@recursica/mui-adapter 0.6.0 → 0.7.0

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 (164) hide show
  1. package/ARCHITECTURE.md +15 -0
  2. package/CHANGELOG.md +6 -0
  3. package/SETUP.md +77 -0
  4. package/USAGE.md +55 -0
  5. package/dist/mui-adapter.cjs +26 -26
  6. package/dist/mui-adapter.cjs.map +1 -1
  7. package/dist/mui-adapter.css +1 -1
  8. package/dist/mui-adapter.js +3721 -3511
  9. package/dist/mui-adapter.js.map +1 -1
  10. package/dist/src/components/Accordion/Accordion.d.ts +9 -29
  11. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +2 -5
  12. package/dist/src/components/Autocomplete/Autocomplete.d.ts +4 -8
  13. package/dist/src/components/Avatar/Avatar.d.ts +1 -6
  14. package/dist/src/components/Badge/Badge.d.ts +1 -4
  15. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +2 -3
  16. package/dist/src/components/Button/Button.d.ts +2 -17
  17. package/dist/src/components/Card/Card.d.ts +2 -4
  18. package/dist/src/components/Checkbox/Checkbox.d.ts +4 -6
  19. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +8 -6
  20. package/dist/src/components/Chip/Chip.d.ts +2 -11
  21. package/dist/src/components/Container/Container.d.ts +1 -5
  22. package/dist/src/components/DatePicker/DatePicker.d.ts +2 -1
  23. package/dist/src/components/Dropdown/Dropdown.d.ts +4 -14
  24. package/dist/src/components/Flex/Flex.d.ts +2 -22
  25. package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +2 -7
  26. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +3 -18
  27. package/dist/src/components/Group/Group.d.ts +2 -7
  28. package/dist/src/components/HoverCard/HoverCard.d.ts +13 -39
  29. package/dist/src/components/Label/Label.d.ts +2 -9
  30. package/dist/src/components/Link/Link.d.ts +2 -6
  31. package/dist/src/components/Loader/Loader.d.ts +2 -7
  32. package/dist/src/components/Menu/Menu.d.ts +24 -98
  33. package/dist/src/components/Modal/Modal.d.ts +32 -31
  34. package/dist/src/components/NumberInput/NumberInput.d.ts +3 -5
  35. package/dist/src/components/Pagination/Pagination.d.ts +8 -41
  36. package/dist/src/components/Panel/Panel.d.ts +5 -18
  37. package/dist/src/components/Radio/Radio.d.ts +4 -4
  38. package/dist/src/components/Radio/RadioGroup.d.ts +3 -7
  39. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +2 -5
  40. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +5 -15
  41. package/dist/src/components/Slider/Slider.d.ts +4 -14
  42. package/dist/src/components/Stack/Stack.d.ts +2 -5
  43. package/dist/src/components/Stepper/Stepper.d.ts +36 -16
  44. package/dist/src/components/Switch/Switch.d.ts +4 -4
  45. package/dist/src/components/Switch/SwitchGroup.d.ts +4 -4
  46. package/dist/src/components/Table/Table.d.ts +2 -1
  47. package/dist/src/components/Tabs/Tabs.d.ts +11 -26
  48. package/dist/src/components/Text/Text.d.ts +2 -16
  49. package/dist/src/components/TextArea/TextArea.d.ts +3 -9
  50. package/dist/src/components/TextField/TextField.d.ts +3 -7
  51. package/dist/src/components/TimePicker/TimePicker.d.ts +2 -1
  52. package/dist/src/components/Timeline/Timeline.d.ts +2 -1
  53. package/dist/src/components/Timeline/TimelineItem.d.ts +2 -13
  54. package/dist/src/components/Title/Title.d.ts +2 -15
  55. package/dist/src/components/Toast/Toast.d.ts +11 -16
  56. package/dist/src/components/Tooltip/Tooltip.d.ts +7 -21
  57. package/dist/src/components/TransferList/TransferList.d.ts +2 -1
  58. package/dist/src/components/Typography/Typography.d.ts +1 -1
  59. package/dist/src/utils/RequireAccessibleLabel.d.ts +1 -18
  60. package/dist/src/utils/filterStylingProps.d.ts +1 -11
  61. package/llms.txt +16 -0
  62. package/package.json +6 -2
  63. package/src/components/Accordion/Accordion.module.css +1 -2
  64. package/src/components/Accordion/Accordion.stories.tsx +0 -18
  65. package/src/components/Accordion/Accordion.tsx +19 -23
  66. package/src/components/AssistiveElement/AssistiveElement.module.css +32 -29
  67. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +10 -27
  68. package/src/components/AssistiveElement/AssistiveElement.tsx +11 -15
  69. package/src/components/Autocomplete/Autocomplete.module.css +17 -18
  70. package/src/components/Autocomplete/Autocomplete.stories.tsx +7 -16
  71. package/src/components/Autocomplete/Autocomplete.tsx +27 -45
  72. package/src/components/Avatar/Avatar.tsx +2 -13
  73. package/src/components/Badge/Badge.tsx +2 -5
  74. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -4
  75. package/src/components/Button/Button.module.css +19 -61
  76. package/src/components/Button/Button.stories.tsx +24 -23
  77. package/src/components/Button/Button.tsx +7 -18
  78. package/src/components/Card/Card.module.css +36 -0
  79. package/src/components/Card/Card.tsx +6 -4
  80. package/src/components/Checkbox/Checkbox.module.css +27 -10
  81. package/src/components/Checkbox/Checkbox.tsx +124 -24
  82. package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
  83. package/src/components/Checkbox/CheckboxGroup.tsx +43 -23
  84. package/src/components/Chip/Chip.module.css +52 -34
  85. package/src/components/Chip/Chip.tsx +45 -47
  86. package/src/components/Container/Container.stories.tsx +103 -20
  87. package/src/components/Container/Container.tsx +1 -13
  88. package/src/components/DatePicker/DatePicker.stories.tsx +125 -19
  89. package/src/components/DatePicker/DatePicker.tsx +3 -1
  90. package/src/components/Dropdown/Dropdown.tsx +7 -9
  91. package/src/components/FileInput/FileInput.stories.tsx +2 -19
  92. package/src/components/FileUpload/FileUpload.stories.tsx +2 -19
  93. package/src/components/Flex/Flex.stories.tsx +113 -20
  94. package/src/components/Flex/Flex.tsx +16 -26
  95. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +0 -8
  96. package/src/components/FormControlLayout/FormControlLayout.tsx +18 -7
  97. package/src/components/FormControlWrapper/FormControlWrapper.module.css +1 -10
  98. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +12 -21
  99. package/src/components/FormControlWrapper/FormControlWrapper.tsx +11 -30
  100. package/src/components/Group/Group.stories.tsx +6 -30
  101. package/src/components/Group/Group.tsx +14 -9
  102. package/src/components/HoverCard/HoverCard.tsx +72 -75
  103. package/src/components/Label/Label.module.css +4 -0
  104. package/src/components/Label/Label.stories.tsx +18 -12
  105. package/src/components/Label/Label.tsx +3 -9
  106. package/src/components/Link/Link.module.css +4 -3
  107. package/src/components/Link/Link.stories.tsx +2 -8
  108. package/src/components/Link/Link.tsx +1 -5
  109. package/src/components/Loader/Loader.module.css +1 -2
  110. package/src/components/Loader/Loader.tsx +1 -7
  111. package/src/components/Menu/IMPLEMENTATION_NOTES.md +4 -0
  112. package/src/components/Menu/Menu.stories.tsx +106 -188
  113. package/src/components/Menu/Menu.tsx +34 -280
  114. package/src/components/Modal/Modal.tsx +158 -160
  115. package/src/components/NumberInput/NumberInput.tsx +6 -18
  116. package/src/components/Pagination/IMPLEMENTATION_NOTES.md +3 -0
  117. package/src/components/Pagination/Pagination.module.css +12 -24
  118. package/src/components/Pagination/Pagination.stories.tsx +0 -8
  119. package/src/components/Pagination/Pagination.tsx +20 -140
  120. package/src/components/Panel/Panel.tsx +7 -30
  121. package/src/components/Radio/Radio.module.css +25 -10
  122. package/src/components/Radio/Radio.tsx +51 -19
  123. package/src/components/Radio/RadioGroup.stories.tsx +117 -0
  124. package/src/components/Radio/RadioGroup.tsx +26 -12
  125. package/src/components/ReadOnlyField/ReadOnlyField.module.css +6 -6
  126. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +5 -36
  127. package/src/components/ReadOnlyField/ReadOnlyField.tsx +9 -13
  128. package/src/components/SegmentedControl/SegmentedControl.module.css +23 -47
  129. package/src/components/SegmentedControl/SegmentedControl.tsx +44 -14
  130. package/src/components/Slider/Slider.module.css +1 -4
  131. package/src/components/Slider/Slider.stories.tsx +3 -3
  132. package/src/components/Slider/Slider.tsx +26 -25
  133. package/src/components/Stack/Stack.stories.tsx +4 -25
  134. package/src/components/Stack/Stack.tsx +1 -5
  135. package/src/components/Stepper/IMPLEMENTATION_NOTES.md +4 -0
  136. package/src/components/Stepper/Stepper.stories.tsx +56 -43
  137. package/src/components/Stepper/Stepper.tsx +89 -87
  138. package/src/components/Switch/Switch.module.css +21 -0
  139. package/src/components/Switch/Switch.tsx +63 -16
  140. package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
  141. package/src/components/Switch/SwitchGroup.tsx +27 -18
  142. package/src/components/Table/Table.stories.tsx +1 -19
  143. package/src/components/Table/Table.tsx +3 -1
  144. package/src/components/Tabs/IMPLEMENTATION_NOTES.md +4 -0
  145. package/src/components/Tabs/Tabs.stories.tsx +41 -24
  146. package/src/components/Tabs/Tabs.tsx +49 -66
  147. package/src/components/Text/Text.stories.tsx +5 -17
  148. package/src/components/Text/Text.tsx +1 -15
  149. package/src/components/TextArea/TextArea.tsx +7 -17
  150. package/src/components/TextField/TextField.stories.tsx +1 -27
  151. package/src/components/TextField/TextField.tsx +4 -6
  152. package/src/components/TimePicker/TimePicker.stories.tsx +2 -19
  153. package/src/components/TimePicker/TimePicker.tsx +3 -1
  154. package/src/components/Timeline/Timeline.tsx +4 -1
  155. package/src/components/Timeline/TimelineItem.tsx +1 -12
  156. package/src/components/Title/Title.stories.tsx +0 -18
  157. package/src/components/Title/Title.tsx +1 -7
  158. package/src/components/Toast/Toast.stories.tsx +1 -1
  159. package/src/components/Toast/Toast.tsx +62 -28
  160. package/src/components/Tooltip/Tooltip.tsx +11 -37
  161. package/src/components/TransferList/TransferList.stories.tsx +1 -19
  162. package/src/components/TransferList/TransferList.tsx +3 -1
  163. package/src/utils/RequireAccessibleLabel.ts +1 -12
  164. package/src/utils/filterStylingProps.ts +7 -20
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import React, { forwardRef } from "react";
3
3
  import {
4
- Switch as MuiSwitch,
5
- type SwitchGroupProps as MuiSwitchGroupProps,
4
+ FormGroup as MuiFormGroup,
5
+ type FormGroupProps as MuiFormGroupProps,
6
6
  } from "@mui/material";
