@syscore/ui-library 1.27.3 → 2.0.0-beta-publish-workflow-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/client/App.tsx +0 -2
  2. package/client/assets/alert/icon-clear.svg +4 -0
  3. package/client/assets/alert/icon-done.svg +3 -0
  4. package/client/assets/avatar-identity/photo.png +0 -0
  5. package/client/assets/avatar-identity/placeholder-icon.svg +8 -0
  6. package/client/assets/breadcrumb/icon-ellipsis.svg +5 -0
  7. package/client/assets/breadcrumb/icon-home.svg +3 -0
  8. package/client/assets/breadcrumb/icon-separator.svg +3 -0
  9. package/client/assets/button-v01/icon-back.svg +4 -0
  10. package/client/assets/button-v01/icon-check.svg +3 -0
  11. package/client/assets/button-v01/icon-close.svg +4 -0
  12. package/client/assets/button-v01/icon-delete.svg +3 -0
  13. package/client/assets/button-v01/icon-device.svg +3 -0
  14. package/client/assets/dropdown/icon-carrot-contract.svg +3 -0
  15. package/client/assets/dropdown/icon-carrot-expand.svg +3 -0
  16. package/client/assets/dropdown/icon-clear.svg +4 -0
  17. package/client/assets/dropdown/icon-enter.svg +3 -0
  18. package/client/components/icons/UtilityChangeType.tsx +21 -0
  19. package/client/components/ui/alert-dialog-panel.tsx +246 -0
  20. package/client/components/ui/alert-v02.tsx +214 -0
  21. package/client/components/ui/app-bar.tsx +299 -0
  22. package/client/components/ui/avatar-identity.tsx +122 -0
  23. package/client/components/ui/banner.tsx +108 -0
  24. package/client/components/ui/bottom-navigation.tsx +223 -0
  25. package/client/components/ui/breadcrumb-trail.tsx +170 -0
  26. package/client/components/ui/button-v01.tsx +238 -0
  27. package/client/components/ui/button.tsx +2 -0
  28. package/client/components/ui/card.tsx +108 -26
  29. package/client/components/ui/code-badge.tsx +62 -0
  30. package/client/components/ui/date-picker.tsx +188 -0
  31. package/client/components/ui/dropdown.tsx +448 -0
  32. package/client/components/ui/empty-state.tsx +197 -0
  33. package/client/components/ui/file-upload.tsx +214 -0
  34. package/client/components/ui/footer.tsx +179 -0
  35. package/client/components/ui/layout.tsx +1182 -0
  36. package/client/components/ui/pagination-v01.tsx +157 -0
  37. package/client/components/ui/password-field-v01.tsx +67 -0
  38. package/client/components/ui/search-field-v01.tsx +192 -0
  39. package/client/components/ui/section-heading.tsx +49 -0
  40. package/client/components/ui/sidebar.tsx +2 -3
  41. package/client/components/ui/standard-navigation.tsx +8 -2
  42. package/client/components/ui/stepper.tsx +148 -0
  43. package/client/components/ui/switch-v01.tsx +71 -0
  44. package/client/components/ui/system-bar.tsx +119 -0
  45. package/client/components/ui/table-v01.tsx +230 -0
  46. package/client/components/ui/tabs-v01.tsx +99 -0
  47. package/client/components/ui/tag-v02.tsx +113 -0
  48. package/client/components/ui/text-area-v01.tsx +33 -0
  49. package/client/components/ui/text-field-v01.tsx +108 -0
  50. package/client/components/ui/timeline.tsx +181 -0
  51. package/client/components/ui/toast-v01.tsx +206 -0
  52. package/client/components/ui/tooltip.tsx +264 -71
  53. package/client/global.css +9565 -4378
  54. package/client/storybook.css +125 -0
  55. package/client/ui/Accordion.stories.tsx +1 -1
  56. package/client/ui/AlertDialogPanel/AlertDialogPanel.stories.tsx +150 -0
  57. package/client/ui/AlertV02/AlertV02.stories.tsx +188 -0
  58. package/client/ui/AppBar/app-bar.stories.tsx +280 -0
  59. package/client/ui/AspectRatio.stories.tsx +1 -1
  60. package/client/ui/AvatarIdentity/AvatarIdentity.stories.tsx +77 -0
  61. package/client/ui/Banner/banner.stories.tsx +238 -0
  62. package/client/ui/BottomNavigation/bottom-navigation.stories.tsx +285 -0
  63. package/client/ui/BreadcrumbTrail/BreadcrumbTrail.stories.tsx +232 -0
  64. package/client/ui/Button.stories.tsx +1 -1
  65. package/client/ui/ButtonV01/ButtonV01.stories.tsx +417 -0
  66. package/client/ui/Calendar/Calendar.stories.tsx +1 -1
  67. package/client/ui/Card.stories.tsx +285 -168
  68. package/client/ui/Carousel/Carousel.stories.tsx +1 -1
  69. package/client/ui/Chart/Chart.stories.tsx +1 -1
  70. package/client/ui/Checkbox.stories.tsx +1 -1
  71. package/client/ui/Collapsible/Collapsible.stories.tsx +1 -1
  72. package/client/ui/Colors.stories.tsx +1 -1
  73. package/client/ui/Command/Command.stories.tsx +1 -1
  74. package/client/ui/ContextMenu/ContextMenu.stories.tsx +1 -1
  75. package/client/ui/DatePicker/DatePicker.stories.tsx +293 -0
  76. package/client/ui/Dialog.stories.tsx +1 -1
  77. package/client/ui/Drawer/Drawer.stories.tsx +1 -1
  78. package/client/ui/Dropdown/Dropdown.stories.tsx +205 -0
  79. package/client/ui/EmptyState/empty-state.stories.tsx +251 -0
  80. package/client/ui/FileUpload/FileUpload.stories.tsx +218 -0
  81. package/client/ui/Footer/footer.stories.tsx +194 -0
  82. package/client/ui/Form/Form.stories.tsx +1 -1
  83. package/client/ui/Hero.stories.tsx +1 -1
  84. package/client/ui/HoverCard/HoverCard.stories.tsx +1 -1
  85. package/client/ui/Icons.stories.tsx +1 -1
  86. package/client/ui/Input.stories.tsx +1 -1
  87. package/client/ui/InputOTP/InputOTP.stories.tsx +1 -1
  88. package/client/ui/Label.stories.tsx +1 -1
  89. package/client/ui/Layout/Center.stories.tsx +100 -0
  90. package/client/ui/Layout/Columns.stories.tsx +136 -0
  91. package/client/ui/Layout/Container.stories.tsx +104 -0
  92. package/client/ui/Layout/FormLayout.stories.tsx +144 -0
  93. package/client/ui/Layout/Grid.stories.tsx +158 -0
  94. package/client/ui/Layout/GridSpan.stories.tsx +75 -0
  95. package/client/ui/Layout/HStack.stories.tsx +128 -0
  96. package/client/ui/Layout/Layout.stories.tsx +287 -0
  97. package/client/ui/Layout/LayoutContent.stories.tsx +91 -0
  98. package/client/ui/Layout/LayoutFooter.stories.tsx +77 -0
  99. package/client/ui/Layout/LayoutHeader.stories.tsx +104 -0
  100. package/client/ui/Layout/LayoutPanel.stories.tsx +143 -0
  101. package/client/ui/Layout/Positioned.stories.tsx +113 -0
  102. package/client/ui/Layout/Section.stories.tsx +84 -0
  103. package/client/ui/Layout/ShowHide.stories.tsx +99 -0
  104. package/client/ui/Layout/Spacer.stories.tsx +149 -0
  105. package/client/ui/Layout/Stack.stories.tsx +69 -0
  106. package/client/ui/Layout/StackItem.stories.tsx +124 -0
  107. package/client/ui/Layout/VStack.stories.tsx +101 -0
  108. package/client/ui/Layout/controls.ts +33 -0
  109. package/client/ui/Layout/demo.tsx +37 -0
  110. package/client/ui/Menubar/Menubar.stories.tsx +1 -1
  111. package/client/ui/MobileNav.stories.tsx +1 -1
  112. package/client/ui/Navigation.stories.tsx +1 -1
  113. package/client/ui/NavigationMenu/NavigationMenu.stories.tsx +1 -1
  114. package/client/ui/PageHeader.stories.tsx +13 -13
  115. package/client/ui/Pagination/Pagination.stories.tsx +178 -98
  116. package/client/ui/Pagination/PaginationLegacy.stories.tsx +121 -0
  117. package/client/ui/Panel.stories.tsx +1 -1
  118. package/client/ui/Popover/Popover.stories.tsx +1 -1
  119. package/client/ui/Progress/Progress.stories.tsx +1 -1
  120. package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
  121. package/client/ui/Resizable/Resizable.stories.tsx +1 -1
  122. package/client/ui/ScrollArea/ScrollArea.stories.tsx +1 -1
  123. package/client/ui/SearchField/SearchField.stories.tsx +153 -0
  124. package/client/ui/{SearchField.stories.tsx → SearchField/SearchFieldLegacy.stories.tsx} +2 -2
  125. package/client/ui/SectionBadge.stories.tsx +1 -1
  126. package/client/ui/Select.stories.tsx +1 -1
  127. package/client/ui/Separator/Separator.stories.tsx +1 -1
  128. package/client/ui/Sheet/Sheet.stories.tsx +1 -1
  129. package/client/ui/Sidebar/Sidebar.stories.tsx +57 -8
  130. package/client/ui/Skeleton/Skeleton.stories.tsx +1 -1
  131. package/client/ui/Slider/Slider.stories.tsx +1 -1
  132. package/client/ui/StandardNavigation.stories.tsx +1 -1
  133. package/client/ui/Stepper/Stepper.stories.tsx +344 -0
  134. package/client/ui/Switch.stories.tsx +1 -1
  135. package/client/ui/SwitchV01/SwitchV01.stories.tsx +152 -0
  136. package/client/ui/SystemBar/system-bar.stories.tsx +179 -0
  137. package/client/ui/Table/TableV01.stories.tsx +256 -0
  138. package/client/ui/Tabs.stories.tsx +1 -1
  139. package/client/ui/TabsV01/TabsV01.stories.tsx +144 -0
  140. package/client/ui/Tag.stories.tsx +1 -1
  141. package/client/ui/TagV02/TagStatusV02.stories.tsx +132 -0
  142. package/client/ui/TagV02/TagV02.stories.tsx +142 -0
  143. package/client/ui/TextAreaV01/TextAreaV01.stories.tsx +146 -0
  144. package/client/ui/TextFieldV01/PasswordFieldV01.stories.tsx +161 -0
  145. package/client/ui/TextFieldV01/TextFieldV01.stories.tsx +160 -0
  146. package/client/ui/Textarea.stories.tsx +1 -1
  147. package/client/ui/Timeline/timeline.stories.tsx +404 -0
  148. package/client/ui/Toast/Toast.stories.tsx +1 -1
  149. package/client/ui/ToastV01/ToastV01.stories.tsx +201 -0
  150. package/client/ui/Toaster/Toaster.stories.tsx +1 -1
  151. package/client/ui/Toggle.stories.tsx +1 -1
  152. package/client/ui/Tooltip.stories.tsx +287 -114
  153. package/client/ui/Typography.stories.tsx +1 -1
  154. package/dist/index.cjs.js +1 -1
  155. package/dist/index.d.ts +649 -13
  156. package/dist/index.es.js +4405 -653
  157. package/package.json +1 -1
  158. package/client/components/ui/badge.tsx +0 -33
  159. package/client/components/ui/sonner.tsx +0 -26
  160. package/client/components/ui/toggle-group.tsx +0 -76
  161. package/client/ui/Alert/Alert.stories.tsx +0 -82
  162. package/client/ui/AlertDialog/AlertDialog.stories.tsx +0 -106
  163. package/client/ui/Avatar/Avatar.stories.tsx +0 -94
  164. package/client/ui/Badge/Badge.stories.tsx +0 -60
  165. package/client/ui/Breadcrumb/Breadcrumb.stories.tsx +0 -97
  166. package/client/ui/DropdownMenu/DropdownMenu.stories.tsx +0 -139
  167. package/client/ui/Sonner/Sonner.stories.tsx +0 -48
  168. package/client/ui/Table/Table.stories.tsx +0 -135
  169. package/client/ui/ToggleGroup/ToggleGroup.stories.tsx +0 -88
