@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,325 @@
1
+ /* EXEMPTIONS:
2
+ - state-specific border-size variables are ignored because the input box uses a uniform static boundary to prevent
3
+ unexpected layout shifts or flickering when switching between active, focused, or error states. */
4
+ /* recursica-ignore: --recursica_ui-kit_components_autocomplete_variants_states_default_properties_border-size */
5
+ /* recursica-ignore: --recursica_ui-kit_components_autocomplete_variants_states_disabled_properties_border-size */
6
+ /* recursica-ignore: --recursica_ui-kit_components_autocomplete_variants_states_error_properties_border-size */
7
+ /* recursica-ignore: --recursica_ui-kit_components_autocomplete_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_autocomplete_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_autocomplete_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_autocomplete_properties_min-height
36
+ );
37
+
38
+ /* Override Mantine native Input variables governing section spacing padding mathematics safely */
39
+ --input-left-section-size: calc(
40
+ var(
41
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
42
+ ) +
43
+ var(--recursica_ui-kit_components_autocomplete_properties_icon-size) +
44
+ var(--recursica_ui-kit_components_autocomplete_properties_icon-text-gap)
45
+ );
46
+ --input-right-section-size: calc(
47
+ var(
48
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
49
+ ) +
50
+ var(--recursica_ui-kit_components_autocomplete_properties_icon-size) +
51
+ var(--recursica_ui-kit_components_autocomplete_properties_icon-text-gap)
52
+ );
53
+ }
54
+
55
+ /* Strip MUI native Form Control wrapper margins on standard variant */
56
+ .root :global(.MuiFormControl-root) {
57
+ margin: 0 !important;
58
+ }
59
+
60
+ .input {
61
+ /* Structural Overrides */
62
+ display: flex;
63
+ align-items: center;
64
+ width: 100%;
65
+ box-sizing: border-box;
66
+ margin: 0;
67
+
68
+ /* Box Geometry */
69
+ min-height: var(
70
+ --recursica_ui-kit_components_autocomplete_properties_min-height
71
+ );
72
+ padding-top: var(
73
+ --recursica_ui-kit_components_autocomplete_properties_vertical-padding
74
+ );
75
+ padding-bottom: var(
76
+ --recursica_ui-kit_components_autocomplete_properties_vertical-padding
77
+ );
78
+ padding-left: var(
79
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
80
+ );
81
+ padding-right: var(
82
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
83
+ );
84
+ border-radius: var(
85
+ --recursica_ui-kit_components_autocomplete_properties_border-radius
86
+ );
87
+ border-width: 1px;
88
+ border-style: solid;
89
+
90
+ /* Strict Typography Unification */
91
+ font-family: var(
92
+ --recursica_ui-kit_components_autocomplete_properties_text_font-family
93
+ );
94
+ font-size: var(
95
+ --recursica_ui-kit_components_autocomplete_properties_text_font-size
96
+ );
97
+ font-style: var(
98
+ --recursica_ui-kit_components_autocomplete_properties_text_font-style
99
+ );
100
+ font-weight: var(
101
+ --recursica_ui-kit_components_autocomplete_properties_text_font-weight
102
+ );
103
+ letter-spacing: var(
104
+ --recursica_ui-kit_components_autocomplete_properties_text_letter-spacing
105
+ );
106
+ line-height: var(
107
+ --recursica_ui-kit_components_autocomplete_properties_text_line-height
108
+ );
109
+ text-decoration: var(
110
+ --recursica_ui-kit_components_autocomplete_properties_text_text-decoration
111
+ );
112
+ text-transform: var(
113
+ --recursica_ui-kit_components_autocomplete_properties_text_text-transform
114
+ );
115
+
116
+ /* Base State Default Execution */
117
+ background-color: var(
118
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_background
119
+ );
120
+ border-color: var(
121
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_border-color
122
+ );
123
+ color: var(
124
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_text
125
+ );
126
+
127
+ outline: none;
128
+ }
129
+
130
+ /* Reset internal MUI <input> node padding to safely allow the wrapper to manage geometry */
131
+ .input :global(input.MuiInputBase-input) {
132
+ padding: 0;
133
+ height: 100%;
134
+ margin: 0;
135
+ box-sizing: border-box;
136
+ }
137
+
138
+ .input::placeholder {
139
+ opacity: var(
140
+ --recursica_ui-kit_components_autocomplete_properties_placeholder-opacity
141
+ );
142
+ color: inherit;
143
+ }
144
+
145
+ /* Dynamic Padding Overrides */
146
+ .root[data-with-left-section] .input {
147
+ padding-left: var(--input-left-section-size);
148
+ }
149
+
150
+ .root[data-with-right-section] .input {
151
+ padding-right: var(--input-right-section-size);
152
+ }
153
+
154
+ /* Flexible End-Caps (Icons, actions) */
155
+ .section {
156
+ display: flex;
157
+ align-items: center;
158
+ height: 100%;
159
+ }
160
+
161
+ .section[data-position="left"] {
162
+ justify-content: flex-start;
163
+ padding-left: var(
164
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
165
+ );
166
+ }
167
+
168
+ .section[data-position="right"] {
169
+ justify-content: flex-end;
170
+ padding-right: var(
171
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
172
+ );
173
+ }
174
+
175
+ .section :global(svg) {
176
+ width: var(--recursica_ui-kit_components_autocomplete_properties_icon-size);
177
+ height: var(--recursica_ui-kit_components_autocomplete_properties_icon-size);
178
+ color: var(
179
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_leading-icon
180
+ );
181
+ }
182
+
183
+ .section[data-position="right"] :global(svg) {
184
+ color: var(
185
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_trailing-icon
186
+ );
187
+ }
188
+
189
+ /* Dropdown and Options */
190
+ /* We want to make sure the dropdown inherits font correctly. */
191
+ .dropdown {
192
+ background-color: var(
193
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_background
194
+ );
195
+ border: 1px solid
196
+ var(
197
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_border-color
198
+ );
199
+ border-radius: var(
200
+ --recursica_ui-kit_components_autocomplete_properties_border-radius
201
+ );
202
+ box-shadow: var(--recursica_ui-kit_components_menu_properties_elevation);
203
+ }
204
+
205
+ .option {
206
+ font-family: var(
207
+ --recursica_ui-kit_components_autocomplete_properties_text_font-family
208
+ );
209
+ font-size: var(
210
+ --recursica_ui-kit_components_autocomplete_properties_text_font-size
211
+ );
212
+ font-weight: var(
213
+ --recursica_ui-kit_components_autocomplete_properties_text_font-weight
214
+ );
215
+ color: var(
216
+ --recursica_ui-kit_components_autocomplete_variants_states_default_properties_colors_text
217
+ );
218
+ padding: calc(
219
+ var(
220
+ --recursica_ui-kit_components_autocomplete_properties_vertical-padding
221
+ ) *
222
+ 0.5
223
+ )
224
+ var(
225
+ --recursica_ui-kit_components_autocomplete_properties_horizontal-padding
226
+ );
227
+ cursor: pointer;
228
+ }
229
+
230
+ .option[data-selected="true"],
231
+ .option[data-selected],
232
+ .option[data-combobox-selected="true"],
233
+ .option[data-combobox-selected],
234
+ .option[data-combobox-active="true"],
235
+ .option[data-combobox-active],
236
+ .option[data-hovered="true"],
237
+ .option[data-hovered],
238
+ .option:hover {
239
+ background-color: var(
240
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_background
241
+ );
242
+ color: var(
243
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_text
244
+ );
245
+ }
246
+
247
+ /* -------------------------------------
248
+ STATE CASCADE ARCHITECTURE
249
+ -------------------------------------- */
250
+
251
+ /* Focus State Mapping (Triggered internally via browser pseudo-pseudo-class) */
252
+ .input:focus-within,
253
+ .input:focus {
254
+ border-color: var(
255
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_border-color
256
+ );
257
+ background-color: var(
258
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_background
259
+ );
260
+ color: var(
261
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_text
262
+ );
263
+ }
264
+
265
+ .root:focus-within .section[data-position="left"] :global(svg) {
266
+ color: var(
267
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_leading-icon
268
+ );
269
+ }
270
+
271
+ .root:focus-within .section[data-position="right"] :global(svg) {
272
+ color: var(
273
+ --recursica_ui-kit_components_autocomplete_variants_states_focus_properties_colors_trailing-icon
274
+ );
275
+ }
276
+
277
+ /* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
278
+ .root[data-error] .input {
279
+ border-color: var(
280
+ --recursica_ui-kit_components_autocomplete_variants_states_error_properties_colors_border-color
281
+ );
282
+ background-color: var(
283
+ --recursica_ui-kit_components_autocomplete_variants_states_error_properties_colors_background
284
+ );
285
+ color: var(
286
+ --recursica_ui-kit_components_autocomplete_variants_states_error_properties_colors_text
287
+ );
288
+ }
289
+
290
+ .root[data-error] .section[data-position="left"] :global(svg) {
291
+ color: var(
292
+ --recursica_ui-kit_components_autocomplete_variants_states_error_properties_colors_leading-icon
293
+ );
294
+ }
295
+
296
+ .root[data-error] .section[data-position="right"] :global(svg) {
297
+ color: var(
298
+ --recursica_ui-kit_components_autocomplete_variants_states_error_properties_colors_trailing-icon
299
+ );
300
+ }
301
+
302
+ /* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
303
+ .root[data-disabled] .input {
304
+ border-color: var(
305
+ --recursica_ui-kit_components_autocomplete_variants_states_disabled_properties_colors_border-color
306
+ );
307
+ background-color: var(
308
+ --recursica_ui-kit_components_autocomplete_variants_states_disabled_properties_colors_background
309
+ );
310
+ color: var(
311
+ --recursica_ui-kit_components_autocomplete_variants_states_disabled_properties_colors_text
312
+ );
313
+ }
314
+
315
+ .root[data-disabled] .section[data-position="left"] :global(svg) {
316
+ color: var(
317
+ --recursica_ui-kit_components_autocomplete_variants_states_disabled_properties_colors_leading-icon
318
+ );
319
+ }
320
+
321
+ .root[data-disabled] .section[data-position="right"] :global(svg) {
322
+ color: var(
323
+ --recursica_ui-kit_components_autocomplete_variants_states_disabled_properties_colors_trailing-icon
324
+ );
325
+ }
@@ -0,0 +1,196 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Autocomplete } from "./Autocomplete";
3
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
4
+
5
+ const meta: Meta<typeof Autocomplete> = {
6
+ title: "UI-Kit/Autocomplete",
7
+ component: Autocomplete,
8
+ tags: ["autodocs"],
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: `
13
+ The \`Autocomplete\` primitive provides a text input with a dropdown menu for displaying suggestions as the user types.
14
+
15
+ ### Architectural Decoupling
16
+ Recursica wraps the internal Mantine \`<Autocomplete>\` component inside the \`WithReadOnlyWrapper\`, ensuring it integrates perfectly with the strict design system form architecture.
17
+
18
+ ### Examples
19
+ Always structure horizontal architectures via the generic \`formLayout\` parameter.
20
+ \`\`\`tsx
21
+ <Autocomplete
22
+ label="Country"
23
+ assistiveText="Select your country of residence."
24
+ data={["United States", "Canada", "Mexico", "United Kingdom", "France"]}
25
+ formLayout="stacked"
26
+ />
27
+ \`\`\`
28
+ `,
29
+ },
30
+ },
31
+ },
32
+ argTypes: {
33
+ ...formControlArgTypes,
34
+ disabled: {
35
+ control: "boolean",
36
+ description:
37
+ "Maps the formal disabled variable states structurally to the input core.",
38
+ },
39
+ error: {
40
+ control: "text",
41
+ description:
42
+ "Applies the strict error string boundary rendering invalid structures seamlessly.",
43
+ },
44
+ required: {
45
+ control: "boolean",
46
+ },
47
+ label: {
48
+ control: "text",
49
+ },
50
+ assistiveText: {
51
+ control: "text",
52
+ },
53
+ readOnly: {
54
+ control: "boolean",
55
+ description:
56
+ "Toggles structural read-only data presentation explicitly blocking standard component bindings.",
57
+ },
58
+ },
59
+ };
60
+
61
+ export default meta;
62
+
63
+ type Story = StoryObj<typeof Autocomplete>;
64
+
65
+ export const Default: Story = {
66
+ args: {
67
+ disabled: false,
68
+ readOnly: false,
69
+ label: "Country Selection",
70
+ placeholder: "Start typing...",
71
+ data: [
72
+ "United States",
73
+ "Canada",
74
+ "Mexico",
75
+ "United Kingdom",
76
+ "France",
77
+ "Germany",
78
+ "Japan",
79
+ "Brazil",
80
+ "India",
81
+ "Australia",
82
+ ],
83
+ assistiveText: "Search from a predefined list of countries.",
84
+ },
85
+ };
86
+
87
+ export const FormsSideBySide: Story = {
88
+ args: {
89
+ label: "Primary Region",
90
+ placeholder: "Select region...",
91
+ data: ["US-East", "US-West", "EU-Central", "AP-South", "SA-East"],
92
+ assistiveText:
93
+ "Select the primary region for the deployment. This violently long string tests native textual wrapping safely mapping alongside inputs.",
94
+ formLayout: "side-by-side",
95
+ },
96
+ };
97
+
98
+ export const WithLeadingIcon: Story = {
99
+ args: {
100
+ label: "Search Projects",
101
+ placeholder: "Project name...",
102
+ data: ["Alpha", "Beta", "Gamma", "Delta", "Epsilon"],
103
+ leftSection: (
104
+ <svg
105
+ width="24"
106
+ height="24"
107
+ viewBox="0 0 24 24"
108
+ fill="none"
109
+ stroke="currentColor"
110
+ strokeWidth="2"
111
+ strokeLinecap="round"
112
+ strokeLinejoin="round"
113
+ >
114
+ <circle cx="11" cy="11" r="8"></circle>
115
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
116
+ </svg>
117
+ ),
118
+ },
119
+ };
120
+
121
+ export const WithTrailingIcon: Story = {
122
+ args: {
123
+ label: "Validation URL",
124
+ placeholder: "https://recursica.dev",
125
+ data: [
126
+ "https://recursica.dev",
127
+ "https://beta.recursica.dev",
128
+ "https://api.recursica.dev",
129
+ ],
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
+ };
146
+
147
+ export const Disabled: Story = {
148
+ args: {
149
+ label: "Disabled Deployment Node",
150
+ placeholder: "Disabled primitive map...",
151
+ data: ["Node 1", "Node 2", "Node 3"],
152
+ disabled: true,
153
+ },
154
+ };
155
+
156
+ export const ErrorState: Story = {
157
+ args: {
158
+ label: "Cluster Failure",
159
+ placeholder: "Failing component instance...",
160
+ data: ["Cluster A", "Cluster B", "Cluster C"],
161
+ defaultValue: "Invalid Cluster",
162
+ error:
163
+ "Critical runtime node disconnect detected traversing DOM architecture.",
164
+ required: true,
165
+ },
166
+ };
167
+
168
+ export const StaticReadOnly: Story = {
169
+ args: {
170
+ label: "Static ReadOnly Review",
171
+ placeholder: "Ignored...",
172
+ data: ["Option 1", "Option 2"],
173
+ value: "Explicitly Uneditable Bound Output",
174
+ readOnly: true,
175
+ },
176
+ };
177
+
178
+ export const EditableReadOnly: Story = {
179
+ args: {
180
+ label: "Editable ReadOnly Review",
181
+ placeholder: "Ignored until active...",
182
+ data: ["Option 1", "Option 2"],
183
+ defaultValue: "Waiting for Edit Execution",
184
+ readOnly: true,
185
+ labelWithEditIcon: true,
186
+ },
187
+ };
188
+
189
+ export const Docs: Story = {
190
+ args: {
191
+ label: "Documentation Mode",
192
+ placeholder: "Docs layout validation...",
193
+ data: ["Doc A", "Doc B"],
194
+ assistiveText: "Explicitly requested docs story.",
195
+ },
196
+ };