@lobehub/ui 5.63.3 → 5.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/es/base-ui/DatePicker/DatePicker.d.mts +7 -2
  2. package/es/base-ui/DatePicker/DatePicker.mjs +13 -83
  3. package/es/base-ui/DatePicker/DatePicker.mjs.map +1 -1
  4. package/es/base-ui/DatePicker/DateRangePicker.d.mts +3 -2
  5. package/es/base-ui/DatePicker/DateRangePicker.mjs +3 -123
  6. package/es/base-ui/DatePicker/DateRangePicker.mjs.map +1 -1
  7. package/es/base-ui/DatePicker/PurePanel.mjs +80 -0
  8. package/es/base-ui/DatePicker/PurePanel.mjs.map +1 -0
  9. package/es/base-ui/DatePicker/RangePicker.mjs +120 -0
  10. package/es/base-ui/DatePicker/RangePicker.mjs.map +1 -0
  11. package/es/base-ui/DatePicker/SinglePicker.mjs +143 -0
  12. package/es/base-ui/DatePicker/SinglePicker.mjs.map +1 -0
  13. package/es/base-ui/DatePicker/generateConfig.mjs +12 -0
  14. package/es/base-ui/DatePicker/generateConfig.mjs.map +1 -0
  15. package/es/base-ui/DatePicker/generatePicker.d.mts +12 -0
  16. package/es/base-ui/DatePicker/generatePicker.mjs +22 -0
  17. package/es/base-ui/DatePicker/generatePicker.mjs.map +1 -0
  18. package/es/base-ui/DatePicker/index.d.mts +4 -3
  19. package/es/base-ui/DatePicker/locale.d.mts +16 -0
  20. package/es/base-ui/DatePicker/locale.mjs +136 -0
  21. package/es/base-ui/DatePicker/locale.mjs.map +1 -0
  22. package/es/base-ui/DatePicker/semantic.mjs +34 -0
  23. package/es/base-ui/DatePicker/semantic.mjs.map +1 -0
  24. package/es/base-ui/DatePicker/style.mjs +982 -139
  25. package/es/base-ui/DatePicker/style.mjs.map +1 -1
  26. package/es/base-ui/DatePicker/type.d.mts +281 -25
  27. package/es/base-ui/DatePicker/usePanelKeyboard.mjs +230 -0
  28. package/es/base-ui/DatePicker/usePanelKeyboard.mjs.map +1 -0
  29. package/es/base-ui/DatePicker/usePickerShared.mjs +136 -0
  30. package/es/base-ui/DatePicker/usePickerShared.mjs.map +1 -0
  31. package/es/base-ui/DatePicker/usePresetActive.mjs +48 -0
  32. package/es/base-ui/DatePicker/usePresetActive.mjs.map +1 -0
  33. package/es/base-ui/Table/FixedFrost.mjs +3 -3
  34. package/es/base-ui/Table/FixedFrost.mjs.map +1 -1
  35. package/es/base-ui/index.d.mts +4 -3
  36. package/es/base-ui/index.mjs +3 -1
  37. package/es/i18n/resources/en/datePicker.d.mts +47 -0
  38. package/es/i18n/resources/en/datePicker.mjs +48 -1
  39. package/es/i18n/resources/en/datePicker.mjs.map +1 -1
  40. package/es/i18n/resources/zhCn/datePicker.d.mts +47 -0
  41. package/es/i18n/resources/zhCn/datePicker.mjs +48 -1
  42. package/es/i18n/resources/zhCn/datePicker.mjs.map +1 -1
  43. package/es/i18n/resources/zhCn/index.mjs +1 -1
  44. package/es/utils/styleEngine.mjs +1 -0
  45. package/package.json +2 -1
  46. package/es/base-ui/DatePicker/CalendarPanel.mjs +0 -188
  47. package/es/base-ui/DatePicker/CalendarPanel.mjs.map +0 -1
  48. package/es/base-ui/DatePicker/PickerShell.mjs +0 -43
  49. package/es/base-ui/DatePicker/PickerShell.mjs.map +0 -1
  50. package/es/base-ui/DatePicker/calendar.d.mts +0 -5
  51. package/es/base-ui/DatePicker/calendar.mjs +0 -46
  52. package/es/base-ui/DatePicker/calendar.mjs.map +0 -1
@@ -1,194 +1,1037 @@
1
1
  import { focusRing } from "../focusRing.mjs";
2
- import { createStaticStyles } from "antd-style";
2
+ import { createStaticStyles } from "../../utils/styleEngine.mjs";
3
3
  //#region src/base-ui/DatePicker/style.ts
