@mrpelz/uikit-ish 7.8.0 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/main.d.ts +12 -0
- package/dist/components/accordion/main.d.ts.map +1 -0
- package/dist/components/accordion/main.js +20 -0
- package/dist/components/accordion/main.js.map +1 -0
- package/dist/components/accordion/style.css +23 -0
- package/dist/components/action-sheet/main.d.ts +22 -16
- package/dist/components/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +89 -19
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/props.d.ts +17 -5
- package/dist/components/action-sheet/props.d.ts.map +1 -1
- package/dist/components/action-sheet/style.css +24 -0
- package/dist/components/activity-view/main.d.ts +15 -4
- package/dist/components/activity-view/main.d.ts.map +1 -1
- package/dist/components/activity-view/main.js +27 -14
- package/dist/components/activity-view/main.js.map +1 -1
- package/dist/components/activity-view/props.d.ts +2 -10
- package/dist/components/activity-view/props.d.ts.map +1 -1
- package/dist/components/activity-view/style.css +29 -67
- package/dist/components/alert/main.d.ts +8 -7
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +32 -19
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/alert/props.d.ts +13 -2
- package/dist/components/alert/props.d.ts.map +1 -1
- package/dist/components/alert/style.css +36 -50
- package/dist/components/avatar/main.d.ts +5 -3
- package/dist/components/avatar/main.d.ts.map +1 -1
- package/dist/components/avatar/main.js +10 -8
- package/dist/components/avatar/main.js.map +1 -1
- package/dist/components/avatar/props.d.ts +4 -0
- package/dist/components/avatar/props.d.ts.map +1 -1
- package/dist/components/avatar/style.css +1 -7
- package/dist/components/badge/main.d.ts +3 -3
- package/dist/components/badge/main.d.ts.map +1 -1
- package/dist/components/badge/main.js +9 -9
- package/dist/components/badge/main.js.map +1 -1
- package/dist/components/badge/props.d.ts +4 -3
- package/dist/components/badge/props.d.ts.map +1 -1
- package/dist/components/badge/style.css +10 -4
- package/dist/components/button/main.d.ts.map +1 -1
- package/dist/components/button/main.js +15 -15
- package/dist/components/button/main.js.map +1 -1
- package/dist/components/button/props.d.ts +8 -8
- package/dist/components/button/props.d.ts.map +1 -1
- package/dist/components/button/style.css +37 -55
- package/dist/components/checkbox/main.d.ts.map +1 -1
- package/dist/components/checkbox/main.js +5 -7
- package/dist/components/checkbox/main.js.map +1 -1
- package/dist/components/checkbox/style.css +5 -8
- package/dist/components/collapsible/main.d.ts +9 -0
- package/dist/components/collapsible/main.d.ts.map +1 -0
- package/dist/components/collapsible/main.js +19 -0
- package/dist/components/collapsible/main.js.map +1 -0
- package/dist/components/collapsible/style.css +23 -0
- package/dist/components/color-picker/main.d.ts +27 -4
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +292 -110
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/props.d.ts +64 -15
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +133 -65
- package/dist/components/contextual-menu/main.d.ts +11 -7
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +207 -202
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +21 -34
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/contextual-menu/style.css +63 -34
- package/dist/components/date-picker/handle.d.ts +41 -0
- package/dist/components/date-picker/handle.d.ts.map +1 -0
- package/dist/components/date-picker/handle.js +47 -0
- package/dist/components/date-picker/handle.js.map +1 -0
- package/dist/components/date-picker/main.d.ts +31 -49
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +373 -178
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/pager.d.ts +24 -0
- package/dist/components/date-picker/pager.d.ts.map +1 -0
- package/dist/components/date-picker/pager.js +307 -0
- package/dist/components/date-picker/pager.js.map +1 -0
- package/dist/components/date-picker/props.d.ts +98 -27
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +110 -118
- package/dist/components/drawer/main.d.ts +31 -0
- package/dist/components/drawer/main.d.ts.map +1 -0
- package/dist/components/drawer/main.js +119 -0
- package/dist/components/drawer/main.js.map +1 -0
- package/dist/components/drawer/props.d.ts +39 -0
- package/dist/components/drawer/props.d.ts.map +1 -0
- package/dist/components/drawer/props.js +2 -0
- package/dist/components/drawer/props.js.map +1 -0
- package/dist/components/drawer/style.css +135 -0
- package/dist/components/edit-menu/main.d.ts +7 -7
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +57 -40
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/props.d.ts +14 -1
- package/dist/components/edit-menu/props.d.ts.map +1 -1
- package/dist/components/edit-menu/style.css +15 -8
- package/dist/components/form/main.d.ts +8 -0
- package/dist/components/form/main.d.ts.map +1 -1
- package/dist/components/form/main.js +18 -5
- package/dist/components/form/main.js.map +1 -1
- package/dist/components/form/props.d.ts +1 -2
- package/dist/components/form/props.d.ts.map +1 -1
- package/dist/components/glass/main.d.ts +1 -1
- package/dist/components/glass/main.js +4 -4
- package/dist/components/glass/main.js.map +1 -1
- package/dist/components/glass/props.d.ts +5 -5
- package/dist/components/glass/props.d.ts.map +1 -1
- package/dist/components/glass/style.css +176 -161
- package/dist/components/header/main.d.ts +5 -4
- package/dist/components/header/main.d.ts.map +1 -1
- package/dist/components/header/main.js +64 -34
- package/dist/components/header/main.js.map +1 -1
- package/dist/components/header/props.d.ts +2 -3
- package/dist/components/header/props.d.ts.map +1 -1
- package/dist/components/header/style.css +46 -65
- package/dist/components/index.d.ts +27 -23
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +17 -13
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/main.d.ts +2 -2
- package/dist/components/layout/main.d.ts.map +1 -1
- package/dist/components/layout/main.js +63 -167
- package/dist/components/layout/main.js.map +1 -1
- package/dist/components/layout/props.d.ts +2 -20
- package/dist/components/layout/props.d.ts.map +1 -1
- package/dist/components/layout/style.css +20 -91
- package/dist/components/list/main.d.ts +58 -10
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +1022 -465
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +211 -21
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts +146 -0
- package/dist/components/list/reorder.d.ts.map +1 -0
- package/dist/components/list/reorder.js +819 -0
- package/dist/components/list/reorder.js.map +1 -0
- package/dist/components/list/select.d.ts +6 -0
- package/dist/components/list/select.d.ts.map +1 -0
- package/dist/components/list/select.js +141 -0
- package/dist/components/list/select.js.map +1 -0
- package/dist/components/list/style.css +492 -507
- package/dist/components/list/swipe-actions-handle.d.ts +40 -0
- package/dist/components/list/swipe-actions-handle.d.ts.map +1 -0
- package/dist/components/list/swipe-actions-handle.js +51 -0
- package/dist/components/list/swipe-actions-handle.js.map +1 -0
- package/dist/components/menu/main.d.ts +102 -32
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +510 -99
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/props.d.ts +5 -5
- package/dist/components/menu/props.d.ts.map +1 -1
- package/dist/components/menu/style.css +35 -43
- package/dist/components/navigation/main.d.ts +14 -2
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +437 -119
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/props.d.ts +53 -3
- package/dist/components/navigation/props.d.ts.map +1 -1
- package/dist/components/navigation/style.css +56 -9
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +13 -8
- package/dist/components/page/main.js.map +1 -1
- package/dist/components/page/props.d.ts +8 -0
- package/dist/components/page/props.d.ts.map +1 -1
- package/dist/components/page/style.css +39 -4
- package/dist/components/page-control/main.d.ts +2 -2
- package/dist/components/page-control/main.d.ts.map +1 -1
- package/dist/components/page-control/main.js +66 -32
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/props.d.ts +10 -2
- package/dist/components/page-control/props.d.ts.map +1 -1
- package/dist/components/page-control/style.css +7 -2
- package/dist/components/popover/main.d.ts +11 -6
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +63 -38
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +7 -6
- package/dist/components/popover/props.d.ts.map +1 -1
- package/dist/components/popover/style.css +54 -4
- package/dist/components/progress/main.d.ts +2 -3
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +148 -29
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/props.d.ts +43 -9
- package/dist/components/progress/props.d.ts.map +1 -1
- package/dist/components/progress/style.css +82 -50
- package/dist/components/roll/main.d.ts +1 -1
- package/dist/components/roll/main.d.ts.map +1 -1
- package/dist/components/roll/main.js +90 -34
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/props.d.ts +25 -8
- package/dist/components/roll/props.d.ts.map +1 -1
- package/dist/components/roll/style.css +12 -24
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +47 -30
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/style.css +16 -23
- package/dist/components/sheet/main.d.ts +25 -15
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +66 -78
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +37 -3
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/style.css +183 -45
- package/dist/components/sidebar/main.d.ts.map +1 -1
- package/dist/components/sidebar/main.js +9 -13
- package/dist/components/sidebar/main.js.map +1 -1
- package/dist/components/sidebar/style.css +20 -14
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +23 -22
- package/dist/components/slider/main.js.map +1 -1
- package/dist/components/slider/props.d.ts +1 -2
- package/dist/components/slider/props.d.ts.map +1 -1
- package/dist/components/slider/style.css +27 -53
- package/dist/components/stepper/main.d.ts +4 -6
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +29 -25
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +12 -16
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +40 -28
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +7 -5
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/switch/style.css +40 -17
- package/dist/components/symbol/main.d.ts +2 -2
- package/dist/components/symbol/main.d.ts.map +1 -1
- package/dist/components/symbol/main.js +36 -28
- package/dist/components/symbol/main.js.map +1 -1
- package/dist/components/symbol/props.d.ts +39 -4
- package/dist/components/symbol/props.d.ts.map +1 -1
- package/dist/components/symbol/style.css +26 -5
- package/dist/components/tab-bar/main.d.ts +2 -2
- package/dist/components/tab-bar/main.d.ts.map +1 -1
- package/dist/components/tab-bar/main.js +133 -101
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +6 -6
- package/dist/components/tab-bar/props.d.ts.map +1 -1
- package/dist/components/tab-bar/style.css +113 -99
- package/dist/components/text-field/main.d.ts +3 -2
- package/dist/components/text-field/main.d.ts.map +1 -1
- package/dist/components/text-field/main.js +29 -30
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/props.d.ts +23 -1
- package/dist/components/text-field/props.d.ts.map +1 -1
- package/dist/components/text-field/style.css +122 -82
- package/dist/components/toolbar/main.js +27 -27
- package/dist/components/toolbar/main.js.map +1 -1
- package/dist/components/toolbar/props.d.ts +10 -4
- package/dist/components/toolbar/props.d.ts.map +1 -1
- package/dist/components/toolbar/style.css +39 -33
- package/dist/components/tooltip/main.d.ts +10 -9
- package/dist/components/tooltip/main.d.ts.map +1 -1
- package/dist/components/tooltip/main.js +39 -10
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/tooltip/props.d.ts +2 -0
- package/dist/components/tooltip/props.d.ts.map +1 -1
- package/dist/components/tooltip/style.css +16 -16
- package/dist/components/typography/main.d.ts +2 -2
- package/dist/components/typography/main.d.ts.map +1 -1
- package/dist/components/typography/main.js +24 -16
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/props.d.ts +11 -18
- package/dist/components/typography/props.d.ts.map +1 -1
- package/dist/components/typography/style.css +503 -623
- package/dist/components/utils/main.d.ts +78 -8
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +235 -16
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/utils/props.d.ts +27 -4
- package/dist/components/utils/props.d.ts.map +1 -1
- package/dist/components/utils/style.css +31 -18
- package/dist/components/viewport/edge-effect.d.ts +10 -0
- package/dist/components/viewport/edge-effect.d.ts.map +1 -0
- package/dist/components/viewport/edge-effect.js +100 -0
- package/dist/components/viewport/edge-effect.js.map +1 -0
- package/dist/components/viewport/edge.d.ts +39 -0
- package/dist/components/viewport/edge.d.ts.map +1 -0
- package/dist/components/viewport/edge.js +151 -0
- package/dist/components/viewport/edge.js.map +1 -0
- package/dist/components/viewport/input.d.ts +39 -0
- package/dist/components/viewport/input.d.ts.map +1 -0
- package/dist/components/viewport/input.js +280 -0
- package/dist/components/viewport/input.js.map +1 -0
- package/dist/components/viewport/main.d.ts +47 -9
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +745 -86
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +78 -0
- package/dist/components/viewport/padding.d.ts.map +1 -0
- package/dist/components/viewport/padding.js +321 -0
- package/dist/components/viewport/padding.js.map +1 -0
- package/dist/components/viewport/props.d.ts +220 -11
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/style.css +377 -6
- package/dist/main.d.ts +0 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js.map +1 -1
- package/dist/styles.css +318 -302
- package/dist/styles.d.ts +2 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +2 -1
- package/dist/styles.js.map +1 -1
- package/package.json +8 -16
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { Popover as BasePopover } from '@base-ui/react/popover';
|
|
1
2
|
import type { ComponentProps, ReactNode } from 'react';
|
|
2
3
|
import type { PopoverAlign } from '../popover/main.js';
|
|
4
|
+
import type { DatePickerHandle } from './handle.js';
|
|
3
5
|
export type DatePickerMode = 'date' | 'dateAndTime' | 'time';
|
|
4
6
|
export type DatePickerStyle = 'compact' | 'inline';
|
|
5
7
|
/** How a day is highlighted. */
|
|
@@ -18,6 +20,23 @@ export type DayHighlight = {
|
|
|
18
20
|
};
|
|
19
21
|
/** A day's highlights (see `CalendarProps` `highlighted`). */
|
|
20
22
|
export type DayHighlights = boolean | DayHighlight | null | readonly DayHighlight[] | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Why the value changed, and the event that changed it: a day pressed (or
|
|
25
|
+
* chosen by keyboard), a range dragged, the time's roll, or the footer's
|
|
26
|
+
* `select`.
|
|
27
|
+
*/
|
|
28
|
+
export type DatePickerChangeEventDetails = {
|
|
29
|
+
event: Event;
|
|
30
|
+
reason: 'day-press' | 'drag' | 'footer' | 'time';
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Why a picker opened or closed (Base UI's popover's reasons; without
|
|
34
|
+
* popovers, `trigger-press`), and the event.
|
|
35
|
+
*/
|
|
36
|
+
export type DatePickerOpenChangeEventDetails = {
|
|
37
|
+
event: Event;
|
|
38
|
+
reason: BasePopover.Root.ChangeEventReason;
|
|
39
|
+
};
|
|
21
40
|
/** A range of days: its start, and its end (`null` while picking it). */
|
|
22
41
|
export type DateRange = {
|
|
23
42
|
end: Date | null;
|
|
@@ -26,8 +45,8 @@ export type DateRange = {
|
|
|
26
45
|
export type SingleValue = {
|
|
27
46
|
/** The initially selected date (uncontrolled). */
|
|
28
47
|
defaultValue?: Date | null;
|
|
29
|
-
/** Called with the newly selected date. */
|
|
30
|
-
onValueChange?: (date: Date) => void;
|
|
48
|
+
/** Called with the newly selected date, and why. */
|
|
49
|
+
onValueChange?: (date: Date, eventDetails: DatePickerChangeEventDetails) => void;
|
|
31
50
|
/** Picks a single date (default). */
|
|
32
51
|
range?: false;
|
|
33
52
|
/** The selected date (controlled). */
|
|
@@ -46,15 +65,15 @@ export type RangeValue = {
|
|
|
46
65
|
isRangeDisabled?: (start: Date, end: Date) => boolean;
|
|
47
66
|
/**
|
|
48
67
|
* Called with the newly selected range: a start (its end `null`), then
|
|
49
|
-
* the range.
|
|
68
|
+
* the range; and why.
|
|
50
69
|
*/
|
|
51
|
-
onValueChange?: (range: DateRange) => void;
|
|
70
|
+
onValueChange?: (range: DateRange, eventDetails: DatePickerChangeEventDetails) => void;
|
|
52
71
|
/** Picks a range of days: a start, then an end (dates only). */
|
|
53
72
|
range: true;
|
|
54
73
|
/** The selected range (controlled). */
|
|
55
74
|
value?: DateRange | null;
|
|
56
75
|
};
|
|
57
|
-
/** Props of the calendar (also of `DatePicker`'s). */
|
|
76
|
+
/** Props of the calendar (also of `DatePicker.Root`'s). */
|
|
58
77
|
export type CalendarProps = {
|
|
59
78
|
/**
|
|
60
79
|
* The week's first day (0: Sunday … 6: Saturday).
|
|
@@ -62,12 +81,17 @@ export type CalendarProps = {
|
|
|
62
81
|
*/
|
|
63
82
|
firstDayOfWeek?: number;
|
|
64
83
|
/**
|
|
65
|
-
* Rows below the calendar, after a separator (e.g. `CalendarTimeRow`, or
|
|
66
|
-
* `CalendarRow`s of `CalendarButton`s jumping to dates), composed from the
|
|
84
|
+
* Rows below the calendar, after a separator (e.g. `DatePicker.CalendarTimeRow`, or
|
|
85
|
+
* `DatePicker.CalendarRow`s of `DatePicker.CalendarButton`s jumping to dates), composed from the
|
|
67
86
|
* calendar's state and actions (see `CalendarFooter`); with a time, by
|
|
68
|
-
* default `CalendarTimeRow` (none: `() => null`).
|
|
87
|
+
* default `DatePicker.CalendarTimeRow` (none: `() => null`).
|
|
69
88
|
*/
|
|
70
89
|
footer?: (calendar: CalendarFooter) => ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* Identifies the form that owns its hidden control (see `name`), when
|
|
92
|
+
* it's outside the form.
|
|
93
|
+
*/
|
|
94
|
+
form?: string;
|
|
71
95
|
/**
|
|
72
96
|
* Days highlighted (e.g. with events; Framework7 `events`): `true` (a dot
|
|
73
97
|
* below), how (see `DayHighlight`), or several highlights (dots side by
|
|
@@ -87,20 +111,40 @@ export type CalendarProps = {
|
|
|
87
111
|
isDateDisabled?: (date: Date) => boolean;
|
|
88
112
|
/** Locale of names, numerals, the hour cycle and the week's first day. */
|
|
89
113
|
locale?: string;
|
|
90
|
-
/** The latest selectable day. */
|
|
114
|
+
/** The latest selectable day (and, with a time, time). */
|
|
91
115
|
max?: Date;
|
|
92
|
-
/** The earliest selectable day. */
|
|
116
|
+
/** The earliest selectable day (and, with a time, time). */
|
|
93
117
|
min?: Date;
|
|
118
|
+
/**
|
|
119
|
+
* Its value's name in a form: submitted by a hidden control (as an
|
|
120
|
+
* input's: a date `YYYY-MM-DD`, a time `HH:MM`, both `YYYY-MM-DDTHH:MM`,
|
|
121
|
+
* a range `start/end`, empty until its end is picked). In a Base UI
|
|
122
|
+
* `Field`, the field's name applies. `DatePicker.Root` and
|
|
123
|
+
* `DatePicker.Calendar` are alternatives, never nested (the picker renders
|
|
124
|
+
* its own calendar): name the one holding the value.
|
|
125
|
+
*/
|
|
126
|
+
name?: string;
|
|
94
127
|
/**
|
|
95
128
|
* Shows the adjacent months' days filling the first and last weeks, grayed
|
|
96
|
-
* out (Framework7 `calendarDayPrev`/`Next
|
|
129
|
+
* out (Framework7 `calendarDayPrev`/`Next`); pressed, they
|
|
97
130
|
* show their month.
|
|
98
131
|
*/
|
|
99
132
|
showAdjacentMonths?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* What swiping the days sideways does: `'month'` turns the month,
|
|
135
|
+
* following the finger; `'date-range'` drags a range (picking a
|
|
136
|
+
* range; otherwise as `'ignore'`); `'ignore'`: neither (left to what's
|
|
137
|
+
* around it, e.g. a swipeable page). Scrolling sideways (e.g. a
|
|
138
|
+
* trackpad's) turns the month, but with `'ignore'`.
|
|
139
|
+
* @default `'date-range'` picking a range, otherwise `'month'`
|
|
140
|
+
*/
|
|
141
|
+
swipe?: CalendarSwipe;
|
|
100
142
|
} & (RangeValue | SingleValue);
|
|
143
|
+
/** What swiping a calendar's days does (see `swipe`). */
|
|
144
|
+
export type CalendarSwipe = 'date-range' | 'ignore' | 'month';
|
|
101
145
|
/** The calendar's state and actions, for its `footer`. */
|
|
102
146
|
export type CalendarFooter = {
|
|
103
|
-
/** The shape of the picker's collapsed buttons (see `DatePicker`). */
|
|
147
|
+
/** The shape of the picker's collapsed buttons (see `DatePicker.Root`). */
|
|
104
148
|
buttonShape?: 'capsule' | 'roundedRectangle';
|
|
105
149
|
/** Whether the picker is disabled. */
|
|
106
150
|
disabled: boolean;
|
|
@@ -128,7 +172,7 @@ export type DatePickerOpen = 'date' | 'time';
|
|
|
128
172
|
export type HourCycle = 'h12' | 'h23';
|
|
129
173
|
export type DatePickerProps = CalendarProps & {
|
|
130
174
|
/**
|
|
131
|
-
* The collapsed buttons' shape (`roundedRectangle`:
|
|
175
|
+
* The collapsed buttons' shape (`roundedRectangle`: 6px corners).
|
|
132
176
|
* @default 'capsule'
|
|
133
177
|
*/
|
|
134
178
|
buttonShape?: 'capsule' | 'roundedRectangle';
|
|
@@ -136,35 +180,45 @@ export type DatePickerProps = CalendarProps & {
|
|
|
136
180
|
defaultOpen?: DatePickerOpen | null;
|
|
137
181
|
/** Disables all of it. */
|
|
138
182
|
disabled?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Its pickers' handle (see `DatePicker.createHandle`): the compact
|
|
185
|
+
* style's buttons toggle them (no popovers), shown in place by a
|
|
186
|
+
* `DatePicker.Expandable` given it (e.g. after the picker's list row).
|
|
187
|
+
*/
|
|
188
|
+
handle?: DatePickerHandle;
|
|
139
189
|
/**
|
|
140
190
|
* 12 or 24 hours.
|
|
141
191
|
* @default the locale's
|
|
142
192
|
*/
|
|
143
193
|
hourCycle?: HourCycle;
|
|
144
194
|
/**
|
|
145
|
-
* Date, time, or both
|
|
146
|
-
* only.
|
|
195
|
+
* Date, time, or both; a `range` is of dates only.
|
|
147
196
|
* @default 'date'
|
|
148
197
|
*/
|
|
149
198
|
mode?: DatePickerMode;
|
|
150
|
-
/**
|
|
151
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Called when the compact style's picker opens or closes (its buttons,
|
|
201
|
+
* or, in a popover, pressing outside it, Escape, …), and why.
|
|
202
|
+
*/
|
|
203
|
+
onOpenChange?: (open: DatePickerOpen | null, eventDetails: DatePickerOpenChangeEventDetails) => void;
|
|
152
204
|
/** The open picker of the compact style (controlled). */
|
|
153
205
|
open?: DatePickerOpen | null;
|
|
154
206
|
/**
|
|
155
|
-
*
|
|
207
|
+
* Collapsed buttons opening a popover (`compact`), or the calendar in
|
|
208
|
+
* place (`inline`).
|
|
156
209
|
* @default 'compact'
|
|
157
210
|
*/
|
|
158
211
|
pickerStyle?: DatePickerStyle;
|
|
159
212
|
/**
|
|
160
213
|
* The compact style's buttons open their pickers in popovers (default);
|
|
161
214
|
* without, they only toggle `open`, for the app to show them (e.g. in an
|
|
162
|
-
* expandable list row: `Calendar`, `TimeRoll`).
|
|
215
|
+
* expandable list row: `DatePicker.Calendar`, `DatePicker.TimeRoll`).
|
|
163
216
|
*/
|
|
164
217
|
popover?: boolean;
|
|
165
218
|
/**
|
|
166
|
-
* How the compact style's popover aligns to its buttons
|
|
167
|
-
*
|
|
219
|
+
* How the compact style's popover aligns to its buttons (in a list row,
|
|
220
|
+
* which they end, aligned with their end: `end`).
|
|
221
|
+
* @default 'center'
|
|
168
222
|
*/
|
|
169
223
|
popoverAlign?: PopoverAlign;
|
|
170
224
|
};
|
|
@@ -176,8 +230,15 @@ export type TimeRollProps = {
|
|
|
176
230
|
hourCycle?: HourCycle;
|
|
177
231
|
/** Locale of numerals, the hour cycle and the day period. */
|
|
178
232
|
locale?: string;
|
|
179
|
-
/**
|
|
180
|
-
|
|
233
|
+
/**
|
|
234
|
+
* The latest selectable time: later hours, minutes
|
|
235
|
+
* and day periods disabled, a later selection moved back to it.
|
|
236
|
+
*/
|
|
237
|
+
max?: Date;
|
|
238
|
+
/** The earliest selectable time, as `max`. */
|
|
239
|
+
min?: Date;
|
|
240
|
+
/** Called with the date at the newly selected time (`reason`: `time`). */
|
|
241
|
+
onValueChange: (date: Date, eventDetails: DatePickerChangeEventDetails) => void;
|
|
181
242
|
/**
|
|
182
243
|
* The date whose time is shown.
|
|
183
244
|
* @default now
|
|
@@ -185,13 +246,19 @@ export type TimeRollProps = {
|
|
|
185
246
|
value: Date | null;
|
|
186
247
|
};
|
|
187
248
|
export type CalendarInternalProps = CalendarProps & {
|
|
249
|
+
/**
|
|
250
|
+
* Renders its value's hidden control (internal: not the picker's
|
|
251
|
+
* calendar, the picker renders its own).
|
|
252
|
+
* @default true
|
|
253
|
+
*/
|
|
254
|
+
formControl?: boolean;
|
|
188
255
|
hourCycle?: HourCycle;
|
|
189
|
-
/** The roll shown at first (internal, see `DatePicker`). */
|
|
256
|
+
/** The roll shown at first (internal, see `DatePicker.Root`). */
|
|
190
257
|
initialRoll?: 'monthYear' | 'time';
|
|
191
258
|
label?: string;
|
|
192
|
-
/** Called as the time's roll shows or hides (internal, see `DatePicker`). */
|
|
259
|
+
/** Called as the time's roll shows or hides (internal, see `DatePicker.Root`). */
|
|
193
260
|
onTimeShownChange?: (shown: boolean) => void;
|
|
194
|
-
/** The picker's time (internal, see `DatePicker`): for the footer. */
|
|
261
|
+
/** The picker's time (internal, see `DatePicker.Root`): for the footer. */
|
|
195
262
|
time?: {
|
|
196
263
|
disabled: boolean;
|
|
197
264
|
shape?: DatePickerProps['buttonShape'];
|
|
@@ -202,7 +269,7 @@ export type RangeDrag = {
|
|
|
202
269
|
/** Moving on to other months, while held beyond the days. */
|
|
203
270
|
edge: number;
|
|
204
271
|
from: Date;
|
|
205
|
-
|
|
272
|
+
isMoved: boolean;
|
|
206
273
|
/** The days the range can reach (see `rangeReach`). */
|
|
207
274
|
reachable: (day: Date) => boolean;
|
|
208
275
|
timer?: ReturnType<typeof setTimeout>;
|
|
@@ -217,4 +284,8 @@ export type CalendarMessageProps = ComponentProps<'p'> & {
|
|
|
217
284
|
*/
|
|
218
285
|
variant?: 'error' | 'info';
|
|
219
286
|
};
|
|
287
|
+
export type DatePickerExpandableProps = {
|
|
288
|
+
/** The pickers' handle, given to their `DatePicker.Root` too. */
|
|
289
|
+
handle: DatePickerHandle;
|
|
290
|
+
};
|
|
220
291
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEnD,gCAAgC;AAChC,MAAM,MAAM,YAAY,GA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