@recursica/adapter-mui-v7 1.3.1 → 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 (75) hide show
  1. package/CHANGELOG.md +19 -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.css +1 -1
  6. package/dist/adapter-mui-v7.js +902 -880
  7. package/dist/adapter-mui-v7.js.map +1 -1
  8. package/dist/index.d.ts +8 -5
  9. package/docs/PHILOSOPHY.md +4 -0
  10. package/package.json +4 -8
  11. package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +10 -0
  12. package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +8 -0
  13. package/src/components/Panel/Panel.tsx +51 -9
  14. package/src/components/Slider/Slider.module.css +11 -0
  15. package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +12 -0
  16. package/src/components/Text/Text.headings.dom.test.tsx +54 -0
  17. package/src/components/Text/Text.tsx +16 -0
  18. package/.storybook/commonArgTypes.ts +0 -148
  19. package/recursica_brand.json +0 -2610
  20. package/recursica_tokens.json +0 -769
  21. package/recursica_ui-kit.json +0 -9049
  22. package/recursica_variables_scoped.css +0 -6178
  23. package/src/Introduction.stories.tsx +0 -178
  24. package/src/components/Accordion/Accordion.stories.tsx +0 -198
  25. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +0 -68
  26. package/src/components/AutoComplete/AutoComplete.stories.tsx +0 -336
  27. package/src/components/Avatar/Avatar.stories.tsx +0 -92
  28. package/src/components/Badge/Badge.stories.tsx +0 -78
  29. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -114
  30. package/src/components/Button/Button.stories.tsx +0 -196
  31. package/src/components/Card/Card.stories.tsx +0 -132
  32. package/src/components/Checkbox/Checkbox.stories.tsx +0 -97
  33. package/src/components/Checkbox/CheckboxGroup.stories.tsx +0 -139
  34. package/src/components/Chip/Chip.stories.tsx +0 -154
  35. package/src/components/Container/Container.stories.tsx +0 -118
  36. package/src/components/DatePicker/DatePicker.stories.tsx +0 -163
  37. package/src/components/Dropdown/Dropdown.stories.tsx +0 -252
  38. package/src/components/FileInput/FileInput.stories.tsx +0 -313
  39. package/src/components/FileUpload/FileUpload.stories.tsx +0 -362
  40. package/src/components/Flex/Flex.stories.tsx +0 -128
  41. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +0 -118
  42. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +0 -129
  43. package/src/components/Group/Group.stories.tsx +0 -120
  44. package/src/components/Heading/Heading.stories.tsx +0 -112
  45. package/src/components/HoverCard/HoverCard.stories.tsx +0 -172
  46. package/src/components/Label/Label.stories.tsx +0 -131
  47. package/src/components/LayoutGrid/LayoutGrid.stories.tsx +0 -61
  48. package/src/components/Link/Link.stories.tsx +0 -58
  49. package/src/components/Loader/Loader.stories.tsx +0 -123
  50. package/src/components/Menu/Menu.stories.tsx +0 -402
  51. package/src/components/Modal/Modal.stories.tsx +0 -105
  52. package/src/components/NumberInput/NumberInput.stories.tsx +0 -96
  53. package/src/components/Pagination/Pagination.stories.tsx +0 -48
  54. package/src/components/Panel/Panel.stories.tsx +0 -227
  55. package/src/components/Popover/Popover.stories.tsx +0 -133
  56. package/src/components/Radio/Radio.stories.tsx +0 -93
  57. package/src/components/Radio/RadioGroup.stories.tsx +0 -117
  58. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +0 -163
  59. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +0 -106
  60. package/src/components/Slider/Slider.stories.tsx +0 -282
  61. package/src/components/Stack/Stack.stories.tsx +0 -108
  62. package/src/components/Stepper/Stepper.stories.tsx +0 -157
  63. package/src/components/Switch/Switch.stories.tsx +0 -114
  64. package/src/components/Switch/SwitchGroup.stories.tsx +0 -132
  65. package/src/components/Table/Table.stories.tsx +0 -154
  66. package/src/components/Tabs/Tabs.stories.tsx +0 -174
  67. package/src/components/Text/Text.stories.tsx +0 -123
  68. package/src/components/TextArea/TextArea.stories.tsx +0 -94
  69. package/src/components/TextField/TextField.stories.tsx +0 -162
  70. package/src/components/TimePicker/TimePicker.stories.tsx +0 -155
  71. package/src/components/Timeline/Timeline.stories.tsx +0 -128
  72. package/src/components/Toast/Toast.stories.tsx +0 -67
  73. package/src/components/Tooltip/Tooltip.stories.tsx +0 -165
  74. package/src/components/TransferList/TransferList.stories.tsx +0 -121
  75. package/src/components/Tree/Tree.stories.tsx +0 -104
