@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.
- package/.storybook/commonArgTypes.ts +148 -0
- package/CHANGELOG.md +6 -0
- package/package.json +2 -2
- package/src/Introduction.stories.tsx +149 -0
- package/src/components/Accordion/Accordion.stories.tsx +189 -0
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +68 -0
- package/src/components/AutoComplete/AutoComplete.stories.tsx +336 -0
- package/src/components/Avatar/Avatar.stories.tsx +92 -0
- package/src/components/Badge/Badge.stories.tsx +78 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +114 -0
- package/src/components/Button/Button.stories.tsx +192 -0
- package/src/components/Card/Card.stories.tsx +76 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +97 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Chip/Chip.stories.tsx +128 -0
- package/src/components/Container/Container.stories.tsx +118 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +158 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +252 -0
- package/src/components/FileInput/FileInput.stories.tsx +313 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +362 -0
- package/src/components/Flex/Flex.stories.tsx +128 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +118 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
- package/src/components/Group/Group.stories.tsx +120 -0
- package/src/components/Heading/Heading.stories.tsx +112 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +172 -0
- package/src/components/Label/Label.stories.tsx +131 -0
- package/src/components/LayoutGrid/LayoutGrid.stories.tsx +61 -0
- package/src/components/Link/Link.stories.tsx +58 -0
- package/src/components/Loader/Loader.stories.tsx +123 -0
- package/src/components/Menu/Menu.stories.tsx +370 -0
- package/src/components/Modal/Modal.stories.tsx +105 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +96 -0
- package/src/components/Pagination/Pagination.stories.tsx +48 -0
- package/src/components/Panel/Panel.stories.tsx +219 -0
- package/src/components/Popover/Popover.stories.tsx +133 -0
- package/src/components/Radio/Radio.stories.tsx +93 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +106 -0
- package/src/components/Slider/Slider.stories.tsx +282 -0
- package/src/components/Stack/Stack.stories.tsx +108 -0
- package/src/components/Stepper/Stepper.stories.tsx +148 -0
- package/src/components/Switch/Switch.stories.tsx +114 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Table/Table.stories.tsx +140 -0
- package/src/components/Tabs/Tabs.stories.tsx +154 -0
- package/src/components/Text/Text.stories.tsx +148 -0
- package/src/components/TextArea/TextArea.stories.tsx +94 -0
- package/src/components/TextField/TextField.stories.tsx +162 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +141 -0
- package/src/components/Timeline/Timeline.stories.tsx +128 -0
- package/src/components/Toast/Toast.stories.tsx +67 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +165 -0
- package/src/components/TransferList/TransferList.stories.tsx +121 -0
- package/src/components/Tree/Tree.stories.tsx +104 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* commonArgTypes.ts
|
|
3
|
+
*
|
|
4
|
+
* This file centralizes the standard Storybook Controls (ArgTypes) for all UI Kit
|
|
5
|
+
* components that natively wrap or extend the `FormControlWrapper`.
|
|
6
|
+
*
|
|
7
|
+
* PHILOSOPHY:
|
|
8
|
+
* Recursica ensures strict unified design boundaries across all form inputs (TextField,
|
|
9
|
+
* CheckboxGroup, Dropdown, etc.). Because they all share the exact same label structures,
|
|
10
|
+
* layout variants (stacked vs side-by-side), and assistive text bindings natively supplied
|
|
11
|
+
* by the `FormControlWrapper`, their Storybook experiences should be exactly identical.
|
|
12
|
+
*
|
|
13
|
+
* USAGE:
|
|
14
|
+
* Rather than recreating these controls inside every `Component.stories.tsx` file,
|
|
15
|
+
* developers must spread this object directly into the `argTypes` of their story default block:
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { formControlArgTypes } from "../../.storybook/commonArgTypes";
|
|
19
|
+
*
|
|
20
|
+
* export default {
|
|
21
|
+
* component: TextField,
|
|
22
|
+
* argTypes: {
|
|
23
|
+
* ...formControlArgTypes,
|
|
24
|
+
* // Component-specific argTypes below...
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
import type { ArgTypes } from "@storybook/react";
|
|
30
|
+
|
|
31
|
+
export const formControlArgTypes: Partial<ArgTypes> = {
|
|
32
|
+
formLayout: {
|
|
33
|
+
control: "inline-radio",
|
|
34
|
+
options: ["stacked", "side-by-side"],
|
|
35
|
+
description:
|
|
36
|
+
"Determines the structural flow layout of the Label relative to the Input.",
|
|
37
|
+
table: {
|
|
38
|
+
category: "Form Layout",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
labelSize: {
|
|
42
|
+
control: "inline-radio",
|
|
43
|
+
options: ["default", "small"],
|
|
44
|
+
description:
|
|
45
|
+
"Adjusts the typographical boundaries bounding the Label section.",
|
|
46
|
+
table: {
|
|
47
|
+
category: "Form Layout",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
labelAlignment: {
|
|
51
|
+
control: "inline-radio",
|
|
52
|
+
options: ["left", "right"],
|
|
53
|
+
description:
|
|
54
|
+
"Adjusts the explicit text alignment axis exclusively evaluating side-by-side structures.",
|
|
55
|
+
table: {
|
|
56
|
+
category: "Form Layout",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
labelOptionalText: {
|
|
60
|
+
control: "text",
|
|
61
|
+
description:
|
|
62
|
+
"Optional secondary stylistic text injected alongside the primary Label node.",
|
|
63
|
+
table: {
|
|
64
|
+
category: "Form Layout",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
labelWithEditIcon: {
|
|
68
|
+
control: "boolean",
|
|
69
|
+
description:
|
|
70
|
+
"Dynamically toggles interactivity hooks revealing the Edit context icon.",
|
|
71
|
+
table: {
|
|
72
|
+
category: "Form Layout",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
description: {
|
|
76
|
+
table: {
|
|
77
|
+
disable: true,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
assistiveText: {
|
|
81
|
+
control: "text",
|
|
82
|
+
description:
|
|
83
|
+
"Helper instructions safely dynamically anchored below the input box natively outperforming description.",
|
|
84
|
+
table: {
|
|
85
|
+
category: "Form Layout",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
assistiveWithIcon: {
|
|
89
|
+
control: "boolean",
|
|
90
|
+
description:
|
|
91
|
+
"Toggles native Recursica Info-styling rendering universally alongside the assistive block.",
|
|
92
|
+
table: {
|
|
93
|
+
category: "Form Layout",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
error: {
|
|
97
|
+
control: "text",
|
|
98
|
+
description:
|
|
99
|
+
"Dynamically maps error feedback validation strings rendering explicit error states.",
|
|
100
|
+
table: {
|
|
101
|
+
category: "Form State",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
required: {
|
|
105
|
+
control: "boolean",
|
|
106
|
+
description:
|
|
107
|
+
"Native DOM compliance flag explicitly marking the field as required natively.",
|
|
108
|
+
table: {
|
|
109
|
+
category: "Form State",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
disabled: {
|
|
113
|
+
control: "boolean",
|
|
114
|
+
description:
|
|
115
|
+
"Globally disables interactive components bounding all click and focus logic natively.",
|
|
116
|
+
table: {
|
|
117
|
+
category: "Form State",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
withAsterisk: {
|
|
121
|
+
control: "boolean",
|
|
122
|
+
description:
|
|
123
|
+
"Visually forces the mandatory asterisk presence completely independent of logical 'required' attribute properties.",
|
|
124
|
+
table: {
|
|
125
|
+
category: "Form State",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
labelActionArea: {
|
|
129
|
+
table: {
|
|
130
|
+
disable: true,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
onLabelEditClick: {
|
|
134
|
+
table: {
|
|
135
|
+
disable: true,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
controlMaxWidth: {
|
|
139
|
+
table: {
|
|
140
|
+
disable: true,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
controlMinWidth: {
|
|
144
|
+
table: {
|
|
145
|
+
disable: true,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @recursica/adapter-mantine-v8
|
|
2
2
|
|
|
3
|
+
## 1.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 712f86a: Publish the component stories and `.storybook/commonArgTypes.ts` again. adapter-tester boots the source-of-truth Storybook from the published package's stories, so without them it only showed the storybook-template stories.
|
|
8
|
+
|
|
3
9
|
## 1.3.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/borderux/recursica-adapter-mantine-v8.git"
|
|
14
14
|
},
|
|
15
|
-
"version": "1.3.
|
|
15
|
+
"version": "1.3.5",
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
33
|
"src",
|
|
34
|
-
"
|
|
34
|
+
".storybook/commonArgTypes.ts",
|
|
35
35
|
"CHANGELOG.md",
|
|
36
36
|
"llms.txt",
|
|
37
37
|
"USAGE.md",
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Meta } from "@storybook/react-vite";
|
|
2
|
+
import { AdaptersContent, MantineLogo } from "@recursica/storybook-template";
|
|
3
|
+
import { VersionInfo } from "./Version";
|
|
4
|
+
import {
|
|
5
|
+
Container,
|
|
6
|
+
Stack,
|
|
7
|
+
Group,
|
|
8
|
+
Heading,
|
|
9
|
+
Text,
|
|
10
|
+
Link,
|
|
11
|
+
Button,
|
|
12
|
+
} from "./components";
|
|
13
|
+
|
|
14
|
+
const DOCS_URL = "https://recursica.com";
|
|
15
|
+
const FORGE_URL = "https://forge.recursica.com";
|
|
16
|
+
|
|
17
|
+
function IntroductionContent() {
|
|
18
|
+
return (
|
|
19
|
+
<Container size="md" style={{ padding: "32px 0", maxWidth: 640 }}>
|
|
20
|
+
<Group gap="rec-md" mb="rec-xl" align="flex-start" wrap="nowrap">
|
|
21
|
+
<MantineLogo width={80} height={80} />
|
|
22
|
+
<Stack gap={0}>
|
|
23
|
+
<Heading order={1} m={0}>
|
|
24
|
+
Recursica Design System (Mantine Adapter)
|
|
25
|
+
</Heading>
|
|
26
|
+
<Link href="https://mantine.dev" target="_blank" rel="noreferrer">
|
|
27
|
+
mantine.dev
|
|
28
|
+
</Link>
|
|
29
|
+
</Stack>
|
|
30
|
+
</Group>
|
|
31
|
+
<Text mb="rec-xl">
|
|
32
|
+
This Storybook showcases the Recursica design system implemented for the{" "}
|
|
33
|
+
<strong>Mantine UI Kit</strong>. It provides reusable components that
|
|
34
|
+
map our design tokens to Mantine's robust component layer.
|
|
35
|
+
</Text>
|
|
36
|
+
|
|
37
|
+
<Stack mb="rec-xl">
|
|
38
|
+
<Heading order={2} mb="rec-md">
|
|
39
|
+
Looking for another UI Kit?
|
|
40
|
+
</Heading>
|
|
41
|
+
<Text mb="rec-md">
|
|
42
|
+
Are you using a different UI Kit (like Material UI)? Recursica
|
|
43
|
+
provides multiple adapters for different frameworks.
|
|
44
|
+
</Text>
|
|
45
|
+
<Group mt="rec-md">
|
|
46
|
+
<Button
|
|
47
|
+
component="a"
|
|
48
|
+
href="./?path=/story/introduction--adapters"
|
|
49
|
+
target="_parent"
|
|
50
|
+
variant="solid"
|
|
51
|
+
>
|
|
52
|
+
View Supported Adapters
|
|
53
|
+
</Button>
|
|
54
|
+
</Group>
|
|
55
|
+
</Stack>
|
|
56
|
+
|
|
57
|
+
<Stack mb="rec-xl">
|
|
58
|
+
<Heading order={2} mb="rec-md">
|
|
59
|
+
Installation
|
|
60
|
+
</Heading>
|
|
61
|
+
<Text mb="rec-md">
|
|
62
|
+
To install the Mantine adapter in your project, run:
|
|
63
|
+
</Text>
|
|
64
|
+
<Stack
|
|
65
|
+
style={{
|
|
66
|
+
padding: 12,
|
|
67
|
+
backgroundColor: "#f5f5f5",
|
|
68
|
+
borderRadius: 6,
|
|
69
|
+
fontSize: 13,
|
|
70
|
+
marginTop: 8,
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<code>
|
|
74
|
+
npm install @recursica/adapter-mantine-v8 @mantine/core
|
|
75
|
+
@mantine/hooks
|
|
76
|
+
</code>
|
|
77
|
+
</Stack>
|
|
78
|
+
</Stack>
|
|
79
|
+
|
|
80
|
+
<Stack mb="rec-xl">
|
|
81
|
+
<Heading order={2} mb="rec-md">
|
|
82
|
+
Tokens
|
|
83
|
+
</Heading>
|
|
84
|
+
<Text mb="rec-md">
|
|
85
|
+
Raw design tokens (colors, sizes, font weights, opacities, etc.) that
|
|
86
|
+
feed the theme and components. These are the primitive values defined
|
|
87
|
+
in your token set and exposed as CSS custom properties.
|
|
88
|
+
</Text>
|
|
89
|
+
</Stack>
|
|
90
|
+
|
|
91
|
+
<Stack mb="rec-xl">
|
|
92
|
+
<Heading order={2} mb="rec-md">
|
|
93
|
+
Theme
|
|
94
|
+
</Heading>
|
|
95
|
+
<Text mb="rec-md">
|
|
96
|
+
Brand and theme layer built on top of tokens. Typography types,
|
|
97
|
+
dimensions, and layout grids are defined here. Theme uses the tokens
|
|
98
|
+
and exposes both CSS variables and helper classes (e.g. typography
|
|
99
|
+
classes) for consistent styling across the product.
|
|
100
|
+
</Text>
|
|
101
|
+
</Stack>
|
|
102
|
+
|
|
103
|
+
<Stack mb="rec-xl">
|
|
104
|
+
<Heading order={2} mb="rec-md">
|
|
105
|
+
Configuring Recursica
|
|
106
|
+
</Heading>
|
|
107
|
+
<Text mb="rec-md">
|
|
108
|
+
To modify the Recursica configuration (tokens, brand, theme), go to{" "}
|
|
109
|
+
<Link href={FORGE_URL} target="_blank" rel="noopener noreferrer">
|
|
110
|
+
{FORGE_URL}
|
|
111
|
+
</Link>
|
|
112
|
+
. Changes there drive the tokens and theme you see in this Storybook.
|
|
113
|
+
</Text>
|
|
114
|
+
</Stack>
|
|
115
|
+
|
|
116
|
+
<Stack mb="rec-xl">
|
|
117
|
+
<Heading order={2} mb="rec-md">
|
|
118
|
+
Documentation
|
|
119
|
+
</Heading>
|
|
120
|
+
<Text mb="rec-md">
|
|
121
|
+
For full documentation, guides, and API reference, visit{" "}
|
|
122
|
+
<Link href={DOCS_URL} target="_blank" rel="noopener noreferrer">
|
|
123
|
+
{DOCS_URL}
|
|
124
|
+
</Link>
|
|
125
|
+
.
|
|
126
|
+
</Text>
|
|
127
|
+
</Stack>
|
|
128
|
+
</Container>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const meta = {
|
|
133
|
+
title: "Introduction",
|
|
134
|
+
} satisfies Meta;
|
|
135
|
+
|
|
136
|
+
export default meta;
|
|
137
|
+
|
|
138
|
+
export const Welcome = {
|
|
139
|
+
render: () => <IntroductionContent />,
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const Adapters = {
|
|
143
|
+
render: () => <AdaptersContent />,
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const VersionInfoStory = {
|
|
147
|
+
name: "Version Info",
|
|
148
|
+
render: () => <VersionInfo />,
|
|
149
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Accordion } from "./Accordion";
|
|
3
|
+
|
|
4
|
+
const SVGIcon = () => (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
strokeWidth="2"
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
>
|
|
16
|
+
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const ChevronIcon = () => (
|
|
21
|
+
<svg
|
|
22
|
+
width="24"
|
|
23
|
+
height="24"
|
|
24
|
+
viewBox="0 0 24 24"
|
|
25
|
+
fill="none"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
+
>
|
|
28
|
+
<path
|
|
29
|
+
d="M20.0306 9.53062L12.5306 17.0306C12.461 17.1003 12.3783 17.1557 12.2872 17.1934C12.1962 17.2312 12.0986 17.2506 12 17.2506C11.9014 17.2506 11.8038 17.2312 11.7128 17.1934C11.6218 17.1557 11.539 17.1003 11.4694 17.0306L3.96938 9.53062C3.82865 9.38988 3.74959 9.19901 3.74959 8.99999C3.74959 8.80097 3.82865 8.61009 3.96938 8.46936C4.11011 8.32863 4.30098 8.24957 4.50001 8.24957C4.69903 8.24957 4.8899 8.32863 5.03063 8.46936L12 15.4397L18.9694 8.46936C19.0391 8.39968 19.1218 8.34441 19.2128 8.30669C19.3039 8.26898 19.4015 8.24957 19.5 8.24957C19.5986 8.24957 19.6961 8.26898 19.7872 8.30669C19.8782 8.34441 19.9609 8.39968 20.0306 8.46936C20.1003 8.53905 20.1556 8.62177 20.1933 8.71282C20.231 8.80386 20.2504 8.90144 20.2504 8.99999C20.2504 9.09854 20.231 9.19612 20.1933 9.28716C20.1556 9.37821 20.1003 9.46093 20.0306 9.53062Z"
|
|
30
|
+
fill="currentColor"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const meta: Meta<typeof Accordion> = {
|
|
36
|
+
title: "UI-Kit/Accordion",
|
|
37
|
+
component: Accordion,
|
|
38
|
+
tags: ["autodocs"],
|
|
39
|
+
parameters: {
|
|
40
|
+
docs: {
|
|
41
|
+
description: {
|
|
42
|
+
component: `
|
|
43
|
+
The \`Accordion\` component intelligently wraps \`@mantine/core\`'s underlying Accordion layers while applying strict native design system mapping via \`recursica_variables_scoped.css\`.
|
|
44
|
+
|
|
45
|
+
### Hybrid Composition API (Smart-Rendering)
|
|
46
|
+
To maximize flexibility while strictly aligning with the explicit Recursica design logic, the \`AccordionItem\` operates utilizing a **Hybrid Smart-Rendering Flow**:
|
|
47
|
+
|
|
48
|
+
1. **Auto-Construction (Explicit Mapping)**:
|
|
49
|
+
If you supply the explicitly outlined Recursica properties (\`title\`, \`leftIcon\`) directly onto \`<Accordion.Item>\`, the component auto-generates the necessary \`<Accordion.Control>\` DOM layer inherently bridging the icons and titles visually while leaving the raw \`children\` wrapped neatly as the \`<Accordion.Panel>\`.
|
|
50
|
+
|
|
51
|
+
2. **Graceful Falldown (Raw Composability)**:
|
|
52
|
+
If you deliberately omit the \`title\` property, the entire mapping system gracefully falls backward yielding exactly to the raw \`@mantine/core\` composition model. Under this context, you must inject your localized \`<Accordion.Control>\` and \`<Accordion.Panel>\` configurations completely manually.
|
|
53
|
+
|
|
54
|
+
### Architecture Warning (\`open\`)
|
|
55
|
+
To structurally protect the parent wrapper's core transitions tracking architecture (\`<Accordion value="...">\`), this configuration explicitly rejects mapping isolated \`open={true}\` object states natively on specific configurations. Use Mantine's inherent sibling arrays matching the corresponding active value map!
|
|
56
|
+
`,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default meta;
|
|
63
|
+
|
|
64
|
+
export const Default: StoryObj<typeof Accordion> = {
|
|
65
|
+
render: () => {
|
|
66
|
+
return (
|
|
67
|
+
<Accordion defaultValue="item-1" chevron={<ChevronIcon />}>
|
|
68
|
+
<Accordion.Item value="item-1">
|
|
69
|
+
<Accordion.Control>Billing and Membership</Accordion.Control>
|
|
70
|
+
<Accordion.Panel>
|
|
71
|
+
You can manage your billing directly from the dashboard tab. All
|
|
72
|
+
payments are processed automatically.
|
|
73
|
+
</Accordion.Panel>
|
|
74
|
+
</Accordion.Item>
|
|
75
|
+
|
|
76
|
+
<Accordion.Item value="item-2">
|
|
77
|
+
<Accordion.Control>Refund Policy</Accordion.Control>
|
|
78
|
+
<Accordion.Panel>
|
|
79
|
+
We offer a 30-day money-back guarantee for all new subscriptions.
|
|
80
|
+
</Accordion.Panel>
|
|
81
|
+
</Accordion.Item>
|
|
82
|
+
|
|
83
|
+
<Accordion.Item value="item-3">
|
|
84
|
+
<Accordion.Control>Technical Support</Accordion.Control>
|
|
85
|
+
<Accordion.Panel>
|
|
86
|
+
Our support team is available 24/7 via live chat or email.
|
|
87
|
+
</Accordion.Panel>
|
|
88
|
+
</Accordion.Item>
|
|
89
|
+
</Accordion>
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const WithIcons: StoryObj<typeof Accordion> = {
|
|
95
|
+
render: () => {
|
|
96
|
+
return (
|
|
97
|
+
<Accordion defaultValue="security" chevron={<ChevronIcon />}>
|
|
98
|
+
<Accordion.Item value="security">
|
|
99
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
100
|
+
Security Settings
|
|
101
|
+
</Accordion.Control>
|
|
102
|
+
<Accordion.Panel>
|
|
103
|
+
Enable two-factor authentication (2FA) and monitor active sessions
|
|
104
|
+
below.
|
|
105
|
+
</Accordion.Panel>
|
|
106
|
+
</Accordion.Item>
|
|
107
|
+
|
|
108
|
+
<Accordion.Item value="privacy">
|
|
109
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
110
|
+
Privacy Configuration
|
|
111
|
+
</Accordion.Control>
|
|
112
|
+
<Accordion.Panel>
|
|
113
|
+
Choose what data is shared with our analytics partners.
|
|
114
|
+
</Accordion.Panel>
|
|
115
|
+
</Accordion.Item>
|
|
116
|
+
</Accordion>
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const LongTitleTruncation: StoryObj<typeof Accordion> = {
|
|
122
|
+
render: () => {
|
|
123
|
+
return (
|
|
124
|
+
// `style` is stripped from Accordion itself (only passes through with overStyled);
|
|
125
|
+
// constrain width on a plain wrapper div instead to force truncation.
|
|
126
|
+
<div style={{ maxWidth: 320 }}>
|
|
127
|
+
<Accordion defaultValue="long-title" chevron={<ChevronIcon />}>
|
|
128
|
+
<Accordion.Item value="long-title">
|
|
129
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
130
|
+
This is a deliberately very long accordion item title used to
|
|
131
|
+
verify that overflowing text truncates with a CSS ellipsis instead
|
|
132
|
+
of wrapping or overflowing the header
|
|
133
|
+
</Accordion.Control>
|
|
134
|
+
<Accordion.Panel>
|
|
135
|
+
The header label above should truncate to a single line with a
|
|
136
|
+
trailing ellipsis (…) rather than wrapping onto multiple lines or
|
|
137
|
+
pushing the chevron out of view.
|
|
138
|
+
</Accordion.Panel>
|
|
139
|
+
</Accordion.Item>
|
|
140
|
+
|
|
141
|
+
<Accordion.Item value="short-title">
|
|
142
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
143
|
+
Short Title
|
|
144
|
+
</Accordion.Control>
|
|
145
|
+
<Accordion.Panel>
|
|
146
|
+
A short title in the same accordion for visual comparison.
|
|
147
|
+
</Accordion.Panel>
|
|
148
|
+
</Accordion.Item>
|
|
149
|
+
</Accordion>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const Disabled: StoryObj<typeof Accordion> = {
|
|
156
|
+
render: () => {
|
|
157
|
+
return (
|
|
158
|
+
<Accordion defaultValue="expanded-disabled" chevron={<ChevronIcon />}>
|
|
159
|
+
<Accordion.Item value="expanded-disabled" disabled>
|
|
160
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
161
|
+
Expanded and Disabled
|
|
162
|
+
</Accordion.Control>
|
|
163
|
+
<Accordion.Panel>
|
|
164
|
+
This item starts expanded so the panel content's dimming can be
|
|
165
|
+
verified alongside the control's, not just the collapsed header.
|
|
166
|
+
</Accordion.Panel>
|
|
167
|
+
</Accordion.Item>
|
|
168
|
+
|
|
169
|
+
<Accordion.Item value="collapsed-disabled" disabled>
|
|
170
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
171
|
+
Collapsed and Disabled
|
|
172
|
+
</Accordion.Control>
|
|
173
|
+
<Accordion.Panel>
|
|
174
|
+
Clicking or tabbing to this control should have no effect.
|
|
175
|
+
</Accordion.Panel>
|
|
176
|
+
</Accordion.Item>
|
|
177
|
+
|
|
178
|
+
<Accordion.Item value="enabled">
|
|
179
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
180
|
+
Enabled, for Comparison
|
|
181
|
+
</Accordion.Control>
|
|
182
|
+
<Accordion.Panel>
|
|
183
|
+
A normal, interactive item alongside the disabled ones above.
|
|
184
|
+
</Accordion.Panel>
|
|
185
|
+
</Accordion.Item>
|
|
186
|
+
</Accordion>
|
|
187
|
+
);
|
|
188
|
+
},
|
|
189
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AssistiveElement } from "./AssistiveElement";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof AssistiveElement> = {
|
|
5
|
+
title: "UI-Kit/AssistiveElement",
|
|
6
|
+
component: AssistiveElement,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component:
|
|
12
|
+
"The `AssistiveElement` is a semantic structural primitive designed to standardize Helper and Error descriptive blocks natively beneath form components globally. By explicitly wiring to the `--recursica_ui-kit_components_assistive-element` layout tokens, this component safely injects custom SVGs (Alerts vs Info circles) alongside constrained flex-wrapping typography strings, preserving flawless line-height and alignment logic entirely decoupled from underlying input engine frameworks.",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
assistiveVariant: {
|
|
18
|
+
control: "radio",
|
|
19
|
+
options: ["help", "error"],
|
|
20
|
+
},
|
|
21
|
+
assistiveWithIcon: {
|
|
22
|
+
control: "boolean",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof AssistiveElement>;
|
|
30
|
+
|
|
31
|
+
export const DefaultHelp: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
children:
|
|
34
|
+
"This is a standard assistive layout explaining specific configurations.",
|
|
35
|
+
assistiveVariant: "help",
|
|
36
|
+
assistiveWithIcon: true,
|
|
37
|
+
},
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
39
|
+
render: ({ withLayer, layer, ...args }: any) => (
|
|
40
|
+
<AssistiveElement {...args} />
|
|
41
|
+
),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const ErrorState: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
children:
|
|
47
|
+
"Invalid property. You must satisfy the constraints outlined above.",
|
|
48
|
+
assistiveVariant: "error",
|
|
49
|
+
assistiveWithIcon: true,
|
|
50
|
+
},
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
52
|
+
render: ({ withLayer, layer, ...args }: any) => (
|
|
53
|
+
<AssistiveElement {...args} />
|
|
54
|
+
),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const NoIconHelp: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
children:
|
|
60
|
+
"Fallback textual representation without visual injection targets.",
|
|
61
|
+
assistiveVariant: "help",
|
|
62
|
+
assistiveWithIcon: false,
|
|
63
|
+
},
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
65
|
+
render: ({ withLayer, layer, ...args }: any) => (
|
|
66
|
+
<AssistiveElement {...args} />
|
|
67
|
+
),
|
|
68
|
+
};
|