@recursica/adapter-mui-v7 1.3.2 → 1.3.3

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 (73) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/adapter-mui-v7.cjs +16 -16
  4. package/dist/adapter-mui-v7.cjs.map +1 -1
  5. package/dist/adapter-mui-v7.js +902 -880
  6. package/dist/adapter-mui-v7.js.map +1 -1
  7. package/dist/index.d.ts +8 -5
  8. package/docs/PHILOSOPHY.md +4 -0
  9. package/package.json +4 -8
  10. package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +10 -0
  11. package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +8 -0
  12. package/src/components/Panel/Panel.tsx +51 -9
  13. package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +12 -0
  14. package/src/components/Text/Text.headings.dom.test.tsx +54 -0
  15. package/src/components/Text/Text.tsx +16 -0
  16. package/.storybook/commonArgTypes.ts +0 -148
  17. package/recursica_brand.json +0 -2610
  18. package/recursica_tokens.json +0 -769
  19. package/recursica_ui-kit.json +0 -9049
  20. package/recursica_variables_scoped.css +0 -6178
  21. package/src/Introduction.stories.tsx +0 -178
  22. package/src/components/Accordion/Accordion.stories.tsx +0 -198
  23. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +0 -68
  24. package/src/components/AutoComplete/AutoComplete.stories.tsx +0 -336
  25. package/src/components/Avatar/Avatar.stories.tsx +0 -92
  26. package/src/components/Badge/Badge.stories.tsx +0 -78
  27. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -114
  28. package/src/components/Button/Button.stories.tsx +0 -196
  29. package/src/components/Card/Card.stories.tsx +0 -132
  30. package/src/components/Checkbox/Checkbox.stories.tsx +0 -97
  31. package/src/components/Checkbox/CheckboxGroup.stories.tsx +0 -139
  32. package/src/components/Chip/Chip.stories.tsx +0 -154
  33. package/src/components/Container/Container.stories.tsx +0 -118
  34. package/src/components/DatePicker/DatePicker.stories.tsx +0 -163
  35. package/src/components/Dropdown/Dropdown.stories.tsx +0 -252
  36. package/src/components/FileInput/FileInput.stories.tsx +0 -313
  37. package/src/components/FileUpload/FileUpload.stories.tsx +0 -362
  38. package/src/components/Flex/Flex.stories.tsx +0 -128
  39. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +0 -118
  40. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +0 -129
  41. package/src/components/Group/Group.stories.tsx +0 -120
  42. package/src/components/Heading/Heading.stories.tsx +0 -112
  43. package/src/components/HoverCard/HoverCard.stories.tsx +0 -172
  44. package/src/components/Label/Label.stories.tsx +0 -131
  45. package/src/components/LayoutGrid/LayoutGrid.stories.tsx +0 -61
  46. package/src/components/Link/Link.stories.tsx +0 -58
  47. package/src/components/Loader/Loader.stories.tsx +0 -123
  48. package/src/components/Menu/Menu.stories.tsx +0 -402
  49. package/src/components/Modal/Modal.stories.tsx +0 -105
  50. package/src/components/NumberInput/NumberInput.stories.tsx +0 -96
  51. package/src/components/Pagination/Pagination.stories.tsx +0 -48
  52. package/src/components/Panel/Panel.stories.tsx +0 -227
  53. package/src/components/Popover/Popover.stories.tsx +0 -133
  54. package/src/components/Radio/Radio.stories.tsx +0 -93
  55. package/src/components/Radio/RadioGroup.stories.tsx +0 -117
  56. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +0 -163
  57. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +0 -106
  58. package/src/components/Slider/Slider.stories.tsx +0 -282
  59. package/src/components/Stack/Stack.stories.tsx +0 -108
  60. package/src/components/Stepper/Stepper.stories.tsx +0 -157
  61. package/src/components/Switch/Switch.stories.tsx +0 -114
  62. package/src/components/Switch/SwitchGroup.stories.tsx +0 -132
  63. package/src/components/Table/Table.stories.tsx +0 -154
  64. package/src/components/Tabs/Tabs.stories.tsx +0 -174
  65. package/src/components/Text/Text.stories.tsx +0 -123
  66. package/src/components/TextArea/TextArea.stories.tsx +0 -94
  67. package/src/components/TextField/TextField.stories.tsx +0 -162
  68. package/src/components/TimePicker/TimePicker.stories.tsx +0 -155
  69. package/src/components/Timeline/Timeline.stories.tsx +0 -128
  70. package/src/components/Toast/Toast.stories.tsx +0 -67
  71. package/src/components/Tooltip/Tooltip.stories.tsx +0 -165
  72. package/src/components/TransferList/TransferList.stories.tsx +0 -121
  73. package/src/components/Tree/Tree.stories.tsx +0 -104