@@ -1,227 +0,0 @@
1
- import { useState } from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import { Panel, type PanelProps } from "./Panel";
4
- import { Button } from "../Button";
5
- import { Text } from "../Text/Text";
6
-
7
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
- type PanelStoryArgs = Record<string, any>;
9
-
10
- const meta: Meta = {
11
- title: "UI-Kit/Panel",
12
- component: Panel,
13
- tags: ["autodocs"],
14
- argTypes: {
15
- placement: {
16
- control: "select",
17
- options: ["left", "right", "top", "bottom"],
18
- description: "Side of the screen the panel slides in from.",
19
- },
20
- title: {
21
- control: "text",
22
- description: "Panel title displayed in the header.",
23
- },
24
- withOverlay: {
25
- control: "boolean",
26
- description: "Whether to display a background overlay.",
27
- },
28
- withCloseButton: {
29
- control: "boolean",
30
- description: "Whether to display the close button in the header.",
31
- },
32
- wrapHeaderText: {
33
- control: "boolean",
34
- description:
35
- "If true, forces the header text to a single line and truncates with an ellipsis.",
36
- },
37
- // Hide auto-detected HTML attributes
38
- defaultChecked: { table: { disable: true } },
39
- defaultValue: { table: { disable: true } },
40
- suppressContentEditableWarning: { table: { disable: true } },
41
- suppressHydrationWarning: { table: { disable: true } },
42
- },
43
- parameters: {
44
- layout: "fullscreen",
45
- docs: {
46
- description: {
47
- component: `
48
- The \`Panel\` component slides in or expands from the edge of the screen to reveal additional content or functionality. Built on Mui's \`Drawer\`, it enforces Recursica design tokens for styling.
49
-
50
- ### Anatomy
51
- 1. **Header** — Title and close icon, remains fixed on scroll
52
- 2. **Divider** — Separates header/footer from content
53
- 3. **Body (Slot)** — Scrollable content area for custom content
54
- 4. **Footer** — Fixed action buttons (Recursica-specific)
55
-
56
- ### Usage
57
- \`\`\`tsx
58
- const [opened, { open, close }] = useDisclosure(false);
59
-
60
- <Button onClick={open}>Open Panel</Button>
61
- <Panel opened={opened} onClose={close} title="Settings" placement="right">
62
- Content goes here
63
- <Panel.Footer>
64
- <Button variant="outline">Cancel</Button>
65
- <Button variant="solid">Save</Button>
66
- </Panel.Footer>
67
- </Panel>
68
- \`\`\`
69
- `,
70
- },
71
- },
72
- },
73
- };
74
-
75
- export default meta;
76
-
77
- type Story = StoryObj<PanelStoryArgs>;
78
-
79
- export const Default: Story = {
80
- args: {
81
- placement: "right",
82
- title: "Panel Title",
83
- withOverlay: true,
84
- withCloseButton: true,
85
- wrapHeaderText: false,
86
- },
87
- render: ({ wrapHeaderText, ...args }: PanelStoryArgs) => {
88
- // eslint-disable-next-line react-hooks/rules-of-hooks
89
- const [opened, setOpened] = useState(true);
90
-
91
- return (
92
- <>
93
- <Button variant="solid" onClick={() => setOpened(true)}>
94
- Open Panel
95
- </Button>
96
- <Panel
97
- {...(args as PanelProps)}
98
- opened={opened}
99
- onClose={() => setOpened(false)}
100
- title="Panel Title"
101
- placement="right"
102
- wrapHeaderText={wrapHeaderText}
103
- >
104
- <Text>
105
- This is the panel body content area. Panels slide in from the edge
106
- of the screen to reveal supplementary information, navigation
107
- options, or toolsets.
108
- </Text>
109
- <Panel.Footer>
110
- <Button variant="outline" onClick={() => setOpened(false)}>
111
- Cancel
112
- </Button>
113
- <Button variant="solid">Save</Button>
114
- </Panel.Footer>
115
- </Panel>
116
- </>
117
- );
118
- },
119
- };
120
-
121
- export const LeftPlacement: Story = {
122
- args: {
123
- placement: "left",
124
- title: "Navigation",
125
- withOverlay: true,
126
- withCloseButton: true,
127
- wrapHeaderText: false,
128
- },
129
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
130
- render: ({ withLayer, layer, ...args }: PanelStoryArgs) => {
131
- // eslint-disable-next-line react-hooks/rules-of-hooks
132
- const [opened, setOpened] = useState(true);
133
-
134
- return (
135
- <>
136
- <Button variant="outline" onClick={() => setOpened(true)}>
137
- Open Left Panel
138
- </Button>
139
- <Panel
140
- {...(args as PanelProps)}
141
- opened={opened}
142
- onClose={() => setOpened(false)}
143
- >
144
- <Text>
145
- A panel sliding in from the left, commonly used for navigation menus
146
- or sidebars.
147
- </Text>
148
- </Panel>
149
- </>
150
- );
151
- },
152
- };
153
-
154
- export const ScrollableContent: Story = {
155
- args: {
156
- placement: "right",
157
- title: "Scrollable Panel",
158
- withOverlay: true,
159
- withCloseButton: true,
160
- wrapHeaderText: false,
161
- },
162
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
163
- render: ({ withLayer, layer, ...args }: PanelStoryArgs) => {
164
- // eslint-disable-next-line react-hooks/rules-of-hooks
165
- const [opened, setOpened] = useState(true);
166
-
167
- return (
168
- <>
169
- <Button variant="solid" onClick={() => setOpened(true)}>
170
- Open Scrollable Panel
171
- </Button>
172
- <Panel
173
- {...(args as PanelProps)}
174
- opened={opened}
175
- onClose={() => setOpened(false)}
176
- >
177
- {Array.from({ length: 20 }).map((_, i) => (
178
- <p key={i} style={{ marginBottom: "1rem" }}>
179
- Paragraph {i + 1}: This is sample content to demonstrate the
180
- scrollable behavior of the panel when content exceeds the viewport
181
- height.
182
- </p>
183
- ))}
184
- <Panel.Footer>
185
- <Button variant="outline" onClick={() => setOpened(false)}>
186
- Close
187
- </Button>
188
- <Button variant="solid">Apply</Button>
189
- </Panel.Footer>
190
- </Panel>
191
- </>
192
- );
193
- },
194
- };
195
-
196
- export const LongTitle: Story = {
197
- args: {
198
- placement: "right",
199
- title:
200
- "This is a ridiculously long panel title designed to test how the header CSS handles text overflow and whether it truncates correctly or breaks the layout",
201
- withOverlay: true,
202
- withCloseButton: true,
203
- wrapHeaderText: true,
204
- },
205
- render: ({ ...args }: PanelStoryArgs) => {
206
- // eslint-disable-next-line react-hooks/rules-of-hooks
207
- const [opened, setOpened] = useState(true);
208
-
209
- return (
210
- <>
211
- <Button variant="solid" onClick={() => setOpened(true)}>
212
- Open Long Title Panel
213
- </Button>
214
- <Panel
215
- {...(args as PanelProps)}
216
- opened={opened}
217
- onClose={() => setOpened(false)}
218
- >
219
- <Text>
220
- Check the header to see if the long title is handled gracefully
221
- without pushing the close button off screen.
222
- </Text>
223
- </Panel>
224
- </>
225
- );
226
- },
227
- };
@@ -1,133 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Popover } from "./Popover";
3
- import { Button } from "../Button";
4
- import { Text } from "../Text/Text";
5
-
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- type PopoverStoryArgs = Record<string, any>;
8
-
9
- const meta: Meta = {
10
- title: "UI-Kit/Popover",
11
- component: Popover,
12
- tags: ["autodocs"],
13
- parameters: {
14
- controls: {
15
- // Explicitly list only the props integrators should configure — Mui's
16
- // underlying Tooltip props would otherwise leak into Controls.
17
- include: ["withBeak", "position", "defaultOpened"],
18
- },
19
- docs: {
20
- description: {
21
- component:
22
- "The `Popover` component is a composable wrapper around Mui's Tooltip in click-controlled mode. It displays a dropdown panel when the user clicks a target element.",
23
- },
24
- },
25
- },
26
- argTypes: {
27
- withBeak: {
28
- control: "boolean",
29
- description:
30
- "Whether to display a beak (arrow) pointing from the dropdown to the target.",
31
- },
32
- position: {
33
- control: "select",
34
- options: [
35
- "top",
36
- "top-start",
37
- "top-end",
38
- "bottom",
39
- "bottom-start",
40
- "bottom-end",
41
- "left",
42
- "left-start",
43
- "left-end",
44
- "right",
45
- "right-start",
46
- "right-end",
47
- ],
48
- description: "Dropdown position relative to target",
49
- },
50
- defaultOpened: {
51
- control: "boolean",
52
- description: "Initial opened state",
53
- },
54
- },
55
- };
56
-
57
- export default meta;
58
- type Story = StoryObj<PopoverStoryArgs>;
59
-
60
- export const Default: Story = {
61
- args: {
62
- withBeak: true,
63
- position: "top",
64
- },
65
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
66
- render: ({ withLayer, layer, ...args }: PopoverStoryArgs) => {
67
- return (
68
- <Popover width={250} {...args}>
69
- <Popover.Target>
70
- <Button variant="solid">Toggle Popover</Button>
71
- </Popover.Target>
72
- <Popover.Dropdown>
73
- <Text>
74
- This is the popover content. It can contain any elements you want to
75
- display when the user clicks the target.
76
- </Text>
77
- </Popover.Dropdown>
78
- </Popover>
79
- );
80
- },
81
- };
82
-
83
- export const SolidDefault: Story = {
84
- args: {
85
- withBeak: true,
86
- position: "top",
87
- defaultOpened: true,
88
- },
89
- parameters: {
90
- layout: "centered",
91
- controls: { disable: true },
92
- },
93
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
94
- render: ({ withLayer, layer, ...args }: PopoverStoryArgs) => {
95
- return (
96
- <Popover width={200} {...args}>
97
- <Popover.Target>
98
- <Button variant="solid">Toggle Popover</Button>
99
- </Popover.Target>
100
- <Popover.Dropdown>
101
- <Text>
102
- This is a static representation of an opened popover with a beak.
103
- </Text>
104
- </Popover.Dropdown>
105
- </Popover>
106
- );
107
- },
108
- };
109
-
110
- export const WithoutBeak: Story = {
111
- args: {
112
- withBeak: false,
113
- position: "bottom",
114
- defaultOpened: true,
115
- },
116
- parameters: {
117
- layout: "centered",
118
- controls: { disable: true },
119
- },
120
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
- render: ({ withLayer, layer, ...args }: PopoverStoryArgs) => {
122
- return (
123
- <Popover width={200} {...args}>
124
- <Popover.Target>
125
- <Button variant="outline">Bottom Popover</Button>
126
- </Popover.Target>
127
- <Popover.Dropdown>
128
- <Text>This popover is positioned at the bottom and has no beak.</Text>
129
- </Popover.Dropdown>
130
- </Popover>
131
- );
132
- },
133
- };
@@ -1,93 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Radio } from "./Radio";
3
-
4
- const meta: Meta<typeof Radio> = {
5
- title: "UI-Kit/Radio",
6
- component: Radio,
7
- tags: ["autodocs"],
8
- parameters: {
9
- docs: {
10
- description: {
11
- component: `
12
- The \`Radio\` component represents a fundamental standalone boolean selection node mapping to the native HTML \`<input type="radio">\`.
13
-
14
- > [!WARNING]
15
- > This component represents the isolated primitive structure. If you need macro form configurations, standard vertical alignments, side-by-side array wrappers, or integrated assistive text and error borders natively, you MUST use the \`<Radio.Group>\` orchestrator instead!
16
- `,
17
- },
18
- },
19
- },
20
- argTypes: {
21
- disabled: {
22
- control: "boolean",
23
- },
24
- checked: {
25
- control: "boolean",
26
- },
27
- readOnly: {
28
- control: "boolean",
29
- },
30
- error: {
31
- control: "boolean",
32
- },
33
- defaultChecked: {
34
- control: "boolean",
35
- },
36
- controlMaxWidth: { table: { disable: true } },
37
- controlMinWidth: { table: { disable: true } },
38
- },
39
- };
40
-
41
- export default meta;
42
-
43
- type Story = StoryObj<typeof Radio>;
44
-
45
- export const Default: Story = {
46
- args: {
47
- label: "Standard Radio Primitive",
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 CheckedState: Story = {
59
- args: {
60
- ...Default.args,
61
- defaultChecked: true,
62
- },
63
- };
64
-
65
- export const DisabledUnchecked: Story = {
66
- args: {
67
- ...Default.args,
68
- disabled: true,
69
- },
70
- };
71
-
72
- export const DisabledChecked: Story = {
73
- args: {
74
- ...Default.args,
75
- disabled: true,
76
- defaultChecked: true,
77
- },
78
- };
79
-
80
- export const ReadOnly: Story = {
81
- args: {},
82
- render: () => (
83
- <div
84
- style={{
85
- display: "flex",
86
- flexDirection: "column",
87
- gap: "24px",
88
- }}
89
- >
90
- <Radio label="Account Type" defaultChecked readOnly />
91
- </div>
92
- ),
93
- };
@@ -1,117 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Radio } from "./Radio";
3
- import { RadioGroup } from "./RadioGroup";
4
- import { useState } from "react";
5
- import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
6
-
7
- const meta: Meta<typeof RadioGroup> = {
8
- title: "UI-Kit/RadioGroup",
9
- component: RadioGroup,
10
- tags: ["autodocs"],
11
- parameters: {
12
- docs: {
13
- description: {
14
- component: `
15
- The \`RadioGroup\` component is the mandatory organizational wrapper aggregating multiple \`Radio\` primitives into structurally bound unified selection 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 radio column array.
19
- - **\`formLayout="side-by-side"\`**: Flow architecture pulling the grouping Label dynamically to the left while structurally organizing the internal radios cleanly alongside it horizontally.
20
- `,
21
- },
22
- },
23
- },
24
- argTypes: {
25
- ...formControlArgTypes,
26
- readOnly: {
27
- control: "boolean",
28
- description:
29
- "Toggles structural read-only data presentation bypassing interaction boundaries completely.",
30
- },
31
- },
32
- };
33
-
34
- export default meta;
35
-
36
- type Story = StoryObj<typeof RadioGroup>;
37
-
38
- export const Default: Story = {
39
- args: {
40
- formLayout: "stacked",
41
- label: "Standard Group",
42
- },
43
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
44
- render: function StoryRender({ withLayer, layer, ...args }: any) {
45
- const [value, setValue] = useState<string>("");
46
- return (
47
- <RadioGroup {...args} value={value} onChange={(_e, val) => setValue(val)}>
48
- <Radio value="1" label="Option 1" />
49
- <Radio value="2" label="Option 2" />
50
- </RadioGroup>
51
- );
52
- },
53
- };
54
-
55
- export const StackedLayout: Story = {
56
- args: {
57
- formLayout: "stacked",
58
- required: true,
59
- label: "Hosting Provider",
60
- error: "You must select a deployment provider.",
61
- },
62
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
63
- render: function StoryRender({ withLayer, layer, ...args }: any) {
64
- const [value, setValue] = useState<string>("aws");
65
- return (
66
- <RadioGroup {...args} value={value} onChange={(_e, val) => setValue(val)}>
67
- <Radio value="aws" label="Amazon Web Services" />
68
- <Radio
69
- value="gcp"
70
- label="Google Cloud Platform (with completely distributed edge computing environments bridging local runtime boundaries seamlessly.)"
71
- />
72
- <Radio value="azure" label="Microsoft Azure" />
73
- </RadioGroup>
74
- );
75
- },
76
- };
77
-
78
- export const SideBySideLayout: Story = {
79
- args: {
80
- formLayout: "side-by-side",
81
- labelOptionalText: "Recommended",
82
- labelWithEditIcon: true,
83
- label: "Deployment Region",
84
- assistiveText: "Select the data center closest to your user base.",
85
- },
86
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
87
- render: function StoryRender({ withLayer, layer, ...args }: any) {
88
- const [value, setValue] = useState<string>("us-east");
89
- return (
90
- <RadioGroup {...args} value={value} onChange={(_e, val) => setValue(val)}>
91
- <Radio value="us-east" label="US East (N. Virginia)" />
92
- <Radio value="us-west" label="US West (Oregon)" />
93
- <Radio value="eu-central" label="EU Central (Frankfurt)" />
94
- </RadioGroup>
95
- );
96
- },
97
- };
98
-
99
- export const ReadOnly: Story = {
100
- args: {
101
- readOnly: true,
102
- formLayout: "stacked",
103
- required: true,
104
- label: "Selected Framework",
105
- assistiveText: "This selection cannot be changed after initialization.",
106
- },
107
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
108
- render: function StoryRender({ withLayer, layer, ...args }: any) {
109
- const [value, setValue] = useState<string>("react");
110
- return (
111
- <RadioGroup {...args} value={value} onChange={(_e, val) => setValue(val)}>
112
- <Radio value="react" label="React" />
113
- <Radio value="vue" label="Vue" />
114
- </RadioGroup>
115
- );
116
- },
117
- };