7
7
  import { type ReadOnlyControlProps } from "@recursica/adapter-common";
8
8
  import {
@@ -13,13 +13,25 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
13
13
  import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
14
14
  import styles from "./Switch.module.css";
15
15
 
16
+ import { type RecursicaSwitchGroupProps as BaseRecursicaSwitchGroupProps } from "@recursica/adapter-common";
17
+
16
18
  export interface RecursicaSwitchGroupProps
17
- extends Omit<MuiSwitchGroupProps, "size" | "labelProps">,
19
+ extends Omit<
20
+ MuiFormGroupProps,
21
+ | "size"
22
+ | "labelProps"
23
+ | "onChange"
24
+ | "classes"
25
+ | "ref"
26
+ | "value"
27
+ | "defaultValue"
28
+ >,
18
29
  Omit<
19
30
  RecursicaFormControlWrapperProps,
20
- "controlMaxWidth" | "controlMinWidth"
31
+ "controlMaxWidth" | "controlMinWidth" | "classes" | "onChange"
21
32
  >,
22
- ReadOnlyControlProps {}
33
+ ReadOnlyControlProps,
34
+ BaseRecursicaSwitchGroupProps {}
23
35
 
24
36
  export type SwitchGroupProps = RecursicaOverStyled<RecursicaSwitchGroupProps>;
25
37
 
@@ -43,7 +55,7 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
43
55
  assistiveWithIcon,
44
56
  error,
45
57
  required,
46
- withAsterisk,
58
+ // removed withAsterisk
47
59
  id,
48
60
  className,
49
61
  style,
@@ -53,6 +65,8 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
53
65
  emptyValueComponent,
54
66
  value,
55
67
  defaultValue,
68
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
+ onChange,
56
70
  ...rest
57
71
  } = props;
