@usefragments/ui 1.1.1 → 1.2.0
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/dist/assets/ui.css +327 -274
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +11 -11
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
- package/dist/components/Chip/Chip.module.scss.cjs +15 -15
- package/dist/components/Chip/Chip.module.scss.js +15 -15
- package/dist/components/Combobox/index.cjs +106 -9
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +106 -9
- package/dist/components/DataTable/DataTable.module.scss.cjs +37 -34
- package/dist/components/DataTable/DataTable.module.scss.js +37 -34
- package/dist/components/Main/Main.module.scss.cjs +26 -0
- package/dist/components/Main/Main.module.scss.js +26 -0
- package/dist/components/Main/index.cjs +128 -0
- package/dist/components/Main/index.d.ts +22 -0
- package/dist/components/Main/index.d.ts.map +1 -0
- package/dist/components/Main/index.js +111 -0
- package/dist/components/Table/Table.module.scss.cjs +19 -19
- package/dist/components/Table/Table.module.scss.js +19 -19
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/TableOfContents/index.cjs +22 -42
- package/dist/components/TableOfContents/index.d.ts +3 -3
- package/dist/components/TableOfContents/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.js +22 -42
- package/dist/index.cjs +87 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/fragments.json +1 -1
- package/package.json +7 -2
- package/src/components/Checkbox/Checkbox.contract.json +5 -24
- package/src/components/Checkbox/Checkbox.module.scss +4 -2
- package/src/components/Chip/Chip.contract.json +11 -28
- package/src/components/Chip/Chip.module.scss +21 -45
- package/src/components/Combobox/Combobox.contract.json +6 -24
- package/src/components/Combobox/index.tsx +132 -6
- package/src/components/DataTable/DataTable.module.scss +31 -8
- package/src/components/Main/Main.contract.json +79 -0
- package/src/components/Main/Main.module.scss +31 -0
- package/src/components/Main/index.tsx +124 -0
- package/src/components/Table/Table.module.scss +22 -5
- package/src/components/TableOfContents/TableOfContents.contract.json +6 -16
- package/src/components/TableOfContents/TableOfContents.module.scss +10 -13
- package/src/components/TableOfContents/index.tsx +27 -38
- package/src/index.ts +3 -0
- package/src/tokens/_component-properties.scss +1 -0
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts +0 -33
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts.map +0 -1
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts +0 -11
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts +0 -5
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts +0 -4
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts +0 -3
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts +0 -86
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts +0 -2
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts.map +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +0 -106
- package/src/components/Alert/Alert.stories.tsx +0 -119
- package/src/components/AppShell/AppShell.stories.tsx +0 -156
- package/src/components/Avatar/Avatar.stories.tsx +0 -74
- package/src/components/Badge/Badge.stories.tsx +0 -92
- package/src/components/BentoGrid/BentoGrid.stories.tsx +0 -98
- package/src/components/Box/Box.stories.tsx +0 -150
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -87
- package/src/components/Button/Button.stories.tsx +0 -103
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -97
- package/src/components/Card/Card.stories.tsx +0 -144
- package/src/components/Chart/Chart.stories.tsx +0 -119
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -68
- package/src/components/Chip/Chip.stories.tsx +0 -70
- package/src/components/Cloud/CloudGovernanceShell.module.scss +0 -88
- package/src/components/Cloud/CloudGovernanceShell.stories.tsx +0 -446
- package/src/components/Cloud/ControlSizing.module.scss +0 -49
- package/src/components/Cloud/ControlSizing.stories.tsx +0 -238
- package/src/components/Cloud/DashboardLayoutPrototypes.module.scss +0 -462
- package/src/components/Cloud/DashboardLayoutPrototypes.shared.tsx +0 -375
- package/src/components/Cloud/DashboardLayoutPrototypes.shell.tsx +0 -147
- package/src/components/Cloud/DashboardLayoutPrototypes.stories.tsx +0 -328
- package/src/components/Cloud/PullRequestsPrototypes.content.tsx +0 -283
- package/src/components/Cloud/PullRequestsPrototypes.detail-panels.tsx +0 -381
- package/src/components/Cloud/PullRequestsPrototypes.detail.tsx +0 -204
- package/src/components/Cloud/PullRequestsPrototypes.id-data.ts +0 -395
- package/src/components/Cloud/PullRequestsPrototypes.id-page.tsx +0 -349
- package/src/components/Cloud/PullRequestsPrototypes.stories.tsx +0 -81
- package/src/components/CodeBlock/CodeBlock.stories.tsx +0 -147
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -94
- package/src/components/ColorPicker/ColorPicker.stories.tsx +0 -74
- package/src/components/Combobox/Combobox.stories.tsx +0 -133
- package/src/components/Command/Command.stories.tsx +0 -102
- package/src/components/ConversationList/ConversationList.stories.tsx +0 -93
- package/src/components/DataTable/DataTable.stories.tsx +0 -129
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -129
- package/src/components/Dialog/Dialog.stories.tsx +0 -154
- package/src/components/Drawer/Drawer.stories.tsx +0 -144
- package/src/components/Editor/Editor.stories.tsx +0 -99
- package/src/components/EmptyState/EmptyState.stories.tsx +0 -97
- package/src/components/Field/Field.stories.tsx +0 -109
- package/src/components/Fieldset/Fieldset.stories.tsx +0 -116
- package/src/components/Form/Form.stories.tsx +0 -142
- package/src/components/Grid/Grid.stories.tsx +0 -125
- package/src/components/Header/Header.stories.tsx +0 -133
- package/src/components/Icon/Icon.stories.tsx +0 -80
- package/src/components/IconButton/IconButton.stories.tsx +0 -78
- package/src/components/Image/Image.stories.tsx +0 -109
- package/src/components/Input/Input.stories.tsx +0 -104
- package/src/components/Link/Link.stories.tsx +0 -67
- package/src/components/List/List.stories.tsx +0 -95
- package/src/components/Listbox/Listbox.stories.tsx +0 -81
- package/src/components/Loading/Loading.stories.tsx +0 -69
- package/src/components/Markdown/Markdown.stories.tsx +0 -75
- package/src/components/Menu/Menu.stories.tsx +0 -113
- package/src/components/Message/Message.stories.tsx +0 -85
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +0 -161
- package/src/components/Pagination/Pagination.stories.tsx +0 -81
- package/src/components/Popover/Popover.stories.tsx +0 -152
- package/src/components/Progress/Progress.stories.tsx +0 -64
- package/src/components/Prompt/Prompt.stories.tsx +0 -93
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -107
- package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -97
- package/src/components/Select/Select.stories.tsx +0 -127
- package/src/components/Separator/Separator.stories.tsx +0 -84
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -122
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -80
- package/src/components/Slider/Slider.stories.tsx +0 -73
- package/src/components/Stack/Stack.stories.tsx +0 -73
- package/src/components/Switch/Switch.stories.tsx +0 -59
- package/src/components/Table/Table.stories.tsx +0 -219
- package/src/components/TableOfContents/TableOfContents.stories.tsx +0 -120
- package/src/components/Tabs/Tabs.stories.tsx +0 -136
- package/src/components/Text/Text.stories.tsx +0 -133
- package/src/components/Textarea/Textarea.stories.tsx +0 -107
- package/src/components/Theme/Theme.stories.tsx +0 -95
- package/src/components/ThinkingIndicator/ThinkingIndicator.stories.tsx +0 -85
- package/src/components/Toast/Toast.stories.tsx +0 -91
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -114
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -95
- package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -78
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Card } from ".";
|
|
3
|
-
import { Progress } from "../Progress";
|
|
4
|
-
import { Stack } from "../Stack";
|
|
5
|
-
import { Text } from "../Text";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Card is a container for grouping related content into a distinct surface. It
|
|
9
|
-
* is a compound component: compose Card.Header, Card.Title, Card.Description,
|
|
10
|
-
* Card.Body, and Card.Footer inside the root.
|
|
11
|
-
*/
|
|
12
|
-
const meta = {
|
|
13
|
-
title: "Layout/Card",
|
|
14
|
-
component: Card,
|
|
15
|
-
tags: ["autodocs", "canonical"],
|
|
16
|
-
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
description: { component: "Container for grouping related content." },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
variant: {
|
|
23
|
-
control: "select",
|
|
24
|
-
options: ["default", "outlined", "outline", "elevated", "stat", "panel"],
|
|
25
|
-
description: "Visual style of the card surface",
|
|
26
|
-
},
|
|
27
|
-
padding: {
|
|
28
|
-
control: "select",
|
|
29
|
-
options: ["none", "sm", "md", "lg"],
|
|
30
|
-
description: "Internal padding size",
|
|
31
|
-
},
|
|
32
|
-
as: {
|
|
33
|
-
control: "select",
|
|
34
|
-
options: ["article", "div", "section"],
|
|
35
|
-
description: "Semantic HTML element for the card root",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
args: {
|
|
39
|
-
variant: "default",
|
|
40
|
-
padding: "md",
|
|
41
|
-
children: (
|
|
42
|
-
<>
|
|
43
|
-
<Card.Header>
|
|
44
|
-
<Card.Title>Card Title</Card.Title>
|
|
45
|
-
<Card.Description>A brief description</Card.Description>
|
|
46
|
-
</Card.Header>
|
|
47
|
-
<Card.Body>Card content goes here.</Card.Body>
|
|
48
|
-
</>
|
|
49
|
-
),
|
|
50
|
-
},
|
|
51
|
-
} satisfies Meta<typeof Card>;
|
|
52
|
-
|
|
53
|
-
export default meta;
|
|
54
|
-
|
|
55
|
-
type Story = StoryObj<typeof meta>;
|
|
56
|
-
|
|
57
|
-
export const Default: Story = {
|
|
58
|
-
render: () => (
|
|
59
|
-
<Card>
|
|
60
|
-
<Card.Header>
|
|
61
|
-
<Card.Title>Card Title</Card.Title>
|
|
62
|
-
<Card.Description>A brief description</Card.Description>
|
|
63
|
-
</Card.Header>
|
|
64
|
-
<Card.Body>Card content goes here.</Card.Body>
|
|
65
|
-
</Card>
|
|
66
|
-
),
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Outlined: Story = {
|
|
70
|
-
render: () => (
|
|
71
|
-
<Card variant="outlined">
|
|
72
|
-
<Card.Header>
|
|
73
|
-
<Card.Title>Outlined Card</Card.Title>
|
|
74
|
-
</Card.Header>
|
|
75
|
-
<Card.Body>Content with border.</Card.Body>
|
|
76
|
-
</Card>
|
|
77
|
-
),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Elevated: Story = {
|
|
81
|
-
render: () => (
|
|
82
|
-
<Card variant="elevated">
|
|
83
|
-
<Card.Header>
|
|
84
|
-
<Card.Title>Featured Item</Card.Title>
|
|
85
|
-
</Card.Header>
|
|
86
|
-
<Card.Body>Important content.</Card.Body>
|
|
87
|
-
</Card>
|
|
88
|
-
),
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const Stat: Story = {
|
|
92
|
-
render: () => (
|
|
93
|
-
<Card variant="stat" style={{ width: 280 }}>
|
|
94
|
-
<Stack gap="md">
|
|
95
|
-
<Stack gap="xs">
|
|
96
|
-
<Text as="strong" size="2xl" weight="bold" letterSpacing="tighter" tabularNums>
|
|
97
|
-
94%
|
|
98
|
-
</Text>
|
|
99
|
-
<Text as="p" size="sm" color="secondary">
|
|
100
|
-
Component coverage
|
|
101
|
-
</Text>
|
|
102
|
-
</Stack>
|
|
103
|
-
<Progress value={94} variant="success" size="sm" />
|
|
104
|
-
</Stack>
|
|
105
|
-
</Card>
|
|
106
|
-
),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const Panel: Story = {
|
|
110
|
-
render: () => (
|
|
111
|
-
<Card variant="panel" padding="none" style={{ width: 360 }}>
|
|
112
|
-
<Card.Header divided>
|
|
113
|
-
<Card.Title>System states</Card.Title>
|
|
114
|
-
</Card.Header>
|
|
115
|
-
<Card.Body padding="md">
|
|
116
|
-
<Text as="p" size="sm" color="secondary">
|
|
117
|
-
Use panel cards for bordered dashboard regions with their own internal header and body
|
|
118
|
-
rhythm.
|
|
119
|
-
</Text>
|
|
120
|
-
</Card.Body>
|
|
121
|
-
</Card>
|
|
122
|
-
),
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const WithFooter: Story = {
|
|
126
|
-
render: () => (
|
|
127
|
-
<Card>
|
|
128
|
-
<Card.Header>
|
|
129
|
-
<Card.Title>Card with Footer</Card.Title>
|
|
130
|
-
<Card.Description>Complete card layout</Card.Description>
|
|
131
|
-
</Card.Header>
|
|
132
|
-
<Card.Body>Main content area.</Card.Body>
|
|
133
|
-
<Card.Footer>Footer actions go here</Card.Footer>
|
|
134
|
-
</Card>
|
|
135
|
-
),
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const ContentOnly: Story = {
|
|
139
|
-
render: () => (
|
|
140
|
-
<Card>
|
|
141
|
-
<Card.Body>Just content, no header or footer.</Card.Body>
|
|
142
|
-
</Card>
|
|
143
|
-
),
|
|
144
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { BarChart, Bar, LineChart, Line, CartesianGrid, XAxis, YAxis } from 'recharts';
|
|
3
|
-
import { ChartContainer, ChartTooltip, ChartLegend } from '.';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* ChartContainer is a composable wrapper for recharts charts with theme-aware
|
|
7
|
-
* tooltips, legends, and color integration. Pass a ChartConfig mapping data
|
|
8
|
-
* keys to labels and colors, with a recharts chart element as the child.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Display/Chart',
|
|
12
|
-
component: ChartContainer,
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Composable chart wrapper for recharts with theme-aware tooltips, legends, and color integration.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
summary: {
|
|
24
|
-
control: 'text',
|
|
25
|
-
description: 'Non-visual summary announced to assistive technology users',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
config: {
|
|
30
|
-
revenue: { label: 'Revenue', color: 'var(--fui-color-accent)' },
|
|
31
|
-
},
|
|
32
|
-
children: <BarChart data={[]} />,
|
|
33
|
-
},
|
|
34
|
-
} satisfies Meta<typeof ChartContainer>;
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
37
|
-
|
|
38
|
-
type Story = StoryObj<typeof meta>;
|
|
39
|
-
|
|
40
|
-
const monthlyData = [
|
|
41
|
-
{ month: 'Jan', revenue: 4200, users: 1200 },
|
|
42
|
-
{ month: 'Feb', revenue: 5100, users: 1500 },
|
|
43
|
-
{ month: 'Mar', revenue: 4800, users: 1400 },
|
|
44
|
-
{ month: 'Apr', revenue: 6300, users: 1900 },
|
|
45
|
-
{ month: 'May', revenue: 7100, users: 2200 },
|
|
46
|
-
{ month: 'Jun', revenue: 6800, users: 2100 },
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
const deviceData = [
|
|
50
|
-
{ device: 'Desktop', sessions: 4300 },
|
|
51
|
-
{ device: 'Mobile', sessions: 3100 },
|
|
52
|
-
{ device: 'Tablet', sessions: 900 },
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
export const Line_: Story = {
|
|
56
|
-
name: 'Line Chart',
|
|
57
|
-
render: () => (
|
|
58
|
-
<div style={{ width: '100%', height: 300 }}>
|
|
59
|
-
<ChartContainer
|
|
60
|
-
config={{
|
|
61
|
-
revenue: { label: 'Revenue', color: 'var(--fui-color-accent)' },
|
|
62
|
-
users: { label: 'Users', color: 'var(--fui-color-info)' },
|
|
63
|
-
}}
|
|
64
|
-
>
|
|
65
|
-
<LineChart data={monthlyData} margin={{ top: 5, right: 20, bottom: 5, left: 0 }}>
|
|
66
|
-
<CartesianGrid strokeDasharray="3 3" />
|
|
67
|
-
<XAxis dataKey="month" />
|
|
68
|
-
<YAxis />
|
|
69
|
-
<ChartTooltip />
|
|
70
|
-
<ChartLegend />
|
|
71
|
-
<Line type="monotone" dataKey="revenue" stroke="var(--fui-color-accent)" strokeWidth={2} dot={false} />
|
|
72
|
-
<Line type="monotone" dataKey="users" stroke="var(--fui-color-info)" strokeWidth={2} dot={false} />
|
|
73
|
-
</LineChart>
|
|
74
|
-
</ChartContainer>
|
|
75
|
-
</div>
|
|
76
|
-
),
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const Bar_: Story = {
|
|
80
|
-
name: 'Bar Chart',
|
|
81
|
-
render: () => (
|
|
82
|
-
<div style={{ width: '100%', height: 300 }}>
|
|
83
|
-
<ChartContainer
|
|
84
|
-
config={{
|
|
85
|
-
sessions: { label: 'Sessions', color: 'var(--fui-color-accent)' },
|
|
86
|
-
}}
|
|
87
|
-
>
|
|
88
|
-
<BarChart data={deviceData} margin={{ top: 5, right: 20, bottom: 5, left: 0 }}>
|
|
89
|
-
<CartesianGrid strokeDasharray="3 3" />
|
|
90
|
-
<XAxis dataKey="device" />
|
|
91
|
-
<YAxis />
|
|
92
|
-
<ChartTooltip />
|
|
93
|
-
<Bar dataKey="sessions" fill="var(--fui-color-accent)" radius={[4, 4, 0, 0]} />
|
|
94
|
-
</BarChart>
|
|
95
|
-
</ChartContainer>
|
|
96
|
-
</div>
|
|
97
|
-
),
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const WithSummary: Story = {
|
|
101
|
-
render: () => (
|
|
102
|
-
<div style={{ width: '100%', height: 300 }}>
|
|
103
|
-
<ChartContainer
|
|
104
|
-
config={{
|
|
105
|
-
sessions: { label: 'Sessions', color: 'var(--fui-color-accent)' },
|
|
106
|
-
}}
|
|
107
|
-
summary="Sessions by device: Desktop 4300, Mobile 3100, Tablet 900."
|
|
108
|
-
>
|
|
109
|
-
<BarChart data={deviceData} margin={{ top: 5, right: 20, bottom: 5, left: 0 }}>
|
|
110
|
-
<CartesianGrid strokeDasharray="3 3" />
|
|
111
|
-
<XAxis dataKey="device" />
|
|
112
|
-
<YAxis />
|
|
113
|
-
<ChartTooltip />
|
|
114
|
-
<Bar dataKey="sessions" fill="var(--fui-color-accent)" radius={[4, 4, 0, 0]} />
|
|
115
|
-
</BarChart>
|
|
116
|
-
</ChartContainer>
|
|
117
|
-
</div>
|
|
118
|
-
),
|
|
119
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Checkbox } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Binary toggle for form fields that require explicit submission.
|
|
6
|
-
* Supports controlled and uncontrolled use, an indeterminate state, and
|
|
7
|
-
* sizes sm/md/lg. Prefer Switch for immediate-effect settings.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Forms/Checkbox',
|
|
11
|
-
component: Checkbox,
|
|
12
|
-
tags: ['autodocs', 'canonical'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component:
|
|
17
|
-
'Binary toggle for form fields requiring explicit submission.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
size: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['sm', 'md', 'lg'],
|
|
25
|
-
description: 'Checkbox size',
|
|
26
|
-
},
|
|
27
|
-
variant: {
|
|
28
|
-
control: 'select',
|
|
29
|
-
options: ['default', 'card'],
|
|
30
|
-
description: 'Inline checkbox or full-width clickable card',
|
|
31
|
-
},
|
|
32
|
-
indeterminate: { control: 'boolean', description: 'Partial selection state' },
|
|
33
|
-
disabled: { control: 'boolean' },
|
|
34
|
-
required: { control: 'boolean' },
|
|
35
|
-
},
|
|
36
|
-
args: { size: 'md', variant: 'default', label: 'Accept terms and conditions' },
|
|
37
|
-
} satisfies Meta<typeof Checkbox>;
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
|
|
41
|
-
type Story = StoryObj<typeof meta>;
|
|
42
|
-
|
|
43
|
-
export const Default: Story = {
|
|
44
|
-
args: { label: 'Accept terms and conditions' },
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Checked: Story = {
|
|
48
|
-
args: { defaultChecked: true, label: 'Subscribe to newsletter' },
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const WithHelperText: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
label: 'Email notifications',
|
|
54
|
-
helperText: 'Receive email updates about your account activity',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Indeterminate: Story = {
|
|
59
|
-
args: { indeterminate: true, label: 'Select all' },
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Large: Story = {
|
|
63
|
-
args: { size: 'lg', label: 'Large checkbox' },
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Disabled: Story = {
|
|
67
|
-
args: { disabled: true, defaultChecked: true, label: 'Disabled checked' },
|
|
68
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Chip } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Interactive pill-shaped element for filtering, selecting, and tagging.
|
|
6
|
-
* Supports selected state, removable chips via onRemove, and multi-select
|
|
7
|
-
* sets through Chip.Group.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Forms/Chip',
|
|
11
|
-
component: Chip,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Interactive pill for filtering, selecting, and tagging.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
variant: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['filled', 'outlined', 'outline', 'soft'],
|
|
24
|
-
description: 'Visual style variant',
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
control: 'select',
|
|
28
|
-
options: ['xs', 'sm', 'md', 'lg'],
|
|
29
|
-
description: 'Chip size',
|
|
30
|
-
},
|
|
31
|
-
selected: { control: 'boolean', description: 'Selection state' },
|
|
32
|
-
disabled: { control: 'boolean' },
|
|
33
|
-
},
|
|
34
|
-
args: { variant: 'filled', size: 'md', children: 'Default' },
|
|
35
|
-
} satisfies Meta<typeof Chip>;
|
|
36
|
-
|
|
37
|
-
export default meta;
|
|
38
|
-
|
|
39
|
-
type Story = StoryObj<typeof meta>;
|
|
40
|
-
|
|
41
|
-
export const Default: Story = {
|
|
42
|
-
args: { children: 'Default' },
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Outline: Story = {
|
|
46
|
-
args: { variant: 'outline', children: 'Outline' },
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const Selected: Story = {
|
|
50
|
-
args: { variant: 'soft', selected: true, children: 'Selected' },
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Removable: Story = {
|
|
54
|
-
args: { children: 'TypeScript', onRemove: () => {} },
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Disabled: Story = {
|
|
58
|
-
args: { disabled: true, selected: true, children: 'Disabled' },
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const Group: Story = {
|
|
62
|
-
render: () => (
|
|
63
|
-
<Chip.Group defaultValue={['react']}>
|
|
64
|
-
<Chip value="react">React</Chip>
|
|
65
|
-
<Chip value="vue">Vue</Chip>
|
|
66
|
-
<Chip value="angular">Angular</Chip>
|
|
67
|
-
<Chip value="svelte">Svelte</Chip>
|
|
68
|
-
</Chip.Group>
|
|
69
|
-
),
|
|
70
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
.frame {
|
|
2
|
-
position: fixed;
|
|
3
|
-
inset: 0;
|
|
4
|
-
overflow: hidden;
|
|
5
|
-
background: var(--fui-app-canvas-bg);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.shell {
|
|
9
|
-
height: 100%;
|
|
10
|
-
min-height: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.main {
|
|
14
|
-
overflow: auto;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.page {
|
|
18
|
-
width: 100%;
|
|
19
|
-
max-width: 1320px;
|
|
20
|
-
margin-inline: auto;
|
|
21
|
-
padding: clamp(var(--fui-space-4), 3vw, var(--fui-space-6));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.brandMark {
|
|
25
|
-
display: grid;
|
|
26
|
-
width: var(--fui-target-size-min);
|
|
27
|
-
height: var(--fui-target-size-min);
|
|
28
|
-
flex: 0 0 auto;
|
|
29
|
-
place-items: center;
|
|
30
|
-
color: var(--fui-text-primary);
|
|
31
|
-
background: var(--fui-bg-elevated);
|
|
32
|
-
border: 1px solid var(--fui-border-strong);
|
|
33
|
-
border-radius: var(--fui-radius-md);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.brandCopy {
|
|
37
|
-
min-width: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.contentGrid {
|
|
41
|
-
display: grid;
|
|
42
|
-
grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
|
|
43
|
-
gap: var(--fui-space-4);
|
|
44
|
-
align-items: start;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.tableColumn {
|
|
48
|
-
min-width: 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.toolbar {
|
|
52
|
-
display: grid;
|
|
53
|
-
grid-template-columns: minmax(260px, 1fr) minmax(150px, 180px) minmax(150px, 180px);
|
|
54
|
-
gap: var(--fui-space-2);
|
|
55
|
-
align-items: center;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.panelHeader {
|
|
59
|
-
width: 100%;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.stateRow {
|
|
63
|
-
min-height: var(--fui-target-size-min);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.actions {
|
|
67
|
-
width: 100%;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@media (max-width: 1120px) {
|
|
71
|
-
.contentGrid {
|
|
72
|
-
grid-template-columns: 1fr;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@media (max-width: 720px) {
|
|
77
|
-
.frame {
|
|
78
|
-
min-height: 100vh;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.page {
|
|
82
|
-
padding: var(--fui-space-3);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.toolbar {
|
|
86
|
-
grid-template-columns: 1fr;
|
|
87
|
-
}
|
|
88
|
-
}
|