@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
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@recursica/mantine-adapter",
3
- "description": "Recursica Design Token Adapter - Convert design tokens to code",
4
- "version": "0.9.3",
3
+ "description": "Reusable UI components for Recursica applications based on Mantine 8+",
5
4
  "private": false,
6
- "homepage": "https://github.com/borderux/recursica#readme",
5
+ "homepage": "https://github.com/borderux/recursica/tree/main/packages/mantine-adapter",
7
6
  "author": "hi@borderux.com",
8
7
  "bugs": {
9
8
  "url": "https://github.com/borderux/recursica/issues"
@@ -12,44 +11,84 @@
12
11
  "type": "git",
13
12
  "url": "git+https://github.com/borderux/recursica.git"
14
13
  },
14
+ "version": "0.10.0",
15
15
  "type": "module",
16
- "main": "dist/index.js",
17
- "types": "dist/index.d.ts",
18
- "bin": {
19
- "recursica": "dist/main.cjs"
20
- },
21
- "scripts": {
22
- "build": "rollup -c",
23
- "dev": "rollup -c -w",
24
- "clean": "rm -rf dist"
16
+ "main": "./dist/mantine-adapter.cjs",
17
+ "module": "./dist/mantine-adapter.js",
18
+ "types": "./dist/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/mantine-adapter.js",
23
+ "require": "./dist/mantine-adapter.cjs"
24
+ },
25
+ "./style.css": "./dist/mantine-adapter.css"
25
26
  },
27
+ "files": [
28
+ "dist",
29
+ "src",
30
+ "CHANGELOG.md",
31
+ ".storybook/commonArgTypes.ts"
32
+ ],
26
33
  "keywords": [
27
- "design-tokens",
28
- "figma",
34
+ "react",
35
+ "ui",
36
+ "components",
37
+ "typescript",
38
+ "mantine",
29
39
  "recursica",
30
- "theme",
31
- "adapter"
40
+ "design system",
41
+ "design systems"
32
42
  ],
33
- "files": [
34
- "dist/**/*",
35
- "README.md"
36
- ],
37
- "dependencies": {
38
- "@recursica/common": "*",
39
- "typescript": "^5.0.0"
43
+ "scripts": {
44
+ "dev": "npm run storybook",
45
+ "build": "vite build --mode library",
46
+ "build-storybook": "storybook build -o storybook-static",
47
+ "lint": "eslint .",
48
+ "storybook": "storybook dev -p 6006"
40
49
  },
41
50
  "devDependencies": {
42
- "@recursica/schemas": "*",
43
- "@rollup/plugin-commonjs": "^28.0.3",
44
- "@rollup/plugin-json": "^6.1.0",
45
- "@rollup/plugin-node-resolve": "^16.0.1",
46
- "@rollup/plugin-terser": "^0.4.4",
47
- "@rollup/plugin-typescript": "^12.1.2",
48
- "@types/node": "^20.0.0",
49
- "rollup": "^4.42.0"
50
- },
51
- "engines": {
52
- "node": ">=16.0.0"
51
+ "@chromatic-com/storybook": "^5.1.1",
52
+ "@eslint/js": "^9.25.0",
53
+ "@recursica/adapter-common": "*",
54
+ "@recursica/recursica-postcss-vars": "*",
55
+ "@recursica/storybook-template": "*",
56
+ "@repo/typescript-config": "*",
57
+ "@storybook/addon-a11y": "^10.3.3",
58
+ "@storybook/addon-docs": "^10.3.3",
59
+ "@storybook/addon-mcp": "^0.4.2",
60
+ "@storybook/addon-onboarding": "^10.3.3",
61
+ "@storybook/addon-vitest": "^10.3.3",
62
+ "@storybook/react-vite": "^10.3.3",
63
+ "@types/react": "^19.1.2",
64
+ "@types/react-dom": "^19.1.2",
65
+ "@vitejs/plugin-react": "^4.4.1",
66
+ "@vitest/browser": "^3.2.4",
67
+ "@vitest/coverage-v8": "^3.2.4",
68
+ "eslint": "^9.25.0",
69
+ "eslint-plugin-react-hooks": "^5.2.0",
70
+ "eslint-plugin-react-refresh": "^0.4.19",
71
+ "eslint-plugin-storybook": "^10.3.3",
72
+ "globals": "^16.0.0",
73
+ "playwright": "^1.53.0",
74
+ "react-markdown": "^10.1.0",
75
+ "sass": "^1.89.2",
76
+ "sirv": "^3.0.2",
77
+ "storybook": "^10.3.3",
78
+ "storybook-dark-mode": "^5.0.0",
79
+ "strip-literal": "^3.0.0",
80
+ "typescript": "~5.8.3",
81
+ "typescript-eslint": "^8.30.1",
82
+ "vite": "^6.3.5",
83
+ "vite-plugin-dts": "^4.5.4",
84
+ "vite-plugin-svgr": "^4.3.0",
85
+ "vitest": "^3.2.4"
53
86
  },
54
- "license": "MIT"
87
+ "peerDependencies": {
88
+ "@mantine/core": "^8.0.0",
89
+ "@mantine/dates": "^8.0.0",
90
+ "@mantine/hooks": "^8.0.0",
91
+ "react": ">=16.8.0",
92
+ "react-dom": ">=16.8.0"
93
+ }
55
94
  }