58
72
  const sanitizedProps = filterStylingProps(rest, overStyled);
@@ -81,7 +95,6 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
81
95
  assistiveWithIcon={assistiveWithIcon}
82
96
  error={error}
83
97
  required={required}
84
- withAsterisk={withAsterisk}
85
98
  id={id}
86
99
  readOnly={readOnly && !!readOnlyComponent}
87
100
  readOnlyComponent={readOnlyComponent}
@@ -90,22 +103,18 @@ export const SwitchGroup = forwardRef<HTMLDivElement, SwitchGroupProps>(
90
103
  readOnlyValue={value !== undefined ? value : defaultValue}
91
104
  readOnlyNativeProps={props}
92
105
  activeComponent={
93
- <div
106
+ <MuiFormGroup
94
107
  ref={ref}
95
- /* Natively bind local disabled lock dynamically */
96
- {...(sanitizedProps as unknown as MuiSwitchGroupProps)}
97
- disabled={readOnly || (restRecord as any).disabled}
98
- value={value}
99
- defaultValue={defaultValue}
108
+ {...(sanitizedProps as unknown as MuiFormGroupProps)}
109
+ className={`${styles.groupRoot} ${(sanitizedProps as any).className || ""}`.trim()}
110
+ data-layout={formLayout}
100
111
  >
101
- <div className={styles.groupRoot} data-layout={formLayout}>
102
- {children}
103
- </div>
104
- </div>
112
+ {children}
113
+ </MuiFormGroup>
105
114
  }
106
115
  />
107
116
  );
