@recursica/mui-adapter 0.4.0 → 0.6.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 (177) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/mui-adapter.cjs +74 -1
  3. package/dist/mui-adapter.cjs.map +1 -1
  4. package/dist/mui-adapter.css +1 -1
  5. package/dist/mui-adapter.js +6651 -201
  6. package/dist/mui-adapter.js.map +1 -1
  7. package/dist/src/components/Accordion/Accordion.d.ts +63 -2
  8. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +9 -2
  9. package/dist/src/components/Autocomplete/Autocomplete.d.ts +17 -0
  10. package/dist/src/components/Autocomplete/index.d.ts +1 -0
  11. package/dist/src/components/Avatar/Avatar.d.ts +14 -2
  12. package/dist/src/components/Badge/Badge.d.ts +13 -3
  13. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +10 -3
  14. package/dist/src/components/Button/Button.d.ts +1 -1
  15. package/dist/src/components/Card/Card.d.ts +40 -3
  16. package/dist/src/components/Checkbox/Checkbox.d.ts +15 -2
  17. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +16 -0
  18. package/dist/src/components/Checkbox/index.d.ts +5 -1
  19. package/dist/src/components/Chip/Chip.d.ts +18 -2
  20. package/dist/src/components/Dropdown/Dropdown.d.ts +23 -3
  21. package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +10 -2
  22. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +24 -2
  23. package/dist/src/components/HoverCard/HoverCard.d.ts +55 -3
  24. package/dist/src/components/Label/Label.d.ts +13 -2
  25. package/dist/src/components/Link/Link.d.ts +1 -1
  26. package/dist/src/components/Menu/Menu.d.ts +99 -3
  27. package/dist/src/components/Modal/Modal.d.ts +36 -2
  28. package/dist/src/components/NumberInput/NumberInput.d.ts +14 -2
  29. package/dist/src/components/Pagination/Pagination.d.ts +44 -2
  30. package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
  31. package/dist/src/components/Panel/Panel.d.ts +65 -3
  32. package/dist/src/components/Radio/Radio.d.ts +13 -3
  33. package/dist/src/components/Radio/RadioGroup.d.ts +13 -0
  34. package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
  35. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +7 -2
  36. package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
  37. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  38. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
  39. package/dist/src/components/ReadOnlyField/index.d.ts +1 -0
  40. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +31 -3
  41. package/dist/src/components/Slider/Slider.d.ts +28 -2
  42. package/dist/src/components/Stepper/Stepper.d.ts +21 -2
  43. package/dist/src/components/Switch/Switch.d.ts +10 -3
  44. package/dist/src/components/Switch/SwitchGroup.d.ts +13 -0
  45. package/dist/src/components/Tabs/Tabs.d.ts +35 -3
  46. package/dist/src/components/Text/Text.d.ts +1 -1
  47. package/dist/src/components/TextArea/TextArea.d.ts +18 -2
  48. package/dist/src/components/TextField/TextField.d.ts +16 -2
  49. package/dist/src/components/Timeline/Timeline.d.ts +14 -2
  50. package/dist/src/components/Timeline/TimelineItem.d.ts +29 -0
  51. package/dist/src/components/Title/Title.d.ts +1 -1
  52. package/dist/src/components/Toast/Toast.d.ts +25 -2
  53. package/dist/src/components/Tooltip/Tooltip.d.ts +42 -3
  54. package/dist/src/components/Typography/Typography.d.ts +1 -1
  55. package/dist/src/components/index.d.ts +1 -0
  56. package/package.json +12 -2
  57. package/src/GlobalExemptions.modules.css +13 -0
  58. package/src/components/Accordion/Accordion.module.css +295 -0
  59. package/src/components/Accordion/Accordion.stories.tsx +149 -21
  60. package/src/components/Accordion/Accordion.tsx +264 -4
  61. package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
  62. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +76 -19
  63. package/src/components/AssistiveElement/AssistiveElement.tsx +85 -4
  64. package/src/components/Autocomplete/Autocomplete.module.css +325 -0
  65. package/src/components/Autocomplete/Autocomplete.stories.tsx +196 -0
  66. package/src/components/Autocomplete/Autocomplete.tsx +201 -0
  67. package/src/components/Autocomplete/index.ts +1 -0
  68. package/src/components/Avatar/Avatar.module.css +344 -0
  69. package/src/components/Avatar/Avatar.stories.tsx +94 -22
  70. package/src/components/Avatar/Avatar.tsx +110 -5
  71. package/src/components/Badge/Badge.module.css +127 -0
  72. package/src/components/Badge/Badge.stories.tsx +65 -22
  73. package/src/components/Badge/Badge.tsx +70 -5
  74. package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
  75. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +57 -22
  76. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -5
  77. package/src/components/Button/Button.module.css +113 -20
  78. package/src/components/Button/Button.stories.tsx +3 -0
  79. package/src/components/Button/Button.tsx +10 -3
  80. package/src/components/Card/Card.module.css +118 -0
  81. package/src/components/Card/Card.stories.tsx +117 -19
  82. package/src/components/Card/Card.tsx +179 -4
  83. package/src/components/Checkbox/Checkbox.module.css +232 -0
  84. package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
  85. package/src/components/Checkbox/Checkbox.tsx +146 -4
  86. package/src/components/Checkbox/CheckboxGroup.tsx +117 -0
  87. package/src/components/Checkbox/index.ts +6 -1
  88. package/src/components/Chip/Chip.module.css +236 -0
  89. package/src/components/Chip/Chip.stories.tsx +101 -21
  90. package/src/components/Chip/Chip.tsx +138 -5
  91. package/src/components/DatePicker/DatePicker.module.css +42 -0
  92. package/src/components/DatePicker/DatePicker.tsx +1 -0
  93. package/src/components/Dropdown/Dropdown.module.css +296 -0
  94. package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
  95. package/src/components/Dropdown/Dropdown.tsx +182 -5
  96. package/src/components/FileInput/FileInput.module.css +47 -0
  97. package/src/components/FileInput/FileInput.tsx +1 -0
  98. package/src/components/FileUpload/FileUpload.module.css +40 -0
  99. package/src/components/FileUpload/FileUpload.tsx +1 -0
  100. package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
  101. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +74 -19
  102. package/src/components/FormControlLayout/FormControlLayout.tsx +58 -4
  103. package/src/components/FormControlWrapper/FormControlWrapper.module.css +96 -0
  104. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +122 -19
  105. package/src/components/FormControlWrapper/FormControlWrapper.tsx +145 -6
  106. package/src/components/HoverCard/HoverCard.module.css +91 -0
  107. package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
  108. package/src/components/HoverCard/HoverCard.tsx +150 -4
  109. package/src/components/Label/Label.module.css +136 -0
  110. package/src/components/Label/Label.stories.tsx +98 -17
  111. package/src/components/Label/Label.tsx +88 -4
  112. package/src/components/Link/Link.module.css +8 -0
  113. package/src/components/Menu/Menu.module.css +287 -0
  114. package/src/components/Menu/Menu.stories.tsx +307 -21
  115. package/src/components/Menu/Menu.tsx +318 -4
  116. package/src/components/Modal/Modal.module.css +172 -0
  117. package/src/components/Modal/Modal.stories.tsx +66 -22
  118. package/src/components/Modal/Modal.tsx +216 -3
  119. package/src/components/NumberInput/NumberInput.module.css +281 -0
  120. package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
  121. package/src/components/NumberInput/NumberInput.tsx +148 -5
  122. package/src/components/Pagination/Pagination.icons.tsx +66 -0
  123. package/src/components/Pagination/Pagination.module.css +307 -0
  124. package/src/components/Pagination/Pagination.stories.tsx +42 -21
  125. package/src/components/Pagination/Pagination.tsx +193 -4
  126. package/src/components/Panel/Panel.module.css +206 -0
  127. package/src/components/Panel/Panel.stories.tsx +214 -22
  128. package/src/components/Panel/Panel.tsx +153 -4
  129. package/src/components/Radio/Radio.module.css +220 -0
  130. package/src/components/Radio/Radio.stories.tsx +77 -19
  131. package/src/components/Radio/Radio.tsx +178 -4
  132. package/src/components/Radio/RadioGroup.tsx +111 -0
  133. package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
  134. package/src/components/ReadOnlyField/ReadOnlyField.module.css +54 -0
  135. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +175 -16
  136. package/src/components/ReadOnlyField/ReadOnlyField.tsx +109 -4
  137. package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
  138. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
  139. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
  140. package/src/components/ReadOnlyField/index.ts +1 -0
  141. package/src/components/SegmentedControl/SegmentedControl.module.css +203 -0
  142. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
  143. package/src/components/SegmentedControl/SegmentedControl.tsx +110 -5
  144. package/src/components/Slider/Slider.module.css +542 -0
  145. package/src/components/Slider/Slider.stories.tsx +157 -19
  146. package/src/components/Slider/Slider.tsx +282 -4
  147. package/src/components/Stepper/Stepper.module.css +410 -0
  148. package/src/components/Stepper/Stepper.stories.tsx +132 -19
  149. package/src/components/Stepper/Stepper.tsx +145 -5
  150. package/src/components/Switch/Switch.module.css +238 -0
  151. package/src/components/Switch/Switch.stories.tsx +98 -19
  152. package/src/components/Switch/Switch.tsx +153 -5
  153. package/src/components/Switch/SwitchGroup.tsx +111 -0
  154. package/src/components/Tabs/Tabs.module.css +422 -0
  155. package/src/components/Tabs/Tabs.stories.tsx +138 -19
  156. package/src/components/Tabs/Tabs.tsx +103 -5
  157. package/src/components/TextArea/TextArea.module.css +160 -0
  158. package/src/components/TextArea/TextArea.stories.tsx +80 -21
  159. package/src/components/TextArea/TextArea.tsx +156 -5
  160. package/src/components/TextField/TextField.module.css +266 -0
  161. package/src/components/TextField/TextField.stories.tsx +168 -15
  162. package/src/components/TextField/TextField.tsx +171 -5
  163. package/src/components/TimePicker/TimePicker.module.css +41 -0
  164. package/src/components/TimePicker/TimePicker.tsx +1 -0
  165. package/src/components/Timeline/Timeline.module.css +367 -0
  166. package/src/components/Timeline/Timeline.stories.tsx +114 -21
  167. package/src/components/Timeline/Timeline.tsx +80 -4
  168. package/src/components/Timeline/TimelineItem.tsx +101 -0
  169. package/src/components/Toast/Toast.module.css +170 -0
  170. package/src/components/Toast/Toast.stories.tsx +54 -22
  171. package/src/components/Toast/Toast.tsx +90 -4
  172. package/src/components/Tooltip/Tooltip.module.css +90 -0
  173. package/src/components/Tooltip/Tooltip.stories.tsx +152 -22
  174. package/src/components/Tooltip/Tooltip.tsx +114 -4
  175. package/src/components/TransferList/TransferList.module.css +38 -0
  176. package/src/components/TransferList/TransferList.tsx +1 -0
  177. package/src/components/index.ts +1 -0
