@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
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HARDCODED VALUES:
|
|
3
|
+
* - display: flex; align-items: center; width: 100%; (Standard CSS flexbox layouts for bidirectional components)
|
|
4
|
+
* - flex-grow: 1; flex-shrink: 0; (Layout control structures)
|
|
5
|
+
* - transform: translateX(-50%); (Mantine's standard step marks positioning alignment offset)
|
|
6
|
+
* - outline: none; border-style: solid; (Standard focus reset and border outlines)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* ==========================================
|
|
10
|
+
1. Baseline, Reset & Layout Overrides
|
|
11
|
+
========================================== */
|
|
12
|
+
|
|
13
|
+
/* Stacked Layout Spacing Override */
|
|
14
|
+
.layoutOverride {
|
|
15
|
+
--form-control-margin-bottom: var(
|
|
16
|
+
--recursica_ui-kit_components_slider_variants_layouts_stacked_properties_top-bottom-margin
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Side-by-Side Layout Spacing Override */
|
|
21
|
+
.layoutOverride[data-form-layout="side-by-side"] {
|
|
22
|
+
--form-control-margin-bottom: var(
|
|
23
|
+
--recursica_ui-kit_components_slider_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.sliderContainer {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: 100%;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
gap: var(--recursica_ui-kit_components_slider_properties_input-gap);
|
|
33
|
+
color: var(--form-field-text-valued);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.sliderTrackWrapper {
|
|
37
|
+
flex-grow: 1;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.iconWrapper {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
width: var(--recursica_ui-kit_components_slider_properties_icon-size);
|
|
49
|
+
height: var(--recursica_ui-kit_components_slider_properties_icon-size);
|
|
50
|
+
color: var(
|
|
51
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_icon-color
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ==========================================
|
|
56
|
+
2. Slider Tracks, Bars, Thumbs, and Marks
|
|
57
|
+
========================================== */
|
|
58
|
+
|
|
59
|
+
.sliderRoot {
|
|
60
|
+
width: 100%;
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.sliderTrack {
|
|
65
|
+
height: var(--recursica_ui-kit_components_slider_properties_track-height);
|
|
66
|
+
border-radius: var(
|
|
67
|
+
--recursica_ui-kit_components_slider_properties_track-border-radius
|
|
68
|
+
);
|
|
69
|
+
background-color: var(
|
|
70
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_track
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.sliderBar {
|
|
75
|
+
background-color: var(
|
|
76
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_track-active
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.sliderThumb {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
width: var(--recursica_ui-kit_components_slider_properties_thumb-size);
|
|
83
|
+
height: var(--recursica_ui-kit_components_slider_properties_thumb-size);
|
|
84
|
+
border-radius: var(
|
|
85
|
+
--recursica_ui-kit_components_slider_properties_thumb-border-radius
|
|
86
|
+
);
|
|
87
|
+
box-shadow: var(
|
|
88
|
+
--recursica_ui-kit_components_slider_properties_thumb-elevation
|
|
89
|
+
);
|
|
90
|
+
background-color: var(
|
|
91
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_thumb
|
|
92
|
+
);
|
|
93
|
+
border: none;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
outline: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.sliderThumb:focus,
|
|
99
|
+
.sliderThumb:focus-visible {
|
|
100
|
+
outline: none;
|
|
101
|
+
background-color: var(
|
|
102
|
+
--recursica_ui-kit_components_slider_variants_states_focus_properties_colors_thumb
|
|
103
|
+
);
|
|
104
|
+
box-shadow: 0 0 0 2px
|
|
105
|
+
var(
|
|
106
|
+
--recursica_ui-kit_components_slider_variants_states_focus_properties_colors_track-active
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.sliderMark {
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
width: var(
|
|
113
|
+
--recursica_ui-kit_components_slider_properties_step-indicator-width
|
|
114
|
+
);
|
|
115
|
+
height: var(
|
|
116
|
+
--recursica_ui-kit_components_slider_properties_step-indicator-width
|
|
117
|
+
);
|
|
118
|
+
border-radius: var(
|
|
119
|
+
--recursica_ui-kit_components_slider_properties_step-indicator-border-radius
|
|
120
|
+
);
|
|
121
|
+
background-color: var(
|
|
122
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_step-indicator-color
|
|
123
|
+
);
|
|
124
|
+
transform: translateX(-50%);
|
|
125
|
+
border: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.sliderMark[data-filled] {
|
|
129
|
+
background-color: var(
|
|
130
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_step-indicator-color-active
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* ==========================================
|
|
135
|
+
3. Min / Max Custom Typography Labels & Floating Active Value
|
|
136
|
+
========================================== */
|
|
137
|
+
|
|
138
|
+
.minMaxGuide {
|
|
139
|
+
font-family: var(
|
|
140
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_font-family
|
|
141
|
+
);
|
|
142
|
+
font-size: var(
|
|
143
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_font-size
|
|
144
|
+
);
|
|
145
|
+
font-style: var(
|
|
146
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_font-style
|
|
147
|
+
);
|
|
148
|
+
font-weight: var(
|
|
149
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_font-weight
|
|
150
|
+
);
|
|
151
|
+
letter-spacing: var(
|
|
152
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_letter-spacing
|
|
153
|
+
);
|
|
154
|
+
line-height: var(
|
|
155
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_line-height
|
|
156
|
+
);
|
|
157
|
+
text-decoration: var(
|
|
158
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_text-decoration
|
|
159
|
+
);
|
|
160
|
+
text-transform: var(
|
|
161
|
+
--recursica_ui-kit_components_slider_properties_min-max-label_text-transform
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/*
|
|
166
|
+
* LAYOUT DECISION: Right-Aligned Floating Current Value Container
|
|
167
|
+
* - Wrapped around the right-side max guide (or icon) as a relative flex context.
|
|
168
|
+
* - This provides the anchor for absolutely positioning the floating current value element
|
|
169
|
+
* above the guide.
|
|
170
|
+
*/
|
|
171
|
+
.rightGuideContainer {
|
|
172
|
+
position: relative;
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
flex-shrink: 0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/*
|
|
180
|
+
* LAYOUT DECISION: Floating Active Value Element
|
|
181
|
+
* - Absolutely positioned directly above the max guide and right-aligned (`right: 0`).
|
|
182
|
+
* - Uses a vertical gap matching the global label-to-component gap variable, ensuring
|
|
183
|
+
* that `.currentValue` is placed in perfect horizontal baseline alignment with the
|
|
184
|
+
* left-aligned form label of the component.
|
|
185
|
+
* - Typography maps back to the slider component's read-only value token definitions.
|
|
186
|
+
* - Inherits the container default/disabled/error text colors naturally.
|
|
187
|
+
*/
|
|
188
|
+
.currentValue {
|
|
189
|
+
position: absolute;
|
|
190
|
+
bottom: calc(
|
|
191
|
+
100% +
|
|
192
|
+
var(
|
|
193
|
+
--recursica_ui-kit_globals_form_properties_label-field-gap-vertical,
|
|
194
|
+
8px
|
|
195
|
+
)
|
|
196
|
+
);
|
|
197
|
+
right: 0;
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
display: inline-block;
|
|
201
|
+
width: var(--recursica_ui-kit_components_slider_properties_input-width);
|
|
202
|
+
text-align: right;
|
|
203
|
+
|
|
204
|
+
font-family: var(
|
|
205
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-family
|
|
206
|
+
);
|
|
207
|
+
font-size: var(
|
|
208
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-size
|
|
209
|
+
);
|
|
210
|
+
font-style: var(
|
|
211
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-style
|
|
212
|
+
);
|
|
213
|
+
font-weight: var(
|
|
214
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-weight
|
|
215
|
+
);
|
|
216
|
+
letter-spacing: var(
|
|
217
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_letter-spacing
|
|
218
|
+
);
|
|
219
|
+
line-height: var(
|
|
220
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_line-height
|
|
221
|
+
);
|
|
222
|
+
text-decoration: var(
|
|
223
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_text-decoration
|
|
224
|
+
);
|
|
225
|
+
text-transform: var(
|
|
226
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_text-transform
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* ==========================================
|
|
231
|
+
4. Numeric Input Field
|
|
232
|
+
========================================== */
|
|
233
|
+
|
|
234
|
+
.inputField {
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
flex-shrink: 0;
|
|
237
|
+
width: var(--recursica_ui-kit_components_slider_properties_input-width);
|
|
238
|
+
height: var(--recursica_ui-kit_components_slider_properties_input-height);
|
|
239
|
+
border-radius: var(
|
|
240
|
+
--recursica_ui-kit_components_slider_properties_input-border-radius
|
|
241
|
+
);
|
|
242
|
+
border-style: solid;
|
|
243
|
+
border-width: var(
|
|
244
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_input-border-size
|
|
245
|
+
);
|
|
246
|
+
border-color: var(
|
|
247
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_input-border-color
|
|
248
|
+
);
|
|
249
|
+
background-color: var(
|
|
250
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_input-background
|
|
251
|
+
);
|
|
252
|
+
color: var(
|
|
253
|
+
--recursica_ui-kit_components_slider_variants_states_default_properties_colors_input-text
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
font-family: var(
|
|
257
|
+
--recursica_ui-kit_components_slider_properties_input-text_font-family
|
|
258
|
+
);
|
|
259
|
+
font-size: var(
|
|
260
|
+
--recursica_ui-kit_components_slider_properties_input-text_font-size
|
|
261
|
+
);
|
|
262
|
+
font-style: var(
|
|
263
|
+
--recursica_ui-kit_components_slider_properties_input-text_font-style
|
|
264
|
+
);
|
|
265
|
+
font-weight: var(
|
|
266
|
+
--recursica_ui-kit_components_slider_properties_input-text_font-weight
|
|
267
|
+
);
|
|
268
|
+
letter-spacing: var(
|
|
269
|
+
--recursica_ui-kit_components_slider_properties_input-text_letter-spacing
|
|
270
|
+
);
|
|
271
|
+
line-height: var(
|
|
272
|
+
--recursica_ui-kit_components_slider_properties_input-text_line-height
|
|
273
|
+
);
|
|
274
|
+
text-decoration: var(
|
|
275
|
+
--recursica_ui-kit_components_slider_properties_input-text_text-decoration
|
|
276
|
+
);
|
|
277
|
+
text-transform: var(
|
|
278
|
+
--recursica_ui-kit_components_slider_properties_input-text_text-transform
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
padding-left: var(
|
|
282
|
+
--recursica_ui-kit_components_slider_properties_input-padding-left
|
|
283
|
+
);
|
|
284
|
+
padding-right: var(
|
|
285
|
+
--recursica_ui-kit_components_slider_properties_input-padding-right
|
|
286
|
+
);
|
|
287
|
+
padding-top: var(
|
|
288
|
+
--recursica_ui-kit_components_slider_properties_input-padding-vertical
|
|
289
|
+
);
|
|
290
|
+
padding-bottom: var(
|
|
291
|
+
--recursica_ui-kit_components_slider_properties_input-padding-vertical
|
|
292
|
+
);
|
|
293
|
+
text-align: center;
|
|
294
|
+
transition:
|
|
295
|
+
border-color 0.15s ease,
|
|
296
|
+
background-color 0.15s ease;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.inputField:focus {
|
|
300
|
+
outline: none;
|
|
301
|
+
background-color: var(
|
|
302
|
+
--recursica_ui-kit_components_slider_variants_states_focus_properties_colors_input-background
|
|
303
|
+
);
|
|
304
|
+
border-color: var(
|
|
305
|
+
--recursica_ui-kit_components_slider_variants_states_focus_properties_colors_input-border-color
|
|
306
|
+
);
|
|
307
|
+
color: var(
|
|
308
|
+
--recursica_ui-kit_components_slider_variants_states_focus_properties_colors_input-text
|
|
309
|
+
);
|
|
310
|
+
border-width: var(
|
|
311
|
+
--recursica_ui-kit_components_slider_variants_states_focus_properties_input-border-size
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Chrome, Safari, Edge, Opera: Hide number spin buttons */
|
|
316
|
+
.inputField::-webkit-outer-spin-button,
|
|
317
|
+
.inputField::-webkit-inner-spin-button {
|
|
318
|
+
-webkit-appearance: none;
|
|
319
|
+
margin: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* Firefox: Hide number spin buttons */
|
|
323
|
+
.inputField[type="number"] {
|
|
324
|
+
-moz-appearance: textfield;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* ==========================================
|
|
328
|
+
5. Custom Read-Only Typography Value
|
|
329
|
+
========================================== */
|
|
330
|
+
|
|
331
|
+
.readOnlyValue {
|
|
332
|
+
font-family: var(
|
|
333
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-family
|
|
334
|
+
);
|
|
335
|
+
font-size: var(
|
|
336
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-size
|
|
337
|
+
);
|
|
338
|
+
font-style: var(
|
|
339
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-style
|
|
340
|
+
);
|
|
341
|
+
font-weight: var(
|
|
342
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_font-weight
|
|
343
|
+
);
|
|
344
|
+
letter-spacing: var(
|
|
345
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_letter-spacing
|
|
346
|
+
);
|
|
347
|
+
line-height: var(
|
|
348
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_line-height
|
|
349
|
+
);
|
|
350
|
+
text-decoration: var(
|
|
351
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_text-decoration
|
|
352
|
+
);
|
|
353
|
+
text-transform: var(
|
|
354
|
+
--recursica_ui-kit_components_slider_properties_read-only-value_text-transform
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* ==========================================
|
|
359
|
+
6. State-Specific Overrides (Disabled, Error)
|
|
360
|
+
========================================== */
|
|
361
|
+
|
|
362
|
+
/* Disabled state */
|
|
363
|
+
.sliderContainer[data-disabled="true"] .iconWrapper {
|
|
364
|
+
color: var(
|
|
365
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_icon-color
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.sliderContainer[data-disabled="true"] .sliderTrack {
|
|
370
|
+
background-color: var(
|
|
371
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_track
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.sliderContainer[data-disabled="true"] .sliderBar {
|
|
376
|
+
background-color: var(
|
|
377
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_track-active
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.sliderContainer[data-disabled="true"] .sliderThumb {
|
|
382
|
+
background-color: var(
|
|
383
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_thumb
|
|
384
|
+
);
|
|
385
|
+
cursor: not-allowed;
|
|
386
|
+
box-shadow: none;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.sliderContainer[data-disabled="true"] .sliderMark {
|
|
390
|
+
background-color: var(
|
|
391
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_step-indicator-color
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.sliderContainer[data-disabled="true"] .sliderMark[data-filled] {
|
|
396
|
+
background-color: var(
|
|
397
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_step-indicator-color-active
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.sliderContainer[data-disabled="true"] {
|
|
402
|
+
color: var(--form-field-disabled-text);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.inputField:disabled {
|
|
406
|
+
cursor: not-allowed;
|
|
407
|
+
background-color: var(
|
|
408
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_input-background
|
|
409
|
+
);
|
|
410
|
+
border-color: var(
|
|
411
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_input-border-color
|
|
412
|
+
);
|
|
413
|
+
color: var(
|
|
414
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_colors_input-text
|
|
415
|
+
);
|
|
416
|
+
border-width: var(
|
|
417
|
+
--recursica_ui-kit_components_slider_variants_states_disabled_properties_input-border-size
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* Error state */
|
|
422
|
+
.sliderContainer[data-error="true"] .iconWrapper {
|
|
423
|
+
color: var(
|
|
424
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_icon-color
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.sliderContainer[data-error="true"] .sliderTrack {
|
|
429
|
+
background-color: var(
|
|
430
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_track
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.sliderContainer[data-error="true"] .sliderBar {
|
|
435
|
+
background-color: var(
|
|
436
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_track-active
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.sliderContainer[data-error="true"] .sliderThumb {
|
|
441
|
+
background-color: var(
|
|
442
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_thumb
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.sliderContainer[data-error="true"] .sliderMark {
|
|
447
|
+
background-color: var(
|
|
448
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_step-indicator-color
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.sliderContainer[data-error="true"] .sliderMark[data-filled] {
|
|
453
|
+
background-color: var(
|
|
454
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_step-indicator-color-active
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.inputField[data-error="true"] {
|
|
459
|
+
background-color: var(
|
|
460
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_input-background
|
|
461
|
+
);
|
|
462
|
+
border-color: var(
|
|
463
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_input-border-color
|
|
464
|
+
);
|
|
465
|
+
color: var(
|
|
466
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_colors_input-text
|
|
467
|
+
);
|
|
468
|
+
border-width: var(
|
|
469
|
+
--recursica_ui-kit_components_slider_variants_states_error_properties_input-border-size
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/* ==========================================
|
|
474
|
+
7. Side-by-Side Layout Overrides
|
|
475
|
+
========================================== */
|
|
476
|
+
|
|
477
|
+
.sliderContainer[data-form-layout="side-by-side"] .rightGuideContainer {
|
|
478
|
+
position: relative;
|
|
479
|
+
display: inline-flex;
|
|
480
|
+
flex-direction: row;
|
|
481
|
+
align-items: center;
|
|
482
|
+
justify-content: flex-end;
|
|
483
|
+
flex-shrink: 0;
|
|
484
|
+
gap: var(--recursica_ui-kit_components_slider_properties_input-gap);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.sliderContainer[data-form-layout="side-by-side"] .currentValue {
|
|
488
|
+
position: static;
|
|
489
|
+
white-space: nowrap;
|
|
490
|
+
pointer-events: none;
|
|
491
|
+
order: 2; /* Positioned to the right of the max label */
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.sliderContainer[data-form-layout="side-by-side"]
|
|
495
|
+
.rightGuideContainer
|
|
496
|
+
.minMaxGuide {
|
|
497
|
+
order: 1; /* Positioned to the left of the current value */
|
|
498
|
+
}
|
|
@@ -1,12 +1,60 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Slider } from "./Slider";
|
|
3
|
-
import {
|
|
3
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Slider> = {
|
|
6
|
-
title: "UI-Kit
|
|
6
|
+
title: "UI-Kit/Slider",
|
|
7
7
|
component: Slider,
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: `
|
|
13
|
+
The \`Slider\` component wraps Mantine's Slider to support a premium design system, a bidirectional input state,
|
|
14
|
+
custom min/max labels, step indicators, and strict states like error, disabled, and read-only.
|
|
15
|
+
|
|
16
|
+
### Architecture
|
|
17
|
+
The component uses Recursica's unified \`FormControlWrapper\` and \`<WithReadOnlyWrapper>\` to render consistent form layouts (stacked, side-by-side) and read-only representations.
|
|
18
|
+
All visual properties map perfectly to token values inside \`Slider.module.css\`.
|
|
19
|
+
`,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
...formControlArgTypes,
|
|
25
|
+
disabled: {
|
|
26
|
+
control: "boolean",
|
|
27
|
+
description: "Disables both the slider track and the text input field.",
|
|
28
|
+
},
|
|
29
|
+
error: {
|
|
30
|
+
control: "text",
|
|
31
|
+
description:
|
|
32
|
+
"Places the slider in an error state with custom border/icon highlights.",
|
|
33
|
+
},
|
|
34
|
+
required: {
|
|
35
|
+
control: "boolean",
|
|
36
|
+
},
|
|
37
|
+
label: {
|
|
38
|
+
control: "text",
|
|
39
|
+
description: "Outer form control label.",
|
|
40
|
+
},
|
|
41
|
+
assistiveText: {
|
|
42
|
+
control: "text",
|
|
43
|
+
description: "Assistive text rendered below or beside the component.",
|
|
44
|
+
},
|
|
45
|
+
readOnly: {
|
|
46
|
+
control: "boolean",
|
|
47
|
+
description: "Puts the component in static read-only mode.",
|
|
48
|
+
},
|
|
49
|
+
showInput: {
|
|
50
|
+
control: "boolean",
|
|
51
|
+
description: "Controls whether the numeric input box is visible.",
|
|
52
|
+
},
|
|
53
|
+
showMinMaxLabels: {
|
|
54
|
+
control: "boolean",
|
|
55
|
+
description: "Toggles rendering of min/max labels below the track.",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
10
58
|
};
|
|
11
59
|
|
|
12
60
|
export default meta;
|
|
@@ -14,5 +62,112 @@ export default meta;
|
|
|
14
62
|
type Story = StoryObj<typeof Slider>;
|
|
15
63
|
|
|
16
64
|
export const Default: Story = {
|
|
17
|
-
|
|
65
|
+
args: {
|
|
66
|
+
label: "Auditory Threshold",
|
|
67
|
+
assistiveText: "Specify the maximum decibel frequency boundary.",
|
|
68
|
+
defaultValue: 60,
|
|
69
|
+
min: 10,
|
|
70
|
+
max: 100,
|
|
71
|
+
step: 1,
|
|
72
|
+
showMinMaxLabels: true,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const WithInputField: Story = {
|
|
77
|
+
args: {
|
|
78
|
+
...Default.args,
|
|
79
|
+
showInput: true,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const SideBySideLayout: Story = {
|
|
84
|
+
args: {
|
|
85
|
+
...Default.args,
|
|
86
|
+
formLayout: "side-by-side",
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Disabled: Story = {
|
|
91
|
+
args: {
|
|
92
|
+
label: "Decommissioned Server Node",
|
|
93
|
+
assistiveText: "Modifications to this environment are frozen.",
|
|
94
|
+
defaultValue: 35,
|
|
95
|
+
disabled: false,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const ErrorState: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
label: "Core Temperature Alert",
|
|
102
|
+
assistiveText:
|
|
103
|
+
"Severe core degradation across the hypervisor socket cluster.",
|
|
104
|
+
defaultValue: 85,
|
|
105
|
+
error: "Thermal overload threshold exceeded.",
|
|
106
|
+
required: true,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const StaticReadOnly: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
label: "System Calibration Metrics",
|
|
113
|
+
assistiveText:
|
|
114
|
+
"Frozen baseline calibrations derived during initial staging.",
|
|
115
|
+
value: 65,
|
|
116
|
+
readOnly: true,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const EditableReadOnly: Story = {
|
|
121
|
+
args: {
|
|
122
|
+
label: "Adaptive Node Output",
|
|
123
|
+
assistiveText:
|
|
124
|
+
"Click edit to unlock bidirectional input parameter boundaries.",
|
|
125
|
+
defaultValue: 15,
|
|
126
|
+
readOnly: true,
|
|
127
|
+
labelWithEditIcon: true,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const WithMarks: Story = {
|
|
132
|
+
args: {
|
|
133
|
+
label: "Interactive Marks Map",
|
|
134
|
+
defaultValue: 50,
|
|
135
|
+
min: 0,
|
|
136
|
+
max: 100,
|
|
137
|
+
step: 10,
|
|
138
|
+
marks: [
|
|
139
|
+
{ value: 0, label: "0%" },
|
|
140
|
+
{ value: 25, label: "25%" },
|
|
141
|
+
{ value: 50, label: "50%" },
|
|
142
|
+
{ value: 75, label: "75%" },
|
|
143
|
+
{ value: 100, label: "100%" },
|
|
144
|
+
],
|
|
145
|
+
showMinMaxLabels: false,
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const FormLayouts: Story = {
|
|
150
|
+
render: () => (
|
|
151
|
+
<div
|
|
152
|
+
style={{
|
|
153
|
+
display: "flex",
|
|
154
|
+
flexDirection: "column",
|
|
155
|
+
gap: "2.5rem",
|
|
156
|
+
maxWidth: 600,
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
<Slider
|
|
160
|
+
label="Stacked Layout"
|
|
161
|
+
assistiveText="This is the standard top-to-bottom stacked form layout."
|
|
162
|
+
defaultValue={40}
|
|
163
|
+
formLayout="stacked"
|
|
164
|
+
/>
|
|
165
|
+
<Slider
|
|
166
|
+
label="Side-by-Side Layout"
|
|
167
|
+
assistiveText="This is the side-by-side layout aligning label beside control."
|
|
168
|
+
defaultValue={60}
|
|
169
|
+
formLayout="side-by-side"
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
),
|
|
18
173
|
};
|