@recursica/mantine-adapter 0.21.0 → 0.23.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.
- package/CHANGELOG.md +18 -0
- package/dist/mantine-adapter.cjs +1 -1
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +2017 -1630
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/AutoComplete/AutoComplete.d.ts +9 -0
- package/dist/src/components/Avatar/Avatar.d.ts +1 -1
- package/dist/src/components/Badge/Badge.d.ts +1 -1
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Card/Card.d.ts +1 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts +8 -2
- package/dist/src/components/Flex/Flex.d.ts +1 -1
- package/dist/src/components/Link/Link.d.ts +1 -1
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +6 -1
- package/dist/src/components/Slider/Slider.d.ts +24 -2
- package/dist/src/components/Text/Text.d.ts +1 -1
- package/dist/src/components/Toast/Toast.d.ts +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/test.html +1 -0
- package/package.json +5 -2
- package/src/GlobalExemptions.modules.css +13 -0
- package/src/components/AutoComplete/AUTOCOMPLETE_IMPLEMENTATION_NOTES.md +21 -0
- package/src/components/AutoComplete/AutoComplete.module.css +311 -0
- package/src/components/AutoComplete/AutoComplete.stories.tsx +187 -0
- package/src/components/AutoComplete/AutoComplete.tsx +154 -0
- package/src/components/Avatar/Avatar.module.css +40 -36
- package/src/components/Badge/Badge.module.css +4 -1
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +3 -10
- package/src/components/Button/Button.module.css +215 -56
- package/src/components/Button/Button.stories.tsx +27 -0
- package/src/components/Button/Button.tsx +11 -4
- package/src/components/Card/Card.module.css +58 -1
- package/src/components/Card/Card.stories.tsx +4 -2
- package/src/components/Checkbox/Checkbox.module.css +74 -46
- package/src/components/Checkbox/Checkbox.stories.tsx +3 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +1 -9
- package/src/components/Chip/Chip.module.css +19 -1
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +16 -0
- package/src/components/DatePicker/DatePicker.module.css +286 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +127 -4
- package/src/components/DatePicker/DatePicker.tsx +166 -5
- package/src/components/Dropdown/Dropdown.module.css +42 -15
- package/src/components/Dropdown/Dropdown.stories.tsx +3 -0
- package/src/components/Dropdown/Dropdown.tsx +5 -1
- package/src/components/FileInput/FileInput.module.css +50 -0
- package/src/components/FileUpload/FileUpload.module.css +43 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +12 -2
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +67 -0
- package/src/components/HoverCard/HoverCard.module.css +12 -5
- package/src/components/Label/Label.module.css +11 -3
- package/src/components/Link/Link.module.css +8 -0
- package/src/components/Loader/LOADER_IMPLEMENTATION_NOTES.md +1 -2
- package/src/components/Loader/Loader.module.css +3 -9
- package/src/components/Menu/Menu.module.css +73 -30
- package/src/components/Modal/Modal.module.css +92 -47
- package/src/components/NumberInput/NumberInput.module.css +46 -15
- package/src/components/NumberInput/NumberInput.tsx +5 -1
- package/src/components/Pagination/Pagination.module.css +123 -41
- package/src/components/Panel/Panel.module.css +55 -3
- package/src/components/Popover/Popover.module.css +6 -4
- package/src/components/Radio/Radio.module.css +72 -59
- package/src/components/Radio/Radio.stories.tsx +3 -0
- package/src/components/Radio/RadioGroup.tsx +1 -8
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +14 -0
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +16 -1
- package/src/components/SegmentedControl/SegmentedControl.module.css +106 -41
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +1 -4
- package/src/components/SegmentedControl/SegmentedControl.tsx +18 -4
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +49 -0
- package/src/components/Slider/Slider.module.css +498 -0
- package/src/components/Slider/Slider.stories.tsx +159 -4
- package/src/components/Slider/Slider.tsx +283 -4
- package/src/components/Stepper/Stepper.module.css +53 -2
- package/src/components/Switch/Switch.module.css +62 -23
- package/src/components/Switch/Switch.stories.tsx +3 -0
- package/src/components/Switch/Switch.tsx +1 -0
- package/src/components/Switch/SwitchGroup.tsx +3 -10
- package/src/components/Tabs/Tabs.module.css +33 -12
- package/src/components/TextArea/TextArea.module.css +58 -120
- package/src/components/TextArea/TextArea.stories.tsx +3 -0
- package/src/components/TextArea/TextArea.tsx +7 -3
- package/src/components/TextField/TextField.module.css +46 -15
- package/src/components/TextField/TextField.tsx +5 -1
- package/src/components/TimePicker/TimePicker.module.css +44 -0
- package/src/components/Timeline/Timeline.module.css +6 -0
- package/src/components/Toast/Toast.module.css +56 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Tooltip/Tooltip.module.css +9 -0
- package/src/components/TransferList/TransferList.module.css +41 -0
- package/src/components/index.ts +1 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPLEMENTATION NOTES:
|
|
3
|
+
*
|
|
4
|
+
* - Icon-Only Flexbox Hack: Mantine renders a hidden `.label` span even if `children` is empty.
|
|
5
|
+
* Because we apply `flex: 1` to `.label`, this empty span grows and pushes the `leftSection` (the icon)
|
|
6
|
+
* off-center. To fix this, we apply `display: none` to the label when `data-content="icon-only"`.
|
|
7
|
+
*/
|
|
1
8
|
/* Baseline and Reset */
|
|
2
9
|
.root {
|
|
3
10
|
box-sizing: border-box;
|
|
@@ -49,6 +56,7 @@
|
|
|
49
56
|
.label {
|
|
50
57
|
display: flex;
|
|
51
58
|
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
52
60
|
min-width: 0;
|
|
53
61
|
flex: 1 1 0;
|
|
54
62
|
}
|
|
@@ -65,39 +73,114 @@
|
|
|
65
73
|
|
|
66
74
|
/* ==== SIZES ==== */
|
|
67
75
|
.root[data-size="default"] {
|
|
68
|
-
|
|
69
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_border-radius
|
|
70
|
-
);
|
|
71
|
-
height: var(
|
|
72
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_height
|
|
73
|
-
);
|
|
74
|
-
min-width: var(
|
|
75
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_min-width
|
|
76
|
-
);
|
|
76
|
+
/* Set baseline paddings and min-width using generic tokens as baseline defaults */
|
|
77
77
|
padding: 0
|
|
78
78
|
var(
|
|
79
79
|
--recursica_ui-kit_components_button_variants_sizes_default_properties_horizontal-padding
|
|
80
80
|
);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
min-width: var(
|
|
82
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_min-width
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
height: var(
|
|
86
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_height
|
|
85
87
|
);
|
|
88
|
+
|
|
89
|
+
.labelText {
|
|
90
|
+
max-width: var(
|
|
91
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_max-label-width
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.iconWrapper {
|
|
96
|
+
width: var(
|
|
97
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_icon
|
|
98
|
+
);
|
|
99
|
+
height: var(
|
|
100
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_icon
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.section {
|
|
105
|
+
gap: var(
|
|
106
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_icon-text-gap
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&[data-content="label"] {
|
|
111
|
+
border-radius: var(
|
|
112
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_default_properties_border-radius
|
|
113
|
+
);
|
|
114
|
+
min-width: var(
|
|
115
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_default_properties_min-width
|
|
116
|
+
);
|
|
117
|
+
padding: 0
|
|
118
|
+
var(
|
|
119
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_default_properties_horizontal-padding
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&[data-content="icon-label"] {
|
|
124
|
+
border-radius: var(
|
|
125
|
+
--recursica_ui-kit_components_button_variants_content_icon-label_variants_sizes_default_properties_border-radius
|
|
126
|
+
);
|
|
127
|
+
min-width: var(
|
|
128
|
+
--recursica_ui-kit_components_button_variants_content_icon-label_variants_sizes_default_properties_min-width
|
|
129
|
+
);
|
|
130
|
+
padding: 0
|
|
131
|
+
var(
|
|
132
|
+
--recursica_ui-kit_components_button_variants_content_icon-label_variants_sizes_default_properties_horizontal-padding
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&[data-content="icon-only"] {
|
|
137
|
+
border-radius: var(
|
|
138
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_default_properties_border-radius
|
|
139
|
+
);
|
|
140
|
+
min-width: var(
|
|
141
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_default_properties_min-width
|
|
142
|
+
);
|
|
143
|
+
padding: 0
|
|
144
|
+
var(
|
|
145
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_default_properties_horizontal-padding
|
|
146
|
+
);
|
|
147
|
+
}
|
|
86
148
|
}
|
|
149
|
+
|
|
87
150
|
.root[data-size="small"] {
|
|
88
|
-
|
|
89
|
-
|
|
151
|
+
/* Set baseline paddings and min-width using generic tokens as baseline defaults */
|
|
152
|
+
padding: 0
|
|
153
|
+
var(
|
|
154
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_horizontal-padding
|
|
155
|
+
);
|
|
156
|
+
min-width: var(
|
|
157
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_min-width
|
|
90
158
|
);
|
|
159
|
+
|
|
91
160
|
height: var(
|
|
92
161
|
--recursica_ui-kit_components_button_variants_sizes_small_properties_height
|
|
93
162
|
);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
163
|
+
|
|
164
|
+
.labelText {
|
|
165
|
+
max-width: var(
|
|
166
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_max-label-width
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.iconWrapper {
|
|
171
|
+
width: var(
|
|
172
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon
|
|
173
|
+
);
|
|
174
|
+
height: var(
|
|
175
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon
|
|
100
176
|
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.section {
|
|
180
|
+
gap: var(
|
|
181
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon-text-gap
|
|
182
|
+
);
|
|
183
|
+
}
|
|
101
184
|
|
|
102
185
|
/* Override specific typography for small */
|
|
103
186
|
font-family: var(
|
|
@@ -118,11 +201,75 @@
|
|
|
118
201
|
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight
|
|
119
202
|
)
|
|
120
203
|
);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
204
|
+
font-style: var(
|
|
205
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-style,
|
|
206
|
+
var(
|
|
207
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-style
|
|
208
|
+
)
|
|
125
209
|
);
|
|
210
|
+
letter-spacing: var(
|
|
211
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_letter-spacing,
|
|
212
|
+
var(
|
|
213
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_letter-spacing
|
|
214
|
+
)
|
|
215
|
+
);
|
|
216
|
+
line-height: var(
|
|
217
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_line-height,
|
|
218
|
+
var(
|
|
219
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_line-height
|
|
220
|
+
)
|
|
221
|
+
);
|
|
222
|
+
text-decoration: var(
|
|
223
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_text-decoration,
|
|
224
|
+
var(
|
|
225
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-decoration
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
text-transform: var(
|
|
229
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_text-transform,
|
|
230
|
+
var(
|
|
231
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-transform
|
|
232
|
+
)
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
&[data-content="label"] {
|
|
236
|
+
border-radius: var(
|
|
237
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_small_properties_border-radius
|
|
238
|
+
);
|
|
239
|
+
min-width: var(
|
|
240
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_small_properties_min-width
|
|
241
|
+
);
|
|
242
|
+
padding: 0
|
|
243
|
+
var(
|
|
244
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_small_properties_horizontal-padding
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&[data-content="icon-label"] {
|
|
249
|
+
border-radius: var(
|
|
250
|
+
--recursica_ui-kit_components_button_variants_content_icon-label_variants_sizes_small_properties_border-radius
|
|
251
|
+
);
|
|
252
|
+
min-width: var(
|
|
253
|
+
--recursica_ui-kit_components_button_variants_content_icon-label_variants_sizes_small_properties_min-width
|
|
254
|
+
);
|
|
255
|
+
padding: 0
|
|
256
|
+
var(
|
|
257
|
+
--recursica_ui-kit_components_button_variants_content_icon-label_variants_sizes_small_properties_horizontal-padding
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&[data-content="icon-only"] {
|
|
262
|
+
border-radius: var(
|
|
263
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_small_properties_border-radius
|
|
264
|
+
);
|
|
265
|
+
min-width: var(
|
|
266
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_small_properties_min-width
|
|
267
|
+
);
|
|
268
|
+
padding: 0
|
|
269
|
+
var(
|
|
270
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_small_properties_horizontal-padding
|
|
271
|
+
);
|
|
272
|
+
}
|
|
126
273
|
}
|
|
127
274
|
|
|
128
275
|
/* Icon Resets */
|
|
@@ -137,45 +284,22 @@
|
|
|
137
284
|
height: 100%;
|
|
138
285
|
object-fit: contain;
|
|
139
286
|
}
|
|
140
|
-
.root[data-size="default"] .iconWrapper {
|
|
141
|
-
width: var(
|
|
142
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_icon
|
|
143
|
-
);
|
|
144
|
-
height: var(
|
|
145
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_icon
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
.root[data-size="small"] .iconWrapper {
|
|
149
|
-
width: var(
|
|
150
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon
|
|
151
|
-
);
|
|
152
|
-
height: var(
|
|
153
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
287
|
|
|
157
288
|
.section {
|
|
158
289
|
min-width: 0;
|
|
159
290
|
}
|
|
160
|
-
.root[data-size="default"] .section {
|
|
161
|
-
gap: var(
|
|
162
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_icon-text-gap
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
.root[data-size="small"] .section {
|
|
166
|
-
gap: var(
|
|
167
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon-text-gap
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
291
|
|
|
171
292
|
/* Icon-only logic overrides */
|
|
172
|
-
.root[data-icon-only] .
|
|
293
|
+
.root[data-content="icon-only"] .label {
|
|
294
|
+
display: none;
|
|
295
|
+
}
|
|
296
|
+
.root[data-content="icon-only"] .section {
|
|
173
297
|
gap: 0;
|
|
174
298
|
}
|
|
175
|
-
.root[data-icon-only] .section[data-position="left"] {
|
|
299
|
+
.root[data-content="icon-only"] .section[data-position="left"] {
|
|
176
300
|
margin-inline-end: 0;
|
|
177
301
|
}
|
|
178
|
-
.root[data-icon-only] .section[data-position="right"] {
|
|
302
|
+
.root[data-content="icon-only"] .section[data-position="right"] {
|
|
179
303
|
margin-inline-start: 0;
|
|
180
304
|
}
|
|
181
305
|
|
|
@@ -214,13 +338,21 @@
|
|
|
214
338
|
--recursica_ui-kit_components_button_variants_sizes_small_properties_hover-color
|
|
215
339
|
);
|
|
216
340
|
}
|
|
217
|
-
.root:hover:not(:disabled)::after {
|
|
341
|
+
.root[data-size="default"]:hover:not(:disabled)::after {
|
|
218
342
|
opacity: var(
|
|
219
343
|
--recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity,
|
|
220
344
|
0.1
|
|
221
345
|
);
|
|
222
346
|
}
|
|
223
|
-
|
|
347
|
+
.root[data-size="small"]:hover:not(:disabled)::after {
|
|
348
|
+
opacity: var(
|
|
349
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_hover-opacity,
|
|
350
|
+
var(
|
|
351
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity,
|
|
352
|
+
0.1
|
|
353
|
+
)
|
|
354
|
+
);
|
|
355
|
+
}
|
|
224
356
|
/* ==== VARIANTS ==== */
|
|
225
357
|
|
|
226
358
|
/* SOLID */
|
|
@@ -240,11 +372,20 @@
|
|
|
240
372
|
color: var(
|
|
241
373
|
--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text
|
|
242
374
|
);
|
|
375
|
+
|
|
376
|
+
.iconWrapper {
|
|
377
|
+
color: var(
|
|
378
|
+
--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_icon-color
|
|
379
|
+
);
|
|
380
|
+
}
|
|
243
381
|
}
|
|
244
382
|
.root[data-variant="solid"]:hover:not(:disabled) {
|
|
245
383
|
color: var(
|
|
246
384
|
--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text-hover
|
|
247
385
|
);
|
|
386
|
+
box-shadow: var(
|
|
387
|
+
--recursica_ui-kit_components_button_variants_styles_solid_properties_hover-elevation
|
|
388
|
+
);
|
|
248
389
|
}
|
|
249
390
|
|
|
250
391
|
/* OUTLINE */
|
|
@@ -264,11 +405,20 @@
|
|
|
264
405
|
color: var(
|
|
265
406
|
--recursica_ui-kit_components_button_variants_styles_outline_properties_colors_text
|
|
266
407
|
);
|
|
408
|
+
|
|
409
|
+
.iconWrapper {
|
|
410
|
+
color: var(
|
|
411
|
+
--recursica_ui-kit_components_button_variants_styles_outline_properties_colors_icon-color
|
|
412
|
+
);
|
|
413
|
+
}
|
|
267
414
|
}
|
|
268
415
|
.root[data-variant="outline"]:hover:not(:disabled) {
|
|
269
416
|
color: var(
|
|
270
417
|
--recursica_ui-kit_components_button_variants_styles_outline_properties_colors_text-hover
|
|
271
418
|
);
|
|
419
|
+
box-shadow: var(
|
|
420
|
+
--recursica_ui-kit_components_button_variants_styles_outline_properties_hover-elevation
|
|
421
|
+
);
|
|
272
422
|
}
|
|
273
423
|
|
|
274
424
|
/* TEXT */
|
|
@@ -288,9 +438,18 @@
|
|
|
288
438
|
color: var(
|
|
289
439
|
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_text
|
|
290
440
|
);
|
|
441
|
+
|
|
442
|
+
.iconWrapper {
|
|
443
|
+
color: var(
|
|
444
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_icon-color
|
|
445
|
+
);
|
|
446
|
+
}
|
|
291
447
|
}
|
|
292
448
|
.root[data-variant="text"]:hover:not(:disabled) {
|
|
293
449
|
color: var(
|
|
294
450
|
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_text-hover
|
|
295
451
|
);
|
|
452
|
+
box-shadow: var(
|
|
453
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_hover-elevation
|
|
454
|
+
);
|
|
296
455
|
}
|
|
@@ -10,6 +10,9 @@ const meta: Meta<ButtonStoryProps> = {
|
|
|
10
10
|
component: Button,
|
|
11
11
|
tags: ["autodocs"],
|
|
12
12
|
argTypes: {
|
|
13
|
+
disabled: {
|
|
14
|
+
control: "boolean",
|
|
15
|
+
},
|
|
13
16
|
variant: {
|
|
14
17
|
control: "select",
|
|
15
18
|
options: ["solid", "outline", "text"],
|
|
@@ -104,6 +107,30 @@ export const TextWithIcon: Story = {
|
|
|
104
107
|
},
|
|
105
108
|
};
|
|
106
109
|
|
|
110
|
+
export const IconOnly: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
variant: "solid",
|
|
113
|
+
size: "default",
|
|
114
|
+
"aria-label": "Search",
|
|
115
|
+
icon: (
|
|
116
|
+
<svg
|
|
117
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
118
|
+
width="24"
|
|
119
|
+
height="24"
|
|
120
|
+
viewBox="0 0 24 24"
|
|
121
|
+
fill="none"
|
|
122
|
+
stroke="currentColor"
|
|
123
|
+
strokeWidth="2"
|
|
124
|
+
strokeLinecap="round"
|
|
125
|
+
strokeLinejoin="round"
|
|
126
|
+
>
|
|
127
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
128
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
129
|
+
</svg>
|
|
130
|
+
),
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
107
134
|
export const LayerOneSolid: Story = {
|
|
108
135
|
args: {
|
|
109
136
|
children: "Layer 1 Solid",
|
|
@@ -71,8 +71,15 @@ const _Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|
|
71
71
|
|
|
72
72
|
const hasLeftSection = !!icon || !!restRecord["leftSection"];
|
|
73
73
|
const hasRightSection = !!restRecord["rightSection"];
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const hasVisibleText = hasVisibleChildren(children);
|
|
75
|
+
const isIconOnly = (hasLeftSection || hasRightSection) && !hasVisibleText;
|
|
76
|
+
|
|
77
|
+
let contentType = "label";
|
|
78
|
+
if (isIconOnly) {
|
|
79
|
+
contentType = "icon-only";
|
|
80
|
+
} else if (hasLeftSection || hasRightSection) {
|
|
81
|
+
contentType = "icon-label";
|
|
82
|
+
}
|
|
76
83
|
|
|
77
84
|
if (
|
|
78
85
|
typeof process !== "undefined" &&
|
|
@@ -110,7 +117,7 @@ const _Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|
|
110
117
|
: styles.root;
|
|
111
118
|
|
|
112
119
|
const userLoaderProps = restRecord.loaderProps as
|
|
113
|
-
| Record<string,
|
|
120
|
+
| Record<string, unknown>
|
|
114
121
|
| undefined;
|
|
115
122
|
|
|
116
123
|
const resolvedLoaderSize =
|
|
@@ -141,7 +148,7 @@ const _Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|
|
141
148
|
}
|
|
142
149
|
data-variant={variant}
|
|
143
150
|
data-size={size}
|
|
144
|
-
|
|
151
|
+
data-content={contentType}
|
|
145
152
|
{...sanitizedProps}
|
|
146
153
|
disabled={!!restRecord.disabled || !!restRecord.loading}
|
|
147
154
|
>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/* HARDCODED VALUES:
|
|
2
|
+
- display: flex on root
|
|
3
|
+
- flex-direction: column
|
|
4
|
+
- gap: section-gap
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
.root {
|
|
2
8
|
/* HARDCODE: Map Recursica explicitly into Mantine's variable format so internal components know the margins */
|
|
3
9
|
--card-padding: var(--recursica_ui-kit_components_card_properties_padding);
|
|
@@ -33,7 +39,32 @@
|
|
|
33
39
|
border-bottom: var(--recursica_ui-kit_components_card_properties_divider-size)
|
|
34
40
|
solid
|
|
35
41
|
var(--recursica_ui-kit_components_card_properties_colors_divider-color);
|
|
36
|
-
|
|
42
|
+
|
|
43
|
+
/* Direct Figma Typography Mapping */
|
|
44
|
+
font-family: var(
|
|
45
|
+
--recursica_ui-kit_components_card_properties_header-style_fontFamily
|
|
46
|
+
);
|
|
47
|
+
font-size: var(
|
|
48
|
+
--recursica_ui-kit_components_card_properties_header-style_fontSize
|
|
49
|
+
);
|
|
50
|
+
font-style: var(
|
|
51
|
+
--recursica_ui-kit_components_card_properties_header-style_fontStyle
|
|
52
|
+
);
|
|
53
|
+
font-weight: var(
|
|
54
|
+
--recursica_ui-kit_components_card_properties_header-style_fontWeight
|
|
55
|
+
);
|
|
56
|
+
letter-spacing: var(
|
|
57
|
+
--recursica_ui-kit_components_card_properties_header-style_letterSpacing
|
|
58
|
+
);
|
|
59
|
+
line-height: var(
|
|
60
|
+
--recursica_ui-kit_components_card_properties_header-style_lineHeight
|
|
61
|
+
);
|
|
62
|
+
text-transform: var(
|
|
63
|
+
--recursica_ui-kit_components_card_properties_header-style_textCase
|
|
64
|
+
);
|
|
65
|
+
text-decoration: var(
|
|
66
|
+
--recursica_ui-kit_components_card_properties_header-style_textDecoration
|
|
67
|
+
);
|
|
37
68
|
}
|
|
38
69
|
|
|
39
70
|
.footer {
|
|
@@ -58,4 +89,30 @@
|
|
|
58
89
|
flex-direction: column;
|
|
59
90
|
gap: var(--recursica_ui-kit_components_card_properties_vertical-gutter);
|
|
60
91
|
padding: 0;
|
|
92
|
+
|
|
93
|
+
/* Direct Figma Typography Mapping */
|
|
94
|
+
font-family: var(
|
|
95
|
+
--recursica_ui-kit_components_card_properties_content-style_fontFamily
|
|
96
|
+
);
|
|
97
|
+
font-size: var(
|
|
98
|
+
--recursica_ui-kit_components_card_properties_content-style_fontSize
|
|
99
|
+
);
|
|
100
|
+
font-style: var(
|
|
101
|
+
--recursica_ui-kit_components_card_properties_content-style_fontStyle
|
|
102
|
+
);
|
|
103
|
+
font-weight: var(
|
|
104
|
+
--recursica_ui-kit_components_card_properties_content-style_fontWeight
|
|
105
|
+
);
|
|
106
|
+
letter-spacing: var(
|
|
107
|
+
--recursica_ui-kit_components_card_properties_content-style_letterSpacing
|
|
108
|
+
);
|
|
109
|
+
line-height: var(
|
|
110
|
+
--recursica_ui-kit_components_card_properties_content-style_lineHeight
|
|
111
|
+
);
|
|
112
|
+
text-transform: var(
|
|
113
|
+
--recursica_ui-kit_components_card_properties_content-style_textCase
|
|
114
|
+
);
|
|
115
|
+
text-decoration: var(
|
|
116
|
+
--recursica_ui-kit_components_card_properties_content-style_textDecoration
|
|
117
|
+
);
|
|
61
118
|
}
|
|
@@ -37,7 +37,8 @@ export const Default: Story = {
|
|
|
37
37
|
<div
|
|
38
38
|
style={{
|
|
39
39
|
padding: "48px",
|
|
40
|
-
backgroundColor:
|
|
40
|
+
backgroundColor:
|
|
41
|
+
"var(--recursica_brand_palettes_neutral_050_color_tone)",
|
|
41
42
|
}}
|
|
42
43
|
>
|
|
43
44
|
<Layer layer={0}>
|
|
@@ -72,7 +73,8 @@ export const HeaderlessAndFooterless: Story = {
|
|
|
72
73
|
<div
|
|
73
74
|
style={{
|
|
74
75
|
padding: "48px",
|
|
75
|
-
backgroundColor:
|
|
76
|
+
backgroundColor:
|
|
77
|
+
"var(--recursica_brand_palettes_neutral_050_color_tone)",
|
|
76
78
|
}}
|
|
77
79
|
>
|
|
78
80
|
<Layer layer={0}>
|