@recursica/mui-adapter 0.5.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 (212) hide show
  1. package/ARCHITECTURE.md +15 -0
  2. package/CHANGELOG.md +15 -0
  3. package/SETUP.md +77 -0
  4. package/USAGE.md +55 -0
  5. package/dist/mui-adapter.cjs +74 -1
  6. package/dist/mui-adapter.cjs.map +1 -1
  7. package/dist/mui-adapter.css +1 -1
  8. package/dist/mui-adapter.js +6863 -205
  9. package/dist/mui-adapter.js.map +1 -1
  10. package/dist/src/components/Accordion/Accordion.d.ts +43 -2
  11. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +6 -2
  12. package/dist/src/components/Autocomplete/Autocomplete.d.ts +12 -2
  13. package/dist/src/components/Avatar/Avatar.d.ts +10 -3
  14. package/dist/src/components/Badge/Badge.d.ts +10 -3
  15. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +9 -3
  16. package/dist/src/components/Button/Button.d.ts +2 -17
  17. package/dist/src/components/Card/Card.d.ts +38 -3
  18. package/dist/src/components/Checkbox/Checkbox.d.ts +13 -2
  19. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +18 -0
  20. package/dist/src/components/Checkbox/index.d.ts +5 -1
  21. package/dist/src/components/Chip/Chip.d.ts +9 -2
  22. package/dist/src/components/Container/Container.d.ts +1 -5
  23. package/dist/src/components/DatePicker/DatePicker.d.ts +2 -1
  24. package/dist/src/components/Dropdown/Dropdown.d.ts +12 -2
  25. package/dist/src/components/Flex/Flex.d.ts +2 -22
  26. package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +5 -2
  27. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +9 -2
  28. package/dist/src/components/Group/Group.d.ts +2 -7
  29. package/dist/src/components/HoverCard/HoverCard.d.ts +28 -2
  30. package/dist/src/components/Label/Label.d.ts +6 -2
  31. package/dist/src/components/Link/Link.d.ts +2 -6
  32. package/dist/src/components/Loader/Loader.d.ts +2 -7
  33. package/dist/src/components/Menu/Menu.d.ts +25 -3
  34. package/dist/src/components/Modal/Modal.d.ts +37 -2
  35. package/dist/src/components/NumberInput/NumberInput.d.ts +12 -2
  36. package/dist/src/components/Pagination/Pagination.d.ts +12 -3
  37. package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
  38. package/dist/src/components/Panel/Panel.d.ts +52 -3
  39. package/dist/src/components/Radio/Radio.d.ts +13 -3
  40. package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
  41. package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
  42. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +4 -2
  43. package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
  44. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  45. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
  46. package/dist/src/components/ReadOnlyField/index.d.ts +1 -0
  47. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +21 -3
  48. package/dist/src/components/Slider/Slider.d.ts +18 -2
  49. package/dist/src/components/Stack/Stack.d.ts +2 -5
  50. package/dist/src/components/Stepper/Stepper.d.ts +41 -2
  51. package/dist/src/components/Switch/Switch.d.ts +10 -3
  52. package/dist/src/components/Switch/SwitchGroup.d.ts +13 -0
  53. package/dist/src/components/Table/Table.d.ts +2 -1
  54. package/dist/src/components/Tabs/Tabs.d.ts +20 -3
  55. package/dist/src/components/Text/Text.d.ts +2 -16
  56. package/dist/src/components/TextArea/TextArea.d.ts +12 -2
  57. package/dist/src/components/TextField/TextField.d.ts +12 -2
  58. package/dist/src/components/TimePicker/TimePicker.d.ts +2 -1
  59. package/dist/src/components/Timeline/Timeline.d.ts +15 -2
  60. package/dist/src/components/Timeline/TimelineItem.d.ts +18 -0
  61. package/dist/src/components/Title/Title.d.ts +2 -15
  62. package/dist/src/components/Toast/Toast.d.ts +20 -2
  63. package/dist/src/components/Tooltip/Tooltip.d.ts +28 -3
  64. package/dist/src/components/TransferList/TransferList.d.ts +2 -1
  65. package/dist/src/components/Typography/Typography.d.ts +1 -1
  66. package/dist/src/utils/RequireAccessibleLabel.d.ts +1 -18
  67. package/dist/src/utils/filterStylingProps.d.ts +1 -11
  68. package/llms.txt +16 -0
  69. package/package.json +14 -3
  70. package/src/components/Accordion/Accordion.module.css +294 -56
  71. package/src/components/Accordion/Accordion.stories.tsx +131 -21
  72. package/src/components/Accordion/Accordion.tsx +260 -5
  73. package/src/components/AssistiveElement/AssistiveElement.module.css +114 -20
  74. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +60 -20
  75. package/src/components/AssistiveElement/AssistiveElement.tsx +81 -5
  76. package/src/components/Autocomplete/Autocomplete.module.css +319 -42
  77. package/src/components/Autocomplete/Autocomplete.stories.tsx +175 -23
  78. package/src/components/Autocomplete/Autocomplete.tsx +181 -6
  79. package/src/components/Avatar/Avatar.module.css +343 -73
  80. package/src/components/Avatar/Avatar.stories.tsx +94 -22
  81. package/src/components/Avatar/Avatar.tsx +99 -6
  82. package/src/components/Badge/Badge.module.css +127 -29
  83. package/src/components/Badge/Badge.stories.tsx +65 -22
  84. package/src/components/Badge/Badge.tsx +67 -6
  85. package/src/components/Breadcrumb/Breadcrumb.module.css +25 -5
  86. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +57 -22
  87. package/src/components/Breadcrumb/Breadcrumb.tsx +59 -6
  88. package/src/components/Button/Button.module.css +19 -61
  89. package/src/components/Button/Button.stories.tsx +24 -23
  90. package/src/components/Button/Button.tsx +7 -18
  91. package/src/components/Card/Card.module.css +154 -38
  92. package/src/components/Card/Card.stories.tsx +117 -19
  93. package/src/components/Card/Card.tsx +181 -5
  94. package/src/components/Checkbox/Checkbox.module.css +249 -39
  95. package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
  96. package/src/components/Checkbox/Checkbox.tsx +246 -5
  97. package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
  98. package/src/components/Checkbox/CheckboxGroup.tsx +137 -0
  99. package/src/components/Checkbox/index.ts +6 -1
  100. package/src/components/Chip/Chip.module.css +246 -43
  101. package/src/components/Chip/Chip.stories.tsx +101 -21
  102. package/src/components/Chip/Chip.tsx +136 -6
  103. package/src/components/Container/Container.stories.tsx +103 -20
  104. package/src/components/Container/Container.tsx +1 -13
  105. package/src/components/DatePicker/DatePicker.stories.tsx +125 -19
  106. package/src/components/DatePicker/DatePicker.tsx +3 -1
  107. package/src/components/Dropdown/Dropdown.module.css +291 -41
  108. package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
  109. package/src/components/Dropdown/Dropdown.tsx +180 -6
  110. package/src/components/FileInput/FileInput.stories.tsx +2 -19
  111. package/src/components/FileUpload/FileUpload.stories.tsx +2 -19
  112. package/src/components/Flex/Flex.stories.tsx +113 -20
  113. package/src/components/Flex/Flex.tsx +16 -26
  114. package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
  115. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +67 -20
  116. package/src/components/FormControlLayout/FormControlLayout.tsx +69 -4
  117. package/src/components/FormControlWrapper/FormControlWrapper.module.css +87 -0
  118. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +116 -22
  119. package/src/components/FormControlWrapper/FormControlWrapper.tsx +126 -6
  120. package/src/components/Group/Group.stories.tsx +6 -30
  121. package/src/components/Group/Group.tsx +14 -9
  122. package/src/components/HoverCard/HoverCard.module.css +90 -22
  123. package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
  124. package/src/components/HoverCard/HoverCard.tsx +147 -5
  125. package/src/components/Label/Label.module.css +140 -35
  126. package/src/components/Label/Label.stories.tsx +108 -21
  127. package/src/components/Label/Label.tsx +82 -5
  128. package/src/components/Link/Link.module.css +4 -3
  129. package/src/components/Link/Link.stories.tsx +2 -8
  130. package/src/components/Link/Link.tsx +1 -5
  131. package/src/components/Loader/Loader.module.css +1 -2
  132. package/src/components/Loader/Loader.tsx +1 -7
  133. package/src/components/Menu/IMPLEMENTATION_NOTES.md +4 -0
  134. package/src/components/Menu/Menu.module.css +285 -51
  135. package/src/components/Menu/Menu.stories.tsx +229 -25
  136. package/src/components/Menu/Menu.tsx +73 -6
  137. package/src/components/Modal/Modal.module.css +171 -35
  138. package/src/components/Modal/Modal.stories.tsx +66 -22
  139. package/src/components/Modal/Modal.tsx +215 -5
  140. package/src/components/NumberInput/NumberInput.module.css +276 -42
  141. package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
  142. package/src/components/NumberInput/NumberInput.tsx +136 -6
  143. package/src/components/Pagination/IMPLEMENTATION_NOTES.md +3 -0
  144. package/src/components/Pagination/Pagination.icons.tsx +66 -0
  145. package/src/components/Pagination/Pagination.module.css +234 -20
  146. package/src/components/Pagination/Pagination.stories.tsx +34 -21
  147. package/src/components/Pagination/Pagination.tsx +74 -6
  148. package/src/components/Panel/Panel.module.css +206 -38
  149. package/src/components/Panel/Panel.stories.tsx +214 -22
  150. package/src/components/Panel/Panel.tsx +130 -5
  151. package/src/components/Radio/Radio.module.css +235 -37
  152. package/src/components/Radio/Radio.stories.tsx +77 -19
  153. package/src/components/Radio/Radio.tsx +210 -5
  154. package/src/components/Radio/RadioGroup.stories.tsx +117 -0
  155. package/src/components/Radio/RadioGroup.tsx +125 -0
  156. package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
  157. package/src/components/ReadOnlyField/ReadOnlyField.module.css +53 -15
  158. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +147 -19
  159. package/src/components/ReadOnlyField/ReadOnlyField.tsx +105 -5
  160. package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
  161. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
  162. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
  163. package/src/components/ReadOnlyField/index.ts +1 -0
  164. package/src/components/SegmentedControl/SegmentedControl.module.css +179 -47
  165. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
  166. package/src/components/SegmentedControl/SegmentedControl.tsx +140 -6
  167. package/src/components/Slider/Slider.module.css +539 -86
  168. package/src/components/Slider/Slider.stories.tsx +157 -19
  169. package/src/components/Slider/Slider.tsx +283 -5
  170. package/src/components/Stack/Stack.stories.tsx +4 -25
  171. package/src/components/Stack/Stack.tsx +1 -5
  172. package/src/components/Stepper/IMPLEMENTATION_NOTES.md +4 -0
  173. package/src/components/Stepper/Stepper.module.css +410 -71
  174. package/src/components/Stepper/Stepper.stories.tsx +146 -20
  175. package/src/components/Stepper/Stepper.tsx +147 -6
  176. package/src/components/Switch/Switch.module.css +259 -39
  177. package/src/components/Switch/Switch.stories.tsx +98 -19
  178. package/src/components/Switch/Switch.tsx +200 -6
  179. package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
  180. package/src/components/Switch/SwitchGroup.tsx +120 -0
  181. package/src/components/Table/Table.stories.tsx +1 -19
  182. package/src/components/Table/Table.tsx +3 -1
  183. package/src/components/Tabs/IMPLEMENTATION_NOTES.md +4 -0
  184. package/src/components/Tabs/Tabs.module.css +422 -79
  185. package/src/components/Tabs/Tabs.stories.tsx +156 -20
  186. package/src/components/Tabs/Tabs.tsx +86 -6
  187. package/src/components/Text/Text.stories.tsx +5 -17
  188. package/src/components/Text/Text.tsx +1 -15
  189. package/src/components/TextArea/TextArea.module.css +155 -32
  190. package/src/components/TextArea/TextArea.stories.tsx +80 -21
  191. package/src/components/TextArea/TextArea.tsx +146 -6
  192. package/src/components/TextField/TextField.module.css +261 -42
  193. package/src/components/TextField/TextField.stories.tsx +147 -20
  194. package/src/components/TextField/TextField.tsx +169 -6
  195. package/src/components/TimePicker/TimePicker.stories.tsx +2 -19
  196. package/src/components/TimePicker/TimePicker.tsx +3 -1
  197. package/src/components/Timeline/Timeline.module.css +365 -76
  198. package/src/components/Timeline/Timeline.stories.tsx +114 -21
  199. package/src/components/Timeline/Timeline.tsx +83 -5
  200. package/src/components/Timeline/TimelineItem.tsx +90 -0
  201. package/src/components/Title/Title.stories.tsx +0 -18
  202. package/src/components/Title/Title.tsx +1 -7
  203. package/src/components/Toast/Toast.module.css +166 -28
  204. package/src/components/Toast/Toast.stories.tsx +54 -22
  205. package/src/components/Toast/Toast.tsx +124 -5
  206. package/src/components/Tooltip/Tooltip.module.css +89 -24
  207. package/src/components/Tooltip/Tooltip.stories.tsx +152 -22
  208. package/src/components/Tooltip/Tooltip.tsx +88 -5
  209. package/src/components/TransferList/TransferList.stories.tsx +1 -19
  210. package/src/components/TransferList/TransferList.tsx +3 -1
  211. package/src/utils/RequireAccessibleLabel.ts +1 -12
  212. package/src/utils/filterStylingProps.ts +7 -20
