@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.
- package/client/App.tsx +0 -2
- package/client/assets/alert/icon-clear.svg +4 -0
- package/client/assets/alert/icon-done.svg +3 -0
- package/client/assets/avatar-identity/photo.png +0 -0
- package/client/assets/avatar-identity/placeholder-icon.svg +8 -0
- package/client/assets/breadcrumb/icon-ellipsis.svg +5 -0
- package/client/assets/breadcrumb/icon-home.svg +3 -0
- package/client/assets/breadcrumb/icon-separator.svg +3 -0
- package/client/assets/button-v01/icon-back.svg +4 -0
- package/client/assets/button-v01/icon-check.svg +3 -0
- package/client/assets/button-v01/icon-close.svg +4 -0
- package/client/assets/button-v01/icon-delete.svg +3 -0
- package/client/assets/button-v01/icon-device.svg +3 -0
- package/client/assets/dropdown/icon-carrot-contract.svg +3 -0
- package/client/assets/dropdown/icon-carrot-expand.svg +3 -0
- package/client/assets/dropdown/icon-clear.svg +4 -0
- package/client/assets/dropdown/icon-enter.svg +3 -0
- package/client/components/icons/UtilityChangeType.tsx +21 -0
- package/client/components/ui/alert-dialog-panel.tsx +246 -0
- package/client/components/ui/alert-v02.tsx +214 -0
- package/client/components/ui/app-bar.tsx +299 -0
- package/client/components/ui/avatar-identity.tsx +122 -0
- package/client/components/ui/banner.tsx +108 -0
- package/client/components/ui/bottom-navigation.tsx +223 -0
- package/client/components/ui/breadcrumb-trail.tsx +170 -0
- package/client/components/ui/button-v01.tsx +238 -0
- package/client/components/ui/button.tsx +2 -0
- package/client/components/ui/card.tsx +108 -26
- package/client/components/ui/code-badge.tsx +62 -0
- package/client/components/ui/date-picker.tsx +188 -0
- package/client/components/ui/dropdown.tsx +448 -0
- package/client/components/ui/empty-state.tsx +197 -0
- package/client/components/ui/file-upload.tsx +214 -0
- package/client/components/ui/footer.tsx +179 -0
- package/client/components/ui/layout.tsx +1182 -0
- package/client/components/ui/pagination-v01.tsx +157 -0
- package/client/components/ui/password-field-v01.tsx +67 -0
- package/client/components/ui/search-field-v01.tsx +192 -0
- package/client/components/ui/section-heading.tsx +49 -0
- package/client/components/ui/sidebar.tsx +2 -3
- package/client/components/ui/standard-navigation.tsx +8 -2
- package/client/components/ui/stepper.tsx +148 -0
- package/client/components/ui/switch-v01.tsx +71 -0
- package/client/components/ui/system-bar.tsx +119 -0
- package/client/components/ui/table-v01.tsx +230 -0
- package/client/components/ui/tabs-v01.tsx +99 -0
- package/client/components/ui/tag-v02.tsx +113 -0
- package/client/components/ui/text-area-v01.tsx +33 -0
- package/client/components/ui/text-field-v01.tsx +108 -0
- package/client/components/ui/timeline.tsx +181 -0
- package/client/components/ui/toast-v01.tsx +206 -0
- package/client/components/ui/tooltip.tsx +264 -71
- package/client/global.css +9565 -4378
- package/client/storybook.css +125 -0
- package/client/ui/Accordion.stories.tsx +1 -1
- package/client/ui/AlertDialogPanel/AlertDialogPanel.stories.tsx +150 -0
- package/client/ui/AlertV02/AlertV02.stories.tsx +188 -0
- package/client/ui/AppBar/app-bar.stories.tsx +280 -0
- package/client/ui/AspectRatio.stories.tsx +1 -1
- package/client/ui/AvatarIdentity/AvatarIdentity.stories.tsx +77 -0
- package/client/ui/Banner/banner.stories.tsx +238 -0
- package/client/ui/BottomNavigation/bottom-navigation.stories.tsx +285 -0
- package/client/ui/BreadcrumbTrail/BreadcrumbTrail.stories.tsx +232 -0
- package/client/ui/Button.stories.tsx +1 -1
- package/client/ui/ButtonV01/ButtonV01.stories.tsx +417 -0
- package/client/ui/Calendar/Calendar.stories.tsx +1 -1
- package/client/ui/Card.stories.tsx +285 -168
- package/client/ui/Carousel/Carousel.stories.tsx +1 -1
- package/client/ui/Chart/Chart.stories.tsx +1 -1
- package/client/ui/Checkbox.stories.tsx +1 -1
- package/client/ui/Collapsible/Collapsible.stories.tsx +1 -1
- package/client/ui/Colors.stories.tsx +1 -1
- package/client/ui/Command/Command.stories.tsx +1 -1
- package/client/ui/ContextMenu/ContextMenu.stories.tsx +1 -1
- package/client/ui/DatePicker/DatePicker.stories.tsx +293 -0
- package/client/ui/Dialog.stories.tsx +1 -1
- package/client/ui/Drawer/Drawer.stories.tsx +1 -1
- package/client/ui/Dropdown/Dropdown.stories.tsx +205 -0
- package/client/ui/EmptyState/empty-state.stories.tsx +251 -0
- package/client/ui/FileUpload/FileUpload.stories.tsx +218 -0
- package/client/ui/Footer/footer.stories.tsx +194 -0
- package/client/ui/Form/Form.stories.tsx +1 -1
- package/client/ui/Hero.stories.tsx +1 -1
- package/client/ui/HoverCard/HoverCard.stories.tsx +1 -1
- package/client/ui/Icons.stories.tsx +1 -1
- package/client/ui/Input.stories.tsx +1 -1
- package/client/ui/InputOTP/InputOTP.stories.tsx +1 -1
- package/client/ui/Label.stories.tsx +1 -1
- package/client/ui/Layout/Center.stories.tsx +100 -0
- package/client/ui/Layout/Columns.stories.tsx +136 -0
- package/client/ui/Layout/Container.stories.tsx +104 -0
- package/client/ui/Layout/FormLayout.stories.tsx +144 -0
- package/client/ui/Layout/Grid.stories.tsx +158 -0
- package/client/ui/Layout/GridSpan.stories.tsx +75 -0
- package/client/ui/Layout/HStack.stories.tsx +128 -0
- package/client/ui/Layout/Layout.stories.tsx +287 -0
- package/client/ui/Layout/LayoutContent.stories.tsx +91 -0
- package/client/ui/Layout/LayoutFooter.stories.tsx +77 -0
- package/client/ui/Layout/LayoutHeader.stories.tsx +104 -0
- package/client/ui/Layout/LayoutPanel.stories.tsx +143 -0
- package/client/ui/Layout/Positioned.stories.tsx +113 -0
- package/client/ui/Layout/Section.stories.tsx +84 -0
- package/client/ui/Layout/ShowHide.stories.tsx +99 -0
- package/client/ui/Layout/Spacer.stories.tsx +149 -0
- package/client/ui/Layout/Stack.stories.tsx +69 -0
- package/client/ui/Layout/StackItem.stories.tsx +124 -0
- package/client/ui/Layout/VStack.stories.tsx +101 -0
- package/client/ui/Layout/controls.ts +33 -0
- package/client/ui/Layout/demo.tsx +37 -0
- package/client/ui/Menubar/Menubar.stories.tsx +1 -1
- package/client/ui/MobileNav.stories.tsx +1 -1
- package/client/ui/Navigation.stories.tsx +1 -1
- package/client/ui/NavigationMenu/NavigationMenu.stories.tsx +1 -1
- package/client/ui/PageHeader.stories.tsx +13 -13
- package/client/ui/Pagination/Pagination.stories.tsx +178 -98
- package/client/ui/Pagination/PaginationLegacy.stories.tsx +121 -0
- package/client/ui/Panel.stories.tsx +1 -1
- package/client/ui/Popover/Popover.stories.tsx +1 -1
- package/client/ui/Progress/Progress.stories.tsx +1 -1
- package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/client/ui/Resizable/Resizable.stories.tsx +1 -1
- package/client/ui/ScrollArea/ScrollArea.stories.tsx +1 -1
- package/client/ui/SearchField/SearchField.stories.tsx +153 -0
- package/client/ui/{SearchField.stories.tsx → SearchField/SearchFieldLegacy.stories.tsx} +2 -2
- package/client/ui/SectionBadge.stories.tsx +1 -1
- package/client/ui/Select.stories.tsx +1 -1
- package/client/ui/Separator/Separator.stories.tsx +1 -1
- package/client/ui/Sheet/Sheet.stories.tsx +1 -1
- package/client/ui/Sidebar/Sidebar.stories.tsx +57 -8
- package/client/ui/Skeleton/Skeleton.stories.tsx +1 -1
- package/client/ui/Slider/Slider.stories.tsx +1 -1
- package/client/ui/StandardNavigation.stories.tsx +1 -1
- package/client/ui/Stepper/Stepper.stories.tsx +344 -0
- package/client/ui/Switch.stories.tsx +1 -1
- package/client/ui/SwitchV01/SwitchV01.stories.tsx +152 -0
- package/client/ui/SystemBar/system-bar.stories.tsx +179 -0
- package/client/ui/Table/TableV01.stories.tsx +256 -0
- package/client/ui/Tabs.stories.tsx +1 -1
- package/client/ui/TabsV01/TabsV01.stories.tsx +144 -0
- package/client/ui/Tag.stories.tsx +1 -1
- package/client/ui/TagV02/TagStatusV02.stories.tsx +132 -0
- package/client/ui/TagV02/TagV02.stories.tsx +142 -0
- package/client/ui/TextAreaV01/TextAreaV01.stories.tsx +146 -0
- package/client/ui/TextFieldV01/PasswordFieldV01.stories.tsx +161 -0
- package/client/ui/TextFieldV01/TextFieldV01.stories.tsx +160 -0
- package/client/ui/Textarea.stories.tsx +1 -1
- package/client/ui/Timeline/timeline.stories.tsx +404 -0
- package/client/ui/Toast/Toast.stories.tsx +1 -1
- package/client/ui/ToastV01/ToastV01.stories.tsx +201 -0
- package/client/ui/Toaster/Toaster.stories.tsx +1 -1
- package/client/ui/Toggle.stories.tsx +1 -1
- package/client/ui/Tooltip.stories.tsx +287 -114
- package/client/ui/Typography.stories.tsx +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +649 -13
- package/dist/index.es.js +4405 -653
- package/package.json +1 -1
- package/client/components/ui/badge.tsx +0 -33
- package/client/components/ui/sonner.tsx +0 -26
- package/client/components/ui/toggle-group.tsx +0 -76
- package/client/ui/Alert/Alert.stories.tsx +0 -82
- package/client/ui/AlertDialog/AlertDialog.stories.tsx +0 -106
- package/client/ui/Avatar/Avatar.stories.tsx +0 -94
- package/client/ui/Badge/Badge.stories.tsx +0 -60
- package/client/ui/Breadcrumb/Breadcrumb.stories.tsx +0 -97
- package/client/ui/DropdownMenu/DropdownMenu.stories.tsx +0 -139
- package/client/ui/Sonner/Sonner.stories.tsx +0 -48
- package/client/ui/Table/Table.stories.tsx +0 -135
- package/client/ui/ToggleGroup/ToggleGroup.stories.tsx +0 -88
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Stack } from "../../components/ui/layout";
|
|
3
|
+
import { DemoBox, LAYOUT_DOCS_RULE } from "./demo";
|
|
4
|
+
import {
|
|
5
|
+
alignControl,
|
|
6
|
+
hiddenArgs,
|
|
7
|
+
justifyControl,
|
|
8
|
+
spaceControl,
|
|
9
|
+
} from "./controls";
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "Components/Layout/Stack",
|
|
13
|
+
component: Stack,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: "padded",
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component: [
|
|
20
|
+
"Unified stack. Use when direction is dynamic. Otherwise prefer `HStack` or `VStack`.",
|
|
21
|
+
"",
|
|
22
|
+
LAYOUT_DOCS_RULE,
|
|
23
|
+
"",
|
|
24
|
+
"```tsx",
|
|
25
|
+
`import { Stack } from "@syscore/ui-library"`,
|
|
26
|
+
"",
|
|
27
|
+
'<Stack direction="vertical" gap="md">…</Stack>',
|
|
28
|
+
'<Stack direction="horizontal" gap="md" align="center">…</Stack>',
|
|
29
|
+
"```",
|
|
30
|
+
].join("\n"),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
argTypes: {
|
|
35
|
+
...hiddenArgs,
|
|
36
|
+
direction: { control: "inline-radio", options: ["vertical", "horizontal"] },
|
|
37
|
+
gap: spaceControl,
|
|
38
|
+
padding: spaceControl,
|
|
39
|
+
align: alignControl,
|
|
40
|
+
justify: justifyControl,
|
|
41
|
+
wrap: { control: "boolean" },
|
|
42
|
+
isScrollable: { control: "boolean" },
|
|
43
|
+
},
|
|
44
|
+
} satisfies Meta<typeof Stack>;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
|
|
49
|
+
export const Default: Story = {
|
|
50
|
+
args: { direction: "vertical", gap: "md" },
|
|
51
|
+
render: (args) => (
|
|
52
|
+
<Stack {...args} maxWidth={args.direction === "vertical" ? 384 : undefined}>
|
|
53
|
+
<DemoBox label="Item 1" />
|
|
54
|
+
<DemoBox label="Item 2" />
|
|
55
|
+
<DemoBox label="Item 3" />
|
|
56
|
+
</Stack>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Horizontal: Story = {
|
|
61
|
+
args: { direction: "horizontal", gap: "md", align: "center" },
|
|
62
|
+
render: (args) => (
|
|
63
|
+
<Stack {...args}>
|
|
64
|
+
<DemoBox label="Item 1" />
|
|
65
|
+
<DemoBox label="Item 2" />
|
|
66
|
+
<DemoBox label="Item 3" />
|
|
67
|
+
</Stack>
|
|
68
|
+
),
|
|
69
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { HStack, StackItem, VStack } from "../../components/ui/layout";
|
|
3
|
+
import { DemoBox, LAYOUT_DOCS_RULE } from "./demo";
|
|
4
|
+
import { hiddenArgs } from "./controls";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Layout/StackItem",
|
|
8
|
+
component: StackItem,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "padded",
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: [
|
|
15
|
+
"Child of `HStack` / `VStack` / `Stack`. Controls grow and scroll without Tailwind `flex-1`.",
|
|
16
|
+
"",
|
|
17
|
+
LAYOUT_DOCS_RULE,
|
|
18
|
+
"",
|
|
19
|
+
"```tsx",
|
|
20
|
+
`import { HStack, StackItem } from "@syscore/ui-library"`,
|
|
21
|
+
"",
|
|
22
|
+
"<HStack>",
|
|
23
|
+
" <StackItem>Logo</StackItem>",
|
|
24
|
+
' <StackItem size="fill">Content</StackItem>',
|
|
25
|
+
" <StackItem>Actions</StackItem>",
|
|
26
|
+
"</HStack>",
|
|
27
|
+
"```",
|
|
28
|
+
"",
|
|
29
|
+
"| `size` | Effect |",
|
|
30
|
+
"|--------|--------|",
|
|
31
|
+
"| `static` (default) | Intrinsic size, no grow |",
|
|
32
|
+
"| `fill` | Grows to fill remaining space |",
|
|
33
|
+
"",
|
|
34
|
+
"`isScrollable` makes a filling item scroll internally — the pattern behind a fixed header and footer with a scrolling middle. `alignSelf` overrides the stack's `align` for one child.",
|
|
35
|
+
].join("\n"),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
argTypes: {
|
|
40
|
+
...hiddenArgs,
|
|
41
|
+
size: { control: "inline-radio", options: ["static", "fill"] },
|
|
42
|
+
isScrollable: { control: "boolean" },
|
|
43
|
+
alignSelf: {
|
|
44
|
+
control: "select",
|
|
45
|
+
options: ["start", "center", "end", "stretch", "baseline"],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
args: { size: "fill" },
|
|
49
|
+
} satisfies Meta<typeof StackItem>;
|
|
50
|
+
|
|
51
|
+
export default meta;
|
|
52
|
+
type Story = StoryObj<typeof meta>;
|
|
53
|
+
|
|
54
|
+
export const Default: Story = {
|
|
55
|
+
name: "Fill remaining space",
|
|
56
|
+
render: (args) => (
|
|
57
|
+
<HStack width="100%" gap="sm">
|
|
58
|
+
<StackItem>
|
|
59
|
+
<DemoBox label="Logo" />
|
|
60
|
+
</StackItem>
|
|
61
|
+
<StackItem {...args}>
|
|
62
|
+
<DemoBox label="Fills remaining space" />
|
|
63
|
+
</StackItem>
|
|
64
|
+
<StackItem>
|
|
65
|
+
<DemoBox label="Actions" />
|
|
66
|
+
</StackItem>
|
|
67
|
+
</HStack>
|
|
68
|
+
),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const FillAndScroll: Story = {
|
|
72
|
+
name: "Fill and scroll",
|
|
73
|
+
args: { size: "fill", isScrollable: true },
|
|
74
|
+
parameters: {
|
|
75
|
+
docs: {
|
|
76
|
+
description: {
|
|
77
|
+
story:
|
|
78
|
+
"Static header and footer with a scrolling middle — the same shape as `Layout`, at component scale.",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
render: (args) => (
|
|
83
|
+
<VStack height={240} gap={0} width="100%" maxWidth={480}>
|
|
84
|
+
<StackItem>
|
|
85
|
+
<DemoBox label="Header (static)" />
|
|
86
|
+
</StackItem>
|
|
87
|
+
<StackItem {...args}>
|
|
88
|
+
<VStack gap="sm" padding="sm">
|
|
89
|
+
{Array.from({ length: 8 }, (_, i) => (
|
|
90
|
+
<DemoBox key={i} label={`Row ${i + 1}`} />
|
|
91
|
+
))}
|
|
92
|
+
</VStack>
|
|
93
|
+
</StackItem>
|
|
94
|
+
<StackItem>
|
|
95
|
+
<DemoBox label="Footer (static)" />
|
|
96
|
+
</StackItem>
|
|
97
|
+
</VStack>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const AlignSelf: Story = {
|
|
102
|
+
name: "Align self",
|
|
103
|
+
args: { size: "static", alignSelf: "end" },
|
|
104
|
+
parameters: {
|
|
105
|
+
docs: {
|
|
106
|
+
description: {
|
|
107
|
+
story: "One child opts out of the stack's `align`.",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
render: (args) => (
|
|
112
|
+
<HStack width="100%" gap="sm" align="start" height={120}>
|
|
113
|
+
<StackItem>
|
|
114
|
+
<DemoBox label="align: start" />
|
|
115
|
+
</StackItem>
|
|
116
|
+
<StackItem {...args}>
|
|
117
|
+
<DemoBox label="alignSelf" />
|
|
118
|
+
</StackItem>
|
|
119
|
+
<StackItem>
|
|
120
|
+
<DemoBox label="align: start" />
|
|
121
|
+
</StackItem>
|
|
122
|
+
</HStack>
|
|
123
|
+
),
|
|
124
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { VStack } from "../../components/ui/layout";
|
|
3
|
+
import { DemoBox, LAYOUT_DOCS_RULE } from "./demo";
|
|
4
|
+
import {
|
|
5
|
+
alignControl,
|
|
6
|
+
hiddenArgs,
|
|
7
|
+
justifyControl,
|
|
8
|
+
spaceControl,
|
|
9
|
+
} from "./controls";
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "Components/Layout/VStack",
|
|
13
|
+
component: VStack,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: "padded",
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component: [
|
|
20
|
+
"Vertical stack. Arranges children top to bottom with a consistent gap.",
|
|
21
|
+
"",
|
|
22
|
+
LAYOUT_DOCS_RULE,
|
|
23
|
+
"",
|
|
24
|
+
"```tsx",
|
|
25
|
+
`import { VStack } from "@syscore/ui-library"`,
|
|
26
|
+
"",
|
|
27
|
+
'<VStack gap="md">',
|
|
28
|
+
" <Item />",
|
|
29
|
+
" <Item />",
|
|
30
|
+
"</VStack>",
|
|
31
|
+
"```",
|
|
32
|
+
"",
|
|
33
|
+
"`align` is the cross axis (horizontal here), `justify` the main axis. This is the default direction of `Stack` — prefer `VStack` when the axis is known.",
|
|
34
|
+
].join("\n"),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
argTypes: {
|
|
39
|
+
...hiddenArgs,
|
|
40
|
+
gap: spaceControl,
|
|
41
|
+
padding: spaceControl,
|
|
42
|
+
align: alignControl,
|
|
43
|
+
justify: justifyControl,
|
|
44
|
+
isScrollable: { control: "boolean" },
|
|
45
|
+
},
|
|
46
|
+
args: {
|
|
47
|
+
gap: "md",
|
|
48
|
+
maxWidth: 384,
|
|
49
|
+
},
|
|
50
|
+
} satisfies Meta<typeof VStack>;
|
|
51
|
+
|
|
52
|
+
export default meta;
|
|
53
|
+
type Story = StoryObj<typeof meta>;
|
|
54
|
+
|
|
55
|
+
export const Default: Story = {
|
|
56
|
+
render: (args) => (
|
|
57
|
+
<VStack {...args}>
|
|
58
|
+
<DemoBox label="Item 1" />
|
|
59
|
+
<DemoBox label="Item 2" />
|
|
60
|
+
<DemoBox label="Item 3" />
|
|
61
|
+
</VStack>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Centered: Story = {
|
|
66
|
+
args: { align: "center" },
|
|
67
|
+
parameters: {
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
story:
|
|
71
|
+
'`align="center"` centres each child on the cross axis without stretching it.',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
render: (args) => (
|
|
76
|
+
<VStack {...args}>
|
|
77
|
+
<DemoBox label="Item 1" />
|
|
78
|
+
<DemoBox label="Item 2" />
|
|
79
|
+
<DemoBox label="Item 3" />
|
|
80
|
+
</VStack>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Scrollable: Story = {
|
|
85
|
+
args: { gap: "sm", isScrollable: true, height: 220, padding: "sm" },
|
|
86
|
+
parameters: {
|
|
87
|
+
docs: {
|
|
88
|
+
description: {
|
|
89
|
+
story:
|
|
90
|
+
"`isScrollable` with a fixed `height` scrolls the stack instead of the page.",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
render: (args) => (
|
|
95
|
+
<VStack {...args}>
|
|
96
|
+
{Array.from({ length: 10 }, (_, i) => (
|
|
97
|
+
<DemoBox key={i} label={`Row ${i + 1}`} />
|
|
98
|
+
))}
|
|
99
|
+
</VStack>
|
|
100
|
+
),
|
|
101
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SPACE_NAMES } from "../../components/ui/layout";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared Storybook controls. `gap`/`padding` accept `SpaceName | number`, so the
|
|
5
|
+
* generated control is a free text box — these pin them to the token scale, which
|
|
6
|
+
* is what the design system wants people reaching for.
|
|
7
|
+
*/
|
|
8
|
+
export const spaceControl = {
|
|
9
|
+
control: "select" as const,
|
|
10
|
+
options: [...SPACE_NAMES],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const alignControl = {
|
|
14
|
+
control: "select" as const,
|
|
15
|
+
options: ["start", "center", "end", "stretch", "baseline"],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const justifyControl = {
|
|
19
|
+
control: "select" as const,
|
|
20
|
+
options: ["start", "center", "end", "between", "around", "evenly"],
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Aliases and deprecated props that should not appear as live knobs. */
|
|
24
|
+
export const hiddenArgs = {
|
|
25
|
+
as: { table: { disable: true } },
|
|
26
|
+
hAlign: { table: { disable: true } },
|
|
27
|
+
vAlign: { table: { disable: true } },
|
|
28
|
+
cols: { table: { disable: true } },
|
|
29
|
+
colsSm: { table: { disable: true } },
|
|
30
|
+
colsMd: { table: { disable: true } },
|
|
31
|
+
colsLg: { table: { disable: true } },
|
|
32
|
+
colGap: { table: { disable: true } },
|
|
33
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Story fixtures. Not design-system components — but still token-driven, so the
|
|
5
|
+
* layout stories never demonstrate the hardcoded styling the docs rule forbids.
|
|
6
|
+
* Styles live in `client/storybook.css` (Storybook only).
|
|
7
|
+
*/
|
|
8
|
+
export function DemoBox({ label, tall }: { label?: string; tall?: boolean }) {
|
|
9
|
+
return (
|
|
10
|
+
<div className={tall ? "sb-demo-box sb-demo-box--tall" : "sb-demo-box"}>
|
|
11
|
+
{label ?? "Item"}
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function ShellFrame({
|
|
17
|
+
children,
|
|
18
|
+
height = 420,
|
|
19
|
+
}: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
height?: number;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
className="sb-shell-frame"
|
|
26
|
+
style={{ ["--sb-shell-frame-height" as string]: `${height / 16}rem` }}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const LAYOUT_DOCS_RULE = [
|
|
34
|
+
"Do not use Tailwind for layout (`flex`, `grid`, `gap-*`, `items-*`, `justify-*`, `col-span-*`).",
|
|
35
|
+
"Use these primitives so a change in the design system updates every app.",
|
|
36
|
+
'Use named space (`gap="md"`, `space="xl"`) and named sizes (`width="narrow"`) — never raw px.',
|
|
37
|
+
].join(" ");
|
|
@@ -20,7 +20,7 @@ import { BadgeImperativePrimary } from "@/components/icons/imperative-badges";
|
|
|
20
20
|
import { Text } from "@/components/ui/typography";
|
|
21
21
|
|
|
22
22
|
const meta = {
|
|
23
|
-
title: "
|
|
23
|
+
title: "Components/PageHeader",
|
|
24
24
|
component: PageHeader,
|
|
25
25
|
parameters: {
|
|
26
26
|
layout: "padded",
|
|
@@ -120,8 +120,8 @@ export const ThemeHeader: Story = {
|
|
|
120
120
|
Theme
|
|
121
121
|
</span>
|
|
122
122
|
</TooltipTrigger>
|
|
123
|
-
<TooltipContent
|
|
124
|
-
<p className="body
|
|
123
|
+
<TooltipContent>
|
|
124
|
+
<p className="tooltip-body">
|
|
125
125
|
Themes are groupings of related strategies that address
|
|
126
126
|
specific aspects of health and well-being within a concept
|
|
127
127
|
area.
|
|
@@ -152,8 +152,8 @@ export const ThemeHeader: Story = {
|
|
|
152
152
|
WELL Certification
|
|
153
153
|
</span>
|
|
154
154
|
</TooltipTrigger>
|
|
155
|
-
<TooltipContent
|
|
156
|
-
<p className="body
|
|
155
|
+
<TooltipContent>
|
|
156
|
+
<p className="tooltip-body">
|
|
157
157
|
The WELL Certification is a globally recognized standard
|
|
158
158
|
for healthy, people-first buildings. It is based on the
|
|
159
159
|
WELL Building Standard, which is a comprehensive framework
|
|
@@ -216,8 +216,8 @@ export const ThemeHeaderWithPoints: Story = {
|
|
|
216
216
|
Theme
|
|
217
217
|
</span>
|
|
218
218
|
</TooltipTrigger>
|
|
219
|
-
<TooltipContent
|
|
220
|
-
<p className="body
|
|
219
|
+
<TooltipContent>
|
|
220
|
+
<p className="tooltip-body">
|
|
221
221
|
Themes are groupings of related strategies that address
|
|
222
222
|
specific aspects of health and well-being within a concept
|
|
223
223
|
area.
|
|
@@ -247,8 +247,8 @@ export const ThemeHeaderWithPoints: Story = {
|
|
|
247
247
|
WELL Certification
|
|
248
248
|
</span>
|
|
249
249
|
</TooltipTrigger>
|
|
250
|
-
<TooltipContent
|
|
251
|
-
<p className="body
|
|
250
|
+
<TooltipContent>
|
|
251
|
+
<p className="tooltip-body">
|
|
252
252
|
The WELL Certification is a globally recognized
|
|
253
253
|
standard for healthy, people-first buildings. It is
|
|
254
254
|
based on the WELL Building Standard, which is a
|
|
@@ -329,8 +329,8 @@ export const ThemeHeaderWithImperativeBadge: Story = {
|
|
|
329
329
|
Theme
|
|
330
330
|
</span>
|
|
331
331
|
</TooltipTrigger>
|
|
332
|
-
<TooltipContent
|
|
333
|
-
<p className="body
|
|
332
|
+
<TooltipContent>
|
|
333
|
+
<p className="tooltip-body">
|
|
334
334
|
Themes are groupings of related strategies that address
|
|
335
335
|
specific aspects of health and well-being within a concept
|
|
336
336
|
area.
|
|
@@ -340,11 +340,11 @@ export const ThemeHeaderWithImperativeBadge: Story = {
|
|
|
340
340
|
</PageHeaderLeftContent>
|
|
341
341
|
|
|
342
342
|
<div className="flex items-center gap-4">
|
|
343
|
-
<Tooltip>
|
|
343
|
+
<Tooltip trigger="hover">
|
|
344
344
|
<TooltipTrigger>
|
|
345
345
|
<BadgeImperativePrimary className="cursor-pointer" />
|
|
346
346
|
</TooltipTrigger>
|
|
347
|
-
<TooltipContent
|
|
347
|
+
<TooltipContent>
|
|
348
348
|
<Text as="p" variant="body-small">
|
|
349
349
|
<span className="font-semibold">Required</span> for
|
|
350
350
|
certification
|