@@ -1,3 +1,128 @@
1
1
  @import "tailwindcss";
2
2
 
3
3
 
4
+
5
+ /* ---------------------------------------------------------------------------
6
+ Story fixtures (Storybook only — never shipped in the library build).
7
+ Token-driven so the frames around layout stories follow the theme instead of
8
+ demonstrating the hardcoded styling the layout docs tell people to avoid.
9
+ --------------------------------------------------------------------------- */
10
+ .sb-shell-frame {
11
+ display: flex;
12
+ flex-direction: column;
13
+ width: 100%;
14
+ height: var(--sb-shell-frame-height, 26.25rem);
15
+ border: 1px solid hsl(var(--border));
16
+ border-radius: var(--radius, 0.75rem);
17
+ overflow: hidden;
18
+ background-color: hsl(var(--background));
19
+ }
20
+
21
+ .sb-demo-box {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ min-height: var(--space-5xl);
26
+ padding-inline: var(--space-sm);
27
+ border: 1px dashed hsl(var(--border));
28
+ border-radius: var(--radius, 0.5rem);
29
+ background-color: hsl(var(--muted));
30
+ color: hsl(var(--muted-foreground));
31
+ font-size: 0.875rem;
32
+ font-weight: 500;
33
+ }
34
+
35
+ .sb-demo-box--tall {
36
+ min-height: var(--space-7xl);
37
+ }
38
+
39
+ /* Fixture accents — the dashed/tinted boxes that make a layout visible. */
40
+ .sb-outline {
41
+ border: 1px dashed hsl(var(--border));
42
+ border-radius: var(--radius, 0.75rem);
43
+ }
44
+
45
+ .sb-fill {
46
+ border: 1px dashed hsl(var(--border));
47
+ border-radius: var(--radius, 0.75rem);
48
+ background-color: hsl(var(--muted));
49
+ }
50
+
51
+ .sb-spacer-fill {
52
+ background-color: hsl(var(--primary) / 0.25);
53
+ border-radius: 2px;
54
+ }
55
+
56
+ /* Follow the token palette so the theme toolbar affects the canvas, not just the components. */
57
+ body {
58
+ background-color: hsl(var(--background));
59
+ color: hsl(var(--foreground));
60
+ }
61
+
62
+ .sb-caption {
63
+ font-size: 0.75rem;
64
+ color: hsl(var(--muted-foreground));
65
+ font-variant-numeric: tabular-nums;
66
+ }
67
+
68
+ .sb-pagination-spec {
69
+ display: flex;
70
+ flex-direction: row;
71
+ align-items: center;
72
+ gap: var(--space-2xl);
73
+ }
74
+
75
+ .sb-pagination-matrix {
76
+ display: flex;
77
+ flex-direction: column;
78
+ gap: var(--space-2xl);
79
+ align-items: flex-start;
80
+ }
81
+
82
+ .sb-pagination-row {
83
+ display: flex;
84
+ align-items: center;
85
+ gap: var(--space-2xl);
86
+ }
87
+
88
+ .sb-pagination-label {
89
+ width: 80px;
90
+ font-size: 18px;
91
+ font-weight: 600;
92
+ line-height: 25.2px;
93
+ color: var(--color-gray-700);
94
+ text-transform: capitalize;
95
+ }
96
+
97
+ /* SearchField spec rows (Storybook only) */
98
+ .sb-searchfield-matrix {
99
+ display: grid;
100
+ gap: var(--space-lg);
101
+ }
102
+
103
+ .sb-searchfield-row {
104
+ display: flex;
105
+ align-items: center;
106
+ gap: var(--space-xl);
107
+ }
108
+
109
+ .sb-searchfield-label {
110
+ min-width: 5rem;
111
+ font-size: 0.75rem;
112
+ text-transform: capitalize;
113
+ color: hsl(var(--muted-foreground));
114
+ }
115
+
116
+ /* Density label above each table in the Table "All variants" story. */
117
+ .sb-table-density-label {
118
+ font-size: 12px;
119
+ font-weight: 600;
120
+ letter-spacing: 0.5px;
121
+ text-transform: uppercase;
122
+ color: hsl(var(--muted-foreground));
123
+ }
124
+
125
+ /* Content-type stories show Figma's three alignment columns at 180px each. */
126
+ .sb-table-triple {
127
+ width: 540px;
128
+ }
@@ -17,7 +17,7 @@ import { CONCEPT_ICONS } from "@/lib/concept-icons";
17
17
  import { Text } from "@/components/ui/typography";