@@ -0,0 +1,174 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import {
3
+ Container,
4
+ Paper,
5
+ Title,
6
+ Text,
7
+ List,
8
+ Divider,
9
+ Group,
10
+ Code,
11
+ } from "@mantine/core";
12
+ import { Button } from "./components/Button/Button";
13
+
14
+ const OverStylingInfo = () => {
15
+ return (
16
+ <Container size="md" py="xl">
17
+ <Paper withBorder p="xl" radius="md">
18
+ <Title order={1} mb="md">
19
+ Over Styling (<Code>overStyled</Code>)
20
+ </Title>
21
+ <Text mb="md">
22
+ By default, all Recursica components are strictly sandboxed. This
23
+ means they are protected against arbitrary styling configurations
24
+ (like passing generic React <Code>style</Code> objects, custom{" "}
25
+ <Code>classNames</Code> injections, or using deep Mantine layout hooks
26
+ like <Code>bg</Code> and <Code>c</Code>). This strict compile-time and
27
+ run-time enforcement guarantees that your design system tokens remain
28
+ true across your application.
29
+ </Text>
30
+ <Text mb="md">
31
+ However, there may be edge cases where a developer absolutely must
32
+ modify a component beyond what the design tokens natively allow. For
33
+ this, we provide the <strong>escape hatch</strong> property:{" "}
34
+ <Code>overStyled={`{true}`}</Code>.
35
+ </Text>
36
+
37
+ <Title order={3} mb="sm">
38
+ The Core Philosophy
39
+ </Title>
40
+ <Text mb="sm">
41
+ **You should not over-style components.** Using{" "}
42
+ <Code>overStyled</Code> explicitly signifies that you are breaking
43
+ design system rules.
44
+ </Text>
45
+ <List mb="xl" type="ordered">
46
+ <List.Item>
47
+ <strong>Technical Debt:</strong> If over-styling is required, it
48
+ should be treated as a short-term workaround. Ideally, the component
49
+ will be refactored once the required layouts or variants are
50
+ officially integrated into the core Recursica component library.
51
+ </List.Item>
52
+ <List.Item>
53
+ <strong>Auditing & Searching:</strong> Because this pattern creates
54
+ technical debt, we enforce the explicit <Code>overStyled</Code>{" "}
55
+ boolean. This provides a highly auditable, easily searchable string.
56
+ Product managers and engineers can quickly grep the codebase for{" "}
57
+ <Code>overStyled</Code> (or the <Code>RecursicaOverStyled</Code>{" "}
58
+ typings) to hunt down components that don't match standard patterns.
59
+ </List.Item>
60
+ <List.Item>
61
+ <strong>Highly Custom Components:</strong> If your application
62
+ genuinely requires massive custom layouts that the UI kit cannot
63
+ support, <strong>do not hack the Recursica component</strong>.
64
+ Instead, it is highly encouraged that you import the underlying
65
+ primitive component directly from <Code>@mantine/core</Code> and
66
+ construct your independent feature there. While you can utilize raw
67
+ Recursica CSS variables on these custom components, note that they
68
+ are not guaranteed to be accurately maintained as Recursica evolves.
69
+ Keep strict components strict!
70
+ </List.Item>
71
+ </List>
72
+
73
+ <Divider mb="xl" />
74
+
75
+ <Title order={3} mb="sm">
76
+ Permitted Layout Properties
77
+ </Title>
78
+ <Text mb="sm">
79
+ Unlike deep styling bounds (colors, typography, padding, dimensions),
80
+ external <strong>layout spacing properties</strong> like Margins (
81
+ <Code>m</Code>, <Code>mt</Code>, <Code>mb</Code>, <Code>mx</Code>) are
82
+ safely <strong>permitted by default</strong>. This allows integrators
83
+ to structurally compose components alongside siblings without
84
+ breaching internal token boundaries.
85
+ </Text>
86
+ <Text mb="xl">
87
+ When using layout properties, you have the flexibility to use either
88
+ ecosystem seamlessly:
89
+ </Text>
90
+ <List mb="md" type="ordered">
91
+ <List.Item>
92
+ <strong>Mantine Core Values:</strong> Passing standard Mantine sizes
93
+ (like <Code>mt="md"</Code>) passes straight through to Mantine
94
+ natively, allowing you to interface completely normally with a
95
+ parent application's existing Mantine Theme setup that might fall
96
+ outside Recursica's scope.
97
+ </List.Item>
98
+ <List.Item>
99
+ <strong>Recursica Strict Tokens:</strong> Passing our custom
100
+ prefixed tokens (like <Code>mt="rec-md"</Code>) signals our internal
101
+ layout interceptor to securely translate the value directly to our
102
+ native <Code>recursica_brand_dimensions</Code> CSS variables. This
103
+ ensures strict design token measurements while sharing the exact
104
+ same prop interface!
105
+ </List.Item>
106
+ </List>
107
+ <Text mb="sm" fw={500}>
108
+ Available Recursica Layout Tokens:
109
+ </Text>
110
+ <List mb="xl" type="unordered">
111
+ <List.Item>
112
+ <Code>rec-none</Code> (0px limit)
113
+ </List.Item>
114
+ <List.Item>
115
+ <Code>rec-sm</Code> (0.5x scaling)
116
+ </List.Item>
117
+ <List.Item>
118
+ <Code>rec-default</Code> (1.0x scaling)
119
+ </List.Item>
120
+ <List.Item>
121
+ <Code>rec-md</Code> (1.5x scaling)
122
+ </List.Item>
123
+ <List.Item>
124
+ <Code>rec-lg</Code> (2.0x scaling)
125
+ </List.Item>
126
+ <List.Item>
127
+ <Code>rec-xl</Code> (3.0x scaling)
128
+ </List.Item>
129
+ <List.Item>
130
+ <Code>rec-2xl</Code> (4.0x scaling)
131
+ </List.Item>
132
+ </List>
133
+
134
+ <Divider mb="xl" />
135
+
136
+ <Title order={3} mb="md">
137
+ Live Example
138
+ </Title>
139
+ <Text mb="xl">
140
+ Below is a side-by-side comparison. The first is a standard Recursica
141
+ Button protected by the design tokens mapping. The second flagrantly
142
+ forces <Code>overStyled={`{true}`}</Code>, allowing Mantine's native
143
+ styling generics to punch right through the sandbox layout.
144
+ </Text>
145
+
146
+ <Group gap="xl">
147
+ <div>
148
+ <Text size="sm" c="dimmed" mb="xs">
149
+ Strict Baseline (Default)
150
+ </Text>
151
+ <Button variant="solid">Standard UI Kit Button</Button>
152
+ </div>
153
+ <div>
154
+ <Text size="sm" c="dimmed" mb="xs">
155
+ overStyled={`{true}`}
156
+ </Text>
157
+ <Button overStyled={true} bg="pink" c="black" radius="xl">
158
+ Unsafe Pink Marketing Button
159
+ </Button>
160
+ </div>
161
+ </Group>
162
+ </Paper>
163
+ </Container>
164
+ );
165
+ };
166
+
167
+ const meta: Meta<typeof OverStylingInfo> = {
168
+ title: "Introduction/Over Styling",
169
+ component: OverStylingInfo,
170
+ };
171
+
172
+ export default meta;
173
+
174
+ export const Default: StoryObj<typeof OverStylingInfo> = {};
@@ -0,0 +1,56 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import ReactMarkdown from "react-markdown";
3
+ import {
4
+ Container,
5
+ Paper,
6
+ Title,
7
+ TypographyStylesProvider,
8
+ Group,
9
+ Anchor,
10
+ Divider,
11
+ } from "@mantine/core";
12
+ import pkg from "../package.json";
13
+ import changelog from "../CHANGELOG.md?raw";
14
+
15
+ const VersionInfo = () => {
16
+ return (
17
+ <Container size="md" py="xl">
18
+ <Paper withBorder p="xl" radius="md">
19
+ <Title order={1} mb="xs">
20
+ Mantine Adapter v{pkg.version}
21
+ </Title>
22
+ <Group mb="xl" gap="md">
23
+ <Anchor
24
+ href="https://github.com/borderux/recursica"
25
+ target="_blank"
26
+ rel="noopener noreferrer"
27
+ >
28
+ GitHub Repository
29
+ </Anchor>
30
+ <Anchor
31
+ href="https://recursica.com"
32
+ target="_blank"
33
+ rel="noopener noreferrer"
34
+ >
35
+ Documentation & Website
36
+ </Anchor>
37
+ </Group>
38
+ <Divider mb="xl" />
39
+ <TypographyStylesProvider>
40
+ <ReactMarkdown>{changelog}</ReactMarkdown>
41
+ </TypographyStylesProvider>
42
+ </Paper>
43
+ </Container>
44
+ );
45
+ };
46
+
47
+ const meta: Meta<typeof VersionInfo> = {
48
+ title: "Introduction/Version Info",
49
+ component: VersionInfo,
50
+ };
51
+
52
+ export default meta;
53
+
54
+ type Story = StoryObj<typeof VersionInfo>;
55
+
56
+ export const Default: Story = {};
@@ -0,0 +1,48 @@
1
+ # Accordion – implementation notes
2
+
3
+ Decisions and design tweaks strictly tailored for the UI Kit's Accordion wrapped against `@mantine/core`. Use this when managing components possessing deeply nested state logic (e.g., active toggles, nested headers mapping external design properties).
4
+
5
+ ---
6
+
7
+ ## 1. Hybrid Composition API (Smart Rendering Flow)
8
+
9
+ **Decision:** We fundamentally maintain the exact library composition API structure (`<Accordion>`, `<Accordion.Item>`, `<Accordion.Control>`, `<Accordion.Panel>`) while actively supporting an auto-completing flattened prop schema matching the unified Recursica API (`title`, `leftIcon`, `divider`).
10
+ **Implementation:** Avoid rigid raw parameter dumps. Mantine dynamically injects explicit `id` logic, keyboard ARIA mapping, and focus tracking correctly across `Control` to `Panel` DOM connections natively. By exposing the hierarchical mapping 1:1, Recursica safely adopts these capabilities. However, to strictly support Recursica's unified prop mapping interface:
11
+
12
+ - **Auto-Construction:** If integrators natively pass `title` and/or `leftIcon` props into `<AccordionItem>`, the component structurally auto-generates the internal `AccordionControl` sub-wrappers mapping the text and SVG natively, whilst treating `children` implicitly as the Panel contents.
13
+ - **Graceful Falldown:** If `title` is heavily omitted, the node immediately falls backward into raw Mantine composability expecting integrators mapped `<Accordion.Control>` entirely manually.
14
+
15
+ ---
16
+
17
+ ## 2. Default Configuration Reset (`unstyled`)
18
+
19
+ **Decision:** We strip Mantine's inner styles away completely from Accordion mappings by leveraging React's default `variant="unstyled"`.
20
+ **Implementation:** In `Accordion.tsx`, `<MantineAccordion>` binds `variant="unstyled"`. This effectively deletes Mantine's precomputed padding, borders, and shadow mappings allowing our targeted `classNames` inside `Accordion.module.css` to become the exact source of foundational truth without "fighting" `!important` tags or unpredictable flex-layouts inherited globally.
21
+
22
+ ---
23
+
24
+ ## 3. Strict SVG Icons Wrapper (`.iconLeftWrapper`)
25
+
26
+ **Decision:** Identical logic enforced as seen within Buttons: SVG scales dynamically inside `.mantine-leftSection` based on SVGs internal definition boundaries potentially corrupting header gaps.
27
+ **Implementation:** `AccordionControl` captures `<span className={styles.iconLeftWrapper} aria-hidden>` forcing `object-fit: contain` mapped exactly to the `properties_icon-left-size` Recursica dimension token forcing integrator SVG overrides inline perfectly.
28
+
29
+ ---
30
+
31
+ ## 4. Transparent Global Hover Fixes
32
+
33
+ **Decision:** We nullify internal Mantine button hover actions and exclusively utilize Recursica's hover structure natively.
34
+ **Implementation:** We construct `.control::after` pseudo-objects dynamically pulling our `hover-color` & `hover-opacity` bindings. Mantine's native action sets `.control:hover { background-color: var(...) }` dynamically causing internal layer overlaps. We enforce `background-color: transparent` strictly overriding it, preserving our pseudo-overlay layer-cascade cleanly.
35
+
36
+ ---
37
+
38
+ ## 5. Active Target Hooks (`[data-active]`)
39
+
40
+ **Decision:** Collapsed and expanded state tracking requires separate background maps across `AccordionItem`.
41
+ **Implementation:** Rather than syncing React `useState` hooks matching `Accordion.value`, we defer to Mantine's inherent DOM mapping: `.item[data-active]` implicitly triggers exactly when Mantine registers an expansion state swap changing values down dynamically on the element layer, perfectly binding to `--recursica_..._background-expanded`.
42
+
43
+ ---
44
+
45
+ ## 6. Nullifying Isolated State Bounds (`open` boolean)
46
+
47
+ **Decision:** We do not bind isolated `open={true}` state properties natively on individual `<AccordionItem>` configurations.
48
+ **Implementation:** Recursica natively dictates an item-level `open` tracking mapping. However, internally mapping boolean flags structurally across specific tree nodes heavily corrupts Mantine's DOM layout algorithms mapping parent-driven transition listeners. Mantine forces all expanded-height logic to run symmetrically off the `<Accordion value="...">` string matching array to accurately bind ARIA transitions. We explicitly ignore isolated item `<AccordionItem open={...}>` booleans to shield the rendering sequence cleanly.