@recursica/mantine-adapter 0.9.3 → 0.10.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 (241) hide show
  1. package/.storybook/commonArgTypes.ts +148 -0
  2. package/CHANGELOG.md +88 -0
  3. package/README.md +48 -332
  4. package/dist/index.d.ts +2 -0
  5. package/dist/mantine-adapter.cjs +2 -0
  6. package/dist/mantine-adapter.cjs.map +1 -0
  7. package/dist/mantine-adapter.css +1 -0
  8. package/dist/mantine-adapter.js +1797 -0
  9. package/dist/mantine-adapter.js.map +1 -0
  10. package/dist/src/components/Accordion/Accordion.d.ts +42 -0
  11. package/dist/src/components/Accordion/index.d.ts +1 -0
  12. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +10 -0
  13. package/dist/src/components/Avatar/Avatar.d.ts +9 -0
  14. package/dist/src/components/Avatar/index.d.ts +1 -0
  15. package/dist/src/components/Badge/Badge.d.ts +8 -0
  16. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +6 -0
  17. package/dist/src/components/Button/Button.d.ts +10 -0
  18. package/dist/src/components/Button/index.d.ts +1 -0
  19. package/dist/src/components/Card/Card.d.ts +38 -0
  20. package/dist/src/components/Checkbox/Checkbox.d.ts +11 -0
  21. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +9 -0
  22. package/dist/src/components/Chip/Chip.d.ts +15 -0
  23. package/dist/src/components/Container/Container.d.ts +18 -0
  24. package/dist/src/components/DatePicker/DatePicker.d.ts +3 -0
  25. package/dist/src/components/Dropdown/Dropdown.d.ts +11 -0
  26. package/dist/src/components/FileInput/FileInput.d.ts +3 -0
  27. package/dist/src/components/FileUpload/FileUpload.d.ts +3 -0
  28. package/dist/src/components/Flex/Flex.d.ts +17 -0
  29. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +18 -0
  30. package/dist/src/components/Group/Group.d.ts +17 -0
  31. package/dist/src/components/HoverCard/HoverCard.d.ts +3 -0
  32. package/dist/src/components/Label/Label.d.ts +21 -0
  33. package/dist/src/components/Label/index.d.ts +1 -0
  34. package/dist/src/components/Link/Link.d.ts +3 -0
  35. package/dist/src/components/Loader/Loader.d.ts +10 -0
  36. package/dist/src/components/Menu/Menu.d.ts +3 -0
  37. package/dist/src/components/Modal/Modal.d.ts +3 -0
  38. package/dist/src/components/NumberInput/NumberInput.d.ts +3 -0
  39. package/dist/src/components/Pagination/Pagination.d.ts +3 -0
  40. package/dist/src/components/Panel/Panel.d.ts +3 -0
  41. package/dist/src/components/Popover/Popover.d.ts +3 -0
  42. package/dist/src/components/Radio/Radio.d.ts +11 -0
  43. package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
  44. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +20 -0
  45. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  46. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +22 -0
  47. package/dist/src/components/ReadOnlyField/index.d.ts +3 -0
  48. package/dist/src/components/Search/Search.d.ts +3 -0
  49. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  50. package/dist/src/components/Slider/Slider.d.ts +3 -0
  51. package/dist/src/components/Stack/Stack.d.ts +15 -0
  52. package/dist/src/components/Stepper/Stepper.d.ts +3 -0
  53. package/dist/src/components/Switch/Switch.d.ts +11 -0
  54. package/dist/src/components/Switch/SwitchGroup.d.ts +9 -0
  55. package/dist/src/components/Table/Table.d.ts +3 -0
  56. package/dist/src/components/Tabs/Tabs.d.ts +3 -0
  57. package/dist/src/components/Text/Text.d.ts +17 -0
  58. package/dist/src/components/TextArea/TextArea.d.ts +15 -0
  59. package/dist/src/components/TextField/TextField.d.ts +9 -0
  60. package/dist/src/components/TimePicker/TimePicker.d.ts +3 -0
  61. package/dist/src/components/Timeline/Timeline.d.ts +3 -0
  62. package/dist/src/components/Title/Title.d.ts +13 -0
  63. package/dist/src/components/Toast/Toast.d.ts +3 -0
  64. package/dist/src/components/Tooltip/Tooltip.d.ts +3 -0
  65. package/dist/src/components/TransferList/TransferList.d.ts +3 -0
  66. package/dist/src/components/index.d.ts +47 -0
  67. package/dist/src/index.d.ts +2 -0
  68. package/dist/src/types/index.d.ts +6 -0
  69. package/dist/src/utils/ColorSchemeWrapper.d.ts +3 -0
  70. package/dist/src/utils/copyToClipboard.d.ts +8 -0
  71. package/dist/src/utils/filterStylingProps.d.ts +36 -0
  72. package/dist/src/utils/index.d.ts +1 -0
  73. package/dist/vite.config.d.ts +2 -0
  74. package/dist/vite.svg +1 -0
  75. package/dist/vitest.workspace.d.ts +2 -0
  76. package/package.json +74 -35
  77. package/src/OverStyling.stories.tsx +174 -0
  78. package/src/Version.stories.tsx +56 -0
  79. package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +48 -0
  80. package/src/components/Accordion/Accordion.module.css +282 -0
  81. package/src/components/Accordion/Accordion.stories.tsx +145 -0
  82. package/src/components/Accordion/Accordion.tsx +200 -0
  83. package/src/components/Accordion/index.ts +1 -0
  84. package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
  85. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +73 -0
  86. package/src/components/AssistiveElement/AssistiveElement.tsx +91 -0
  87. package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +24 -0
  88. package/src/components/Avatar/Avatar.module.css +340 -0
  89. package/src/components/Avatar/Avatar.stories.tsx +102 -0
  90. package/src/components/Avatar/Avatar.tsx +100 -0
  91. package/src/components/Avatar/index.ts +1 -0
  92. package/src/components/Badge/BADGE_IMPLEMENTATION_NOTES.md +18 -0
  93. package/src/components/Badge/Badge.module.css +124 -0
  94. package/src/components/Badge/Badge.stories.tsx +77 -0
  95. package/src/components/Badge/Badge.tsx +66 -0
  96. package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +14 -0
  97. package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
  98. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +77 -0
  99. package/src/components/Breadcrumb/Breadcrumb.tsx +64 -0
  100. package/src/components/Button/Button.module.css +275 -0
  101. package/src/components/Button/Button.stories.tsx +105 -0
  102. package/src/components/Button/Button.tsx +122 -0
  103. package/src/components/Button/IMPLEMENTATION_NOTES.md +45 -0
  104. package/src/components/Button/index.ts +1 -0
  105. package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +10 -0
  106. package/src/components/Card/Card.module.css +60 -0
  107. package/src/components/Card/Card.stories.tsx +141 -0
  108. package/src/components/Card/Card.tsx +176 -0
  109. package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
  110. package/src/components/Checkbox/Checkbox.module.css +204 -0
  111. package/src/components/Checkbox/Checkbox.stories.tsx +73 -0
  112. package/src/components/Checkbox/Checkbox.tsx +102 -0
  113. package/src/components/Checkbox/CheckboxGroup.stories.tsx +138 -0
  114. package/src/components/Checkbox/CheckboxGroup.tsx +140 -0
  115. package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +35 -0
  116. package/src/components/Chip/Chip.module.css +218 -0
  117. package/src/components/Chip/Chip.stories.tsx +115 -0
  118. package/src/components/Chip/Chip.tsx +143 -0
  119. package/src/components/Container/CONTAINER_IMPLEMENTATION_NOTES.md +4 -0
  120. package/src/components/Container/Container.module.css +7 -0
  121. package/src/components/Container/Container.stories.tsx +115 -0
  122. package/src/components/Container/Container.tsx +89 -0
  123. package/src/components/DatePicker/DatePicker.stories.tsx +22 -0
  124. package/src/components/DatePicker/DatePicker.tsx +7 -0
  125. package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +7 -0
  126. package/src/components/Dropdown/Dropdown.module.css +272 -0
  127. package/src/components/Dropdown/Dropdown.stories.tsx +94 -0
  128. package/src/components/Dropdown/Dropdown.tsx +173 -0
  129. package/src/components/FileInput/FileInput.stories.tsx +22 -0
  130. package/src/components/FileInput/FileInput.tsx +7 -0
  131. package/src/components/FileUpload/FileUpload.stories.tsx +22 -0
  132. package/src/components/FileUpload/FileUpload.tsx +7 -0
  133. package/src/components/Flex/FLEX_IMPLEMENTATION_NOTES.md +4 -0
  134. package/src/components/Flex/Flex.module.css +7 -0
  135. package/src/components/Flex/Flex.stories.tsx +125 -0
  136. package/src/components/Flex/Flex.tsx +68 -0
  137. package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
  138. package/src/components/FormControlWrapper/FormControlWrapper.module.css +46 -0
  139. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +116 -0
  140. package/src/components/FormControlWrapper/FormControlWrapper.tsx +170 -0
  141. package/src/components/Group/GROUP_IMPLEMENTATION_NOTES.md +4 -0
  142. package/src/components/Group/Group.module.css +7 -0
  143. package/src/components/Group/Group.stories.tsx +117 -0
  144. package/src/components/Group/Group.tsx +68 -0
  145. package/src/components/HoverCard/HoverCard.stories.tsx +17 -0
  146. package/src/components/HoverCard/HoverCard.tsx +7 -0
  147. package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
  148. package/src/components/Label/Label.module.css +177 -0
  149. package/src/components/Label/Label.stories.tsx +123 -0
  150. package/src/components/Label/Label.tsx +132 -0
  151. package/src/components/Label/index.ts +1 -0
  152. package/src/components/Link/Link.stories.tsx +17 -0
  153. package/src/components/Link/Link.tsx +7 -0
  154. package/src/components/Loader/Loader.module.css +60 -0
  155. package/src/components/Loader/Loader.stories.tsx +98 -0
  156. package/src/components/Loader/Loader.tsx +76 -0
  157. package/src/components/Menu/Menu.stories.tsx +17 -0
  158. package/src/components/Menu/Menu.tsx +7 -0
  159. package/src/components/Modal/Modal.stories.tsx +17 -0
  160. package/src/components/Modal/Modal.tsx +7 -0
  161. package/src/components/NumberInput/NumberInput.stories.tsx +22 -0
  162. package/src/components/NumberInput/NumberInput.tsx +7 -0
  163. package/src/components/Pagination/Pagination.stories.tsx +17 -0
  164. package/src/components/Pagination/Pagination.tsx +7 -0
  165. package/src/components/Panel/Panel.stories.tsx +17 -0
  166. package/src/components/Panel/Panel.tsx +7 -0
  167. package/src/components/Popover/Popover.stories.tsx +17 -0
  168. package/src/components/Popover/Popover.tsx +7 -0
  169. package/src/components/Radio/Radio.module.css +207 -0
  170. package/src/components/Radio/Radio.stories.tsx +76 -0
  171. package/src/components/Radio/Radio.tsx +115 -0
  172. package/src/components/Radio/RadioGroup.stories.tsx +98 -0
  173. package/src/components/Radio/RadioGroup.tsx +138 -0
  174. package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -0
  175. package/src/components/ReadOnlyField/ReadOnlyField.module.css +49 -0
  176. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +120 -0
  177. package/src/components/ReadOnlyField/ReadOnlyField.tsx +75 -0
  178. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +46 -0
  179. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +85 -0
  180. package/src/components/ReadOnlyField/index.ts +3 -0
  181. package/src/components/Search/Search.stories.tsx +17 -0
  182. package/src/components/Search/Search.tsx +7 -0
  183. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +22 -0
  184. package/src/components/SegmentedControl/SegmentedControl.tsx +7 -0
  185. package/src/components/Slider/Slider.stories.tsx +22 -0
  186. package/src/components/Slider/Slider.tsx +7 -0
  187. package/src/components/Stack/STACK_IMPLEMENTATION_NOTES.md +4 -0
  188. package/src/components/Stack/Stack.module.css +7 -0
  189. package/src/components/Stack/Stack.stories.tsx +105 -0
  190. package/src/components/Stack/Stack.tsx +66 -0
  191. package/src/components/Stepper/Stepper.stories.tsx +17 -0
  192. package/src/components/Stepper/Stepper.tsx +7 -0
  193. package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +28 -0
  194. package/src/components/Switch/Switch.module.css +207 -0
  195. package/src/components/Switch/Switch.stories.tsx +96 -0
  196. package/src/components/Switch/Switch.tsx +119 -0
  197. package/src/components/Switch/SwitchGroup.stories.tsx +112 -0
  198. package/src/components/Switch/SwitchGroup.tsx +138 -0
  199. package/src/components/Table/Table.stories.tsx +17 -0
  200. package/src/components/Table/Table.tsx +7 -0
  201. package/src/components/Tabs/Tabs.stories.tsx +17 -0
  202. package/src/components/Tabs/Tabs.tsx +7 -0
  203. package/src/components/Text/Text.stories.tsx +88 -0
  204. package/src/components/Text/Text.tsx +54 -0
  205. package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
  206. package/src/components/TextArea/TextArea.module.css +225 -0
  207. package/src/components/TextArea/TextArea.stories.tsx +94 -0
  208. package/src/components/TextArea/TextArea.tsx +151 -0
  209. package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
  210. package/src/components/TextField/TextField.module.css +225 -0
  211. package/src/components/TextField/TextField.stories.tsx +162 -0
  212. package/src/components/TextField/TextField.tsx +138 -0
  213. package/src/components/TimePicker/TimePicker.stories.tsx +22 -0
  214. package/src/components/TimePicker/TimePicker.tsx +7 -0
  215. package/src/components/Timeline/Timeline.stories.tsx +17 -0
  216. package/src/components/Timeline/Timeline.tsx +7 -0
  217. package/src/components/Title/Title.stories.tsx +63 -0
  218. package/src/components/Title/Title.tsx +45 -0
  219. package/src/components/Toast/Toast.stories.tsx +17 -0
  220. package/src/components/Toast/Toast.tsx +7 -0
  221. package/src/components/Tooltip/Tooltip.stories.tsx +17 -0
  222. package/src/components/Tooltip/Tooltip.tsx +7 -0
  223. package/src/components/TransferList/TransferList.stories.tsx +17 -0
  224. package/src/components/TransferList/TransferList.tsx +7 -0
  225. package/src/components/index.ts +47 -0
  226. package/src/env.d.ts +7 -0
  227. package/src/index.ts +3 -0
  228. package/src/types/index.ts +9 -0
  229. package/src/types/mantine.d.ts +7 -0
  230. package/src/types/scss-modules.d.ts +9 -0
  231. package/src/utils/ColorSchemeWrapper.tsx +27 -0
  232. package/src/utils/copyToClipboard.ts +36 -0
  233. package/src/utils/filterStylingProps.ts +141 -0
  234. package/src/utils/index.ts +1 -0
  235. package/dist/index.js +0 -917
  236. package/dist/index.js.map +0 -1
  237. package/dist/main.cjs +0 -924
  238. package/dist/main.cjs.map +0 -1
  239. package/dist/main.js +0 -922
  240. package/dist/main.js.map +0 -1
  241. package/dist/webworker.js +0 -787