@@ -1,28 +1,33 @@
1
+ import React, { useState } from "react";
1
2
  import type { Meta, StoryObj } from "@storybook/react";
2
- import { Tabs } from "./Tabs";
3
- import { ComingSoon } from "@recursica/storybook-template";
3
+ import { Tabs, Tab, TabPanel } from "./Tabs";
4
+ import { TabContext } from "@mui/lab";
5
+ import { Flex } from "../Flex/Flex";
4
6
 
5
7
  const meta: Meta<typeof Tabs> = {
6
- title: "UI-Kit/🚧 Tabs",
8
+ title: "UI-Kit/Tabs",
7
9
  component: Tabs,
8
10
  tags: ["autodocs"],
9
11
  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
- ],
12
+ layout: "centered",
13
+ },
14
+ argTypes: {
15
+ variant: {
16
+ control: "radio",
17
+ options: ["default", "outline", "pills"],
18
+ },
19
+ orientation: {
20
+ control: "radio",
21
+ options: ["horizontal", "vertical"],
22
+ },
23
+ // @ts-expect-error Custom prop not in native TabsProps
24
+ disabled: {
25
+ control: "boolean",
26
+ },
27
+ defaultChecked: {
28
+ table: {
29
+ disable: true,
30
+ },
26
31
  },
27
32
  },
