@recursica/mantine-adapter 0.9.4 → 0.11.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 (290) hide show
  1. package/.storybook/commonArgTypes.ts +148 -0
  2. package/CHANGELOG.md +94 -0
  3. package/README.md +48 -332
  4. package/dist/index.d.ts +2 -8
  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 +1963 -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 +13 -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/FormControlLayout/FormControlLayout.d.ts +21 -0
  30. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +20 -0
  31. package/dist/src/components/Group/Group.d.ts +17 -0
  32. package/dist/src/components/HoverCard/HoverCard.d.ts +3 -0
  33. package/dist/src/components/Label/Label.d.ts +19 -0
  34. package/dist/src/components/Label/index.d.ts +1 -0
  35. package/dist/src/components/Link/Link.d.ts +3 -0
  36. package/dist/src/components/Loader/Loader.d.ts +10 -0
  37. package/dist/src/components/Menu/Menu.d.ts +3 -0
  38. package/dist/src/components/Modal/Modal.d.ts +3 -0
  39. package/dist/src/components/NumberInput/NumberInput.d.ts +3 -0
  40. package/dist/src/components/Pagination/Pagination.d.ts +3 -0
  41. package/dist/src/components/Panel/Panel.d.ts +3 -0
  42. package/dist/src/components/Popover/Popover.d.ts +3 -0
  43. package/dist/src/components/Radio/Radio.d.ts +13 -0
  44. package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
  45. package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
  46. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +20 -0
  47. package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
  48. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  49. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
  50. package/dist/src/components/ReadOnlyField/index.d.ts +5 -0
  51. package/dist/src/components/Search/Search.d.ts +3 -0
  52. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  53. package/dist/src/components/Slider/Slider.d.ts +3 -0
  54. package/dist/src/components/Stack/Stack.d.ts +15 -0
  55. package/dist/src/components/Stepper/Stepper.d.ts +3 -0
  56. package/dist/src/components/Switch/Switch.d.ts +13 -0
  57. package/dist/src/components/Switch/SwitchGroup.d.ts +9 -0
  58. package/dist/src/components/Table/Table.d.ts +3 -0
  59. package/dist/src/components/Tabs/Tabs.d.ts +3 -0
  60. package/dist/src/components/Text/Text.d.ts +17 -0
  61. package/dist/src/components/TextArea/TextArea.d.ts +15 -0
  62. package/dist/src/components/TextField/TextField.d.ts +9 -0
  63. package/dist/src/components/TimePicker/TimePicker.d.ts +3 -0
  64. package/dist/src/components/Timeline/Timeline.d.ts +3 -0
  65. package/dist/src/components/Title/Title.d.ts +13 -0
  66. package/dist/src/components/Toast/Toast.d.ts +3 -0
  67. package/dist/src/components/Tooltip/Tooltip.d.ts +3 -0
  68. package/dist/src/components/TransferList/TransferList.d.ts +3 -0
  69. package/dist/src/components/index.d.ts +48 -0
  70. package/dist/src/index.d.ts +2 -0
  71. package/dist/src/types/index.d.ts +6 -0
  72. package/dist/src/utils/ColorSchemeWrapper.d.ts +3 -0
  73. package/dist/src/utils/RequireAccessibleLabel.d.ts +18 -0
  74. package/dist/src/utils/copyToClipboard.d.ts +8 -0
  75. package/dist/src/utils/filterStylingProps.d.ts +36 -0
  76. package/dist/src/utils/index.d.ts +1 -0
  77. package/dist/vite.config.d.ts +2 -0
  78. package/dist/vite.svg +1 -0
  79. package/dist/vitest.workspace.d.ts +2 -0
  80. package/package.json +74 -35
  81. package/src/OverStyling.stories.tsx +174 -0
  82. package/src/Version.stories.tsx +56 -0
  83. package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +48 -0
  84. package/src/components/Accordion/Accordion.module.css +282 -0
  85. package/src/components/Accordion/Accordion.stories.tsx +145 -0
  86. package/src/components/Accordion/Accordion.tsx +200 -0
  87. package/src/components/Accordion/index.ts +1 -0
  88. package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
  89. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +75 -0
  90. package/src/components/AssistiveElement/AssistiveElement.tsx +91 -0
  91. package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +24 -0
  92. package/src/components/Avatar/Avatar.module.css +340 -0
  93. package/src/components/Avatar/Avatar.stories.tsx +107 -0
  94. package/src/components/Avatar/Avatar.tsx +100 -0
  95. package/src/components/Avatar/index.ts +1 -0
  96. package/src/components/Badge/BADGE_IMPLEMENTATION_NOTES.md +18 -0
  97. package/src/components/Badge/Badge.module.css +124 -0
  98. package/src/components/Badge/Badge.stories.tsx +78 -0
  99. package/src/components/Badge/Badge.tsx +66 -0
  100. package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +14 -0
  101. package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
  102. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +77 -0
  103. package/src/components/Breadcrumb/Breadcrumb.tsx +64 -0
  104. package/src/components/Button/Button.module.css +275 -0
  105. package/src/components/Button/Button.stories.tsx +103 -0
  106. package/src/components/Button/Button.tsx +122 -0
  107. package/src/components/Button/IMPLEMENTATION_NOTES.md +45 -0
  108. package/src/components/Button/index.ts +1 -0
  109. package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +10 -0
  110. package/src/components/Card/Card.module.css +60 -0
  111. package/src/components/Card/Card.stories.tsx +141 -0
  112. package/src/components/Card/Card.tsx +176 -0
  113. package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
  114. package/src/components/Checkbox/Checkbox.module.css +204 -0
  115. package/src/components/Checkbox/Checkbox.stories.tsx +94 -0
  116. package/src/components/Checkbox/Checkbox.tsx +159 -0
  117. package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
  118. package/src/components/Checkbox/CheckboxGroup.tsx +120 -0
  119. package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +35 -0
  120. package/src/components/Chip/Chip.module.css +218 -0
  121. package/src/components/Chip/Chip.stories.tsx +115 -0
  122. package/src/components/Chip/Chip.tsx +143 -0
  123. package/src/components/Container/CONTAINER_IMPLEMENTATION_NOTES.md +4 -0
  124. package/src/components/Container/Container.module.css +7 -0
  125. package/src/components/Container/Container.stories.tsx +118 -0
  126. package/src/components/Container/Container.tsx +89 -0
  127. package/src/components/DatePicker/DatePicker.stories.tsx +18 -0
  128. package/src/components/DatePicker/DatePicker.tsx +7 -0
  129. package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +7 -0
  130. package/src/components/Dropdown/Dropdown.module.css +272 -0
  131. package/src/components/Dropdown/Dropdown.stories.tsx +91 -0
  132. package/src/components/Dropdown/Dropdown.tsx +174 -0
  133. package/src/components/FileInput/FileInput.stories.tsx +18 -0
  134. package/src/components/FileInput/FileInput.tsx +7 -0
  135. package/src/components/FileUpload/FileUpload.stories.tsx +18 -0
  136. package/src/components/FileUpload/FileUpload.tsx +7 -0
  137. package/src/components/Flex/FLEX_IMPLEMENTATION_NOTES.md +4 -0
  138. package/src/components/Flex/Flex.module.css +7 -0
  139. package/src/components/Flex/Flex.stories.tsx +128 -0
  140. package/src/components/Flex/Flex.tsx +68 -0
  141. package/src/components/FormControlLayout/FormControlLayout.module.css +80 -0
  142. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +82 -0
  143. package/src/components/FormControlLayout/FormControlLayout.tsx +78 -0
  144. package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
  145. package/src/components/FormControlWrapper/FormControlWrapper.module.css +8 -0
  146. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
  147. package/src/components/FormControlWrapper/FormControlWrapper.tsx +157 -0
  148. package/src/components/Group/GROUP_IMPLEMENTATION_NOTES.md +4 -0
  149. package/src/components/Group/Group.module.css +7 -0
  150. package/src/components/Group/Group.stories.tsx +120 -0
  151. package/src/components/Group/Group.tsx +68 -0
  152. package/src/components/HoverCard/HoverCard.stories.tsx +17 -0
  153. package/src/components/HoverCard/HoverCard.tsx +7 -0
  154. package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
  155. package/src/components/Label/Label.module.css +140 -0
  156. package/src/components/Label/Label.stories.tsx +122 -0
  157. package/src/components/Label/Label.tsx +127 -0
  158. package/src/components/Label/index.ts +1 -0
  159. package/src/components/Link/Link.stories.tsx +17 -0
  160. package/src/components/Link/Link.tsx +7 -0
  161. package/src/components/Loader/Loader.module.css +60 -0
  162. package/src/components/Loader/Loader.stories.tsx +103 -0
  163. package/src/components/Loader/Loader.tsx +76 -0
  164. package/src/components/Menu/Menu.stories.tsx +17 -0
  165. package/src/components/Menu/Menu.tsx +7 -0
  166. package/src/components/Modal/Modal.stories.tsx +17 -0
  167. package/src/components/Modal/Modal.tsx +7 -0
  168. package/src/components/NumberInput/NumberInput.stories.tsx +18 -0
  169. package/src/components/NumberInput/NumberInput.tsx +7 -0
  170. package/src/components/Pagination/Pagination.stories.tsx +17 -0
  171. package/src/components/Pagination/Pagination.tsx +7 -0
  172. package/src/components/Panel/Panel.stories.tsx +17 -0
  173. package/src/components/Panel/Panel.tsx +7 -0
  174. package/src/components/Popover/Popover.stories.tsx +17 -0
  175. package/src/components/Popover/Popover.tsx +7 -0
  176. package/src/components/Radio/Radio.module.css +207 -0
  177. package/src/components/Radio/Radio.stories.tsx +90 -0
  178. package/src/components/Radio/Radio.tsx +174 -0
  179. package/src/components/Radio/RadioGroup.stories.tsx +117 -0
  180. package/src/components/Radio/RadioGroup.tsx +118 -0
  181. package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -0
  182. package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
  183. package/src/components/ReadOnlyField/ReadOnlyField.module.css +49 -0
  184. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
  185. package/src/components/ReadOnlyField/ReadOnlyField.tsx +102 -0
  186. package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
  187. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
  188. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
  189. package/src/components/ReadOnlyField/index.ts +5 -0
  190. package/src/components/Search/Search.stories.tsx +17 -0
  191. package/src/components/Search/Search.tsx +7 -0
  192. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +18 -0
  193. package/src/components/SegmentedControl/SegmentedControl.tsx +7 -0
  194. package/src/components/Slider/Slider.stories.tsx +18 -0
  195. package/src/components/Slider/Slider.tsx +7 -0
  196. package/src/components/Stack/STACK_IMPLEMENTATION_NOTES.md +4 -0
  197. package/src/components/Stack/Stack.module.css +7 -0
  198. package/src/components/Stack/Stack.stories.tsx +108 -0
  199. package/src/components/Stack/Stack.tsx +66 -0
  200. package/src/components/Stepper/Stepper.stories.tsx +17 -0
  201. package/src/components/Stepper/Stepper.tsx +7 -0
  202. package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +28 -0
  203. package/src/components/Switch/Switch.module.css +199 -0
  204. package/src/components/Switch/Switch.stories.tsx +111 -0
  205. package/src/components/Switch/Switch.tsx +168 -0
  206. package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
  207. package/src/components/Switch/SwitchGroup.tsx +118 -0
  208. package/src/components/Table/Table.stories.tsx +17 -0
  209. package/src/components/Table/Table.tsx +7 -0
  210. package/src/components/Tabs/Tabs.stories.tsx +17 -0
  211. package/src/components/Tabs/Tabs.tsx +7 -0
  212. package/src/components/Text/Text.stories.tsx +88 -0
  213. package/src/components/Text/Text.tsx +54 -0
  214. package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
  215. package/src/components/TextArea/TextArea.module.css +225 -0
  216. package/src/components/TextArea/TextArea.stories.tsx +91 -0
  217. package/src/components/TextArea/TextArea.tsx +152 -0
  218. package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
  219. package/src/components/TextField/TextField.module.css +225 -0
  220. package/src/components/TextField/TextField.stories.tsx +162 -0
  221. package/src/components/TextField/TextField.tsx +139 -0
  222. package/src/components/TimePicker/TimePicker.stories.tsx +18 -0
  223. package/src/components/TimePicker/TimePicker.tsx +7 -0
  224. package/src/components/Timeline/Timeline.stories.tsx +17 -0
  225. package/src/components/Timeline/Timeline.tsx +7 -0
  226. package/src/components/Title/Title.stories.tsx +63 -0
  227. package/src/components/Title/Title.tsx +45 -0
  228. package/src/components/Toast/Toast.stories.tsx +17 -0
  229. package/src/components/Toast/Toast.tsx +7 -0
  230. package/src/components/Tooltip/Tooltip.stories.tsx +17 -0
  231. package/src/components/Tooltip/Tooltip.tsx +7 -0
  232. package/src/components/TransferList/TransferList.stories.tsx +17 -0
  233. package/src/components/TransferList/TransferList.tsx +7 -0
  234. package/src/components/index.ts +48 -0
  235. package/src/env.d.ts +7 -0
  236. package/src/index.ts +3 -0
  237. package/src/types/index.ts +9 -0
  238. package/src/types/mantine.d.ts +7 -0
  239. package/src/types/scss-modules.d.ts +9 -0
  240. package/src/utils/ColorSchemeWrapper.tsx +27 -0
  241. package/src/utils/RequireAccessibleLabel.ts +12 -0
  242. package/src/utils/copyToClipboard.ts +36 -0
  243. package/src/utils/filterStylingProps.ts +141 -0
  244. package/src/utils/index.ts +1 -0
  245. package/dist/adapter/generateBorderRadiusType.d.ts +0 -3
  246. package/dist/adapter/generateBorderRadiusType.d.ts.map +0 -1
  247. package/dist/adapter/generateColorTypes.d.ts +0 -6
  248. package/dist/adapter/generateColorTypes.d.ts.map +0 -1
  249. package/dist/adapter/generateIcons.d.ts +0 -8
  250. package/dist/adapter/generateIcons.d.ts.map +0 -1
  251. package/dist/adapter/generateMantineTheme.d.ts +0 -19
  252. package/dist/adapter/generateMantineTheme.d.ts.map +0 -1
  253. package/dist/adapter/generatePrettierignore.d.ts +0 -3
  254. package/dist/adapter/generatePrettierignore.d.ts.map +0 -1
  255. package/dist/adapter/generateRecursicaObject.d.ts +0 -7
  256. package/dist/adapter/generateRecursicaObject.d.ts.map +0 -1
  257. package/dist/adapter/generateRecursicaThemes.d.ts +0 -12
  258. package/dist/adapter/generateRecursicaThemes.d.ts.map +0 -1
  259. package/dist/adapter/generateRecursicaTokens.d.ts +0 -3
  260. package/dist/adapter/generateRecursicaTokens.d.ts.map +0 -1
  261. package/dist/adapter/generateSpacersType.d.ts +0 -3
  262. package/dist/adapter/generateSpacersType.d.ts.map +0 -1
  263. package/dist/adapter/generateUiKit.d.ts +0 -8
  264. package/dist/adapter/generateUiKit.d.ts.map +0 -1
  265. package/dist/adapter/generateVanillaExtractThemes.d.ts +0 -12
  266. package/dist/adapter/generateVanillaExtractThemes.d.ts.map +0 -1
  267. package/dist/adapter/index.d.ts +0 -44
  268. package/dist/adapter/index.d.ts.map +0 -1
  269. package/dist/cli.d.ts +0 -6
  270. package/dist/cli.d.ts.map +0 -1
  271. package/dist/index.d.ts.map +0 -1
  272. package/dist/index.js +0 -921
  273. package/dist/index.js.map +0 -1
  274. package/dist/main.cjs +0 -928
  275. package/dist/main.cjs.map +0 -1
  276. package/dist/main.d.ts +0 -2
  277. package/dist/main.d.ts.map +0 -1
  278. package/dist/main.js +0 -926
  279. package/dist/main.js.map +0 -1
  280. package/dist/shared/processTokens.d.ts +0 -22
  281. package/dist/shared/processTokens.d.ts.map +0 -1
  282. package/dist/types.d.ts +0 -62
  283. package/dist/types.d.ts.map +0 -1
  284. package/dist/utils/fileCheck.d.ts +0 -8
  285. package/dist/utils/fileCheck.d.ts.map +0 -1
  286. package/dist/utils/loadConfig.d.ts +0 -24
  287. package/dist/utils/loadConfig.d.ts.map +0 -1
  288. package/dist/webworker.d.ts +0 -2
  289. package/dist/webworker.d.ts.map +0 -1
  290. package/dist/webworker.js +0 -791