@@ -0,0 +1,225 @@
1
+ /* HARDCODED VALUES:
2
+ - border-width: 1px. Native geometric boundary for the input box.
3
+ - border-style: solid. Native structural rendering rule.
4
+ - outline: none. Bypassing browser focus rings to rely strictly on Recursica focus states natively.
5
+ - flex/layout: display: flex on the root wrapper safely encapsulating internal section rendering.
6
+ */
7
+
8
+ .root {
9
+ display: flex;
10
+ position: relative;
11
+ width: 100%;
12
+ min-height: var(
13
+ --recursica_ui-kit_components_text-field_properties_min-height
14
+ );
15
+
16
+ /* Override Mantine native Input variables governing section spacing padding mathematics safely */
17
+ --input-left-section-size: calc(
18
+ var(--recursica_ui-kit_components_text-field_properties_icon-size) +
19
+ (
20
+ var(
21
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
22
+ ) *
23
+ 2
24
+ )
25
+ );
26
+ --input-right-section-size: calc(
27
+ var(--recursica_ui-kit_components_text-field_properties_icon-size) +
28
+ (
29
+ var(
30
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
31
+ ) *
32
+ 2
33
+ )
34
+ );
35
+ }
36
+
37
+ .input {
38
+ /* Structural Overrides */
39
+ width: 100%;
40
+ box-sizing: border-box;
41
+ margin: 0;
42
+
43
+ /* Box Geometry */
44
+ min-height: var(
45
+ --recursica_ui-kit_components_text-field_properties_min-height
46
+ );
47
+ padding-top: var(
48
+ --recursica_ui-kit_components_text-field_properties_vertical-padding
49
+ );
50
+ padding-bottom: var(
51
+ --recursica_ui-kit_components_text-field_properties_vertical-padding
52
+ );
53
+ padding-left: var(
54
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
55
+ );
56
+ padding-right: var(
57
+ --recursica_ui-kit_components_text-field_properties_horizontal-padding
58
+ );
59
+ border-radius: var(
60
+ --recursica_ui-kit_components_text-field_properties_border-radius
61
+ );
62
+ border-width: 1px;
63
+ border-style: solid;
64
+
65
+ /* Strict Typography Unification */
66
+ font-family: var(
67
+ --recursica_ui-kit_components_text-field_properties_text_font-family
68
+ );
69
+ font-size: var(
70
+ --recursica_ui-kit_components_text-field_properties_text_font-size
71
+ );
72
+ font-style: var(
73
+ --recursica_ui-kit_components_text-field_properties_text_font-style
74
+ );
75
+ font-weight: var(
76
+ --recursica_ui-kit_components_text-field_properties_text_font-weight
77
+ );
78
+ letter-spacing: var(
79
+ --recursica_ui-kit_components_text-field_properties_text_letter-spacing
80
+ );
81
+ line-height: var(
82
+ --recursica_ui-kit_components_text-field_properties_text_line-height
83
+ );
84
+ text-decoration: var(
85
+ --recursica_ui-kit_components_text-field_properties_text_text-decoration
86
+ );
87
+ text-transform: var(
88
+ --recursica_ui-kit_components_text-field_properties_text_text-transform
89
+ );
90
+
91
+ /* Base State Default Execution */
92
+ background-color: var(
93
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_background
94
+ );
95
+ border-color: var(
96
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_border-color
97
+ );
98
+ color: var(
99
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_text
100
+ );
101
+
102
+ outline: none;
103
+ transition:
104
+ border-color 0.15s ease,
105
+ background-color 0.15s ease;
106
+ }
107
+
108
+ .input::placeholder {
109
+ opacity: var(
110
+ --recursica_ui-kit_components_text-field_properties_placeholder-opacity
111
+ );
112
+ color: inherit;
113
+ }
114
+
115
+ /* Dynamic Padding Overrides */
116
+ .root[data-with-left-section] .input {
117
+ padding-left: var(--input-left-section-size);
118
+ }
119
+
120
+ .root[data-with-right-section] .input {
121
+ padding-right: var(--input-right-section-size);
122
+ }
123
+
124
+ /* Flexible End-Caps (Icons, actions) */
125
+ .section {
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: center;
129
+ height: 100%;
130
+ }
131
+
132
+ .section :global(svg) {
133
+ width: var(--recursica_ui-kit_components_text-field_properties_icon-size);
134
+ height: var(--recursica_ui-kit_components_text-field_properties_icon-size);
135
+ color: var(
136
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_leading-icon
137
+ );
138
+ }
139
+
140
+ .section[data-position="right"] :global(svg) {
141
+ color: var(
142
+ --recursica_ui-kit_components_text-field_variants_states_default_properties_colors_trailing-icon
143
+ );
144
+ }
145
+
146
+ /* -------------------------------------
147
+ STATE CASCADE ARCHITECTURE
148
+ -------------------------------------- */
149
+
150
+ /* Focus State Mapping (Triggered internally via browser pseudo-pseudo-class) */
151
+ .input:focus-within,
152
+ .input:focus {
153
+ border-color: var(
154
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_border-color
155
+ );
156
+ background-color: var(
157
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_background
158
+ );
159
+ color: var(
160
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_text
161
+ );
162
+ }
163
+
164
+ .root:focus-within .section[data-position="left"] :global(svg) {
165
+ color: var(
166
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_leading-icon
167
+ );
168
+ }
169
+
170
+ .root:focus-within .section[data-position="right"] :global(svg) {
171
+ color: var(
172
+ --recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_trailing-icon
173
+ );
174
+ }
175
+
176
+ /* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
177
+ .root[data-error] .input {
178
+ border-color: var(
179
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_border-color
180
+ ) !important;
181
+ background-color: var(
182
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_background
183
+ ) !important;
184
+ color: var(
185
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_text
186
+ ) !important;
187
+ }
188
+
189
+ .root[data-error] .section[data-position="left"] :global(svg) {
190
+ color: var(
191
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_leading-icon
192
+ ) !important;
193
+ }
194
+
195
+ .root[data-error] .section[data-position="right"] :global(svg) {
196
+ color: var(
197
+ --recursica_ui-kit_components_text-field_variants_states_error_properties_colors_trailing-icon
198
+ ) !important;
199
+ }
200
+
201
+ /* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
202
+ .root[data-disabled] .input {
203
+ border-color: var(
204
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_border-color
205
+ ) !important;
206
+ background-color: var(
207
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_background
208
+ ) !important;
209
+ color: var(
210
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_text
211
+ ) !important;
212
+ cursor: not-allowed;
213
+ }
214
+
215
+ .root[data-disabled] .section[data-position="left"] :global(svg) {
216
+ color: var(
217
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_leading-icon
218
+ ) !important;
219
+ }
220
+
221
+ .root[data-disabled] .section[data-position="right"] :global(svg) {
222
+ color: var(
223
+ --recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_trailing-icon
224
+ ) !important;
225
+ }
@@ -0,0 +1,94 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { TextArea } from "./TextArea";
4
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
5
+
6
+ type TextAreaStoryProps = React.ComponentProps<typeof TextArea>;
7
+
8
+ const meta: Meta<TextAreaStoryProps> = {
9
+ title: "UI-Kit/TextArea",
10
+ component: TextArea,
11
+ tags: ["autodocs"],
12
+ parameters: {
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
+ ...formControlArgTypes,
30
+ disabled: {
31
+ control: "boolean",
32
+ },
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",
50
+ },
51
+ },
52
+ };
53
+
54
+ export default meta;
55
+
56
+ type Story = StoryObj<TextAreaStoryProps>;
57
+
58
+ export const Default: Story = {
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
+ },
94
+ };
@@ -0,0 +1,151 @@
1
+ import React, { forwardRef } from "react";
2
+ import {
3
+ Textarea as MantineTextarea,
4
+ type TextareaProps as MantineTextareaProps,
5
+ } from "@mantine/core";
6
+ import { type ReadOnlyControlProps } from "@recursica/adapter-common";
7
+ import {
8
+ filterStylingProps,
9
+ type RecursicaOverStyled,
10
+ } from "../../utils/filterStylingProps";
11
+ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
12
+ import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
13
+ import styles from "./TextArea.module.css";
14
+
15
+ export interface RecursicaTextAreaProps
16
+ extends Omit<
17
+ MantineTextareaProps,
18
+ "size" | "variant" | "radius" | "wrapperProps"
19
+ >,
20
+ Pick<
21
+ RecursicaFormControlWrapperProps,
22
+ | "assistiveText"
23
+ | "assistiveWithIcon"
24
+ | "formLayout"
25
+ | "labelSize"
26
+ | "labelAlignment"
27
+ | "labelOptionalText"
28
+ | "labelWithEditIcon"
29
+ | "onLabelEditClick"
30
+ >,
31
+ ReadOnlyControlProps {
32
+ /** Maximum rows for autosize textarea to grow */
33
+ maxRows?: number;
34
+ /** Minimum rows of autosize textarea */
35
+ minRows?: number;
36
+ /** If set, enables textarea height growing with its content */
37
+ autosize?: boolean;
38
+ }
39
+
40
+ export type TextAreaProps = RecursicaOverStyled<RecursicaTextAreaProps>;
41
+
42
+ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
43
+ function TextArea(
44
+ {
45
+ overStyled = false,
46
+ formLayout = "stacked",
47
+
48
+ // Label & Wrapper Maps
49
+ labelSize,
50
+ labelAlignment,
51
+ labelOptionalText,
52
+ labelWithEditIcon,
53
+ onLabelEditClick,
54
+
55
+ label,
56
+ assistiveText,
57
+ assistiveWithIcon,
58
+ error,
59
+ required,
60
+ withAsterisk,
61
+ id,
62
+ className,
63
+ style,
64
+ disabled,
65
+ readOnly,
66
+ readOnlyComponent,
67
+ value,
68
+ defaultValue,
69
+ ...rest
70
+ },
71
+ ref,
72
+ ) {
73
+ const sanitizedProps = filterStylingProps(rest, overStyled);
74
+ const restRecord = sanitizedProps as Record<string, unknown>;
75
+
76
+ // Delete prohibited sizing hooks from bypassing variables natively
77
+ delete restRecord["size"];
78
+ delete restRecord["variant"];
79
+ delete restRecord["radius"];
80
+
81
+ // Securely map core native blocks down ensuring nested CSS modules map precisely
82
+ const mergedClassNames: Partial<Record<string, string>> = {
83
+ wrapper: styles.root, // The nested Input internal relative wrapper bounding box
84
+ input: styles.input,
85
+ };
86
+
87
+ const classNamesProp = restRecord.classNames;
88
+ if (
89
+ classNamesProp &&
90
+ typeof classNamesProp === "object" &&
91
+ !Array.isArray(classNamesProp)
92
+ ) {
93
+ const o = classNamesProp as Partial<Record<string, string>>;
94
+ mergedClassNames.wrapper = o.wrapper
95
+ ? `${styles.root} ${o.wrapper}`
96
+ : styles.root;
97
+ mergedClassNames.input = o.input
98
+ ? `${styles.input} ${o.input}`
99
+ : styles.input;
100
+ }
101
+
102
+ return (
103
+ <WithReadOnlyWrapper
104
+ className={className}
105
+ style={style as React.CSSProperties}
106
+ controlMaxWidth="var(--recursica_ui-kit_components_text-field_properties_max-width)"
107
+ controlMinWidth="var(--recursica_ui-kit_components_text-field_properties_min-width)"
108
+ overStyled={overStyled as true}
109
+ formLayout={formLayout}
110
+ labelSize={labelSize}
111
+ labelAlignment={labelAlignment}
112
+ labelOptionalText={labelOptionalText}
113
+ labelWithEditIcon={labelWithEditIcon}
114
+ onLabelEditClick={onLabelEditClick}
115
+ label={label}
116
+ assistiveText={assistiveText}
117
+ assistiveWithIcon={assistiveWithIcon}
118
+ error={error}
119
+ required={required}
120
+ withAsterisk={withAsterisk}
121
+ id={id}
122
+ readOnly={readOnly}
123
+ readOnlyComponent={readOnlyComponent}
124
+ readOnlyType="text"
125
+ readOnlyValue={value !== undefined ? value : defaultValue}
126
+ activeComponent={
127
+ /* Naked Input execution safely decoupled from Mantine's macro Input.Wrapper DOM hooks */
128
+ <MantineTextarea
129
+ ref={ref}
130
+ classNames={mergedClassNames}
131
+ disabled={disabled}
132
+ value={value}
133
+ defaultValue={defaultValue}
134
+ label={undefined}
135
+ description={undefined}
136
+ error={undefined}
137
+ required={undefined}
138
+ withAsterisk={undefined}
139
+ wrapperProps={{
140
+ "data-disabled": disabled ? "true" : undefined,
141
+ "data-error": error ? "true" : undefined,
142
+ }}
143
+ {...(sanitizedProps as unknown as MantineTextareaProps)}
144
+ />
145
+ }
146
+ />
147
+ );
148
+ },
149
+ );
150
+
151
+ TextArea.displayName = "TextArea";
@@ -0,0 +1,19 @@
1
+ # TextField Implementation Notes
2
+
3
+ ## Architectural philosophy
4
+
5
+ The `TextField` primitive intentionally ignores Mantine's built-in `<TextInput>` structure in favor of directly binding against `<Input>`.
6
+
7
+ ### 1. Bypassing `Input.Wrapper`
8
+
9
+ Because `<TextInput>` inherently renders Mantine's `Input.Wrapper` underneath the hood, utilizing it natively double-wraps our layouts causing massive DOM bloat and margin collapsing errors. By leveraging the completely naked `<Input>` primitive natively natively alongside `FormControlWrapper`, we retain full logical control of where the `label` maps, avoiding dual label conflicts or mis-aligned asterisks securely.
10
+
11
+ ### 2. State Hooks (`wrapperProps`)
12
+
13
+ Because we target `<Input>`, all dynamic UI modifiers (`disabled`, `error`, etc) must strictly be applied to the `.root` CSS module to correctly style the internal `<input>` boxes AND the nested `.[data-position]` icon sections simultaneously.
14
+
15
+ To accomplish this safely without spilling random pseudo-variables onto the input parameters, we exclusively use Mantine's `<Input wrapperProps={{...}}>` block natively locking `.root[data-error]` to correctly map Recursica UI variable hooks without breaking the DOM hierarchy natively.
16
+
17
+ ### 3. Component Definition Intersections
18
+
19
+ To strictly acquire native HTML typings, `TextField.tsx` explicitly extracts `React.ComponentPropsWithoutRef<"input">`. However, to prevent Typescript strict union collisions with overlapping Mantine definitions over functional `style` components and custom mappings natively, we meticulously omit (`Pick<InputWrapperProps, ...>`) explicit base elements to guarantee that strictly Recursica styles traverse the array flawlessly.