@recursica/mantine-adapter 0.35.1 → 0.36.1
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.
- package/CHANGELOG.md +23 -0
- package/README.md +3 -3
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +1104 -1023
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Tree/Tree.d.ts +9 -5
- package/docs/PHILOSOPHY.md +39 -0
- package/package.json +3 -2
- package/src/components/Accordion/Accordion.module.css +123 -62
- package/src/components/Accordion/Accordion.stories.tsx +65 -33
- package/src/components/Accordion/Accordion.tsx +1 -0
- package/src/components/AutoComplete/AutoComplete.module.css +50 -49
- package/src/components/AutoComplete/AutoComplete.tsx +2 -2
- package/src/components/Avatar/Avatar.module.css +7 -7
- package/src/components/Badge/Badge.module.css +8 -8
- package/src/components/Button/Button.module.css +22 -89
- package/src/components/Card/Card.module.css +3 -3
- package/src/components/Checkbox/Checkbox.module.css +54 -15
- package/src/components/Chip/Chip.module.css +27 -26
- package/src/components/DatePicker/DatePicker.module.css +25 -30
- package/src/components/Dropdown/Dropdown.module.css +47 -44
- package/src/components/Dropdown/Dropdown.tsx +2 -2
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +12 -12
- package/src/components/HoverCard/HoverCard.module.css +1 -1
- package/src/components/Label/Label.module.css +7 -3
- package/src/components/Link/IMPLEMENTATION_NOTES.md +2 -9
- package/src/components/Link/Link.module.css +15 -76
- package/src/components/Link/USAGE.md +2 -9
- package/src/components/Loader/Loader.module.css +3 -3
- package/src/components/Menu/Menu.module.css +34 -41
- package/src/components/Modal/Modal.module.css +27 -11
- package/src/components/NumberInput/NumberInput.module.css +39 -37
- package/src/components/NumberInput/NumberInput.tsx +2 -2
- package/src/components/Pagination/Pagination.module.css +10 -43
- package/src/components/Panel/Panel.module.css +3 -3
- package/src/components/Popover/Popover.module.css +1 -1
- package/src/components/Radio/Radio.module.css +31 -14
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +1 -1
- package/src/components/SegmentedControl/SegmentedControl.module.css +29 -29
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +9 -0
- package/src/components/Slider/Slider.module.css +44 -48
- package/src/components/Stepper/Stepper.module.css +3 -3
- package/src/components/Switch/Switch.module.css +26 -10
- package/src/components/Table/Table.module.css +53 -21
- package/src/components/Tabs/Tabs.module.css +309 -170
- package/src/components/TextArea/TextArea.module.css +36 -21
- package/src/components/TextArea/TextArea.tsx +2 -2
- package/src/components/TextField/TextField.module.css +38 -35
- package/src/components/TextField/TextField.tsx +2 -2
- package/src/components/Timeline/Timeline.module.css +41 -34
- package/src/components/Toast/Toast.module.css +19 -11
- package/src/components/Tooltip/Tooltip.module.css +4 -2
- package/src/components/Tree/IMPLEMENTATION_NOTES.md +17 -0
- package/src/components/Tree/Tree.module.css +173 -39
- package/src/components/Tree/Tree.stories.tsx +81 -4
- package/src/components/Tree/Tree.tsx +117 -15
- package/src/components/Tree/USAGE.md +36 -3
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { RecursicaOverStyled } from '../../utils/filterStylingProps';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
import { RecursicaTreeProps } from '@recursica/adapter-common';
|
|
4
|
+
export type TreeProps = RecursicaOverStyled<RecursicaTreeProps & Omit<React.ComponentPropsWithoutRef<"ul">, "children">>;
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* Recursively renders hierarchical `data` as an expandable/selectable tree.
|
|
7
|
+
*
|
|
8
|
+
* **Recursica Abstract:**
|
|
9
|
+
* Wraps Mantine's `Tree` with a fully custom node renderer so every visual aspect (row box
|
|
10
|
+
* model, selected/unselected colors and typography, indent, item spacing) comes from
|
|
11
|
+
* Recursica's `tree` design tokens rather than Mantine's defaults.
|
|
8
12
|
*/
|
|
9
|
-
export declare const Tree: React.ForwardRefExoticComponent<
|
|
13
|
+
export declare const Tree: React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<HTMLUListElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Recursica Mantine Adapter: Core Philosophy
|
|
2
|
+
|
|
3
|
+
Recursica's component architecture isn't just a wrapper; it's a strict enforcing layer over Mantine's massive API surface. Our primary goal is to ensure consistency, eliminate "design system rot," and provide clear boundaries for application developers using the UI Kit.
|
|
4
|
+
|
|
5
|
+
This document serves as the governing framework for why the `mantine-adapter` components are built the way they are.
|
|
6
|
+
|
|
7
|
+
## 1. Strict Separation of Props (The Unified Recursica Prop Layer)
|
|
8
|
+
|
|
9
|
+
Recursica has a **single universal API surface** internally regardless of whether we use Mantine or another underlying UI library.
|
|
10
|
+
|
|
11
|
+
- We decouple our visual properties natively. Instead of mapping perfectly to Mantine's variants `(solid, outline)`, we intentionally use Recursica's semantic and behavioral structures (e.g., `<Badge variant="alert" />`).
|
|
12
|
+
- We intentionally omit and strip complex underlying parameters if they collide with or circumvent our UI tokens (like stripping `--size` out of Mantine Badge when Recursica enforces a universal single size).
|
|
13
|
+
|
|
14
|
+
## 2. Component Wrappers (Leaving Mantine Alone)
|
|
15
|
+
|
|
16
|
+
We actively avoid mutating or patching Mantine source code or deeply hooking into the Mantine Theme object to apply our token system.
|
|
17
|
+
|
|
18
|
+
- We rely on standard DOM `module.css` bridging with strictly targeted `className`/`classNames` overrides.
|
|
19
|
+
- This creates total decoupled isolation: updating Mantine natively will not fracture our styles, and we avoid dealing with deep Emotion/styled-component theme clashing logic.
|
|
20
|
+
|
|
21
|
+
## 3. The `overStyled` Property
|
|
22
|
+
|
|
23
|
+
Mantine encourages deep styling access by injecting properties like `p` (padding), `bg` (background), `c` (color), or `styles`/`classNames` directly into component tags.
|
|
24
|
+
|
|
25
|
+
- By default, **Recursica components block all arbitrary styling vectors**. `className` maps, system styles, and inline logic are proactively stripped before they hit Mantine using central utility functions.
|
|
26
|
+
- **Why?** To prevent the design system from deteriorating over time as developers write one-off hotfixes into their TSX rendering blocks.
|
|
27
|
+
- **The Caveat:** We allow _external DOM layout positioning props_ (e.g., margin `m`, `mt`, `mb`, etc.) to pass through so developers can still structure components organically within their parent layouts.
|
|
28
|
+
|
|
29
|
+
### Escape Hatches
|
|
30
|
+
|
|
31
|
+
If a developer _strictly must_ heavily alter a component, they are required to explicitly declare `<Component overStyled={true} />`. This immediately raises a visible red flag during code reviews.
|
|
32
|
+
|
|
33
|
+
## 4. Expectations for External Developers (Modifying Recursica)
|
|
34
|
+
|
|
35
|
+
If a developer finds that a component does not fit their needs and styling must be modified, their path of execution should follow these principles sequentially:
|
|
36
|
+
|
|
37
|
+
1. **Leverage Native Mantine First:** If a Recursica component lacks the functionality or styling variant needed for a highly custom edge case (e.g., a massive marketing hero button), do not try to forcibly hack the Recursica component. Instead, import the raw underlying `Button` component directly from `@mantine/core` and style it manually. Use Recursica for standard systematic needs, and native libraries for isolated custom one-offs.
|
|
38
|
+
2. **Accept `overStyled` as Technical Debt:** If you must override the Recursica component immediately but intend to roll it back, use `overStyled={true}`. The expectation is that `overStyled` uses will eventually be replaced once the actual Recursica Figma variants are natively updated to accommodate your usecase, at which point `overStyled={true}` can be safely removed.
|
|
39
|
+
3. **Contribute to the Kit:** Avoid building private custom wrappers around Recursica components. If the system is missing a variant, that is a shared project deficit—raise a concern and have the variant integrated directly into the universal token libraries!
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "git+https://github.com/borderux/recursica.git",
|
|
14
14
|
"directory": "packages/mantine-adapter"
|
|
15
15
|
},
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.36.1",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "./dist/mantine-adapter.cjs",
|
|
19
19
|
"module": "./dist/mantine-adapter.js",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"USAGE.md",
|
|
36
36
|
"ARCHITECTURE.md",
|
|
37
37
|
"SETUP.md",
|
|
38
|
-
"OVERSTYLING.md"
|
|
38
|
+
"OVERSTYLING.md",
|
|
39
|
+
"docs/PHILOSOPHY.md"
|
|
39
40
|
],
|
|
40
41
|
"keywords": [
|
|
41
42
|
"react",
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/* EXEMPTIONS:
|
|
2
|
+
- accordion-header open-appearance background-color/border-color are ignored because Forge does
|
|
3
|
+
not apply a visual swap on expand, even though the token schema defines "open" appearance
|
|
4
|
+
colors distinct from "closed" (see .control below, which intentionally keeps a constant
|
|
5
|
+
background/border across collapsed/expanded). */
|
|
6
|
+
/* recursica-ignore: --recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_background-color */
|
|
7
|
+
/* recursica-ignore: --recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_border-color */
|
|
8
|
+
|
|
1
9
|
/* ==== ACCORDION CONTAINER ==== */
|
|
2
10
|
.root {
|
|
3
11
|
box-sizing: border-box;
|
|
@@ -16,7 +24,7 @@
|
|
|
16
24
|
--recursica_ui-kit_components_accordion_properties_colors_border-color
|
|
17
25
|
);
|
|
18
26
|
background-color: var(
|
|
19
|
-
--recursica_ui-kit_components_accordion_properties_colors_background
|
|
27
|
+
--recursica_ui-kit_components_accordion_properties_colors_background-color
|
|
20
28
|
);
|
|
21
29
|
box-shadow: var(--recursica_ui-kit_components_accordion_properties_elevation);
|
|
22
30
|
|
|
@@ -31,7 +39,8 @@
|
|
|
31
39
|
/* ==== ACCORDION ITEM ==== */
|
|
32
40
|
.item {
|
|
33
41
|
box-sizing: border-box;
|
|
34
|
-
margin:
|
|
42
|
+
margin: var(--recursica_ui-kit_components_accordion-item_properties_margin);
|
|
43
|
+
padding: var(--recursica_ui-kit_components_accordion-item_properties_padding);
|
|
35
44
|
position: relative;
|
|
36
45
|
transition: all 0.2s ease;
|
|
37
46
|
|
|
@@ -40,13 +49,13 @@
|
|
|
40
49
|
|
|
41
50
|
border-style: solid;
|
|
42
51
|
border-color: var(
|
|
43
|
-
--recursica_ui-kit_components_accordion-
|
|
52
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_border-color
|
|
44
53
|
);
|
|
45
54
|
border-width: var(
|
|
46
|
-
--recursica_ui-kit_components_accordion-
|
|
55
|
+
--recursica_ui-kit_components_accordion-item_properties_border-size
|
|
47
56
|
);
|
|
48
57
|
border-bottom-color: var(
|
|
49
|
-
--recursica_ui-kit_components_accordion_properties_colors_divider
|
|
58
|
+
--recursica_ui-kit_components_accordion_properties_colors_divider-color
|
|
50
59
|
);
|
|
51
60
|
border-bottom-width: var(
|
|
52
61
|
--recursica_ui-kit_components_accordion_properties_divider-size
|
|
@@ -55,18 +64,11 @@
|
|
|
55
64
|
--recursica_ui-kit_components_accordion-item_properties_border-radius
|
|
56
65
|
);
|
|
57
66
|
box-shadow: var(
|
|
58
|
-
--recursica_ui-kit_components_accordion-item_properties_elevation
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
background-color: var(
|
|
62
|
-
--recursica_ui-kit_components_accordion-item_properties_colors_background-collapsed
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
.item[data-active] {
|
|
66
|
-
background-color: var(
|
|
67
|
-
--recursica_ui-kit_components_accordion-item_properties_colors_background-expanded
|
|
67
|
+
--recursica_ui-kit_components_accordion-item_properties_elevation
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
+
/* The collapsed/expanded background now lives on accordion-header (open/closed appearance),
|
|
71
|
+
applied via .control below, rather than on the item wrapper itself. */
|
|
70
72
|
.noDivider {
|
|
71
73
|
border-bottom: none !important;
|
|
72
74
|
border-bottom-width: 0 !important;
|
|
@@ -81,56 +83,86 @@
|
|
|
81
83
|
justify-content: space-between;
|
|
82
84
|
|
|
83
85
|
/* Re-apply gap defined by UI Kit for icons vs text */
|
|
84
|
-
gap: var(--recursica_ui-kit_components_accordion-
|
|
86
|
+
gap: var(--recursica_ui-kit_components_accordion-header_properties_icon-gap);
|
|
85
87
|
|
|
86
88
|
/* Strip Mantine's baked padding directly */
|
|
87
89
|
padding: var(
|
|
88
|
-
--recursica_ui-kit_components_accordion-
|
|
90
|
+
--recursica_ui-kit_components_accordion-header_properties_vertical-padding
|
|
89
91
|
)
|
|
90
92
|
var(
|
|
91
|
-
--recursica_ui-kit_components_accordion-
|
|
93
|
+
--recursica_ui-kit_components_accordion-header_properties_horizontal-padding
|
|
92
94
|
);
|
|
93
|
-
|
|
95
|
+
|
|
96
|
+
/* Background is intentionally constant across collapsed/expanded (Forge doesn't apply a
|
|
97
|
+
background swap on expand, even though the token schema defines an "open" appearance color) */
|
|
98
|
+
background-color: var(
|
|
99
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_background-color
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
/* Header's own border box, constant across collapsed/expanded (only its closed-state
|
|
103
|
+
border-color is used, matching the background decision above) */
|
|
104
|
+
border-style: solid;
|
|
105
|
+
border-width: var(
|
|
106
|
+
--recursica_ui-kit_components_accordion-header_properties_border-size
|
|
107
|
+
);
|
|
108
|
+
border-radius: var(
|
|
109
|
+
--recursica_ui-kit_components_accordion-header_properties_border-radius
|
|
110
|
+
);
|
|
111
|
+
border-color: var(
|
|
112
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_border-color
|
|
113
|
+
);
|
|
114
|
+
box-shadow: var(
|
|
115
|
+
--recursica_ui-kit_components_accordion-header_properties_elevation
|
|
116
|
+
);
|
|
94
117
|
|
|
95
118
|
transition: background-color 0.15s ease;
|
|
96
119
|
position: relative;
|
|
97
120
|
z-index: 1;
|
|
98
121
|
color: var(
|
|
99
|
-
--recursica_ui-kit_components_accordion-
|
|
122
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_text-color
|
|
100
123
|
);
|
|
101
124
|
|
|
102
125
|
/* Header Typography */
|
|
103
126
|
font-family: var(
|
|
104
|
-
--recursica_ui-kit_components_accordion-
|
|
127
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-family
|
|
105
128
|
);
|
|
106
129
|
font-size: var(
|
|
107
|
-
--recursica_ui-kit_components_accordion-
|
|
130
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-size
|
|
108
131
|
);
|
|
109
132
|
font-weight: var(
|
|
110
|
-
--recursica_ui-kit_components_accordion-
|
|
133
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-weight
|
|
111
134
|
);
|
|
112
135
|
font-style: var(
|
|
113
|
-
--recursica_ui-kit_components_accordion-
|
|
136
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-style
|
|
114
137
|
);
|
|
115
138
|
letter-spacing: var(
|
|
116
|
-
--recursica_ui-kit_components_accordion-
|
|
139
|
+
--recursica_ui-kit_components_accordion-header_properties_text_letter-spacing
|
|
117
140
|
);
|
|
118
141
|
line-height: var(
|
|
119
|
-
--recursica_ui-kit_components_accordion-
|
|
142
|
+
--recursica_ui-kit_components_accordion-header_properties_text_line-height
|
|
120
143
|
);
|
|
121
144
|
text-decoration: var(
|
|
122
|
-
--recursica_ui-kit_components_accordion-
|
|
145
|
+
--recursica_ui-kit_components_accordion-header_properties_text_text-decoration
|
|
123
146
|
);
|
|
124
147
|
text-transform: var(
|
|
125
|
-
--recursica_ui-kit_components_accordion-
|
|
148
|
+
--recursica_ui-kit_components_accordion-header_properties_text_text-transform
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.item[data-active] .control {
|
|
153
|
+
color: var(
|
|
154
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_text-color
|
|
126
155
|
);
|
|
127
156
|
}
|
|
128
157
|
|
|
129
|
-
/* Mantine natively places hover states on the control node.
|
|
130
|
-
|
|
131
|
-
|
|
158
|
+
/* Mantine natively places hover states on the control node. We explicitly re-apply our own
|
|
159
|
+
constant background (Mantine's native :hover CSS would otherwise show through) and use an
|
|
160
|
+
overlay ::after structure with the generic hover tokens for the actual hover tint; no per-item
|
|
161
|
+
hover-color/hover-opacity tokens exist anymore. */
|
|
132
162
|
.control:hover {
|
|
133
|
-
background-color:
|
|
163
|
+
background-color: var(
|
|
164
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_background-color
|
|
165
|
+
);
|
|
134
166
|
}
|
|
135
167
|
.control::after {
|
|
136
168
|
content: "";
|
|
@@ -139,37 +171,58 @@
|
|
|
139
171
|
border-radius: inherit;
|
|
140
172
|
z-index: -1;
|
|
141
173
|
pointer-events: none;
|
|
142
|
-
background-color: var(
|
|
143
|
-
--recursica_ui-kit_components_accordion-item_properties_hover-color
|
|
144
|
-
);
|
|
174
|
+
background-color: var(--recursica_brand_states_hover_color);
|
|
145
175
|
opacity: 0;
|
|
146
176
|
transition: opacity 150ms ease;
|
|
147
177
|
}
|
|
148
178
|
.control:hover:not(:disabled)::after {
|
|
149
|
-
opacity: var(
|
|
150
|
-
|
|
151
|
-
|
|
179
|
+
opacity: var(--recursica_brand_states_hover_opacity);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Recursica focus ring instead of Mantine's default `.mantine-focus-auto:focus-visible` outline
|
|
183
|
+
(same class+pseudo-class specificity, so !important guarantees ours wins regardless of CSS
|
|
184
|
+
import order). */
|
|
185
|
+
.control:focus-visible {
|
|
186
|
+
outline: none !important;
|
|
187
|
+
box-shadow:
|
|
188
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
189
|
+
var(--recursica_brand_states_focus_color),
|
|
190
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
191
|
+
var(--recursica_brand_states_focus_margin)
|
|
192
|
+
var(--recursica_brand_states_focus_color) !important;
|
|
152
193
|
}
|
|
153
194
|
|
|
154
195
|
/* Label logic inside the Control wrapper */
|
|
155
196
|
.label {
|
|
156
197
|
flex: 1;
|
|
198
|
+
min-width: 0; /* HARDCODE: required for text-overflow ellipsis to take effect on a flex child */
|
|
157
199
|
text-align: left;
|
|
158
200
|
color: inherit;
|
|
159
201
|
padding: 0; /* Clear Mantine inner padding */
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
text-overflow: ellipsis;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* ==== ICON SLOT (Mantine's leading-icon wrapper) ==== */
|
|
208
|
+
.icon {
|
|
209
|
+
/* HARDCODE: Mantine applies its own margin-inline-start/end around this slot; our own
|
|
210
|
+
icon-gap token (applied as flex `gap` on .control) already provides the spacing. */
|
|
211
|
+
margin-inline-start: 0;
|
|
212
|
+
margin-inline-end: 0;
|
|
160
213
|
}
|
|
161
214
|
|
|
162
215
|
/* ==== CHEVRON / RIGHT ICON ==== */
|
|
163
216
|
.chevron {
|
|
164
217
|
flex-shrink: 0;
|
|
165
218
|
width: var(
|
|
166
|
-
--recursica_ui-kit_components_accordion-
|
|
219
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-right-size
|
|
167
220
|
);
|
|
168
221
|
height: var(
|
|
169
|
-
--recursica_ui-kit_components_accordion-
|
|
222
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-right-size
|
|
170
223
|
);
|
|
171
224
|
color: var(
|
|
172
|
-
--recursica_ui-kit_components_accordion-
|
|
225
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_icon-color
|
|
173
226
|
);
|
|
174
227
|
margin: 0;
|
|
175
228
|
transition: transform 200ms ease;
|
|
@@ -184,6 +237,9 @@
|
|
|
184
237
|
}
|
|
185
238
|
.item[data-active] .chevron {
|
|
186
239
|
transform: rotate(180deg);
|
|
240
|
+
color: var(
|
|
241
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_icon-color
|
|
242
|
+
);
|
|
187
243
|
}
|
|
188
244
|
|
|
189
245
|
/* ==== LEFT ICON / CUSTOM ICONS ==== */
|
|
@@ -193,13 +249,18 @@
|
|
|
193
249
|
align-items: center;
|
|
194
250
|
justify-content: center;
|
|
195
251
|
width: var(
|
|
196
|
-
--recursica_ui-kit_components_accordion-
|
|
252
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-left-size
|
|
197
253
|
);
|
|
198
254
|
height: var(
|
|
199
|
-
--recursica_ui-kit_components_accordion-
|
|
255
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-left-size
|
|
256
|
+
);
|
|
257
|
+
color: var(
|
|
258
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_icon-color
|
|
200
259
|
);
|
|
260
|
+
}
|
|
261
|
+
.item[data-active] .iconLeftWrapper {
|
|
201
262
|
color: var(
|
|
202
|
-
--recursica_ui-kit_components_accordion-
|
|
263
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_icon-color
|
|
203
264
|
);
|
|
204
265
|
}
|
|
205
266
|
.iconLeftWrapper > * {
|
|
@@ -212,24 +273,24 @@
|
|
|
212
273
|
.panel {
|
|
213
274
|
box-sizing: border-box;
|
|
214
275
|
margin: var(
|
|
215
|
-
--recursica_ui-kit_components_accordion-
|
|
276
|
+
--recursica_ui-kit_components_accordion-content_properties_margin
|
|
216
277
|
);
|
|
217
278
|
padding: 0; /* Overriding dynamic layout structure */
|
|
218
279
|
background-color: var(
|
|
219
|
-
--recursica_ui-kit_components_accordion-
|
|
280
|
+
--recursica_ui-kit_components_accordion-content_properties_colors_background-color
|
|
220
281
|
);
|
|
221
282
|
border-style: solid;
|
|
222
283
|
border-color: var(
|
|
223
|
-
--recursica_ui-kit_components_accordion-
|
|
284
|
+
--recursica_ui-kit_components_accordion-content_properties_colors_border-color
|
|
224
285
|
);
|
|
225
286
|
border-width: var(
|
|
226
|
-
--recursica_ui-kit_components_accordion-
|
|
287
|
+
--recursica_ui-kit_components_accordion-content_properties_border-size
|
|
227
288
|
);
|
|
228
289
|
border-radius: var(
|
|
229
|
-
--recursica_ui-kit_components_accordion-
|
|
290
|
+
--recursica_ui-kit_components_accordion-content_properties_border-radius
|
|
230
291
|
);
|
|
231
292
|
box-shadow: var(
|
|
232
|
-
--recursica_ui-kit_components_accordion-
|
|
293
|
+
--recursica_ui-kit_components_accordion-content_properties_elevation
|
|
233
294
|
);
|
|
234
295
|
}
|
|
235
296
|
|
|
@@ -238,44 +299,44 @@
|
|
|
238
299
|
/* Strip Mantine padding and apply logic directly mapped */
|
|
239
300
|
padding: 0
|
|
240
301
|
var(
|
|
241
|
-
--recursica_ui-kit_components_accordion-
|
|
302
|
+
--recursica_ui-kit_components_accordion-content_properties_horizontal-padding
|
|
242
303
|
)
|
|
243
304
|
var(
|
|
244
|
-
--recursica_ui-kit_components_accordion-
|
|
305
|
+
--recursica_ui-kit_components_accordion-content_properties_bottom-padding
|
|
245
306
|
);
|
|
246
307
|
|
|
247
308
|
/* Apply offset gap explicitly calculated below header */
|
|
248
309
|
padding-top: var(
|
|
249
|
-
--recursica_ui-kit_components_accordion-
|
|
310
|
+
--recursica_ui-kit_components_accordion-content_properties_top-padding
|
|
250
311
|
);
|
|
251
312
|
|
|
252
313
|
color: var(
|
|
253
|
-
--recursica_ui-kit_components_accordion-
|
|
314
|
+
--recursica_ui-kit_components_accordion-content_properties_colors_text-color
|
|
254
315
|
);
|
|
255
316
|
|
|
256
317
|
/* Content Typography */
|
|
257
318
|
font-family: var(
|
|
258
|
-
--recursica_ui-kit_components_accordion-
|
|
319
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-family
|
|
259
320
|
);
|
|
260
321
|
font-size: var(
|
|
261
|
-
--recursica_ui-kit_components_accordion-
|
|
322
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-size
|
|
262
323
|
);
|
|
263
324
|
font-weight: var(
|
|
264
|
-
--recursica_ui-kit_components_accordion-
|
|
325
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-weight
|
|
265
326
|
);
|
|
266
327
|
font-style: var(
|
|
267
|
-
--recursica_ui-kit_components_accordion-
|
|
328
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-style
|
|
268
329
|
);
|
|
269
330
|
letter-spacing: var(
|
|
270
|
-
--recursica_ui-kit_components_accordion-
|
|
331
|
+
--recursica_ui-kit_components_accordion-content_properties_text_letter-spacing
|
|
271
332
|
);
|
|
272
333
|
line-height: var(
|
|
273
|
-
--recursica_ui-kit_components_accordion-
|
|
334
|
+
--recursica_ui-kit_components_accordion-content_properties_text_line-height
|
|
274
335
|
);
|
|
275
336
|
text-decoration: var(
|
|
276
|
-
--recursica_ui-kit_components_accordion-
|
|
337
|
+
--recursica_ui-kit_components_accordion-content_properties_text_text-decoration
|
|
277
338
|
);
|
|
278
339
|
text-transform: var(
|
|
279
|
-
--recursica_ui-kit_components_accordion-
|
|
340
|
+
--recursica_ui-kit_components_accordion-content_properties_text_text-transform
|
|
280
341
|
);
|
|
281
342
|
}
|
|
@@ -65,31 +65,29 @@ export default meta;
|
|
|
65
65
|
export const Default: StoryObj<typeof Accordion> = {
|
|
66
66
|
render: () => {
|
|
67
67
|
return (
|
|
68
|
-
<
|
|
69
|
-
<Accordion
|
|
70
|
-
<Accordion.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</Accordion.Item>
|
|
68
|
+
<Accordion defaultValue="item-1" chevron={<ChevronIcon />}>
|
|
69
|
+
<Accordion.Item value="item-1">
|
|
70
|
+
<Accordion.Control>Billing and Membership</Accordion.Control>
|
|
71
|
+
<Accordion.Panel>
|
|
72
|
+
You can manage your billing directly from the dashboard tab. All
|
|
73
|
+
payments are processed automatically.
|
|
74
|
+
</Accordion.Panel>
|
|
75
|
+
</Accordion.Item>
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
<Accordion.Item value="item-2">
|
|
78
|
+
<Accordion.Control>Refund Policy</Accordion.Control>
|
|
79
|
+
<Accordion.Panel>
|
|
80
|
+
We offer a 30-day money-back guarantee for all new subscriptions.
|
|
81
|
+
</Accordion.Panel>
|
|
82
|
+
</Accordion.Item>
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
</Layer>
|
|
84
|
+
<Accordion.Item value="item-3">
|
|
85
|
+
<Accordion.Control>Technical Support</Accordion.Control>
|
|
86
|
+
<Accordion.Panel>
|
|
87
|
+
Our support team is available 24/7 via live chat or email.
|
|
88
|
+
</Accordion.Panel>
|
|
89
|
+
</Accordion.Item>
|
|
90
|
+
</Accordion>
|
|
93
91
|
);
|
|
94
92
|
},
|
|
95
93
|
};
|
|
@@ -97,32 +95,66 @@ export const Default: StoryObj<typeof Accordion> = {
|
|
|
97
95
|
export const WithIcons: StoryObj<typeof Accordion> = {
|
|
98
96
|
render: () => {
|
|
99
97
|
return (
|
|
100
|
-
<
|
|
101
|
-
<Accordion
|
|
102
|
-
<Accordion.
|
|
98
|
+
<Accordion defaultValue="security" chevron={<ChevronIcon />}>
|
|
99
|
+
<Accordion.Item value="security">
|
|
100
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
101
|
+
Security Settings
|
|
102
|
+
</Accordion.Control>
|
|
103
|
+
<Accordion.Panel>
|
|
104
|
+
Enable two-factor authentication (2FA) and monitor active sessions
|
|
105
|
+
below.
|
|
106
|
+
</Accordion.Panel>
|
|
107
|
+
</Accordion.Item>
|
|
108
|
+
|
|
109
|
+
<Accordion.Item value="privacy">
|
|
110
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
111
|
+
Privacy Configuration
|
|
112
|
+
</Accordion.Control>
|
|
113
|
+
<Accordion.Panel>
|
|
114
|
+
Choose what data is shared with our analytics partners.
|
|
115
|
+
</Accordion.Panel>
|
|
116
|
+
</Accordion.Item>
|
|
117
|
+
</Accordion>
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const LongTitleTruncation: StoryObj<typeof Accordion> = {
|
|
123
|
+
render: () => {
|
|
124
|
+
return (
|
|
125
|
+
// `style` is stripped from Accordion itself (only passes through with overStyled);
|
|
126
|
+
// constrain width on a plain wrapper div instead to force truncation.
|
|
127
|
+
<div style={{ maxWidth: 320 }}>
|
|
128
|
+
<Accordion defaultValue="long-title" chevron={<ChevronIcon />}>
|
|
129
|
+
<Accordion.Item value="long-title">
|
|
103
130
|
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
104
|
-
|
|
131
|
+
This is a deliberately very long accordion item title used to
|
|
132
|
+
verify that overflowing text truncates with a CSS ellipsis instead
|
|
133
|
+
of wrapping or overflowing the header
|
|
105
134
|
</Accordion.Control>
|
|
106
135
|
<Accordion.Panel>
|
|
107
|
-
|
|
108
|
-
|
|
136
|
+
The header label above should truncate to a single line with a
|
|
137
|
+
trailing ellipsis (…) rather than wrapping onto multiple lines or
|
|
138
|
+
pushing the chevron out of view.
|
|
109
139
|
</Accordion.Panel>
|
|
110
140
|
</Accordion.Item>
|
|
111
141
|
|
|
112
|
-
<Accordion.Item value="
|
|
142
|
+
<Accordion.Item value="short-title">
|
|
113
143
|
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
114
|
-
|
|
144
|
+
Short Title
|
|
115
145
|
</Accordion.Control>
|
|
116
146
|
<Accordion.Panel>
|
|
117
|
-
|
|
147
|
+
A short title in the same accordion for visual comparison.
|
|
118
148
|
</Accordion.Panel>
|
|
119
149
|
</Accordion.Item>
|
|
120
150
|
</Accordion>
|
|
121
|
-
</
|
|
151
|
+
</div>
|
|
122
152
|
);
|
|
123
153
|
},
|
|
124
154
|
};
|
|
125
155
|
|
|
156
|
+
/** Demonstrates the component nested inside a non-default layer — the one case where an
|
|
157
|
+
* explicit `<Layer>` wrap belongs in a story (see COMPONENT_STORYBOOK_GUIDE.md §9). */
|
|
126
158
|
export const LayerOne: StoryObj<typeof Accordion> = {
|
|
127
159
|
render: () => {
|
|
128
160
|
return (
|