@@ -0,0 +1,266 @@
1
+ /* EXEMPTIONS:
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. */
4
+ /* recursica-ignore: --recursica_ui-kit_components_text-field_variants_states_default_properties_border-size */
5
+ /* recursica-ignore: --recursica_ui-kit_components_text-field_variants_states_disabled_properties_border-size */
6
+ /* recursica-ignore: --recursica_ui-kit_components_text-field_variants_states_error_properties_border-size */
7
+ /* recursica-ignore: --recursica_ui-kit_components_text-field_variants_states_focus_properties_border-size */
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_text-field_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_text-field_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
+ min-height: var(
35
+ --recursica_ui-kit_components_text-field_properties_min-height
36
+ );
37
+
38
+ /* Strict Typography Unification placed on root for MUI InputBase inheritance */
39
+ font-family: var(
40
+ --recursica_ui-kit_components_text-field_properties_text_font-family
41
+ );
42
+ font-size: var(
43
+ --recursica_ui-kit_components_text-field_properties_text_font-size
44
+ );
45
+ font-style: var(
46
+ --recursica_ui-kit_components_text-field_properties_text_font-style
47
+ );
48
+ font-weight: var(
49
+ --recursica_ui-kit_components_text-field_properties_text_font-weight
50
+ );
51
+ letter-spacing: var(
52
+ --recursica_ui-kit_components_text-field_properties_text_letter-spacing
53
+ );
54
+ line-height: var(
55
+ --recursica_ui-kit_components_text-field_properties_text_line-height
56
+ );
57
+ text-decoration: var(
58
+ --recursica_ui-kit_components_text-field_properties_text_text-decoration
59
+ );
60
+ text-transform: var(
61
+ --recursica_ui-kit_components_text-field_properties_text_text-transform
62
+ );
63
+
64
+ /* Box Geometry placed on root so MUI InputBase boundary executes */
65
+ border-radius: var(
66
+ --recursica_ui-kit_components_text-field_properties_border-radius
67
+ );
68
+ border-width: 1px;
69
+ border-style: solid;
70
+
71
+ /* Base State Default Execution */
72
+ background-color: var(
73
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_background
74
+ );
75
+ border-color: var(
76
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_border-color
77
+ );
78
+ color: var(
79
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_text
80
+ );
81
+
82
+ /* Override MUI/Mantine native Input variables governing section spacing padding mathematics safely */
83
+ --input-left-section-size: calc(
84
+ var(
85
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
86
+ ) +
87
+ var(--recursica_ui-kit_components_text-field_properties_icon-size) +
88
+ var(--recursica_ui-kit_components_text-field_properties_icon-text-gap)
89
+ );
90
+ --input-right-section-size: calc(
91
+ var(
92
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
93
+ ) +
94
+ var(--recursica_ui-kit_components_text-field_properties_icon-size) +
95
+ var(--recursica_ui-kit_components_text-field_properties_icon-text-gap)
96
+ );
97
+ }
98
+
99
+ .input {
100
+ /* Structural Overrides */
101
+ width: 100%;
102
+ box-sizing: border-box;
103
+ margin: 0;
104
+
105
+ /* Box Geometry Padding */
106
+ min-height: var(
107
+ --recursica_ui-kit_components_text-field_properties_min-height
108
+ );
109
+ padding-top: var(
110
+ --recursica_ui-kit_components_text-field_properties_vertical-padding
111
+ );
112
+ padding-bottom: var(
113
+ --recursica_ui-kit_components_text-field_properties_vertical-padding
114
+ );
115
+ padding-left: var(
116
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
117
+ );
118
+ padding-right: var(
119
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
120
+ );
121
+
122
+ outline: none;
123
+ border: none; /* Because root handles border in MUI */
124
+ background: transparent;
125
+ color: inherit;
126
+ height: auto; /* overrides MUI's 1.1876em */
127
+ }
128
+
129
+ .input::placeholder {
130
+ opacity: var(
131
+ --recursica_ui-kit_components_text-field_properties_placeholder-opacity
132
+ );
133
+ color: inherit;
134
+ }
135
+
136
+ /* Dynamic Padding Overrides */
137
+ .root[data-with-left-section="true"] .input {
138
+ padding-left: var(--input-left-section-size);
139
+ }
140
+
141
+ .root[data-with-right-section="true"] .input {
142
+ padding-right: var(--input-right-section-size);
143
+ }
144
+
145
+ /* Flexible End-Caps (Icons, actions) */
146
+ .section {
147
+ display: flex;
148
+ align-items: center;
149
+ height: 100%;
150
+ position: absolute;
151
+ }
152
+
153
+ .section[data-position="left"] {
154
+ justify-content: flex-start;
155
+ left: 0;
156
+ padding-left: var(
157
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
158
+ );
159
+ }
160
+
161
+ .section[data-position="right"] {
162
+ justify-content: flex-end;
163
+ right: 0;
164
+ padding-right: var(
165
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
166
+ );
167
+ }
168
+
169
+ .section :global(svg) {
170
+ width: var(--recursica_ui-kit_components_text-field_properties_icon-size);
171
+ height: var(--recursica_ui-kit_components_text-field_properties_icon-size);
172
+ color: var(
173
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_leading-icon
174
+ );
175
+ }
176
+
177
+ .section[data-position="right"] :global(svg) {
178
+ color: var(
179
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_trailing-icon
180
+ );
181
+ }
182
+
183
+ /* -------------------------------------
184
+ STATE CASCADE ARCHITECTURE
185
+ -------------------------------------- */
186
+
187
+ /* Focus State Mapping (Triggered internally via browser pseudo-pseudo-class) */
188
+ .root:focus-within,
189
+ .root:focus {
190
+ border-color: var(
191
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_border-color
192
+ );
193
+ background-color: var(
194
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_background
195
+ );
196
+ color: var(
197
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_text
198
+ );
199
+ }
200
+
201
+ .root:focus-within .section[data-position="left"] :global(svg) {
202
+ color: var(
203
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_leading-icon
204
+ );
205
+ }
206
+
207
+ .root:focus-within .section[data-position="right"] :global(svg) {
208
+ color: var(
209
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_trailing-icon
210
+ );
211
+ }
212
+
213
+ /* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
214
+ .root[data-error="true"] {
215
+ border-color: var(
216
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_border-color
217
+ );
218
+ background-color: var(
219
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_background
220
+ );
221
+ color: var(
222
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_text
223
+ );
224
+ }
225
+
226
+ .root[data-error="true"] .section[data-position="left"] :global(svg) {
227
+ color: var(
228
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_leading-icon
229
+ );
230
+ }
231
+
232
+ .root[data-error="true"] .section[data-position="right"] :global(svg) {
233
+ color: var(
234
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_trailing-icon
235
+ );
236
+ }
237
+
238
+ /* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
239
+ .root[data-disabled="true"] {
240
+ border-color: var(
241
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_border-color
242
+ );
243
+ background-color: var(
244
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_background
245
+ );
246
+ color: var(
247
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_text
248
+ );
249
+ cursor: not-allowed;
250
+ }
251
+
252
+ .root[data-disabled="true"] .input {
253
+ cursor: not-allowed;
254
+ }
255
+
256
+ .root[data-disabled="true"] .section[data-position="left"] :global(svg) {
257
+ color: var(
258
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_leading-icon
259
+ );
260
+ }
261
+
262
+ .root[data-disabled="true"] .section[data-position="right"] :global(svg) {
263
+ color: var(
264
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_trailing-icon
265
+ );
266
+ }
@@ -1,35 +1,188 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import React from "react";
1
3
  import type { Meta, StoryObj } from "@storybook/react";
2
4
  import { TextField } from "./TextField";
3
- import { ComingSoon } from "@recursica/storybook-template";
5
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
4
6
 
5
7
  const meta: Meta<typeof TextField> = {
6
- title: "UI-Kit/🚧 TextField",
8
+ title: "UI-Kit/TextField",
7
9
  component: TextField,
8
10
  tags: ["autodocs"],
9
11
  parameters: {
12
+ docs: {
13
+ description: {
14
+ component: `
15
+ The \`TextField\` primitive functions as a universal text entry input natively integrated directly into the unified \`FormControlWrapper\` architecture.
16
+
17
+ ### 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.
19
+
20
+ ### Examples
21
+ Always structure horizontal architectures via the generic \`formLayout\` parameter.
22
+ \`\`\`tsx
23
+ <TextField
24
+ label="Primary Network Socket"
25
+ assistiveText="Ensure connections resolve seamlessly."
26
+ formLayout="stacked"
27
+ />
28
+ \`\`\`
29
+ `,
30
+ },
31
+ },
10
32
  controls: {
11
33
  include: [
12
- "layer",
13
- "withLayer",
14
- "children",
15
- "component",
16
- "variant",
17
- "size",
18
- "icon",
19
34
  "disabled",
20
- "href",
21
- "onClick",
22
- "onChange",
23
- "value",
24
- "checked",
35
+ "error",
36
+ "required",
37
+ "label",
38
+ "assistiveText",
39
+ "readOnly",
40
+ "formLayout",
41
+ "labelSize",
42
+ "labelAlignment",
43
+ "labelOptionalText",
44
+ "labelWithEditIcon",
25
45
  ],
26
46
  },
27
47
  },
48
+ argTypes: {
49
+ ...formControlArgTypes,
50
+ disabled: {
51
+ control: "boolean",
52
+ description:
53
+ "Maps the formal disabled variable states structurally to the input core.",
54
+ },
55
+ error: {
56
+ control: "text",
57
+ description:
58
+ "Applies the strict error string boundary rendering invalid structures seamlessly.",
59
+ },
60
+ required: {
61
+ control: "boolean",
62
+ },
63
+ label: {
64
+ control: "text",
65
+ },
66
+ assistiveText: {
67
+ control: "text",
68
+ },
69
+ readOnly: {
70
+ control: "boolean",
71
+ description:
72
+ "Toggles structural read-only data presentation explicitly blocking standard component bindings.",
73
+ },
74
+ },
28
75
  };
29
76
 
30
77
  export default meta;
78
+
31
79
  type Story = StoryObj<typeof TextField>;
32
80
 
33
81
  export const Default: Story = {
34
- render: () => <ComingSoon componentName="TextField" />,
82
+ args: {
83
+ disabled: false,
84
+ label: "Authentication Token",
85
+ placeholder: "Enter validation hash...",
86
+ assistiveText:
87
+ "Tokens are stored identically locally and strictly ephemeral.",
88
+ },
89
+ render: ({ ...args }: any) => <TextField {...args} />,
90
+ };
91
+
92
+ export const FormsSideBySide: Story = {
93
+ args: {
94
+ label: "Distributed Access Control",
95
+ placeholder: "admin@node.local",
96
+ assistiveText:
97
+ "Specify the exact cluster administrative credentials enforcing strict domain policies. This violently long string tests native textual wrapping safely mapping alongside inputs.",
98
+ formLayout: "side-by-side",
99
+ },
100
+ render: ({ ...args }: any) => <TextField {...args} />,
101
+ };
102
+
103
+ export const WithLeadingIcon: Story = {
104
+ args: {
105
+ label: "Search Global Context",
106
+ placeholder: "Search for repositories...",
107
+ leftSection: (
108
+ <svg
109
+ width="24"
110
+ height="24"
111
+ viewBox="0 0 24 24"
112
+ fill="none"
113
+ stroke="currentColor"
114
+ strokeWidth="2"
115
+ strokeLinecap="round"
116
+ strokeLinejoin="round"
117
+ >
118
+ <circle cx="11" cy="11" r="8"></circle>
119
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
120
+ </svg>
121
+ ),
122
+ },
123
+ render: ({ ...args }: any) => <TextField {...args} />,
124
+ };
125
+
126
+ export const WithTrailingIcon: Story = {
127
+ args: {
128
+ label: "Validation URL",
129
+ placeholder: "https://recursica.dev",
130
+ rightSection: (
131
+ <svg
132
+ width="24"
133
+ height="24"
134
+ viewBox="0 0 24 24"
135
+ fill="none"
136
+ stroke="currentColor"
137
+ strokeWidth="2"
138
+ strokeLinecap="round"
139
+ strokeLinejoin="round"
140
+ >
141
+ <polyline points="20 6 9 17 4 12"></polyline>
142
+ </svg>
143
+ ),
144
+ },
145
+ render: ({ ...args }: any) => <TextField {...args} />,
146
+ };
147
+
148
+ export const Disabled: Story = {
149
+ args: {
150
+ label: "Disabled Deployment Node",
151
+ placeholder: "Disabled primitive map...",
152
+ disabled: true,
153
+ },
154
+ render: ({ ...args }: any) => <TextField {...args} />,
155
+ };
156
+
157
+ export const ErrorState: Story = {
158
+ args: {
159
+ label: "Cluster Failure",
160
+ placeholder: "Failing component instance...",
161
+ defaultValue: "Invalid Execution Plan",
162
+ error:
163
+ "Critical runtime node disconnect detected traversing DOM architecture.",
164
+ required: true,
165
+ },
166
+ render: ({ ...args }: any) => <TextField {...args} />,
167
+ };
168
+
169
+ export const StaticReadOnly: Story = {
170
+ args: {
171
+ label: "Static ReadOnly Review",
172
+ placeholder: "Ignored...",
173
+ value: "Explicitly Uneditable Bound Output",
174
+ readOnly: true,
175
+ },
176
+ render: ({ ...args }: any) => <TextField {...args} />,
177
+ };
178
+
179
+ export const EditableReadOnly: Story = {
180
+ args: {
181
+ label: "Editable ReadOnly Review",
182
+ placeholder: "Ignored until active...",
183
+ defaultValue: "Waiting for Edit Execution",
184
+ readOnly: true,
185
+ labelWithEditIcon: true,
186
+ },
187
+ render: ({ ...args }: any) => <TextField {...args} />,
35
188
  };
@@ -1,7 +1,173 @@
1
- import React from "react";
1
+ import React, { forwardRef } from "react";
2
+ import { InputBase, type InputBaseProps } from "@mui/material";
3
+ import { type ReadOnlyControlProps } from "@recursica/adapter-common";
4
+ import {
5
+ filterStylingProps,
6
+ type RecursicaOverStyled,
7
+ } from "../../utils/filterStylingProps";
8
+ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
9
+ import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
10
+ import styles from "./TextField.module.css";
2
11
 
3
- export type TextFieldProps = React.HTMLAttributes<HTMLDivElement>;
12
+ export interface RecursicaTextFieldProps
13
+ extends Omit<
14
+ InputBaseProps,
15
+ "color" | "size" | "startAdornment" | "endAdornment" | "autoComplete"
16
+ >,
17
+ Omit<
18
+ React.ComponentPropsWithoutRef<"input">,
19
+ keyof InputBaseProps | "size" | "color" | "style" | "className" | "id"
20
+ >,
21
+ Pick<
22
+ RecursicaFormControlWrapperProps,
23
+ | "label"
24
+ | "error"
25
+ | "required"
26
+ | "id"
27
+ | "assistiveText"
28
+ | "assistiveWithIcon"
29
+ | "formLayout"
30
+ | "labelSize"
31
+ | "labelAlignment"
32
+ | "labelOptionalText"
33
+ | "labelWithEditIcon"
34
+ | "onLabelEditClick"
35
+ >,
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
+ }
4
42
 
5
- export const TextField: React.FC<TextFieldProps> = (props) => {
6
- return <div {...props}>TextField</div>;
7
- };
43
+ export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
44
+
45
+ export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
46
+ function TextField(props, ref) {
47
+ const {
48
+ overStyled = false,
49
+ formLayout = "stacked",
50
+
51
+ // Label & Wrapper Maps
52
+ labelSize,
53
+ labelAlignment,
54
+ labelOptionalText,
55
+ labelWithEditIcon,
56
+ onLabelEditClick,
57
+
58
+ label,
59
+ assistiveText,
60
+ assistiveWithIcon,
61
+ error,
62
+ required,
63
+ id,
64
+ className,
65
+ style,
66
+ disabled,
67
+ readOnly,
68
+ readOnlyComponent,
69
+ emptyValueComponent,
70
+ value,
71
+ defaultValue,
72
+ leftSection,
73
+ rightSection,
74
+ ...rest
75
+ } = props;
76
+
77
+ const sanitizedProps = filterStylingProps(rest, overStyled);
78
+ const restRecord = sanitizedProps as Record<string, unknown>;
79
+
80
+ // Delete prohibited sizing hooks from bypassing variables natively
81
+ delete restRecord["size"];
82
+ delete restRecord["color"];
83
+
84
+ // Securely map core native blocks down ensuring nested CSS modules map precisely
85
+ const mergedClassNames: Partial<Record<string, string>> = {
86
+ wrapper: styles.root, // The nested Input internal relative wrapper bounding box
87
+ input: styles.input,
88
+ section: styles.section,
89
+ };
90
+
91
+ const classesProp = restRecord.classes;
92
+ if (
93
+ classesProp &&
94
+ typeof classesProp === "object" &&
95
+ !Array.isArray(classesProp)
96
+ ) {
97
+ const o = classesProp as Partial<Record<string, string>>;
98
+ mergedClassNames.wrapper = o.root
99
+ ? `${styles.root} ${o.root}`
100
+ : styles.root;
101
+ mergedClassNames.input = o.input
102
+ ? `${styles.input} ${o.input}`
103
+ : styles.input;
104
+ }
105
+
106
+ const wrapperClass = className
107
+ ? `${styles.layoutOverride} ${className}`
108
+ : styles.layoutOverride;
109
+
110
+ const startAdornment = leftSection ? (
111
+ <div className={mergedClassNames.section} data-position="left">
112
+ {leftSection}
113
+ </div>
114
+ ) : undefined;
115
+
116
+ const endAdornment = rightSection ? (
117
+ <div className={mergedClassNames.section} data-position="right">
118
+ {rightSection}
119
+ </div>
120
+ ) : undefined;
121
+
122
+ return (
123
+ <WithReadOnlyWrapper
124
+ className={wrapperClass}
125
+ style={style as React.CSSProperties}
126
+ controlMaxWidth="var(--recursica_ui-kit_components_text-field_properties_max-width)"
127
+ controlMinWidth="var(--recursica_ui-kit_components_text-field_properties_min-width)"
128
+ overStyled={overStyled as true}
129
+ formLayout={formLayout}
130
+ labelSize={labelSize}
131
+ labelAlignment={labelAlignment}
132
+ labelOptionalText={labelOptionalText}
133
+ labelWithEditIcon={labelWithEditIcon}
134
+ onLabelEditClick={onLabelEditClick}
135
+ label={label}
136
+ assistiveText={assistiveText}
137
+ assistiveWithIcon={assistiveWithIcon}
138
+ error={error}
139
+ required={required}
140
+ id={id}
141
+ readOnly={readOnly}
142
+ readOnlyComponent={readOnlyComponent as any}
143
+ emptyValueComponent={(emptyValueComponent as any) || undefined}
144
+ readOnlyType="text"
145
+ readOnlyValue={value !== undefined ? value : defaultValue}
146
+ readOnlyNativeProps={props}
147
+ activeComponent={
148
+ /* Naked Input execution safely decoupled from MUI's macro FormControl DOM hooks */
149
+ <InputBase
150
+ inputRef={ref} // MUI specific forward ref mapping
151
+ classes={{
152
+ root: mergedClassNames.wrapper,
153
+ input: mergedClassNames.input,
154
+ }}
155
+ disabled={disabled}
156
+ value={value}
157
+ defaultValue={defaultValue}
158
+ startAdornment={startAdornment}
159
+ endAdornment={endAdornment}
160
+ // Bind native CSS selectors for errors / adornments explicitly to the root boundary
161
+ data-disabled={disabled ? "true" : undefined}
162
+ data-error={error ? "true" : undefined}
163
+ data-with-left-section={leftSection ? "true" : undefined}
164
+ data-with-right-section={rightSection ? "true" : undefined}
165
+ {...(sanitizedProps as unknown as InputBaseProps)}
166
+ />
167
+ }
168
+ />
169
+ );
170
+ },
171
+ );
172
+
173
+ TextField.displayName = "TextField";
@@ -0,0 +1,41 @@
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_time-picker_properties_border-radius */
6
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_horizontal-padding */
7
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_icon-size */
8
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_icon-text-gap */
9
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_placeholder-opacity */
10
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_font-family */
11
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_font-size */
12
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_font-style */
13
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_font-weight */
14
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_letter-spacing */
15
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_line-height */
16
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_text-decoration */
17
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_text_text-transform */
18
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_vertical-padding */
19
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_width */
20
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_layouts_side-by-side_properties_top-bottom-margin */
21
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_layouts_stacked_properties_top-bottom-margin */
22
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_default_properties_border-size */
23
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_default_properties_colors_background */
24
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_default_properties_colors_border-color */
25
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_default_properties_colors_icon */
26
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_default_properties_colors_text */
27
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_border-size */
28
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_colors_background */
29
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_colors_border-color */
30
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_colors_icon */
31
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_colors_text */
32
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_border-size */
33
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_colors_background */
34
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_colors_border-color */
35
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_colors_icon */
36
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_colors_text */
37
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_focus_properties_border-size */
38
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_focus_properties_colors_background */
39
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_focus_properties_colors_border-color */
40
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_focus_properties_colors_icon */
41
+ /* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_focus_properties_colors_text */
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import "./TimePicker.module.css";
2
3
 
3
4
  export type TimePickerProps = React.HTMLAttributes<HTMLDivElement>;
4
5