asheeui 0.6.2 → 0.6.3
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/AsheeUIProvider.d.ts +34 -0
- package/dist/AsheeUIProvider.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.d.ts +55 -44
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +27 -27
- package/dist/components/accordion/accordion-config.d.ts +41 -12
- package/dist/components/accordion/accordion-config.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.d.ts +20 -0
- package/dist/components/accordion/accordion-styles.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.js +1 -1
- package/dist/components/autocomplete/Autocomplete.d.ts +59 -39
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +98 -91
- package/dist/components/autocomplete/autocomplete-config.d.ts +9 -62
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +6 -21
- package/dist/components/button/Button.d.ts +50 -51
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +19 -19
- package/dist/components/button/button-config.d.ts +23 -15
- package/dist/components/button/button-config.d.ts.map +1 -1
- package/dist/components/button/button-styles.d.ts +11 -1
- package/dist/components/button/button-styles.d.ts.map +1 -1
- package/dist/components/card/Card.d.ts +85 -43
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +49 -49
- package/dist/components/card/card-config.d.ts +35 -18
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +0 -2
- package/dist/components/card/card-styles.d.ts +17 -1
- package/dist/components/card/card-styles.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.d.ts +107 -12
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +63 -64
- package/dist/components/carousel/carousel-config.d.ts +94 -7
- package/dist/components/carousel/carousel-config.d.ts.map +1 -1
- package/dist/components/carousel/carousel-config.js +6 -4
- package/dist/components/carousel/carousel-styles.d.ts +32 -1
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/chip/Chip.d.ts +55 -34
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +71 -72
- package/dist/components/chip/chip-config.d.ts +29 -15
- package/dist/components/chip/chip-config.d.ts.map +1 -1
- package/dist/components/chip/chip-config.js +5 -6
- package/dist/components/chip/chip-styles.d.ts +21 -1
- package/dist/components/chip/chip-styles.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +166 -2
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +110 -99
- package/dist/components/date-picker/date-picker-config.d.ts +31 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +8 -16
- package/dist/components/date-picker/date-picker-styles.d.ts +21 -1
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +7 -11
- package/dist/components/drawer/Drawer.d.ts +97 -7
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +9 -9
- package/dist/components/drawer/drawer-config.d.ts +54 -1
- package/dist/components/drawer/drawer-config.d.ts.map +1 -1
- package/dist/components/drawer/drawer-styles.d.ts +21 -0
- package/dist/components/drawer/drawer-styles.d.ts.map +1 -1
- package/dist/components/field/FieldShell.d.ts +86 -0
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/field-config.d.ts +66 -3
- package/dist/components/field/field-config.d.ts.map +1 -1
- package/dist/components/field/field-config.js +2 -1
- package/dist/components/field/field-styles.d.ts +22 -0
- package/dist/components/field/field-styles.d.ts.map +1 -1
- package/dist/components/field/field-styles.js +10 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/image/Image.d.ts +35 -28
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +7 -7
- package/dist/components/image/image-config.d.ts +25 -7
- package/dist/components/image/image-config.d.ts.map +1 -1
- package/dist/components/image/image-styles.d.ts +9 -0
- package/dist/components/image/image-styles.d.ts.map +1 -1
- package/dist/components/input/Input.d.ts +117 -10
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +20 -20
- package/dist/components/input/PasswordInput.d.ts +48 -0
- package/dist/components/input/PasswordInput.d.ts.map +1 -1
- package/dist/components/input/input-config.d.ts +10 -1
- package/dist/components/input/input-config.d.ts.map +1 -1
- package/dist/components/input/input-config.js +5 -8
- package/dist/components/input/input-styles.d.ts +10 -0
- package/dist/components/input/input-styles.d.ts.map +1 -1
- package/dist/components/input/input-styles.js +5 -9
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +58 -8
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +49 -48
- package/dist/components/keyboard/index.js +1 -1
- package/dist/components/keyboard/keyboard-config.d.ts +88 -3
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/{default-keyboard-config.js → keyboard-config.js} +7 -1
- package/dist/components/keyboard/keyboard-context.d.ts +103 -13
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +66 -68
- package/dist/components/keyboard/use-keyboard-field.d.ts +37 -0
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/link/Link.d.ts +118 -9
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +29 -30
- package/dist/components/link/link-config.d.ts +58 -5
- package/dist/components/link/link-config.d.ts.map +1 -1
- package/dist/components/link/link-styles.d.ts +24 -4
- package/dist/components/link/link-styles.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.d.ts +77 -8
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +5 -5
- package/dist/components/marquee/marquee-config.d.ts +74 -0
- package/dist/components/marquee/marquee-config.d.ts.map +1 -1
- package/dist/components/marquee/marquee-styles.d.ts +12 -0
- package/dist/components/marquee/marquee-styles.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts +113 -25
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +75 -82
- package/dist/components/modal/modal-config.d.ts +59 -1
- package/dist/components/modal/modal-config.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.d.ts +8 -1
- package/dist/components/modal/modal-styles.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.js +4 -11
- package/dist/components/multi-select/MultiSelect.d.ts +152 -23
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +195 -217
- package/dist/components/multi-select/multi-select-config.d.ts +61 -23
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +16 -25
- package/dist/components/multi-select/multi-select-styles.d.ts +17 -0
- package/dist/components/multi-select/multi-select-styles.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-styles.js +9 -13
- package/dist/components/radio/Radio.d.ts +137 -13
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +66 -141
- package/dist/components/radio/RadioGroup.d.ts +88 -23
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +141 -66
- package/dist/components/radio/radio-config.d.ts +36 -11
- package/dist/components/radio/radio-config.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +9 -11
- package/dist/components/radio/radio-context.d.ts +44 -1
- package/dist/components/radio/radio-context.d.ts.map +1 -1
- package/dist/components/radio/radio-styles.d.ts +24 -1
- package/dist/components/radio/radio-styles.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.d.ts +79 -32
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +77 -72
- package/dist/components/resizable-screen/resizable-screen-config.d.ts +62 -0
- package/dist/components/resizable-screen/resizable-screen-config.d.ts.map +1 -1
- package/dist/components/scrollbar/scrollbar-config.d.ts +44 -9
- package/dist/components/scrollbar/scrollbar-config.d.ts.map +1 -1
- package/dist/components/select/Select.d.ts +157 -17
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +141 -152
- package/dist/components/select/select-config.d.ts +26 -19
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +5 -21
- package/dist/components/select/select-styles.d.ts +10 -0
- package/dist/components/select/select-styles.d.ts.map +1 -1
- package/dist/components/select/select-styles.js +5 -9
- package/dist/components/select-menu/SelectMenu.d.ts +125 -8
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +107 -79
- package/dist/components/select-menu/index.d.ts +2 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +82 -0
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -0
- package/dist/components/select-menu/select-menu-config.js +12 -0
- package/dist/components/sidebar/Sidebar.d.ts +151 -51
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +211 -232
- package/dist/components/sidebar/sidebar-config.d.ts +140 -21
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +9 -12
- package/dist/components/sidebar/sidebar-styles.d.ts +24 -0
- package/dist/components/sidebar/sidebar-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner-config.d.ts +15 -9
- package/dist/components/spinner/spinner-config.d.ts.map +1 -1
- package/dist/components/spinner/spinner-styles.d.ts +10 -3
- package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner.d.ts +27 -20
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +18 -18
- package/dist/components/switch/Switch.d.ts +109 -9
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +19 -19
- package/dist/components/switch/switch-config.d.ts +20 -6
- package/dist/components/switch/switch-config.d.ts.map +1 -1
- package/dist/components/switch/switch-config.js +8 -16
- package/dist/components/switch/switch-styles.d.ts +17 -0
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/table/Table.d.ts +101 -28
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +56 -56
- package/dist/components/table/table-config.d.ts +75 -8
- package/dist/components/table/table-config.d.ts.map +1 -1
- package/dist/components/table/table-styles.d.ts +25 -6
- package/dist/components/table/table-styles.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +84 -31
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +44 -44
- package/dist/components/tabs/tabs-config.d.ts +102 -9
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-styles.d.ts +16 -4
- package/dist/components/tabs/tabs-styles.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +105 -11
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +27 -24
- package/dist/components/textarea/textarea-config.d.ts +21 -0
- package/dist/components/textarea/textarea-config.d.ts.map +1 -1
- package/dist/components/textarea/textarea-config.js +8 -16
- package/dist/components/textarea/textarea-styles.d.ts +9 -0
- package/dist/components/textarea/textarea-styles.d.ts.map +1 -1
- package/dist/components/textarea/textarea-styles.js +5 -9
- package/dist/components/toast/ToastItem.d.ts +58 -4
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +18 -18
- package/dist/components/toast/toast-config.d.ts +104 -6
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-context.d.ts +123 -11
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +19 -19
- package/dist/components/toast/toast-styles.d.ts +27 -5
- package/dist/components/toast/toast-styles.d.ts.map +1 -1
- package/dist/components/toast/use-pausable-timeout.d.ts +29 -0
- package/dist/components/toast/use-pausable-timeout.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +76 -16
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +25 -25
- package/dist/components/tooltip/tooltip-config.d.ts +73 -3
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-styles.d.ts +12 -0
- package/dist/components/tooltip/tooltip-styles.d.ts.map +1 -1
- package/dist/config/config.d.ts +50 -2
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-config.d.ts +5 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +23 -0
- package/dist/config/define-config.d.ts +23 -0
- package/dist/config/define-config.d.ts.map +1 -1
- package/dist/config/resolve-color.d.ts +25 -0
- package/dist/config/resolve-color.d.ts.map +1 -1
- package/dist/config/resolve-config.d.ts +23 -0
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/index.css +43 -7
- package/dist/index.d.ts +30 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -115
- package/dist/libs/context.d.ts +50 -1
- package/dist/libs/context.d.ts.map +1 -1
- package/dist/libs/registry.d.ts +61 -5
- package/dist/libs/registry.d.ts.map +1 -1
- package/dist/libs/use-isomorphic-layout-effect.d.ts +18 -0
- package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/radius.d.ts +37 -1
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/variant.d.ts +31 -0
- package/dist/shared/variant.d.ts.map +1 -1
- package/dist/shared/variant.js +132 -45
- package/dist/theme/color.d.ts +89 -1
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/controller.d.ts +121 -0
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +84 -0
- package/dist/theme/useTheme.d.ts +68 -0
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +23 -0
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +101 -0
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/keyboard/default-keyboard-config.d.ts +0 -10
- package/dist/components/keyboard/default-keyboard-config.d.ts.map +0 -1
- package/dist/shared/size.d.ts +0 -2
- package/dist/shared/size.d.ts.map +0 -1
|
@@ -1,30 +1,194 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
import { Radius } from '../../shared
|
|
3
|
-
import { Color, Variant } from '../../shared/variant';
|
|
2
|
+
import { Color, Radius, Variant } from '../../shared';
|
|
4
3
|
import { FieldSizeKey, FieldStatus, LabelAlign } from '../field/field-config';
|
|
5
4
|
import { PickerMode } from './date-picker-config';
|
|
6
5
|
export interface DatePickerProps {
|
|
6
|
+
/**
|
|
7
|
+
* The currently selected date.
|
|
8
|
+
* Use null for no selection.
|
|
9
|
+
*/
|
|
7
10
|
selected?: Date | null;
|
|
11
|
+
/**
|
|
12
|
+
* Callback fired when the selected date changes.
|
|
13
|
+
* Receives the new date or null when cleared.
|
|
14
|
+
*/
|
|
8
15
|
onChange?: (date: Date | null) => void;
|
|
16
|
+
/**
|
|
17
|
+
* The selection mode of the picker.
|
|
18
|
+
* Determines whether the picker shows date, time, or both.
|
|
19
|
+
*
|
|
20
|
+
* @default "date"
|
|
21
|
+
*/
|
|
9
22
|
mode?: PickerMode;
|
|
23
|
+
/**
|
|
24
|
+
* Size of the date picker.
|
|
25
|
+
* Controls the height and font size of the trigger.
|
|
26
|
+
*
|
|
27
|
+
* @default "md"
|
|
28
|
+
*/
|
|
10
29
|
size?: FieldSizeKey;
|
|
30
|
+
/**
|
|
31
|
+
* Corner rounding of the date picker.
|
|
32
|
+
*
|
|
33
|
+
* @default "md"
|
|
34
|
+
*/
|
|
11
35
|
radius?: Radius;
|
|
36
|
+
/**
|
|
37
|
+
* Visual style variant of the date picker trigger.
|
|
38
|
+
*
|
|
39
|
+
* @default "bordered"
|
|
40
|
+
*/
|
|
12
41
|
variant?: Variant;
|
|
42
|
+
/**
|
|
43
|
+
* Theme accent color of the date picker.
|
|
44
|
+
*
|
|
45
|
+
* @default "primary"
|
|
46
|
+
*/
|
|
13
47
|
color?: Color;
|
|
48
|
+
/**
|
|
49
|
+
* Validation status of the field.
|
|
50
|
+
* Controls border color and message styling.
|
|
51
|
+
*/
|
|
14
52
|
status?: FieldStatus;
|
|
53
|
+
/**
|
|
54
|
+
* Label text for the date picker.
|
|
55
|
+
*/
|
|
15
56
|
label?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Alignment of the label relative to the input.
|
|
59
|
+
*
|
|
60
|
+
* @default "left"
|
|
61
|
+
*/
|
|
16
62
|
labelAlign?: LabelAlign;
|
|
63
|
+
/**
|
|
64
|
+
* Description text shown below the field.
|
|
65
|
+
*/
|
|
17
66
|
description?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Validation message shown below the field.
|
|
69
|
+
* Color is determined by the status prop.
|
|
70
|
+
*/
|
|
18
71
|
message?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the field is required.
|
|
74
|
+
* Adds a required indicator to the label.
|
|
75
|
+
*
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
19
78
|
required?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the field is in a loading state.
|
|
81
|
+
* Shows a loading spinner.
|
|
82
|
+
*
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
20
85
|
isLoading?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether the field is disabled.
|
|
88
|
+
* Prevents interaction and dims the field.
|
|
89
|
+
*
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
21
92
|
disabled?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether a clear button is shown when a value is selected.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
22
98
|
isClearable?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether future dates are disabled for selection.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
23
104
|
disableFuture?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Custom placeholder text.
|
|
107
|
+
* Overrides the default placeholder for the selected mode.
|
|
108
|
+
*/
|
|
24
109
|
placeholder?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Extra CSS classes for the date picker.
|
|
112
|
+
*/
|
|
25
113
|
className?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Optional ID for the field.
|
|
116
|
+
*/
|
|
26
117
|
id?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Inline styles for the date picker.
|
|
120
|
+
*/
|
|
27
121
|
style?: CSSProperties;
|
|
28
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* A date, time, or datetime picker component with a calendar popover.
|
|
125
|
+
*
|
|
126
|
+
* DatePicker displays a trigger input that opens a calendar panel for
|
|
127
|
+
* selecting dates and times. It supports multiple modes (date, time,
|
|
128
|
+
* datetime), clearable values, validation states, and the standard
|
|
129
|
+
* AsheeUI cascade for visual tokens.
|
|
130
|
+
*
|
|
131
|
+
* The component automatically handles accessibility attributes including
|
|
132
|
+
* role="combobox", aria-expanded, aria-invalid, and proper focus management
|
|
133
|
+
* through Floating UI.
|
|
134
|
+
*
|
|
135
|
+
* @param props - DatePicker configuration options.
|
|
136
|
+
* @param props.selected - The currently selected date.
|
|
137
|
+
* @param props.onChange - Callback fired when the selected date changes.
|
|
138
|
+
* @param props.mode - Selection mode. Defaults to "date".
|
|
139
|
+
* @param props.size - Size of the picker. Defaults to "md".
|
|
140
|
+
* @param props.radius - Corner rounding. Defaults to "md".
|
|
141
|
+
* @param props.variant - Visual style variant. Defaults to "bordered".
|
|
142
|
+
* @param props.color - Theme accent color. Defaults to "primary".
|
|
143
|
+
* @param props.status - Validation status.
|
|
144
|
+
* @param props.label - Label text.
|
|
145
|
+
* @param props.labelAlign - Label alignment. Defaults to "left".
|
|
146
|
+
* @param props.description - Description text.
|
|
147
|
+
* @param props.message - Validation message.
|
|
148
|
+
* @param props.required - Whether the field is required.
|
|
149
|
+
* @param props.isLoading - Loading state.
|
|
150
|
+
* @param props.disabled - Disabled state.
|
|
151
|
+
* @param props.isClearable - Whether a clear button is shown.
|
|
152
|
+
* @param props.disableFuture - Whether future dates are disabled.
|
|
153
|
+
* @param props.placeholder - Custom placeholder text.
|
|
154
|
+
* @param props.className - Extra CSS classes.
|
|
155
|
+
* @param props.id - Optional ID for the field.
|
|
156
|
+
* @param props.style - Inline styles.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* import { DatePicker } from "asheeui";
|
|
161
|
+
* import { useState } from "react";
|
|
162
|
+
*
|
|
163
|
+
* export function Example() {
|
|
164
|
+
* const [date, setDate] = useState<Date | null>(null);
|
|
165
|
+
*
|
|
166
|
+
* return (
|
|
167
|
+
* <DatePicker
|
|
168
|
+
* selected={date}
|
|
169
|
+
* onChange={setDate}
|
|
170
|
+
* label="Select a date"
|
|
171
|
+
* isClearable
|
|
172
|
+
* />
|
|
173
|
+
* );
|
|
174
|
+
* }
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```tsx
|
|
179
|
+
* // DateTime picker with time selection
|
|
180
|
+
* <DatePicker
|
|
181
|
+
* mode="datetime"
|
|
182
|
+
* selected={dateTime}
|
|
183
|
+
* onChange={setDateTime}
|
|
184
|
+
* label="Select date and time"
|
|
185
|
+
* disableFuture
|
|
186
|
+
* />
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @see DatePickerConfig - The configuration type for component defaults.
|
|
190
|
+
* @see FieldShell - The wrapper component for label and validation.
|
|
191
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
192
|
+
*/
|
|
29
193
|
export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
30
194
|
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAsBA,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,OAAO,CAAC;AAOf,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,MAAM,EAEX,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAsa9B,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,eAAO,MAAM,UAAU,4GA4PtB,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as o, jsxs as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { CalendarIcon as
|
|
6
|
-
import { ChevronLeftIcon as
|
|
7
|
-
import { ChevronRightIcon as
|
|
8
|
-
import { ClearIcon as
|
|
9
|
-
import { ClockIcon as
|
|
10
|
-
import { useAsheeConfig as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
2
|
+
import { jsx as o, jsxs as h, Fragment as fe } from "react/jsx-runtime";
|
|
3
|
+
import { useFloating as pe, autoUpdate as he, offset as ge, flip as be, shift as xe, size as ye, useClick as ve, useDismiss as we, useRole as Se, useInteractions as De, FloatingFocusManager as Ne } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as Me, useId as Ae, useState as _, useCallback as Z, useMemo as ke } from "react";
|
|
5
|
+
import { CalendarIcon as Ie } from "../../icons/CalendarIcon.js";
|
|
6
|
+
import { ChevronLeftIcon as Fe } from "../../icons/ChevronLeftIcon.js";
|
|
7
|
+
import { ChevronRightIcon as Ce } from "../../icons/ChevronRightIcon.js";
|
|
8
|
+
import { ClearIcon as _e } from "../../icons/ClearIcon.js";
|
|
9
|
+
import { ClockIcon as Re } from "../../icons/ClockIcon.js";
|
|
10
|
+
import { useAsheeConfig as Ee } from "../../libs/context.js";
|
|
11
|
+
import { resolveCascade as j, resolveRadiusKey as $e, resolveClassKey as ee } from "../../utils/resolve-token.js";
|
|
12
|
+
import { FieldShell as Le } from "../field/FieldShell.js";
|
|
13
|
+
import { FALLBACK_DATE_PICKER_CONFIG as y } from "./date-picker-config.js";
|
|
14
|
+
import { CALENDAR_COLOR_CLASSES as K, DATE_PICKER_CELL_SIZE_CLASS as Pe, DATE_PICKER_STATUS_BORDER_CLASS as Te, DATE_PICKER_SIZE_CLASS as Ye } from "./date-picker-styles.js";
|
|
15
|
+
import { resolveVariantClass as je } from "../../shared/variant.js";
|
|
16
|
+
import { RADIUS_CLASS as te } from "../../shared/radius.js";
|
|
17
17
|
import { cn as d } from "../../utils/cn.js";
|
|
18
|
-
const
|
|
18
|
+
const Ke = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], Oe = [
|
|
19
19
|
"January",
|
|
20
20
|
"February",
|
|
21
21
|
"March",
|
|
@@ -32,7 +32,7 @@ const Ye = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], je = [
|
|
|
32
32
|
function R(e) {
|
|
33
33
|
return String(e).padStart(2, "0");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ze(e, n) {
|
|
36
36
|
const l = R(e.getDate()), m = R(e.getMonth() + 1), a = e.getFullYear(), s = R(e.getHours()), u = R(e.getMinutes());
|
|
37
37
|
switch (n) {
|
|
38
38
|
case "date":
|
|
@@ -43,7 +43,7 @@ function Ke(e, n) {
|
|
|
43
43
|
return `${l}/${m}/${a} ${s}:${u}`;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function He(e) {
|
|
47
47
|
switch (e) {
|
|
48
48
|
case "date":
|
|
49
49
|
return "Select date...";
|
|
@@ -53,7 +53,7 @@ function Oe(e) {
|
|
|
53
53
|
return "Select date & time...";
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Ve(e, n) {
|
|
57
57
|
const l = new Date(e, n + 1, 0).getDate(), m = new Date(e, n, 1).getDay(), a = [
|
|
58
58
|
...Array(m).fill(null),
|
|
59
59
|
...Array.from({ length: l }, (s, u) => u + 1)
|
|
@@ -69,8 +69,8 @@ function oe({
|
|
|
69
69
|
resolvedColor: a,
|
|
70
70
|
radiusClass: s
|
|
71
71
|
}) {
|
|
72
|
-
const u = () => m(e >= n ? 0 : e + 1),
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
const u = () => m(e >= n ? 0 : e + 1), v = () => m(e <= 0 ? n : e - 1), w = K[a] ?? K.primary;
|
|
73
|
+
return /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-0.5", children: [
|
|
74
74
|
/* @__PURE__ */ o("span", { className: "text-[10px] uppercase tracking-widest text-foreground/70 select-none", children: l }),
|
|
75
75
|
/* @__PURE__ */ o(
|
|
76
76
|
"button",
|
|
@@ -105,14 +105,14 @@ function oe({
|
|
|
105
105
|
s,
|
|
106
106
|
w.hover
|
|
107
107
|
),
|
|
108
|
-
onClick:
|
|
108
|
+
onClick: v,
|
|
109
109
|
"aria-label": `Decrement ${l}`,
|
|
110
110
|
children: "▼"
|
|
111
111
|
}
|
|
112
112
|
)
|
|
113
113
|
] });
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Je({
|
|
116
116
|
selected: e,
|
|
117
117
|
mode: n,
|
|
118
118
|
isClearable: l,
|
|
@@ -120,14 +120,14 @@ function He({
|
|
|
120
120
|
resolvedColor: a,
|
|
121
121
|
radiusClass: s,
|
|
122
122
|
onSelect: u,
|
|
123
|
-
onClose:
|
|
123
|
+
onClose: v,
|
|
124
124
|
disableFuture: w = !1
|
|
125
125
|
}) {
|
|
126
|
-
const c = /* @__PURE__ */ new Date(), [
|
|
126
|
+
const c = /* @__PURE__ */ new Date(), [g, E] = _(
|
|
127
127
|
(e == null ? void 0 : e.getFullYear()) ?? c.getFullYear()
|
|
128
128
|
), [f, D] = _(
|
|
129
129
|
(e == null ? void 0 : e.getMonth()) ?? c.getMonth()
|
|
130
|
-
), [
|
|
130
|
+
), [b, $] = _((e == null ? void 0 : e.getHours()) ?? 0), [I, O] = _((e == null ? void 0 : e.getMinutes()) ?? 0), x = K[a] ?? K.primary;
|
|
131
131
|
function L(t, i) {
|
|
132
132
|
const k = e ?? /* @__PURE__ */ new Date();
|
|
133
133
|
u(
|
|
@@ -138,10 +138,10 @@ function He({
|
|
|
138
138
|
$(t), L(t, I);
|
|
139
139
|
}
|
|
140
140
|
function N(t) {
|
|
141
|
-
O(t), L(
|
|
141
|
+
O(t), L(b, t);
|
|
142
142
|
}
|
|
143
143
|
function M(t) {
|
|
144
|
-
u(new Date(
|
|
144
|
+
u(new Date(g, f, t, b, I, 0, 0)), n === "date" && v();
|
|
145
145
|
}
|
|
146
146
|
function r() {
|
|
147
147
|
f === 0 ? (D(11), E((t) => t - 1)) : D((t) => t - 1);
|
|
@@ -150,10 +150,10 @@ function He({
|
|
|
150
150
|
f === 11 ? (D(0), E((t) => t + 1)) : D((t) => t + 1);
|
|
151
151
|
}
|
|
152
152
|
function V(t) {
|
|
153
|
-
return !!e && e.getFullYear() ===
|
|
153
|
+
return !!e && e.getFullYear() === g && e.getMonth() === f && e.getDate() === t;
|
|
154
154
|
}
|
|
155
155
|
function F(t) {
|
|
156
|
-
return c.getFullYear() ===
|
|
156
|
+
return c.getFullYear() === g && c.getMonth() === f && c.getDate() === t;
|
|
157
157
|
}
|
|
158
158
|
const P = new Date(
|
|
159
159
|
c.getFullYear(),
|
|
@@ -161,13 +161,13 @@ function He({
|
|
|
161
161
|
c.getDate()
|
|
162
162
|
);
|
|
163
163
|
function C(t) {
|
|
164
|
-
return w ? new Date(
|
|
164
|
+
return w ? new Date(g, f, t) > P : !1;
|
|
165
165
|
}
|
|
166
|
-
const J = !w ||
|
|
166
|
+
const J = !w || g < c.getFullYear() || g === c.getFullYear() && f < c.getMonth(), A = n === "date" || n === "datetime", U = n === "time" || n === "datetime", B = n !== "date" || l && !!e, T = Ve(g, f), G = ke(() => T.map((t, i) => ({
|
|
167
167
|
key: t !== null ? `day-${t}` : `empty-slot-${i}`,
|
|
168
168
|
day: t
|
|
169
169
|
})), [T]);
|
|
170
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ h(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
173
|
className: d(
|
|
@@ -175,8 +175,8 @@ function He({
|
|
|
175
175
|
s
|
|
176
176
|
),
|
|
177
177
|
children: [
|
|
178
|
-
A && /* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
178
|
+
A && /* @__PURE__ */ h(fe, { children: [
|
|
179
|
+
/* @__PURE__ */ h("div", { className: "flex items-center justify-between pb-2 mb-2 border-b border-border", children: [
|
|
180
180
|
/* @__PURE__ */ o(
|
|
181
181
|
"button",
|
|
182
182
|
{
|
|
@@ -186,15 +186,15 @@ function He({
|
|
|
186
186
|
className: d(
|
|
187
187
|
"p-1 text-foreground transition-colors",
|
|
188
188
|
s,
|
|
189
|
-
|
|
189
|
+
x.hover
|
|
190
190
|
),
|
|
191
|
-
children: /* @__PURE__ */ o(
|
|
191
|
+
children: /* @__PURE__ */ o(Fe, {})
|
|
192
192
|
}
|
|
193
193
|
),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
194
|
+
/* @__PURE__ */ h("span", { className: "font-medium text-sm text-foreground", children: [
|
|
195
|
+
Oe[f],
|
|
196
196
|
" ",
|
|
197
|
-
|
|
197
|
+
g
|
|
198
198
|
] }),
|
|
199
199
|
/* @__PURE__ */ o(
|
|
200
200
|
"button",
|
|
@@ -206,14 +206,14 @@ function He({
|
|
|
206
206
|
className: d(
|
|
207
207
|
"p-1 text-foreground transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
208
208
|
s,
|
|
209
|
-
|
|
209
|
+
x.hover
|
|
210
210
|
),
|
|
211
|
-
children: /* @__PURE__ */ o(
|
|
211
|
+
children: /* @__PURE__ */ o(Ce, {})
|
|
212
212
|
}
|
|
213
213
|
)
|
|
214
214
|
] }),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
|
|
215
|
+
/* @__PURE__ */ h("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
216
|
+
Ke.map((t) => /* @__PURE__ */ o(
|
|
217
217
|
"div",
|
|
218
218
|
{
|
|
219
219
|
className: "text-xs font-semibold text-foreground/70 py-1",
|
|
@@ -230,9 +230,9 @@ function He({
|
|
|
230
230
|
disabled: C(i),
|
|
231
231
|
className: d(
|
|
232
232
|
"w-full flex items-center justify-center font-medium transition-colors",
|
|
233
|
-
|
|
233
|
+
Pe[m],
|
|
234
234
|
s,
|
|
235
|
-
C(i) ? "opacity-30 cursor-not-allowed text-foreground/70" : V(i) ? d(
|
|
235
|
+
C(i) ? "opacity-30 cursor-not-allowed text-foreground/70" : V(i) ? d(x.bg, "font-semibold") : F(i) ? d("border", x.border, x.text) : d("text-foreground", x.hover)
|
|
236
236
|
),
|
|
237
237
|
children: i
|
|
238
238
|
},
|
|
@@ -241,11 +241,11 @@ function He({
|
|
|
241
241
|
)
|
|
242
242
|
] })
|
|
243
243
|
] }),
|
|
244
|
-
U && /* @__PURE__ */
|
|
244
|
+
U && /* @__PURE__ */ h("div", { className: "flex items-center justify-center gap-4 py-3 border-t border-border mt-2", children: [
|
|
245
245
|
/* @__PURE__ */ o(
|
|
246
246
|
oe,
|
|
247
247
|
{
|
|
248
|
-
value:
|
|
248
|
+
value: b,
|
|
249
249
|
max: 23,
|
|
250
250
|
label: "HH",
|
|
251
251
|
onChange: z,
|
|
@@ -266,13 +266,13 @@ function He({
|
|
|
266
266
|
}
|
|
267
267
|
)
|
|
268
268
|
] }),
|
|
269
|
-
B && /* @__PURE__ */
|
|
269
|
+
B && /* @__PURE__ */ h("div", { className: "flex items-center justify-between border-t border-border pt-2 mt-2", children: [
|
|
270
270
|
l && e && /* @__PURE__ */ o(
|
|
271
271
|
"button",
|
|
272
272
|
{
|
|
273
273
|
type: "button",
|
|
274
274
|
onClick: () => {
|
|
275
|
-
u(null),
|
|
275
|
+
u(null), v();
|
|
276
276
|
},
|
|
277
277
|
className: "text-xs text-foreground/70 hover:text-danger transition-colors",
|
|
278
278
|
children: "Clear"
|
|
@@ -282,11 +282,11 @@ function He({
|
|
|
282
282
|
"button",
|
|
283
283
|
{
|
|
284
284
|
type: "button",
|
|
285
|
-
onClick:
|
|
285
|
+
onClick: v,
|
|
286
286
|
className: d(
|
|
287
287
|
"ml-auto text-xs font-medium px-3 py-1.5 hover:opacity-90 transition-opacity",
|
|
288
288
|
s,
|
|
289
|
-
|
|
289
|
+
x.bg
|
|
290
290
|
),
|
|
291
291
|
children: "Done"
|
|
292
292
|
}
|
|
@@ -296,7 +296,7 @@ function He({
|
|
|
296
296
|
}
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const Ue = Me(
|
|
300
300
|
({
|
|
301
301
|
selected: e,
|
|
302
302
|
onChange: n,
|
|
@@ -305,29 +305,40 @@ const Ve = De(
|
|
|
305
305
|
radius: a,
|
|
306
306
|
variant: s,
|
|
307
307
|
color: u,
|
|
308
|
-
status:
|
|
308
|
+
status: v,
|
|
309
309
|
label: w,
|
|
310
310
|
labelAlign: c,
|
|
311
|
-
description:
|
|
311
|
+
description: g,
|
|
312
312
|
message: E,
|
|
313
313
|
required: f,
|
|
314
314
|
isLoading: D,
|
|
315
|
-
disabled:
|
|
315
|
+
disabled: b,
|
|
316
316
|
isClearable: $ = !1,
|
|
317
317
|
disableFuture: I = !1,
|
|
318
318
|
placeholder: O,
|
|
319
|
-
className:
|
|
319
|
+
className: x,
|
|
320
320
|
id: L,
|
|
321
321
|
style: z
|
|
322
322
|
}, N) => {
|
|
323
323
|
var X;
|
|
324
|
-
const M =
|
|
324
|
+
const M = Ee(), r = (X = M.components) == null ? void 0 : X.datePicker, H = Ae(), V = L ?? H, [F, P] = _(!1), { refs: C, floatingStyles: J, context: A } = pe({
|
|
325
325
|
open: F,
|
|
326
|
-
onOpenChange: (
|
|
326
|
+
onOpenChange: (p) => !b && P(p),
|
|
327
327
|
placement: "bottom-start",
|
|
328
|
-
whileElementsMounted:
|
|
329
|
-
middleware: [
|
|
330
|
-
|
|
328
|
+
whileElementsMounted: he,
|
|
329
|
+
middleware: [
|
|
330
|
+
ge(4),
|
|
331
|
+
be(),
|
|
332
|
+
xe({ padding: 8 }),
|
|
333
|
+
ye({
|
|
334
|
+
apply({ availableHeight: p, elements: me }) {
|
|
335
|
+
Object.assign(me.floating.style, {
|
|
336
|
+
maxHeight: `${p}px`
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
})
|
|
340
|
+
]
|
|
341
|
+
}), U = ve(A, { enabled: !b }), B = we(A), T = Se(A, { role: "dialog" }), { getReferenceProps: G, getFloatingProps: t } = De([
|
|
331
342
|
U,
|
|
332
343
|
B,
|
|
333
344
|
T
|
|
@@ -335,80 +346,80 @@ const Ve = De(
|
|
|
335
346
|
m,
|
|
336
347
|
r == null ? void 0 : r.size,
|
|
337
348
|
void 0,
|
|
338
|
-
|
|
349
|
+
y.size
|
|
339
350
|
), k = j(
|
|
340
351
|
s,
|
|
341
352
|
r == null ? void 0 : r.variant,
|
|
342
353
|
M.defaultVariant,
|
|
343
|
-
|
|
354
|
+
y.variant
|
|
344
355
|
), q = j(
|
|
345
356
|
u,
|
|
346
357
|
r == null ? void 0 : r.color,
|
|
347
358
|
M.defaultColor,
|
|
348
|
-
|
|
349
|
-
), W =
|
|
359
|
+
y.color
|
|
360
|
+
), W = $e(
|
|
350
361
|
typeof a == "string" ? a : void 0,
|
|
351
362
|
typeof (r == null ? void 0 : r.radius) == "string" ? r.radius : void 0,
|
|
352
363
|
M.defaultRadius,
|
|
353
|
-
|
|
354
|
-
), S =
|
|
364
|
+
y.radius
|
|
365
|
+
), S = v ?? y.status, ne = j(
|
|
355
366
|
c,
|
|
356
367
|
r == null ? void 0 : r.labelAlign,
|
|
357
368
|
void 0,
|
|
358
|
-
|
|
359
|
-
), Y = l ?? (r == null ? void 0 : r.mode) ??
|
|
369
|
+
y.labelAlign
|
|
370
|
+
), Y = l ?? (r == null ? void 0 : r.mode) ?? y.mode, re = je(
|
|
360
371
|
k,
|
|
361
372
|
S === "error" ? "danger" : S === "success" ? "success" : S === "warning" ? "warning" : q
|
|
362
|
-
), se = S !== "default" ?
|
|
373
|
+
), se = S !== "default" ? Te[S] : "", ae = k === "underlined" ? "rounded-none" : ee(
|
|
363
374
|
W,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
), ie =
|
|
375
|
+
te,
|
|
376
|
+
y.radius
|
|
377
|
+
), ie = ee(
|
|
367
378
|
W === "full" ? "xl" : W,
|
|
368
|
-
|
|
369
|
-
|
|
379
|
+
te,
|
|
380
|
+
y.radius
|
|
370
381
|
), le = Z(
|
|
371
|
-
(
|
|
382
|
+
(p) => n == null ? void 0 : n(p),
|
|
372
383
|
[n]
|
|
373
384
|
), ce = Z(() => P(!1), []), ue = Z(
|
|
374
|
-
(
|
|
375
|
-
|
|
385
|
+
(p) => {
|
|
386
|
+
p.stopPropagation(), n == null || n(null);
|
|
376
387
|
},
|
|
377
388
|
[n]
|
|
378
|
-
), de = O ??
|
|
389
|
+
), de = O ?? He(Y), Q = e ? ze(e, Y) : null;
|
|
379
390
|
return /* @__PURE__ */ o(
|
|
380
|
-
|
|
391
|
+
Le,
|
|
381
392
|
{
|
|
382
393
|
id: V,
|
|
383
394
|
label: w,
|
|
384
395
|
labelAlign: ne,
|
|
385
|
-
description:
|
|
396
|
+
description: g,
|
|
386
397
|
message: E,
|
|
387
398
|
status: S,
|
|
388
399
|
required: f,
|
|
389
400
|
isLoading: D,
|
|
390
|
-
children: /* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ h("div", { className: "w-full relative inline-block", children: [
|
|
402
|
+
/* @__PURE__ */ h(
|
|
392
403
|
"div",
|
|
393
404
|
{
|
|
394
|
-
ref: (
|
|
395
|
-
C.setReference(
|
|
405
|
+
ref: (p) => {
|
|
406
|
+
C.setReference(p), typeof N == "function" ? N(p) : N && (N.current = p);
|
|
396
407
|
},
|
|
397
408
|
role: "combobox",
|
|
398
|
-
tabIndex:
|
|
409
|
+
tabIndex: b ? -1 : 0,
|
|
399
410
|
"aria-expanded": F,
|
|
400
411
|
"aria-haspopup": "dialog",
|
|
401
412
|
"aria-invalid": S === "error",
|
|
402
|
-
"aria-disabled":
|
|
413
|
+
"aria-disabled": b,
|
|
403
414
|
className: d(
|
|
404
415
|
"w-full flex items-center justify-between cursor-pointer text-foreground outline-none transition-colors select-none shrink-0",
|
|
405
416
|
"focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
406
|
-
|
|
407
|
-
|
|
417
|
+
b && "pointer-events-none opacity-50 cursor-not-allowed",
|
|
418
|
+
Ye[i],
|
|
408
419
|
re,
|
|
409
420
|
se,
|
|
410
421
|
ae,
|
|
411
|
-
|
|
422
|
+
x
|
|
412
423
|
),
|
|
413
424
|
style: z,
|
|
414
425
|
...G(),
|
|
@@ -420,23 +431,23 @@ const Ve = De(
|
|
|
420
431
|
children: Q ?? de
|
|
421
432
|
}
|
|
422
433
|
),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
$ && e && !
|
|
434
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-1.5 ml-2 shrink-0", children: [
|
|
435
|
+
$ && e && !b && /* @__PURE__ */ o(
|
|
425
436
|
"button",
|
|
426
437
|
{
|
|
427
438
|
type: "button",
|
|
428
439
|
onClick: ue,
|
|
429
440
|
"aria-label": "Clear selection",
|
|
430
441
|
className: "p-0.5 rounded text-foreground/70 hover:text-foreground transition-colors",
|
|
431
|
-
children: /* @__PURE__ */ o(
|
|
442
|
+
children: /* @__PURE__ */ o(_e, { className: "size-3.5" })
|
|
432
443
|
}
|
|
433
444
|
),
|
|
434
|
-
/* @__PURE__ */ o("span", { className: "text-foreground/70 pointer-events-none", children: Y === "time" ? /* @__PURE__ */ o(
|
|
445
|
+
/* @__PURE__ */ o("span", { className: "text-foreground/70 pointer-events-none", children: Y === "time" ? /* @__PURE__ */ o(Re, {}) : /* @__PURE__ */ o(Ie, {}) })
|
|
435
446
|
] })
|
|
436
447
|
]
|
|
437
448
|
}
|
|
438
449
|
),
|
|
439
|
-
F && /* @__PURE__ */ o(
|
|
450
|
+
F && /* @__PURE__ */ o(Ne, { context: A, modal: !1, children: /* @__PURE__ */ o(
|
|
440
451
|
"div",
|
|
441
452
|
{
|
|
442
453
|
ref: C.setFloating,
|
|
@@ -444,7 +455,7 @@ const Ve = De(
|
|
|
444
455
|
className: "outline-none",
|
|
445
456
|
...t(),
|
|
446
457
|
children: /* @__PURE__ */ o("div", { className: "animate-in fade-in-0 zoom-in-95 duration-150 ease-out", children: /* @__PURE__ */ o(
|
|
447
|
-
|
|
458
|
+
Je,
|
|
448
459
|
{
|
|
449
460
|
selected: e,
|
|
450
461
|
mode: Y,
|
|
@@ -464,7 +475,7 @@ const Ve = De(
|
|
|
464
475
|
);
|
|
465
476
|
}
|
|
466
477
|
);
|
|
467
|
-
|
|
478
|
+
Ue.displayName = "DatePicker";
|
|
468
479
|
export {
|
|
469
|
-
|
|
480
|
+
Ue as DatePicker
|
|
470
481
|
};
|