@recursica/mui-adapter 0.25.0 → 0.26.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 +10 -0
- package/dist/index.d.ts +23 -19
- package/dist/mui-adapter.cjs +85 -85
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +30129 -25630
- package/dist/mui-adapter.js.map +1 -1
- package/package.json +1 -1
- package/src/GlobalExemptions.modules.css +0 -6
- package/src/components/Accordion/Accordion.module.css +0 -8
- package/src/components/Autocomplete/Autocomplete.module.css +0 -8
- package/src/components/Avatar/Avatar.module.css +0 -8
- package/src/components/Button/Button.module.css +0 -13
- package/src/components/Chip/Chip.module.css +0 -27
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +29 -0
- package/src/components/DatePicker/DatePicker.icons.tsx +35 -0
- package/src/components/DatePicker/DatePicker.module.css +451 -42
- package/src/components/DatePicker/DatePicker.stories.tsx +23 -25
- package/src/components/DatePicker/DatePicker.tsx +229 -47
- package/src/components/DatePicker/USAGE.md +14 -1
- package/src/components/Dropdown/Dropdown.module.css +0 -7
- package/src/components/FileInput/FileInput.module.css +0 -21
- package/src/components/FileUpload/FileUpload.module.css +0 -11
- package/src/components/HoverCard/HoverCard.module.css +1 -7
- package/src/components/Label/Label.module.css +0 -6
- package/src/components/Link/Link.module.css +0 -13
- package/src/components/Menu/Menu.module.css +0 -5
- package/src/components/Modal/Modal.module.css +0 -11
- package/src/components/NumberInput/NumberInput.module.css +0 -7
- package/src/components/Pagination/Pagination.module.css +0 -81
- package/src/components/Popover/Popover.module.css +0 -5
- package/src/components/SegmentedControl/SegmentedControl.module.css +0 -8
- package/src/components/TextArea/TextArea.module.css +0 -7
- package/src/components/TextField/TextField.module.css +0 -8
- package/src/components/TimePicker/TimePicker.module.css +0 -16
- package/src/components/Timeline/Timeline.module.css +0 -6
- package/src/components/Toast/Toast.module.css +0 -7
- package/src/components/Tooltip/Tooltip.module.css +0 -9
- package/src/components/TransferList/TransferList.module.css +0 -8
|
@@ -1,42 +1,451 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
/* HARDCODED VALUES:
|
|
2
|
+
- border-style: solid. Native structural rendering rule.
|
|
3
|
+
- outline: none. Bypassing browser focus rings to rely strictly on Recursica focus states natively.
|
|
4
|
+
- MUI X's field variant can't be forced from this component's public API (see
|
|
5
|
+
DATEPICKER_IMPLEMENTATION_NOTES.md) — whichever native decoration it renders is suppressed
|
|
6
|
+
below, and our own border/background are applied to .field instead, same convention as
|
|
7
|
+
TimePicker.module.css.
|
|
8
|
+
- disabled/error border-size: intentionally not consumed. border-width is set once on .field
|
|
9
|
+
from the base border-size token and held constant across states, so a uniform border is
|
|
10
|
+
preserved and no layout shift/flicker occurs on disabled/error transitions. Matches
|
|
11
|
+
Mantine's DatePicker convention. */
|
|
12
|
+
|
|
13
|
+
/* LAYOUT SPACING OVERRIDES:
|
|
14
|
+
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens. */
|
|
15
|
+
.layoutOverride {
|
|
16
|
+
--form-control-margin-bottom: var(
|
|
17
|
+
--recursica_ui-kit_components_date-picker_variants_layouts_stacked_properties_top-bottom-margin
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.layoutOverride[data-form-layout="side-by-side"] {
|
|
22
|
+
--form-control-margin-bottom: var(
|
|
23
|
+
--recursica_ui-kit_components_date-picker_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.root {
|
|
28
|
+
display: flex;
|
|
29
|
+
width: fit-content;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.field {
|
|
33
|
+
width: var(--recursica_ui-kit_components_date-picker_properties_width);
|
|
34
|
+
border-radius: var(
|
|
35
|
+
--recursica_ui-kit_components_date-picker_properties_border-radius
|
|
36
|
+
);
|
|
37
|
+
border-width: var(
|
|
38
|
+
--recursica_ui-kit_components_date-picker_properties_border-size
|
|
39
|
+
);
|
|
40
|
+
border-style: solid;
|
|
41
|
+
border-color: var(
|
|
42
|
+
--recursica_ui-kit_components_date-picker_properties_colors_border-color
|
|
43
|
+
);
|
|
44
|
+
background-color: var(
|
|
45
|
+
--recursica_ui-kit_components_date-picker_properties_colors_background-color
|
|
46
|
+
);
|
|
47
|
+
color: var(
|
|
48
|
+
--recursica_ui-kit_components_date-picker_properties_colors_text-color
|
|
49
|
+
);
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Suppress whichever native field decoration MUI X renders by default — .field draws the border
|
|
54
|
+
instead, same technique as TimePicker.module.css. */
|
|
55
|
+
.field :global(.MuiPickersInputBase-root::before),
|
|
56
|
+
.field :global(.MuiPickersInputBase-root::after),
|
|
57
|
+
.field :global(.MuiInput-root::before),
|
|
58
|
+
.field :global(.MuiInput-root::after) {
|
|
59
|
+
border-bottom: none !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.field :global(.MuiPickersOutlinedInput-notchedOutline) {
|
|
63
|
+
border: none !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.field :global(.MuiPickersInputBase-root) {
|
|
67
|
+
min-height: var(
|
|
68
|
+
--recursica_ui-kit_components_date-picker_properties_min-height
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.field :global(.MuiPickersInputBase-sectionsContainer) {
|
|
73
|
+
padding-top: var(
|
|
74
|
+
--recursica_ui-kit_components_date-picker_properties_vertical-padding
|
|
75
|
+
);
|
|
76
|
+
padding-bottom: var(
|
|
77
|
+
--recursica_ui-kit_components_date-picker_properties_vertical-padding
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
font-family: var(
|
|
81
|
+
--recursica_ui-kit_components_date-picker_properties_text_font-family
|
|
82
|
+
);
|
|
83
|
+
font-size: var(
|
|
84
|
+
--recursica_ui-kit_components_date-picker_properties_text_font-size
|
|
85
|
+
);
|
|
86
|
+
font-style: var(
|
|
87
|
+
--recursica_ui-kit_components_date-picker_properties_text_font-style
|
|
88
|
+
);
|
|
89
|
+
font-weight: var(
|
|
90
|
+
--recursica_ui-kit_components_date-picker_properties_text_font-weight
|
|
91
|
+
);
|
|
92
|
+
letter-spacing: var(
|
|
93
|
+
--recursica_ui-kit_components_date-picker_properties_text_letter-spacing
|
|
94
|
+
);
|
|
95
|
+
line-height: var(
|
|
96
|
+
--recursica_ui-kit_components_date-picker_properties_text_line-height
|
|
97
|
+
);
|
|
98
|
+
text-decoration: var(
|
|
99
|
+
--recursica_ui-kit_components_date-picker_properties_text_text-decoration
|
|
100
|
+
);
|
|
101
|
+
text-transform: var(
|
|
102
|
+
--recursica_ui-kit_components_date-picker_properties_text_text-transform
|
|
103
|
+
);
|
|
104
|
+
margin-left: var(
|
|
105
|
+
--recursica_ui-kit_components_date-picker_properties_icon-text-gap
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.field :global(.MuiPickersInputBase-input) {
|
|
110
|
+
color: inherit;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Empty segments ("MM", "DD", "YYYY") render via MUI X's own placeholder styling, not a native
|
|
114
|
+
::placeholder pseudo-element — there is no equivalent selector to hook the placeholder-opacity
|
|
115
|
+
token onto, same constraint TimePicker documents for its own empty sections. */
|
|
116
|
+
|
|
117
|
+
/* Leading calendar icon button (see DatePicker.tsx's `openPickerButtonPosition="start"`). */
|
|
118
|
+
.field :global(.MuiInputAdornment-root) {
|
|
119
|
+
margin: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.field :global(.MuiButtonBase-root.MuiIconButton-root) {
|
|
123
|
+
padding: 0;
|
|
124
|
+
padding-left: var(
|
|
125
|
+
--recursica_ui-kit_components_date-picker_properties_horizontal-padding
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.field :global(.MuiButtonBase-root.MuiIconButton-root) :global(svg) {
|
|
130
|
+
width: var(--recursica_ui-kit_components_date-picker_properties_icon-size);
|
|
131
|
+
height: var(--recursica_ui-kit_components_date-picker_properties_icon-size);
|
|
132
|
+
color: var(
|
|
133
|
+
--recursica_ui-kit_components_date-picker_properties_colors_leading-icon
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* -------------------------------------
|
|
138
|
+
STATE CASCADE ARCHITECTURE
|
|
139
|
+
-------------------------------------- */
|
|
140
|
+
|
|
141
|
+
.field:has(:global(.Mui-focused)) {
|
|
142
|
+
box-shadow:
|
|
143
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
144
|
+
var(--recursica_brand_states_focus_color),
|
|
145
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
146
|
+
var(--recursica_brand_states_focus_margin)
|
|
147
|
+
var(--recursica_brand_states_focus_color);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.root[data-error="true"] .field {
|
|
151
|
+
border-color: var(
|
|
152
|
+
--recursica_ui-kit_components_date-picker_variants_states_error_properties_colors_border-color
|
|
153
|
+
) !important;
|
|
154
|
+
background-color: var(
|
|
155
|
+
--recursica_ui-kit_components_date-picker_variants_states_error_properties_colors_background-color
|
|
156
|
+
) !important;
|
|
157
|
+
color: var(
|
|
158
|
+
--recursica_ui-kit_components_date-picker_variants_states_error_properties_colors_text-color
|
|
159
|
+
) !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.root[data-error="true"]
|
|
163
|
+
.field
|
|
164
|
+
:global(.MuiButtonBase-root.MuiIconButton-root svg) {
|
|
165
|
+
color: var(
|
|
166
|
+
--recursica_ui-kit_components_date-picker_variants_states_error_properties_colors_leading-icon
|
|
167
|
+
) !important;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.field:has(:global(.Mui-disabled)) {
|
|
171
|
+
border-color: var(
|
|
172
|
+
--recursica_ui-kit_components_date-picker_variants_states_disabled_properties_colors_border-color
|
|
173
|
+
) !important;
|
|
174
|
+
background-color: var(
|
|
175
|
+
--recursica_ui-kit_components_date-picker_variants_states_disabled_properties_colors_background-color
|
|
176
|
+
) !important;
|
|
177
|
+
color: var(
|
|
178
|
+
--recursica_ui-kit_components_date-picker_variants_states_disabled_properties_colors_text-color
|
|
179
|
+
) !important;
|
|
180
|
+
opacity: var(
|
|
181
|
+
--recursica_ui-kit_components_date-picker_variants_states_disabled_properties_opacity
|
|
182
|
+
) !important;
|
|
183
|
+
cursor: not-allowed;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.field:has(:global(.Mui-disabled))
|
|
187
|
+
:global(.MuiButtonBase-root.MuiIconButton-root svg) {
|
|
188
|
+
color: var(
|
|
189
|
+
--recursica_ui-kit_components_date-picker_variants_states_disabled_properties_colors_leading-icon
|
|
190
|
+
) !important;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* =========================================
|
|
194
|
+
CALENDAR POPOVER OVERRIDES
|
|
195
|
+
Maps generic popover & solid button tokens
|
|
196
|
+
to enforce Recursica's global styling.
|
|
197
|
+
Mirrors mantine-adapter's DatePicker.module.css mapping 1:1 — see
|
|
198
|
+
DATEPICKER_IMPLEMENTATION_NOTES.md for the full rationale per token choice.
|
|
199
|
+
========================================= */
|
|
200
|
+
|
|
201
|
+
.dropdown {
|
|
202
|
+
background-color: var(
|
|
203
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_background-color
|
|
204
|
+
) !important;
|
|
205
|
+
border: var(
|
|
206
|
+
--recursica_ui-kit_components_hover-card-popover_properties_border-size
|
|
207
|
+
)
|
|
208
|
+
solid
|
|
209
|
+
var(
|
|
210
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_border-color
|
|
211
|
+
) !important;
|
|
212
|
+
border-radius: var(
|
|
213
|
+
--recursica_ui-kit_components_hover-card-popover_properties_border-radius
|
|
214
|
+
) !important;
|
|
215
|
+
box-shadow: var(
|
|
216
|
+
--recursica_ui-kit_components_hover-card-popover_properties_elevation
|
|
217
|
+
) !important;
|
|
218
|
+
padding: var(
|
|
219
|
+
--recursica_ui-kit_components_hover-card-popover_properties_vertical-padding
|
|
220
|
+
)
|
|
221
|
+
var(
|
|
222
|
+
--recursica_ui-kit_components_hover-card-popover_properties_horizontal-padding
|
|
223
|
+
) !important;
|
|
224
|
+
font-family: var(
|
|
225
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_font-family
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.dropdown :global(.MuiPickersCalendarHeader-root),
|
|
230
|
+
.dropdown :global(.MuiDayCalendar-weekDayLabel) {
|
|
231
|
+
color: var(
|
|
232
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_content
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* Month label + prev/next nav controls: styled as Recursica's own "text" button variant (small
|
|
237
|
+
size) rather than bare popover text — same treatment as mantine-adapter's
|
|
238
|
+
.calendarHeaderControl/.calendarHeaderLevel. */
|
|
239
|
+
.dropdown :global(.MuiPickersArrowSwitcher-button),
|
|
240
|
+
.dropdown :global(.MuiPickersCalendarHeader-switchViewButton) {
|
|
241
|
+
position: relative;
|
|
242
|
+
border-style: solid;
|
|
243
|
+
border-width: var(
|
|
244
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_border-size
|
|
245
|
+
);
|
|
246
|
+
border-color: var(
|
|
247
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_border-color
|
|
248
|
+
);
|
|
249
|
+
background-color: var(
|
|
250
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_background-color
|
|
251
|
+
);
|
|
252
|
+
box-shadow: var(
|
|
253
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_elevation
|
|
254
|
+
);
|
|
255
|
+
color: var(
|
|
256
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_text-color
|
|
257
|
+
);
|
|
258
|
+
font-family: var(
|
|
259
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-family
|
|
260
|
+
);
|
|
261
|
+
transition: all 0.2s ease;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.dropdown :global(.MuiPickersArrowSwitcher-button) {
|
|
265
|
+
min-width: var(
|
|
266
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_small_properties_min-width
|
|
267
|
+
);
|
|
268
|
+
height: var(
|
|
269
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_height
|
|
270
|
+
);
|
|
271
|
+
border-radius: var(
|
|
272
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_small_properties_border-radius
|
|
273
|
+
);
|
|
274
|
+
padding: 0
|
|
275
|
+
var(
|
|
276
|
+
--recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_small_properties_horizontal-padding
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.dropdown :global(.MuiPickersCalendarHeader-switchViewButton) {
|
|
281
|
+
height: var(
|
|
282
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_height
|
|
283
|
+
);
|
|
284
|
+
border-radius: var(
|
|
285
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_small_properties_border-radius
|
|
286
|
+
);
|
|
287
|
+
padding: 0
|
|
288
|
+
var(
|
|
289
|
+
--recursica_ui-kit_components_button_variants_content_label_variants_sizes_small_properties_horizontal-padding
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* The "August 2026" label sits beside (not inside) .switchViewButton — the only actual button in
|
|
294
|
+
this header — but recoloring it to match keeps the whole month control reading as one unit,
|
|
295
|
+
same as mantine-adapter's single calendarHeaderLevel button. labelContainer has `role="none"`
|
|
296
|
+
(MUI marks it decorative), so this is presentation-only, no false interactive affordance. */
|
|
297
|
+
.dropdown :global(.MuiPickersCalendarHeader-label) {
|
|
298
|
+
color: var(
|
|
299
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_text-color
|
|
300
|
+
);
|
|
301
|
+
font-family: var(
|
|
302
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-family
|
|
303
|
+
);
|
|
304
|
+
font-size: var(
|
|
305
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-size
|
|
306
|
+
);
|
|
307
|
+
font-style: var(
|
|
308
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-style
|
|
309
|
+
);
|
|
310
|
+
font-weight: var(
|
|
311
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-weight
|
|
312
|
+
);
|
|
313
|
+
letter-spacing: var(
|
|
314
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_letter-spacing
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* Hover overlay, same generic mechanism (and ::after-behind-content layering) mantine-adapter uses
|
|
319
|
+
for its .calendarHeaderControl/.calendarHeaderLevel — a plain background-color+opacity change on
|
|
320
|
+
the button itself would dim its icon/text along with the fill, not just tint the surface. */
|
|
321
|
+
.dropdown :global(.MuiPickersArrowSwitcher-button)::after,
|
|
322
|
+
.dropdown :global(.MuiPickersCalendarHeader-switchViewButton)::after {
|
|
323
|
+
content: "";
|
|
324
|
+
position: absolute;
|
|
325
|
+
inset: 0;
|
|
326
|
+
border-radius: inherit;
|
|
327
|
+
z-index: -1;
|
|
328
|
+
pointer-events: none;
|
|
329
|
+
background-color: var(--recursica_brand_states_hover_color);
|
|
330
|
+
opacity: 0;
|
|
331
|
+
transition: opacity 150ms ease;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.dropdown
|
|
335
|
+
:global(.MuiPickersArrowSwitcher-button:hover:not(.Mui-disabled))::after,
|
|
336
|
+
.dropdown
|
|
337
|
+
:global(
|
|
338
|
+
.MuiPickersCalendarHeader-switchViewButton:hover:not(.Mui-disabled)
|
|
339
|
+
)::after {
|
|
340
|
+
opacity: var(--recursica_brand_states_hover_opacity);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.dropdown :global(.MuiPickersArrowSwitcher-button.Mui-disabled),
|
|
344
|
+
.dropdown :global(.MuiPickersCalendarHeader-switchViewButton.Mui-disabled) {
|
|
345
|
+
opacity: var(
|
|
346
|
+
--recursica_ui-kit_components_button_variants_styles_text_variants_states_disabled_properties_opacity
|
|
347
|
+
);
|
|
348
|
+
box-shadow: var(
|
|
349
|
+
--recursica_ui-kit_components_button_variants_styles_text_variants_states_disabled_properties_elevation
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.dropdown :global(.MuiPickersArrowSwitcher-button.Mui-focusVisible),
|
|
354
|
+
.dropdown :global(.MuiPickersCalendarHeader-switchViewButton.Mui-focusVisible) {
|
|
355
|
+
outline: none;
|
|
356
|
+
box-shadow:
|
|
357
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
358
|
+
var(--recursica_brand_states_focus_color),
|
|
359
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
360
|
+
var(--recursica_brand_states_focus_margin)
|
|
361
|
+
var(--recursica_brand_states_focus_color);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.dropdown :global(.MuiPickersArrowSwitcher-leftArrowIcon),
|
|
365
|
+
.dropdown :global(.MuiPickersArrowSwitcher-rightArrowIcon),
|
|
366
|
+
.dropdown :global(.MuiPickersCalendarHeader-switchViewIcon) {
|
|
367
|
+
color: var(
|
|
368
|
+
--recursica_ui-kit_components_button_variants_styles_text_properties_colors_icon-color
|
|
369
|
+
);
|
|
370
|
+
width: var(
|
|
371
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon
|
|
372
|
+
);
|
|
373
|
+
height: var(
|
|
374
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_icon
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Day cells */
|
|
379
|
+
.dropdown :global(.MuiPickerDay-root) {
|
|
380
|
+
position: relative;
|
|
381
|
+
color: var(
|
|
382
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_content
|
|
383
|
+
);
|
|
384
|
+
border-radius: var(--recursica_brand_dimensions_border-radii_default);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* Today marker: reuse the popover border-size/color tokens already used for the dropdown surface
|
|
388
|
+
itself, same reasoning as mantine-adapter (no dedicated "today" indicator token exists).
|
|
389
|
+
background-color reset because MUI's own default .MuiPickerDay-today rule ships a light
|
|
390
|
+
primary-color tint that this design system has no equivalent for. */
|
|
391
|
+
.dropdown :global(.MuiPickerDay-today:not(.Mui-selected)) {
|
|
392
|
+
background-color: transparent;
|
|
393
|
+
border-style: solid;
|
|
394
|
+
border-width: var(
|
|
395
|
+
--recursica_ui-kit_components_hover-card-popover_properties_border-size
|
|
396
|
+
);
|
|
397
|
+
border-color: var(
|
|
398
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_border-color
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* Hover overlay: same ::after-behind-content technique as the header buttons above and
|
|
403
|
+
mantine-adapter's .day — MUI's PickerDay renders the day number as a bare text node with no
|
|
404
|
+
wrapping span to z-index above the overlay, so this sits at z-index: -1 instead. */
|
|
405
|
+
.dropdown :global(.MuiPickerDay-root)::after {
|
|
406
|
+
content: "";
|
|
407
|
+
position: absolute;
|
|
408
|
+
inset: 0;
|
|
409
|
+
border-radius: inherit;
|
|
410
|
+
z-index: -1;
|
|
411
|
+
pointer-events: none;
|
|
412
|
+
background-color: var(--recursica_brand_states_hover_color);
|
|
413
|
+
opacity: 0;
|
|
414
|
+
transition: opacity 150ms ease;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.dropdown
|
|
418
|
+
:global(.MuiPickerDay-root:hover:not(.Mui-disabled, .Mui-selected))::after {
|
|
419
|
+
opacity: var(--recursica_brand_states_hover_opacity);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* Outside-month & disabled days: dim with the generic disabled-opacity token, same convention used
|
|
423
|
+
repo-wide for elements with no dedicated disabled token. */
|
|
424
|
+
.dropdown :global(.MuiPickerDay-dayOutsideMonth),
|
|
425
|
+
.dropdown :global(.MuiPickerDay-root.Mui-disabled) {
|
|
426
|
+
opacity: var(--recursica_brand_states_disabled);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.dropdown :global(.MuiPickerDay-root.Mui-disabled) {
|
|
430
|
+
cursor: not-allowed;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.dropdown :global(.MuiPickerDay-root.Mui-selected) {
|
|
434
|
+
background-color: var(
|
|
435
|
+
--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_background-color
|
|
436
|
+
) !important;
|
|
437
|
+
color: var(
|
|
438
|
+
--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text-color
|
|
439
|
+
) !important;
|
|
440
|
+
opacity: 1;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.dropdown :global(.MuiPickerDay-root.Mui-focusVisible) {
|
|
444
|
+
outline: none;
|
|
445
|
+
box-shadow:
|
|
446
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
447
|
+
var(--recursica_brand_states_focus_color),
|
|
448
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
449
|
+
var(--recursica_brand_states_focus_margin)
|
|
450
|
+
var(--recursica_brand_states_focus_color);
|
|
451
|
+
}
|
|
@@ -13,7 +13,7 @@ const meta: Meta<typeof DatePicker> = {
|
|
|
13
13
|
The \`DatePicker\` primitive provides a unified calendar date selection input integrated directly into the \`FormControlWrapper\` architecture.
|
|
14
14
|
|
|
15
15
|
### Architectural Decoupling
|
|
16
|
-
Recursica overrides
|
|
16
|
+
Recursica overrides MUI X's \`DatePicker\` field/popover defaults, safely injecting the date picker into our rigid structural layout systems. State modifiers (e.g. Focus, Errors, ReadOnly) hook seamlessly back onto our native CSS mapping architecture.
|
|
17
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
Always structure horizontal architectures via the generic \`formLayout\` parameter.
|
|
@@ -65,7 +65,6 @@ export const Default: Story = {
|
|
|
65
65
|
args: {
|
|
66
66
|
disabled: false,
|
|
67
67
|
label: "Project Deadline",
|
|
68
|
-
placeholder: "Select a deadline...",
|
|
69
68
|
assistiveText: "Specify the absolute cutoff for code submission.",
|
|
70
69
|
},
|
|
71
70
|
};
|
|
@@ -73,40 +72,42 @@ export const Default: Story = {
|
|
|
73
72
|
export const FormsSideBySide: Story = {
|
|
74
73
|
args: {
|
|
75
74
|
label: "Incident Start Date",
|
|
76
|
-
placeholder: "Pick date...",
|
|
77
75
|
assistiveText: "When did the incident originally occur?",
|
|
78
76
|
formLayout: "side-by-side",
|
|
79
77
|
},
|
|
80
78
|
};
|
|
81
79
|
|
|
80
|
+
function CustomLeadingIcon({ className }: { className?: string }) {
|
|
81
|
+
return (
|
|
82
|
+
<svg
|
|
83
|
+
className={className}
|
|
84
|
+
width="24"
|
|
85
|
+
height="24"
|
|
86
|
+
viewBox="0 0 24 24"
|
|
87
|
+
fill="none"
|
|
88
|
+
stroke="currentColor"
|
|
89
|
+
strokeWidth="2"
|
|
90
|
+
strokeLinecap="round"
|
|
91
|
+
strokeLinejoin="round"
|
|
92
|
+
>
|
|
93
|
+
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
94
|
+
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
95
|
+
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
96
|
+
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
97
|
+
</svg>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
82
101
|
export const WithLeadingIcon: Story = {
|
|
83
102
|
args: {
|
|
84
103
|
label: "Launch Date",
|
|
85
|
-
|
|
86
|
-
leftSection: (
|
|
87
|
-
<svg
|
|
88
|
-
width="24"
|
|
89
|
-
height="24"
|
|
90
|
-
viewBox="0 0 24 24"
|
|
91
|
-
fill="none"
|
|
92
|
-
stroke="currentColor"
|
|
93
|
-
strokeWidth="2"
|
|
94
|
-
strokeLinecap="round"
|
|
95
|
-
strokeLinejoin="round"
|
|
96
|
-
>
|
|
97
|
-
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
98
|
-
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
99
|
-
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
100
|
-
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
101
|
-
</svg>
|
|
102
|
-
),
|
|
104
|
+
slots: { openPickerIcon: CustomLeadingIcon },
|
|
103
105
|
},
|
|
104
106
|
};
|
|
105
107
|
|
|
106
108
|
export const Disabled: Story = {
|
|
107
109
|
args: {
|
|
108
110
|
label: "Disabled Date Range",
|
|
109
|
-
placeholder: "Disabled selection...",
|
|
110
111
|
disabled: true,
|
|
111
112
|
},
|
|
112
113
|
};
|
|
@@ -114,7 +115,6 @@ export const Disabled: Story = {
|
|
|
114
115
|
export const ErrorState: Story = {
|
|
115
116
|
args: {
|
|
116
117
|
label: "Execution Date",
|
|
117
|
-
placeholder: "Pick a valid date...",
|
|
118
118
|
error: "The chosen date conflicts with an existing deployment freeze.",
|
|
119
119
|
required: true,
|
|
120
120
|
},
|
|
@@ -123,7 +123,6 @@ export const ErrorState: Story = {
|
|
|
123
123
|
export const StaticReadOnly: Story = {
|
|
124
124
|
args: {
|
|
125
125
|
label: "Static ReadOnly Review",
|
|
126
|
-
placeholder: "Ignored...",
|
|
127
126
|
value: new Date("2026-05-21"),
|
|
128
127
|
readOnly: true,
|
|
129
128
|
},
|
|
@@ -132,7 +131,6 @@ export const StaticReadOnly: Story = {
|
|
|
132
131
|
export const EditableReadOnly: Story = {
|
|
133
132
|
args: {
|
|
134
133
|
label: "Editable ReadOnly Review",
|
|
135
|
-
placeholder: "Ignored until active...",
|
|
136
134
|
defaultValue: new Date("2026-06-01"),
|
|
137
135
|
readOnly: true,
|
|
138
136
|
labelWithEditIcon: true,
|