@@ -0,0 +1,148 @@
1
+ /**
2
+ * commonArgTypes.ts
3
+ *
4
+ * This file centralizes the standard Storybook Controls (ArgTypes) for all UI Kit
5
+ * components that natively wrap or extend the `FormControlWrapper`.
6
+ *
7
+ * PHILOSOPHY:
8
+ * Recursica ensures strict unified design boundaries across all form inputs (TextField,
9
+ * CheckboxGroup, Dropdown, etc.). Because they all share the exact same label structures,
10
+ * layout variants (stacked vs side-by-side), and assistive text bindings natively supplied
11
+ * by the `FormControlWrapper`, their Storybook experiences should be exactly identical.
12
+ *
13
+ * USAGE:
14
+ * Rather than recreating these controls inside every `Component.stories.tsx` file,
15
+ * developers must spread this object directly into the `argTypes` of their story default block:
16
+ *
17
+ * ```tsx
18
+ * import { formControlArgTypes } from "../../.storybook/commonArgTypes";
19
+ *
20
+ * export default {
21
+ * component: TextField,
22
+ * argTypes: {
23
+ * ...formControlArgTypes,
24
+ * // Component-specific argTypes below...
25
+ * }
26
+ * }
27
+ * ```
28
+ */
29
+ import type { ArgTypes } from "@storybook/react";
30
+
31
+ export const formControlArgTypes: Partial<ArgTypes> = {
32
+ formLayout: {
33
+ control: "inline-radio",
34
+ options: ["stacked", "side-by-side"],
35
+ description:
36
+ "Determines the structural flow layout of the Label relative to the Input.",
37
+ table: {
38
+ category: "Form Layout",
39
+ },
40
+ },
41
+ labelSize: {
42
+ control: "inline-radio",
43
+ options: ["default", "small"],
44
+ description:
45
+ "Adjusts the typographical boundaries bounding the Label section.",
46
+ table: {
47
+ category: "Form Layout",
48
+ },
49
+ },
50
+ labelAlignment: {
51
+ control: "inline-radio",
52
+ options: ["left", "right"],
53
+ description:
54
+ "Adjusts the explicit text alignment axis exclusively evaluating side-by-side structures.",
55
+ table: {
56
+ category: "Form Layout",
57
+ },
58
+ },
59
+ labelOptionalText: {
60
+ control: "text",
61
+ description:
62
+ "Optional secondary stylistic text injected alongside the primary Label node.",
63
+ table: {
64
+ category: "Form Layout",
65
+ },
66
+ },
67
+ labelWithEditIcon: {
68
+ control: "boolean",
69
+ description:
70
+ "Dynamically toggles interactivity hooks revealing the Edit context icon.",
71
+ table: {
72
+ category: "Form Layout",
73
+ },
74
+ },
75
+ description: {
76
+ table: {
77
+ disable: true,
78
+ },
79
+ },
80
+ assistiveText: {
81
+ control: "text",
82
+ description:
83
+ "Helper instructions safely dynamically anchored below the input box natively outperforming description.",
84
+ table: {
85
+ category: "Form Layout",
86
+ },
87
+ },
88
+ assistiveWithIcon: {
89
+ control: "boolean",
90
+ description:
91
+ "Toggles native Recursica Info-styling rendering universally alongside the assistive block.",
92
+ table: {
93
+ category: "Form Layout",
94
+ },
95
+ },
96
+ error: {
97
+ control: "text",
98
+ description:
99
+ "Dynamically maps error feedback validation strings rendering explicit error states.",
100
+ table: {
101
+ category: "Form State",
102
+ },
103
+ },
104
+ required: {
105
+ control: "boolean",
106
+ description:
107
+ "Native DOM compliance flag explicitly marking the field as required natively.",
108
+ table: {
109
+ category: "Form State",
110
+ },
111
+ },
112
+ disabled: {
113
+ control: "boolean",
114
+ description:
115
+ "Globally disables interactive components bounding all click and focus logic natively.",
116
+ table: {
117
+ category: "Form State",
118
+ },
119
+ },
120
+ withAsterisk: {
121
+ control: "boolean",
122
+ description:
123
+ "Visually forces the mandatory asterisk presence completely independent of logical 'required' attribute properties.",
124
+ table: {
125
+ category: "Form State",
126
+ },
127
+ },
128
+ labelActionArea: {
129
+ table: {
130
+ disable: true,
131
+ },
132
+ },
133
+ onLabelEditClick: {
134
+ table: {
135
+ disable: true,
136
+ },
137
+ },
138
+ controlMaxWidth: {
139
+ table: {
140
+ disable: true,
141
+ },
142
+ },
143
+ controlMinWidth: {
144
+ table: {
145
+ disable: true,
146
+ },
147
+ },
148
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,94 @@
1
+ # @recursica/mantine-adapter
2
+
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7898170: Updated read-only states for all components
8
+
9
+ ## 0.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 928f346: Added switch and radio
14
+ - cb90751: Updated container and docs
15
+
16
+ ## 0.9.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 7d4af9c: Updated accordion
21
+
22
+ ## 0.8.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 6e6256b: Updated with latest components
27
+
28
+ ## 0.7.0
29
+
30
+ ### Minor Changes
31
+
32
+ - bce74c3: Updated mantine storybook config
33
+ - a4cf78b: Updates storybook controls and added chip
34
+
35
+ ## 0.6.0
36
+
37
+ ### Minor Changes
38
+
39
+ - 9e31278: Added more mantine adapter components
40
+
41
+ ## 0.5.0
42
+
43
+ ### Minor Changes
44
+
45
+ - a1067c9: Implemented stories in construction and over styling
46
+
47
+ ## 0.4.0
48
+
49
+ ### Minor Changes
50
+
51
+ - eb5561b: Restructured and moved new adapter-common package
52
+ - 6df88b7: Updated storybook layout and consolidated storybook release
53
+ - eb5561b: Updated for latest CSS config and postcss processing
54
+
55
+ ## 0.3.0
56
+
57
+ ### Minor Changes
58
+
59
+ - ea86688: Updated for latest CSS config and postcss processing
60
+
61
+ ## 0.2.0
62
+
63
+ ### Minor Changes
64
+
65
+ - 5e0c31f: Fixed dependency so it will import correctly
66
+
67
+ ### Patch Changes
68
+
69
+ - 5e0c31f: Updated link to readme in package.json
70
+
71
+ ## 0.1.0
72
+
73
+ ### Minor Changes
74
+
75
+ - be88cfc: Updated README and structure and provided Storybook builds
76
+
77
+ ## 0.0.4
78
+
79
+ ### Patch Changes
80
+
81
+ - cec0db5: Renamed ui-kit to mantine-adapter to signal proper peer reference to Mantine
82
+ - cec0db5: Added peer dependency for mantine in the plugin
83
+
84
+ ## 0.0.3
85
+
86
+ ### Patch Changes
87
+
88
+ - 9aab210: update docs
89
+
90
+ ## 0.0.2
91
+
92
+ ### Patch Changes
93
+
94
+ - c6973c2: first publish
package/README.md CHANGED
@@ -1,376 +1,92 @@
1
- # Recursica Mantine Adapter
1
+ # @recursica/mantine-adapter
2
2
 
3
- A design token adapter that converts Figma design tokens exported via the Recursica Figma plugin into Mantine theme files, TypeScript types, and Vanilla Extract CSS-in-JS themes.
4
-
5
- ## What is Recursica Mantine Adapter
6
-
7
- The Recursica Mantine Adapter processes design token JSON files and generates:
8
-
9
- - **Mantine Theme**: Complete Mantine theme configuration with colors, typography, spacing, and more
10
- - **Vanilla Extract Themes**: CSS-in-JS theme files with contract-based theme switching
11
- - **TypeScript Types**: Type-safe interfaces for colors, spacers, border radius, and other tokens
12
- - **React Components**: Ready-to-use Icon components with proper TypeScript definitions
13
- - **UI Kit Objects**: Structured objects containing all design system primitives
3
+ A modern React component library built with TypeScript and **Mantine 8**. This package serves as the core UI kit for Recursica applications, providing reusable UI components, centralized theme configurations, and a comprehensive Storybook environment for development.
14
4
 
15
5
  ## Installation
16
6
 
17
7
  ```bash
18
8
  npm install @recursica/mantine-adapter
9
+ # or
10
+ yarn add @recursica/mantine-adapter
11
+ # or
12
+ pnpm add @recursica/mantine-adapter
19
13
  ```
20
14
 
21
- ## Usage
22
-
23
- ### Option 1: Using npx (Recommended)
24
-
25
- Run the adapter directly without installation:
26
-
27
- ```bash
28
- npx @recursica/mantine-adapter
29
- ```
30
-
31
- ### Option 2: Adding a script to package.json
15
+ ## Peer Dependencies
32
16
 
33
- Add the recursica command to your package.json scripts:
34
-
35
- ```json
36
- {
37
- "scripts": {
38
- "recursica": "recursica"
39
- }
40
- }
41
- ```
42
-
43
- Then run:
17
+ This library requires the following peer dependencies to be installed in your project:
44
18
 
45
19
  ```bash
46
- npm run recursica
20
+ npm install @mantine/core@>=8.0.0 @mantine/dates@>=8.0.0 @mantine/hooks@>=8.0.0 react@>=16.8.0 react-dom@>=16.8.0
47
21
  ```
48
22
 
49
- ### Option 3: Programmatic Usage
23
+ **Important**: Make sure you have these exact versions or higher installed, as the components rely on Mantine 8+ features and React 16.8+ hooks.
50
24
 
51
- ```typescript
52
- import { runMain } from "@recursica/mantine-adapter";
25
+ ## Quick Start
53
26
 
54
- await runMain();
55
- ```
56
-
57
- ## Configuration
58
-
59
- Create a `recursica.json` file in your project root:
60
-
61
- ```json
62
- {
63
- "$schema": "node_modules/@recursica/schemas/RecursicaConfiguration.json",
64
- "project": "YourProjectName",
65
- "srcPath": "./src",
66
- "bundledJson": "./design-tokens.json",
67
- "iconsJson": "./icons.json",
68
- "overrides": {
69
- "mantineTheme": {
70
- "1-scale": "rem",
71
- "background": "white"
72
- },
73
- "fontWeight": [
74
- {
75
- "fontFamily": "Inter",
76
- "value": 400,
77
- "alias": "regular"
78
- }
79
- ]
80
- },
81
- "iconsConfig": {
82
- "include": {
83
- "variants": ["Filled", "Outlined"]
84
- },
85
- "exclude": {
86
- "names": ["deprecated_icon"]
87
- }
88
- }
89
- }
90
- ```
91
-
92
- ### Configuration Options
93
-
94
- - `project`: Must match the project name in your exported JSON files
95
- - `srcPath`: Output directory for generated files (default: `./src`)
96
- - `bundledJson`: Path to your design tokens JSON file
97
- - `iconsJson`: Path to your icons JSON file (optional)
98
- - `overrides`: Custom overrides for theme generation
99
- - `iconsConfig`: Configuration for icon filtering and processing
100
-
101
- ## Generated Files
102
-
103
- The adapter generates the following file structure in `{srcPath}/recursica/`:
104
-
105
- ```
106
- src/
107
- └── recursica/
108
- ├── Recursica.ts # Main theme object
109
- ├── RecursicaTokens.ts # Base design tokens
110
- ├── RecursicaContractTheme.css.ts # Vanilla Extract contract
111
- ├── RecursicaThemes.css.ts # Theme implementations
112
- ├── RecursicaMantineTheme.ts # Mantine theme config
113
- ├── RecursicaColorsType.ts # Color type definitions
114
- ├── RecursicaSpacersType.ts # Spacing type definitions
115
- ├── RecursicaBorderRadiusType.ts # Border radius types
116
- ├── RecursicaUiKit.ts # UI Kit components object
117
- └── components/
118
- └── Icons/
119
- ├── Icon.tsx # Main Icon component
120
- ├── icon_exports.ts # React icon components
121
- ├── icon_resource_map.ts # Icon name mappings
122
- └── Svg/ # SVG icon files
123
- ├── icon1.svg
124
- └── icon2.svg
125
- ```
126
-
127
- ## Icon Component Usage
128
-
129
- The generated Icon component provides type-safe icon usage:
27
+ To use `@recursica/mantine-adapter` in your project, you **must** import its required CSS files in a specific order at the root of your application (e.g., in `App.tsx` or `main.tsx`). This ensures that Mantine styles load first, followed by the Recursica design tokens, and finally the adapter overrides.
130
28
 
131
29
  ```tsx
132
- import { Icon } from './recursica/components/Icons/Icon';
133
- import type { RecursicaColors } from './recursica/RecursicaColorsType';
134
-
135
- // Basic usage
136
- <Icon name="check_Filled" />
137
-
138
- // With custom size and color
139
- <Icon
140
- name="arrow_back_ios_new_Outlined"
141
- size={32}
142
- color="primary-500"
143
- />
144
-
145
- // Available props
146
- interface IconProps {
147
- name: IconName; // Autocompleted icon names
148
- size?: 16 | 20 | 24 | 32 | 40 | 48 | "100%"; // Predefined sizes
149
- title?: string; // Accessibility title
150
- color?: RecursicaColors; // Theme colors
151
- }
152
- ```
153
-
154
- ## Using with Webworker
155
-
156
- For browser-based token processing, use the webworker implementation:
157
-
158
- ### 1. Setup the Worker
159
-
160
- ```typescript
161
- // worker.ts
162
- import "@recursica/mantine-adapter/dist/webworker.js";
163
- ```
164
-
165
- ### 2. Process Tokens in Main Thread
166
-
167
- ```typescript
168
- // main.ts
169
- interface WorkerMessage {
170
- bundledJson: string; // JSON content as string
171
- iconsJson?: string; // Icons JSON content as string
172
- project: string; // Project name
173
- srcPath: string; // Output path
174
- rootPath: string; // Root project path
175
- overrides?: any; // Theme overrides
176
- iconsConfig?: any; // Icons configuration
177
- }
178
-
179
- // Create and use worker
180
- const worker = new Worker("./worker.js");
181
-
182
- worker.postMessage({
183
- bundledJson: jsonFileContent,
184
- iconsJson: iconsJsonContent,
185
- project: "YourProject",
186
- srcPath: "./src",
187
- rootPath: "./",
188
- overrides: undefined,
189
- iconsConfig: undefined,
190
- });
191
-
192
- worker.onmessage = (event) => {
193
- const files = event.data;
194
- // Process generated files
195
- console.log("Generated files:", files);
196
-
197
- // Files structure matches the CLI output:
198
- // - files.recursicaTokens
199
- // - files.vanillaExtractThemes
200
- // - files.mantineTheme
201
- // - files.uiKitObject
202
- // - files.recursicaObject
203
- // - files.colorsType
204
- // - files.iconsObject
205
- // etc.
206
- };
207
- ```
208
-
209
- ### 3. Handle Worker Response
210
-
211
- ```typescript
212
- interface WorkerResponse {
213
- recursicaTokens: ExportingResult;
214
- vanillaExtractThemes: VanillaExtractThemesOutput;
215
- mantineTheme: GenerateMantineThemeOutput;
216
- uiKitObject: ExportingResult;
217
- recursicaObject: ExportingResult;
218
- colorsType: ExportingResult;
219
- spacersType: ExportingResult;
220
- borderRadiusType: ExportingResult;
221
- iconsObject?: GenerateIconsOutput;
222
- recursicaThemes: ExportingResult;
223
- prettierignore: ExportingResult;
224
- }
225
-
226
- interface ExportingResult {
227
- content: string; // File content
228
- path: string; // Full file path
229
- filename: string; // Filename only
230
- }
231
- ```
232
-
233
- ## Creating Custom Adapters
234
-
235
- To create your own adapter, you need to implement the core generator functions. The adapter architecture is modular and extensible.
30
+ import "@mantine/core/styles.css";
31
+ import "../path/to/recursica_variables_scoped.css"; // Import your Recursica CSS variables
32
+ import "@recursica/mantine-adapter/style.css";
236
33
 
237
- ### 1. Adapter Structure
238
-
239
- ```typescript
240
- // your-adapter/index.ts
241
- import type {
242
- RecursicaConfigOverrides,
243
- RecursicaConfigIcons,
244
- ExportingResult,
245
- } from "@recursica/mantine-adapter";
246
-
247
- interface CustomAdapterParams {
248
- overrides: RecursicaConfigOverrides | undefined;
249
- rootPath: string;
250
- srcPath: string;
251
- project: string;
252
- icons: Record<string, string>;
253
- iconsConfig: RecursicaConfigIcons | undefined;
254
- processTokens: ProcessTokens;
255
- }
34
+ import React from "react";
35
+ import { Button } from "@recursica/mantine-adapter";
256
36
 
257
- export function runCustomAdapter(params: CustomAdapterParams) {
258
- // Your custom generation logic here
259
- return {
260
- // Return ExportingResult objects for each file you want to generate
261
- customTheme: generateCustomTheme(params),
262
- customTypes: generateCustomTypes(params),
263
- // ... other generators
264
- };
37
+ function App() {
38
+ return <Button variant="solid">Click Me</Button>;
265
39
  }
266
40
  ```
267
41
 
268
- ### 2. Individual Generators
42
+ ## Philosophy
269
43
 
270
- Each generator should follow this pattern:
44
+ The `@recursica/mantine-adapter` is designed to provide curated, strictly-typed UI components tailored specifically following the Recursica styling and behavior guidelines.
271
45
 
272
- ```typescript
273
- // generateCustomTheme.ts
274
- import type {
275
- ExportingResult,
276
- ExportingProps,
277
- } from "@recursica/mantine-adapter";
46
+ - **Override, Don't Corrupt**: Recursica components are built as wrappers around Mantine components to seamlessly override their default appearance with Recursica stylings. We deliberately **leave the base Mantine global styles and theme alone** so that it does not negatively impact the overall project or third-party libraries depending on standard Mantine.
47
+ - **Strictly Curated Props**: We expose a complete set of Mantine props via our Recursica components, but **not all props are fully supported**. We restrict certain props if they do not fit the established UI definition, styles, or behaviors of the Recursica design system.
48
+ - **Avoid Overstyling**: Developers are encouraged to use Recursica components precisely as they are provided. You should **not overstyle them** (e.g., injecting custom styles or class names that conflict with the adapter) as this risks breaking the carefully constructed styling connections and visual consistency.
49
+ - **Need Something Different?**: If you need to build a UI element with completely different styling that deviates from the design system, you are encouraged to import the base component directly from `@mantine/core` and style it yourself to achieve your goal.
278
50
 
279
- export function generateCustomTheme(
280
- tokens: Record<string, any>,
281
- exportingProps: ExportingProps,
282
- ): ExportingResult {
283
- const { outputPath, project } = exportingProps;
51
+ ## Development and Architecture
284
52
 
285
- const filename = `${project}CustomTheme.ts`;
286
- const path = `${outputPath}/${filename}`;
53
+ This project is built using:
287
54
 
288
- const content = `
289
- // Auto-generated custom theme
290
- export const customTheme = ${JSON.stringify(tokens, null, 2)};
291
- `.trim();
55
+ - **Vite (Library Mode)**: For fast builds, producing optimized ES and CJS modules.
56
+ - **Mantine 8**: Base components, hooks, and native standard styling architecture.
57
+ - **Storybook**: Used heavily for interactive component development, documentation, and prototyping.
292
58
 
293
- return {
294
- content,
295
- path,
296
- filename,
297
- };
298
- }
299
- ```
300
-
301
- ### 3. Available Generator Templates
59
+ > **Note:** We relying completely on Mantine's built-in CSS styling and Vite's native CSS/CSS Modules capabilities. No complex CSS-in-JS overhead!
302
60
 
303
- The mantine-adapter provides several generator templates you can extend:
61
+ ## Storybook Documentation
304
62
 
305
- - `generateRecursicaTokens`: Base token generation
306
- - `generateVanillaExtractThemes`: CSS-in-JS theme generation
307
- - `generateMantineTheme`: Mantine-specific theme generation
308
- - `generateColorTypes`: TypeScript color type generation
309
- - `generateIcons`: React icon component generation
310
- - `generateUiKit`: UI component object generation
63
+ This library includes Storybook for all components. You can:
311
64
 
312
- ### 4. Token Processing
65
+ - **View live examples** of components.
66
+ - **Test component interactions** and accessibility.
67
+ - **Explore UI tokens** and layout utilities.
313
68
 
314
- Use the `ProcessTokens` class to handle token transformation:
69
+ ### Accessing Storybook Locally
315
70
 
316
- ```typescript
317
- import { ProcessTokens } from "@recursica/mantine-adapter";
71
+ If you're contributing or developing locally, clone the repository and run:
318
72
 
319
- const processTokens = new ProcessTokens(overrides);
320
- processTokens.processTokens(jsonContent.tokens);
321
-
322
- // Access processed tokens
323
- const colors = processTokens.colors;
324
- const spacers = processTokens.spacers;
325
- const typography = processTokens.typography;
326
- const themes = processTokens.themes;
73
+ ```bash
74
+ npm run storybook
327
75
  ```
328
76
 
329
- ### 5. Integration
330
-
331
- Replace the default adapter by modifying the `runAdapter` function or create a separate CLI that uses your custom adapter:
332
-
333
- ```typescript
334
- // custom-cli.ts
335
- import { processJsonContent, processIcons } from "@recursica/mantine-adapter";
336
- import { runCustomAdapter } from "./your-adapter";
337
-
338
- // Use the same processing logic but with your custom adapter
339
- const processTokens = processJsonContent(bundledJsonContent, {
340
- project,
341
- overrides,
342
- });
343
- const icons = processIcons(iconsJsonContent);
344
-
345
- const files = runCustomAdapter({
346
- rootPath,
347
- overrides,
348
- srcPath,
349
- icons,
350
- processTokens,
351
- project,
352
- iconsConfig,
353
- });
354
- ```
77
+ This will spin up a local server (typically at `http://localhost:6006`) with a hot-reloading environment for component prototyping.
355
78
 
356
- ## API Reference
79
+ ## TypeScript Support
357
80
 
358
- ### Core Functions
81
+ All newly built components will include full TypeScript support with comprehensive prop types exported.
359
82
 
360
- - `runMain()`: Main CLI execution function
361
- - `processJsonContent()`: Process design token JSON
362
- - `processIcons()`: Process icons JSON
363
- - `processAdapter()`: Core adapter processing logic
364
- - `runAdapter()`: Execute the Mantine adapter
83
+ ## Developer & AI Guidelines
365
84
 
366
- ### Types
85
+ This repository provides dedicated routing documents for both human developers and AI Agents to ensure strict adherence to our design system constraints.
367
86
 
368
- - `ExportingResult`: File output interface
369
- - `RecursicaConfigOverrides`: Theme override configuration
370
- - `RecursicaConfigIcons`: Icon processing configuration
371
- - `ThemeTokens`: Theme token structure
372
- - `Themes`: Multi-theme structure
87
+ - **For Human Developers:** This `README.md` acts as your primary routing document. If you are integrating this library into an application, please read [USAGE.md](./USAGE.md). If you are building or modifying components inside this library, please read [CONTRIBUTING.md](./CONTRIBUTING.md).
88
+ - **For AI Agents:** All AI Agents operating in this repository must start by reading [AGENT.md](./AGENT.md), which serves as the primary routing document for AI workflows.
373
89
 
374
90
  ## License
375
91
 
376
- MIT
92
+ This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,2 @@
1
- export { runAdapter } from "./adapter";
2
- export type { Themes, ThemeTokens, RecursicaConfigOverrides, RecursicaConfigIcons, ExportingResult, JsonContentIcons, } from "./types";
3
- export { loadConfig } from "./utils/loadConfig";
4
- export { isFontFamilyToken, isEffectToken, isColorOrFloatToken, capitalize, } from "@recursica/common";
5
- export { ProcessTokens } from "./shared/processTokens";
6
- export { processJsonContent } from "./shared/common";
7
- export { runMain } from "./cli";
8
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './src/index'
2
+ export {}