@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
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Text } from "./Text";
|
|
3
|
+
import brand from "../../../recursica_brand.json";
|
|
4
|
+
|
|
5
|
+
const BUILT_IN_VARIANTS = ["body", "caption", "overline"];
|
|
6
|
+
|
|
7
|
+
// Custom styles defined under `brand.typography` (beyond h1-h6 and the built-ins above); each has
|
|
8
|
+
// an exported `recursica_brand_typography_<name>` class, so `Text` renders it by name.
|
|
9
|
+
// Sorted so the render order is stable across exports (the visual diff depends on it).
|
|
10
|
+
const customVariants = Object.keys(brand.brand.typography)
|
|
11
|
+
.filter((name) => !/^h[1-6]$/.test(name) && !BUILT_IN_VARIANTS.includes(name))
|
|
12
|
+
.sort();
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof Text> = {
|
|
15
|
+
title: "UI-Kit/Text",
|
|
16
|
+
component: Text,
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
"The standard `<Text>` component controls common body sizing scales and implicit paragraphs governed by the active theme layer. For semantic headings (`h1` through `h6`), use `<Heading>` instead.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
variant: {
|
|
28
|
+
control: "select",
|
|
29
|
+
options: [...BUILT_IN_VARIANTS, ...customVariants],
|
|
30
|
+
description:
|
|
31
|
+
"Controls the standard logical boundary definitions natively extracted from Figma.",
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
control: "select",
|
|
35
|
+
options: ["default", "warning", "alert", "success"],
|
|
36
|
+
description:
|
|
37
|
+
"Semantic text color, bound to the active layer's text-element tokens via `data-color`.",
|
|
38
|
+
},
|
|
39
|
+
emphasis: {
|
|
40
|
+
control: "inline-radio",
|
|
41
|
+
options: ["high", "low"],
|
|
42
|
+
description:
|
|
43
|
+
"Emphasis level, bound to the theme's text-emphasis opacity tokens via `data-emphasis`.",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
|
|
50
|
+
type Story = StoryObj<typeof Text>;
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
variant: "body",
|
|
55
|
+
children:
|
|
56
|
+
"This is standard body typography controlled by the central UI-kit boundaries exclusively.",
|
|
57
|
+
},
|
|
58
|
+
render: ({ ...args }) => <Text {...args} />,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const StaticVariations: Story = {
|
|
62
|
+
args: {},
|
|
63
|
+
render: () => (
|
|
64
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
65
|
+
<Text variant="body">
|
|
66
|
+
Body (Base paragraph and generic information flow)
|
|
67
|
+
</Text>
|
|
68
|
+
<Text variant="caption">
|
|
69
|
+
Caption (Data table descriptions or micro-labels)
|
|
70
|
+
</Text>
|
|
71
|
+
<Text variant="overline">
|
|
72
|
+
Overline (Card contextual pre-headers and categorical tags)
|
|
73
|
+
</Text>
|
|
74
|
+
{customVariants.map((name) => (
|
|
75
|
+
<Text key={name} variant={name}>
|
|
76
|
+
{name} (Custom style from brand.typography)
|
|
77
|
+
</Text>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const Colors: Story = {
|
|
84
|
+
args: {},
|
|
85
|
+
parameters: {
|
|
86
|
+
docs: {
|
|
87
|
+
description: {
|
|
88
|
+
story:
|
|
89
|
+
"Semantic colors map to the active layer's text-element tokens. `default` follows the layer's base text color; `warning`, `alert`, and `success` pull their respective semantic tones.",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
render: () => (
|
|
94
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
95
|
+
<Text color="default">Default (follows the layer's base text color)</Text>
|
|
96
|
+
<Text color="warning">Warning (cautionary, non-blocking messaging)</Text>
|
|
97
|
+
<Text color="alert">Alert (errors and destructive states)</Text>
|
|
98
|
+
<Text color="success">Success (confirmations and positive states)</Text>
|
|
99
|
+
</div>
|
|
100
|
+
),
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const Emphasis: Story = {
|
|
104
|
+
args: {},
|
|
105
|
+
parameters: {
|
|
106
|
+
docs: {
|
|
107
|
+
description: {
|
|
108
|
+
story:
|
|
109
|
+
"Emphasis controls text opacity via the theme's text-emphasis tokens. `high` (the default) is solid; `low` dims the text for secondary content.",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
render: () => (
|
|
114
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
115
|
+
<Text emphasis="high">
|
|
116
|
+
High emphasis (solid — primary reading content)
|
|
117
|
+
</Text>
|
|
118
|
+
<Text emphasis="low">
|
|
119
|
+
Low emphasis (dimmed — secondary or supporting content)
|
|
120
|
+
</Text>
|
|
121
|
+
</div>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const AsElement: Story = {
|
|
126
|
+
args: {},
|
|
127
|
+
parameters: {
|
|
128
|
+
docs: {
|
|
129
|
+
description: {
|
|
130
|
+
story:
|
|
131
|
+
"`component` renders Text as an inline `span`, a `label` or a `div`. `h1` to `h6` throw; use `<Heading>`.",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
render: () => (
|
|
136
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
137
|
+
<Text>Default is a block paragraph.</Text>
|
|
138
|
+
<div>
|
|
139
|
+
Inline text:{" "}
|
|
140
|
+
<Text component="span" emphasis="low">
|
|
141
|
+
a span inside a line
|
|
142
|
+
</Text>
|
|
143
|
+
.
|
|
144
|
+
</div>
|
|
145
|
+
<Text component="label">A label</Text>
|
|
146
|
+
</div>
|
|
147
|
+
),
|
|
148
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { TextArea } from "./TextArea";
|
|
4
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
5
|
+
|
|
6
|
+
type TextAreaStoryProps = React.ComponentProps<typeof TextArea>;
|
|
7
|
+
|
|
8
|
+
const meta: Meta<TextAreaStoryProps> = {
|
|
9
|
+
title: "UI-Kit/TextArea",
|
|
10
|
+
component: TextArea,
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
"TextArea provides a multi-line input field, mapping layout explicitly over the standardized FormControlWrapper.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
label: "Description",
|
|
22
|
+
assistiveText: "Enter your full description here.",
|
|
23
|
+
disabled: false,
|
|
24
|
+
required: false,
|
|
25
|
+
readOnly: false,
|
|
26
|
+
autosize: false,
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
disabled: {
|
|
30
|
+
control: "boolean",
|
|
31
|
+
},
|
|
32
|
+
...formControlArgTypes,
|
|
33
|
+
readOnly: {
|
|
34
|
+
control: "boolean",
|
|
35
|
+
},
|
|
36
|
+
autosize: {
|
|
37
|
+
control: "boolean",
|
|
38
|
+
},
|
|
39
|
+
minRows: {
|
|
40
|
+
control: "number",
|
|
41
|
+
},
|
|
42
|
+
maxRows: {
|
|
43
|
+
control: "number",
|
|
44
|
+
},
|
|
45
|
+
value: {
|
|
46
|
+
control: "text",
|
|
47
|
+
},
|
|
48
|
+
placeholder: {
|
|
49
|
+
control: "text",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
55
|
+
|
|
56
|
+
type Story = StoryObj<TextAreaStoryProps>;
|
|
57
|
+
|
|
58
|
+
export const Default: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
placeholder: "Type something long...",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Autosize: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
label: "Auto-sizing TextArea",
|
|
67
|
+
autosize: true,
|
|
68
|
+
minRows: 2,
|
|
69
|
+
maxRows: 6,
|
|
70
|
+
placeholder: "Type multiple lines here. Watch it grow!",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const StaticError: Story = {
|
|
75
|
+
args: {
|
|
76
|
+
error: "This field requires a detailed explanation.",
|
|
77
|
+
value: "Some bad input.",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const StaticDisabled: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
disabled: true,
|
|
84
|
+
value: "This content is locked.",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const StaticReadOnly: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
label: "Read Only View",
|
|
91
|
+
readOnly: true,
|
|
92
|
+
value: "This text is safely frozen in read-only form.",
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { TextField } from "./TextField";
|
|
3
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
4
|
+
const meta: Meta<typeof TextField> = {
|
|
5
|
+
title: "UI-Kit/TextField",
|
|
6
|
+
component: TextField,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `
|
|
12
|
+
The \`TextField\` primitive functions as a universal text entry input natively integrated directly into the unified \`FormControlWrapper\` architecture.
|
|
13
|
+
|
|
14
|
+
### Architectural Decoupling
|
|
15
|
+
Recursica forcibly overrides the internal Mantine \`Input.Wrapper\` defaults injecting an untamed \`<Input>\` layout primitive perfectly mapped back into our rigid design systems. State modifiers (e.g. Focus, Errors) hook flawlessly back onto our CSS module mapping variable colors strictly accurately.
|
|
16
|
+
|
|
17
|
+
### Examples
|
|
18
|
+
Always structure horizontal architectures via the generic \`formLayout\` parameter.
|
|
19
|
+
\`\`\`tsx
|
|
20
|
+
<TextField
|
|
21
|
+
label="Primary Network Socket"
|
|
22
|
+
assistiveText="Ensure connections resolve seamlessly."
|
|
23
|
+
formLayout="stacked"
|
|
24
|
+
/>
|
|
25
|
+
\`\`\`
|
|
26
|
+
`,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
...formControlArgTypes,
|
|
32
|
+
disabled: {
|
|
33
|
+
control: "boolean",
|
|
34
|
+
description:
|
|
35
|
+
"Maps the formal disabled variable states structurally to the input core.",
|
|
36
|
+
},
|
|
37
|
+
error: {
|
|
38
|
+
control: "text",
|
|
39
|
+
description:
|
|
40
|
+
"Applies the strict error string boundary rendering invalid structures seamlessly.",
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
control: "boolean",
|
|
44
|
+
},
|
|
45
|
+
label: {
|
|
46
|
+
control: "text",
|
|
47
|
+
},
|
|
48
|
+
assistiveText: {
|
|
49
|
+
control: "text",
|
|
50
|
+
},
|
|
51
|
+
readOnly: {
|
|
52
|
+
control: "boolean",
|
|
53
|
+
description:
|
|
54
|
+
"Toggles structural read-only data presentation explicitly blocking standard component bindings.",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default meta;
|
|
60
|
+
|
|
61
|
+
type Story = StoryObj<typeof TextField>;
|
|
62
|
+
|
|
63
|
+
export const Default: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
disabled: false,
|
|
66
|
+
label: "Authentication Token",
|
|
67
|
+
placeholder: "Enter validation hash...",
|
|
68
|
+
assistiveText:
|
|
69
|
+
"Tokens are stored identically locally and strictly ephemeral.",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const FormsSideBySide: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
label: "Distributed Access Control",
|
|
76
|
+
placeholder: "admin@node.local",
|
|
77
|
+
assistiveText:
|
|
78
|
+
"Specify the exact cluster administrative credentials enforcing strict domain policies. This violently long string tests native textual wrapping safely mapping alongside inputs.",
|
|
79
|
+
formLayout: "side-by-side",
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const WithLeadingIcon: Story = {
|
|
84
|
+
args: {
|
|
85
|
+
label: "Search Global Context",
|
|
86
|
+
placeholder: "Search for repositories...",
|
|
87
|
+
leftSection: (
|
|
88
|
+
<svg
|
|
89
|
+
width="24"
|
|
90
|
+
height="24"
|
|
91
|
+
viewBox="0 0 24 24"
|
|
92
|
+
fill="none"
|
|
93
|
+
stroke="currentColor"
|
|
94
|
+
strokeWidth="2"
|
|
95
|
+
strokeLinecap="round"
|
|
96
|
+
strokeLinejoin="round"
|
|
97
|
+
>
|
|
98
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
99
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
100
|
+
</svg>
|
|
101
|
+
),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const WithTrailingIcon: Story = {
|
|
106
|
+
args: {
|
|
107
|
+
label: "Validation URL",
|
|
108
|
+
placeholder: "https://recursica.dev",
|
|
109
|
+
rightSection: (
|
|
110
|
+
<svg
|
|
111
|
+
width="24"
|
|
112
|
+
height="24"
|
|
113
|
+
viewBox="0 0 24 24"
|
|
114
|
+
fill="none"
|
|
115
|
+
stroke="currentColor"
|
|
116
|
+
strokeWidth="2"
|
|
117
|
+
strokeLinecap="round"
|
|
118
|
+
strokeLinejoin="round"
|
|
119
|
+
>
|
|
120
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
121
|
+
</svg>
|
|
122
|
+
),
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const Disabled: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
label: "Disabled Deployment Node",
|
|
129
|
+
placeholder: "Disabled primitive map...",
|
|
130
|
+
disabled: true,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const ErrorState: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
label: "Cluster Failure",
|
|
137
|
+
placeholder: "Failing component instance...",
|
|
138
|
+
defaultValue: "Invalid Execution Plan",
|
|
139
|
+
error:
|
|
140
|
+
"Critical runtime node disconnect detected traversing DOM architecture.",
|
|
141
|
+
required: true,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const StaticReadOnly: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
label: "Static ReadOnly Review",
|
|
148
|
+
placeholder: "Ignored...",
|
|
149
|
+
value: "Explicitly Uneditable Bound Output",
|
|
150
|
+
readOnly: true,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const EditableReadOnly: Story = {
|
|
155
|
+
args: {
|
|
156
|
+
label: "Editable ReadOnly Review",
|
|
157
|
+
placeholder: "Ignored until active...",
|
|
158
|
+
defaultValue: "Waiting for Edit Execution",
|
|
159
|
+
readOnly: true,
|
|
160
|
+
labelWithEditIcon: true,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { TimePicker } from "./TimePicker";
|
|
3
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TimePicker> = {
|
|
6
|
+
title: "UI-Kit/TimePicker",
|
|
7
|
+
component: TimePicker,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: `
|
|
13
|
+
The \`TimePicker\` primitive provides a segmented hour/minute (optionally seconds) time entry input, paired with a dedicated AM/PM \`Dropdown\`-style selector, integrated directly into the \`FormControlWrapper\` architecture. This 12-hour + AM/PM composite is the only way this component operates — a Recursica-specific design, not a user-configurable option.
|
|
14
|
+
|
|
15
|
+
### Examples
|
|
16
|
+
Always structure horizontal architectures via the generic \`formLayout\` parameter.
|
|
17
|
+
\`\`\`tsx
|
|
18
|
+
<TimePicker
|
|
19
|
+
label="Start Time"
|
|
20
|
+
assistiveText="Select the deployment kick-off time."
|
|
21
|
+
formLayout="stacked"
|
|
22
|
+
/>
|
|
23
|
+
\`\`\`
|
|
24
|
+
`,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
...formControlArgTypes,
|
|
30
|
+
disabled: {
|
|
31
|
+
control: "boolean",
|
|
32
|
+
description:
|
|
33
|
+
"Maps the formal disabled variable states structurally to the input core.",
|
|
34
|
+
},
|
|
35
|
+
error: {
|
|
36
|
+
control: "text",
|
|
37
|
+
description:
|
|
38
|
+
"Applies the strict error string boundary rendering invalid structures seamlessly.",
|
|
39
|
+
},
|
|
40
|
+
required: {
|
|
41
|
+
control: "boolean",
|
|
42
|
+
},
|
|
43
|
+
label: {
|
|
44
|
+
control: "text",
|
|
45
|
+
},
|
|
46
|
+
assistiveText: {
|
|
47
|
+
control: "text",
|
|
48
|
+
},
|
|
49
|
+
readOnly: {
|
|
50
|
+
control: "boolean",
|
|
51
|
+
description:
|
|
52
|
+
"Toggles structural read-only data presentation explicitly blocking standard component bindings.",
|
|
53
|
+
},
|
|
54
|
+
withSeconds: {
|
|
55
|
+
control: "boolean",
|
|
56
|
+
description: "Shows and allows editing the seconds segment.",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
62
|
+
|
|
63
|
+
type Story = StoryObj<typeof TimePicker>;
|
|
64
|
+
|
|
65
|
+
export const Default: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
disabled: false,
|
|
68
|
+
label: "Meeting Time",
|
|
69
|
+
assistiveText: "Choose the start time in your local timezone.",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const FormsSideBySide: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
label: "Incident Start Time",
|
|
76
|
+
assistiveText: "When did the incident originally occur?",
|
|
77
|
+
formLayout: "side-by-side",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const WithSeconds: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
label: "Precise Execution Time",
|
|
84
|
+
assistiveText: "Includes a seconds segment for exact scheduling.",
|
|
85
|
+
withSeconds: true,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const Disabled: Story = {
|
|
90
|
+
args: {
|
|
91
|
+
label: "Disabled Time Slot",
|
|
92
|
+
disabled: true,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const ErrorState: Story = {
|
|
97
|
+
args: {
|
|
98
|
+
label: "Deployment Window",
|
|
99
|
+
error: "The chosen time falls outside the allowed deployment window.",
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const WithLeadingIcon: Story = {
|
|
105
|
+
args: {
|
|
106
|
+
label: "Meeting Time",
|
|
107
|
+
assistiveText: "Choose the start time in your local timezone.",
|
|
108
|
+
leftSection: (
|
|
109
|
+
<svg
|
|
110
|
+
width="24"
|
|
111
|
+
height="24"
|
|
112
|
+
viewBox="0 0 24 24"
|
|
113
|
+
fill="none"
|
|
114
|
+
stroke="currentColor"
|
|
115
|
+
strokeWidth="2"
|
|
116
|
+
strokeLinecap="round"
|
|
117
|
+
strokeLinejoin="round"
|
|
118
|
+
>
|
|
119
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
120
|
+
<polyline points="12 6 12 12 16 14"></polyline>
|
|
121
|
+
</svg>
|
|
122
|
+
),
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const StaticReadOnly: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
label: "Static ReadOnly Review",
|
|
129
|
+
value: "14:30",
|
|
130
|
+
readOnly: true,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const EditableReadOnly: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
label: "Editable ReadOnly Review",
|
|
137
|
+
defaultValue: "09:00",
|
|
138
|
+
readOnly: true,
|
|
139
|
+
labelWithEditIcon: true,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Timeline } from "./Timeline";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Timeline> = {
|
|
5
|
+
title: "UI-Kit/Timeline",
|
|
6
|
+
component: Timeline,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
defaultChecked: { table: { disable: true } },
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Timeline>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
active: 1,
|
|
20
|
+
},
|
|
21
|
+
render: (args) => (
|
|
22
|
+
<Timeline {...args}>
|
|
23
|
+
<Timeline.Item
|
|
24
|
+
title="Commit created"
|
|
25
|
+
timestamp="Yesterday"
|
|
26
|
+
bulletVariant="default"
|
|
27
|
+
>
|
|
28
|
+
You pushed 3 new commits to the repository.
|
|
29
|
+
</Timeline.Item>
|
|
30
|
+
<Timeline.Item
|
|
31
|
+
title="Pull request opened"
|
|
32
|
+
timestamp="2 days ago"
|
|
33
|
+
bulletVariant="default"
|
|
34
|
+
>
|
|
35
|
+
You opened a pull request for the feature branch.
|
|
36
|
+
</Timeline.Item>
|
|
37
|
+
<Timeline.Item
|
|
38
|
+
title="Code review completed"
|
|
39
|
+
timestamp="1 week ago"
|
|
40
|
+
bulletVariant="default"
|
|
41
|
+
>
|
|
42
|
+
Your pull request was approved by 2 reviewers.
|
|
43
|
+
</Timeline.Item>
|
|
44
|
+
<Timeline.Item
|
|
45
|
+
title="Branch merged"
|
|
46
|
+
timestamp="2 weeks ago"
|
|
47
|
+
bulletVariant="default"
|
|
48
|
+
>
|
|
49
|
+
Your feature branch was successfully merged into main.
|
|
50
|
+
</Timeline.Item>
|
|
51
|
+
</Timeline>
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const BulletVariants: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
active: 1,
|
|
58
|
+
},
|
|
59
|
+
render: (args) => (
|
|
60
|
+
<Timeline {...args}>
|
|
61
|
+
<Timeline.Item
|
|
62
|
+
title="Default Bullet"
|
|
63
|
+
timestamp="Standard configuration"
|
|
64
|
+
bulletVariant="default"
|
|
65
|
+
>
|
|
66
|
+
The default un-configured structural dot.
|
|
67
|
+
</Timeline.Item>
|
|
68
|
+
<Timeline.Item
|
|
69
|
+
title="Icon Bullet"
|
|
70
|
+
timestamp="Standard sized icons"
|
|
71
|
+
bulletVariant="icon"
|
|
72
|
+
bullet={
|
|
73
|
+
<svg
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
fill="none"
|
|
76
|
+
stroke="currentColor"
|
|
77
|
+
strokeWidth="2"
|
|
78
|
+
strokeLinecap="round"
|
|
79
|
+
strokeLinejoin="round"
|
|
80
|
+
>
|
|
81
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
82
|
+
</svg>
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
A standard structural icon node mapping.
|
|
86
|
+
</Timeline.Item>
|
|
87
|
+
<Timeline.Item
|
|
88
|
+
title="Alternative Icon"
|
|
89
|
+
timestamp="Larger structural bounds"
|
|
90
|
+
bulletVariant="icon-alternative"
|
|
91
|
+
bullet={
|
|
92
|
+
<svg
|
|
93
|
+
viewBox="0 0 24 24"
|
|
94
|
+
fill="none"
|
|
95
|
+
stroke="currentColor"
|
|
96
|
+
strokeWidth="2"
|
|
97
|
+
strokeLinecap="round"
|
|
98
|
+
strokeLinejoin="round"
|
|
99
|
+
>
|
|
100
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
101
|
+
</svg>
|
|
102
|
+
}
|
|
103
|
+
>
|
|
104
|
+
A slightly larger alternative bounding box for specialized icons.
|
|
105
|
+
</Timeline.Item>
|
|
106
|
+
<Timeline.Item
|
|
107
|
+
title="Avatar Bullet"
|
|
108
|
+
timestamp="Profile pictures"
|
|
109
|
+
bulletVariant="avatar"
|
|
110
|
+
bullet={
|
|
111
|
+
<img
|
|
112
|
+
src="https://avatars.githubusercontent.com/u/10353856?s=460&v=4"
|
|
113
|
+
alt="avatar"
|
|
114
|
+
style={{
|
|
115
|
+
width: "100%",
|
|
116
|
+
height: "100%",
|
|
117
|
+
objectFit: "cover",
|
|
118
|
+
borderRadius: "inherit",
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
Avatar mappings inherently drop borders and leverage specific opacity
|
|
124
|
+
states.
|
|
125
|
+
</Timeline.Item>
|
|
126
|
+
</Timeline>
|
|
127
|
+
),
|
|
128
|
+
};
|