@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,128 +0,0 @@
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
- };
@@ -1,67 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Toast } from "./Toast";
3
-
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- type ToastStoryArgs = Record<string, any>;
6
-
7
- const meta = {
8
- title: "UI-Kit/Toast",
9
- component: Toast,
10
- tags: ["autodocs"],
11
- parameters: {
12
- docs: {
13
- description: {
14
- component:
15
- "The `Toast` component is a standalone visual component wrapping Mui's `Alert`. Note that this component is visually decoupled from `@mui/material/Snackbar` and is meant to be used when you need to render a static or manually-controlled notification panel.",
16
- },
17
- },
18
- },
19
- argTypes: {
20
- title: {
21
- control: "text",
22
- description: "Title displayed above the message body",
23
- },
24
- children: {
25
- control: "text",
26
- description: "Main notification message",
27
- },
28
- withCloseButton: {
29
- control: "boolean",
30
- description: "Whether the close button is visible",
31
- },
32
- },
33
- } satisfies Meta<typeof Toast>;
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof meta>;
37
-
38
- export const Default: Story = {
39
- args: {
40
- variant: "default",
41
- title: "Update Available",
42
- children:
43
- "A new version of the application is available to download. Please restart your browser to apply the latest security patches and feature updates. If you ignore this message, the update will automatically install during your next session.",
44
- withCloseButton: true,
45
- },
46
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
- render: ({ withLayer, layer, ...args }: ToastStoryArgs) => {
48
- return <Toast {...args} />;
49
- },
50
- };
51
-
52
- export const WithIcon: Story = {
53
- args: {
54
- variant: "default",
55
- title: "Action Required",
56
- children:
57
- "You must complete your profile setup before accessing this feature.",
58
- icon: "⚠️",
59
- },
60
- parameters: {
61
- controls: { disable: true },
62
- },
63
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
64
- render: ({ withLayer, layer, ...args }: ToastStoryArgs) => {
65
- return <Toast {...args} />;
66
- },
67
- };
@@ -1,165 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Tooltip, type TooltipProps } from "./Tooltip";
3
- import { Button } from "../Button";
4
-
5
- /**
6
- * Tooltip story axes:
7
- * - position: tooltip alignment relative to target
8
- * - withBeak: beak (arrow) indicator on the tooltip
9
- * - openDelay / closeDelay: hover timing controls
10
- * - multiline: text wrapping behavior
11
- * - disabled: suppress the tooltip entirely
12
- * - layer: tested via the global Layer decorator (withLayer/layer args)
13
- */
14
-
15
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- type TooltipStoryArgs = Record<string, any>;
17
-
18
- const meta: Meta = {
19
- title: "UI-Kit/Tooltip",
20
- component: Tooltip,
21
- tags: ["autodocs"],
22
- argTypes: {
23
- label: {
24
- control: "text",
25
- description: "Content displayed inside the tooltip.",
26
- },
27
- position: {
28
- control: "select",
29
- options: [
30
- "bottom",
31
- "bottom-start",
32
- "bottom-end",
33
- "top",
34
- "top-start",
35
- "top-end",
36
- "left",
37
- "left-start",
38
- "left-end",
39
- "right",
40
- "right-start",
41
- "right-end",
42
- ],
43
- description: "The position of the tooltip relative to the target.",
44
- },
45
- withBeak: {
46
- control: "boolean",
47
- description:
48
- "Whether to display a beak (arrow) pointing to the target. Recursica equivalent of Mantine's withArrow.",
49
- },
50
- offset: {
51
- control: "number",
52
- description: "Distance in px between the tooltip and the target element.",
53
- },
54
- openDelay: {
55
- control: "number",
56
- description: "Delay in ms before the tooltip opens on hover.",
57
- },
58
- closeDelay: {
59
- control: "number",
60
- description: "Delay in ms before the tooltip closes when hover ends.",
61
- },
62
- disabled: {
63
- control: "boolean",
64
- description: "If set, the tooltip will not be rendered.",
65
- },
66
- opened: {
67
- control: "boolean",
68
- description:
69
- "Force the tooltip to stay open. Useful for inspecting styling.",
70
- },
71
- // Hide auto-detected HTML attributes that leak from ElementProps<'div'>
72
- defaultChecked: { table: { disable: true } },
73
- defaultValue: { table: { disable: true } },
74
- suppressContentEditableWarning: { table: { disable: true } },
75
- suppressHydrationWarning: { table: { disable: true } },
76
- },
77
- parameters: {
78
- layout: "centered",
79
- docs: {
80
- description: {
81
- component: `
82
- The \`Tooltip\` component displays a floating label when the user hovers over or focuses a target element. It wraps Mantine's \`Tooltip\` while enforcing strict Recursica design token styling.
83
-
84
- ### API
85
-
86
- Unlike \`HoverCard\`, Tooltip is a single component — content is passed via the \`label\` prop:
87
- \`\`\`tsx
88
- <Tooltip label="Helpful text" withBeak>
89
- <Button>Hover me</Button>
90
- </Tooltip>
91
- \`\`\`
92
-
93
- ### Static Sub-Components
94
- - \`Tooltip.Floating\` — A tooltip that follows the cursor position
95
- - \`Tooltip.Group\` — Groups multiple tooltips to share hover delay
96
-
97
- ### Key Behaviors
98
- - The beak (arrow) is shown by default (\`withBeak={true}\`)
99
- - Supports \`openDelay\` and \`closeDelay\` for timing control
100
- - Set \`multiline\` to allow text wrapping within max-width
101
- `,
102
- },
103
- },
104
- },
105
- };
106
-
107
- export default meta;
108
-
109
- type Story = StoryObj<TooltipStoryArgs>;
110
-
111
- export const Default: Story = {
112
- args: {
113
- label: "This is a helpful tooltip",
114
- position: "top",
115
- withBeak: true,
116
- offset: 5,
117
- openDelay: 0,
118
- closeDelay: 0,
119
- disabled: false,
120
- },
121
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
122
- render: ({ withLayer, layer, ...args }: TooltipStoryArgs) => {
123
- return (
124
- <Tooltip {...(args as TooltipProps)}>
125
- <Button variant="solid">Hover me</Button>
126
- </Tooltip>
127
- );
128
- },
129
- };
130
-
131
- export const WithoutBeak: Story = {
132
- args: {
133
- label: "Tooltip without a beak indicator",
134
- position: "top",
135
- withBeak: false,
136
- offset: 5,
137
- },
138
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
139
- render: ({ withLayer, layer, ...args }: TooltipStoryArgs) => {
140
- return (
141
- <Tooltip {...(args as TooltipProps)}>
142
- <Button variant="outline">Without Beak</Button>
143
- </Tooltip>
144
- );
145
- },
146
- };
147
-
148
- export const LongContent: Story = {
149
- args: {
150
- label:
151
- "This is a longer tooltip message that demonstrates how text wraps within the maximum width defined by the design system.",
152
- position: "top",
153
- withBeak: true,
154
- opened: true,
155
- offset: 5,
156
- },
157
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
158
- render: ({ withLayer, layer, ...args }: TooltipStoryArgs) => {
159
- return (
160
- <Tooltip {...(args as TooltipProps)}>
161
- <Button variant="solid">Long Content</Button>
162
- </Tooltip>
163
- );
164
- },
165
- };
@@ -1,121 +0,0 @@
1
- import React from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import { TransferList } from "./TransferList";
4
- import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
5
-
6
- type TransferListStoryProps = React.ComponentProps<typeof TransferList>;
7
-
8
- const SAMPLE_DATA: TransferListStoryProps["defaultData"] = [
9
- [
10
- { value: "alpha", label: "Alpha" },
11
- { value: "bravo", label: "Bravo" },
12
- { value: "charlie", label: "Charlie" },
13
- { value: "delta", label: "Delta" },
14
- { value: "echo", label: "Echo" },
15
- ],
16
- [{ value: "foxtrot", label: "Foxtrot" }],
17
- ];
18
-
19
- const GROUPED_DATA: TransferListStoryProps["defaultData"] = [
20
- [
21
- { value: "apple", label: "Apple", group: "Fruit" },
22
- { value: "banana", label: "Banana", group: "Fruit" },
23
- { value: "carrot", label: "Carrot", group: "Vegetable" },
24
- { value: "daikon", label: "Daikon", group: "Vegetable" },
25
- { value: "eagle", label: "Eagle" },
26
- ],
27
- [],
28
- ];
29
-
30
- const meta: Meta<TransferListStoryProps> = {
31
- title: "UI-Kit/TransferList",
32
- component: TransferList,
33
- tags: ["autodocs"],
34
- parameters: {
35
- docs: {
36
- description: {
37
- component:
38
- "TransferList (dual listbox) lets users move items between two lists. Composes FormControlWrapper, TextField, Checkbox, CheckboxGroup, Badge, and Button.",
39
- },
40
- },
41
- },
42
- args: {
43
- label: "Assign users",
44
- assistiveText: "Move users into the selected list.",
45
- defaultData: SAMPLE_DATA,
46
- disabled: false,
47
- required: false,
48
- },
49
- argTypes: {
50
- disabled: {
51
- control: "boolean",
52
- },
53
- ...formControlArgTypes,
54
- sourceLabel: {
55
- control: "text",
56
- },
57
- targetLabel: {
58
- control: "text",
59
- },
60
- searchable: {
61
- control: "boolean",
62
- },
63
- searchPlaceholder: {
64
- control: "text",
65
- },
66
- },
67
- };
68
-
69
- export default meta;
70
-
71
- type Story = StoryObj<TransferListStoryProps>;
72
-
73
- export const Default: Story = {};
74
-
75
- export const Grouped: Story = {
76
- args: {
77
- label: "Assign ingredients",
78
- defaultData: GROUPED_DATA,
79
- },
80
- };
81
-
82
- export const SideBySide: Story = {
83
- args: {
84
- formLayout: "side-by-side",
85
- },
86
- };
87
-
88
- export const NoSearch: Story = {
89
- args: {
90
- label: "Assign users (no filtering)",
91
- searchable: false,
92
- },
93
- };
94
-
95
- export const StaticError: Story = {
96
- args: {
97
- error: "Select at least one user.",
98
- defaultData: [[], SAMPLE_DATA![0]],
99
- },
100
- };
101
-
102
- export const StaticDisabled: Story = {
103
- args: {
104
- disabled: true,
105
- },
106
- };
107
-
108
- export const Empty: Story = {
109
- args: {
110
- label: "Assign users",
111
- defaultData: [[], []],
112
- },
113
- };
114
-
115
- export const ReadOnly: Story = {
116
- args: {
117
- label: "Assigned users",
118
- defaultData: [[], SAMPLE_DATA![0]],
119
- readOnly: true,
120
- },
121
- };
@@ -1,104 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Tree } from "./Tree";
3
- import { Layer, type RecursicaTreeNode } from "@recursica/adapter-common";
4
-
5
- const sampleData: RecursicaTreeNode[] = [
6
- {
7
- value: "documents",
8
- label: "Documents",
9
- children: [
10
- { value: "documents/resume.pdf", label: "resume.pdf" },
11
- { value: "documents/cover-letter.docx", label: "cover-letter.docx" },
12
- {
13
- value: "documents/taxes",
14
- label: "Taxes",
15
- children: [
16
- { value: "documents/taxes/2023.pdf", label: "2023.pdf" },
17
- { value: "documents/taxes/2024.pdf", label: "2024.pdf" },
18
- ],
19
- },
20
- ],
21
- },
22
- {
23
- value: "photos",
24
- label: "Photos",
25
- children: [
26
- { value: "photos/vacation.jpg", label: "vacation.jpg" },
27
- { value: "photos/family.jpg", label: "family.jpg" },
28
- ],
29
- },
30
- { value: "readme.md", label: "readme.md" },
31
- ];
32
-
33
- const meta: Meta<typeof Tree> = {
34
- title: "UI-Kit/Tree",
35
- component: Tree,
36
- tags: ["autodocs"],
37
- parameters: {
38
- docs: {
39
- description: {
40
- component: `
41
- The \`Tree\` component renders hierarchical \`data\` as an expandable/selectable tree, wrapping \`@mui/x-tree-view\`'s \`RichTreeView\` with a fully custom item renderer so every visual property (row box model, selected/unselected colors and typography, indent, item spacing) comes from Recursica's \`tree\` design tokens.
42
-
43
- Each node needs a unique \`value\` and a \`label\`; a \`children\` array (even empty) makes a node expandable.
44
- `,
45
- },
46
- },
47
- },
48
- };
49
-
50
- export default meta;
51
-
52
- export const Default: StoryObj<typeof Tree> = {
53
- render: () => (
54
- <Tree data={sampleData} initialExpandedValues={["documents"]} />
55
- ),
56
- };
57
-
58
- export const AllExpanded: StoryObj<typeof Tree> = {
59
- render: () => <Tree data={sampleData} initialExpandedValues="*" />,
60
- };
61
-
62
- export const PreSelected: StoryObj<typeof Tree> = {
63
- render: () => (
64
- <Tree
65
- data={sampleData}
66
- initialExpandedValues={["documents"]}
67
- initialSelectedValues={["documents/resume.pdf"]}
68
- />
69
- ),
70
- };
71
-
72
- export const MultipleSelection: StoryObj<typeof Tree> = {
73
- render: () => (
74
- <Tree
75
- data={sampleData}
76
- initialExpandedValues="*"
77
- initialSelectedValues={["documents/resume.pdf", "photos/vacation.jpg"]}
78
- multiple
79
- />
80
- ),
81
- };
82
-
83
- /** Whole tree disabled, with a node pre-selected so the selected chip's styling under the
84
- * disabled dimming can be checked alongside unselected rows. */
85
- export const Disabled: StoryObj<typeof Tree> = {
86
- render: () => (
87
- <Tree
88
- data={sampleData}
89
- initialExpandedValues={["documents"]}
90
- initialSelectedValues={["documents/resume.pdf"]}
91
- disabled
92
- />
93
- ),
94
- };
95
-
96
- /** Demonstrates the component nested inside a non-default layer — the one case where an
97
- * explicit `<Layer>` wrap belongs in a story (see COMPONENT_STORYBOOK_GUIDE.md §9). */
98
- export const LayerOne: StoryObj<typeof Tree> = {
99
- render: () => (
100
- <Layer layer={1} style={{ padding: "24px" }}>
101
- <Tree data={sampleData} initialExpandedValues={["documents"]} />
102
- </Layer>
103
- ),
104
- };