@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,178 +0,0 @@
1
- import type { Meta } from "@storybook/react-vite";
2
- import { AdaptersContent, MuiLogo } from "@recursica/storybook-template";
3
- import { VersionInfo } from "./Version";
4
-
5
- const DOCS_URL = "https://recursica.com";
6
- const FORGE_URL = "https://forge.recursica.com";
7
-
8
- import { Box } from "@mui/material";
9
- import { Container, Group, Heading, Text, Link } from "./components";
10
-
11
- function IntroductionContent() {
12
- return (
13
- <Container size="md" style={{ padding: "32px 0", maxWidth: 640 }}>
14
- <Group gap="rec-md" mb={2}>
15
- <MuiLogo width={40} height={40} />
16
- <Box>
17
- <Heading order={1} m={0}>
18
- Recursica Design System (MUI Adapter)
19
- </Heading>
20
- <Link href="https://mui.com" target="_blank" rel="noreferrer">
21
- mui.com
22
- </Link>
23
- </Box>
24
- </Group>
25
- <Text mb={4}>
26
- This Storybook showcases the Recursica design system implemented for the{" "}
27
- <strong>Material UI (MUI) Kit</strong>. It provides reusable components
28
- that map our design tokens to MUI's robust component layer.
29
- </Text>
30
-
31
- <Box component="section" sx={{ mb: 4 }}>
32
- <Heading order={2} mb={1}>
33
- Looking for another UI Kit?
34
- </Heading>
35
- <Text>
36
- Are you using a different UI Kit (like Mantine)? Recursica provides
37
- multiple adapters for different frameworks.
38
- </Text>
39
- <Box sx={{ mt: 2 }}>
40
- <a
41
- href="./?path=/story/introduction--adapters"
42
- target="_parent"
43
- className="adapter-btn"
44
- style={{
45
- display: "inline-flex",
46
- alignItems: "center",
47
- justifyContent: "center",
48
- backgroundColor:
49
- "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_background)",
50
- color:
51
- "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text)",
52
- textDecoration: "none",
53
- borderRadius:
54
- "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_border-radius)",
55
- height:
56
- "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_height)",
57
- padding:
58
- "0 var(--recursica_ui-kit_components_button_variants_sizes_default_properties_horizontal-padding)",
59
- fontFamily:
60
- "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-family)",
61
- fontSize:
62
- "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-size)",
63
- fontWeight:
64
- "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight)",
65
- boxShadow:
66
- "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_elevation)",
67
- border:
68
- "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_border-size) solid var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_border-color)",
69
- transition: "opacity 0.2s ease",
70
- }}
71
- onMouseOver={(e) => {
72
- e.currentTarget.style.opacity = "0.85";
73
- e.currentTarget.style.color =
74
- "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text-hover)";
75
- }}
76
- onMouseOut={(e) => {
77
- e.currentTarget.style.opacity = "1";
78
- e.currentTarget.style.color =
79
- "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text)";
80
- }}
81
- >
82
- View Supported Adapters
83
- </a>
84
- </Box>
85
- </Box>
86
-
87
- <Box component="section" sx={{ mb: 4 }}>
88
- <Heading order={2} mb={1}>
89
- Installation
90
- </Heading>
91
- <Text>To install the MUI adapter in your project, run:</Text>
92
- <Box
93
- component="pre"
94
- sx={{
95
- p: 1.5,
96
- bgcolor: "grey.100",
97
- borderRadius: 1,
98
- fontSize: 13,
99
- mt: 1,
100
- }}
101
- >
102
- <code>
103
- npm install @recursica/adapter-mui-v7 @mui/material @emotion/react
104
- @emotion/styled
105
- </code>
106
- </Box>
107
- </Box>
108
-
109
- <Box component="section" sx={{ mb: 4 }}>
110
- <Heading order={2} mb={1}>
111
- Tokens
112
- </Heading>
113
- <Text>
114
- Raw design tokens (colors, sizes, font weights, opacities, etc.) that
115
- feed the theme and components. These are the primitive values defined
116
- in your token set and exposed as CSS custom properties.
117
- </Text>
118
- </Box>
119
-
120
- <Box component="section" sx={{ mb: 4 }}>
121
- <Heading order={2} mb={1}>
122
- Theme
123
- </Heading>
124
- <Text>
125
- Brand and theme layer built on top of tokens. Typography types,
126
- dimensions, and layout grids are defined here. Theme uses the tokens
127
- and exposes both CSS variables and helper classes (e.g. typography
128
- classes) for consistent styling across the product.
129
- </Text>
130
- </Box>
131
-
132
- <Box component="section" sx={{ mb: 4 }}>
133
- <Heading order={2} mb={1}>
134
- Configuring Recursica
135
- </Heading>
136
- <Text>
137
- To modify the Recursica configuration (tokens, brand, theme), go to{" "}
138
- <Link href={FORGE_URL} target="_blank" rel="noopener noreferrer">
139
- {FORGE_URL}
140
- </Link>
141
- . Changes there drive the tokens and theme you see in this Storybook.
142
- </Text>
143
- </Box>
144
-
145
- <Box component="section" sx={{ mb: 4 }}>
146
- <Heading order={2} mb={1}>
147
- Documentation
148
- </Heading>
149
- <Text>
150
- For full documentation, guides, and API reference, visit{" "}
151
- <Link href={DOCS_URL} target="_blank" rel="noopener noreferrer">
152
- {DOCS_URL}
153
- </Link>
154
- .
155
- </Text>
156
- </Box>
157
- </Container>
158
- );
159
- }
160
-
161
- const meta = {
162
- title: "Introduction",
163
- } satisfies Meta;
164
-
165
- export default meta;
166
-
167
- export const Welcome = {
168
- render: () => <IntroductionContent />,
169
- };
170
-
171
- export const Adapters = {
172
- render: () => <AdaptersContent />,
173
- };
174
-
175
- export const VersionInfoStory = {
176
- name: "Version Info",
177
- render: () => <VersionInfo />,
178
- };
@@ -1,198 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Accordion } from "./Accordion";
3
- import { Layer } from "@recursica/adapter-common";
4
-
5
- const SVGIcon = () => (
6
- <svg
7
- xmlns="http://www.w3.org/2000/svg"
8
- width="24"
9
- height="24"
10
- viewBox="0 0 24 24"
11
- fill="none"
12
- stroke="currentColor"
13
- strokeWidth="2"
14
- strokeLinecap="round"
15
- strokeLinejoin="round"
16
- >
17
- <path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
18
- </svg>
19
- );
20
-
21
- const ChevronIcon = () => (
22
- <svg
23
- width="24"
24
- height="24"
25
- viewBox="0 0 24 24"
26
- fill="none"
27
- xmlns="http://www.w3.org/2000/svg"
28
- >
29
- <path
30
- d="M20.0306 9.53062L12.5306 17.0306C12.461 17.1003 12.3783 17.1557 12.2872 17.1934C12.1962 17.2312 12.0986 17.2506 12 17.2506C11.9014 17.2506 11.8038 17.2312 11.7128 17.1934C11.6218 17.1557 11.539 17.1003 11.4694 17.0306L3.96938 9.53062C3.82865 9.38988 3.74959 9.19901 3.74959 8.99999C3.74959 8.80097 3.82865 8.61009 3.96938 8.46936C4.11011 8.32863 4.30098 8.24957 4.50001 8.24957C4.69903 8.24957 4.8899 8.32863 5.03063 8.46936L12 15.4397L18.9694 8.46936C19.0391 8.39968 19.1218 8.34441 19.2128 8.30669C19.3039 8.26898 19.4015 8.24957 19.5 8.24957C19.5986 8.24957 19.6961 8.26898 19.7872 8.30669C19.8782 8.34441 19.9609 8.39968 20.0306 8.46936C20.1003 8.53905 20.1556 8.62177 20.1933 8.71282C20.231 8.80386 20.2504 8.90144 20.2504 8.99999C20.2504 9.09854 20.231 9.19612 20.1933 9.28716C20.1556 9.37821 20.1003 9.46093 20.0306 9.53062Z"
31
- fill="currentColor"
32
- />
33
- </svg>
34
- );
35
-
36
- const meta: Meta<typeof Accordion> = {
37
- title: "UI-Kit/Accordion",
38
- component: Accordion,
39
- tags: ["autodocs"],
40
- parameters: {
41
- docs: {
42
- description: {
43
- component: `
44
- The \`Accordion\` component intelligently wraps \`@mantine/core\`'s underlying Accordion layers while applying strict native design system mapping via \`recursica_variables_scoped.css\`.
45
-
46
- ### Hybrid Composition API (Smart-Rendering)
47
- To maximize flexibility while strictly aligning with the explicit Recursica design logic, the \`AccordionItem\` operates utilizing a **Hybrid Smart-Rendering Flow**:
48
-
49
- 1. **Auto-Construction (Explicit Mapping)**:
50
- If you supply the explicitly outlined Recursica properties (\`title\`, \`leftIcon\`) directly onto \`<Accordion.Item>\`, the component auto-generates the necessary \`<Accordion.Control>\` DOM layer inherently bridging the icons and titles visually while leaving the raw \`children\` wrapped neatly as the \`<Accordion.Panel>\`.
51
-
52
- 2. **Graceful Falldown (Raw Composability)**:
53
- If you deliberately omit the \`title\` property, the entire mapping system gracefully falls backward yielding exactly to the raw \`@mantine/core\` composition model. Under this context, you must inject your localized \`<Accordion.Control>\` and \`<Accordion.Panel>\` configurations completely manually.
54
-
55
- ### Architecture Warning (\`open\`)
56
- To structurally protect the parent wrapper's core transitions tracking architecture (\`<Accordion value="...">\`), this configuration explicitly rejects mapping isolated \`open={true}\` object states natively on specific configurations. Use Mantine's inherent sibling arrays matching the corresponding active value map!
57
- `,
58
- },
59
- },
60
- },
61
- };
62
-
63
- export default meta;
64
-
65
- export const Default: StoryObj<typeof Accordion> = {
66
- render: () => {
67
- return (
68
- <Layer layer={0} style={{ padding: "24px" }}>
69
- <Accordion defaultValue="item-1" chevron={<ChevronIcon />}>
70
- <Accordion.Item value="item-1">
71
- <Accordion.Control>Billing and Membership</Accordion.Control>
72
- <Accordion.Panel>
73
- You can manage your billing directly from the dashboard tab. All
74
- payments are processed automatically.
75
- </Accordion.Panel>
76
- </Accordion.Item>
77
-
78
- <Accordion.Item value="item-2">
79
- <Accordion.Control>Refund Policy</Accordion.Control>
80
- <Accordion.Panel>
81
- We offer a 30-day money-back guarantee for all new subscriptions.
82
- </Accordion.Panel>
83
- </Accordion.Item>
84
-
85
- <Accordion.Item value="item-3">
86
- <Accordion.Control>Technical Support</Accordion.Control>
87
- <Accordion.Panel>
88
- Our support team is available 24/7 via live chat or email.
89
- </Accordion.Panel>
90
- </Accordion.Item>
91
- </Accordion>
92
- </Layer>
93
- );
94
- },
95
- };
96
-
97
- export const WithIcons: StoryObj<typeof Accordion> = {
98
- render: () => {
99
- return (
100
- <Layer layer={0} style={{ padding: "24px" }}>
101
- <Accordion defaultValue="security" chevron={<ChevronIcon />}>
102
- <Accordion.Item value="security">
103
- <Accordion.Control leftIcon={<SVGIcon />}>
104
- Security Settings
105
- </Accordion.Control>
106
- <Accordion.Panel>
107
- Enable two-factor authentication (2FA) and monitor active sessions
108
- below.
109
- </Accordion.Panel>
110
- </Accordion.Item>
111
-
112
- <Accordion.Item value="privacy">
113
- <Accordion.Control leftIcon={<SVGIcon />}>
114
- Privacy Configuration
115
- </Accordion.Control>
116
- <Accordion.Panel>
117
- Choose what data is shared with our analytics partners.
118
- </Accordion.Panel>
119
- </Accordion.Item>
120
- </Accordion>
121
- </Layer>
122
- );
123
- },
124
- };
125
-
126
- export const LongTitleTruncation: StoryObj<typeof Accordion> = {
127
- render: () => {
128
- return (
129
- // `style` is stripped from Accordion itself (only passes through with overStyled);
130
- // constrain width on a plain wrapper div instead to force truncation.
131
- <Layer layer={0} style={{ padding: "24px" }}>
132
- <div style={{ maxWidth: 320 }}>
133
- <Accordion defaultValue="long-title" chevron={<ChevronIcon />}>
134
- <Accordion.Item value="long-title">
135
- <Accordion.Control leftIcon={<SVGIcon />}>
136
- This is a deliberately very long accordion item title used to
137
- verify that overflowing text truncates with a CSS ellipsis
138
- instead of wrapping or overflowing the header
139
- </Accordion.Control>
140
- <Accordion.Panel>
141
- The header label above should truncate to a single line with a
142
- trailing ellipsis (…) rather than wrapping onto multiple lines
143
- or pushing the chevron out of view.
144
- </Accordion.Panel>
145
- </Accordion.Item>
146
-
147
- <Accordion.Item value="short-title">
148
- <Accordion.Control leftIcon={<SVGIcon />}>
149
- Short Title
150
- </Accordion.Control>
151
- <Accordion.Panel>
152
- A short title in the same accordion for visual comparison.
153
- </Accordion.Panel>
154
- </Accordion.Item>
155
- </Accordion>
156
- </div>
157
- </Layer>
158
- );
159
- },
160
- };
161
-
162
- export const Disabled: StoryObj<typeof Accordion> = {
163
- render: () => {
164
- return (
165
- <Layer layer={0} style={{ padding: "24px" }}>
166
- <Accordion defaultValue="expanded-disabled" chevron={<ChevronIcon />}>
167
- <Accordion.Item value="expanded-disabled" disabled>
168
- <Accordion.Control leftIcon={<SVGIcon />}>
169
- Expanded and Disabled
170
- </Accordion.Control>
171
- <Accordion.Panel>
172
- This item starts expanded so the panel content's dimming can be
173
- verified alongside the control's, not just the collapsed header.
174
- </Accordion.Panel>
175
- </Accordion.Item>
176
-
177
- <Accordion.Item value="collapsed-disabled" disabled>
178
- <Accordion.Control leftIcon={<SVGIcon />}>
179
- Collapsed and Disabled
180
- </Accordion.Control>
181
- <Accordion.Panel>
182
- Clicking or tabbing to this control should have no effect.
183
- </Accordion.Panel>
184
- </Accordion.Item>
185
-
186
- <Accordion.Item value="enabled">
187
- <Accordion.Control leftIcon={<SVGIcon />}>
188
- Enabled, for Comparison
189
- </Accordion.Control>
190
- <Accordion.Panel>
191
- A normal, interactive item alongside the disabled ones above.
192
- </Accordion.Panel>
193
- </Accordion.Item>
194
- </Accordion>
195
- </Layer>
196
- );
197
- },
198
- };
@@ -1,68 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { AssistiveElement } from "./AssistiveElement";
3
-
4
- const meta: Meta<typeof AssistiveElement> = {
5
- title: "UI-Kit/AssistiveElement",
6
- component: AssistiveElement,
7
- tags: ["autodocs"],
8
- parameters: {
9
- docs: {
10
- description: {
11
- component:
12
- "The `AssistiveElement` is a semantic structural primitive designed to standardize Helper and Error descriptive blocks natively beneath form components globally. By explicitly wiring to the `--recursica_ui-kit_components_assistive-element` layout tokens, this component safely injects custom SVGs (Alerts vs Info circles) alongside constrained flex-wrapping typography strings, preserving flawless line-height and alignment logic entirely decoupled from underlying input engine frameworks.",
13
- },
14
- },
15
- },
16
- argTypes: {
17
- assistiveVariant: {
18
- control: "radio",
19
- options: ["help", "error"],
20
- },
21
- assistiveWithIcon: {
22
- control: "boolean",
23
- },
24
- },
25
- };
26
-
27
- export default meta;
28
-
29
- type Story = StoryObj<typeof AssistiveElement>;
30
-
31
- export const DefaultHelp: Story = {
32
- args: {
33
- children:
34
- "This is a standard assistive layout explaining specific configurations.",
35
- assistiveVariant: "help",
36
- assistiveWithIcon: true,
37
- },
38
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
39
- render: ({ withLayer, layer, ...args }: any) => (
40
- <AssistiveElement {...args} />
41
- ),
42
- };
43
-
44
- export const ErrorState: Story = {
45
- args: {
46
- children:
47
- "Invalid property. You must satisfy the constraints outlined above.",
48
- assistiveVariant: "error",
49
- assistiveWithIcon: true,
50
- },
51
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
52
- render: ({ withLayer, layer, ...args }: any) => (
53
- <AssistiveElement {...args} />
54
- ),
55
- };
56
-
57
- export const NoIconHelp: Story = {
58
- args: {
59
- children:
60
- "Fallback textual representation without visual injection targets.",
61
- assistiveVariant: "help",
62
- assistiveWithIcon: false,
63
- },
64
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
65
- render: ({ withLayer, layer, ...args }: any) => (
66
- <AssistiveElement {...args} />
67
- ),
68
- };