@moduix/react 2.5.1 → 2.6.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/README.md +24 -3
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/components/accordion/Accordion.js +7 -8
- package/dist/components/alert/Alert.js +6 -7
- package/dist/components/alert/Alert_module.css +3 -16
- package/dist/components/angle-slider/AngleSlider.d.ts +5 -11
- package/dist/components/angle-slider/AngleSlider.js +17 -59
- package/dist/components/aspect-ratio/AspectRatio.js +1 -2
- package/dist/components/aspect-ratio/AspectRatio_module.css +0 -13
- package/dist/components/avatar/Avatar.d.ts +3 -6
- package/dist/components/avatar/Avatar.js +7 -50
- package/dist/components/avatar/Avatar.module.js +1 -2
- package/dist/components/avatar/Avatar_module.css +0 -6
- package/dist/components/badge/Badge.d.ts +2 -2
- package/dist/components/badge/Badge.js +5 -10
- package/dist/components/badge/Badge_module.css +7 -14
- package/dist/components/bleed/Bleed.js +1 -2
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +16 -32
- package/dist/components/breadcrumbs/Breadcrumbs_module.css +12 -14
- package/dist/components/button/Button.d.ts +4 -4
- package/dist/components/button/Button.js +1 -2
- package/dist/components/button/Button_module.css +2 -7
- package/dist/components/card/Card.d.ts +15 -15
- package/dist/components/card/Card.js +10 -11
- package/dist/components/card/Card_module.css +1 -17
- package/dist/components/carousel/Carousel.js +12 -13
- package/dist/components/carousel/Carousel_module.css +7 -0
- package/dist/components/chart/Chart.d.ts +9 -8
- package/dist/components/chart/Chart.js +7 -8
- package/dist/components/chart/Chart_module.css +0 -2
- package/dist/components/checkbox/Checkbox.d.ts +3 -2
- package/dist/components/checkbox/Checkbox.js +12 -35
- package/dist/components/clipboard/Clipboard.js +8 -9
- package/dist/components/close-button/CloseButton.js +1 -2
- package/dist/components/close-button/CloseButton_module.css +1 -10
- package/dist/components/collapsible/Collapsible.js +6 -9
- package/dist/components/collapsible/Collapsible_module.css +2 -4
- package/dist/components/color-picker/ColorPicker.d.ts +4 -3
- package/dist/components/color-picker/ColorPicker.js +32 -45
- package/dist/components/color-picker/ColorPicker_module.css +0 -1
- package/dist/components/combobox/Combobox.d.ts +5 -5
- package/dist/components/combobox/Combobox.js +20 -29
- package/dist/components/combobox/Combobox_module.css +0 -1
- package/dist/components/command-palette/CommandPalette.d.ts +7 -18
- package/dist/components/command-palette/CommandPalette.js +51 -78
- package/dist/components/command-palette/CommandPalette_module.css +11 -18
- package/dist/components/container/Container.js +1 -2
- package/dist/components/date-input/DateInput.d.ts +7 -9
- package/dist/components/date-input/DateInput.js +14 -44
- package/dist/components/date-input/DateInput_module.css +0 -1
- package/dist/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/components/date-picker/DatePicker.js +34 -43
- package/dist/components/date-picker/DatePicker.module.js +1 -1
- package/dist/components/date-picker/DatePicker_module.css +5 -2
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/Dialog.js +11 -12
- package/dist/components/drawer/Drawer.d.ts +6 -3
- package/dist/components/drawer/Drawer.js +33 -24
- package/dist/components/editable/Editable.d.ts +1 -1
- package/dist/components/editable/Editable.js +10 -11
- package/dist/components/empty/Empty.js +6 -7
- package/dist/components/field/Field.js +10 -11
- package/dist/components/fieldset/Fieldset.js +5 -6
- package/dist/components/file-upload/FileUpload.d.ts +3 -2
- package/dist/components/file-upload/FileUpload.js +28 -55
- package/dist/components/file-upload/FileUpload_module.css +4 -13
- package/dist/components/floating-panel/FloatingPanel.d.ts +2 -2
- package/dist/components/floating-panel/FloatingPanel.js +14 -15
- package/dist/components/floating-panel/FloatingPanel_module.css +4 -17
- package/dist/components/heading/Heading.js +1 -2
- package/dist/components/highlight/Highlight.js +1 -2
- package/dist/components/hover-card/HoverCard.d.ts +2 -1
- package/dist/components/hover-card/HoverCard.js +15 -6
- package/dist/components/hover-card/HoverCard.module.js +1 -0
- package/dist/components/hover-card/HoverCard_module.css +18 -3
- package/dist/components/image/Image.js +1 -2
- package/dist/components/image-cropper/ImageCropper.d.ts +1 -1
- package/dist/components/image-cropper/ImageCropper.js +7 -8
- package/dist/components/input/Input.d.ts +4 -4
- package/dist/components/input/Input.js +1 -2
- package/dist/components/input-group/InputGroup.d.ts +5 -5
- package/dist/components/input-group/InputGroup.js +5 -6
- package/dist/components/json-tree-view/JsonTreeView.js +3 -4
- package/dist/components/json-tree-view/JsonTreeView_module.css +26 -10
- package/dist/components/kbd/Kbd.js +2 -3
- package/dist/components/lightbox/Lightbox.d.ts +1 -1
- package/dist/components/lightbox/Lightbox.js +13 -14
- package/dist/components/lightbox/Lightbox_module.css +0 -2
- package/dist/components/list/List.js +2 -3
- package/dist/components/listbox/Listbox.d.ts +5 -5
- package/dist/components/listbox/Listbox.js +19 -25
- package/dist/components/listbox/Listbox.module.js +2 -2
- package/dist/components/listbox/Listbox_module.css +3 -13
- package/dist/components/marquee/Marquee.js +6 -7
- package/dist/components/menu/Menu.d.ts +2 -1
- package/dist/components/menu/Menu.js +34 -41
- package/dist/components/menu/Menu.module.js +1 -1
- package/dist/components/menu/Menu_module.css +8 -8
- package/dist/components/native-select/NativeSelect.js +2 -3
- package/dist/components/native-select/NativeSelect_module.css +0 -1
- package/dist/components/navigation-menu/NavigationMenu.js +17 -36
- package/dist/components/navigation-menu/NavigationMenu.module.js +2 -3
- package/dist/components/navigation-menu/NavigationMenu_module.css +15 -32
- package/dist/components/number-input/NumberInput.js +9 -10
- package/dist/components/pagination/Pagination.js +17 -20
- package/dist/components/pagination/Pagination_module.css +1 -5
- package/dist/components/password-input/PasswordInput.js +7 -8
- package/dist/components/pin-input/PinInput.d.ts +3 -2
- package/dist/components/pin-input/PinInput.js +13 -54
- package/dist/components/popover/Popover.d.ts +5 -3
- package/dist/components/popover/Popover.js +16 -17
- package/dist/components/progress-circular/ProgressCircular.js +8 -9
- package/dist/components/progress-circular/ProgressCircular.module.js +1 -3
- package/dist/components/progress-circular/ProgressCircular_module.css +0 -10
- package/dist/components/progress-linear/ProgressLinear.js +7 -8
- package/dist/components/progress-linear/ProgressLinear.module.js +1 -5
- package/dist/components/progress-linear/ProgressLinear_module.css +0 -20
- package/dist/components/qr-code/QrCode.js +6 -7
- package/dist/components/radio-group/RadioGroup.d.ts +1 -0
- package/dist/components/radio-group/RadioGroup.js +13 -27
- package/dist/components/radio-group/RadioGroup_module.css +0 -1
- package/dist/components/rating-group/RatingGroup.d.ts +1 -0
- package/dist/components/rating-group/RatingGroup.js +12 -29
- package/dist/components/rating-group/RatingGroup_module.css +1 -1
- package/dist/components/scroll-area/ScrollArea.js +7 -8
- package/dist/components/segment-group/SegmentGroup.d.ts +1 -0
- package/dist/components/segment-group/SegmentGroup.js +16 -30
- package/dist/components/segment-group/SegmentGroup_module.css +4 -0
- package/dist/components/select/Select.d.ts +4 -7
- package/dist/components/select/Select.js +36 -86
- package/dist/components/select/Select.module.js +1 -1
- package/dist/components/select/Select_module.css +4 -31
- package/dist/components/separator/Separator.d.ts +6 -6
- package/dist/components/separator/Separator.js +1 -2
- package/dist/components/sidebar/Sidebar.d.ts +16 -16
- package/dist/components/sidebar/Sidebar.js +35 -48
- package/dist/components/sidebar/Sidebar.module.js +2 -3
- package/dist/components/sidebar/Sidebar_module.css +62 -158
- package/dist/components/signature-pad/SignaturePad.d.ts +5 -8
- package/dist/components/signature-pad/SignaturePad.js +17 -46
- package/dist/components/signature-pad/SignaturePad_module.css +0 -1
- package/dist/components/simple-grid/SimpleGrid.js +13 -8
- package/dist/components/skeleton/Skeleton.d.ts +2 -2
- package/dist/components/skeleton/Skeleton.js +1 -2
- package/dist/components/slider/Slider.d.ts +2 -2
- package/dist/components/slider/Slider.js +18 -32
- package/dist/components/spinner/Spinner.d.ts +2 -2
- package/dist/components/spinner/Spinner.js +1 -2
- package/dist/components/split-button/SplitButton.d.ts +4 -4
- package/dist/components/split-button/SplitButton.js +11 -8
- package/dist/components/splitter/Splitter.js +5 -6
- package/dist/components/splitter/Splitter_module.css +2 -10
- package/dist/components/stack/Stack.d.ts +6 -6
- package/dist/components/stack/Stack.js +4 -5
- package/dist/components/stack/Stack_module.css +1 -1
- package/dist/components/steps/Steps.js +12 -13
- package/dist/components/steps/Steps_module.css +2 -3
- package/dist/components/swap/Swap.js +3 -4
- package/dist/components/switch/Switch.d.ts +3 -2
- package/dist/components/switch/Switch.js +12 -35
- package/dist/components/switch/Switch_module.css +0 -1
- package/dist/components/table/Table.d.ts +5 -5
- package/dist/components/table/Table.js +12 -13
- package/dist/components/tabs/Tabs.js +6 -7
- package/dist/components/tabs/Tabs_module.css +5 -10
- package/dist/components/tag/Tag.js +5 -6
- package/dist/components/tag/Tag_module.css +2 -4
- package/dist/components/tags-input/TagsInput.d.ts +3 -3
- package/dist/components/tags-input/TagsInput.js +21 -75
- package/dist/components/tags-input/TagsInput_module.css +0 -1
- package/dist/components/text/Text.js +1 -2
- package/dist/components/textarea/Textarea.js +1 -2
- package/dist/components/timer/Timer.js +7 -8
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +7 -8
- package/dist/components/toast/Toast_module.css +1 -2
- package/dist/components/toc/Toc.js +10 -11
- package/dist/components/toc/Toc_module.css +2 -2
- package/dist/components/toggle/Toggle.js +2 -3
- package/dist/components/toggle-group/ToggleGroup.d.ts +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +3 -4
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +6 -7
- package/dist/components/tooltip/Tooltip_module.css +1 -1
- package/dist/components/tour/Tour.d.ts +1 -1
- package/dist/components/tour/Tour.js +14 -15
- package/dist/components/tree-view/TreeView.d.ts +4 -4
- package/dist/components/tree-view/TreeView.js +17 -18
- package/dist/components/tree-view/TreeView_module.css +39 -12
- package/dist/components/typeset/Typeset.js +2 -3
- package/dist/components/typeset/Typeset_module.css +300 -159
- package/dist/internal/icons/ui/Icons.d.ts +9 -30
- package/dist/internal/icons/ui/Icons.js +67 -807
- package/dist/internal/icons/ui/index.d.ts +1 -1
- package/dist/styles/animations.css +310 -0
- package/dist/styles/style.css +168 -2
- package/package.json +23 -23
- package/dist/internal/normalizeClassName.d.ts +0 -1
- package/dist/internal/normalizeClassName.js +0 -2
|
@@ -3,51 +3,34 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Combobox } from "@ark-ui/react/combobox";
|
|
4
4
|
import { Dialog, useDialog, useDialogContext } from "@ark-ui/react/dialog";
|
|
5
5
|
import { ark } from "@ark-ui/react/factory";
|
|
6
|
+
import { isHotKey } from "@zag-js/hotkeys";
|
|
6
7
|
import { clsx } from "clsx";
|
|
7
8
|
import { forwardRef, useEffect } from "react";
|
|
8
|
-
import { CheckIcon } from "../../internal/icons/ui/index.js";
|
|
9
|
-
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
9
|
+
import { CheckIcon, CloseIcon } from "../../internal/icons/ui/index.js";
|
|
10
10
|
import { OverlayPortal, OverlayPortalProvider } from "../../internal/overlayPortal.js";
|
|
11
|
-
import
|
|
11
|
+
import CloseButton_module from "../close-button/CloseButton.module.js";
|
|
12
12
|
import { Kbd } from "../kbd/index.js";
|
|
13
13
|
import { ScrollArea } from "../scroll-area/index.js";
|
|
14
14
|
import CommandPalette_module from "./CommandPalette.module.js";
|
|
15
15
|
const DEFAULT_CLEAR_TRIGGER_LABEL = 'Clear search';
|
|
16
16
|
const DEFAULT_SEARCH_INPUT_LABEL = 'Search commands';
|
|
17
|
-
function
|
|
18
|
-
const parts = shortcut.toLowerCase().split('+').map((part)=>part.trim()).filter(Boolean);
|
|
19
|
-
const [modifier, key] = parts;
|
|
20
|
-
if (!modifier || !key || 2 !== parts.length || event.shiftKey) return false;
|
|
21
|
-
const eventKey = event.key.toLowerCase();
|
|
22
|
-
const eventCode = event.code.startsWith('Key') || event.code.startsWith('Digit') ? event.code.slice(event.code.startsWith('Key') ? 3 : 5).toLowerCase() : event.code.toLowerCase();
|
|
23
|
-
if (eventKey !== key && eventCode !== key) return false;
|
|
24
|
-
if ('mod' === modifier) return (event.metaKey || event.ctrlKey) && !event.altKey;
|
|
25
|
-
if ('ctrl' === modifier || 'control' === modifier) return event.ctrlKey && !event.metaKey && !event.altKey;
|
|
26
|
-
if ('meta' === modifier || 'cmd' === modifier || 'command' === modifier) return event.metaKey && !event.ctrlKey && !event.altKey;
|
|
27
|
-
if ('alt' === modifier || 'option' === modifier) return event.altKey && !event.metaKey && !event.ctrlKey;
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
function isEditableTarget(target) {
|
|
31
|
-
if (!(target instanceof Element)) return false;
|
|
32
|
-
return null !== target.closest('input, textarea, select, [contenteditable], [contenteditable="true"]');
|
|
33
|
-
}
|
|
34
|
-
function CommandPaletteRoot({ shortcut = false, shortcutTarget, lazyMount = true, unmountOnExit = true, immediate, onExitComplete, portalled, present, portalRef, skipAnimationOnMount, children, ...props }) {
|
|
17
|
+
function CommandPaletteRoot({ shortcut = false, lazyMount = true, unmountOnExit = true, immediate, onExitComplete, portalled, present, portalRef, skipAnimationOnMount, children, ...props }) {
|
|
35
18
|
const dialog = useDialog(props);
|
|
36
19
|
useEffect(()=>{
|
|
37
|
-
if (!shortcut
|
|
38
|
-
const target = shortcutTarget ?? document;
|
|
20
|
+
if (!shortcut) return;
|
|
39
21
|
const handleKeyDown = (event)=>{
|
|
40
|
-
if (event.defaultPrevented || event.repeat || event.isComposing || !
|
|
22
|
+
if (event.defaultPrevented || event.repeat || event.isComposing || !isHotKey(shortcut, event, {
|
|
23
|
+
enableOnContentEditable: dialog.open,
|
|
24
|
+
enableOnFormTags: dialog.open
|
|
25
|
+
})) return;
|
|
41
26
|
event.preventDefault();
|
|
42
27
|
dialog.setOpen(!dialog.open);
|
|
43
28
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return ()=>target.removeEventListener('keydown', eventListener);
|
|
29
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
30
|
+
return ()=>document.removeEventListener('keydown', handleKeyDown);
|
|
47
31
|
}, [
|
|
48
32
|
dialog,
|
|
49
|
-
shortcut
|
|
50
|
-
shortcutTarget
|
|
33
|
+
shortcut
|
|
51
34
|
]);
|
|
52
35
|
return /*#__PURE__*/ jsx(OverlayPortalProvider, {
|
|
53
36
|
portalled: portalled,
|
|
@@ -80,7 +63,7 @@ const CommandPalette_CommandPaletteTrigger = /*#__PURE__*/ forwardRef(function({
|
|
|
80
63
|
ref: ref,
|
|
81
64
|
asChild: asChild,
|
|
82
65
|
"data-slot": "command-palette-trigger",
|
|
83
|
-
className: clsx(!asChild && CommandPalette_module.trigger,
|
|
66
|
+
className: clsx(!asChild && CommandPalette_module.trigger, className),
|
|
84
67
|
...props
|
|
85
68
|
});
|
|
86
69
|
});
|
|
@@ -89,7 +72,7 @@ const CommandPalette_CommandPaletteBackdrop = /*#__PURE__*/ forwardRef(function(
|
|
|
89
72
|
children: /*#__PURE__*/ jsx(Dialog.Backdrop, {
|
|
90
73
|
ref: ref,
|
|
91
74
|
"data-slot": "command-palette-backdrop",
|
|
92
|
-
className: clsx(CommandPalette_module.backdrop,
|
|
75
|
+
className: clsx(CommandPalette_module.backdrop, className),
|
|
93
76
|
...props
|
|
94
77
|
})
|
|
95
78
|
});
|
|
@@ -99,7 +82,7 @@ const CommandPalette_CommandPalettePositioner = /*#__PURE__*/ forwardRef(functio
|
|
|
99
82
|
children: /*#__PURE__*/ jsx(Dialog.Positioner, {
|
|
100
83
|
ref: ref,
|
|
101
84
|
"data-slot": "command-palette-positioner",
|
|
102
|
-
className: clsx(CommandPalette_module.positioner,
|
|
85
|
+
className: clsx(CommandPalette_module.positioner, className),
|
|
103
86
|
...props
|
|
104
87
|
})
|
|
105
88
|
});
|
|
@@ -108,7 +91,7 @@ const CommandPalette_CommandPaletteContent = /*#__PURE__*/ forwardRef(function({
|
|
|
108
91
|
return /*#__PURE__*/ jsx(Dialog.Content, {
|
|
109
92
|
ref: ref,
|
|
110
93
|
"data-slot": "command-palette-content",
|
|
111
|
-
className: clsx(CommandPalette_module.content,
|
|
94
|
+
className: clsx(CommandPalette_module.content, className),
|
|
112
95
|
...props
|
|
113
96
|
});
|
|
114
97
|
});
|
|
@@ -132,7 +115,7 @@ const CommandPalette_CommandPaletteTitle = /*#__PURE__*/ forwardRef(function({ c
|
|
|
132
115
|
return /*#__PURE__*/ jsx(Dialog.Title, {
|
|
133
116
|
ref: ref,
|
|
134
117
|
"data-slot": "command-palette-title",
|
|
135
|
-
className: clsx(CommandPalette_module.title,
|
|
118
|
+
className: clsx(CommandPalette_module.title, className),
|
|
136
119
|
...props
|
|
137
120
|
});
|
|
138
121
|
});
|
|
@@ -140,7 +123,7 @@ const CommandPalette_CommandPaletteDescription = /*#__PURE__*/ forwardRef(functi
|
|
|
140
123
|
return /*#__PURE__*/ jsx(Dialog.Description, {
|
|
141
124
|
ref: ref,
|
|
142
125
|
"data-slot": "command-palette-description",
|
|
143
|
-
className: clsx(CommandPalette_module.description,
|
|
126
|
+
className: clsx(CommandPalette_module.description, className),
|
|
144
127
|
...props
|
|
145
128
|
});
|
|
146
129
|
});
|
|
@@ -148,7 +131,7 @@ const CommandPalette_CommandPaletteHeader = /*#__PURE__*/ forwardRef(function({
|
|
|
148
131
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
149
132
|
ref: ref,
|
|
150
133
|
"data-slot": "command-palette-header",
|
|
151
|
-
className: clsx(CommandPalette_module.header,
|
|
134
|
+
className: clsx(CommandPalette_module.header, className),
|
|
152
135
|
...props
|
|
153
136
|
});
|
|
154
137
|
});
|
|
@@ -156,7 +139,7 @@ const CommandPalette_CommandPaletteBody = /*#__PURE__*/ forwardRef(function({ cl
|
|
|
156
139
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
157
140
|
ref: ref,
|
|
158
141
|
"data-slot": "command-palette-body",
|
|
159
|
-
className: clsx(CommandPalette_module.body,
|
|
142
|
+
className: clsx(CommandPalette_module.body, className),
|
|
160
143
|
...props
|
|
161
144
|
});
|
|
162
145
|
});
|
|
@@ -169,7 +152,7 @@ const CommandPalette_CommandPaletteCombobox = /*#__PURE__*/ forwardRef(function(
|
|
|
169
152
|
return /*#__PURE__*/ jsx(Combobox.Root, {
|
|
170
153
|
ref: ref,
|
|
171
154
|
"data-slot": "command-palette-combobox",
|
|
172
|
-
className: clsx(CommandPalette_module.combobox,
|
|
155
|
+
className: clsx(CommandPalette_module.combobox, className),
|
|
173
156
|
open: open,
|
|
174
157
|
inputBehavior: inputBehavior,
|
|
175
158
|
selectionBehavior: selectionBehavior,
|
|
@@ -183,7 +166,7 @@ const CommandPalette_CommandPaletteControl = /*#__PURE__*/ forwardRef(function({
|
|
|
183
166
|
return /*#__PURE__*/ jsx(Combobox.Control, {
|
|
184
167
|
ref: ref,
|
|
185
168
|
"data-slot": "command-palette-control",
|
|
186
|
-
className: clsx(CommandPalette_module.control,
|
|
169
|
+
className: clsx(CommandPalette_module.control, className),
|
|
187
170
|
...props
|
|
188
171
|
});
|
|
189
172
|
});
|
|
@@ -191,13 +174,12 @@ const CommandPalette_CommandPaletteInput = /*#__PURE__*/ forwardRef(function({ c
|
|
|
191
174
|
return /*#__PURE__*/ jsx(Combobox.Input, {
|
|
192
175
|
ref: ref,
|
|
193
176
|
"data-slot": "command-palette-input",
|
|
194
|
-
className: clsx(CommandPalette_module.input,
|
|
177
|
+
className: clsx(CommandPalette_module.input, className),
|
|
195
178
|
...props
|
|
196
179
|
});
|
|
197
180
|
});
|
|
198
|
-
const CommandPalette_CommandPaletteSearch = /*#__PURE__*/ forwardRef(function({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy,
|
|
181
|
+
const CommandPalette_CommandPaletteSearch = /*#__PURE__*/ forwardRef(function({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }, ref) {
|
|
199
182
|
return /*#__PURE__*/ jsxs(CommandPalette_CommandPaletteControl, {
|
|
200
|
-
...controlProps,
|
|
201
183
|
children: [
|
|
202
184
|
/*#__PURE__*/ jsx(CommandPalette_CommandPaletteInput, {
|
|
203
185
|
ref: ref,
|
|
@@ -205,50 +187,41 @@ const CommandPalette_CommandPaletteSearch = /*#__PURE__*/ forwardRef(function({
|
|
|
205
187
|
"aria-labelledby": ariaLabelledBy,
|
|
206
188
|
...props
|
|
207
189
|
}),
|
|
208
|
-
/*#__PURE__*/ jsx(CommandPalette_CommandPaletteClearTrigger, {
|
|
209
|
-
...clearTriggerProps
|
|
210
|
-
})
|
|
190
|
+
/*#__PURE__*/ jsx(CommandPalette_CommandPaletteClearTrigger, {})
|
|
211
191
|
]
|
|
212
192
|
});
|
|
213
193
|
});
|
|
214
|
-
const CommandPalette_CommandPaletteClearTrigger = /*#__PURE__*/ forwardRef(function({ asChild, className, children,
|
|
194
|
+
const CommandPalette_CommandPaletteClearTrigger = /*#__PURE__*/ forwardRef(function({ asChild, className, children, onClick, onPointerDown, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }, ref) {
|
|
215
195
|
return /*#__PURE__*/ jsx(Combobox.Context, {
|
|
216
|
-
children: (combobox)
|
|
217
|
-
const inputProps = combobox.getInputProps();
|
|
218
|
-
const isInvalid = true === inputProps['aria-invalid'] || 'true' === inputProps['aria-invalid'];
|
|
219
|
-
return /*#__PURE__*/ jsx(CloseButton.Root, {
|
|
196
|
+
children: (combobox)=>/*#__PURE__*/ jsx(Combobox.ClearTrigger, {
|
|
220
197
|
ref: ref,
|
|
221
198
|
asChild: asChild,
|
|
222
199
|
...props,
|
|
223
|
-
disabled: disabled ?? combobox.disabled,
|
|
224
|
-
"data-scope": "combobox",
|
|
225
|
-
"data-part": "clear-trigger",
|
|
226
200
|
"data-slot": "command-palette-clear-trigger",
|
|
227
|
-
"data-invalid": isInvalid ? '' : void 0,
|
|
228
201
|
hidden: 0 === combobox.inputValue.length,
|
|
229
|
-
tabIndex: tabIndex ?? -1,
|
|
230
|
-
"aria-controls": ariaControls ?? inputProps.id,
|
|
231
202
|
"aria-label": ariaLabel ?? (asChild || null != children || null != ariaLabelledBy ? void 0 : DEFAULT_CLEAR_TRIGGER_LABEL),
|
|
232
203
|
"aria-labelledby": ariaLabelledBy,
|
|
233
|
-
className: clsx(CommandPalette_module.clearTrigger,
|
|
204
|
+
className: clsx(CloseButton_module.root, CommandPalette_module.clearTrigger, className),
|
|
205
|
+
onClick: (event)=>{
|
|
206
|
+
onClick?.(event);
|
|
207
|
+
if (!event.defaultPrevented) {
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
combobox.setInputValue('');
|
|
210
|
+
}
|
|
211
|
+
},
|
|
234
212
|
onPointerDown: (event)=>{
|
|
235
213
|
onPointerDown?.(event);
|
|
236
214
|
if (0 === event.button) event.preventDefault();
|
|
237
215
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (!event.defaultPrevented) combobox.setInputValue('');
|
|
241
|
-
},
|
|
242
|
-
children: children
|
|
243
|
-
});
|
|
244
|
-
}
|
|
216
|
+
children: children ?? /*#__PURE__*/ jsx(CloseIcon, {})
|
|
217
|
+
})
|
|
245
218
|
});
|
|
246
219
|
});
|
|
247
220
|
const CommandPalette_CommandPaletteList = /*#__PURE__*/ forwardRef(function({ className, children, ...props }, ref) {
|
|
248
221
|
return /*#__PURE__*/ jsx(Combobox.Content, {
|
|
249
222
|
ref: ref,
|
|
250
223
|
"data-slot": "command-palette-list",
|
|
251
|
-
className: clsx(CommandPalette_module.list,
|
|
224
|
+
className: clsx(CommandPalette_module.list, className),
|
|
252
225
|
...props,
|
|
253
226
|
children: /*#__PURE__*/ jsx(ScrollArea, {
|
|
254
227
|
"data-slot": "command-palette-scroll-area",
|
|
@@ -269,7 +242,7 @@ const CommandPalette_CommandPaletteEmpty = /*#__PURE__*/ forwardRef(function({ c
|
|
|
269
242
|
return /*#__PURE__*/ jsx(Combobox.Empty, {
|
|
270
243
|
ref: ref,
|
|
271
244
|
"data-slot": "command-palette-empty",
|
|
272
|
-
className: clsx(CommandPalette_module.empty,
|
|
245
|
+
className: clsx(CommandPalette_module.empty, className),
|
|
273
246
|
...props
|
|
274
247
|
});
|
|
275
248
|
});
|
|
@@ -277,7 +250,7 @@ const CommandPalette_CommandPaletteItemGroup = /*#__PURE__*/ forwardRef(function
|
|
|
277
250
|
return /*#__PURE__*/ jsx(Combobox.ItemGroup, {
|
|
278
251
|
ref: ref,
|
|
279
252
|
"data-slot": "command-palette-item-group",
|
|
280
|
-
className: clsx(CommandPalette_module.itemGroup,
|
|
253
|
+
className: clsx(CommandPalette_module.itemGroup, className),
|
|
281
254
|
...props
|
|
282
255
|
});
|
|
283
256
|
});
|
|
@@ -285,7 +258,7 @@ const CommandPalette_CommandPaletteItemGroupLabel = /*#__PURE__*/ forwardRef(fun
|
|
|
285
258
|
return /*#__PURE__*/ jsx(Combobox.ItemGroupLabel, {
|
|
286
259
|
ref: ref,
|
|
287
260
|
"data-slot": "command-palette-item-group-label",
|
|
288
|
-
className: clsx(CommandPalette_module.itemGroupLabel,
|
|
261
|
+
className: clsx(CommandPalette_module.itemGroupLabel, className),
|
|
289
262
|
...props
|
|
290
263
|
});
|
|
291
264
|
});
|
|
@@ -293,7 +266,7 @@ const CommandPalette_CommandPaletteItem = /*#__PURE__*/ forwardRef(function({ cl
|
|
|
293
266
|
return /*#__PURE__*/ jsx(Combobox.Item, {
|
|
294
267
|
ref: ref,
|
|
295
268
|
"data-slot": "command-palette-item",
|
|
296
|
-
className: clsx(CommandPalette_module.item,
|
|
269
|
+
className: clsx(CommandPalette_module.item, className),
|
|
297
270
|
...props
|
|
298
271
|
});
|
|
299
272
|
});
|
|
@@ -301,7 +274,7 @@ const CommandPalette_CommandPaletteItemText = /*#__PURE__*/ forwardRef(function(
|
|
|
301
274
|
return /*#__PURE__*/ jsx(Combobox.ItemText, {
|
|
302
275
|
ref: ref,
|
|
303
276
|
"data-slot": "command-palette-item-text",
|
|
304
|
-
className: clsx(CommandPalette_module.itemText,
|
|
277
|
+
className: clsx(CommandPalette_module.itemText, className),
|
|
305
278
|
...props
|
|
306
279
|
});
|
|
307
280
|
});
|
|
@@ -309,7 +282,7 @@ const CommandPalette_CommandPaletteItemIndicator = /*#__PURE__*/ forwardRef(func
|
|
|
309
282
|
return /*#__PURE__*/ jsx(Combobox.ItemIndicator, {
|
|
310
283
|
ref: ref,
|
|
311
284
|
"data-slot": "command-palette-item-indicator",
|
|
312
|
-
className: clsx(CommandPalette_module.itemIndicator,
|
|
285
|
+
className: clsx(CommandPalette_module.itemIndicator, className),
|
|
313
286
|
...props,
|
|
314
287
|
children: children ?? /*#__PURE__*/ jsx(CheckIcon, {})
|
|
315
288
|
});
|
|
@@ -318,7 +291,7 @@ const CommandPalette_CommandPaletteItemIcon = /*#__PURE__*/ forwardRef(function(
|
|
|
318
291
|
return /*#__PURE__*/ jsx(ark.span, {
|
|
319
292
|
ref: ref,
|
|
320
293
|
"data-slot": "command-palette-item-icon",
|
|
321
|
-
className: clsx(CommandPalette_module.itemIcon,
|
|
294
|
+
className: clsx(CommandPalette_module.itemIcon, className),
|
|
322
295
|
...props
|
|
323
296
|
});
|
|
324
297
|
});
|
|
@@ -326,7 +299,7 @@ const CommandPalette_CommandPaletteItemLabel = /*#__PURE__*/ forwardRef(function
|
|
|
326
299
|
return /*#__PURE__*/ jsx(ark.span, {
|
|
327
300
|
ref: ref,
|
|
328
301
|
"data-slot": "command-palette-item-label",
|
|
329
|
-
className: clsx(CommandPalette_module.itemLabel,
|
|
302
|
+
className: clsx(CommandPalette_module.itemLabel, className),
|
|
330
303
|
...props
|
|
331
304
|
});
|
|
332
305
|
});
|
|
@@ -334,7 +307,7 @@ const CommandPalette_CommandPaletteItemDescription = /*#__PURE__*/ forwardRef(fu
|
|
|
334
307
|
return /*#__PURE__*/ jsx(ark.span, {
|
|
335
308
|
ref: ref,
|
|
336
309
|
"data-slot": "command-palette-item-description",
|
|
337
|
-
className: clsx(CommandPalette_module.itemDescription,
|
|
310
|
+
className: clsx(CommandPalette_module.itemDescription, className),
|
|
338
311
|
...props
|
|
339
312
|
});
|
|
340
313
|
});
|
|
@@ -342,7 +315,7 @@ const CommandPalette_CommandPaletteItemMeta = /*#__PURE__*/ forwardRef(function(
|
|
|
342
315
|
return /*#__PURE__*/ jsx(ark.span, {
|
|
343
316
|
ref: ref,
|
|
344
317
|
"data-slot": "command-palette-item-meta",
|
|
345
|
-
className: clsx(CommandPalette_module.itemMeta,
|
|
318
|
+
className: clsx(CommandPalette_module.itemMeta, className),
|
|
346
319
|
...props
|
|
347
320
|
});
|
|
348
321
|
});
|
|
@@ -351,7 +324,7 @@ const CommandPalette_CommandPaletteSeparator = /*#__PURE__*/ forwardRef(function
|
|
|
351
324
|
ref: ref,
|
|
352
325
|
role: "separator",
|
|
353
326
|
"data-slot": "command-palette-separator",
|
|
354
|
-
className: clsx(CommandPalette_module.separator,
|
|
327
|
+
className: clsx(CommandPalette_module.separator, className),
|
|
355
328
|
...props
|
|
356
329
|
});
|
|
357
330
|
});
|
|
@@ -359,14 +332,14 @@ const CommandPalette_CommandPaletteFooter = /*#__PURE__*/ forwardRef(function({
|
|
|
359
332
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
360
333
|
ref: ref,
|
|
361
334
|
"data-slot": "command-palette-footer",
|
|
362
|
-
className: clsx(CommandPalette_module.footer,
|
|
335
|
+
className: clsx(CommandPalette_module.footer, className),
|
|
363
336
|
...props
|
|
364
337
|
});
|
|
365
338
|
});
|
|
366
339
|
function CommandPaletteKbd({ className, ...props }) {
|
|
367
340
|
return /*#__PURE__*/ jsx(Kbd.Root, {
|
|
368
341
|
"data-slot": "command-palette-kbd",
|
|
369
|
-
className: clsx(CommandPalette_module.kbd,
|
|
342
|
+
className: clsx(CommandPalette_module.kbd, className),
|
|
370
343
|
...props
|
|
371
344
|
});
|
|
372
345
|
}
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
.backdrop-Y8_IJU {
|
|
42
42
|
z-index: calc(var(--moduix-z-backdrop) + var(--layer-index, 0));
|
|
43
43
|
background-color: var(--moduix-command-palette-backdrop-bg, var(--moduix-backdrop-bg, var(--moduix-color-overlay)));
|
|
44
|
-
min-height: 100dvh;
|
|
45
44
|
-webkit-backdrop-filter: var(--moduix-backdrop-filter, blur(var(--moduix-command-palette-backdrop-blur, 4px)));
|
|
46
45
|
backdrop-filter: var(--moduix-backdrop-filter, blur(var(--moduix-command-palette-backdrop-blur, 4px)));
|
|
47
46
|
position: fixed;
|
|
@@ -127,9 +126,9 @@
|
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
.clearTrigger-n6fuk6 {
|
|
130
|
-
--moduix-close-button-size: var(--moduix-command-palette-clear-size, var(--moduix-
|
|
129
|
+
--moduix-close-button-size: var(--moduix-command-palette-clear-size, var(--moduix-spacing-6));
|
|
131
130
|
--moduix-close-button-radius: var(--moduix-command-palette-clear-radius, var(--moduix-radius-md));
|
|
132
|
-
--moduix-close-button-icon-size: var(--moduix-command-palette-icon-size, var(--moduix-spacing-
|
|
131
|
+
--moduix-close-button-icon-size: var(--moduix-command-palette-icon-size, var(--moduix-spacing-3));
|
|
133
132
|
--moduix-close-button-bg: transparent;
|
|
134
133
|
--moduix-close-button-bg-hover: var(--moduix-command-palette-clear-bg-hover, var(--moduix-color-accent));
|
|
135
134
|
--moduix-close-button-color: var(--moduix-command-palette-muted-color, var(--moduix-color-muted-foreground));
|
|
@@ -192,6 +191,7 @@
|
|
|
192
191
|
background: none;
|
|
193
192
|
border: 0;
|
|
194
193
|
outline: 0;
|
|
194
|
+
flex: auto;
|
|
195
195
|
margin: 0;
|
|
196
196
|
padding: 0;
|
|
197
197
|
}
|
|
@@ -296,16 +296,8 @@
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
.item-UA3NPh[data-highlighted] {
|
|
299
|
-
color: var(--moduix-command-palette-highlight-color, var(--moduix-color-foreground));
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.item-UA3NPh[data-highlighted]:before {
|
|
303
|
-
content: "";
|
|
304
|
-
z-index: -1;
|
|
305
|
-
border-radius: inherit;
|
|
306
299
|
background-color: var(--moduix-command-palette-highlight-bg, var(--moduix-color-accent));
|
|
307
|
-
|
|
308
|
-
inset: 0;
|
|
300
|
+
color: var(--moduix-command-palette-highlight-color, var(--moduix-color-foreground));
|
|
309
301
|
}
|
|
310
302
|
|
|
311
303
|
.item-UA3NPh[data-state="checked"] {
|
|
@@ -330,18 +322,13 @@
|
|
|
330
322
|
display: inline-flex;
|
|
331
323
|
}
|
|
332
324
|
|
|
333
|
-
:is(.itemIcon-EO6ViN, .itemIndicator-nhPwW2) > svg {
|
|
334
|
-
width: var(--moduix-command-palette-item-icon-size, var(--moduix-spacing-4));
|
|
335
|
-
height: var(--moduix-command-palette-item-icon-size, var(--moduix-spacing-4));
|
|
336
|
-
}
|
|
337
|
-
|
|
338
325
|
.itemIndicator-nhPwW2 {
|
|
339
326
|
background-color: #0000;
|
|
340
327
|
border-color: #0000;
|
|
341
328
|
justify-self: end;
|
|
342
329
|
}
|
|
343
330
|
|
|
344
|
-
.itemIndicator-nhPwW2 > svg {
|
|
331
|
+
.itemIcon-EO6ViN > svg, .itemIndicator-nhPwW2 > svg {
|
|
345
332
|
width: var(--moduix-command-palette-item-icon-size, var(--moduix-spacing-4));
|
|
346
333
|
height: var(--moduix-command-palette-item-icon-size, var(--moduix-spacing-4));
|
|
347
334
|
}
|
|
@@ -446,5 +433,11 @@
|
|
|
446
433
|
scale: var(--moduix-command-palette-content-ending-scale, var(--moduix-popup-motion-ending-scale, var(--moduix-scale-popup)));
|
|
447
434
|
}
|
|
448
435
|
}
|
|
436
|
+
|
|
437
|
+
@media (prefers-reduced-motion: reduce) {
|
|
438
|
+
.backdrop-Y8_IJU, .content-EVNfnh {
|
|
439
|
+
animation: none;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
449
442
|
}
|
|
450
443
|
|
|
@@ -2,7 +2,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ark } from "@ark-ui/react/factory";
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
-
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
6
5
|
import Container_module from "./Container.module.js";
|
|
7
6
|
const Container_ContainerRoot = /*#__PURE__*/ forwardRef(function({ size = 'lg', gutter = 'md', className, ...props }, ref) {
|
|
8
7
|
return /*#__PURE__*/ jsx(ark.div, {
|
|
@@ -13,7 +12,7 @@ const Container_ContainerRoot = /*#__PURE__*/ forwardRef(function({ size = 'lg',
|
|
|
13
12
|
"data-slot": "container-root",
|
|
14
13
|
"data-size": size,
|
|
15
14
|
"data-gutter": gutter,
|
|
16
|
-
className: clsx(Container_module.root,
|
|
15
|
+
className: clsx(Container_module.root, className)
|
|
17
16
|
});
|
|
18
17
|
});
|
|
19
18
|
const Container = Object.assign(Container_ContainerRoot, {
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { DateInput as DateInputPrimitive, type DateInputDateValue, useDateInput, useDateInputContext } from '@ark-ui/react/date-input';
|
|
2
|
-
import type { ComponentProps
|
|
3
|
-
type DateInputFormProps = {
|
|
4
|
-
names?: readonly [string, string];
|
|
5
|
-
};
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
6
3
|
declare function DateInputSeparator({ className, 'aria-hidden': ariaHidden, role, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
|
|
7
|
-
declare const DateInput: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement
|
|
8
|
-
Root: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement
|
|
9
|
-
RootProvider: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.RootProviderProps & import("react").RefAttributes<HTMLDivElement
|
|
4
|
+
declare const DateInput: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
|
+
Root: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.RootProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
RootProvider: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.RootProviderProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
HiddenInput: import("react").ForwardRefExoticComponent<DateInputPrimitive.HiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
8
|
Label: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.LabelProps & import("react").RefAttributes<HTMLLabelElement>, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
11
9
|
Control: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.ControlProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
10
|
SegmentGroup: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.SegmentGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
11
|
Segment: import("react").ForwardRefExoticComponent<Omit<DateInputPrimitive.SegmentProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
14
|
-
Segments: import("react").ForwardRefExoticComponent<Omit<Omit<DateInputPrimitive.SegmentGroupProps & import("react").RefAttributes<HTMLDivElement>, "
|
|
12
|
+
Segments: import("react").ForwardRefExoticComponent<Omit<Omit<DateInputPrimitive.SegmentGroupProps & import("react").RefAttributes<HTMLDivElement>, "asChild" | "children">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
13
|
Separator: typeof DateInputSeparator;
|
|
16
|
-
Context: (props: DateInputPrimitive.ContextProps) => ReactNode;
|
|
14
|
+
Context: (props: DateInputPrimitive.ContextProps) => import("react").ReactNode;
|
|
17
15
|
SegmentContext: (props: DateInputPrimitive.SegmentContextProps) => import("react").JSX.Element[];
|
|
18
16
|
};
|
|
19
17
|
export { DateInput, type DateInputDateValue, useDateInput, useDateInputContext };
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { DateInput, useDateInput, useDateInputContext } from "@ark-ui/react/date-input";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
|
-
import {
|
|
6
|
-
import { normalizeClassName } from "../../internal/normalizeClassName.js";
|
|
5
|
+
import { forwardRef } from "react";
|
|
7
6
|
import DateInput_module from "./DateInput.module.js";
|
|
8
|
-
const DateInput_DateInputRoot = /*#__PURE__*/ forwardRef(function({
|
|
7
|
+
const DateInput_DateInputRoot = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
9
8
|
return /*#__PURE__*/ jsx(DateInput.Root, {
|
|
10
9
|
ref: ref,
|
|
11
10
|
"data-slot": "date-input-root",
|
|
12
|
-
className: clsx(DateInput_module.root,
|
|
13
|
-
|
|
14
|
-
...props,
|
|
15
|
-
children: withHiddenInputs(children, asChild, names)
|
|
11
|
+
className: clsx(DateInput_module.root, className),
|
|
12
|
+
...props
|
|
16
13
|
});
|
|
17
14
|
});
|
|
18
|
-
const DateInput_DateInputRootProvider = /*#__PURE__*/ forwardRef(function({
|
|
15
|
+
const DateInput_DateInputRootProvider = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
19
16
|
return /*#__PURE__*/ jsx(DateInput.RootProvider, {
|
|
20
17
|
ref: ref,
|
|
21
18
|
"data-slot": "date-input-root-provider",
|
|
22
|
-
className: clsx(DateInput_module.root,
|
|
23
|
-
|
|
24
|
-
...props,
|
|
25
|
-
children: withHiddenInputs(children, asChild, names)
|
|
19
|
+
className: clsx(DateInput_module.root, className),
|
|
20
|
+
...props
|
|
26
21
|
});
|
|
27
22
|
});
|
|
28
23
|
const DateInput_DateInputLabel = /*#__PURE__*/ forwardRef(function({ className, ...props }, ref) {
|
|
29
24
|
return /*#__PURE__*/ jsx(DateInput.Label, {
|
|
30
25
|
ref: ref,
|
|
31
26
|
"data-slot": "date-input-label",
|
|
32
|
-
className: clsx(DateInput_module.label,
|
|
27
|
+
className: clsx(DateInput_module.label, className),
|
|
33
28
|
...props
|
|
34
29
|
});
|
|
35
30
|
});
|
|
@@ -37,7 +32,7 @@ const DateInput_DateInputControl = /*#__PURE__*/ forwardRef(function({ className
|
|
|
37
32
|
return /*#__PURE__*/ jsx(DateInput.Control, {
|
|
38
33
|
ref: ref,
|
|
39
34
|
"data-slot": "date-input-control",
|
|
40
|
-
className: clsx(DateInput_module.control,
|
|
35
|
+
className: clsx(DateInput_module.control, className),
|
|
41
36
|
...props
|
|
42
37
|
});
|
|
43
38
|
});
|
|
@@ -45,7 +40,7 @@ const DateInput_DateInputSegmentGroup = /*#__PURE__*/ forwardRef(function({ clas
|
|
|
45
40
|
return /*#__PURE__*/ jsx(DateInput.SegmentGroup, {
|
|
46
41
|
ref: ref,
|
|
47
42
|
"data-slot": "date-input-segment-group",
|
|
48
|
-
className: clsx(DateInput_module.segmentGroup,
|
|
43
|
+
className: clsx(DateInput_module.segmentGroup, className),
|
|
49
44
|
...props
|
|
50
45
|
});
|
|
51
46
|
});
|
|
@@ -53,7 +48,7 @@ const DateInput_DateInputSegment = /*#__PURE__*/ forwardRef(function({ className
|
|
|
53
48
|
return /*#__PURE__*/ jsx(DateInput.Segment, {
|
|
54
49
|
ref: ref,
|
|
55
50
|
"data-slot": "date-input-segment",
|
|
56
|
-
className: clsx(DateInput_module.segment,
|
|
51
|
+
className: clsx(DateInput_module.segment, className),
|
|
57
52
|
...props
|
|
58
53
|
});
|
|
59
54
|
});
|
|
@@ -68,44 +63,19 @@ const DateInput_DateInputSegments = /*#__PURE__*/ forwardRef(function(props, ref
|
|
|
68
63
|
})
|
|
69
64
|
});
|
|
70
65
|
});
|
|
71
|
-
function withHiddenInputs(children, asChild, names) {
|
|
72
|
-
const hiddenInputs = /*#__PURE__*/ jsx(DateInputFormInputs, {
|
|
73
|
-
names: names
|
|
74
|
-
});
|
|
75
|
-
if (!asChild) return /*#__PURE__*/ jsxs(Fragment, {
|
|
76
|
-
children: [
|
|
77
|
-
children,
|
|
78
|
-
hiddenInputs
|
|
79
|
-
]
|
|
80
|
-
});
|
|
81
|
-
const child = Children.only(children);
|
|
82
|
-
return /*#__PURE__*/ cloneElement(child, {}, child.props.children, hiddenInputs);
|
|
83
|
-
}
|
|
84
|
-
function DateInputFormInputs({ names }) {
|
|
85
|
-
const dateInput = useDateInputContext();
|
|
86
|
-
const inputCount = Math.max(dateInput.displayValues.length, 1);
|
|
87
|
-
return /*#__PURE__*/ jsx(Fragment, {
|
|
88
|
-
children: Array.from({
|
|
89
|
-
length: inputCount
|
|
90
|
-
}, (_, index)=>/*#__PURE__*/ jsx(DateInput.HiddenInput, {
|
|
91
|
-
index: index,
|
|
92
|
-
name: names?.[index],
|
|
93
|
-
"data-slot": "date-input-hidden-input"
|
|
94
|
-
}, index))
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
66
|
function DateInputSeparator({ className, 'aria-hidden': ariaHidden = true, role = 'presentation', ...props }) {
|
|
98
67
|
return /*#__PURE__*/ jsx("span", {
|
|
99
68
|
"data-slot": "date-input-separator",
|
|
100
69
|
"aria-hidden": ariaHidden,
|
|
101
70
|
role: role,
|
|
102
|
-
className: clsx(DateInput_module.separator,
|
|
71
|
+
className: clsx(DateInput_module.separator, className),
|
|
103
72
|
...props
|
|
104
73
|
});
|
|
105
74
|
}
|
|
106
75
|
const DateInput_DateInput = Object.assign(DateInput_DateInputRoot, {
|
|
107
76
|
Root: DateInput_DateInputRoot,
|
|
108
77
|
RootProvider: DateInput_DateInputRootProvider,
|
|
78
|
+
HiddenInput: DateInput.HiddenInput,
|
|
109
79
|
Label: DateInput_DateInputLabel,
|
|
110
80
|
Control: DateInput_DateInputControl,
|
|
111
81
|
SegmentGroup: DateInput_DateInputSegmentGroup,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useDatePicker, useDatePickerContext, type UseDatePickerReturn } from '@ark-ui/react/date-picker';
|
|
2
2
|
import { DatePicker as DatePickerPrimitive } from '@ark-ui/react/date-picker';
|
|
3
3
|
import type { ComponentProps } from 'react';
|
|
4
|
-
import { type OverlayPortalProps } from '../../internal/overlayPortal';
|
|
4
|
+
import { type OverlayPortalProps } from '../../internal/overlayPortal.js';
|
|
5
5
|
type DatePickerRootProps = ComponentProps<typeof DatePickerPrimitive.Root> & OverlayPortalProps;
|
|
6
6
|
type DatePickerRootProviderProps = ComponentProps<typeof DatePickerPrimitive.RootProvider> & OverlayPortalProps;
|
|
7
7
|
type DatePickerFieldProps = ComponentProps<typeof DatePickerPrimitive.Control> & {
|