108
117
  },
109
118
  );
110
119
 
111
- const SwitchGroup = (() => {}) as any; // SwitchGroup.displayName = "SwitchGroup";
120
+ SwitchGroup.displayName = "SwitchGroup";
@@ -6,28 +6,10 @@ const meta: Meta<typeof Table> = {
6
6
  title: "UI-Kit/🚧 Table",
7
7
  component: Table,
8
8
  tags: ["autodocs"],
9
- parameters: {
10
- controls: {
11
- include: [
12
- "layer",
13
- "withLayer",
14
- "children",
15
- "component",
16
- "variant",
17
- "size",
18
- "icon",
19
- "disabled",
20
- "href",
21
- "onClick",
22
- "onChange",
23
- "value",
24
- "checked",
25
- ],
26
- },
27
- },
28
9
  };
29
10
 
30
11
  export default meta;
12
+
31
13
  type Story = StoryObj<typeof Table>;
32
14
 
33
15
  export const Default: Story = {
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
+ import { type RecursicaTableProps } from "@recursica/adapter-common";
2
3
 
3
- export type TableProps = React.HTMLAttributes<HTMLDivElement>;
4
+ export type TableProps = React.HTMLAttributes<HTMLDivElement> &
5
+ RecursicaTableProps;
4
6
 
5
7
  export const Table: React.FC<TableProps> = (props) => {
6
8
  return <div {...props}>Table</div>;
@@ -0,0 +1,4 @@
1
+ # Tabs Implementation Notes
2
+
3
+ - **Compositional API Dropped:** Mantine uses `<Tabs.List>`, `<Tabs.Tab>`, and `<Tabs.Panel>` natively with implicit context from `<Tabs>`. MUI relies on `@mui/lab/TabContext` and separates `Tabs` and `TabPanel`.
4
+ - **Monolithic API Adopted:** Following architectural review, we have opted to drop the broken dot-notation wrappers for `mui-adapter`. We now natively export `Tabs` (MUI List), `Tab` (MUI Item), and `TabPanel` (from `@mui/lab`). Developers must use `TabContext` (from `@mui/lab`) to manage state, just like native MUI. Storybook and visual regression tests have been updated to reflect this divergence while retaining core property mapping compatibility.
@@ -1,5 +1,7 @@
1
+ import React, { useState } from "react";
1
2
  import type { Meta, StoryObj } from "@storybook/react";
2
- import { Tabs } from "./Tabs";
3
+ import { Tabs, Tab, TabPanel } from "./Tabs";
4
+ import { TabContext } from "@mui/lab";
3
5
  import { Flex } from "../Flex/Flex";
4
6
 
5
7
  const meta: Meta<typeof Tabs> = {
@@ -34,16 +36,26 @@ export default meta;
34
36
  type Story = StoryObj<typeof Tabs>;
35
37
 
36
38
  const InteractiveTabs = (
37
- args: React.ComponentProps<typeof Tabs> & { disabled?: boolean },
39
+ args: React.ComponentProps<typeof Tabs> & {
40
+ disabled?: boolean;
41
+ inverted?: boolean;
42
+ },
38
43
  ) => {
44
+ const [value, setValue] = useState("gallery");
45
+
46
+ const handleChange = (event: React.SyntheticEvent, newValue: string) => {
47
+ setValue(newValue);
48
+ };
49
+
39
50
  return (
40
51
  <Flex w={600} h={300}>
41
- <Tabs defaultValue="gallery" {...args}>
42
- <Tabs.List>
43
- <Tabs.Tab
52
+ <TabContext value={value}>
53
+ <Tabs onChange={handleChange} {...args}>
54
+ <Tab
44
55
  value="gallery"
56
+ label="Gallery"
45
57
  disabled={args.disabled}
46
- leftSection={
58
+ icon={
47
59
  <svg
48
60
  xmlns="http://www.w3.org/2000/svg"
49
61
  viewBox="0 0 24 24"
@@ -52,19 +64,21 @@ const InteractiveTabs = (
52
64
  strokeWidth="2"
53
65
  strokeLinecap="round"
54
66
  strokeLinejoin="round"
67
+ width={16}
68
+ height={16}
55
69
  >
56
70
  <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
57
71
  <circle cx="8.5" cy="8.5" r="1.5"></circle>
58
72
  <polyline points="21 15 16 10 5 21"></polyline>
59
73
  </svg>
60
74
  }
61
- >
62
- Gallery
63
- </Tabs.Tab>
64
- <Tabs.Tab
75
+ iconPosition="start"
76
+ />
77
+ <Tab
65
78
  value="messages"
79
+ label="Messages"
66
80
  disabled={args.disabled}
67
- leftSection={
81
+ icon={
68
82
  <svg
69
83
  xmlns="http://www.w3.org/2000/svg"
70
84
  viewBox="0 0 24 24"
@@ -73,17 +87,19 @@ const InteractiveTabs = (
73
87
  strokeWidth="2"
74
88
  strokeLinecap="round"
75
89
  strokeLinejoin="round"
90
+ width={16}
91
+ height={16}
76
92
  >
77
93
  <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>
78
94
  </svg>
79
95
  }
80
- >
81
- Messages
82
- </Tabs.Tab>
83
- <Tabs.Tab
96
+ iconPosition="start"
97
+ />
98
+ <Tab
84
99
  value="settings"
100
+ label="Settings"
85
101
  disabled={args.disabled}
86
- leftSection={
102
+ icon={
87
103
  <svg
88
104
  xmlns="http://www.w3.org/2000/svg"
89
105
  viewBox="0 0 24 24"
@@ -92,22 +108,23 @@ const InteractiveTabs = (
92
108
  strokeWidth="2"
93
109
  strokeLinecap="round"
94
110
  strokeLinejoin="round"
111
+ width={16}
112
+ height={16}
95
113
  >
96
114
  <circle cx="12" cy="12" r="3"></circle>
97
115
  <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>
98
116
  </svg>
99
117
  }
100
- >
101
- Settings
102
- </Tabs.Tab>
103
- </Tabs.List>
118
+ iconPosition="start"
119
+ />
120
+ </Tabs>
104
121
 
105
- <Tabs.Panel value="gallery">Gallery tab content</Tabs.Panel>
122
+ <TabPanel value="gallery">Gallery tab content</TabPanel>
106
123
 
107
- <Tabs.Panel value="messages">Messages tab content</Tabs.Panel>
124
+ <TabPanel value="messages">Messages tab content</TabPanel>
108
125
 
109
- <Tabs.Panel value="settings">Settings tab content</Tabs.Panel>
110
- </Tabs>
126
+ <TabPanel value="settings">Settings tab content</TabPanel>
127
+ </TabContext>
111
128
  </Flex>
112
129
  );
113
130
  };
@@ -2,8 +2,8 @@ import { forwardRef } from "react";
2
2
  import {
3
3
  Tabs as MuiTabs,
4
4
  type TabsProps as MuiTabsProps,
5
- type ListProps as MuiTabsListProps,
6
- type TabsProps as MuiTabsTabProps,
5
+ Tab as MuiTab,
6
+ type TabProps as MuiTabProps,
7
7
  } from "@mui/material";
8
8
  import {
9
9
  filterStylingProps,
@@ -11,95 +11,78 @@ import {
11
11
  } from "../../utils/filterStylingProps";
12
12
  import styles from "./Tabs.module.css";
13
13
 
14
- export interface RecursicaTabsProps
15
- extends Omit<MuiTabsProps, "variant" | "classNames" | "color" | "radius"> {
16
- variant?: "default" | "outline" | "pills";
17
- }
14
+ import { type RecursicaTabsProps } from "@recursica/adapter-common";
18
15
 
19
16
  export type TabsProps = RecursicaOverStyled<RecursicaTabsProps>;
20
17
 
21
- const _Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(props, ref) {
22
- const {
23
- variant = "default",
24
- orientation = "horizontal",
25
- overStyled = false,
26
- className,
27
- ...rest
28
- } = props;
18
+ export const Tabs = forwardRef<HTMLDivElement, TabsProps>(
19
+ function Tabs(props, ref) {
20
+ const {
21
+ variant = "default",
22
+ orientation = "horizontal",
23
+ overStyled = false,
24
+ className,
25
+ ...rest
26
+ } = props;
29
27
 
30
- const sanitizedProps = filterStylingProps(rest, overStyled);
28
+ const sanitizedProps = filterStylingProps(rest, overStyled);
31
29
 
32
- return (
33
- <MuiTabs
34
- ref={ref}
35
- variant={variant}
36
- orientation={orientation}
37
- className={`${styles.root} ${className || ""}`}
38
- data-variant={variant}
39
- data-orientation={orientation}
40
- classes={{
41
- list: styles.list,
42
- tab: styles.tab,
43
- panel: styles.panel,
44
- }}
45
- {...(sanitizedProps as MuiTabsProps)}
46
- />
47
- );
48
- });
49
-
50
- _Tabs.displayName = "Tabs";
51
-
52
- export type TabsListProps = RecursicaOverStyled<MuiTabsListProps>;
53
-
54
- const _TabsList = forwardRef<HTMLDivElement, TabsListProps>(
55
- function TabsList(props, ref) {
56
- const { overStyled = false, ...rest } = props;
57
30
  return (
58
- <div
31
+ <MuiTabs
59
32
  ref={ref}
60
- {...(filterStylingProps(rest, overStyled) as MuiTabsListProps)}
33
+ orientation={orientation}
34
+ className={`${styles.root} ${className || ""}`}
35
+ data-variant={variant}
36
+ data-orientation={orientation}
37
+ classes={{
38
+ flexContainer: styles.list,
39
+ indicator: styles.indicator,
40
+ }}
41
+ {...(sanitizedProps as MuiTabsProps)}
61
42
  />
62
43
  );
63
44
  },
64
45
  );
65
- _TabsList.displayName = "Tabs.List";
66
46
 
67
- export type TabsTabProps = RecursicaOverStyled<MuiTabsTabProps>;
47
+ Tabs.displayName = "Tabs";
48
+
49
+ export type TabProps = RecursicaOverStyled<MuiTabProps>;
50
+
51
+ export const Tab = forwardRef<HTMLDivElement, TabProps>(
52
+ function Tab(props, ref) {
53
+ const { overStyled = false, className, ...rest } = props;
54
+ const sanitizedProps = filterStylingProps(rest, overStyled);
68
55
 
69
- const _TabsTab = forwardRef<HTMLButtonElement, TabsTabProps>(
70
- function TabsTab(props, ref) {
71
- const { overStyled = false, ...rest } = props;
72
56
  return (
73
- <div
57
+ <MuiTab
74
58
  ref={ref}
75
- {...(filterStylingProps(rest, overStyled) as MuiTabsTabProps)}
59
+ className={`${styles.tab} ${className || ""}`}
60
+ {...(sanitizedProps as MuiTabProps)}
76
61
  />
77
62
  );
78
63
  },
79
64
  );
80
- _TabsTab.displayName = "Tabs.Tab";
81
65
 
82
- export type TabsPanelProps = RecursicaOverStyled<MuiTabsPanelProps>;
66
+ Tab.displayName = "Tab";
67
+
68
+ import { TabPanel as MuiTabPanel } from "@mui/lab";
69
+ import type { TabPanelProps as MuiTabPanelProps } from "@mui/lab";
70
+
71
+ export type TabPanelProps = RecursicaOverStyled<MuiTabPanelProps>;
72
+
73
+ export const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(
74
+ function TabPanel(props, ref) {
75
+ const { overStyled = false, className, ...rest } = props;
76
+ const sanitizedProps = filterStylingProps(rest, overStyled);
83
77
 
84
- const _TabsPanel = forwardRef<HTMLDivElement, TabsPanelProps>(
85
- function TabsPanel(props, ref) {
86
- const { overStyled = false, ...rest } = props;
87
78
  return (
88
- <div
79
+ <MuiTabPanel
89
80
  ref={ref}
90
- {...(filterStylingProps(rest, overStyled) as MuiTabsPanelProps)}
81
+ className={`${styles.panel} ${className || ""}`}
82
+ {...(sanitizedProps as MuiTabPanelProps)}
91
83
  />
92
84
  );
93
85
  },
94
86
  );
95
- _TabsPanel.displayName = "Tabs.Panel";
96
87
 
97
- export const Tabs: typeof _Tabs & {
98
- List: typeof _TabsList;
99
- Tab: typeof _TabsTab;
100
- Panel: typeof _TabsPanel;
101
- } = Object.assign(_Tabs, {
102
- List: _TabsList,
103
- Tab: _TabsTab,
104
- Panel: _TabsPanel,
105
- });
88
+ TabPanel.displayName = "TabPanel";
@@ -13,23 +13,6 @@ const meta: Meta<typeof Text> = {
13
13
  "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 `<Title>` instead.",
14
14
  },
15
15
  },
16
- controls: {
17
- include: [
18
- "layer",
19
- "withLayer",
20
- "variant",
21
- "children",
22
- "component",
23
- "size",
24
- "icon",
25
- "disabled",
26
- "href",
27
- "onClick",
28
- "onChange",
29
- "value",
30
- "checked",
31
- ],
32
- },
33
16
  },
34
17
  argTypes: {
35
18
  variant: {
@@ -45,6 +28,11 @@ const meta: Meta<typeof Text> = {
45
28
  description:
46
29
  "Controls the standard logical boundary definitions natively extracted from Figma.",
47
30
  },
31
+ c: {
32
+ control: "text",
33
+ description:
34
+ "Standard Mantine color string mapped via internal boundaries. Example: `dimmed`",
35
+ },
48
36
  },
49
37
  };
50
38
 
@@ -1,21 +1,7 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import { Typography } from "../Typography/Typography";
3
3
  import { type RecursicaOverStyled } from "../../utils/filterStylingProps";
4
- import { type TypographyProps as MuiTypographyProps } from "@mui/material";
5
-
6
- export type TextVariant =
7
- | "body"
8
- | "body-small"
9
- | "caption"
10
- | "overline"
11
- | "subtitle"
12
- | "subtitle-small";
13
-
14
- export type RecursicaTextProps = Omit<MuiTypographyProps, "variant"> & {
15
- variant?: TextVariant;
16
- children?: React.ReactNode;
17
- component?: React.ElementType;
18
- };
4
+ import { type RecursicaTextProps } from "@recursica/adapter-common";
19
5
 
20
6
  export type TextProps = RecursicaOverStyled<RecursicaTextProps>;
21
7
 
@@ -4,7 +4,7 @@ import {
4
4
  type TextFieldProps as MuiTextareaProps,
5
5
  } from "@mui/material";
6
6
  import { type ReadOnlyControlProps } from "@recursica/adapter-common";
7
- import { TextField } from "@mui/material";
7
+ // Removed unused TextField import
8
8
  import {
9
9
  filterStylingProps,
10
10
  type RecursicaOverStyled,
@@ -13,6 +13,8 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
13
13
  import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
14
14
  import styles from "./TextArea.module.css";
15
15
 
16
+ import { type RecursicaTextAreaProps as BaseRecursicaTextAreaProps } from "@recursica/adapter-common";
17
+
16
18
  export interface RecursicaTextAreaProps
17
19
  extends Omit<
18
20
  MuiTextareaProps,
@@ -29,14 +31,8 @@ export interface RecursicaTextAreaProps
29
31
  | "labelWithEditIcon"
30
32
  | "onLabelEditClick"
31
33
  >,
32
- ReadOnlyControlProps {
33
- /** Maximum rows for autosize textarea to grow */
34
- maxRows?: number;
35
- /** Minimum rows of autosize textarea */
36
- minRows?: number;
37
- /** If set, enables textarea height growing with its content */
38
- autosize?: boolean;
39
- }
34
+ ReadOnlyControlProps,
35
+ BaseRecursicaTextAreaProps {}
40
36
 
41
37
  export type TextAreaProps = RecursicaOverStyled<RecursicaTextAreaProps>;
42
38
 
@@ -58,6 +54,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
58
54
  assistiveWithIcon,
59
55
  error,
60
56
  required,
57
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
61
58
  withAsterisk,
62
59
  id,
63
60
  className,
@@ -121,7 +118,6 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
121
118
  assistiveWithIcon={assistiveWithIcon}
122
119
  error={error}
123
120
  required={required}
124
- withAsterisk={withAsterisk}
125
121
  id={id}
126
122
  readOnly={readOnly}
127
123
  readOnlyComponent={readOnlyComponent}
@@ -133,20 +129,14 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
133
129
  /* Naked Input execution safely decoupled from Mui's macro Input.Wrapper DOM hooks */
134
130
  <MuiTextarea
135
131
  multiline
136
- ref={ref}
132
+ inputRef={ref as any}
137
133
  classes={mergedClassNames}
138
134
  disabled={disabled}
139
135
  value={value}
140
136
  defaultValue={defaultValue}
141
137
  label={undefined}
142
- description={undefined}
143
138
  error={undefined}
144
139
  required={undefined}
145
- withAsterisk={undefined}
146
- wrapperProps={{
147
- "data-disabled": disabled ? "true" : undefined,
148
- "data-error": error ? "true" : undefined,
149
- }}
150
140
  {...(sanitizedProps as unknown as MuiTextareaProps)}
151
141
  />
152
142
  }
@@ -1,9 +1,6 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import React from "react";
3
1
  import type { Meta, StoryObj } from "@storybook/react";
4
2
  import { TextField } from "./TextField";
5
3
  import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
6
-
7
4
  const meta: Meta<typeof TextField> = {
8
5
  title: "UI-Kit/TextField",
9
6
  component: TextField,
@@ -15,7 +12,7 @@ const meta: Meta<typeof TextField> = {
15
12
  The \`TextField\` primitive functions as a universal text entry input natively integrated directly into the unified \`FormControlWrapper\` architecture.
16
13
 
17
14
  ### Architectural Decoupling
18
- Recursica forcibly overrides the internal MUI \`InputBase\` 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.
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.
19
16
 
20
17
  ### Examples
21
18
  Always structure horizontal architectures via the generic \`formLayout\` parameter.
@@ -29,21 +26,6 @@ Always structure horizontal architectures via the generic \`formLayout\` paramet
29
26
  `,
30
27
  },
31
28
  },
32
- controls: {
33
- include: [
34
- "disabled",
35
- "error",
36
- "required",
37
- "label",
38
- "assistiveText",
39
- "readOnly",
40
- "formLayout",
41
- "labelSize",
42
- "labelAlignment",
43
- "labelOptionalText",
44
- "labelWithEditIcon",
45
- ],
46
- },
47
29
  },
48
30
  argTypes: {
49
31
  ...formControlArgTypes,
@@ -86,7 +68,6 @@ export const Default: Story = {
86
68
  assistiveText:
87
69
  "Tokens are stored identically locally and strictly ephemeral.",
88
70
  },
89
- render: ({ ...args }: any) => <TextField {...args} />,
90
71
  };
91
72
 
92
73
  export const FormsSideBySide: Story = {
@@ -97,7 +78,6 @@ export const FormsSideBySide: Story = {
97
78
  "Specify the exact cluster administrative credentials enforcing strict domain policies. This violently long string tests native textual wrapping safely mapping alongside inputs.",
98
79
  formLayout: "side-by-side",
99
80
  },
100
- render: ({ ...args }: any) => <TextField {...args} />,
101
81
  };
102
82
 
103
83
  export const WithLeadingIcon: Story = {
@@ -120,7 +100,6 @@ export const WithLeadingIcon: Story = {
120
100
  </svg>
121
101
  ),
122
102
  },
123
- render: ({ ...args }: any) => <TextField {...args} />,
124
103
  };
125
104
 
126
105
  export const WithTrailingIcon: Story = {
@@ -142,7 +121,6 @@ export const WithTrailingIcon: Story = {
142
121
  </svg>
143
122
  ),
144
123
  },
145
- render: ({ ...args }: any) => <TextField {...args} />,
146
124
  };
147
125
 
148
126
  export const Disabled: Story = {
@@ -151,7 +129,6 @@ export const Disabled: Story = {
151
129
  placeholder: "Disabled primitive map...",
152
130
  disabled: true,
153
131
  },
154
- render: ({ ...args }: any) => <TextField {...args} />,
155
132
  };
156
133
 
157
134
  export const ErrorState: Story = {
@@ -163,7 +140,6 @@ export const ErrorState: Story = {
163
140
  "Critical runtime node disconnect detected traversing DOM architecture.",
164
141
  required: true,
165
142
  },
166
- render: ({ ...args }: any) => <TextField {...args} />,
167
143
  };
168
144
 
169
145
  export const StaticReadOnly: Story = {
@@ -173,7 +149,6 @@ export const StaticReadOnly: Story = {
173
149
  value: "Explicitly Uneditable Bound Output",
174
150
  readOnly: true,
175
151
  },
176
- render: ({ ...args }: any) => <TextField {...args} />,
177
152
  };
178
153
 
179
154
  export const EditableReadOnly: Story = {
@@ -184,5 +159,4 @@ export const EditableReadOnly: Story = {
184
159
  readOnly: true,
185
160
  labelWithEditIcon: true,
186
161
  },
187
- render: ({ ...args }: any) => <TextField {...args} />,
188
162
  };
@@ -9,6 +9,8 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
9
9
  import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
10
10
  import styles from "./TextField.module.css";
11
11
 
12
+ import { type RecursicaTextFieldProps as BaseRecursicaTextFieldProps } from "@recursica/adapter-common";
13
+
12
14
  export interface RecursicaTextFieldProps
13
15
  extends Omit<
14
16
  InputBaseProps,
@@ -33,12 +35,8 @@ export interface RecursicaTextFieldProps
33
35
  | "labelWithEditIcon"
34
36
  | "onLabelEditClick"
35
37
  >,
36
- ReadOnlyControlProps {
37
- /** Renders a section on the left side of the input (e.g. icon). Maps to Mantine's leftSection natively. */
38
- leftSection?: React.ReactNode;
39
- /** Renders a section on the right side of the input (e.g. clear button). Maps to Mantine's rightSection natively. */
40
- rightSection?: React.ReactNode;
41
- }
38
+ ReadOnlyControlProps,
39
+ BaseRecursicaTextFieldProps {}
42
40
 
43
41
  export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
44
42