@@ -1,174 +0,0 @@
1
- import React, { useState } from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import { Tabs, Tab, TabPanel } from "./Tabs";
4
- import { TabContext } from "@mui/lab";
5
- import { Flex } from "../Flex/Flex";
6
-
7
- const meta: Meta<typeof Tabs> = {
8
- title: "UI-Kit/Tabs",
9
- component: Tabs,
10
- tags: ["autodocs"],
11
- parameters: {
12
- layout: "centered",
13
- },
14
- argTypes: {
15
- variant: {
16
- control: "radio",
17
- options: ["default", "outline", "pills"],
18
- },
19
- orientation: {
20
- control: "radio",
21
- options: ["horizontal", "vertical"],
22
- },
23
- // @ts-expect-error Custom prop not in native TabsProps
24
- disabled: {
25
- control: "boolean",
26
- },
27
- defaultChecked: {
28
- table: {
29
- disable: true,
30
- },
31
- },
32
- },
33
- };
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof Tabs>;
37
-
38
- const InteractiveTabs = (
39
- args: React.ComponentProps<typeof Tabs> & {
40
- disabled?: boolean;
41
- inverted?: boolean;
42
- },
43
- ) => {
44
- const [value, setValue] = useState("gallery");
45
-
46
- const handleChange = (_event: React.SyntheticEvent, newValue: string) => {
47
- setValue(newValue);
48
- };
49
-
50
- return (
51
- <Flex
52
- direction={args.orientation === "vertical" ? "row" : "column"}
53
- style={{ width: 600, height: 300 }}
54
- >
55
- <TabContext value={value}>
56
- <Tabs value={value} onChange={handleChange} {...args}>
57
- <Tab
58
- value="gallery"
59
- label="Gallery"
60
- disabled={args.disabled}
61
- icon={
62
- <svg
63
- xmlns="http://www.w3.org/2000/svg"
64
- viewBox="0 0 24 24"
65
- fill="none"
66
- stroke="currentColor"
67
- strokeWidth="2"
68
- strokeLinecap="round"
69
- strokeLinejoin="round"
70
- width={16}
71
- height={16}
72
- >
73
- <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
74
- <circle cx="8.5" cy="8.5" r="1.5"></circle>
75
- <polyline points="21 15 16 10 5 21"></polyline>
76
- </svg>
77
- }
78
- iconPosition="start"
79
- />
80
- <Tab
81
- value="messages"
82
- label="Messages"
83
- disabled={args.disabled}
84
- icon={
85
- <svg
86
- xmlns="http://www.w3.org/2000/svg"
87
- viewBox="0 0 24 24"
88
- fill="none"
89
- stroke="currentColor"
90
- strokeWidth="2"
91
- strokeLinecap="round"
92
- strokeLinejoin="round"
93
- width={16}
94
- height={16}
95
- >
96
- <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
97
- </svg>
98
- }
99
- iconPosition="start"
100
- />
101
- <Tab
102
- value="settings"
103
- label="Settings"
104
- disabled={args.disabled}
105
- icon={
106
- <svg
107
- xmlns="http://www.w3.org/2000/svg"
108
- viewBox="0 0 24 24"
109
- fill="none"
110
- stroke="currentColor"
111
- strokeWidth="2"
112
- strokeLinecap="round"
113
- strokeLinejoin="round"
114
- width={16}
115
- height={16}
116
- >
117
- <circle cx="12" cy="12" r="3"></circle>
118
- <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
119
- </svg>
120
- }
121
- iconPosition="start"
122
- />
123
- </Tabs>
124
-
125
- <TabPanel value="gallery">Gallery tab content</TabPanel>
126
-
127
- <TabPanel value="messages">Messages tab content</TabPanel>
128
-
129
- <TabPanel value="settings">Settings tab content</TabPanel>
130
- </TabContext>
131
- </Flex>
132
- );
133
- };
134
-
135
- export const Default: Story = {
136
- render: (args) => <InteractiveTabs {...args} />,
137
- args: {
138
- variant: "default",
139
- orientation: "horizontal",
140
- },
141
- };
142
-
143
- export const Outline: Story = {
144
- render: (args) => <InteractiveTabs {...args} />,
145
- args: {
146
- variant: "outline",
147
- orientation: "horizontal",
148
- },
149
- };
150
-
151
- export const Pills: Story = {
152
- render: (args) => <InteractiveTabs {...args} />,
153
- args: {
154
- variant: "pills",
155
- orientation: "horizontal",
156
- },
157
- };
158
-
159
- export const Vertical: Story = {
160
- render: (args) => <InteractiveTabs {...args} />,
161
- args: {
162
- variant: "default",
163
- orientation: "vertical",
164
- },
165
- };
166
-
167
- export const Inverted: Story = {
168
- render: (args) => <InteractiveTabs {...args} />,
169
- args: {
170
- variant: "default",
171
- orientation: "horizontal",
172
- inverted: true,
173
- },
174
- };
@@ -1,123 +0,0 @@
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 theme's text-element tokens via `data-color`.",
38
- },
39
- emphasis: {
40
- control: "select",
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
- };
@@ -1,94 +0,0 @@
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
- };
@@ -1,162 +0,0 @@
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
- };
@@ -1,155 +0,0 @@
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
- controls: {
11
- include: [
12
- "value",
13
- "defaultValue",
14
- "disabled",
15
- "error",
16
- "required",
17
- "label",
18
- "assistiveText",
19
- "readOnly",
20
- "withSeconds",
21
- "formLayout",
22
- ],
23
- },
24
- docs: {
25
- description: {
26
- component: `
27
- The \`TimePicker\` primitive provides a 12-hour time field (via \`@mui/x-date-pickers\`) paired with a dedicated AM/PM \`Dropdown\`-style selector, integrated directly into the \`FormControlWrapper\` architecture. This composite is the only way this component operates — a Recursica-specific design, not a user-configurable option.
28
-
29
- ### Examples
30
- Always structure horizontal architectures via the generic \`formLayout\` parameter.
31
- \`\`\`tsx
32
- <TimePicker
33
- label="Start Time"
34
- assistiveText="Select the deployment kick-off time."
35
- formLayout="stacked"
36
- />
37
- \`\`\`
38
- `,
39
- },
40
- },
41
- },
42
- argTypes: {
43
- ...formControlArgTypes,
44
- disabled: {
45
- control: "boolean",
46
- description:
47
- "Maps the formal disabled variable states structurally to the input core.",
48
- },
49
- error: {
50
- control: "text",
51
- description:
52
- "Applies the strict error string boundary rendering invalid structures seamlessly.",
53
- },
54
- required: {
55
- control: "boolean",
56
- },
57
- label: {
58
- control: "text",
59
- },
60
- assistiveText: {
61
- control: "text",
62
- },
63
- readOnly: {
64
- control: "boolean",
65
- description:
66
- "Toggles structural read-only data presentation explicitly blocking standard component bindings.",
67
- },
68
- withSeconds: {
69
- control: "boolean",
70
- description: "Shows and allows editing the seconds segment.",
71
- },
72
- },
73
- };
74
-
75
- export default meta;
76
-
77
- type Story = StoryObj<typeof TimePicker>;
78
-
79
- export const Default: Story = {
80
- args: {
81
- disabled: false,
82
- label: "Meeting Time",
83
- assistiveText: "Choose the start time in your local timezone.",
84
- },
85
- };
86
-
87
- export const FormsSideBySide: Story = {
88
- args: {
89
- label: "Incident Start Time",
90
- assistiveText: "When did the incident originally occur?",
91
- formLayout: "side-by-side",
92
- },
93
- };
94
-
95
- export const WithSeconds: Story = {
96
- args: {
97
- label: "Precise Execution Time",
98
- assistiveText: "Includes a seconds segment for exact scheduling.",
99
- withSeconds: true,
100
- },
101
- };
102
-
103
- export const Disabled: Story = {
104
- args: {
105
- label: "Disabled Time Slot",
106
- disabled: true,
107
- },
108
- };
109
-
110
- export const ErrorState: Story = {
111
- args: {
112
- label: "Deployment Window",
113
- error: "The chosen time falls outside the allowed deployment window.",
114
- required: true,
115
- },
116
- };
117
-
118
- export const WithLeadingIcon: Story = {
119
- args: {
120
- label: "Meeting Time",
121
- assistiveText: "Choose the start time in your local timezone.",
122
- leftSection: (
123
- <svg
124
- width="24"
125
- height="24"
126
- viewBox="0 0 24 24"
127
- fill="none"
128
- stroke="currentColor"
129
- strokeWidth="2"
130
- strokeLinecap="round"
131
- strokeLinejoin="round"
132
- >
133
- <circle cx="12" cy="12" r="10"></circle>
134
- <polyline points="12 6 12 12 16 14"></polyline>
135
- </svg>
136
- ),
137
- },
138
- };
139
-
140
- export const StaticReadOnly: Story = {
141
- args: {
142
- label: "Static ReadOnly Review",
143
- value: "14:30",
144
- readOnly: true,
145
- },
146
- };
147
-
148
- export const EditableReadOnly: Story = {
149
- args: {
150
- label: "Editable ReadOnly Review",
151
- defaultValue: "09:00",
152
- readOnly: true,
153
- labelWithEditIcon: true,
154
- },
155
- };