From 77e529c0b75e105e868661fe6e98506c33ab54c9 Mon Sep 17 00:00:00 2001 From: Arno V Date: Tue, 27 Feb 2024 19:05:19 -0500 Subject: [PATCH] docs: better release tags information (#365) ## Summary by CodeRabbit - **New Features** - Introduced a component variant and release tag rendering based on the stage parameter. - Added support for light and dark mode styling. - Enhanced the Getting Started documentation with a new section explaining component stages, including visual indicators. - **Documentation** - Updated the Getting Started guide with examples and explanations of component stages using a new layout and visual components. --- packages/documentation/.ladle/components.tsx | 26 ++++++++++---- packages/documentation/.ladle/styles.css | 15 ++++++++ .../GettingStarted/5-alpha-beta.stories.tsx | 35 ++++++++++++++++--- 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/packages/documentation/.ladle/components.tsx b/packages/documentation/.ladle/components.tsx index db7f734c..e3468f69 100644 --- a/packages/documentation/.ladle/components.tsx +++ b/packages/documentation/.ladle/components.tsx @@ -8,19 +8,31 @@ import { IconGitHub } from "@versini/ui-icons"; import clsx from "clsx"; const renderImportLine = (importName: string, stage?: string) => { - const releaseTag = stage ? stage : "alpha"; + let variant: "information" | "warning" | "success", releaseTag; + + switch (stage) { + case "beta": + variant = "information"; + releaseTag = "beta"; + break; + case "stable": + variant = "success"; + releaseTag = "stable"; + break; + default: + variant = "warning"; + releaseTag = "alpha"; + break; + } + return (
- +

{importName}

- +
diff --git a/packages/documentation/.ladle/styles.css b/packages/documentation/.ladle/styles.css index c80906de..6bc7f444 100644 --- a/packages/documentation/.ladle/styles.css +++ b/packages/documentation/.ladle/styles.css @@ -7,3 +7,18 @@ @apply m-0 !important; } } + +/* @media (prefers-color-scheme: light) { + html, + body, + .ladle-background { + background-color: white; + } +} +@media (prefers-color-scheme: dark) { + html, + body, + .ladle-background { + background-color: rgb(100 116 139); + } +} */ diff --git a/packages/documentation/src/GettingStarted/5-alpha-beta.stories.tsx b/packages/documentation/src/GettingStarted/5-alpha-beta.stories.tsx index 45b91867..f26e698f 100644 --- a/packages/documentation/src/GettingStarted/5-alpha-beta.stories.tsx +++ b/packages/documentation/src/GettingStarted/5-alpha-beta.stories.tsx @@ -1,5 +1,7 @@ +/* eslint-disable react/no-unescaped-entities */ + import { linkTo, Story } from "@ladle/react"; -import { ButtonIcon } from "@versini/ui-components"; +import { ButtonIcon, Pill } from "@versini/ui-components"; import { IconPrevious } from "@versini/ui-icons"; import { Flexgrid, FlexgridItem } from "@versini/ui-system"; @@ -17,8 +19,19 @@ export const ReleaseTags: Story = () => ( help consuming partners, we are applying tags per components: alpha, then beta and finally stable.

+

+ Component stage is indicated by a little "pill" located to the right of + the component title. +

-

Alpha

+ + +

Alpha

+
+ + + +
  • Alpha components are in the early stages of @@ -33,7 +46,14 @@ export const ReleaseTags: Story = () => (
-

Beta

+ + +

Beta

+
+ + + +
  • Beta components can be deployed to production. @@ -50,7 +70,14 @@ export const ReleaseTags: Story = () => (
-

Stable

+ + +

Stable

+
+ + + +
  • Stable components can be deployed to