@lobehub/ui 5.63.4 → 5.64.1

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