18
18
 
19
19
  const meta = {
20
- title: "Review/Accordion",
20
+ title: "Components/Accordion",
21
21
  component: Accordion,
22
22
  tags: ["autodocs"],
23
23
  parameters: {
@@ -0,0 +1,150 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { AlertDialogPanelSurface } from "../../components/ui/alert-dialog-panel";
3
+
4
+ const meta = {
5
+ title: "Components/Alert Dialog",
6
+ component: AlertDialogPanelSurface,
7
+ tags: ["autodocs"],
8
+ parameters: {
9
+ layout: "centered",
10
+ // The panel's 12px ring is white at 20% opacity and sits outside the fill,
11
+ // so it vanishes on a white canvas — what the 27 Aug review flagged. These
12
+ // stories render the surface inline, so the default background stands in
13
+ // for the modal overlay (`rgba(0, 0, 0, 0.8)`) the dialog really sits on.
14
+ backgrounds: {
15
+ default: "light",
16
+ values: [
17
+ { name: "light", value: "#FFFFFF" },
18
+ { name: "overlay", value: "#282A31" },
19
+ { name: "surface", value: "#71747D" },
20
+ ],
21
+ },
22
+ docs: {
23
+ description: {
24
+ component: [
25
+ "Confirmation dialog.",
26
+ "",
27
+ "Three variants — `default`, `destruction` and `success` — each available at",
28
+ "`medium` (420px) and `small` (320px). Use the **Controls** panel to switch size.",
29
+ "",
30
+ "---",
31
+ "",
32
+ "## Import",
33
+ "",
34
+ "```tsx",
35
+ `import {`,
36
+ ` AlertDialogPanel, AlertDialogPanelSurface,`,
37
+ `} from "@syscore/ui-library"`,
38
+ "```",
39
+ "",
40
+ "## Two components, two jobs",
41
+ "",
42
+ "| Component | Use for |",
43
+ "|-----------|---------|",
44
+ "| `AlertDialogPanel` | The real modal — portal, overlay, focus trap, escape handling |",
45
+ "| `AlertDialogPanelSurface` | The bare panel, rendered inline. Used by the stories below |",
46
+ "",
47
+ "## Props",
48
+ "",
49
+ "| Prop | Values | Default | Effect |",
50
+ "|------|--------|---------|--------|",
51
+ '| `variant` | `"default"` \\| `"destruction"` \\| `"success"` | `"default"` | Surface and confirm-button treatment |',
52
+ '| `size` | `"medium"` \\| `"small"` | `"medium"` | 420px vs 320px wide |',
53
+ "| `title` | `ReactNode` | — | Heading text |",
54
+ "| `description` | `ReactNode` | — | Supporting copy |",
55
+ "| `showDescription` | `boolean` | `true` | Shows or hides the description |",
56
+ '| `cancelLabel` | `ReactNode` | `"Cancel"` | Left (dismiss) button |',
57
+ '| `actionLabel` | `ReactNode` | `"Confirm"` | Right (confirm) button |',
58
+ "| `onCancel` / `onAction` | `() => void` | — | Button handlers |",
59
+ "| `trigger` | `ReactNode` | — | Element that opens the modal |",
60
+ "",
61
+ "## Sizing behaviour",
62
+ "",
63
+ "At `medium` the two buttons split the row equally. At `small` they hug their",
64
+ "labels and centre as a group.",
65
+ "",
66
+ "## Using it as a modal",
67
+ "",
68
+ "The stories below render the surface inline so the design is visible. In an",
69
+ "app, use `AlertDialogPanel` for a real dialog:",
70
+ "",
71
+ "```tsx",
72
+ "const [open, setOpen] = useState(false)",
73
+ "",
74
+ "<AlertDialogPanel",
75
+ " open={open}",
76
+ " onOpenChange={setOpen}",
77
+ ` variant="destruction"`,
78
+ ` size="medium"`,
79
+ ` title="Are you sure?"`,
80
+ ` description="This action cannot be undone."`,
81
+ ` cancelLabel="Cancel"`,
82
+ ` actionLabel="Delete"`,
83
+ " onAction={handleDelete}",
84
+ ` trigger={<Button variant="general-primary">Delete item</Button>}`,
85
+ "/>",
86
+ "```",
87
+ ].join("\n"),
88
+ },
89
+ },
90
+ },
91
+ argTypes: {
92
+ variant: {
93
+ control: "select",
94
+ options: ["default", "destruction", "success"],
95
+ },
96
+ size: { control: "select", options: ["medium", "small"] },
97
+ showDescription: { control: "boolean" },
98
+ title: { control: "text" },
99
+ description: { control: "text" },
100
+ cancelLabel: { control: "text" },
101
+ actionLabel: { control: "text" },
102
+ asPrimitive: { table: { disable: true } },
103
+ },
104
+ } satisfies Meta<typeof AlertDialogPanelSurface>;
105
+
106
+ export default meta;
107
+ type Story = StoryObj<typeof meta>;
108
+
109
+ // ─── Default ──────────────────────────────────────────────────────────────────
110
+ // Neutral confirmation. Switch `size` in the Controls panel.
111
+
112
+ export const Default: Story = {
113
+ args: {
114
+ variant: "default",
115
+ size: "medium",
116
+ title: "Confirm Action",
117
+ description: "Are you sure you want to proceed with this action?",
118
+ cancelLabel: "Cancel",
119
+ actionLabel: "Confirm",
120
+ },
121
+ };
122
+
123
+ // ─── Destructive ──────────────────────────────────────────────────────────────
124
+ // Irreversible action. Confirm button uses the coral treatment.
125
+
126
+ export const Destructive: Story = {
127
+ args: {
128
+ variant: "destruction",
129
+ size: "medium",
130
+ title: "Are you sure?",
131
+ description:
132
+ "This action cannot be undone. This will permanently delete the item.",
133
+ cancelLabel: "Cancel",
134
+ actionLabel: "Delete",
135
+ },
136
+ };
137
+
138
+ // ─── Success ──────────────────────────────────────────────────────────────────
139
+ // Positive confirmation on the gradient surface.
140
+
141
+ export const Success: Story = {
142
+ args: {
143
+ variant: "success",
144
+ size: "medium",
145
+ title: "Success!",
146
+ description: "Link sent! Check your inbox 📥",
147
+ cancelLabel: "Send link again",
148
+ actionLabel: "Try another email",
149
+ },
150
+ };
@@ -0,0 +1,188 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { AlertV02 } from "../../components/ui/alert-v02";
3
+ import samplePhoto from "../../assets/avatar-identity/photo.png";
4
+
5
+ const LOREM =
6
+ "Lorem ipsum dolor sit amet consectetur adipiscing elit. Sit amet consectetur adipiscing elit quisque faucibus ex. Adipiscing elit quisque faucibus ex sapien vitae pellentesque.";
7
+
8
+ const appearances = ["solid", "subtle", "outline"] as const;
9
+ const colors = ["default", "success", "error"] as const;
10
+ const sizes = ["large", "small"] as const;
11
+ const indicators = ["icon", "avatar"] as const;
12
+
13
+ const meta = {
14
+ title: "Components/Alert",
15
+ component: AlertV02,
16
+ tags: ["autodocs"],
17
+ parameters: {
18
+ layout: "centered",
19
+ docs: {
20
+ description: {
21
+ component: [
22
+ "Inline alert. Existing `UI/Alert` is unchanged.",
23
+ "",
24
+ "Stories are the semantic states: **Default**, **Success**, **Error**.",
25
+ "Use **Controls** for appearance (solid / subtle / outline), size, and indicator.",
26
+ "All Variants shows the full set of **36**.",
27
+ "",
28
+ "---",
29
+ "",
30
+ "## Import",
31
+ "",
32
+ "```tsx",
33
+ `import { AlertV02 } from "@syscore/ui-library"`,
34
+ "```",
35
+ "",
36
+ "## How to use",
37
+ "",
38
+ "Pick `color` for meaning. Use `variant`, `size`, and `indicator` for presentation.",
39
+ "Handle Confirm, Cancel, and dismiss with the callbacks — do not navigate from the",
40
+ "heading itself.",
41
+ "",
42
+ "```tsx",
43
+ "const [visible, setVisible] = useState(true)",
44
+ "",
45
+ "visible ? (",
46
+ " <AlertV02",
47
+ ` color="error"`,
48
+ ` variant="solid"`,
49
+ ` size="large"`,
50
+ ` indicator="icon"`,
51
+ ` title="Could not save changes"`,
52
+ ` description="Check the required fields and try again."`,
53
+ ` confirmLabel="Retry"`,
54
+ ` cancelLabel="Cancel"`,
55
+ " onConfirm={handleRetry}",
56
+ " onCancel={() => setVisible(false)}",
57
+ " onDismiss={() => setVisible(false)}",
58
+ " />",
59
+ ") : null",
60
+ "```",
61
+ "",
62
+ "| Situation | Use |",
63
+ "|-----------|-----|",
64
+ "| Neutral notice | `color=\"default\"` |",
65
+ "| Positive confirmation | `color=\"success\"` |",
66
+ "| Failure / blocking problem | `color=\"error\"` |",
67
+ "| Compact toolbar / inline row | `size=\"small\"` (heading + Confirm only) |",
68
+ "| Person-specific message | `indicator=\"avatar\"` and `avatarSrc` |",
69
+ "",
70
+ "## Props",
71
+ "",
72
+ "| Prop | Values | Default | Effect |",
73
+ "|------|--------|---------|--------|",
74
+ "| `color` | `\"default\"` \\| `\"success\"` \\| `\"error\"` | `\"default\"` | Semantic state (stories) |",
75
+ "| `variant` | `\"solid\"` \\| `\"subtle\"` \\| `\"outline\"` | `\"solid\"` | Surface treatment |",
76
+ "| `size` | `\"large\"` \\| `\"small\"` | `\"large\"` | Stacked copy + two actions vs compact row |",
77
+ "| `indicator` | `\"icon\"` \\| `\"avatar\"` | `\"icon\"` | Leading checkmark or 32px avatar |",
78
+ "| `action` | `boolean` | `true` | Confirm (and Cancel on large) |",
79
+ "| `title` | `ReactNode` | — | Heading |",
80
+ "| `description` | `ReactNode` | — | Body copy (large only) |",
81
+ ].join("\n"),
82
+ },
83
+ },
84
+ },
85
+ argTypes: {
86
+ variant: {
87
+ name: "Appearance",
88
+ control: "select",
89
+ options: [...appearances],
90
+ },
91
+ size: { control: "select", options: [...sizes] },
92
+ indicator: { control: "select", options: [...indicators] },
93
+ action: { control: "boolean" },
94
+ title: { control: "text" },
95
+ description: { control: "text" },
96
+ confirmLabel: { control: "text" },
97
+ cancelLabel: { control: "text" },
98
+ avatarSrc: { control: "text" },
99
+ color: { table: { disable: true } },
100
+ },
101
+ args: {
102
+ variant: "solid",
103
+ size: "large",
104
+ indicator: "icon",
105
+ action: true,
106
+ title: "Alert Heading",
107
+ description: LOREM,
108
+ confirmLabel: "Confirm",
109
+ cancelLabel: "Cancel",
110
+ avatarSrc: samplePhoto,
111
+ },
112
+ } satisfies Meta<typeof AlertV02>;
113
+
114
+ export default meta;
115
+ type Story = StoryObj<typeof meta>;
116
+
117
+ export const Default: Story = {
118
+ args: { color: "default" },
119
+ };
120
+
121
+ export const Success: Story = {
122
+ args: { color: "success" },
123
+ };
124
+
125
+ export const Error: Story = {
126
+ args: { color: "error" },
127
+ };
128
+
129
+ export const AllVariants: Story = {
130
+ name: "All Variants",
131
+ render: (args) => (
132
+ <div
133
+ style={{
134
+ display: "grid",
135
+ gap: 40,
136
+ width: "min(100%, 1200px)",
137
+ }}
138
+ >
139
+ {sizes.flatMap((size) =>
140
+ indicators.map((indicator) => (
141
+ <section key={`${size}-${indicator}`}>
142
+ <h3
143
+ style={{
144
+ margin: "0 0 16px",
145
+ fontSize: 14,
146
+ fontWeight: 600,
147
+ textTransform: "uppercase",
148
+ letterSpacing: 0.5,
149
+ color: "#52545d",
150
+ }}
151
+ >
152
+ {size} · {indicator}
153
+ </h3>
154
+ <div
155
+ style={{
156
+ display: "grid",
157
+ gridTemplateColumns: "repeat(3, minmax(0, 360px))",
158
+ gap: 16,
159
+ }}
160
+ >
161
+ {appearances.flatMap((variant) =>
162
+ colors.map((color) => (
163
+ <AlertV02
164
+ key={`${size}-${indicator}-${variant}-${color}`}
165
+ {...args}
166
+ size={size}
167
+ indicator={indicator}
168
+ variant={variant}
169
+ color={color}
170
+ title="Alert Heading"
171
+ description={LOREM}
172
+ avatarSrc={samplePhoto}
173
+ />
174
+ )),
175
+ )}
176
+ </div>
177
+ </section>
178
+ )),
179
+ )}
180
+ </div>
181
+ ),
182
+ argTypes: {
183
+ variant: { table: { disable: true } },
184
+ size: { table: { disable: true } },
185
+ indicator: { table: { disable: true } },
186
+ },
187
+ parameters: { layout: "padded" },
188
+ };