28
33
  };
@@ -30,6 +35,137 @@ const meta: Meta<typeof Tabs> = {
30
35
  export default meta;
31
36
  type Story = StoryObj<typeof Tabs>;
32
37
 
38
+ const InteractiveTabs = (
39
+ args: React.ComponentProps<typeof Tabs> & {
40
+ disabled?: boolean;
41
+ inverted?: boolean;
42
+ },
43
+ ) => {
44
+ const [value, setValue] = useState("gallery");
45
+
46
+ const handleChange = (event: React.SyntheticEvent, newValue: string) => {
47
+ setValue(newValue);
48
+ };
49
+
50
+ return (
51
+ <Flex w={600} h={300}>
52
+ <TabContext value={value}>
53
+ <Tabs onChange={handleChange} {...args}>
54
+ <Tab
55
+ value="gallery"
56
+ label="Gallery"
57
+ disabled={args.disabled}
58
+ icon={
59
+ <svg
60
+ xmlns="http://www.w3.org/2000/svg"
61
+ viewBox="0 0 24 24"
62
+ fill="none"
63
+ stroke="currentColor"
64
+ strokeWidth="2"
65
+ strokeLinecap="round"
66
+ strokeLinejoin="round"
67
+ width={16}
68
+ height={16}
69
+ >
70
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
71
+ <circle cx="8.5" cy="8.5" r="1.5"></circle>
72
+ <polyline points="21 15 16 10 5 21"></polyline>
73
+ </svg>
74
+ }
75
+ iconPosition="start"
76
+ />
77
+ <Tab
78
+ value="messages"
79
+ label="Messages"
80
+ disabled={args.disabled}
81
+ icon={
82
+ <svg
83
+ xmlns="http://www.w3.org/2000/svg"
84
+ viewBox="0 0 24 24"
85
+ fill="none"
86
+ stroke="currentColor"
87
+ strokeWidth="2"
88
+ strokeLinecap="round"
89
+ strokeLinejoin="round"
90
+ width={16}
91
+ height={16}
92
+ >
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>
94
+ </svg>
95
+ }
96
+ iconPosition="start"
97
+ />
98
+ <Tab
99
+ value="settings"
100
+ label="Settings"
101
+ disabled={args.disabled}
102
+ icon={
103
+ <svg
104
+ xmlns="http://www.w3.org/2000/svg"
105
+ viewBox="0 0 24 24"
106
+ fill="none"
107
+ stroke="currentColor"
108
+ strokeWidth="2"
109
+ strokeLinecap="round"
110
+ strokeLinejoin="round"
111
+ width={16}
112
+ height={16}
113
+ >
114
+ <circle cx="12" cy="12" r="3"></circle>
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>
116
+ </svg>
117
+ }
118
+ iconPosition="start"
119
+ />
120
+ </Tabs>
121
+
122
+ <TabPanel value="gallery">Gallery tab content</TabPanel>
123
+
124
+ <TabPanel value="messages">Messages tab content</TabPanel>
125
+
126
+ <TabPanel value="settings">Settings tab content</TabPanel>
127
+ </TabContext>
128
+ </Flex>
129
+ );
130
+ };
131
+
33
132
  export const Default: Story = {
34
- render: () => <ComingSoon componentName="Tabs" />,
133
+ render: (args) => <InteractiveTabs {...args} />,
134
+ args: {
135
+ variant: "default",
136
+ orientation: "horizontal",
137
+ },
138
+ };
139
+
140
+ export const Outline: Story = {
141
+ render: (args) => <InteractiveTabs {...args} />,
142
+ args: {
143
+ variant: "outline",
144
+ orientation: "horizontal",
145
+ },
146
+ };
147
+
148
+ export const Pills: Story = {
149
+ render: (args) => <InteractiveTabs {...args} />,
150
+ args: {
151
+ variant: "pills",
152
+ orientation: "horizontal",
153
+ },
154
+ };
155
+
156
+ export const Vertical: Story = {
157
+ render: (args) => <InteractiveTabs {...args} />,
158
+ args: {
159
+ variant: "default",
160
+ orientation: "vertical",
161
+ },
162
+ };
163
+
164
+ export const Inverted: Story = {
165
+ render: (args) => <InteractiveTabs {...args} />,
166
+ args: {
167
+ variant: "default",
168
+ orientation: "horizontal",
169
+ inverted: true,
170
+ },
35
171
  };
@@ -1,8 +1,88 @@
1
- import React from "react";
2
- import "./Tabs.module.css";
1
+ import { forwardRef } from "react";
2
+ import {
3
+ Tabs as MuiTabs,
4
+ type TabsProps as MuiTabsProps,
5
+ Tab as MuiTab,
6
+ type TabProps as MuiTabProps,
7
+ } from "@mui/material";
8
+ import {
9
+ filterStylingProps,
10
+ type RecursicaOverStyled,
11
+ } from "../../utils/filterStylingProps";
12
+ import styles from "./Tabs.module.css";
3
13
 
4
- export type TabsProps = React.HTMLAttributes<HTMLDivElement>;
14
+ import { type RecursicaTabsProps } from "@recursica/adapter-common";
5
15
 
6
- export const Tabs: React.FC<TabsProps> = (props) => {
7
- return <div {...props}>Tabs</div>;
8
- };
16
+ export type TabsProps = RecursicaOverStyled<RecursicaTabsProps>;
17
+
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;
27
+
28
+ const sanitizedProps = filterStylingProps(rest, overStyled);
29
+
30
+ return (
31
+ <MuiTabs
32
+ ref={ref}
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)}
42
+ />
43
+ );
44
+ },
45
+ );
46
+
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);
55
+
56
+ return (
57
+ <MuiTab
58
+ ref={ref}
59
+ className={`${styles.tab} ${className || ""}`}
60
+ {...(sanitizedProps as MuiTabProps)}
61
+ />
62
+ );
63
+ },
64
+ );
65
+
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);
77
+
78
+ return (
79
+ <MuiTabPanel
80
+ ref={ref}
81
+ className={`${styles.panel} ${className || ""}`}
82
+ {...(sanitizedProps as MuiTabPanelProps)}
83
+ />
84
+ );
85
+ },
86
+ );
87
+
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
 
