@recursica/mui-adapter 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/mui-adapter.cjs +74 -1
  3. package/dist/mui-adapter.cjs.map +1 -1
  4. package/dist/mui-adapter.css +1 -1
  5. package/dist/mui-adapter.js +6651 -201
  6. package/dist/mui-adapter.js.map +1 -1
  7. package/dist/src/components/Accordion/Accordion.d.ts +63 -2
  8. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +9 -2
  9. package/dist/src/components/Autocomplete/Autocomplete.d.ts +17 -0
  10. package/dist/src/components/Autocomplete/index.d.ts +1 -0
  11. package/dist/src/components/Avatar/Avatar.d.ts +14 -2
  12. package/dist/src/components/Badge/Badge.d.ts +13 -3
  13. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +10 -3
  14. package/dist/src/components/Button/Button.d.ts +1 -1
  15. package/dist/src/components/Card/Card.d.ts +40 -3
  16. package/dist/src/components/Checkbox/Checkbox.d.ts +15 -2
  17. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +16 -0
  18. package/dist/src/components/Checkbox/index.d.ts +5 -1
  19. package/dist/src/components/Chip/Chip.d.ts +18 -2
  20. package/dist/src/components/Dropdown/Dropdown.d.ts +23 -3
  21. package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +10 -2
  22. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +24 -2
  23. package/dist/src/components/HoverCard/HoverCard.d.ts +55 -3
  24. package/dist/src/components/Label/Label.d.ts +13 -2
  25. package/dist/src/components/Link/Link.d.ts +1 -1
  26. package/dist/src/components/Menu/Menu.d.ts +99 -3
  27. package/dist/src/components/Modal/Modal.d.ts +36 -2
  28. package/dist/src/components/NumberInput/NumberInput.d.ts +14 -2
  29. package/dist/src/components/Pagination/Pagination.d.ts +44 -2
  30. package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
  31. package/dist/src/components/Panel/Panel.d.ts +65 -3
  32. package/dist/src/components/Radio/Radio.d.ts +13 -3
  33. package/dist/src/components/Radio/RadioGroup.d.ts +13 -0
  34. package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
  35. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +7 -2
  36. package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
  37. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  38. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
  39. package/dist/src/components/ReadOnlyField/index.d.ts +1 -0
  40. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +31 -3
  41. package/dist/src/components/Slider/Slider.d.ts +28 -2
  42. package/dist/src/components/Stepper/Stepper.d.ts +21 -2
  43. package/dist/src/components/Switch/Switch.d.ts +10 -3
  44. package/dist/src/components/Switch/SwitchGroup.d.ts +13 -0
  45. package/dist/src/components/Tabs/Tabs.d.ts +35 -3
  46. package/dist/src/components/Text/Text.d.ts +1 -1
  47. package/dist/src/components/TextArea/TextArea.d.ts +18 -2
  48. package/dist/src/components/TextField/TextField.d.ts +16 -2
  49. package/dist/src/components/Timeline/Timeline.d.ts +14 -2
  50. package/dist/src/components/Timeline/TimelineItem.d.ts +29 -0
  51. package/dist/src/components/Title/Title.d.ts +1 -1
  52. package/dist/src/components/Toast/Toast.d.ts +25 -2
  53. package/dist/src/components/Tooltip/Tooltip.d.ts +42 -3
  54. package/dist/src/components/Typography/Typography.d.ts +1 -1
  55. package/dist/src/components/index.d.ts +1 -0
  56. package/package.json +12 -2
  57. package/src/GlobalExemptions.modules.css +13 -0
  58. package/src/components/Accordion/Accordion.module.css +295 -0
  59. package/src/components/Accordion/Accordion.stories.tsx +149 -21
  60. package/src/components/Accordion/Accordion.tsx +264 -4
  61. package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
  62. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +76 -19
  63. package/src/components/AssistiveElement/AssistiveElement.tsx +85 -4
  64. package/src/components/Autocomplete/Autocomplete.module.css +325 -0
  65. package/src/components/Autocomplete/Autocomplete.stories.tsx +196 -0
  66. package/src/components/Autocomplete/Autocomplete.tsx +201 -0
  67. package/src/components/Autocomplete/index.ts +1 -0
  68. package/src/components/Avatar/Avatar.module.css +344 -0
  69. package/src/components/Avatar/Avatar.stories.tsx +94 -22
  70. package/src/components/Avatar/Avatar.tsx +110 -5
  71. package/src/components/Badge/Badge.module.css +127 -0
  72. package/src/components/Badge/Badge.stories.tsx +65 -22
  73. package/src/components/Badge/Badge.tsx +70 -5
  74. package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
  75. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +57 -22
  76. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -5
  77. package/src/components/Button/Button.module.css +113 -20
  78. package/src/components/Button/Button.stories.tsx +3 -0
  79. package/src/components/Button/Button.tsx +10 -3
  80. package/src/components/Card/Card.module.css +118 -0
  81. package/src/components/Card/Card.stories.tsx +117 -19
  82. package/src/components/Card/Card.tsx +179 -4
  83. package/src/components/Checkbox/Checkbox.module.css +232 -0
  84. package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
  85. package/src/components/Checkbox/Checkbox.tsx +146 -4
  86. package/src/components/Checkbox/CheckboxGroup.tsx +117 -0
  87. package/src/components/Checkbox/index.ts +6 -1
  88. package/src/components/Chip/Chip.module.css +236 -0
  89. package/src/components/Chip/Chip.stories.tsx +101 -21
  90. package/src/components/Chip/Chip.tsx +138 -5
  91. package/src/components/DatePicker/DatePicker.module.css +42 -0
  92. package/src/components/DatePicker/DatePicker.tsx +1 -0
  93. package/src/components/Dropdown/Dropdown.module.css +296 -0
  94. package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
  95. package/src/components/Dropdown/Dropdown.tsx +182 -5
  96. package/src/components/FileInput/FileInput.module.css +47 -0
  97. package/src/components/FileInput/FileInput.tsx +1 -0
  98. package/src/components/FileUpload/FileUpload.module.css +40 -0
  99. package/src/components/FileUpload/FileUpload.tsx +1 -0
  100. package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
  101. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +74 -19
  102. package/src/components/FormControlLayout/FormControlLayout.tsx +58 -4
  103. package/src/components/FormControlWrapper/FormControlWrapper.module.css +96 -0
  104. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +122 -19
  105. package/src/components/FormControlWrapper/FormControlWrapper.tsx +145 -6
  106. package/src/components/HoverCard/HoverCard.module.css +91 -0
  107. package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
  108. package/src/components/HoverCard/HoverCard.tsx +150 -4
  109. package/src/components/Label/Label.module.css +136 -0
  110. package/src/components/Label/Label.stories.tsx +98 -17
  111. package/src/components/Label/Label.tsx +88 -4
  112. package/src/components/Link/Link.module.css +8 -0
  113. package/src/components/Menu/Menu.module.css +287 -0
  114. package/src/components/Menu/Menu.stories.tsx +307 -21
  115. package/src/components/Menu/Menu.tsx +318 -4
  116. package/src/components/Modal/Modal.module.css +172 -0
  117. package/src/components/Modal/Modal.stories.tsx +66 -22
  118. package/src/components/Modal/Modal.tsx +216 -3
  119. package/src/components/NumberInput/NumberInput.module.css +281 -0
  120. package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
  121. package/src/components/NumberInput/NumberInput.tsx +148 -5
  122. package/src/components/Pagination/Pagination.icons.tsx +66 -0
  123. package/src/components/Pagination/Pagination.module.css +307 -0
  124. package/src/components/Pagination/Pagination.stories.tsx +42 -21
  125. package/src/components/Pagination/Pagination.tsx +193 -4
  126. package/src/components/Panel/Panel.module.css +206 -0
  127. package/src/components/Panel/Panel.stories.tsx +214 -22
  128. package/src/components/Panel/Panel.tsx +153 -4
  129. package/src/components/Radio/Radio.module.css +220 -0
  130. package/src/components/Radio/Radio.stories.tsx +77 -19
  131. package/src/components/Radio/Radio.tsx +178 -4
  132. package/src/components/Radio/RadioGroup.tsx +111 -0
  133. package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
  134. package/src/components/ReadOnlyField/ReadOnlyField.module.css +54 -0
  135. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +175 -16
  136. package/src/components/ReadOnlyField/ReadOnlyField.tsx +109 -4
  137. package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
  138. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
  139. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
  140. package/src/components/ReadOnlyField/index.ts +1 -0
  141. package/src/components/SegmentedControl/SegmentedControl.module.css +203 -0
  142. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
  143. package/src/components/SegmentedControl/SegmentedControl.tsx +110 -5
  144. package/src/components/Slider/Slider.module.css +542 -0
  145. package/src/components/Slider/Slider.stories.tsx +157 -19
  146. package/src/components/Slider/Slider.tsx +282 -4
  147. package/src/components/Stepper/Stepper.module.css +410 -0
  148. package/src/components/Stepper/Stepper.stories.tsx +132 -19
  149. package/src/components/Stepper/Stepper.tsx +145 -5
  150. package/src/components/Switch/Switch.module.css +238 -0
  151. package/src/components/Switch/Switch.stories.tsx +98 -19
  152. package/src/components/Switch/Switch.tsx +153 -5
  153. package/src/components/Switch/SwitchGroup.tsx +111 -0
  154. package/src/components/Tabs/Tabs.module.css +422 -0
  155. package/src/components/Tabs/Tabs.stories.tsx +138 -19
  156. package/src/components/Tabs/Tabs.tsx +103 -5
  157. package/src/components/TextArea/TextArea.module.css +160 -0
  158. package/src/components/TextArea/TextArea.stories.tsx +80 -21
  159. package/src/components/TextArea/TextArea.tsx +156 -5
  160. package/src/components/TextField/TextField.module.css +266 -0
  161. package/src/components/TextField/TextField.stories.tsx +168 -15
  162. package/src/components/TextField/TextField.tsx +171 -5
  163. package/src/components/TimePicker/TimePicker.module.css +41 -0
  164. package/src/components/TimePicker/TimePicker.tsx +1 -0
  165. package/src/components/Timeline/Timeline.module.css +367 -0
  166. package/src/components/Timeline/Timeline.stories.tsx +114 -21
  167. package/src/components/Timeline/Timeline.tsx +80 -4
  168. package/src/components/Timeline/TimelineItem.tsx +101 -0
  169. package/src/components/Toast/Toast.module.css +170 -0
  170. package/src/components/Toast/Toast.stories.tsx +54 -22
  171. package/src/components/Toast/Toast.tsx +90 -4
  172. package/src/components/Tooltip/Tooltip.module.css +90 -0
  173. package/src/components/Tooltip/Tooltip.stories.tsx +152 -22
  174. package/src/components/Tooltip/Tooltip.tsx +114 -4
  175. package/src/components/TransferList/TransferList.module.css +38 -0
  176. package/src/components/TransferList/TransferList.tsx +1 -0
  177. package/src/components/index.ts +1 -0
