@kalyx/react 1.0.0-rc.0 → 1.0.0-rc.10
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 +283 -9
- package/README.md +7 -2
- package/dist/index.cjs +827 -410
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -8
- package/dist/index.d.ts +81 -8
- package/dist/index.js +816 -415
- package/dist/index.js.map +1 -1
- package/package.json +18 -3
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, HTMLAttributes, InputHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ISODateString, DisabledRule, WeekStartsOn, DateAdapter, DatePickerLabels, DateRange, RangePickerLabels, TimePickerLabels, DateTimePickerLabels, CalendarGrid, TimeValue } from '@kalyx/core';
|
|
5
|
-
export { CalendarDay, DateAdapter, DateFnsAdapter, DateRange, DisabledRule, ISODateString, TimeValue } from '@kalyx/core';
|
|
5
|
+
export { CalendarDay, CalendarGrid, CalendarOptions, CalendarWeek, DEFAULT_DATEPICKER_LABELS, DEFAULT_DATETIMEPICKER_LABELS, DEFAULT_RANGEPICKER_LABELS, DEFAULT_TIMEPICKER_LABELS, DateAdapter, DateFnsAdapter, DatePickerLabels, DateRange, DateTimePickerLabels, DisabledRule, ISODateString, RangePickerLabels, TimePickerLabels, TimeValue, WeekStartsOn, WeekdayInfo } from '@kalyx/core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Props for the DatePicker Root component.
|
|
@@ -82,13 +82,28 @@ interface DatePickerCalendarClassNames {
|
|
|
82
82
|
dayDisabled?: string;
|
|
83
83
|
dayOutsideMonth?: string;
|
|
84
84
|
weekdayHeader?: string;
|
|
85
|
+
/** Header cell at the top of the week-number column. Rendered only when `showWeekNumber` is set. */
|
|
86
|
+
weekNumberHeader?: string;
|
|
87
|
+
/** Each row's week-number cell. Rendered only when `showWeekNumber` is set. */
|
|
88
|
+
weekNumber?: string;
|
|
85
89
|
}
|
|
86
90
|
interface DatePickerCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
87
91
|
classNames?: DatePickerCalendarClassNames;
|
|
88
92
|
/** Called when the title ("January 2026") is clicked. Useful for switching to Month/Year views. */
|
|
89
93
|
onTitleClick?: () => void;
|
|
94
|
+
/**
|
|
95
|
+
* Render an ISO 8601 week-number column on the left of the grid (1–53).
|
|
96
|
+
* The column is a `<th scope="row">`; it doesn't participate in the WAI-ARIA grid
|
|
97
|
+
* data region, so keyboard navigation across the date cells is unaffected.
|
|
98
|
+
*/
|
|
99
|
+
showWeekNumber?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Always render 6 weeks (42 cells), even when the month fits in 4 or 5 rows. Useful for
|
|
102
|
+
* popover layouts that need a fixed height across month navigation.
|
|
103
|
+
*/
|
|
104
|
+
fixedWeeks?: boolean;
|
|
90
105
|
}
|
|
91
|
-
declare function DatePickerCalendar({ classNames, onTitleClick, ...props }: DatePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
declare function DatePickerCalendar({ classNames, onTitleClick, showWeekNumber, fixedWeeks, ...props }: DatePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
92
107
|
|
|
93
108
|
interface DatePickerMonthGridClassNames {
|
|
94
109
|
root?: string;
|
|
@@ -198,6 +213,12 @@ declare function DatePickerPreset({ value: presetKey, date: directDate, children
|
|
|
198
213
|
interface DatePickerInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
199
214
|
/** Date display format (defaults to parent's displayFormat) */
|
|
200
215
|
format?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Form field name. When set, a hidden `<input type="hidden" name={name} value={ISO}>`
|
|
218
|
+
* is rendered alongside the visible input so the value participates in native form
|
|
219
|
+
* submission (and integrates with `react-hook-form` Controller-less flows).
|
|
220
|
+
*/
|
|
221
|
+
name?: string;
|
|
201
222
|
}
|
|
202
223
|
|
|
203
224
|
interface DatePickerTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
@@ -316,6 +337,10 @@ interface RangePickerCalendarClassNames {
|
|
|
316
337
|
dayRangeEnd?: string;
|
|
317
338
|
dayInRange?: string;
|
|
318
339
|
weekdayHeader?: string;
|
|
340
|
+
/** Header cell at the top of the week-number column. Rendered only when `showWeekNumber` is set. */
|
|
341
|
+
weekNumberHeader?: string;
|
|
342
|
+
/** Each row's week-number cell. Rendered only when `showWeekNumber` is set. */
|
|
343
|
+
weekNumber?: string;
|
|
319
344
|
}
|
|
320
345
|
/**
|
|
321
346
|
* Selection mode for the calendar grid.
|
|
@@ -327,8 +352,18 @@ interface RangePickerCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
327
352
|
classNames?: RangePickerCalendarClassNames;
|
|
328
353
|
/** @default 'range' */
|
|
329
354
|
selectionMode?: RangePickerCalendarSelectionMode;
|
|
355
|
+
/**
|
|
356
|
+
* Render an ISO 8601 week-number column on the left of the grid (1–53).
|
|
357
|
+
* The column is a `<th scope="row">`; it doesn't participate in the WAI-ARIA grid
|
|
358
|
+
* data region, so keyboard navigation across the date cells is unaffected.
|
|
359
|
+
*/
|
|
360
|
+
showWeekNumber?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Always render 6 weeks (42 cells), even when the month fits in 4 or 5 rows.
|
|
363
|
+
*/
|
|
364
|
+
fixedWeeks?: boolean;
|
|
330
365
|
}
|
|
331
|
-
declare function RangePickerCalendar({ classNames, selectionMode, ...props }: RangePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
366
|
+
declare function RangePickerCalendar({ classNames, selectionMode, showWeekNumber, fixedWeeks, ...props }: RangePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
332
367
|
|
|
333
368
|
/** Predefined preset keys. Custom ranges are also supported. */
|
|
334
369
|
type PresetKey = 'today' | 'yesterday' | 'last7days' | 'last30days' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear';
|
|
@@ -460,12 +495,20 @@ interface TimePickerRootProps {
|
|
|
460
495
|
disabled?: boolean;
|
|
461
496
|
/** Read-only */
|
|
462
497
|
readOnly?: boolean;
|
|
498
|
+
/**
|
|
499
|
+
* Programmatic per-slot disable predicate. Returns `true` for any `(hours, minutes)` pair
|
|
500
|
+
* that should be unselectable — same polarity as MUI X's `shouldDisableTime`, and the
|
|
501
|
+
* **inverse** of react-datepicker's `filterTime` (which returns `true` to *keep* a slot).
|
|
502
|
+
* Use cases: business hours, lunch breaks, blackout slots. Hours are disabled only when the
|
|
503
|
+
* predicate returns `true` for every step within the hour. Always receives 24-hour values.
|
|
504
|
+
*/
|
|
505
|
+
filterTime?: (hours: number, minutes: number) => boolean;
|
|
463
506
|
/** Override ARIA labels (defaults to English) */
|
|
464
507
|
labels?: Partial<TimePickerLabels>;
|
|
465
508
|
/** Child components */
|
|
466
509
|
children: ReactNode;
|
|
467
510
|
}
|
|
468
|
-
declare function TimePickerRoot({ value: controlledValue, defaultValue, onChange, format, step, withSeconds, displayTimezone, disabled, readOnly, labels: labelsProp, children, }: TimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
511
|
+
declare function TimePickerRoot({ value: controlledValue, defaultValue, onChange, format, step, withSeconds, displayTimezone, disabled, readOnly, filterTime, labels: labelsProp, children, }: TimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
469
512
|
|
|
470
513
|
interface TimePickerHourListClassNames {
|
|
471
514
|
root?: string;
|
|
@@ -509,6 +552,9 @@ interface TimePickerAmPmToggleProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
509
552
|
/**
|
|
510
553
|
* TimePicker.AmPmToggle — AM/PM toggle shown only in 12-hour mode.
|
|
511
554
|
* Returns null in 24-hour mode.
|
|
555
|
+
*
|
|
556
|
+
* Implements the WAI-ARIA radiogroup pattern: only the checked radio is in the
|
|
557
|
+
* tab order; ArrowLeft/Right/Up/Down + Home/End move selection between radios.
|
|
512
558
|
*/
|
|
513
559
|
declare function TimePickerAmPmToggle({ classNames, ...props }: TimePickerAmPmToggleProps): react_jsx_runtime.JSX.Element | null;
|
|
514
560
|
|
|
@@ -571,6 +617,15 @@ interface DateTimePickerRootProps {
|
|
|
571
617
|
format?: TimePickerFormat;
|
|
572
618
|
/** Minute step (e.g., 1, 5, 15, 30) */
|
|
573
619
|
step?: number;
|
|
620
|
+
/** Whether to display seconds in the time controls */
|
|
621
|
+
withSeconds?: boolean;
|
|
622
|
+
/**
|
|
623
|
+
* Programmatic per-slot disable predicate for the time controls. Returns `true` for any
|
|
624
|
+
* `(hours, minutes)` pair that should be unselectable — same polarity as MUI X's
|
|
625
|
+
* `shouldDisableTime`, and the **inverse** of react-datepicker's `filterTime`. Always
|
|
626
|
+
* receives 24-hour values.
|
|
627
|
+
*/
|
|
628
|
+
filterTime?: (hours: number, minutes: number) => boolean;
|
|
574
629
|
/** Disabled rules (applied to dates) */
|
|
575
630
|
disabled?: DisabledRule[] | boolean;
|
|
576
631
|
/** Read-only */
|
|
@@ -606,7 +661,7 @@ interface DateTimePickerRootProps {
|
|
|
606
661
|
* - Changing time in TimePicker -> changes only the time, preserves the date
|
|
607
662
|
* - Escape / outside click -> close the popover (commit)
|
|
608
663
|
*/
|
|
609
|
-
declare function DateTimePickerRoot({ value: controlledValue, defaultValue, onChange, onOpenChange, onCalendarNavigate, format, step, disabled, readOnly, weekStartsOn, displayFormat, locale, displayTimezone, adapter, labels: labelsProp, children, }: DateTimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
664
|
+
declare function DateTimePickerRoot({ value: controlledValue, defaultValue, onChange, onOpenChange, onCalendarNavigate, format, step, withSeconds, filterTime, disabled, readOnly, weekStartsOn, displayFormat, locale, displayTimezone, adapter, labels: labelsProp, children, }: DateTimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
610
665
|
|
|
611
666
|
interface DateTimePickerInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
612
667
|
}
|
|
@@ -674,7 +729,7 @@ interface MonthPickerGridClassNames {
|
|
|
674
729
|
monthCurrent?: string;
|
|
675
730
|
monthDisabled?: string;
|
|
676
731
|
}
|
|
677
|
-
interface MonthPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
732
|
+
interface MonthPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
678
733
|
classNames?: MonthPickerGridClassNames;
|
|
679
734
|
}
|
|
680
735
|
/**
|
|
@@ -683,9 +738,18 @@ interface MonthPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>, "rol
|
|
|
683
738
|
* Unlike `DatePicker.MonthGrid` (drilldown), this component commits the month selection
|
|
684
739
|
* via `ctx.selectDate`, emitting the month-start ISO string.
|
|
685
740
|
*
|
|
741
|
+
* Disabled state: a month is marked unselectable when every day in it is
|
|
742
|
+
* excluded by a `before`/`after` rule on the `disabled` prop. The cell is
|
|
743
|
+
* rendered with `disabled` + `aria-disabled` + the `monthDisabled` className,
|
|
744
|
+
* and keyboard navigation skips it.
|
|
745
|
+
*
|
|
686
746
|
* @example
|
|
687
747
|
* ```tsx
|
|
688
|
-
* <MonthPicker
|
|
748
|
+
* <MonthPicker
|
|
749
|
+
* value={month}
|
|
750
|
+
* onChange={setMonth}
|
|
751
|
+
* disabled={[{ before: '2026-04-01T00:00:00.000Z' }]}
|
|
752
|
+
* >
|
|
689
753
|
* <MonthPicker.Input />
|
|
690
754
|
* <MonthPicker.Popover>
|
|
691
755
|
* <MonthPicker.Grid />
|
|
@@ -747,9 +811,18 @@ interface YearPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role
|
|
|
747
811
|
* Unlike `DatePicker.YearGrid` (drilldown), this component commits the year selection via
|
|
748
812
|
* `ctx.selectDate`, emitting the year-start ISO string (Jan 1 at UTC midnight).
|
|
749
813
|
*
|
|
814
|
+
* Disabled state: a year is marked unselectable when every day in it is
|
|
815
|
+
* excluded by a `before`/`after` rule on the `disabled` prop. The cell is
|
|
816
|
+
* rendered with `disabled` + `aria-disabled` + the `yearDisabled` className,
|
|
817
|
+
* and keyboard navigation skips it.
|
|
818
|
+
*
|
|
750
819
|
* @example
|
|
751
820
|
* ```tsx
|
|
752
|
-
* <YearPicker
|
|
821
|
+
* <YearPicker
|
|
822
|
+
* value={year}
|
|
823
|
+
* onChange={setYear}
|
|
824
|
+
* disabled={[{ before: '2024-01-01T00:00:00.000Z' }]}
|
|
825
|
+
* >
|
|
753
826
|
* <YearPicker.Input />
|
|
754
827
|
* <YearPicker.Popover>
|
|
755
828
|
* <YearPicker.Grid />
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, HTMLAttributes, InputHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ISODateString, DisabledRule, WeekStartsOn, DateAdapter, DatePickerLabels, DateRange, RangePickerLabels, TimePickerLabels, DateTimePickerLabels, CalendarGrid, TimeValue } from '@kalyx/core';
|
|
5
|
-
export { CalendarDay, DateAdapter, DateFnsAdapter, DateRange, DisabledRule, ISODateString, TimeValue } from '@kalyx/core';
|
|
5
|
+
export { CalendarDay, CalendarGrid, CalendarOptions, CalendarWeek, DEFAULT_DATEPICKER_LABELS, DEFAULT_DATETIMEPICKER_LABELS, DEFAULT_RANGEPICKER_LABELS, DEFAULT_TIMEPICKER_LABELS, DateAdapter, DateFnsAdapter, DatePickerLabels, DateRange, DateTimePickerLabels, DisabledRule, ISODateString, RangePickerLabels, TimePickerLabels, TimeValue, WeekStartsOn, WeekdayInfo } from '@kalyx/core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Props for the DatePicker Root component.
|
|
@@ -82,13 +82,28 @@ interface DatePickerCalendarClassNames {
|
|
|
82
82
|
dayDisabled?: string;
|
|
83
83
|
dayOutsideMonth?: string;
|
|
84
84
|
weekdayHeader?: string;
|
|
85
|
+
/** Header cell at the top of the week-number column. Rendered only when `showWeekNumber` is set. */
|
|
86
|
+
weekNumberHeader?: string;
|
|
87
|
+
/** Each row's week-number cell. Rendered only when `showWeekNumber` is set. */
|
|
88
|
+
weekNumber?: string;
|
|
85
89
|
}
|
|
86
90
|
interface DatePickerCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
87
91
|
classNames?: DatePickerCalendarClassNames;
|
|
88
92
|
/** Called when the title ("January 2026") is clicked. Useful for switching to Month/Year views. */
|
|
89
93
|
onTitleClick?: () => void;
|
|
94
|
+
/**
|
|
95
|
+
* Render an ISO 8601 week-number column on the left of the grid (1–53).
|
|
96
|
+
* The column is a `<th scope="row">`; it doesn't participate in the WAI-ARIA grid
|
|
97
|
+
* data region, so keyboard navigation across the date cells is unaffected.
|
|
98
|
+
*/
|
|
99
|
+
showWeekNumber?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Always render 6 weeks (42 cells), even when the month fits in 4 or 5 rows. Useful for
|
|
102
|
+
* popover layouts that need a fixed height across month navigation.
|
|
103
|
+
*/
|
|
104
|
+
fixedWeeks?: boolean;
|
|
90
105
|
}
|
|
91
|
-
declare function DatePickerCalendar({ classNames, onTitleClick, ...props }: DatePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
declare function DatePickerCalendar({ classNames, onTitleClick, showWeekNumber, fixedWeeks, ...props }: DatePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
92
107
|
|
|
93
108
|
interface DatePickerMonthGridClassNames {
|
|
94
109
|
root?: string;
|
|
@@ -198,6 +213,12 @@ declare function DatePickerPreset({ value: presetKey, date: directDate, children
|
|
|
198
213
|
interface DatePickerInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
199
214
|
/** Date display format (defaults to parent's displayFormat) */
|
|
200
215
|
format?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Form field name. When set, a hidden `<input type="hidden" name={name} value={ISO}>`
|
|
218
|
+
* is rendered alongside the visible input so the value participates in native form
|
|
219
|
+
* submission (and integrates with `react-hook-form` Controller-less flows).
|
|
220
|
+
*/
|
|
221
|
+
name?: string;
|
|
201
222
|
}
|
|
202
223
|
|
|
203
224
|
interface DatePickerTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
@@ -316,6 +337,10 @@ interface RangePickerCalendarClassNames {
|
|
|
316
337
|
dayRangeEnd?: string;
|
|
317
338
|
dayInRange?: string;
|
|
318
339
|
weekdayHeader?: string;
|
|
340
|
+
/** Header cell at the top of the week-number column. Rendered only when `showWeekNumber` is set. */
|
|
341
|
+
weekNumberHeader?: string;
|
|
342
|
+
/** Each row's week-number cell. Rendered only when `showWeekNumber` is set. */
|
|
343
|
+
weekNumber?: string;
|
|
319
344
|
}
|
|
320
345
|
/**
|
|
321
346
|
* Selection mode for the calendar grid.
|
|
@@ -327,8 +352,18 @@ interface RangePickerCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
327
352
|
classNames?: RangePickerCalendarClassNames;
|
|
328
353
|
/** @default 'range' */
|
|
329
354
|
selectionMode?: RangePickerCalendarSelectionMode;
|
|
355
|
+
/**
|
|
356
|
+
* Render an ISO 8601 week-number column on the left of the grid (1–53).
|
|
357
|
+
* The column is a `<th scope="row">`; it doesn't participate in the WAI-ARIA grid
|
|
358
|
+
* data region, so keyboard navigation across the date cells is unaffected.
|
|
359
|
+
*/
|
|
360
|
+
showWeekNumber?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Always render 6 weeks (42 cells), even when the month fits in 4 or 5 rows.
|
|
363
|
+
*/
|
|
364
|
+
fixedWeeks?: boolean;
|
|
330
365
|
}
|
|
331
|
-
declare function RangePickerCalendar({ classNames, selectionMode, ...props }: RangePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
366
|
+
declare function RangePickerCalendar({ classNames, selectionMode, showWeekNumber, fixedWeeks, ...props }: RangePickerCalendarProps): react_jsx_runtime.JSX.Element;
|
|
332
367
|
|
|
333
368
|
/** Predefined preset keys. Custom ranges are also supported. */
|
|
334
369
|
type PresetKey = 'today' | 'yesterday' | 'last7days' | 'last30days' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear';
|
|
@@ -460,12 +495,20 @@ interface TimePickerRootProps {
|
|
|
460
495
|
disabled?: boolean;
|
|
461
496
|
/** Read-only */
|
|
462
497
|
readOnly?: boolean;
|
|
498
|
+
/**
|
|
499
|
+
* Programmatic per-slot disable predicate. Returns `true` for any `(hours, minutes)` pair
|
|
500
|
+
* that should be unselectable — same polarity as MUI X's `shouldDisableTime`, and the
|
|
501
|
+
* **inverse** of react-datepicker's `filterTime` (which returns `true` to *keep* a slot).
|
|
502
|
+
* Use cases: business hours, lunch breaks, blackout slots. Hours are disabled only when the
|
|
503
|
+
* predicate returns `true` for every step within the hour. Always receives 24-hour values.
|
|
504
|
+
*/
|
|
505
|
+
filterTime?: (hours: number, minutes: number) => boolean;
|
|
463
506
|
/** Override ARIA labels (defaults to English) */
|
|
464
507
|
labels?: Partial<TimePickerLabels>;
|
|
465
508
|
/** Child components */
|
|
466
509
|
children: ReactNode;
|
|
467
510
|
}
|
|
468
|
-
declare function TimePickerRoot({ value: controlledValue, defaultValue, onChange, format, step, withSeconds, displayTimezone, disabled, readOnly, labels: labelsProp, children, }: TimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
511
|
+
declare function TimePickerRoot({ value: controlledValue, defaultValue, onChange, format, step, withSeconds, displayTimezone, disabled, readOnly, filterTime, labels: labelsProp, children, }: TimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
469
512
|
|
|
470
513
|
interface TimePickerHourListClassNames {
|
|
471
514
|
root?: string;
|
|
@@ -509,6 +552,9 @@ interface TimePickerAmPmToggleProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
509
552
|
/**
|
|
510
553
|
* TimePicker.AmPmToggle — AM/PM toggle shown only in 12-hour mode.
|
|
511
554
|
* Returns null in 24-hour mode.
|
|
555
|
+
*
|
|
556
|
+
* Implements the WAI-ARIA radiogroup pattern: only the checked radio is in the
|
|
557
|
+
* tab order; ArrowLeft/Right/Up/Down + Home/End move selection between radios.
|
|
512
558
|
*/
|
|
513
559
|
declare function TimePickerAmPmToggle({ classNames, ...props }: TimePickerAmPmToggleProps): react_jsx_runtime.JSX.Element | null;
|
|
514
560
|
|
|
@@ -571,6 +617,15 @@ interface DateTimePickerRootProps {
|
|
|
571
617
|
format?: TimePickerFormat;
|
|
572
618
|
/** Minute step (e.g., 1, 5, 15, 30) */
|
|
573
619
|
step?: number;
|
|
620
|
+
/** Whether to display seconds in the time controls */
|
|
621
|
+
withSeconds?: boolean;
|
|
622
|
+
/**
|
|
623
|
+
* Programmatic per-slot disable predicate for the time controls. Returns `true` for any
|
|
624
|
+
* `(hours, minutes)` pair that should be unselectable — same polarity as MUI X's
|
|
625
|
+
* `shouldDisableTime`, and the **inverse** of react-datepicker's `filterTime`. Always
|
|
626
|
+
* receives 24-hour values.
|
|
627
|
+
*/
|
|
628
|
+
filterTime?: (hours: number, minutes: number) => boolean;
|
|
574
629
|
/** Disabled rules (applied to dates) */
|
|
575
630
|
disabled?: DisabledRule[] | boolean;
|
|
576
631
|
/** Read-only */
|
|
@@ -606,7 +661,7 @@ interface DateTimePickerRootProps {
|
|
|
606
661
|
* - Changing time in TimePicker -> changes only the time, preserves the date
|
|
607
662
|
* - Escape / outside click -> close the popover (commit)
|
|
608
663
|
*/
|
|
609
|
-
declare function DateTimePickerRoot({ value: controlledValue, defaultValue, onChange, onOpenChange, onCalendarNavigate, format, step, disabled, readOnly, weekStartsOn, displayFormat, locale, displayTimezone, adapter, labels: labelsProp, children, }: DateTimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
664
|
+
declare function DateTimePickerRoot({ value: controlledValue, defaultValue, onChange, onOpenChange, onCalendarNavigate, format, step, withSeconds, filterTime, disabled, readOnly, weekStartsOn, displayFormat, locale, displayTimezone, adapter, labels: labelsProp, children, }: DateTimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
610
665
|
|
|
611
666
|
interface DateTimePickerInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
612
667
|
}
|
|
@@ -674,7 +729,7 @@ interface MonthPickerGridClassNames {
|
|
|
674
729
|
monthCurrent?: string;
|
|
675
730
|
monthDisabled?: string;
|
|
676
731
|
}
|
|
677
|
-
interface MonthPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
732
|
+
interface MonthPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
678
733
|
classNames?: MonthPickerGridClassNames;
|
|
679
734
|
}
|
|
680
735
|
/**
|
|
@@ -683,9 +738,18 @@ interface MonthPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>, "rol
|
|
|
683
738
|
* Unlike `DatePicker.MonthGrid` (drilldown), this component commits the month selection
|
|
684
739
|
* via `ctx.selectDate`, emitting the month-start ISO string.
|
|
685
740
|
*
|
|
741
|
+
* Disabled state: a month is marked unselectable when every day in it is
|
|
742
|
+
* excluded by a `before`/`after` rule on the `disabled` prop. The cell is
|
|
743
|
+
* rendered with `disabled` + `aria-disabled` + the `monthDisabled` className,
|
|
744
|
+
* and keyboard navigation skips it.
|
|
745
|
+
*
|
|
686
746
|
* @example
|
|
687
747
|
* ```tsx
|
|
688
|
-
* <MonthPicker
|
|
748
|
+
* <MonthPicker
|
|
749
|
+
* value={month}
|
|
750
|
+
* onChange={setMonth}
|
|
751
|
+
* disabled={[{ before: '2026-04-01T00:00:00.000Z' }]}
|
|
752
|
+
* >
|
|
689
753
|
* <MonthPicker.Input />
|
|
690
754
|
* <MonthPicker.Popover>
|
|
691
755
|
* <MonthPicker.Grid />
|
|
@@ -747,9 +811,18 @@ interface YearPickerGridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role
|
|
|
747
811
|
* Unlike `DatePicker.YearGrid` (drilldown), this component commits the year selection via
|
|
748
812
|
* `ctx.selectDate`, emitting the year-start ISO string (Jan 1 at UTC midnight).
|
|
749
813
|
*
|
|
814
|
+
* Disabled state: a year is marked unselectable when every day in it is
|
|
815
|
+
* excluded by a `before`/`after` rule on the `disabled` prop. The cell is
|
|
816
|
+
* rendered with `disabled` + `aria-disabled` + the `yearDisabled` className,
|
|
817
|
+
* and keyboard navigation skips it.
|
|
818
|
+
*
|
|
750
819
|
* @example
|
|
751
820
|
* ```tsx
|
|
752
|
-
* <YearPicker
|
|
821
|
+
* <YearPicker
|
|
822
|
+
* value={year}
|
|
823
|
+
* onChange={setYear}
|
|
824
|
+
* disabled={[{ before: '2024-01-01T00:00:00.000Z' }]}
|
|
825
|
+
* >
|
|
753
826
|
* <YearPicker.Input />
|
|
754
827
|
* <YearPicker.Popover>
|
|
755
828
|
* <YearPicker.Grid />
|