@recursica/adapter-mantine-v8 1.3.4 → 1.3.5

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 (56) hide show
  1. package/.storybook/commonArgTypes.ts +148 -0
  2. package/CHANGELOG.md +6 -0
  3. package/package.json +2 -2
  4. package/src/Introduction.stories.tsx +149 -0
  5. package/src/components/Accordion/Accordion.stories.tsx +189 -0
  6. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +68 -0
  7. package/src/components/AutoComplete/AutoComplete.stories.tsx +336 -0
  8. package/src/components/Avatar/Avatar.stories.tsx +92 -0
  9. package/src/components/Badge/Badge.stories.tsx +78 -0
  10. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +114 -0
  11. package/src/components/Button/Button.stories.tsx +192 -0
  12. package/src/components/Card/Card.stories.tsx +76 -0
  13. package/src/components/Checkbox/Checkbox.stories.tsx +97 -0
  14. package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
  15. package/src/components/Chip/Chip.stories.tsx +128 -0
  16. package/src/components/Container/Container.stories.tsx +118 -0
  17. package/src/components/DatePicker/DatePicker.stories.tsx +158 -0
  18. package/src/components/Dropdown/Dropdown.stories.tsx +252 -0
  19. package/src/components/FileInput/FileInput.stories.tsx +313 -0
  20. package/src/components/FileUpload/FileUpload.stories.tsx +362 -0
  21. package/src/components/Flex/Flex.stories.tsx +128 -0
  22. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +118 -0
  23. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
  24. package/src/components/Group/Group.stories.tsx +120 -0
  25. package/src/components/Heading/Heading.stories.tsx +112 -0
  26. package/src/components/HoverCard/HoverCard.stories.tsx +172 -0
  27. package/src/components/Label/Label.stories.tsx +131 -0
  28. package/src/components/LayoutGrid/LayoutGrid.stories.tsx +61 -0
  29. package/src/components/Link/Link.stories.tsx +58 -0
  30. package/src/components/Loader/Loader.stories.tsx +123 -0
  31. package/src/components/Menu/Menu.stories.tsx +370 -0
  32. package/src/components/Modal/Modal.stories.tsx +105 -0
  33. package/src/components/NumberInput/NumberInput.stories.tsx +96 -0
  34. package/src/components/Pagination/Pagination.stories.tsx +48 -0
  35. package/src/components/Panel/Panel.stories.tsx +219 -0
  36. package/src/components/Popover/Popover.stories.tsx +133 -0
  37. package/src/components/Radio/Radio.stories.tsx +93 -0
  38. package/src/components/Radio/RadioGroup.stories.tsx +117 -0
  39. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
  40. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +106 -0
  41. package/src/components/Slider/Slider.stories.tsx +282 -0
  42. package/src/components/Stack/Stack.stories.tsx +108 -0
  43. package/src/components/Stepper/Stepper.stories.tsx +148 -0
  44. package/src/components/Switch/Switch.stories.tsx +114 -0
  45. package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
  46. package/src/components/Table/Table.stories.tsx +140 -0
  47. package/src/components/Tabs/Tabs.stories.tsx +154 -0
  48. package/src/components/Text/Text.stories.tsx +148 -0
  49. package/src/components/TextArea/TextArea.stories.tsx +94 -0
  50. package/src/components/TextField/TextField.stories.tsx +162 -0
  51. package/src/components/TimePicker/TimePicker.stories.tsx +141 -0
  52. package/src/components/Timeline/Timeline.stories.tsx +128 -0
  53. package/src/components/Toast/Toast.stories.tsx +67 -0
  54. package/src/components/Tooltip/Tooltip.stories.tsx +165 -0
  55. package/src/components/TransferList/TransferList.stories.tsx +121 -0
  56. package/src/components/Tree/Tree.stories.tsx +104 -0