4
+ /** Own prefix so rc-picker class names never collide with antd's global `.ant-picker` CSS. */
5
+ const PREFIX_CLS = "lobe-picker";
6
+ const P = PREFIX_CLS;
7
+ const MOTION = `${P}-slide-up`;
8
+ /**
9
+ * Styles for rc-picker's class-name contract. `root` is passed as `rootClassName`, which
10
+ * rc-picker puts on both the input box (`.lobe-picker`) and the popup
11
+ * (`.lobe-picker-dropdown`); the box itself reuses base-ui Input's `rootVariants`.
12
+ */
4
13
  const styles = createStaticStyles(({ css, cssVar }) => ({
5
- band: css`
6
- background: ${cssVar.colorFillSecondary};
7
- `,
8
- bandEnd: css`
9
- background: linear-gradient(to left, transparent 50%, ${cssVar.colorFillSecondary} 50%);
10
- `,
11
- bandStart: css`
12
- background: linear-gradient(to right, transparent 50%, ${cssVar.colorFillSecondary} 50%);
13
- `,
14
- calendar: css`
15
- display: flex;
16
- flex-direction: column;
17
- gap: 8px;
18
- width: 266px;
19
- `,
20
- cell: css`
21
- display: flex;
22
- justify-content: center;
14
+ /** antd's `underlined`: only a bottom border, applied over Input's `borderless`. */
15
+ underlined: css`
16
+ &.${P} {
17
+ border-block-end-color: ${cssVar.colorBorder};
18
+ border-radius: 0;
19
+ }
20
+
21
+ &.${P}:hover:not(:focus-within, .${P}-disabled) {
22
+ border-block-end-color: ${cssVar.colorPrimaryHover};
23
+ }
24
+
25
+ &.${P}:focus-within {
26
+ border-block-end-color: ${cssVar.colorPrimary};
27
+ }
23
28
  `,
24
- day: css`
25
- ${focusRing};
26
- cursor: pointer;
29
+ root: css`
30
+ /* ---------------------------------------------------------------- input box */
31
+ &.${P} {
32
+ position: relative;
33
+ }
27
34
 
28
- display: flex;
29
- align-items: center;
30
- justify-content: center;
35
+ &.${P} .${P}-input {
36
+ position: relative;
31
37
 
32
- width: 34px;
33
- height: 34px;
34
- padding: 0;
35
- border: 0;
36
- border-radius: 50%;
38
+ display: inline-flex;
39
+ flex: 1;
40
+ gap: 8px;
41
+ align-items: center;
37
42
 
38
- font: inherit;
39
- font-size: 13px;
40
- font-variant-numeric: tabular-nums;
41
- color: ${cssVar.colorText};
43
+ min-width: 0;
44
+ }
42
45
 
43
- background: none;
46
+ &.${P} .${P}-input > input {
47
+ flex: 1;
44
48
 
45
- &:hover:not(:disabled, [aria-pressed='true']) {
46
- background: ${cssVar.colorFillTertiary};
49
+ width: 100%;
50
+ min-width: 0;
51
+ padding: 0;
52
+ border: none;
53
+
54
+ font: inherit;
55
+ font-variant-numeric: tabular-nums;
56
+ color: inherit;
57
+ text-overflow: ellipsis;
58
+
59
+ appearance: none;
60
+ background: transparent;
61
+ outline: none;
62
+
63
+ &::placeholder {
64
+ color: ${cssVar.colorTextPlaceholder};
65
+ }
66
+
67
+ &:disabled {
68
+ cursor: not-allowed;
69
+ }
47
70
  }
48
71
 
49
- &:disabled {
72
+ /*
73
+ * \`disabled: [boolean, boolean]\`: Input greys the whole root on \`:has(input:disabled)\`;
74
+ * while one end stays editable (rc adds \`-disabled\` only when both are), grey just that end.
75
+ */
76
+ &.${P}-range:not(.${P}-disabled):has(input:disabled) {
77
+ cursor: auto;
78
+ color: ${cssVar.colorText};
79
+ opacity: 1;
80
+ }
81
+
82
+ &.${P}-range:not(.${P}-disabled) .${P}-input:has(> input:disabled) {
50
83
  cursor: not-allowed;
51
84
  color: ${cssVar.colorTextQuaternary};
52
85
  }
53
86
 
54
- &[data-outside] {
87
+ /* hover preview text from presets / cells */
88
+ &.${P} .${P}-input-placeholder > input {
89
+ color: ${cssVar.colorTextPlaceholder};
90
+ }
91
+
92
+ &.${P} .${P}-prefix {
93
+ display: inline-flex;
94
+ flex: none;
95
+ align-items: center;
96
+ color: ${cssVar.colorTextTertiary};
97
+ }
98
+
99
+ &.${P} .${P}-suffix {
100
+ pointer-events: none;
101
+
102
+ display: inline-flex;
103
+ flex: none;
104
+ align-items: center;
105
+ justify-content: center;
106
+
107
+ width: 16px;
108
+
109
+ color: ${cssVar.colorTextTertiary};
110
+
111
+ transition: opacity 150ms ${cssVar.motionEaseOut};
112
+ }
113
+
114
+ /* the clear button sits on top of the suffix icon (16px wide + 8px gap) */
115
+ &.${P} .${P}-clear {
116
+ cursor: pointer;
117
+
118
+ position: relative;
119
+ z-index: 1;
120
+
121
+ display: inline-flex;
122
+ flex: none;
123
+ align-items: center;
124
+ justify-content: center;
125
+
126
+ width: 16px;
127
+ height: 16px;
128
+ margin-inline-start: -24px;
129
+ padding: 0;
130
+ border: 0;
131
+ border-radius: 50%;
132
+
133
+ color: ${cssVar.colorBgContainer};
134
+
135
+ opacity: 0;
136
+ background: ${cssVar.colorTextQuaternary};
137
+
138
+ transition: opacity 150ms ${cssVar.motionEaseOut};
139
+
140
+ &:hover {
141
+ background: ${cssVar.colorTextTertiary};
142
+ }
143
+ }
144
+
145
+ &.${P}:not(.${P}-disabled):hover .${P}-clear {
146
+ opacity: 1;
147
+ }
148
+
149
+ &.${P}:not(.${P}-disabled):hover .${P}-suffix:not(:last-child) {
150
+ opacity: 0;
151
+ }
152
+
153
+ &.${P}-disabled .${P}-clear {
154
+ display: none;
155
+ }
156
+
157
+ /*
158
+ * multiple: rc-picker's tags (\`-selection-item\`, also the \`+ N ...\` rest) in base-ui Tag's
159
+ * filled look, sized as antd (control height - 8px) and wrapping the box when they overflow.
160
+ */
161
+ &.${P}-multiple {
162
+ --lobe-picker-tag-height: 24px;
163
+
164
+ cursor: pointer;
165
+ padding-block: 1px;
166
+ }
167
+
168
+ &.${P}-multiple.${P}-small {
169
+ --lobe-picker-tag-height: 16px;
170
+ }
171
+
172
+ &.${P}-multiple.${P}-large {
173
+ --lobe-picker-tag-height: 32px;
174
+ }
175
+
176
+ &.${P}-multiple .${P}-selector {
177
+ position: relative;
178
+ flex: 1;
179
+ min-width: 0;
180
+ }
181
+
182
+ &.${P}-multiple .${P}-selection-overflow {
183
+ display: flex;
184
+ flex-wrap: wrap;
185
+ align-items: center;
186
+ max-width: 100%;
187
+ }
188
+
189
+ &.${P}-multiple .${P}-selection-overflow-item {
190
+ flex: none;
191
+ max-width: 100%;
192
+ }
193
+
194
+ &.${P}-multiple .${P}-selection-item {
195
+ display: flex;
196
+ gap: 4px;
197
+ align-items: center;
198
+
199
+ box-sizing: border-box;
200
+ max-width: 100%;
201
+ height: var(--lobe-picker-tag-height);
202
+ margin-block: 2px;
203
+ margin-inline-end: 4px;
204
+ padding-inline: 8px 4px;
205
+ border-radius: ${cssVar.borderRadiusSM};
206
+
207
+ font-size: ${cssVar.fontSizeSM};
208
+ line-height: var(--lobe-picker-tag-height);
209
+ color: ${cssVar.colorText};
210
+ white-space: nowrap;
211
+
212
+ background: ${cssVar.colorFillSecondary};
213
+ }
214
+
215
+ &.${P}-multiple.${P}-large .${P}-selection-item {
216
+ font-size: ${cssVar.fontSize};
217
+ }
218
+
219
+ &.${P}-multiple .${P}-selection-item:not(:has(.${P}-selection-item-remove)) {
220
+ padding-inline-end: 8px;
221
+ }
222
+
223
+ &.${P}-multiple .${P}-selection-item-content {
224
+ overflow: hidden;
225
+ font-variant-numeric: tabular-nums;
226
+ text-overflow: ellipsis;
227
+ }
228
+
229
+ &.${P}-multiple .${P}-selection-item-remove {
230
+ cursor: pointer;
231
+
232
+ display: inline-flex;
233
+ flex: none;
234
+ align-items: center;
235
+
236
+ color: ${cssVar.colorIcon};
237
+
238
+ &:hover {
239
+ color: ${cssVar.colorTextHeading};
240
+ }
241
+ }
242
+
243
+ &.${P}-multiple .${P}-selection-placeholder {
244
+ overflow: hidden;
245
+ display: block;
246
+
247
+ line-height: calc(var(--lobe-picker-tag-height) + 4px);
248
+ color: ${cssVar.colorTextPlaceholder};
249
+ text-overflow: ellipsis;
250
+ white-space: nowrap;
251
+ }
252
+
253
+ /* the selector shows the value; rc-picker keeps this readonly input only for focus */
254
+ &.${P}-multiple .${P}-multiple-input {
255
+ position: absolute;
256
+ z-index: -1;
257
+
258
+ width: 0;
259
+ height: 0;
260
+ padding: 0;
261
+ border: 0;
262
+
263
+ opacity: 0;
264
+ }
265
+
266
+ &.${P}-multiple.${P}-disabled {
267
+ cursor: not-allowed;
55
268
  color: ${cssVar.colorTextQuaternary};
269
+ opacity: 0.66;
56
270
  }
57
271
 
58
- &[data-today] {
59
- box-shadow: inset 0 0 0 1px ${cssVar.colorText};
272
+ /* status: border + focus ring per variant, as antd's genStatusStyle */
273
+ &.${P}-status-error {
274
+ --lobe-picker-status: ${cssVar.colorError};
275
+ --lobe-picker-status-hover: ${cssVar.colorErrorBorderHover};
276
+ --lobe-picker-status-bg: ${cssVar.colorErrorBg};
277
+ --lobe-picker-status-bg-hover: ${cssVar.colorErrorBgHover};
60
278
  }
61
279
 
62
- &[aria-pressed='true'] {
280
+ &.${P}-status-warning {
281
+ --lobe-picker-status: ${cssVar.colorWarning};
282
+ --lobe-picker-status-hover: ${cssVar.colorWarningBorderHover};
283
+ --lobe-picker-status-bg: ${cssVar.colorWarningBg};
284
+ --lobe-picker-status-bg-hover: ${cssVar.colorWarningBgHover};
285
+ }
286
+
287
+ &:is(.${P}-status-error, .${P}-status-warning):not(.${P}-disabled) {
288
+ &.${P}-outlined {
289
+ border-color: var(--lobe-picker-status);
290
+
291
+ &:hover:not(:focus-within) {
292
+ border-color: var(--lobe-picker-status-hover);
293
+ }
294
+
295
+ &:focus-within {
296
+ border-color: var(--lobe-picker-status);
297
+ box-shadow: 0 0 0 2px var(--lobe-picker-status-bg);
298
+ }
299
+ }
300
+
301
+ &.${P}-filled {
302
+ background: var(--lobe-picker-status-bg);
303
+
304
+ &:hover:not(:focus-within) {
305
+ background: var(--lobe-picker-status-bg-hover);
306
+ }
307
+
308
+ &:focus-within {
309
+ border-color: var(--lobe-picker-status);
310
+ background: ${cssVar.colorBgContainer};
311
+ }
312
+ }
313
+
314
+ &.${P}-underlined {
315
+ border-block-end-color: var(--lobe-picker-status);
316
+ }
317
+
318
+ &:is(.${P}-borderless, .${P}-underlined) .${P}-input > input {
319
+ color: var(--lobe-picker-status);
320
+ }
321
+
322
+ .${P}-prefix {
323
+ color: var(--lobe-picker-status);
324
+ }
325
+ }
326
+
327
+ /* rtl: rc-picker adds the -rtl modifier to the box and the popup; lucide arrows are mirrored */
328
+ &.${P}-rtl, &.${P}-dropdown-rtl {
329
+ direction: rtl;
330
+ }
331
+
332
+ &.${P}-rtl .${P}-range-separator .lucide,
333
+ &.${P}-dropdown-rtl .${P}-header > button .lucide {
334
+ transform: scaleX(-1);
335
+ }
336
+
337
+ /* range: two inputs, a separator and the bar under the active field */
338
+ &.${P}-range .${P}-input {
339
+ flex: 1;
340
+ }
341
+
342
+ &.${P}-range .${P}-range-separator {
343
+ display: inline-flex;
344
+ flex: none;
345
+ align-items: center;
346
+ color: ${cssVar.colorTextTertiary};
347
+ }
348
+
349
+ &.${P}-range .${P}-active-bar {
350
+ pointer-events: none;
351
+
352
+ position: absolute;
353
+ inset-block-end: -1px;
354
+
355
+ height: 2px;
356
+
357
+ opacity: 0;
358
+ background: ${cssVar.colorPrimary};
359
+
360
+ transition:
361
+ inset-inline-start 200ms ${cssVar.motionEaseOut},
362
+ width 200ms ${cssVar.motionEaseOut},
363
+ opacity 200ms ${cssVar.motionEaseOut};
364
+ }
365
+
366
+ &.${P}-range.${P}-focused .${P}-active-bar {
367
+ opacity: 1;
368
+ }
369
+
370
+ /* ---------------------------------------------------------------- popup */
371
+ &.${P}-dropdown {
372
+ /* nested in a base-ui Modal / Popover layer that sets pointer-events: none */
373
+ pointer-events: auto;
374
+
375
+ position: absolute;
376
+ inset-block-start: -9999px;
377
+ inset-inline-start: -9999px;
378
+
379
+ font-size: 14px;
380
+ color: ${cssVar.colorText};
381
+ }
382
+
383
+ &.${P}-dropdown-hidden {
384
+ display: none;
385
+ }
386
+
387
+ &.${P}-dropdown .${P}-range-arrow {
388
+ display: none;
389
+ }
390
+
391
+ /* rc-trigger stretches the popup to the input width; only the container is painted */
392
+ &.${P}-dropdown .${P}-panel-container {
393
+ overflow: hidden;
394
+ display: inline-block;
395
+
396
+ border-radius: 16px;
397
+
398
+ vertical-align: top;
399
+
400
+ background: ${cssVar.colorBgElevated};
401
+ box-shadow: ${cssVar.boxShadow}, var(--lobe-ring);
402
+ }
403
+
404
+ &.${P}-dropdown .${P}-panel-layout {
405
+ display: flex;
406
+ align-items: stretch;
407
+ }
408
+
409
+ &.${P}-dropdown .${P}-panels {
410
+ display: flex;
411
+ flex-wrap: nowrap;
412
+ }
413
+
414
+ /* presets: a sidebar on the start side of the panels, as in antd */
415
+ &.${P}-dropdown .${P}-presets {
416
+ display: flex;
417
+ flex-direction: column;
418
+
419
+ min-width: 120px;
420
+ max-width: 200px;
421
+
422
+ /* divider one step lighter than the panel borders: light colorFillSecondary,
423
+ dark colorFillTertiary (see the -dropdown-dark rule below) */
424
+ border-inline-end: 1px solid ${cssVar.colorFillSecondary};
425
+
426
+ /* slightly tinted; the panel container's radius + overflow clip it */
427
+ background: ${cssVar.colorFillQuaternary};
428
+
429
+ ul {
430
+ overflow: auto;
431
+ flex: auto;
432
+
433
+ height: 0;
434
+ margin: 0;
435
+ padding: 6px;
436
+
437
+ list-style: none;
438
+ }
439
+
440
+ li {
441
+ cursor: pointer;
442
+
443
+ overflow: hidden;
444
+
445
+ padding-block: 4px;
446
+ padding-inline: 8px;
447
+ border-radius: 6px;
448
+
449
+ font-size: 13px;
450
+ line-height: 20px;
451
+ color: ${cssVar.colorText};
452
+ text-overflow: ellipsis;
453
+ white-space: nowrap;
454
+
455
+ transition: background-color 150ms ${cssVar.motionEaseOut};
456
+
457
+ &:hover {
458
+ background: ${cssVar.colorFillTertiary};
459
+ }
460
+
461
+ &:has(> .${P}-preset-active) {
462
+ font-weight: 500;
463
+ background: ${cssVar.colorFillSecondary};
464
+ }
465
+ }
466
+
467
+ li + li {
468
+ margin-block-start: 2px;
469
+ }
470
+ }
471
+
472
+ /* dark: fill tokens are white-alpha and would lighten the sidebar, so darken it */
473
+ &.${P}-dropdown.${P}-dropdown-dark .${P}-presets {
474
+ border-inline-end-color: ${cssVar.colorFillTertiary};
475
+ background: rgb(0 0 0 / 12%);
476
+ }
477
+
478
+ &.${P}-dropdown .${P}-panel {
479
+ display: inline-flex;
480
+ flex-direction: column;
481
+ outline: none;
482
+ }
483
+
484
+ &.${P}-dropdown .${P}-panels > .${P}-panel + .${P}-panel {
485
+ border-inline-start: 1px solid ${cssVar.colorBorderSecondary};
486
+ }
487
+
488
+ &.${P}-dropdown
489
+ :is(
490
+ .${P}-date-panel,
491
+ .${P}-week-panel,
492
+ .${P}-month-panel,
493
+ .${P}-quarter-panel,
494
+ .${P}-year-panel,
495
+ .${P}-decade-panel
496
+ ) {
497
+ width: 288px;
498
+ }
499
+
500
+ /* header: << < [month year] > >> */
501
+ &.${P}-dropdown .${P}-header {
502
+ display: flex;
503
+ gap: 2px;
504
+ align-items: center;
505
+
506
+ padding-block: 12px 4px;
507
+ padding-inline: 12px;
508
+ }
509
+
510
+ &.${P}-dropdown .${P}-header > button {
511
+ ${focusRing};
512
+ cursor: pointer;
513
+
514
+ display: inline-flex;
515
+ flex: none;
516
+ align-items: center;
517
+ justify-content: center;
518
+
519
+ width: 28px;
520
+ height: 28px;
521
+ padding: 0;
522
+ border: 0;
523
+ border-radius: 50%;
524
+
525
+ color: ${cssVar.colorTextSecondary};
526
+
527
+ background: none;
528
+
529
+ &:hover:not(:disabled) {
530
+ color: ${cssVar.colorText};
531
+ background: ${cssVar.colorFillTertiary};
532
+ }
533
+ }
534
+
535
+ &.${P}-dropdown
536
+ :is(
537
+ .${P}-header-prev-btn-disabled,
538
+ .${P}-header-next-btn-disabled,
539
+ .${P}-header-super-prev-btn-disabled,
540
+ .${P}-header-super-next-btn-disabled
541
+ ) {
542
+ cursor: not-allowed;
543
+ opacity: 0.3;
544
+ }
545
+
546
+ &.${P}-dropdown .${P}-header-view {
547
+ display: flex;
548
+ flex: 1;
549
+ gap: 4px;
550
+ align-items: center;
551
+ justify-content: center;
552
+
553
+ min-width: 0;
554
+
63
555
  font-weight: 600;
64
- color: ${cssVar.colorBgContainer};
65
- background: ${cssVar.colorText};
66
556
  }
67
- `,
68
- footer: css`
69
- display: flex;
70
- justify-content: center;
71
557
 
72
- margin-block-start: 12px;
73
- padding-block-start: 12px;
74
- border-block-start: 1px solid ${cssVar.colorBorderSecondary};
75
- `,
76
- grid: css`
77
- display: grid;
78
- grid-template-columns: repeat(7, minmax(0, 1fr));
79
- row-gap: 2px;
80
- `,
81
- header: css`
82
- display: flex;
83
- align-items: center;
84
- justify-content: space-between;
85
- margin-block-end: 4px;
86
- `,
87
- icon: css`
88
- display: inline-flex;
89
- flex: none;
90
- color: ${cssVar.colorTextTertiary};
91
- `,
92
- navGroup: css`
93
- display: flex;
94
- gap: 2px;
95
- `,
96
- placeholder: css`
97
- color: ${cssVar.colorTextPlaceholder};
98
- `,
99
- range: css`
100
- display: flex;
101
- gap: 28px;
102
- `,
103
- rangeHalf: css`
104
- flex: 1;
105
- min-width: 0;
106
- padding-block: 2px;
558
+ &.${P}-dropdown .${P}-header-view > button {
559
+ ${focusRing};
560
+ cursor: pointer;
561
+
562
+ padding-block: 2px;
563
+ padding-inline: 4px;
564
+ border: 0;
565
+ border-radius: 6px;
107
566
 
108
- &[data-active] {
109
- box-shadow: inset 0 -2px 0 ${cssVar.colorText};
567
+ font: inherit;
568
+ color: inherit;
569
+
570
+ background: none;
571
+
572
+ &:hover:not(:disabled) {
573
+ color: ${cssVar.colorPrimary};
574
+ }
575
+
576
+ &:disabled {
577
+ cursor: default;
578
+ }
110
579
  }
111
- `,
112
- rangeTrigger: css`
113
- display: flex;
114
- flex: 1;
115
- gap: 8px;
116
- align-items: center;
117
580
 
118
- min-width: 0;
119
- `,
120
- tile: css`
121
- ${focusRing};
122
- cursor: pointer;
581
+ /* body + cells */
582
+ &.${P}-dropdown .${P}-body {
583
+ padding-block: 4px 12px;
584
+ padding-inline: 12px;
585
+ }
586
+
587
+ &.${P}-dropdown .${P}-content {
588
+ table-layout: fixed;
589
+ border-collapse: collapse;
590
+ width: 100%;
591
+ }
592
+
593
+ &.${P}-dropdown .${P}-content th {
594
+ height: 28px;
595
+ padding: 0;
596
+
597
+ font-size: 12px;
598
+ font-weight: 400;
599
+ color: ${cssVar.colorTextTertiary};
600
+ text-align: center;
601
+ }
602
+
603
+ &.${P}-dropdown .${P}-cell {
604
+ cursor: pointer;
605
+
606
+ position: relative;
607
+
608
+ padding-block: 2px;
609
+ padding-inline: 0;
610
+
611
+ color: ${cssVar.colorTextQuaternary};
612
+ text-align: center;
613
+
614
+ &::before {
615
+ content: '';
616
+
617
+ position: absolute;
618
+ z-index: 0;
619
+ inset-block-start: 50%;
620
+ inset-inline: 0;
621
+ transform: translateY(-50%);
622
+
623
+ height: 32px;
624
+ }
625
+ }
123
626
 
124
- height: 40px;
125
- padding: 0;
126
- border: 0;
127
- border-radius: 999px;
627
+ &.${P}-dropdown .${P}-cell-in-view {
628
+ color: ${cssVar.colorText};
629
+ }
630
+
631
+ &.${P}-dropdown .${P}-cell-inner {
632
+ position: relative;
633
+ z-index: 1;
634
+
635
+ display: inline-flex;
636
+ align-items: center;
637
+ justify-content: center;
128
638
 
129
- font: inherit;
130
- font-size: 14px;
131
- color: ${cssVar.colorText};
639
+ box-sizing: border-box;
640
+ min-width: 32px;
641
+ height: 32px;
642
+ border-radius: 999px;
132
643
 
133
- background: none;
644
+ font-size: 13px;
645
+ font-variant-numeric: tabular-nums;
646
+
647
+ transition:
648
+ background 150ms ${cssVar.motionEaseOut},
649
+ color 150ms ${cssVar.motionEaseOut};
650
+ }
134
651
 
135
- &:hover:not(:disabled, [aria-pressed='true']) {
652
+ &.${P}-dropdown
653
+ .${P}-cell:not(
654
+ .${P}-cell-disabled,
655
+ .${P}-cell-selected,
656
+ .${P}-cell-range-start,
657
+ .${P}-cell-range-end
658
+ ):hover
659
+ .${P}-cell-inner {
136
660
  background: ${cssVar.colorFillTertiary};
137
661
  }
138
662
 
139
- &:disabled {
663
+ /* today: bold only, no ring, fill or border */
664
+ &.${P}-dropdown .${P}-cell-in-view.${P}-cell-today .${P}-cell-inner {
665
+ font-weight: ${cssVar.fontWeightStrong};
666
+ }
667
+
668
+ &.${P}-dropdown
669
+ :is(
670
+ .${P}-cell-in-view.${P}-cell-selected,
671
+ .${P}-cell-in-view.${P}-cell-range-start,
672
+ .${P}-cell-in-view.${P}-cell-range-end
673
+ )
674
+ .${P}-cell-inner {
675
+ font-weight: 600;
676
+ color: ${cssVar.colorBgContainer};
677
+ background: ${cssVar.colorText};
678
+ }
679
+
680
+ &.${P}-dropdown .${P}-cell-in-view.${P}-cell-in-range::before {
681
+ background: ${cssVar.colorFillSecondary};
682
+ }
683
+
684
+ &.${P}-dropdown .${P}-cell-in-view.${P}-cell-range-start:not(.${P}-cell-range-end)::before {
685
+ inset-inline-start: 50%;
686
+ background: ${cssVar.colorFillSecondary};
687
+ }
688
+
689
+ &.${P}-dropdown .${P}-cell-in-view.${P}-cell-range-end:not(.${P}-cell-range-start)::before {
690
+ inset-inline-end: 50%;
691
+ background: ${cssVar.colorFillSecondary};
692
+ }
693
+
694
+ &.${P}-dropdown .${P}-cell-disabled {
140
695
  cursor: not-allowed;
141
696
  color: ${cssVar.colorTextQuaternary};
142
697
  }
143
698
 
144
- &[data-today] {
145
- box-shadow: inset 0 0 0 1px ${cssVar.colorText};
699
+ &.${P}-dropdown .${P}-cell-disabled::before {
700
+ background: transparent;
701
+ }
702
+
703
+ /* month / quarter / year / decade: wider pills in a 3-column grid */
704
+ &.${P}-dropdown
705
+ :is(.${P}-month-panel, .${P}-quarter-panel, .${P}-year-panel, .${P}-decade-panel)
706
+ .${P}-cell {
707
+ padding-block: 8px;
708
+ }
709
+
710
+ &.${P}-dropdown
711
+ :is(.${P}-month-panel, .${P}-quarter-panel, .${P}-year-panel, .${P}-decade-panel)
712
+ .${P}-cell::before {
713
+ height: 36px;
714
+ }
715
+
716
+ &.${P}-dropdown
717
+ :is(.${P}-month-panel, .${P}-quarter-panel, .${P}-year-panel, .${P}-decade-panel)
718
+ .${P}-cell-inner {
719
+ min-width: 64px;
720
+ height: 36px;
721
+ padding-inline: 8px;
722
+ font-size: 14px;
723
+ }
724
+
725
+ /* decade labels ("2020-2029") stay on one line */
726
+ &.${P}-dropdown .${P}-decade-panel .${P}-cell-inner {
727
+ padding-inline: 6px;
728
+ font-size: 13px;
729
+ white-space: nowrap;
730
+ }
731
+
732
+ /* week number column: always on the week panel, on the date panel with showWeek */
733
+ &.${P}-dropdown :is(.${P}-week-panel, .${P}-date-panel-show-week) {
734
+ width: 320px;
735
+ }
736
+
737
+ &.${P}-dropdown .${P}-cell-week {
738
+ font-size: 12px;
739
+ color: ${cssVar.colorTextTertiary};
740
+ }
741
+
742
+ &.${P}-dropdown .${P}-date-panel-show-week .${P}-cell-week {
743
+ cursor: default;
744
+ }
745
+
746
+ /* week panel: the whole row is one tile, painted through each cell's band */
747
+ &.${P}-dropdown .${P}-week-panel .${P}-cell:hover .${P}-cell-inner {
748
+ background: none;
749
+ }
750
+
751
+ &.${P}-dropdown .${P}-week-panel .${P}-cell:first-child::before {
752
+ inset-inline-start: 2px;
753
+ border-start-start-radius: 999px;
754
+ border-end-start-radius: 999px;
755
+ }
756
+
757
+ &.${P}-dropdown .${P}-week-panel .${P}-cell:last-child::before {
758
+ inset-inline-end: 2px;
759
+ border-start-end-radius: 999px;
760
+ border-end-end-radius: 999px;
761
+ }
762
+
763
+ &.${P}-dropdown .${P}-week-panel-row:hover .${P}-cell::before {
764
+ background: ${cssVar.colorFillTertiary};
765
+ }
766
+
767
+ &.${P}-dropdown
768
+ .${P}-week-panel-row-range-hover
769
+ .${P}-cell::before,
770
+ &.${P}-dropdown
771
+ .${P}-week-panel-row-hover
772
+ .${P}-cell::before {
773
+ background: ${cssVar.colorFillSecondary};
774
+ }
775
+
776
+ /* multiple: rc-picker marks every picked week but the first with \`-row-hover\` */
777
+ &.${P}-dropdown
778
+ :is(
779
+ .${P}-week-panel-row-selected,
780
+ .${P}-dropdown-multiple
781
+ .${P}-week-panel-row-hover,
782
+ .${P}-week-panel-row-range-start,
783
+ .${P}-week-panel-row-range-end
784
+ )
785
+ .${P}-cell {
786
+ color: ${cssVar.colorBgContainer};
787
+
788
+ &::before {
789
+ background: ${cssVar.colorText};
790
+ }
791
+
792
+ .${P}-cell-inner {
793
+ font-weight: 600;
794
+ box-shadow: none;
795
+ }
796
+ }
797
+
798
+ /* keyboard: the tile arrow keys moved to on month / quarter / year / decade panels */
799
+ &.${P}-dropdown .${P}-cell-keyboard-active {
800
+ display: none;
801
+ }
802
+
803
+ &.${P}-dropdown .${P}-cell-in-view:has(> .${P}-cell-keyboard-active) .${P}-cell-inner {
804
+ outline: 2px solid ${cssVar.colorPrimary};
805
+ outline-offset: 1px;
806
+ }
807
+
808
+ /* time: hour / minute / second / meridiem columns, beside the date panel with showTime */
809
+ &.${P}-dropdown .${P}-datetime-panel {
810
+ display: flex;
811
+ align-items: stretch;
812
+ }
813
+
814
+ &.${P}-dropdown .${P}-datetime-panel > .${P}-time-panel {
815
+ border-inline-start: 1px solid ${cssVar.colorBorderSecondary};
816
+ }
817
+
818
+ &.${P}-dropdown .${P}-time-panel {
819
+ display: flex;
820
+ flex-direction: column;
821
+ min-width: 0;
822
+ }
823
+
824
+ &.${P}-dropdown .${P}-time-panel .${P}-header-view {
825
+ height: 28px;
826
+ font-variant-numeric: tabular-nums;
827
+ }
828
+
829
+ &.${P}-dropdown .${P}-time-panel .${P}-content {
830
+ display: flex;
831
+ flex: auto;
832
+
833
+ height: 224px;
834
+ padding-block: 4px 12px;
835
+ padding-inline: 4px;
836
+ }
837
+
838
+ /* next to the date panel the columns take its height instead */
839
+ &.${P}-dropdown .${P}-datetime-panel .${P}-time-panel .${P}-content {
840
+ flex: 1 1 0;
841
+ height: auto;
842
+ min-height: 0;
146
843
  }
147
844
 
148
- &[aria-pressed='true'] {
845
+ &.${P}-dropdown .${P}-time-panel-column {
846
+ scrollbar-width: thin;
847
+
848
+ overflow-y: hidden;
849
+ flex: none;
850
+
851
+ width: 56px;
852
+ margin: 0;
853
+ padding: 0;
854
+
855
+ list-style: none;
856
+
857
+ /* lets the last option scroll up to the top, as in antd */
858
+ &::after {
859
+ content: '';
860
+ display: block;
861
+ height: calc(100% - 28px);
862
+ }
863
+
864
+ &:hover {
865
+ overflow-y: auto;
866
+ }
867
+ }
868
+
869
+ &.${P}-dropdown .${P}-time-panel-column + .${P}-time-panel-column {
870
+ border-inline-start: 1px solid ${cssVar.colorBorderSecondary};
871
+ }
872
+
873
+ &.${P}-dropdown .${P}-time-panel-cell {
874
+ cursor: pointer;
875
+ padding-block: 1px;
876
+ padding-inline: 4px;
877
+ }
878
+
879
+ &.${P}-dropdown .${P}-time-panel-cell-inner {
880
+ height: 26px;
881
+ border-radius: 6px;
882
+
883
+ font-size: 13px;
884
+ font-variant-numeric: tabular-nums;
885
+ line-height: 26px;
886
+ color: ${cssVar.colorText};
887
+ text-align: center;
888
+
889
+ transition:
890
+ background 150ms ${cssVar.motionEaseOut},
891
+ color 150ms ${cssVar.motionEaseOut};
892
+ }
893
+
894
+ &.${P}-dropdown
895
+ .${P}-time-panel-cell:not(.${P}-time-panel-cell-disabled, .${P}-time-panel-cell-selected):hover
896
+ .${P}-time-panel-cell-inner {
897
+ background: ${cssVar.colorFillTertiary};
898
+ }
899
+
900
+ &.${P}-dropdown .${P}-time-panel-cell-selected .${P}-time-panel-cell-inner {
149
901
  font-weight: 600;
150
902
  color: ${cssVar.colorBgContainer};
151
903
  background: ${cssVar.colorText};
152
904
  }
153
- `,
154
- tiles: css`
155
- display: grid;
156
- grid-template-columns: repeat(3, minmax(0, 1fr));
157
- gap: 6px 4px;
158
- width: 266px;
159
- `,
160
- trigger: css`
161
- ${focusRing};
162
- cursor: pointer;
163
905
 
164
- display: flex;
165
- flex: 1;
166
- align-items: center;
906
+ &.${P}-dropdown .${P}-time-panel-cell-disabled {
907
+ cursor: not-allowed;
908
+
909
+ .${P}-time-panel-cell-inner {
910
+ color: ${cssVar.colorTextQuaternary};
911
+ }
912
+ }
913
+
914
+ /* footer: no background of its own; dividers match the presets sidebar divider */
915
+
916
+ /* footer: ONE row in one container — renderExtraFooter content on the start side,
917
+ Today / Now / OK on the end side — under a single divider. No background. */
918
+ &.${P}-dropdown .${P}-footer {
919
+ display: flex;
920
+ gap: 8px;
921
+ align-items: center;
922
+
923
+ min-width: 0;
924
+ border-block-start: 1px solid ${cssVar.colorFillSecondary};
925
+
926
+ background: none;
927
+ }
928
+
929
+ &.${P}-dropdown.${P}-dropdown-dark .${P}-footer {
930
+ border-block-start-color: ${cssVar.colorFillTertiary};
931
+ }
932
+
933
+ &.${P}-dropdown .${P}-footer-extra {
934
+ flex: 1;
935
+
936
+ min-width: 0;
937
+ padding-block: 8px;
938
+ padding-inline: 12px;
939
+
940
+ font-size: 13px;
941
+ line-height: 20px;
942
+ color: ${cssVar.colorTextSecondary};
943
+ text-align: start;
944
+ }
945
+
946
+ &.${P}-dropdown .${P}-footer-extra + .${P}-ranges {
947
+ flex: none;
948
+ padding-inline-start: 0;
949
+ }
950
+
951
+ &.${P}-dropdown .${P}-ranges {
952
+ display: flex;
953
+ flex: 1;
954
+ gap: 8px;
955
+ align-items: center;
956
+ justify-content: space-between;
957
+
958
+ margin: 0;
959
+ padding-block: 8px;
960
+ padding-inline: 12px;
961
+
962
+ list-style: none;
963
+ }
167
964
 
168
- min-width: 0;
169
- height: 100%;
170
- padding: 0;
171
- border: 0;
965
+ &.${P}-dropdown .${P}-ranges > .${P}-now {
966
+ margin-inline: auto;
967
+ }
968
+
969
+ /* Now on the start side, OK on the end side */
970
+ &.${P}-dropdown .${P}-ranges > .${P}-now:has(+ .${P}-ok) {
971
+ margin-inline: 0;
972
+ }
973
+
974
+ &.${P}-dropdown .${P}-ranges > .${P}-ok {
975
+ margin-inline-start: auto;
976
+ }
172
977
 
173
- font: inherit;
174
- color: inherit;
175
- text-align: start;
176
- white-space: nowrap;
978
+ &.${P}-dropdown .${P}-now-btn {
979
+ ${focusRing};
980
+ cursor: pointer;
177
981
 
178
- background: none;
982
+ padding-block: 2px;
983
+ padding-inline: 8px;
984
+ border-radius: 6px;
179
985
 
180
- &:disabled {
986
+ font-size: 13px;
987
+ color: ${cssVar.colorText};
988
+
989
+ &:hover {
990
+ background: ${cssVar.colorFillTertiary};
991
+ }
992
+ }
993
+
994
+ &.${P}-dropdown .${P}-now-btn-disabled {
181
995
  cursor: not-allowed;
996
+ color: ${cssVar.colorTextQuaternary};
997
+ }
998
+
999
+ /* motion (transitionName = lobe-picker-slide-up) */
1000
+ &.${MOTION}-appear, &.${MOTION}-enter {
1001
+ transform-origin: top center;
1002
+ }
1003
+
1004
+ /* rc-motion's prepare frame is where the trigger measures and aligns the popup, so it
1005
+ must stay untransformed (a scaled box would misalign). Without an opacity of its own
1006
+ it painted fully visible at the final spot for one frame, then snapped back to the
1007
+ start state below and animated in again: that flash + jump read as jitter on open. */
1008
+ &.${MOTION}-appear-prepare, &.${MOTION}-enter-prepare {
1009
+ opacity: 0;
1010
+ }
1011
+
1012
+ &.${MOTION}-appear-start, &.${MOTION}-enter-start {
1013
+ transform: translateY(-4px) scale(0.98);
1014
+ opacity: 0;
1015
+ }
1016
+
1017
+ &.${MOTION}-appear-active, &.${MOTION}-enter-active {
1018
+ transform: none;
1019
+ opacity: 1;
1020
+ transition:
1021
+ opacity 150ms ${cssVar.motionEaseOut},
1022
+ transform 150ms ${cssVar.motionEaseOut};
1023
+ }
1024
+
1025
+ &.${MOTION}-leave-active {
1026
+ transform: translateY(-4px) scale(0.98);
1027
+ opacity: 0;
1028
+ transition:
1029
+ opacity 100ms ${cssVar.motionEaseInOut},
1030
+ transform 100ms ${cssVar.motionEaseInOut};
182
1031
  }
183
- `,
184
- weekday: css`
185
- display: flex;
186
- align-items: center;
187
- justify-content: center;
188
- height: 20px;
189
1032
  `
190
1033
  }));
191
1034
  //#endregion
192
- export { styles };
1035
+ export { PREFIX_CLS, styles };
193
1036
 
194
1037
  //# sourceMappingURL=style.mjs.map