@@ -14,7 +14,7 @@ export declare const Typography: React.ForwardRefExoticComponent<(Omit<Omit<Omit
14
14
  */
15
15
  typographyClass: string;
16
16
  component?: React.ElementType;
17
- }, "style" | "className" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "bgcolor" | "color" | "zIndex" | "position" | "boxShadow" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "backgroundColor" | "sx"> & import('../../utils/filterStylingProps').ForbiddenStyles & {
17
+ }, "className" | "classes" | "style" | "sx" | "color" | "bgcolor" | "backgroundColor" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textAlign" | "border" | "borderTop" | "borderBottom" | "borderLeft" | "borderRight" | "borderColor" | "borderRadius" | "boxShadow" | "display" | "position" | "zIndex"> & import('../../utils/filterStylingProps').ForbiddenStyles & {
18
18
  overStyled?: false | undefined;
19
19
  }, "ref"> | Omit<Omit<MuiTypographyProps, "variant"> & {
20
20
  /**
@@ -1,5 +1,6 @@
1
1
  export * from './Accordion';
2
2
  export * from './AssistiveElement';
3
+ export * from './Autocomplete';
3
4
  export * from './Avatar';
4
5
  export * from './Badge';
5
6
  export * from './Box';
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/borderux/recursica.git",
14
14
  "directory": "packages/mui-adapter"
15
15
  },
16
- "version": "0.4.0",
16
+ "version": "0.6.0",
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
@@ -51,14 +51,18 @@
51
51
  "build": "vite build --mode library",
52
52
  "build-storybook": "storybook build -o storybook-static",
53
53
  "lint": "eslint .",
54
- "storybook": "storybook dev -p 6006"
54
+ "storybook": "storybook dev -p 6012",
55
+ "analyze-tokens": "analyze-tokens --css recursica_variables_scoped.css --dir src/components --output token-analysis.json",
56
+ "prebuild": "npm run analyze-tokens"
55
57
  },
56
58
  "devDependencies": {
57
59
  "@chromatic-com/storybook": "^5.1.1",
58
60
  "@eslint/js": "^9.25.0",
61
+ "@mui/lab": "^7.0.1-beta.25",
59
62
  "@recursica/adapter-common": "*",
60
63
  "@recursica/recursica-postcss-vars": "*",
61
64
  "@recursica/storybook-template": "*",
65
+ "@recursica/token-analyzer": "*",
62
66
  "@repo/typescript-config": "*",
63
67
  "@storybook/addon-a11y": "^10.3.3",
64
68
  "@storybook/addon-docs": "^10.3.3",
@@ -93,8 +97,14 @@
93
97
  "peerDependencies": {
94
98
  "@emotion/react": "^11.14.0",
95
99
  "@emotion/styled": "^11.14.0",
100
+ "@mui/lab": "^7.0.1-beta.25",
96
101
  "@mui/material": "^7.3.0",
97
102
  "react": ">=16.8.0",
98
103
  "react-dom": ">=16.8.0"
104
+ },
105
+ "peerDependenciesMeta": {
106
+ "@mui/lab": {
107
+ "optional": true
108
+ }
99
109
  }
100
110
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * GLOBAL EXEMPTIONS
3
+ *
4
+ * This file hosts global, brand, and layout variables that are defined in
5
+ * recursica_variables_scoped.css but are not used by any specific component.
6
+ * Isolating them here keeps individual component stylesheets clean and focused.
7
+ */
8
+
9
+ /* ==== GLOBAL ICON STYLE ====
10
+ Global layout option specifying the overall SVG rendering style (solid/outline).
11
+ Note to Forge Devs: style is not a CSS property or variable type and cannot be applied in standard CSS stylesheets.
12
+ This variable is ignored in the UI adapters and should be reviewed by the Forge team. */
13
+ /* recursica-ignore: --recursica_ui-kit_globals_icon_style */
@@ -0,0 +1,295 @@
1
+ /* ==== ACCORDION CONTAINER ==== */
2
+ .root {
3
+ box-sizing: border-box;
4
+ margin: 0;
5
+ display: flex;
6
+ flex-direction: column;
7
+
8
+ border-style: solid;
9
+ border-width: var(
10
+ --recursica_ui-kit_components_accordion_properties_border-size
11
+ );
12
+ border-radius: var(
13
+ --recursica_ui-kit_components_accordion_properties_border-radius
14
+ );
15
+ border-color: var(
16
+ --recursica_ui-kit_components_accordion_properties_colors_border-color
17
+ );
18
+ background-color: var(
19
+ --recursica_ui-kit_components_accordion_properties_colors_background
20
+ );
21
+ box-shadow: var(--recursica_ui-kit_components_accordion_properties_elevation);
22
+
23
+ max-width: var(--recursica_ui-kit_components_accordion_properties_max-width);
24
+ min-width: var(--recursica_ui-kit_components_accordion_properties_min-width);
25
+ padding: var(--recursica_ui-kit_components_accordion_properties_padding);
26
+
27
+ /* Ensure gaps between items */
28
+ gap: var(--recursica_ui-kit_components_accordion_properties_item-gap);
29
+ }
30
+
31
+ /* ==== ACCORDION ITEM ==== */
32
+ .item {
33
+ box-sizing: border-box;
34
+ margin: 0;
35
+ position: relative;
36
+ transition: all 0.2s ease;
37
+
38
+ /* Overriding Mantine Default Borders natively */
39
+ border-bottom: none;
40
+
41
+ border-style: solid;
42
+ border-color: var(
43
+ --recursica_ui-kit_components_accordion-item_properties_colors_item-border-color
44
+ );
45
+ border-width: var(
46
+ --recursica_ui-kit_components_accordion-item_properties_item-border-size
47
+ );
48
+ border-bottom-color: var(
49
+ --recursica_ui-kit_components_accordion_properties_colors_divider
50
+ );
51
+ border-bottom-width: var(
52
+ --recursica_ui-kit_components_accordion_properties_divider-size
53
+ );
54
+ border-radius: var(
55
+ --recursica_ui-kit_components_accordion-item_properties_border-radius
56
+ );
57
+ box-shadow: var(
58
+ --recursica_ui-kit_components_accordion-item_properties_elevation-item
59
+ );
60
+
61
+ background-color: var(
62
+ --recursica_ui-kit_components_accordion-item_properties_colors_background-collapsed
63
+ );
64
+ }
65
+ .item:global(.Mui-expanded) {
66
+ background-color: var(
67
+ --recursica_ui-kit_components_accordion-item_properties_colors_background-expanded
68
+ );
69
+ }
70
+ .noDivider {
71
+ border-bottom: none !important;
72
+ border-bottom-width: 0 !important;
73
+ }
74
+
75
+ /* ==== ACCORDION CONTROL (HEADER) ==== */
76
+ .control {
77
+ box-sizing: border-box;
78
+ width: 100%;
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: space-between;
82
+
83
+ /* Re-apply gap defined by UI Kit for icons vs text */
84
+ gap: var(--recursica_ui-kit_components_accordion-item_properties_icon-gap);
85
+
86
+ /* Strip Mantine's baked padding directly */
87
+ padding: var(
88
+ --recursica_ui-kit_components_accordion-item_properties_header-vertical-padding
89
+ )
90
+ var(
91
+ --recursica_ui-kit_components_accordion-item_properties_header-horizontal-padding
92
+ );
93
+ background-color: transparent;
94
+
95
+ transition: background-color 0.15s ease;
96
+ position: relative;
97
+ z-index: 1;
98
+ color: var(
99
+ --recursica_ui-kit_components_accordion-item_properties_colors_text
100
+ );
101
+
102
+ /* Header Typography */
103
+ font-family: var(
104
+ --recursica_ui-kit_components_accordion-item_properties_header-text_font-family
105
+ );
106
+ font-size: var(
107
+ --recursica_ui-kit_components_accordion-item_properties_header-text_font-size
108
+ );
109
+ font-weight: var(
110
+ --recursica_ui-kit_components_accordion-item_properties_header-text_font-weight
111
+ );
112
+ font-style: var(
113
+ --recursica_ui-kit_components_accordion-item_properties_header-text_font-style
114
+ );
115
+ letter-spacing: var(
116
+ --recursica_ui-kit_components_accordion-item_properties_header-text_letter-spacing
117
+ );
118
+ line-height: var(
119
+ --recursica_ui-kit_components_accordion-item_properties_header-text_line-height
120
+ );
121
+ text-decoration: var(
122
+ --recursica_ui-kit_components_accordion-item_properties_header-text_text-decoration
123
+ );
124
+ text-transform: var(
125
+ --recursica_ui-kit_components_accordion-item_properties_header-text_text-transform
126
+ );
127
+ }
128
+
129
+ /* Ensure inner native wrap aligns and has zero margins */
130
+ .control :global(.MuiAccordionSummary-content) {
131
+ margin: 0 !important;
132
+ display: flex;
133
+ align-items: center;
134
+ gap: inherit;
135
+ flex: 1;
136
+ }
137
+
138
+ .control :global(.MuiAccordionSummary-content.Mui-expanded) {
139
+ margin: 0 !important;
140
+ }
141
+
142
+ /* Mantine natively places hover states on the control node.
143
+ We explicitly override it with our layer hover tokens via an overlay ::after structure
144
+ so we can cleanly utilize the hover-opacity token! */
145
+ .control:hover {
146
+ background-color: transparent;
147
+ }
148
+ .control::after {
149
+ content: "";
150
+ position: absolute;
151
+ inset: 0;
152
+ border-radius: inherit;
153
+ z-index: -1;
154
+ pointer-events: none;
155
+ background-color: var(
156
+ --recursica_ui-kit_components_accordion-item_properties_hover-color
157
+ );
158
+ opacity: 0;
159
+ transition: opacity 150ms ease;
160
+ }
161
+ .control:hover:not(:disabled)::after {
162
+ opacity: var(
163
+ --recursica_ui-kit_components_accordion-item_properties_hover-opacity,
164
+ 0.1
165
+ );
166
+ }
167
+
168
+ /* Label logic inside the Control wrapper */
169
+ .label {
170
+ flex: 1;
171
+ text-align: left;
172
+ color: inherit;
173
+ padding: 0; /* Clear Mantine inner padding */
174
+ }
175
+
176
+ /* ==== CHEVRON / RIGHT ICON ==== */
177
+ .chevron {
178
+ flex-shrink: 0;
179
+ width: var(
180
+ --recursica_ui-kit_components_accordion-item_properties_icon-right-size
181
+ );
182
+ height: var(
183
+ --recursica_ui-kit_components_accordion-item_properties_icon-right-size
184
+ );
185
+ color: var(
186
+ --recursica_ui-kit_components_accordion-item_properties_colors_icon
187
+ );
188
+ margin: 0;
189
+ transition: transform 200ms ease;
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: center;
193
+ }
194
+ .chevron > * {
195
+ width: 100%;
196
+ height: 100%;
197
+ object-fit: contain;
198
+ }
199
+ .item:global(.Mui-expanded) .chevron {
200
+ transform: rotate(180deg);
201
+ }
202
+
203
+ /* ==== LEFT ICON / CUSTOM ICONS ==== */
204
+ .iconLeftWrapper {
205
+ flex-shrink: 0;
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ width: var(
210
+ --recursica_ui-kit_components_accordion-item_properties_icon-left-size
211
+ );
212
+ height: var(
213
+ --recursica_ui-kit_components_accordion-item_properties_icon-left-size
214
+ );
215
+ color: var(
216
+ --recursica_ui-kit_components_accordion-item_properties_colors_icon
217
+ );
218
+ }
219
+ .iconLeftWrapper > * {
220
+ width: 100%;
221
+ height: 100%;
222
+ object-fit: contain;
223
+ }
224
+
225
+ /* ==== ACCORDION PANEL (CONTENT) ==== */
226
+ .panel {
227
+ box-sizing: border-box;
228
+ margin: var(
229
+ --recursica_ui-kit_components_accordion-item_properties_content-margin
230
+ );
231
+ padding: 0; /* Overriding dynamic layout structure */
232
+ background-color: var(
233
+ --recursica_ui-kit_components_accordion-item_properties_colors_content-background
234
+ );
235
+ border-style: solid;
236
+ border-color: var(
237
+ --recursica_ui-kit_components_accordion-item_properties_colors_content-border-color
238
+ );
239
+ border-width: var(
240
+ --recursica_ui-kit_components_accordion-item_properties_content-border-size
241
+ );
242
+ border-radius: var(
243
+ --recursica_ui-kit_components_accordion-item_properties_content-border-radius
244
+ );
245
+ box-shadow: var(
246
+ --recursica_ui-kit_components_accordion-item_properties_elevation-content
247
+ );
248
+ }
249
+
250
+ .content {
251
+ box-sizing: border-box;
252
+ /* Strip Mantine padding and apply logic directly mapped */
253
+ padding: 0
254
+ var(
255
+ --recursica_ui-kit_components_accordion-item_properties_content-horizontal-padding
256
+ )
257
+ var(
258
+ --recursica_ui-kit_components_accordion-item_properties_content-bottom-padding
259
+ );
260
+
261
+ /* Apply offset gap explicitly calculated below header */
262
+ padding-top: var(
263
+ --recursica_ui-kit_components_accordion-item_properties_content-top-padding
264
+ );
265
+
266
+ color: var(
267
+ --recursica_ui-kit_components_accordion-item_properties_colors_content-text
268
+ );
269
+
270
+ /* Content Typography */
271
+ font-family: var(
272
+ --recursica_ui-kit_components_accordion-item_properties_content-text_font-family
273
+ );
274
+ font-size: var(
275
+ --recursica_ui-kit_components_accordion-item_properties_content-text_font-size
276
+ );
277
+ font-weight: var(
278
+ --recursica_ui-kit_components_accordion-item_properties_content-text_font-weight
279
+ );
280
+ font-style: var(
281
+ --recursica_ui-kit_components_accordion-item_properties_content-text_font-style
282
+ );
283
+ letter-spacing: var(
284
+ --recursica_ui-kit_components_accordion-item_properties_content-text_letter-spacing
285
+ );
286
+ line-height: var(
287
+ --recursica_ui-kit_components_accordion-item_properties_content-text_line-height
288
+ );
289
+ text-decoration: var(
290
+ --recursica_ui-kit_components_accordion-item_properties_content-text_text-decoration
291
+ );
292
+ text-transform: var(
293
+ --recursica_ui-kit_components_accordion-item_properties_content-text_text-transform
294
+ );
295
+ }
@@ -1,35 +1,163 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Accordion } from "./Accordion";
3
- import { ComingSoon } from "@recursica/storybook-template";
3
+ import { Layer } from "@recursica/adapter-common";
4
+
5
+ const SVGIcon = () => (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width="24"
9
+ height="24"
10
+ viewBox="0 0 24 24"
11
+ fill="none"
12
+ stroke="currentColor"
13
+ strokeWidth="2"
14
+ strokeLinecap="round"
15
+ strokeLinejoin="round"
16
+ >
17
+ <path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
18
+ </svg>
19
+ );
20
+
21
+ const ChevronIcon = () => (
22
+ <svg
23
+ width="24"
24
+ height="24"
25
+ viewBox="0 0 24 24"
26
+ fill="none"
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ >
29
+ <path
30
+ d="M20.0306 9.53062L12.5306 17.0306C12.461 17.1003 12.3783 17.1557 12.2872 17.1934C12.1962 17.2312 12.0986 17.2506 12 17.2506C11.9014 17.2506 11.8038 17.2312 11.7128 17.1934C11.6218 17.1557 11.539 17.1003 11.4694 17.0306L3.96938 9.53062C3.82865 9.38988 3.74959 9.19901 3.74959 8.99999C3.74959 8.80097 3.82865 8.61009 3.96938 8.46936C4.11011 8.32863 4.30098 8.24957 4.50001 8.24957C4.69903 8.24957 4.8899 8.32863 5.03063 8.46936L12 15.4397L18.9694 8.46936C19.0391 8.39968 19.1218 8.34441 19.2128 8.30669C19.3039 8.26898 19.4015 8.24957 19.5 8.24957C19.5986 8.24957 19.6961 8.26898 19.7872 8.30669C19.8782 8.34441 19.9609 8.39968 20.0306 8.46936C20.1003 8.53905 20.1556 8.62177 20.1933 8.71282C20.231 8.80386 20.2504 8.90144 20.2504 8.99999C20.2504 9.09854 20.231 9.19612 20.1933 9.28716C20.1556 9.37821 20.1003 9.46093 20.0306 9.53062Z"
31
+ fill="currentColor"
32
+ />
33
+ </svg>
34
+ );
4
35
 
