@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,122 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import React from "react";
3
+ import type { Meta, StoryObj } from "@storybook/react";
4
+ import { Label } from "./Label";
5
+ import { TextField } from "../TextField/TextField";
6
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
7
+
8
+ type LabelStoryProps = React.ComponentProps<typeof Label>;
9
+
10
+ const meta: Meta<LabelStoryProps> = {
11
+ title: "UI-Kit/Label",
12
+ component: Label,
13
+ tags: ["autodocs"],
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component:
18
+ "The `Label` component is a strict Recursica-styled wrapper around Mantine's native `Input.Label`. It serves as the primary compositional primitive for all form fields, preserving Mantine's accessibility associations and context while strictly enforcing the Recursica atomic design system.\n\n### Usage with Form Inputs\nWhen working with form structures, render this `Label` component directly above your inputs or supply it to a component's overriding properties. The component automatically maps structural layout dimensions, dynamic alignment (`left` vs `right`), custom indicator gaps, and integrates a customized `optionalText` and `withEditIcon` flow that safely bypasses Mantine's native required asterisk mechanisms.",
19
+ },
20
+ },
21
+ },
22
+ argTypes: {
23
+ ...formControlArgTypes,
24
+ },
25
+ };
26
+
27
+ export default meta;
28
+
29
+ type Story = StoryObj<LabelStoryProps>;
30
+
31
+ // Utility mapping to pipe raw Label args structurally into TextField accurately
32
+ const renderWithTextField = ({ children, ...args }: LabelStoryProps) => (
33
+ <TextField
34
+ label={children as React.ReactNode}
35
+ placeholder="Form Control primitive mapped..."
36
+ {...(args as any)}
37
+ />
38
+ );
39
+
40
+ export const Default: Story = {
41
+ args: {
42
+ children: "Dynamic Label (Controls)",
43
+
44
+ labelSize: "default",
45
+ labelAlignment: "left",
46
+ required: false,
47
+ labelOptionalText: "",
48
+ labelWithEditIcon: false,
49
+ },
50
+ render: renderWithTextField,
51
+ };
52
+
53
+ export const StackedDefault: Story = {
54
+ args: {
55
+ children: "Email Address",
56
+ },
57
+ render: renderWithTextField,
58
+ };
59
+
60
+ export const StackedRequired: Story = {
61
+ args: {
62
+ children: "Primary Network Node",
63
+
64
+ required: true,
65
+ },
66
+ render: renderWithTextField,
67
+ };
68
+
69
+ export const StackedWithEditIcon: Story = {
70
+ args: {
71
+ children: "Environment Variables",
72
+
73
+ labelWithEditIcon: true,
74
+ },
75
+ render: renderWithTextField,
76
+ };
77
+
78
+ export const SideBySideDefault: Story = {
79
+ args: {
80
+ children: "Status",
81
+
82
+ labelSize: "default",
83
+ },
84
+ render: renderWithTextField,
85
+ };
86
+
87
+ export const RequiredSuppressesOptionalText: Story = {
88
+ args: {
89
+ children: "Full Name",
90
+
91
+ required: true,
92
+ labelOptionalText: "This should not render",
93
+ },
94
+ render: renderWithTextField,
95
+ };
96
+
97
+ export const BooleanOptionalText: Story = {
98
+ args: {
99
+ children: "Middle Initial",
100
+
101
+ labelOptionalText: true,
102
+ },
103
+ render: renderWithTextField,
104
+ };
105
+
106
+ export const WithEditIcon: Story = {
107
+ args: {
108
+ children: "Shipping Address",
109
+
110
+ labelWithEditIcon: true,
111
+ },
112
+ render: renderWithTextField,
113
+ };
114
+
115
+ export const LayerOneSideBySide: Story = {
116
+ args: {
117
+ children: "Configuration",
118
+
119
+ labelWithEditIcon: true,
120
+ },
121
+ render: renderWithTextField,
122
+ };
@@ -0,0 +1,127 @@
1
+ import React, { forwardRef } from "react";
2
+ import { Input, type InputLabelProps } from "@mantine/core";
3
+ import {
4
+ filterStylingProps,
5
+ type RecursicaOverStyled,
6
+ } from "../../utils/filterStylingProps";
7
+ import styles from "./Label.module.css";
8
+
9
+ export interface RecursicaLabelProps {
10
+ /** Specifies the sizing metrics natively mapping the Label boundaries. */
11
+ labelSize?: "default" | "small" | "md";
12
+ /** Overall alignment directive for the label strings natively forcing Left/Right justification. */
13
+ labelAlignment?: "left" | "right";
14
+ /** Injects an indicator text block alongside the label. Can be boolean (`true` maps to '(Optional)') or custom React nodes. */
15
+ labelOptionalText?: boolean | React.ReactNode;
16
+ /** When true, forces the native Edit Icon to replace the standard asterisk visually. */
17
+ labelWithEditIcon?: boolean;
18
+ /** Custom action area to render alongside the label instead of the default edit icon. */
19
+ labelActionArea?: React.ReactNode;
20
+ /** Interaction hook invoked whenever a generated edit icon block natively triggers a click event. */
21
+ onLabelEditClick?: React.MouseEventHandler<HTMLButtonElement>;
22
+ }
23
+
24
+ export type LabelProps = RecursicaOverStyled<
25
+ Omit<InputLabelProps, "size"> & RecursicaLabelProps
26
+ >;
27
+
28
+ export const Label = forwardRef<HTMLLabelElement, LabelProps>(function Label(
29
+ {
30
+ labelSize = "default",
31
+ labelAlignment,
32
+ required = false,
33
+ labelOptionalText,
34
+ labelWithEditIcon,
35
+ labelActionArea,
36
+ onLabelEditClick,
37
+ children,
38
+ overStyled = false,
39
+ ...rest
40
+ },
41
+ ref,
42
+ ) {
43
+ const resolvedAlignment = labelAlignment || "left";
44
+
45
+ let resolvedOptionalText: React.ReactNode | undefined;
46
+ if (!required) {
47
+ if (labelOptionalText === true) resolvedOptionalText = "optional";
48
+ else if (labelOptionalText) resolvedOptionalText = labelOptionalText;
49
+ }
50
+
51
+ const sanitizedProps = filterStylingProps(rest, overStyled);
52
+ const restRecord = sanitizedProps as Record<string, unknown>;
53
+
54
+ const mergedClassNames: Partial<Record<string, string>> = {
55
+ label: styles.root,
56
+ required: styles.required,
57
+ };
58
+
59
+ const classNamesProp = restRecord.classNames;
60
+ if (
61
+ classNamesProp &&
62
+ typeof classNamesProp === "object" &&
63
+ !Array.isArray(classNamesProp)
64
+ ) {
65
+ const o = classNamesProp as Partial<Record<string, string>>;
66
+ mergedClassNames.label = o.label
67
+ ? `${styles.root} ${o.label}`
68
+ : styles.root;
69
+ mergedClassNames.required = o.required
70
+ ? `${styles.required} ${o.required}`
71
+ : styles.required;
72
+ }
73
+
74
+ const classNameProp = restRecord.className as string | undefined;
75
+ const finalClass = classNameProp
76
+ ? `${styles.root} ${classNameProp}`
77
+ : styles.root;
78
+
79
+ return (
80
+ <Input.Label
81
+ ref={ref}
82
+ className={finalClass}
83
+ classNames={mergedClassNames}
84
+ data-size={labelSize}
85
+ data-alignment={resolvedAlignment}
86
+ required={required && !labelWithEditIcon}
87
+ {...sanitizedProps}
88
+ >
89
+ <span className={styles.labelText}>{children}</span>
90
+ {resolvedOptionalText && (
91
+ <span className={styles.optionalText}>
92
+ {typeof resolvedOptionalText === "string"
93
+ ? `(${resolvedOptionalText})`
94
+ : resolvedOptionalText}
95
+ </span>
96
+ )}
97
+ {labelActionArea ? (
98
+ <span className={styles.actionAreaWrapper}>{labelActionArea}</span>
99
+ ) : labelWithEditIcon ? (
100
+ <button
101
+ type="button"
102
+ className={styles.editIconWrapper}
103
+ data-replaces-asterisk={required ? "true" : undefined}
104
+ onClick={onLabelEditClick}
105
+ aria-label="Edit"
106
+ >
107
+ <svg
108
+ width="16"
109
+ height="16"
110
+ viewBox="0 0 16 16"
111
+ fill="none"
112
+ xmlns="http://www.w3.org/2000/svg"
113
+ >
114
+ <path
115
+ d="M11.5303 2.46967C11.8232 2.17678 12.2981 2.17678 12.591 2.46967L13.5303 3.40898C13.8232 3.70188 13.8232 4.17675 13.5303 4.46964L5.61288 12.3871C5.45268 12.5473 5.24434 12.6483 5.01809 12.6766L2.39534 13.0044C2.10091 13.0412 1.83856 12.7789 1.87538 12.4845L2.2032 9.86175C2.23147 9.63551 2.3325 9.42716 2.4927 9.26696L11.5303 2.46967Z"
116
+ stroke="currentColor"
117
+ strokeLinecap="round"
118
+ strokeLinejoin="round"
119
+ />
120
+ </svg>
121
+ </button>
122
+ ) : null}
123
+ </Input.Label>
124
+ );
125
+ });
126
+
127
+ Label.displayName = "Label";
@@ -0,0 +1 @@
1
+ export * from "./Label";
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Link } from "./Link";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof Link> = {
6
+ title: "UI-Kit/🚧 Link",
7
+ component: Link,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof Link>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="Link" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type LinkProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const Link: React.FC<LinkProps> = (props) => {
6
+ return <div {...props}>Link</div>;
7
+ };
@@ -0,0 +1,60 @@
1
+ .root {
2
+ /* Default inheritance mapped from component variables if not explicitly overridden by variants */
3
+ --loader-color: var(
4
+ --recursica_ui-kit_components_loader_properties_indicator-color,
5
+ currentColor
6
+ );
7
+ }
8
+
9
+ /* data-size mapping */
10
+
11
+ /* SMALL */
12
+ .root[data-size="small"] {
13
+ --loader-size: var(
14
+ --recursica_ui-kit_components_loader_variants_sizes_small_properties_size
15
+ );
16
+ }
17
+ .root[data-size="small"][data-variant="oval"] {
18
+ border-width: var(
19
+ --recursica_ui-kit_components_loader_variants_sizes_small_properties_thickness
20
+ );
21
+ }
22
+ .root[data-size="small"]:not([data-variant="oval"]) span {
23
+ border-radius: var(
24
+ --recursica_ui-kit_components_loader_variants_sizes_small_properties_border-radius
25
+ );
26
+ }
27
+
28
+ /* DEFAULT */
29
+ .root[data-size="default"] {
30
+ --loader-size: var(
31
+ --recursica_ui-kit_components_loader_variants_sizes_default_properties_size
32
+ );
33
+ }
34
+ .root[data-size="default"][data-variant="oval"] {
35
+ border-width: var(
36
+ --recursica_ui-kit_components_loader_variants_sizes_default_properties_thickness
37
+ );
38
+ }
39
+ .root[data-size="default"]:not([data-variant="oval"]) span {
40
+ border-radius: var(
41
+ --recursica_ui-kit_components_loader_variants_sizes_default_properties_border-radius
42
+ );
43
+ }
44
+
45
+ /* LARGE */
46
+ .root[data-size="large"] {
47
+ --loader-size: var(
48
+ --recursica_ui-kit_components_loader_variants_sizes_large_properties_size
49
+ );
50
+ }
51
+ .root[data-size="large"][data-variant="oval"] {
52
+ border-width: var(
53
+ --recursica_ui-kit_components_loader_variants_sizes_large_properties_thickness
54
+ );
55
+ }
56
+ .root[data-size="large"]:not([data-variant="oval"]) span {
57
+ border-radius: var(
58
+ --recursica_ui-kit_components_loader_variants_sizes_large_properties_border-radius
59
+ );
60
+ }
@@ -0,0 +1,103 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Loader } from "./Loader";
4
+ import { Layer } from "@recursica/adapter-common";
5
+
6
+ type LoaderStoryArgs = React.ComponentProps<typeof Loader> & {
7
+ layer?: 0 | 1 | 2 | 3;
8
+ };
9
+
10
+ const meta: Meta<LoaderStoryArgs> = {
11
+ title: "UI-Kit/Loader",
12
+ component: Loader as React.ComponentType<LoaderStoryArgs>,
13
+ tags: ["autodocs"],
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component:
18
+ "The Loader bridges the Recursica UI-Kit `loader` variables to the generic primitive, rendering deterministic sizes and variants visually mapped strictly from the explicit design boundary tokens.",
19
+ },
20
+ },
21
+ },
22
+ argTypes: {
23
+ variant: {
24
+ control: "select",
25
+ options: ["oval", "bars", "dots"],
26
+ description: "The structural layout variant of the loading indicator",
27
+ },
28
+ size: {
29
+ control: "select",
30
+ options: ["sm", "md", "lg", "small", "default", "large"],
31
+ description:
32
+ "Scales the dimensional and thickness layout constrained to the explicit UI variables",
33
+ },
34
+ color: {
35
+ control: "color",
36
+ description:
37
+ "Optional inline dynamic color override spanning the token defaults",
38
+ },
39
+ layer: {
40
+ control: { type: "range", min: 0, max: 3, step: 1 },
41
+ description:
42
+ "Applies a wrapping context to observe rendering logic externally",
43
+ },
44
+ },
45
+ };
46
+
47
+ export default meta;
48
+
49
+ type Story = StoryObj<LoaderStoryArgs>;
50
+
51
+ export const Default: Story = {
52
+ args: {
53
+ variant: "oval",
54
+ size: "default",
55
+ layer: 0,
56
+ },
57
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
58
+ render: ({ withLayer, layer, ...args }: any) => (
59
+ <Layer layer={layer ?? 0} style={{ padding: "24px" }}>
60
+ <Loader {...args} />
61
+ </Layer>
62
+ ),
63
+ };
64
+
65
+ export const StaticOvalDefault: Story = {
66
+ args: {
67
+ variant: "oval",
68
+ size: "default",
69
+ },
70
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
71
+ render: ({ withLayer, layer, ...args }: any) => <Loader {...args} />,
72
+ };
73
+
74
+ export const StaticBarsLarge: Story = {
75
+ args: {
76
+ variant: "bars",
77
+ size: "large",
78
+ },
79
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
80
+ render: ({ withLayer, layer, ...args }: any) => <Loader {...args} />,
81
+ };
82
+
83
+ export const StaticDotsSmall: Story = {
84
+ args: {
85
+ variant: "dots",
86
+ size: "sm",
87
+ },
88
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
89
+ render: ({ withLayer, layer, ...args }: any) => <Loader {...args} />,
90
+ };
91
+
92
+ export const LayerTwoOval: Story = {
93
+ args: {
94
+ variant: "oval",
95
+ size: "default",
96
+ },
97
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
98
+ render: ({ withLayer, layer, ...args }: any) => (
99
+ <Layer layer={2} style={{ padding: "24px" }}>
100
+ <Loader {...args} />
101
+ </Layer>
102
+ ),
103
+ };
@@ -0,0 +1,76 @@
1
+ import { forwardRef } from "react";
2
+ import {
3
+ Loader as MantineLoader,
4
+ type LoaderProps as MantineLoaderProps,
5
+ } from "@mantine/core";
6
+ import {
7
+ filterStylingProps,
8
+ type RecursicaOverStyled,
9
+ type RecursicaSize,
10
+ } from "../../utils/filterStylingProps";
11
+ import styles from "./Loader.module.css";
12
+
13
+ export interface RecursicaLoaderProps {
14
+ /** Map to the component styles defined in variables */
15
+ variant?: "oval" | "bars" | "dots";
16
+ /** Map to Recursica sizes */
17
+ size?: "sm" | "md" | "lg" | RecursicaSize;
18
+ }
19
+
20
+ export type LoaderProps = RecursicaOverStyled<
21
+ Omit<MantineLoaderProps, "variant" | "size" | "type"> & RecursicaLoaderProps
22
+ >;
23
+
24
+ export const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(
25
+ { variant = "oval", size = "default", overStyled = false, ...rest },
26
+ ref,
27
+ ) {
28
+ const mapSize = {
29
+ sm: "small",
30
+ md: "default",
31
+ lg: "large",
32
+ small: "small",
33
+ default: "default",
34
+ large: "large",
35
+ } as const;
36
+
37
+ const resolvedSize = mapSize[size] || "default";
38
+
39
+ // Strip all visual override injections unless developer has specifically opted into overStyling.
40
+ // External layout props like margins are safely preserved.
41
+ const sanitizedProps = filterStylingProps(rest, overStyled);
42
+
43
+ const mergedClassNames: Partial<Record<string, string>> = {
44
+ root: styles.root,
45
+ };
46
+
47
+ const classNamesProp = (sanitizedProps as Record<string, unknown>).classNames;
48
+ if (
49
+ classNamesProp &&
50
+ typeof classNamesProp === "object" &&
51
+ !Array.isArray(classNamesProp)
52
+ ) {
53
+ const o = classNamesProp as Partial<Record<string, string>>;
54
+ mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
55
+ }
56
+
57
+ const classNameProp = (sanitizedProps as Record<string, unknown>)
58
+ .className as string | undefined;
59
+ const finalClass = classNameProp
60
+ ? `${styles.root} ${classNameProp}`
61
+ : styles.root;
62
+
63
+ return (
64
+ <MantineLoader
65
+ ref={ref}
66
+ type={variant}
67
+ data-variant={variant}
68
+ data-size={resolvedSize}
69
+ {...sanitizedProps}
70
+ className={finalClass}
71
+ classNames={mergedClassNames}
72
+ />
73
+ );
74
+ });
75
+
76
+ Loader.displayName = "Loader";
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Menu } from "./Menu";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof Menu> = {
6
+ title: "UI-Kit/🚧 Menu",
7
+ component: Menu,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof Menu>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="Menu" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type MenuProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const Menu: React.FC<MenuProps> = (props) => {
6
+ return <div {...props}>Menu</div>;
7
+ };
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Modal } from "./Modal";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof Modal> = {
6
+ title: "UI-Kit/🚧 Modal",
7
+ component: Modal,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof Modal>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="Modal" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type ModalProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const Modal: React.FC<ModalProps> = (props) => {
6
+ return <div {...props}>Modal</div>;
7
+ };
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { NumberInput } from "./NumberInput";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof NumberInput> = {
6
+ title: "UI-Kit/🚧 NumberInput",
7
+ component: NumberInput,
8
+ tags: ["autodocs"],
9
+ argTypes: {},
10
+ };
11
+
12
+ export default meta;
13
+
14
+ type Story = StoryObj<typeof NumberInput>;
15
+
16
+ export const Default: Story = {
17
+ render: () => <ComingSoon componentName="NumberInput" />,
18
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type NumberInputProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const NumberInput: React.FC<NumberInputProps> = (props) => {
6
+ return <div {...props}>NumberInput</div>;
7
+ };
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Pagination } from "./Pagination";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof Pagination> = {
6
+ title: "UI-Kit/🚧 Pagination",
7
+ component: Pagination,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof Pagination>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="Pagination" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type PaginationProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const Pagination: React.FC<PaginationProps> = (props) => {
6
+ return <div {...props}>Pagination</div>;
7
+ };
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Panel } from "./Panel";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof Panel> = {
6
+ title: "UI-Kit/🚧 Panel",
7
+ component: Panel,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof Panel>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="Panel" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type PanelProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const Panel: React.FC<PanelProps> = (props) => {
6
+ return <div {...props}>Panel</div>;
7
+ };
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Popover } from "./Popover";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof Popover> = {
6
+ title: "UI-Kit/🚧 Popover",
7
+ component: Popover,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof Popover>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="Popover" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type PopoverProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const Popover: React.FC<PopoverProps> = (props) => {
6
+ return <div {...props}>Popover</div>;
7
+ };