@@ -1,37 +1,160 @@
1
1
  /* EXEMPTIONS:
2
- This component is a placeholder stub. Once fully implemented, its specific
3
- tokens will be fully wired up to direct styles. */
4
-
5
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_border-radius */
6
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_horizontal-padding */
7
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_max-width */
8
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_min-width */
9
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_placeholder-opacity */
10
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_rows */
11
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-family */
12
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-size */
13
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-style */
14
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-weight */
15
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_letter-spacing */
16
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_line-height */
17
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_text-decoration */
18
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_text-transform */
19
- /* recursica-ignore: --recursica_ui-kit_components_textarea_properties_vertical-padding */
20
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_layouts_side-by-side_properties_top-bottom-margin */
21
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_layouts_stacked_properties_top-bottom-margin */
2
+ - state-specific border-size variables are ignored because a uniform 1px border is applied globally to prevent
3
+ unexpected layout shift or flickering during focus, disabled, or error state transitions. */
22
4
  /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_border-size */
23
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_background */
24
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_border-color */
25
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_text */
26
5
  /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_border-size */
27
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_background */
28
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_border-color */
29
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_text */
30
6
  /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_border-size */
31
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_background */
32
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_border-color */
33
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_text */
34
7
  /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_focus_properties_border-size */
35
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_background */
36
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_border-color */
37
- /* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_text */
8
+
9
+ /* LAYOUT SPACING OVERRIDES:
10
+ - Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens. */
11
+ .layoutOverride {
12
+ --form-control-margin-bottom: var(
13
+ --recursica_ui-kit_components_textarea_variants_layouts_stacked_properties_top-bottom-margin
14
+ );
15
+ }
16
+
17
+ .layoutOverride[data-form-layout="side-by-side"] {
18
+ --form-control-margin-bottom: var(
19
+ --recursica_ui-kit_components_textarea_variants_layouts_side-by-side_properties_top-bottom-margin
20
+ );
21
+ }
22
+
23
+ /* HARDCODED VALUES:
24
+ - border-width: 1px. Native geometric boundary for the input box.
25
+ - border-style: solid. Native structural rendering rule.
26
+ - outline: none. Bypassing browser focus rings to rely strictly on Recursica focus states natively.
27
+ - flex/layout: display: flex on the root wrapper safely encapsulating internal section rendering.
28
+ */
29
+
30
+ .root {
31
+ display: flex;
32
+ position: relative;
33
+ width: 100%;
34
+ }
35
+
36
+ .input {
37
+ /* Structural Overrides */
38
+ width: 100%;
39
+ box-sizing: border-box;
40
+ margin: 0;
41
+
42
+ /* Sizing driven by rows token */
43
+ min-height: calc(
44
+ var(--recursica_ui-kit_components_textarea_properties_rows) *
45
+ var(--recursica_ui-kit_components_textarea_properties_text_line-height) +
46
+ 2 *
47
+ var(--recursica_ui-kit_components_textarea_properties_vertical-padding) +
48
+ 2px
49
+ );
50
+
51
+ /* Box Geometry */
52
+ padding-top: var(
53
+ --recursica_ui-kit_components_textarea_properties_vertical-padding
54
+ );
55
+ padding-bottom: var(
56
+ --recursica_ui-kit_components_textarea_properties_vertical-padding
57
+ );
58
+ padding-left: var(
59
+ --recursica_ui-kit_components_textarea_properties_horizontal-padding
60
+ );
61
+ padding-right: var(
62
+ --recursica_ui-kit_components_textarea_properties_horizontal-padding
63
+ );
64
+ border-radius: var(
65
+ --recursica_ui-kit_components_textarea_properties_border-radius
66
+ );
67
+ border-width: 1px;
68
+ border-style: solid;
69
+
70
+ /* Strict Typography Unification */
71
+ font-family: var(
72
+ --recursica_ui-kit_components_textarea_properties_text_font-family
73
+ );
74
+ font-size: var(
75
+ --recursica_ui-kit_components_textarea_properties_text_font-size
76
+ );
77
+ font-style: var(
78
+ --recursica_ui-kit_components_textarea_properties_text_font-style
79
+ );
80
+ font-weight: var(
81
+ --recursica_ui-kit_components_textarea_properties_text_font-weight
82
+ );
83
+ letter-spacing: var(
84
+ --recursica_ui-kit_components_textarea_properties_text_letter-spacing
85
+ );
86
+ line-height: var(
87
+ --recursica_ui-kit_components_textarea_properties_text_line-height
88
+ );
89
+ text-decoration: var(
90
+ --recursica_ui-kit_components_textarea_properties_text_text-decoration
91
+ );
92
+ text-transform: var(
93
+ --recursica_ui-kit_components_textarea_properties_text_text-transform
94
+ );
95
+
96
+ /* Base State Default Execution */
97
+ background-color: var(
98
+ --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_background
99
+ );
100
+ border-color: var(
101
+ --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_border-color
102
+ );
103
+ color: var(
104
+ --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_text
105
+ );
106
+
107
+ outline: none;
108
+ }
109
+
110
+ .input::placeholder {
111
+ opacity: var(
112
+ --recursica_ui-kit_components_textarea_properties_placeholder-opacity
113
+ );
114
+ color: inherit;
115
+ }
116
+
117
+ /* -------------------------------------
118
+ STATE CASCADE ARCHITECTURE
119
+ -------------------------------------- */
120
+
121
+ /* Focus State Mapping (Triggered internally via browser focus rules) */
122
+ .input:focus-within,
123
+ .input:focus {
124
+ border-color: var(
125
+ --recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_border-color
126
+ );
127
+ background-color: var(
128
+ --recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_background
129
+ );
130
+ color: var(
131
+ --recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_text
132
+ );
133
+ }
134
+
135
+ /* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
136
+ .root[data-error] .input {
137
+ border-color: var(
138
+ --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_border-color
139
+ ) !important;
140
+ background-color: var(
141
+ --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_background
142
+ ) !important;
143
+ color: var(
144
+ --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_text
145
+ ) !important;
146
+ }
147
+
148
+ /* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
149
+ .root[data-disabled] .input {
150
+ border-color: var(
151
+ --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_border-color
152
+ ) !important;
153
+ background-color: var(
154
+ --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_background
155
+ ) !important;
156
+ color: var(
157
+ --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_text
158
+ ) !important;
159
+ cursor: not-allowed;
160
+ }
@@ -1,35 +1,94 @@
1
+ import React from "react";
1
2
  import type { Meta, StoryObj } from "@storybook/react";
2
3
  import { TextArea } from "./TextArea";
3
- import { ComingSoon } from "@recursica/storybook-template";
4
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
4
5
 
5
- const meta: Meta<typeof TextArea> = {
6
- title: "UI-Kit/🚧 TextArea",
6
+ type TextAreaStoryProps = React.ComponentProps<typeof TextArea>;
7
+
8
+ const meta: Meta<TextAreaStoryProps> = {
9
+ title: "UI-Kit/TextArea",
7
10
  component: TextArea,
8
11
  tags: ["autodocs"],
9
12
  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
- ],
13
+ docs: {
14
+ description: {
15
+ component:
16
+ "TextArea provides a multi-line input field, mapping layout explicitly over the standardized FormControlWrapper.",
17
+ },
18
+ },
19
+ },
20
+ args: {
21
+ label: "Description",
22
+ assistiveText: "Enter your full description here.",
23
+ disabled: false,
24
+ required: false,
25
+ readOnly: false,
26
+ autosize: false,
27
+ },
28
+ argTypes: {
29
+ disabled: {
30
+ control: "boolean",
31
+ },
32
+ ...formControlArgTypes,
33
+ readOnly: {
34
+ control: "boolean",
35
+ },
36
+ autosize: {
37
+ control: "boolean",
38
+ },
39
+ minRows: {
40
+ control: "number",
41
+ },
42
+ maxRows: {
43
+ control: "number",
44
+ },
45
+ value: {
46
+ control: "text",
47
+ },
48
+ placeholder: {
49
+ control: "text",
26
50
  },
27
51
  },
28
52
  };
29
53
 
30
54
  export default meta;
31
- type Story = StoryObj<typeof TextArea>;
55
+
56
+ type Story = StoryObj<TextAreaStoryProps>;
32
57
 
33
58
  export const Default: Story = {
34
- render: () => <ComingSoon componentName="TextArea" />,
59
+ args: {
60
+ placeholder: "Type something long...",
61
+ },
62
+ };
63
+
64
+ export const Autosize: Story = {
65
+ args: {
66
+ label: "Auto-sizing TextArea",
67
+ autosize: true,
68
+ minRows: 2,
69
+ maxRows: 6,
70
+ placeholder: "Type multiple lines here. Watch it grow!",
71
+ },
72
+ };
73
+
74
+ export const StaticError: Story = {
75
+ args: {
76
+ error: "This field requires a detailed explanation.",
77
+ value: "Some bad input.",
78
+ },
79
+ };
80
+
81
+ export const StaticDisabled: Story = {
82
+ args: {
83
+ disabled: true,
84
+ value: "This content is locked.",
85
+ },
86
+ };
87
+
88
+ export const StaticReadOnly: Story = {
89
+ args: {
90
+ label: "Read Only View",
91
+ readOnly: true,
92
+ value: "This text is safely frozen in read-only form.",
93
+ },
35
94
  };