@@ -0,0 +1,192 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Button } from "./Button";
4
+ import { Layer } from "@recursica/adapter-common";
5
+
6
+ type ButtonStoryProps = React.ComponentProps<typeof Button>;
7
+
8
+ const meta: Meta<ButtonStoryProps> = {
9
+ title: "UI-Kit/Button",
10
+ component: Button,
11
+ tags: ["autodocs"],
12
+ argTypes: {
13
+ disabled: {
14
+ control: "boolean",
15
+ },
16
+ variant: {
17
+ control: "select",
18
+ options: ["solid", "outline", "text"],
19
+ description: "The visual variant of the button",
20
+ },
21
+ size: {
22
+ control: "radio",
23
+ options: ["default", "small"],
24
+ description: "The size of the button",
25
+ },
26
+ loading: {
27
+ control: "boolean",
28
+ description: "Sets the button to a loading state",
29
+ },
30
+ useRecursicaLoader: {
31
+ control: "boolean",
32
+ description:
33
+ "Use the Recursica Loader component instead of the default Mantine loader",
34
+ },
35
+ loaderVariant: {
36
+ control: "select",
37
+ options: ["oval", "bars", "dots"],
38
+ description: "The visual variant of the Recursica Loader",
39
+ },
40
+ loaderSize: {
41
+ control: "select",
42
+ options: [undefined, "sm", "md", "lg", "small", "default", "large"],
43
+ description: "The size variant for the loader",
44
+ },
45
+ },
46
+ args: {
47
+ useRecursicaLoader: true,
48
+ loaderVariant: "oval",
49
+ loaderSize: undefined,
50
+ },
51
+ };
52
+
53
+ export default meta;
54
+
55
+ type Story = StoryObj<ButtonStoryProps>;
56
+
57
+ export const Default: Story = {
58
+ args: {
59
+ children: "Explore Button",
60
+ variant: "solid",
61
+ size: "default",
62
+ disabled: false,
63
+ },
64
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
65
+ render: ({ withLayer, layer, ...args }: any) => {
66
+ return <Button {...args} />;
67
+ },
68
+ };
69
+
70
+ export const SolidDefault: Story = {
71
+ args: {
72
+ children: "Solid Default",
73
+ variant: "solid",
74
+ size: "default",
75
+ },
76
+ };
77
+
78
+ export const OutlineSmall: Story = {
79
+ args: {
80
+ children: "Outline Small",
81
+ variant: "outline",
82
+ size: "small",
83
+ },
84
+ };
85
+
86
+ export const TextWithIcon: Story = {
87
+ args: {
88
+ children: "Text With Icon",
89
+ variant: "text",
90
+ size: "default",
91
+ icon: (
92
+ <svg
93
+ xmlns="http://www.w3.org/2000/svg"
94
+ width="24"
95
+ height="24"
96
+ viewBox="0 0 24 24"
97
+ fill="none"
98
+ stroke="currentColor"
99
+ strokeWidth="2"
100
+ strokeLinecap="round"
101
+ strokeLinejoin="round"
102
+ >
103
+ <circle cx="11" cy="11" r="8"></circle>
104
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
105
+ </svg>
106
+ ),
107
+ },
108
+ };
109
+
110
+ export const IconOnly: Story = {
111
+ args: {
112
+ variant: "solid",
113
+ size: "default",
114
+ "aria-label": "Search",
115
+ icon: (
116
+ <svg
117
+ xmlns="http://www.w3.org/2000/svg"
118
+ width="24"
119
+ height="24"
120
+ viewBox="0 0 24 24"
121
+ fill="none"
122
+ stroke="currentColor"
123
+ strokeWidth="2"
124
+ strokeLinecap="round"
125
+ strokeLinejoin="round"
126
+ >
127
+ <circle cx="11" cy="11" r="8"></circle>
128
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
129
+ </svg>
130
+ ),
131
+ },
132
+ };
133
+
134
+ export const LayerOneSolid: Story = {
135
+ args: {
136
+ children: "Layer 1 Solid",
137
+ variant: "solid",
138
+ size: "default",
139
+ },
140
+ render: (args: ButtonStoryProps) => (
141
+ <Layer layer={1} style={{ padding: "24px" }}>
142
+ <Button {...args} />
143
+ </Layer>
144
+ ),
145
+ };
146
+
147
+ export const DisabledSolid: Story = {
148
+ args: {
149
+ children: "Disabled Solid",
150
+ variant: "solid",
151
+ size: "default",
152
+ disabled: true,
153
+ },
154
+ };
155
+
156
+ export const PolymorphicAsLink: Story = {
157
+ args: {
158
+ children: "Button as Link",
159
+ variant: "solid",
160
+ size: "default",
161
+ component: "a",
162
+ href: "https://example.com",
163
+ target: "_blank",
164
+ },
165
+ };
166
+
167
+ export const TruncatedLabel: Story = {
168
+ args: {
169
+ children:
170
+ "This is an exceptionally long button label designed to demonstrate how the component handles text overflow by applying an ellipsis rather than breaking the layout or wrapping to multiple lines.",
171
+ variant: "solid",
172
+ size: "default",
173
+ },
174
+ render: (args: ButtonStoryProps) => <Button {...args} />,
175
+ };
176
+
177
+ export const Loading: Story = {
178
+ args: {
179
+ children: "Saving Changes",
180
+ variant: "solid",
181
+ size: "default",
182
+ loading: true,
183
+ },
184
+ parameters: {
185
+ docs: {
186
+ description: {
187
+ story:
188
+ "When `loading={true}` is applied, the Button injects the Recursica `<Loader />` component. Per Recursica design rules, placing a Button in a loading state automatically forces the `disabled={true}` state on the underlying element. This ensures the button immediately receives the brand theme disabled opacities without relying solely on semantic logic.",
189
+ },
190
+ },
191
+ },
192
+ };
@@ -0,0 +1,76 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Card } from "./Card";
3
+ import { Button } from "../Button/Button";
4
+ import { Group } from "../Group/Group";
5
+ import { Heading } from "../Heading/Heading";
6
+ import { Text } from "../Text/Text";
7
+
8
+ const meta: Meta<typeof Card> = {
9
+ title: "UI-Kit/Card",
10
+ component: Card,
11
+ subcomponents: {
12
+ "Card.Header": Card.Header,
13
+ "Card.Content": Card.Content,
14
+ "Card.Footer": Card.Footer,
15
+ "Card.Section": Card.Section,
16
+ } as Record<string, React.ComponentType<unknown>>,
17
+ tags: ["autodocs"],
18
+ parameters: {
19
+ docs: {
20
+ description: {
21
+ component:
22
+ "The Card component acts as the foundational padded surface for grouping related information. It relies on standard internal compositional nodes (`Card.Header`, `Card.Content`, `Card.Footer`) mapped directly to the active Recursica design tokens to enforce layout gaps and margins seamlessly. Use the provided dot-notation wrappers rather than building ad-hoc generic sections.",
23
+ },
24
+ },
25
+ },
26
+ argTypes: {},
27
+ };
28
+
29
+ export default meta;
30
+
31
+ type Story = StoryObj<typeof Card>;
32
+
33
+ export const Default: Story = {
34
+ args: {},
35
+ render: ({ ...args }) => {
36
+ return (
37
+ <Card {...args}>
38
+ <Card.Header>Customer Activity Report</Card.Header>
39
+ <Card.Content>
40
+ <Text>
41
+ Card inner section content body. Notice how this acts as padded
42
+ content natively based on the overarching properties. Recursica's
43
+ vertical gutter governs vertical spacing between siblings in the
44
+ flex container.
45
+ </Text>
46
+ <Text>Another section showing the vertical gutter spacing.</Text>
47
+ </Card.Content>
48
+ <Card.Footer>
49
+ <Group justify="space-between" align="center">
50
+ <Text variant="caption">Generated today</Text>
51
+ <Button variant="solid">View Details</Button>
52
+ </Group>
53
+ </Card.Footer>
54
+ </Card>
55
+ );
56
+ },
57
+ };
58
+
59
+ export const HeaderlessAndFooterless: Story = {
60
+ args: {},
61
+ render: ({ ...args }) => {
62
+ return (
63
+ <Card {...args}>
64
+ <Card.Content>
65
+ <Heading order={6}>Notice</Heading>
66
+ <Text>
67
+ This is a completely generic card payload dropping the Header and
68
+ Footer specific elements, simply acting as a padded elevation
69
+ boundary box directly mirroring native composability!
70
+ </Text>
71
+ <Button variant="solid">Acknowledge</Button>
72
+ </Card.Content>
73
+ </Card>
74
+ );
75
+ },
76
+ };
@@ -0,0 +1,97 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Checkbox } from "./Checkbox";
3
+
4
+ const meta: Meta<typeof Checkbox> = {
5
+ title: "UI-Kit/Checkbox",
6
+ component: Checkbox,
7
+ tags: ["autodocs"],
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component: `
12
+ The \`Checkbox\` component is a precisely engineered, atomic form primitive representing boolean states natively aligned to the Recursica design system. It overrides Mantine's standard properties explicitly enforcing our variables natively across all structural boundaries.
13
+
14
+ > [!IMPORTANT]
15
+ > The atomic \`Checkbox\` is intended primarily as an internal primitive. **When wrapping multiple Checkbox elements together or rendering form controls, always utilize the \`<Checkbox.Group>\` component.** \`Checkbox.Group\` inherits the global \`FormControlWrapper\`, granting instantaneous access to macroscopic layout structuring, assistive descriptions, validation errors, and strict flex arrays.
16
+
17
+ ### Usage
18
+ To render a solitary component natively:
19
+ \`\`\`tsx
20
+ <Checkbox label="Acknowledge Terms" defaultChecked />
21
+ \`\`\`
22
+ `,
23
+ },
24
+ },
25
+ },
26
+ argTypes: {
27
+ disabled: {
28
+ control: "boolean",
29
+ },
30
+ readOnly: {
31
+ control: "boolean",
32
+ description:
33
+ "Toggles structural read-only data presentation bypassing interaction boundaries completely.",
34
+ },
35
+ controlMaxWidth: { table: { disable: true } },
36
+ controlMinWidth: { table: { disable: true } },
37
+ },
38
+ };
39
+
40
+ export default meta;
41
+
42
+ type Story = StoryObj<typeof Checkbox>;
43
+
44
+ export const Default: Story = {
45
+ args: {
46
+ disabled: false,
47
+ label: "Standard Unchecked Property",
48
+ },
49
+ };
50
+
51
+ export const SideBySideLayout: Story = {
52
+ args: {
53
+ label: "Opt-in form alignment",
54
+ formLayout: "side-by-side",
55
+ },
56
+ };
57
+
58
+ export const LongLabelWrap: Story = {
59
+ args: {
60
+ label:
61
+ "A meticulously long Checkbox label property demonstrating the absolute maximum 400px wrapper constraints actively snapping the text engine down onto a secondary wrapping line automatically without blowing out the visual boundaries.",
62
+ },
63
+ };
64
+
65
+ export const StaticVariations: Story = {
66
+ args: {},
67
+ render: () => (
68
+ <div
69
+ style={{
70
+ display: "flex",
71
+ flexDirection: "column",
72
+ gap: "24px",
73
+ }}
74
+ >
75
+ <Checkbox label="Default Unchecked State" />
76
+ <Checkbox label="Acknowledge Configuration" defaultChecked />
77
+ <Checkbox label="Indeterminate Master" indeterminate />
78
+ <Checkbox label="Disabled Variant" disabled />
79
+ <Checkbox label="Disabled Checked Variant" checked disabled />
80
+ </div>
81
+ ),
82
+ };
83
+
84
+ export const ReadOnly: Story = {
85
+ args: {},
86
+ render: () => (
87
+ <div
88
+ style={{
89
+ display: "flex",
90
+ flexDirection: "column",
91
+ gap: "24px",
92
+ }}
93
+ >
94
+ <Checkbox label="Accept Terms & Conditions" defaultChecked readOnly />
95
+ </div>
96
+ ),
97
+ };
@@ -0,0 +1,139 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Checkbox } from "./Checkbox";
3
+ import { CheckboxGroup } from "./CheckboxGroup";
4
+ import { useState } from "react";
5
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
6
+
7
+ const meta: Meta<typeof CheckboxGroup> = {
8
+ title: "UI-Kit/CheckboxGroup",
9
+ component: CheckboxGroup,
10
+ tags: ["autodocs"],
11
+ parameters: {
12
+ docs: {
13
+ description: {
14
+ component: `
15
+ The \`CheckboxGroup\` component is the mandatory organizational wrapper aggregating multiple \`Checkbox\` primitives into structurally bound unified arrays. It inherently leverages the \`FormControlWrapper\` granting native access to macroscopic layout structuring, assistive descriptions, and strict flex arrays.
16
+
17
+ We exclusively utilize the \`formLayout\` parameter to control macro-level form flow:
18
+ - **\`formLayout="stacked"\`**: Top-to-bottom layout cascading the Label bounding box down vertically into a standard stacked checkbox column array.
19
+ - **\`formLayout="side-by-side"\`**: Flow architecture pulling the grouping Label dynamically to the left while structurally organizing the internal checkboxes cleanly alongside it horizontally.
20
+
21
+ \`\`\`tsx
22
+ <Checkbox.Group
23
+ label="Execution Targets"
24
+ assistiveText="Strictly mapped structural grouping dynamically applied natively."
25
+ formLayout="stacked"
26
+ >
27
+ <Checkbox value="react" label="Browser Execution Context" />
28
+ <Checkbox value="svelte" label="Edge Nodes" />
29
+ </Checkbox.Group>
30
+ \`\`\`
31
+ `,
32
+ },
33
+ },
34
+ },
35
+ argTypes: {
36
+ ...formControlArgTypes,
37
+ readOnly: {
38
+ control: "boolean",
39
+ description:
40
+ "Toggles structural read-only data presentation bypassing interaction boundaries completely.",
41
+ },
42
+ },
43
+ };
44
+
45
+ export default meta;
46
+
47
+ type Story = StoryObj<typeof CheckboxGroup>;
48
+
49
+ export const Default: Story = {
50
+ args: {
51
+ formLayout: "stacked",
52
+ label: "Standard Group",
53
+ },
54
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
55
+ render: function StoryRender({ withLayer, layer, ...args }: any) {
56
+ const [value, setValue] = useState<string[]>([]);
57
+ return (
58
+ <Checkbox.Group {...args} value={value} onChange={setValue}>
59
+ <Checkbox value="1" label="Option 1" />
60
+ <Checkbox value="2" label="Option 2" />
61
+ </Checkbox.Group>
62
+ );
63
+ },
64
+ };
65
+
66
+ export const SideBySideLayout: Story = {
67
+ args: {
68
+ formLayout: "side-by-side",
69
+ labelOptionalText: "Recommended",
70
+ labelWithEditIcon: true,
71
+ label: "Frontend Frameworks",
72
+ assistiveText:
73
+ "Select all libraries currently in use for this specific workspace configuration.",
74
+ },
75
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
76
+ render: function StoryRender({ withLayer, layer, ...args }: any) {
77
+ const [value, setValue] = useState<string[]>(["react"]);
78
+ return (
79
+ <Checkbox.Group {...args} value={value} onChange={setValue}>
80
+ <Checkbox value="react" label="React (Standard Build)" />
81
+ <Checkbox
82
+ value="svelte"
83
+ label="The Svelte architecture which provides a highly optimized, completely compiler-driven framework avoiding virtual DOM boundaries. This massively extended text explicitly guarantees accurate wrapper constraint checking and multi-line flex alignment."
84
+ />
85
+ <Checkbox value="vue" label="Vue Configuration Map" />
86
+ </Checkbox.Group>
87
+ );
88
+ },
89
+ };
90
+
91
+ export const StackedLayout: Story = {
92
+ args: {
93
+ formLayout: "stacked",
94
+ required: true,
95
+ label: "Execution Targets",
96
+ error: "You must select at least one deployment target to compile.",
97
+ },
98
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
99
+ render: function StoryRender({ withLayer, layer, ...args }: any) {
100
+ const [value, setValue] = useState<string[]>(["react"]);
101
+ return (
102
+ <Checkbox.Group {...args} value={value} onChange={setValue}>
103
+ <Checkbox value="react" label="Browser Execution Context" />
104
+ <Checkbox
105
+ value="svelte"
106
+ label="Highly distributed Edge computing environments seamlessly bridging local runtime boundaries."
107
+ />
108
+ <Checkbox value="vue" label="Serverless Cloud Providers" />
109
+ </Checkbox.Group>
110
+ );
111
+ },
112
+ };
113
+
114
+ export const ReadOnly: Story = {
115
+ args: {
116
+ readOnly: true,
117
+ formLayout: "stacked",
118
+ required: true,
119
+ label: "Static ReadOnly Execution Locks",
120
+ assistiveText:
121
+ "This structure explicitly validates native component-level DOM preservation natively mapping lock bounds safely over interaction.",
122
+ },
123
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
124
+ render: function StoryRender({ withLayer, layer, ...args }: any) {
125
+ const [value, setValue] = useState<string[]>(["disabledNode"]);
126
+ return (
127
+ <Checkbox.Group {...args} value={value} onChange={setValue}>
128
+ <Checkbox
129
+ value="disabledNode"
130
+ label="Structurally Checked Node natively"
131
+ />
132
+ <Checkbox
133
+ value="disabledNodeEmpty"
134
+ label="Unchecked Configuration Limit"
135
+ />
136
+ </Checkbox.Group>
137
+ );
138
+ },
139
+ };
@@ -0,0 +1,128 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Chip } from "./Chip";
4
+
5
+ type ChipStoryProps = React.ComponentProps<typeof Chip>;
6
+
7
+ const meta: Meta<ChipStoryProps> = {
8
+ title: "UI-Kit/Chip",
9
+ component: Chip,
10
+ tags: ["autodocs"],
11
+ parameters: {
12
+ docs: {
13
+ description: {
14
+ component:
15
+ "The Chip component is used to represent interactive selections, descriptive tags, or dynamic filters natively bounded to Recursica variables. It can be used as a toggleable input, can render a custom leading `icon`, and handles close constraints automatically via the `onDelete` property.",
16
+ },
17
+ },
18
+ },
19
+ argTypes: {
20
+ error: {
21
+ control: "boolean",
22
+ description: "Applies the error state styling dynamically.",
23
+ },
24
+ disabled: {
25
+ control: "boolean",
26
+ description: "Applies disabled token states.",
27
+ },
28
+ checked: {
29
+ control: "boolean",
30
+ description: "Forces the visual selected state.",
31
+ },
32
+ },
33
+ };
34
+
35
+ export default meta;
36
+
37
+ type Story = StoryObj<ChipStoryProps>;
38
+
39
+ // The Default story exposing native properties for the playground.
40
+ export const Default: Story = {
41
+ args: {
42
+ children: "Default Chip",
43
+ error: false,
44
+ disabled: false,
45
+ checked: false,
46
+ },
47
+ render: (args: ChipStoryProps) => <Chip {...args} />,
48
+ };
49
+
50
+ // Static Stories for Regression Snapshots
51
+ export const Unselected: Story = {
52
+ args: {
53
+ children: "Unselected",
54
+ checked: false,
55
+ },
56
+ render: (args: ChipStoryProps) => <Chip {...args} />,
57
+ };
58
+
59
+ export const Selected: Story = {
60
+ args: {
61
+ children: "Selected",
62
+ checked: true,
63
+ },
64
+ render: (args: ChipStoryProps) => <Chip {...args} onChange={() => {}} />,
65
+ };
66
+
67
+ export const ErrorState: Story = {
68
+ args: {
69
+ children: "Error",
70
+ error: true,
71
+ checked: false,
72
+ },
73
+ render: (args: ChipStoryProps) => <Chip {...args} />,
74
+ };
75
+
76
+ export const ErrorSelected: Story = {
77
+ args: {
78
+ children: "Error Selected",
79
+ error: true,
80
+ checked: true,
81
+ },
82
+ render: (args: ChipStoryProps) => <Chip {...args} onChange={() => {}} />,
83
+ };
84
+
85
+ export const Removable: Story = {
86
+ args: {
87
+ children: "Dismissible",
88
+ checked: false,
89
+ onDelete: () => console.log("Removal Action Triggered"),
90
+ },
91
+ render: (args: ChipStoryProps) => <Chip {...args} />,
92
+ };
93
+
94
+ const leadingIcon = (
95
+ <svg
96
+ xmlns="http://www.w3.org/2000/svg"
97
+ viewBox="0 0 24 24"
98
+ fill="none"
99
+ stroke="currentColor"
100
+ strokeWidth="2"
101
+ strokeLinecap="round"
102
+ strokeLinejoin="round"
103
+ >
104
+ <circle cx="12" cy="12" r="10"></circle>
105
+ <path d="M12 8v4"></path>
106
+ <path d="M12 16h.01"></path>
107
+ </svg>
108
+ );
109
+
110
+ export const WithLeadingIcon: Story = {
111
+ args: {
112
+ children: "Leading Icon",
113
+ checked: false,
114
+ icon: leadingIcon,
115
+ },
116
+ render: (args: ChipStoryProps) => <Chip {...args} />,
117
+ };
118
+
119
+ // Selecting a chip with a leading icon swaps in the checkmark rather than showing both —
120
+ // matches MUI's native behavior of the check icon overlaying the leading icon.
121
+ export const WithLeadingIconSelected: Story = {
122
+ args: {
123
+ children: "Leading Icon Selected",
124
+ checked: true,
125
+ icon: leadingIcon,
126
+ },
127
+ render: (args: ChipStoryProps) => <Chip {...args} onChange={() => {}} />,
128
+ };