5
36
  const meta: Meta<typeof Accordion> = {
6
- title: "UI-Kit/🚧 Accordion",
37
+ title: "UI-Kit/Accordion",
7
38
  component: Accordion,
8
39
  tags: ["autodocs"],
9
40
  parameters: {
10
- controls: {
11
- include: [
12
- "layer",
13
- "withLayer",
14
- "children",
15
- "component",
16
- "variant",
17
- "size",
18
- "icon",
19
- "disabled",
20
- "href",
21
- "onClick",
22
- "onChange",
23
- "value",
24
- "checked",
25
- ],
41
+ docs: {
42
+ description: {
43
+ component: `
44
+ The \`Accordion\` component intelligently wraps \`@mantine/core\`'s underlying Accordion layers while applying strict native design system mapping via \`recursica_variables_scoped.css\`.
45
+
46
+ ### Hybrid Composition API (Smart-Rendering)
47
+ To maximize flexibility while strictly aligning with the explicit Recursica design logic, the \`AccordionItem\` operates utilizing a **Hybrid Smart-Rendering Flow**:
48
+
49
+ 1. **Auto-Construction (Explicit Mapping)**:
50
+ If you supply the explicitly outlined Recursica properties (\`title\`, \`leftIcon\`) directly onto \`<Accordion.Item>\`, the component auto-generates the necessary \`<Accordion.Control>\` DOM layer inherently bridging the icons and titles visually while leaving the raw \`children\` wrapped neatly as the \`<Accordion.Panel>\`.
51
+
52
+ 2. **Graceful Falldown (Raw Composability)**:
53
+ If you deliberately omit the \`title\` property, the entire mapping system gracefully falls backward yielding exactly to the raw \`@mantine/core\` composition model. Under this context, you must inject your localized \`<Accordion.Control>\` and \`<Accordion.Panel>\` configurations completely manually.
54
+
55
+ ### Architecture Warning (\`open\`)
56
+ To structurally protect the parent wrapper's core transitions tracking architecture (\`<Accordion value="...">\`), this configuration explicitly rejects mapping isolated \`open={true}\` object states natively on specific configurations. Use Mantine's inherent sibling arrays matching the corresponding active value map!
57
+ `,
58
+ },
26
59
  },
27
60
  },
28
61
  };
29
62
 
30
63
  export default meta;
31
- type Story = StoryObj<typeof Accordion>;
32
64
 
33
- export const Default: Story = {
34
- render: () => <ComingSoon componentName="Accordion" />,
65
+ export const Default: StoryObj<typeof Accordion> = {
66
+ render: () => {
67
+ return (
68
+ <Layer layer={0} style={{ padding: "24px" }}>
69
+ <Accordion defaultValue="item-1" chevron={<ChevronIcon />}>
70
+ <Accordion.Item value="item-1">
71
+ <Accordion.Control>Billing and Membership</Accordion.Control>
72
+ <Accordion.Panel>
73
+ You can manage your billing directly from the dashboard tab. All
74
+ payments are processed automatically.
75
+ </Accordion.Panel>
76
+ </Accordion.Item>
77
+
78
+ <Accordion.Item value="item-2">
79
+ <Accordion.Control>Refund Policy</Accordion.Control>
80
+ <Accordion.Panel>
81
+ We offer a 30-day money-back guarantee for all new subscriptions.
82
+ </Accordion.Panel>
83
+ </Accordion.Item>
84
+
85
+ <Accordion.Item value="item-3">
86
+ <Accordion.Control>Technical Support</Accordion.Control>
87
+ <Accordion.Panel>
88
+ Our support team is available 24/7 via live chat or email.
89
+ </Accordion.Panel>
90
+ </Accordion.Item>
91
+ </Accordion>
92
+ </Layer>
93
+ );
94
+ },
95
+ };
96
+
97
+ export const WithIcons: StoryObj<typeof Accordion> = {
98
+ render: () => {
99
+ return (
100
+ <Layer layer={0} style={{ padding: "24px" }}>
101
+ <Accordion defaultValue="security" chevron={<ChevronIcon />}>
102
+ <Accordion.Item value="security">
103
+ <Accordion.Control leftIcon={<SVGIcon />}>
104
+ Security Settings
105
+ </Accordion.Control>
106
+ <Accordion.Panel>
107
+ Enable two-factor authentication (2FA) and monitor active sessions
108
+ below.
109
+ </Accordion.Panel>
110
+ </Accordion.Item>
111
+
112
+ <Accordion.Item value="privacy">
113
+ <Accordion.Control leftIcon={<SVGIcon />}>
114
+ Privacy Configuration
115
+ </Accordion.Control>
116
+ <Accordion.Panel>
117
+ Choose what data is shared with our analytics partners.
118
+ </Accordion.Panel>
119
+ </Accordion.Item>
120
+ </Accordion>
121
+ </Layer>
122
+ );
123
+ },
124
+ };
125
+
126
+ export const LayerOne: StoryObj<typeof Accordion> = {
127
+ render: () => {
128
+ return (
129
+ <Layer layer={1} style={{ padding: "24px" }}>
130
+ <Accordion defaultValue="demo" chevron={<ChevronIcon />}>
131
+ <Accordion.Item value="demo">
132
+ <Accordion.Control leftIcon={<SVGIcon />}>
133
+ Layer 1 Render Engine
134
+ </Accordion.Control>
135
+ <Accordion.Panel>
136
+ This Accordion dynamically updates its colors, borders, and
137
+ typography variables because it is wrapped securely by the
138
+ simulated `data-recursica-layer="1"`.
139
+ </Accordion.Panel>
140
+ </Accordion.Item>
141
+ </Accordion>
142
+ </Layer>
143
+ );
144
+ },
145
+ };
146
+
147
+ export const Docs: StoryObj<typeof Accordion> = {
148
+ render: () => {
149
+ return (
150
+ <Layer layer={0} style={{ padding: "24px" }}>
151
+ <Accordion defaultValue="docs-1">
152
+ <Accordion.Item value="docs-1">
153
+ <Accordion.Control>Documentation Content</Accordion.Control>
154
+ <Accordion.Panel>
155
+ This is the explicitly requested Docs story for automated layout
156
+ testing.
157
+ </Accordion.Panel>
158
+ </Accordion.Item>
159
+ </Accordion>
160
+ </Layer>
161
+ );
162
+ },
35
163
  };