haze-ui 1.26.0 → 1.27.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 +420 -36
- package/dist/components/Anchor/Anchor.js +78 -0
- package/dist/components/Anchor/index.js +3 -0
- package/dist/components/AppShell/AppShell.js +44 -0
- package/dist/components/AppShell/index.js +3 -0
- package/dist/components/AspectRatio/AspectRatio.js +0 -1
- package/dist/components/AspectRatio/index.js +0 -1
- package/dist/components/Badge/Badge.js +5 -17
- package/dist/components/Badge/badge-styles.js +15 -0
- package/dist/components/Badge/index.js +3 -3
- package/dist/components/BottomSheet/BottomSheet.js +133 -22
- package/dist/components/Button/index.js +4 -3
- package/dist/components/Calendar/Calendar.js +454 -78
- package/dist/components/Calendar/date.js +35 -2
- package/dist/components/Card/Card.js +0 -1
- package/dist/components/Card/index.js +0 -1
- package/dist/components/Carousel/Carousel.js +64 -41
- package/dist/components/Cascader/Cascader.js +185 -137
- package/dist/components/Chart/Chart.js +31 -0
- package/dist/components/Chart/chart-elements.js +88 -0
- package/dist/components/Chart/index.js +3 -0
- package/dist/components/ChatContainer/ChatContainer.js +36 -16
- package/dist/components/ChatInput/ChatInput.js +49 -29
- package/dist/components/ChatMessage/ChatMessage.js +76 -29
- package/dist/components/Checkbox/Checkbox.js +6 -5
- package/dist/components/Checkbox/CheckboxCore.js +6 -5
- package/dist/components/CodeBlock/CodeBlock.js +0 -1
- package/dist/components/CodeBlock/index.js +0 -1
- package/dist/components/Collapsible/Collapsible.js +23 -10
- package/dist/components/ColorPicker/ColorPicker.js +5 -4
- package/dist/components/ColorPicker/ColorPickerCore.js +5 -4
- package/dist/components/Combobox/Combobox.js +195 -76
- package/dist/components/Combobox/ComboboxGroup.js +23 -0
- package/dist/components/Combobox/ComboboxOption.js +7 -6
- package/dist/components/Combobox/index.js +4 -3
- package/dist/components/Command/Command.js +102 -59
- package/dist/components/Command/CommandDialog.js +48 -0
- package/dist/components/Command/command-filter.js +16 -0
- package/dist/components/Command/index.js +3 -2
- package/dist/components/ConfirmDialog/ConfirmDialog.js +3 -3
- package/dist/components/Container/Container.js +0 -1
- package/dist/components/Container/index.js +0 -1
- package/dist/components/ContextMenu/ContextMenuContent.js +4 -4
- package/dist/components/DataTable/CellEditor.js +38 -0
- package/dist/components/DataTable/DataTable.js +390 -142
- package/dist/components/DataTable/features.js +25 -0
- package/dist/components/DataTable/index.js +2 -1
- package/dist/components/DataTable/summary.js +17 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +10 -7
- package/dist/components/DateRangePicker/DateRangePickerCore.js +59 -27
- package/dist/components/Datepicker/Datepicker.js +16 -12
- package/dist/components/Datepicker/DatepickerCore.js +50 -37
- package/dist/components/Dialog/Dialog.js +56 -32
- package/dist/components/Divider/Divider.js +0 -1
- package/dist/components/Divider/index.js +0 -1
- package/dist/components/Drawer/Drawer.js +49 -29
- package/dist/components/DropdownMenu/DropdownMenu.js +38 -26
- package/dist/components/DropdownMenu/DropdownMenuSub.js +23 -0
- package/dist/components/DropdownMenu/DropdownMenuSubContent.js +24 -0
- package/dist/components/DropdownMenu/DropdownMenuSubTrigger.js +30 -0
- package/dist/components/DropdownMenu/index.js +4 -1
- package/dist/components/Flex/Flex.js +0 -1
- package/dist/components/Flex/index.js +0 -1
- package/dist/components/Fullscreen/Fullscreen.js +29 -0
- package/dist/components/Fullscreen/index.js +3 -0
- package/dist/components/Grid/Grid.js +0 -1
- package/dist/components/Grid/GridItem.js +0 -1
- package/dist/components/Grid/index.js +0 -1
- package/dist/components/Icon/Icon.js +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/components/Image/Image.js +37 -19
- package/dist/components/Image/ImagePreview.js +233 -0
- package/dist/components/Input/Input.js +6 -5
- package/dist/components/Input/InputCore.js +3 -2
- package/dist/components/Kbd/Kbd.js +0 -1
- package/dist/components/Kbd/index.js +0 -1
- package/dist/components/LocaleProvider/LocaleProvider.js +16 -13
- package/dist/components/LocaleProvider/index.js +2 -1
- package/dist/components/LocaleProvider/locale.js +58 -2
- package/dist/components/LocaleProvider/strings.js +15 -0
- package/dist/components/LocaleProvider/zh-cn.js +58 -2
- package/dist/components/Mentions/Mentions.js +6 -5
- package/dist/components/Mentions/MentionsCore.js +69 -68
- package/dist/components/Menu/Menu.js +5 -5
- package/dist/components/Menu/MenuSub.js +23 -0
- package/dist/components/Menu/MenuSubContent.js +24 -0
- package/dist/components/Menu/MenuSubTrigger.js +30 -0
- package/dist/components/Menu/index.js +4 -1
- package/dist/components/NumberInput/NumberInput.js +6 -5
- package/dist/components/NumberInput/NumberInputCore.js +9 -8
- package/dist/components/OTPInput/OTPInput.js +5 -4
- package/dist/components/OTPInput/OTPInputCore.js +34 -33
- package/dist/components/PasswordInput/PasswordInput.js +5 -4
- package/dist/components/PasswordInput/PasswordInputCore.js +8 -7
- package/dist/components/Popover/Popover.js +43 -31
- package/dist/components/PromptInput/PromptInput.js +213 -0
- package/dist/components/PromptInput/index.js +3 -0
- package/dist/components/Radio/Radio.js +7 -6
- package/dist/components/Radio/RadioGroup.js +5 -4
- package/dist/components/Radio/RadioGroupCore.js +23 -14
- package/dist/components/Rating/Rating.js +5 -4
- package/dist/components/Rating/RatingCore.js +62 -28
- package/dist/components/Resizable/index.js +1 -1
- package/dist/components/Segmented/Segmented.js +5 -4
- package/dist/components/Segmented/SegmentedCore.js +22 -18
- package/dist/components/Select/OptionGroup.js +12 -0
- package/dist/components/Select/Select.js +19 -9
- package/dist/components/Select/SelectCore.js +73 -13
- package/dist/components/Select/SelectFloating.js +248 -0
- package/dist/components/Select/index.js +5 -4
- package/dist/components/Select/select-options.js +57 -0
- package/dist/components/Sidebar/Sidebar.js +9 -9
- package/dist/components/Skeleton/Skeleton.js +0 -1
- package/dist/components/Skeleton/index.js +0 -1
- package/dist/components/Slider/Slider.js +16 -8
- package/dist/components/Slider/SliderCore.js +75 -12
- package/dist/components/Stat/Stat.js +0 -1
- package/dist/components/Stat/index.js +0 -1
- package/dist/components/Switch/Switch.js +6 -5
- package/dist/components/Switch/SwitchCore.js +3 -2
- package/dist/components/Tabs/Tab.js +7 -4
- package/dist/components/Tabs/TabList.js +38 -7
- package/dist/components/Tabs/TabPanel.js +4 -3
- package/dist/components/Tabs/Tabs.js +11 -6
- package/dist/components/TagGroup/TagGroup.js +19 -7
- package/dist/components/TagGroup/TagGroupItem.js +17 -11
- package/dist/components/TagInput/TagInput.js +10 -8
- package/dist/components/TagInput/TagInputCore.js +94 -57
- package/dist/components/Textarea/Textarea.js +6 -5
- package/dist/components/Textarea/TextareaCore.js +3 -2
- package/dist/components/TimePicker/TimePicker.js +6 -5
- package/dist/components/TimePicker/TimePickerCore.js +3 -2
- package/dist/components/Toast/Toast.js +23 -22
- package/dist/components/Toast/ToastContainer.js +67 -47
- package/dist/components/Toast/ToastContext.js +23 -4
- package/dist/components/Toast/toast2.js +63 -28
- package/dist/components/Toast/useToast.js +9 -7
- package/dist/components/Toggle/Toggle.js +20 -0
- package/dist/components/Toggle/ToggleCore.js +31 -0
- package/dist/components/Toggle/index.js +4 -0
- package/dist/components/Toolbar/Toolbar.js +33 -32
- package/dist/components/Toolbar/ToolbarToggle.js +31 -0
- package/dist/components/Toolbar/index.js +2 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tour/Tour.js +57 -53
- package/dist/components/Tree/Tree.js +199 -77
- package/dist/components/Tree/TreeItem.js +17 -15
- package/dist/components/Tree/utils.js +26 -10
- package/dist/components/Typography/Typography.js +0 -1
- package/dist/components/Typography/index.js +0 -1
- package/dist/components/Upload/Upload.js +21 -8
- package/dist/components/Upload/UploadCore.js +224 -37
- package/dist/components/Upload/UploadList.js +172 -0
- package/dist/components/Upload/xhr-upload.js +22 -0
- package/dist/components/VirtualList/VirtualList.js +84 -56
- package/dist/components/Watermark/Watermark.js +55 -0
- package/dist/components/Watermark/index.js +3 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/app-shell.css +2 -0
- package/dist/css/badge.css +1 -1
- package/dist/css/bottom-sheet.css +1 -1
- package/dist/css/button.css +1 -1
- package/dist/css/calendar.css +1 -1
- package/dist/css/cascader.css +1 -1
- package/dist/css/chart.css +2 -0
- package/dist/css/chat-container.css +1 -1
- package/dist/css/chat-message.css +1 -1
- package/dist/css/combobox.css +3 -2
- package/dist/css/command.css +2 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/data-table.css +2 -1
- package/dist/css/date-range-picker.css +1 -1
- package/dist/css/datepicker.css +2 -2
- package/dist/css/dialog.css +1 -1
- package/dist/css/dropdown-menu.css +4 -1
- package/dist/css/image.css +2 -1
- package/dist/css/menu.css +4 -1
- package/dist/css/popover.css +1 -1
- package/dist/css/prompt-input.css +2 -0
- package/dist/css/rating.css +1 -1
- package/dist/css/select.css +3 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/tag-group.css +2 -0
- package/dist/css/tag-input.css +3 -1
- package/dist/css/toggle.css +2 -0
- package/dist/css/toolbar.css +1 -0
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree.css +1 -1
- package/dist/css/upload.css +2 -1
- package/dist/css/watermark.css +2 -0
- package/dist/css-manifest.json +60 -1
- package/dist/form/FormItem.js +55 -50
- package/dist/form/FormList.js +79 -0
- package/dist/form/index.js +5 -1
- package/dist/form/standard-schema.js +16 -0
- package/dist/haze-ui.css +51 -27
- package/dist/headless/index.js +7 -0
- package/dist/hooks/useClickOutside.js +24 -0
- package/dist/hooks/useFullscreen.js +42 -0
- package/dist/hooks/useHotkeys.js +77 -0
- package/dist/hooks/useInView.js +27 -0
- package/dist/hooks/useLocalStorage.js +8 -0
- package/dist/hooks/useMediaQuery.js +2 -1
- package/dist/hooks/usePrevious.js +11 -0
- package/dist/hooks/useSessionStorage.js +8 -0
- package/dist/hooks/useStorageState.js +80 -0
- package/dist/index.js +205 -171
- package/dist/registry.json +2259 -91
- package/dist/tokens/colors.js +0 -1
- package/dist/tokens/index.js +0 -1
- package/dist/tokens/motion.js +0 -1
- package/dist/tokens/oklch.js +0 -1
- package/dist/tokens/palette.js +0 -1
- package/dist/tokens/registry.js +17 -28
- package/dist/tokens/spacing.js +0 -1
- package/dist/tokens/typography.js +0 -1
- package/dist/types/components/Anchor/Anchor.d.ts +25 -0
- package/dist/types/components/Anchor/index.d.ts +2 -0
- package/dist/types/components/AppShell/AppShell.d.ts +17 -0
- package/dist/types/components/AppShell/index.d.ts +2 -0
- package/dist/types/components/Badge/badge-styles.d.ts +21 -0
- package/dist/types/components/Badge/index.d.ts +1 -0
- package/dist/types/components/BottomSheet/BottomSheet.d.ts +52 -3
- package/dist/types/components/BottomSheet/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +7 -0
- package/dist/types/components/Button/ButtonLink.d.ts +3 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/Button/styles.d.ts +17 -0
- package/dist/types/components/Calendar/Calendar.d.ts +71 -7
- package/dist/types/components/Calendar/date.d.ts +52 -0
- package/dist/types/components/Calendar/index.d.ts +1 -1
- package/dist/types/components/Cascader/Cascader.d.ts +29 -3
- package/dist/types/components/Chart/Chart.d.ts +29 -0
- package/dist/types/components/Chart/chart-elements.d.ts +52 -0
- package/dist/types/components/Chart/index.d.ts +2 -0
- package/dist/types/components/ChatContainer/ChatContainer.d.ts +18 -3
- package/dist/types/components/ChatInput/ChatInput.d.ts +11 -1
- package/dist/types/components/ChatMessage/ChatMessage.d.ts +13 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +6 -2
- package/dist/types/components/Checkbox/CheckboxCore.d.ts +4 -2
- package/dist/types/components/Collapsible/Collapsible.d.ts +24 -2
- package/dist/types/components/Collapsible/index.d.ts +1 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +7 -1
- package/dist/types/components/ColorPicker/ColorPickerCore.d.ts +7 -1
- package/dist/types/components/Combobox/Combobox.d.ts +101 -7
- package/dist/types/components/Combobox/ComboboxGroup.d.ts +22 -0
- package/dist/types/components/Combobox/ComboboxOption.d.ts +7 -2
- package/dist/types/components/Combobox/index.d.ts +3 -1
- package/dist/types/components/Command/Command.d.ts +70 -6
- package/dist/types/components/Command/CommandDialog.d.ts +36 -0
- package/dist/types/components/Command/command-filter.d.ts +34 -0
- package/dist/types/components/Command/index.d.ts +4 -2
- package/dist/types/components/DataTable/CellEditor.d.ts +24 -0
- package/dist/types/components/DataTable/DataTable.d.ts +149 -32
- package/dist/types/components/DataTable/features.d.ts +118 -0
- package/dist/types/components/DataTable/index.d.ts +2 -1
- package/dist/types/components/DataTable/summary.d.ts +19 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +15 -1
- package/dist/types/components/DateRangePicker/DateRangePickerCore.d.ts +26 -2
- package/dist/types/components/DateRangePicker/index.d.ts +1 -1
- package/dist/types/components/Datepicker/Datepicker.d.ts +17 -1
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +24 -2
- package/dist/types/components/Datepicker/index.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +68 -3
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Drawer/Drawer.d.ts +33 -3
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +23 -3
- package/dist/types/components/DropdownMenu/DropdownMenuSub.d.ts +18 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +13 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +14 -0
- package/dist/types/components/DropdownMenu/index.d.ts +7 -1
- package/dist/types/components/Fullscreen/Fullscreen.d.ts +34 -0
- package/dist/types/components/Fullscreen/index.d.ts +3 -0
- package/dist/types/components/Image/Image.d.ts +20 -5
- package/dist/types/components/Image/ImagePreview.d.ts +13 -0
- package/dist/types/components/Image/index.d.ts +1 -1
- package/dist/types/components/Input/Input.d.ts +5 -2
- package/dist/types/components/Input/InputCore.d.ts +4 -2
- package/dist/types/components/LocaleProvider/LocaleContext.d.ts +9 -0
- package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +12 -1
- package/dist/types/components/LocaleProvider/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +56 -0
- package/dist/types/components/LocaleProvider/strings.d.ts +28 -0
- package/dist/types/components/Mentions/Mentions.d.ts +5 -2
- package/dist/types/components/Mentions/MentionsCore.d.ts +4 -2
- package/dist/types/components/Menu/MenuSub.d.ts +18 -0
- package/dist/types/components/Menu/MenuSubContent.d.ts +12 -0
- package/dist/types/components/Menu/MenuSubTrigger.d.ts +14 -0
- package/dist/types/components/Menu/index.d.ts +6 -0
- package/dist/types/components/NumberInput/NumberInput.d.ts +5 -2
- package/dist/types/components/NumberInput/NumberInputCore.d.ts +4 -2
- package/dist/types/components/OTPInput/OTPInput.d.ts +5 -1
- package/dist/types/components/OTPInput/OTPInputCore.d.ts +4 -1
- package/dist/types/components/PasswordInput/PasswordInput.d.ts +5 -1
- package/dist/types/components/PasswordInput/PasswordInputCore.d.ts +4 -1
- package/dist/types/components/Popover/Popover.d.ts +41 -3
- package/dist/types/components/Popover/index.d.ts +1 -1
- package/dist/types/components/PromptInput/PromptInput.d.ts +46 -0
- package/dist/types/components/PromptInput/index.d.ts +2 -0
- package/dist/types/components/Radio/Radio.d.ts +5 -2
- package/dist/types/components/Radio/RadioGroup.d.ts +8 -2
- package/dist/types/components/Radio/RadioGroupCore.d.ts +7 -2
- package/dist/types/components/Rating/Rating.d.ts +8 -1
- package/dist/types/components/Rating/RatingCore.d.ts +7 -1
- package/dist/types/components/Resizable/index.d.ts +2 -0
- package/dist/types/components/Segmented/Segmented.d.ts +8 -1
- package/dist/types/components/Segmented/SegmentedCore.d.ts +7 -2
- package/dist/types/components/Select/OptionGroup.d.ts +16 -0
- package/dist/types/components/Select/Select.d.ts +66 -4
- package/dist/types/components/Select/SelectCore.d.ts +70 -6
- package/dist/types/components/Select/SelectFloating.d.ts +83 -0
- package/dist/types/components/Select/index.d.ts +2 -0
- package/dist/types/components/Select/select-options.d.ts +53 -0
- package/dist/types/components/Slider/Slider.d.ts +29 -4
- package/dist/types/components/Slider/SliderCore.d.ts +35 -6
- package/dist/types/components/Switch/Switch.d.ts +5 -2
- package/dist/types/components/Switch/SwitchCore.d.ts +4 -2
- package/dist/types/components/Tabs/TabList.d.ts +7 -0
- package/dist/types/components/Tabs/Tabs.d.ts +8 -1
- package/dist/types/components/Tabs/TabsContext.d.ts +20 -0
- package/dist/types/components/Tabs/index.d.ts +1 -0
- package/dist/types/components/TagGroup/TagGroup.d.ts +13 -1
- package/dist/types/components/TagInput/TagInput.d.ts +12 -1
- package/dist/types/components/TagInput/TagInputCore.d.ts +11 -1
- package/dist/types/components/Textarea/Textarea.d.ts +5 -2
- package/dist/types/components/Textarea/TextareaCore.d.ts +4 -2
- package/dist/types/components/TimePicker/TimePicker.d.ts +5 -2
- package/dist/types/components/TimePicker/TimePickerCore.d.ts +4 -2
- package/dist/types/components/Toast/Toast.d.ts +31 -2
- package/dist/types/components/Toast/ToastContainer.d.ts +11 -1
- package/dist/types/components/Toast/ToastContext.d.ts +44 -3
- package/dist/types/components/Toast/index.d.ts +1 -1
- package/dist/types/components/Toast/toast.d.ts +35 -4
- package/dist/types/components/Toast/useToast.d.ts +16 -4
- package/dist/types/components/Toggle/Toggle.d.ts +19 -0
- package/dist/types/components/Toggle/ToggleCore.d.ts +23 -0
- package/dist/types/components/Toggle/index.d.ts +4 -0
- package/dist/types/components/Toolbar/ToolbarToggle.d.ts +19 -0
- package/dist/types/components/Toolbar/index.d.ts +2 -0
- package/dist/types/components/Tour/Tour.d.ts +3 -3
- package/dist/types/components/Tree/Tree.d.ts +3 -3
- package/dist/types/components/Tree/TreeItem.d.ts +6 -1
- package/dist/types/components/Tree/types.d.ts +26 -0
- package/dist/types/components/Tree/utils.d.ts +32 -0
- package/dist/types/components/Upload/Upload.d.ts +38 -3
- package/dist/types/components/Upload/UploadCore.d.ts +75 -4
- package/dist/types/components/Upload/UploadList.d.ts +12 -0
- package/dist/types/components/Upload/index.d.ts +1 -0
- package/dist/types/components/Upload/types.d.ts +60 -0
- package/dist/types/components/Upload/xhr-upload.d.ts +20 -0
- package/dist/types/components/VirtualList/VirtualList.d.ts +16 -1
- package/dist/types/components/Watermark/Watermark.d.ts +32 -0
- package/dist/types/components/Watermark/index.d.ts +2 -0
- package/dist/types/form/FormItem.d.ts +33 -8
- package/dist/types/form/FormList.d.ts +113 -0
- package/dist/types/form/index.d.ts +26 -0
- package/dist/types/form/standard-schema.d.ts +30 -0
- package/dist/types/headless/index.d.ts +182 -0
- package/dist/types/hooks/index.d.ts +11 -0
- package/dist/types/hooks/useClickOutside.d.ts +46 -0
- package/dist/types/hooks/useFullscreen.d.ts +33 -0
- package/dist/types/hooks/useHotkeys.d.ts +53 -0
- package/dist/types/hooks/useInView.d.ts +32 -0
- package/dist/types/hooks/useLocalStorage.d.ts +33 -0
- package/dist/types/hooks/useMediaQuery.d.ts +3 -0
- package/dist/types/hooks/usePrevious.d.ts +18 -0
- package/dist/types/hooks/useSessionStorage.d.ts +26 -0
- package/dist/types/hooks/useStorageState.d.ts +12 -0
- package/dist/types/index.d.ts +57 -32
- package/dist/types/utils/collision.d.ts +39 -1
- package/dist/types/utils/direction.d.ts +22 -0
- package/dist/types/utils/floating.d.ts +32 -4
- package/dist/types/utils/focus-scope.d.ts +2 -1
- package/dist/types/utils/focus.d.ts +2 -1
- package/dist/types/utils/menuKeyboard.d.ts +19 -4
- package/dist/types/utils/refs.d.ts +16 -0
- package/dist/types/utils/sortable-shared.d.ts +42 -0
- package/dist/types/utils/sortable.d.ts +36 -0
- package/dist/types/utils/submenu.d.ts +63 -0
- package/dist/types/utils/view-transition.d.ts +28 -0
- package/dist/utils/classnames.js +0 -1
- package/dist/utils/collision.js +37 -26
- package/dist/utils/direction.js +34 -0
- package/dist/utils/floating.js +163 -143
- package/dist/utils/menuKeyboard.js +59 -46
- package/dist/utils/refs.js +9 -0
- package/dist/utils/sortable-shared.js +24 -0
- package/dist/utils/sortable.js +46 -0
- package/dist/utils/submenu.js +104 -0
- package/dist/utils/view-transition.js +26 -0
- package/package.json +109 -16
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { columnFilteringFeature as e, columnResizingFeature as t, columnSizingFeature as n, columnVisibilityFeature as r, createExpandedRowModel as i, createFilteredRowModel as a, createPaginatedRowModel as o, createSortedRowModel as s, filterFn_includesString as c, metaHelper as l, rowExpandingFeature as u, rowPaginationFeature as d, rowSelectionFeature as f, rowSortingFeature as p, sortFn_alphanumeric as m, sortFn_text as h, tableFeatures as g } from "@tanstack/react-table";
|
|
3
|
+
//#region src/lib/components/DataTable/features.ts
|
|
4
|
+
var _ = g({
|
|
5
|
+
rowPaginationFeature: d,
|
|
6
|
+
paginatedRowModel: o(),
|
|
7
|
+
rowSelectionFeature: f,
|
|
8
|
+
rowSortingFeature: p,
|
|
9
|
+
sortedRowModel: s(),
|
|
10
|
+
sortFns: {
|
|
11
|
+
alphanumeric: m,
|
|
12
|
+
text: h
|
|
13
|
+
},
|
|
14
|
+
rowExpandingFeature: u,
|
|
15
|
+
expandedRowModel: i(),
|
|
16
|
+
columnVisibilityFeature: r,
|
|
17
|
+
columnFilteringFeature: e,
|
|
18
|
+
filteredRowModel: a(),
|
|
19
|
+
filterFns: { includesString: c },
|
|
20
|
+
columnSizingFeature: n,
|
|
21
|
+
columnResizingFeature: t,
|
|
22
|
+
columnMeta: l()
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { _ as dataTableFeatures };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/lib/components/DataTable/summary.ts
|
|
3
|
+
function e(e, t) {
|
|
4
|
+
return e.map((e) => e.getValue(t)).filter((e) => typeof e == "number");
|
|
5
|
+
}
|
|
6
|
+
function t(t, n) {
|
|
7
|
+
return e(t, n).reduce((e, t) => e + t, 0);
|
|
8
|
+
}
|
|
9
|
+
function n(n, r) {
|
|
10
|
+
let i = e(n, r);
|
|
11
|
+
if (i.length !== 0) return t(n, r) / i.length;
|
|
12
|
+
}
|
|
13
|
+
function r(e) {
|
|
14
|
+
return e.length;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as dataTableAvg, r as dataTableCount, t as dataTableSum };
|
|
@@ -3,19 +3,22 @@ import e from "./DateRangePickerCore.js";
|
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import { useControl as n } from "react-use-control";
|
|
5
5
|
//#region src/lib/components/DateRangePicker/DateRangePicker.tsx
|
|
6
|
-
function r({ startDate: r, endDate: i, onStartChange: a, onEndChange: o, separator: s,
|
|
7
|
-
let [
|
|
6
|
+
function r({ startDate: r, endDate: i, onStartChange: a, onEndChange: o, separator: s, months: c, disabledDate: l, presets: u, className: d }) {
|
|
7
|
+
let [f, p] = n(r, ""), [m, h] = n(i, "");
|
|
8
8
|
return /* @__PURE__ */ t(e, {
|
|
9
|
-
startDate:
|
|
10
|
-
endDate:
|
|
9
|
+
startDate: f,
|
|
10
|
+
endDate: m,
|
|
11
11
|
onStartChange: (e) => {
|
|
12
|
-
|
|
12
|
+
p(e), a?.(e);
|
|
13
13
|
},
|
|
14
14
|
onEndChange: (e) => {
|
|
15
|
-
|
|
15
|
+
h(e), o?.(e);
|
|
16
16
|
},
|
|
17
17
|
separator: s,
|
|
18
|
-
|
|
18
|
+
months: c,
|
|
19
|
+
disabledDate: l,
|
|
20
|
+
presets: u,
|
|
21
|
+
className: d
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
24
|
//#endregion
|
|
@@ -2,35 +2,67 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
|
+
import n from "../Calendar/Calendar.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
import { jsx as
|
|
7
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
8
|
//#region src/lib/components/DateRangePicker/DateRangePickerCore.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
9
|
+
var o = "haze-DateRangePickerCore__container", s = "haze-DateRangePickerCore__stackedContainer", c = "haze-DateRangePickerCore__inputsRow", l = "haze-DateRangePickerCore__panel", u = "haze-DateRangePickerCore__input", d = "haze-DateRangePickerCore__sep", f = "haze-DateRangePickerCore__presetList", p = "haze-DateRangePickerCore__presetRow";
|
|
10
|
+
function m({ startDate: m, endDate: h, onStartChange: g, onEndChange: _, separator: v = "–", months: y = 1, disabledDate: b, presets: x, className: S }) {
|
|
11
|
+
let C = t("dateRangePicker"), w = (e) => {
|
|
12
|
+
!m || h ? (g(e), _("")) : e < m ? g(e) : _(e);
|
|
13
|
+
}, T = x !== void 0 && x.length > 0, E = /* @__PURE__ */ a(r, { children: [
|
|
14
|
+
/* @__PURE__ */ i("input", {
|
|
15
|
+
type: "date",
|
|
16
|
+
"aria-label": C.startDate,
|
|
17
|
+
value: m,
|
|
18
|
+
onChange: (e) => g(e.target.value),
|
|
19
|
+
className: e([u])
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ i("span", {
|
|
22
|
+
className: e([d]),
|
|
23
|
+
children: v
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ i("input", {
|
|
26
|
+
type: "date",
|
|
27
|
+
"aria-label": C.endDate,
|
|
28
|
+
value: h,
|
|
29
|
+
onChange: (e) => _(e.target.value),
|
|
30
|
+
className: e([u])
|
|
31
|
+
})
|
|
32
|
+
] });
|
|
33
|
+
return y !== 2 && !T ? /* @__PURE__ */ i("div", {
|
|
34
|
+
className: e([o, S]),
|
|
35
|
+
children: E
|
|
36
|
+
}) : /* @__PURE__ */ a("div", {
|
|
37
|
+
className: e([
|
|
38
|
+
o,
|
|
39
|
+
s,
|
|
40
|
+
S
|
|
41
|
+
]),
|
|
42
|
+
children: [/* @__PURE__ */ i("div", {
|
|
43
|
+
className: e([c]),
|
|
44
|
+
children: E
|
|
45
|
+
}), /* @__PURE__ */ a("div", {
|
|
46
|
+
className: e([l]),
|
|
47
|
+
children: [T && /* @__PURE__ */ i("div", {
|
|
48
|
+
className: e([f]),
|
|
49
|
+
children: x.map((t) => /* @__PURE__ */ i("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: () => {
|
|
52
|
+
g(t.range[0]), _(t.range[1]);
|
|
53
|
+
},
|
|
54
|
+
className: e([p]),
|
|
55
|
+
children: t.label
|
|
56
|
+
}, `${t.label}:${t.range.join("~")}`))
|
|
57
|
+
}), y === 2 && /* @__PURE__ */ i(n, {
|
|
58
|
+
months: 2,
|
|
59
|
+
rangeStart: m,
|
|
60
|
+
rangeEnd: h,
|
|
61
|
+
disabledDate: b,
|
|
62
|
+
onSelect: w
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
33
65
|
});
|
|
34
66
|
}
|
|
35
67
|
//#endregion
|
|
36
|
-
export {
|
|
68
|
+
export { m as default };
|
|
@@ -3,19 +3,23 @@ import e from "./DatepickerCore.js";
|
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import { useControl as n } from "react-use-control";
|
|
5
5
|
//#region src/lib/components/Datepicker/Datepicker.tsx
|
|
6
|
-
function r({ value: r, open: i,
|
|
7
|
-
let [
|
|
6
|
+
function r({ value: r, open: i, picker: a, min: o, max: s, disabledDate: c, presets: l, locale: u, weekStartsOn: d, placeholder: f, className: p, ref: m }) {
|
|
7
|
+
let [h, g] = n(r, ""), [_, v] = n(i, !1);
|
|
8
8
|
return /* @__PURE__ */ t(e, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
ref: m,
|
|
10
|
+
value: h,
|
|
11
|
+
onChange: g,
|
|
12
|
+
open: _,
|
|
13
|
+
onOpenChange: v,
|
|
14
|
+
picker: a,
|
|
15
|
+
min: o,
|
|
16
|
+
max: s,
|
|
17
|
+
disabledDate: c,
|
|
18
|
+
presets: l,
|
|
19
|
+
locale: u,
|
|
20
|
+
weekStartsOn: d,
|
|
21
|
+
placeholder: f,
|
|
22
|
+
className: p
|
|
19
23
|
});
|
|
20
24
|
}
|
|
21
25
|
//#endregion
|
|
@@ -1,54 +1,67 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import r from "
|
|
4
|
+
import { mergeRefs as t } from "../../utils/refs.js";
|
|
5
|
+
import { FloatingPanel as n, useFloating as r } from "../../utils/floating.js";
|
|
6
|
+
import i from "../Calendar/Calendar.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useCallback as
|
|
8
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
9
|
+
import { useCallback as s, useId as c, useRef as l } from "react";
|
|
9
10
|
//#region src/lib/components/Datepicker/DatepickerCore.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
open:
|
|
14
|
-
setOpen:
|
|
15
|
-
triggerRef:
|
|
16
|
-
panelRef:
|
|
11
|
+
var u = "haze-DatepickerCore__wrapper", d = "haze-DatepickerCore__input", f = "haze-DatepickerCore__dropdown", p = "haze-DatepickerCore__presetList", m = "haze-DatepickerCore__presetRow";
|
|
12
|
+
function h({ value: h, onChange: g, open: _, onOpenChange: v, picker: y, min: b, max: x, disabledDate: S, presets: C, locale: w, weekStartsOn: T, placeholder: E = "Select date", className: D, ref: O }) {
|
|
13
|
+
let k = l(null), A = s((e) => t(k, O)(e), [k, O]), j = l(null), M = c(), N = s((e) => v(typeof e == "function" ? e(_) : e), [v, _]), P = r({
|
|
14
|
+
open: _,
|
|
15
|
+
setOpen: N,
|
|
16
|
+
triggerRef: k,
|
|
17
|
+
panelRef: j,
|
|
17
18
|
animated: !0
|
|
18
19
|
});
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className: e([
|
|
21
|
-
children: [/* @__PURE__ */
|
|
22
|
-
ref:
|
|
20
|
+
return /* @__PURE__ */ o("div", {
|
|
21
|
+
className: e([u, D]),
|
|
22
|
+
children: [/* @__PURE__ */ a("input", {
|
|
23
|
+
ref: A,
|
|
23
24
|
readOnly: !0,
|
|
24
|
-
style:
|
|
25
|
-
className:
|
|
26
|
-
value:
|
|
27
|
-
placeholder:
|
|
25
|
+
style: P.triggerStyle,
|
|
26
|
+
className: d,
|
|
27
|
+
value: h,
|
|
28
|
+
placeholder: E,
|
|
28
29
|
role: "combobox",
|
|
29
30
|
"aria-haspopup": "dialog",
|
|
30
|
-
"aria-expanded":
|
|
31
|
-
"aria-controls":
|
|
32
|
-
onPointerDown:
|
|
33
|
-
onClick:
|
|
34
|
-
}), /* @__PURE__ */
|
|
35
|
-
ref:
|
|
36
|
-
behavior:
|
|
31
|
+
"aria-expanded": _,
|
|
32
|
+
"aria-controls": M,
|
|
33
|
+
onPointerDown: P.onTriggerPointerDown,
|
|
34
|
+
onClick: P.onTriggerClick
|
|
35
|
+
}), /* @__PURE__ */ o(n, {
|
|
36
|
+
ref: j,
|
|
37
|
+
behavior: P,
|
|
37
38
|
placement: "bottom",
|
|
38
|
-
visualClass:
|
|
39
|
-
id:
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
visualClass: f,
|
|
40
|
+
id: M,
|
|
41
|
+
children: [C && C.length > 0 && /* @__PURE__ */ a("div", {
|
|
42
|
+
className: e([p]),
|
|
43
|
+
children: C.map((t) => /* @__PURE__ */ a("button", {
|
|
44
|
+
type: "button",
|
|
45
|
+
onClick: () => {
|
|
46
|
+
g(t.value), v(!1);
|
|
47
|
+
},
|
|
48
|
+
className: e([m]),
|
|
49
|
+
children: t.label
|
|
50
|
+
}, `${t.label}:${t.value}`))
|
|
51
|
+
}), /* @__PURE__ */ a(i, {
|
|
52
|
+
picker: y,
|
|
53
|
+
value: h,
|
|
54
|
+
min: b,
|
|
55
|
+
max: x,
|
|
56
|
+
disabledDate: S,
|
|
57
|
+
locale: w,
|
|
58
|
+
weekStartsOn: T,
|
|
46
59
|
onSelect: (e) => {
|
|
47
|
-
|
|
60
|
+
g(e), v(!1);
|
|
48
61
|
}
|
|
49
|
-
})
|
|
62
|
+
})]
|
|
50
63
|
})]
|
|
51
64
|
});
|
|
52
65
|
}
|
|
53
66
|
//#endregion
|
|
54
|
-
export {
|
|
67
|
+
export { h as default };
|
|
@@ -1,52 +1,76 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { whenExitSettles as t } from "../../utils/presence.js";
|
|
5
|
+
import { useFocusScope as n } from "../../utils/focus-scope.js";
|
|
6
|
+
import { useViewTransitionFlip as r } from "../../utils/view-transition.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useCallback as
|
|
9
|
-
import { useControl as
|
|
8
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
9
|
+
import { useCallback as o, useEffect as s, useId as c, useImperativeHandle as l, useRef as u } from "react";
|
|
10
|
+
import { useControl as d } from "react-use-control";
|
|
10
11
|
//#region src/lib/components/Dialog/Dialog.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let [
|
|
14
|
-
|
|
12
|
+
var f = "haze-Dialog__overlay", p = "haze-Dialog__titleText";
|
|
13
|
+
function m({ open: m, onClose: h, title: g, viewTransition: _ = !1, classNames: v, className: y, children: b, ref: x }) {
|
|
14
|
+
let [S, C] = d(m, !1), w = r(_, C), T = u(null);
|
|
15
|
+
s(() => {
|
|
16
|
+
if (!S) return;
|
|
17
|
+
let e = document.activeElement;
|
|
18
|
+
T.current = e instanceof HTMLElement ? e : null;
|
|
19
|
+
}, [S]);
|
|
20
|
+
let E = u(null), D = n({
|
|
21
|
+
enabled: S,
|
|
15
22
|
trapped: !1
|
|
16
|
-
}),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
}), O = `haze-dialog-title-${c()}`;
|
|
24
|
+
l(x, () => ({
|
|
25
|
+
open: () => {
|
|
26
|
+
w(!0);
|
|
27
|
+
},
|
|
28
|
+
close: () => {
|
|
29
|
+
w(!1);
|
|
30
|
+
},
|
|
31
|
+
focusTrigger: () => {
|
|
32
|
+
let e = T.current;
|
|
33
|
+
e?.isConnected && e.focus();
|
|
34
|
+
}
|
|
35
|
+
}), [w]);
|
|
36
|
+
let k = o((e) => {
|
|
37
|
+
E.current = e, D(e);
|
|
38
|
+
}, [D]);
|
|
39
|
+
return s(() => {
|
|
40
|
+
let e = E.current;
|
|
21
41
|
if (e) {
|
|
22
|
-
if (
|
|
23
|
-
else if (!
|
|
24
|
-
let
|
|
42
|
+
if (S && !e.open) e.showModal();
|
|
43
|
+
else if (!S && e.open) {
|
|
44
|
+
let n = t(e), r = () => {
|
|
25
45
|
e.getAttribute("data-state") === "closed" && e.close();
|
|
26
46
|
};
|
|
27
|
-
|
|
47
|
+
n ? n.then(r) : r();
|
|
28
48
|
}
|
|
29
49
|
}
|
|
30
|
-
}, [
|
|
31
|
-
ref:
|
|
32
|
-
"data-state":
|
|
33
|
-
"aria-labelledby":
|
|
50
|
+
}, [S]), /* @__PURE__ */ a("dialog", {
|
|
51
|
+
ref: k,
|
|
52
|
+
"data-state": S ? "open" : "closed",
|
|
53
|
+
"aria-labelledby": g === void 0 ? void 0 : O,
|
|
34
54
|
onClose: () => {
|
|
35
|
-
|
|
55
|
+
C(!1), h?.();
|
|
36
56
|
},
|
|
37
57
|
onCancel: (e) => {
|
|
38
|
-
e.preventDefault(),
|
|
58
|
+
e.preventDefault(), w(!1);
|
|
39
59
|
},
|
|
40
60
|
onClick: (e) => {
|
|
41
|
-
e.target ===
|
|
61
|
+
e.target === E.current && w(!1);
|
|
42
62
|
},
|
|
43
|
-
className: e([
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
63
|
+
className: e([
|
|
64
|
+
f,
|
|
65
|
+
y,
|
|
66
|
+
v?.root
|
|
67
|
+
]),
|
|
68
|
+
children: [g !== void 0 && /* @__PURE__ */ i("h2", {
|
|
69
|
+
id: O,
|
|
70
|
+
className: e([p, v?.header]),
|
|
71
|
+
children: g
|
|
72
|
+
}), b]
|
|
49
73
|
});
|
|
50
74
|
}
|
|
51
75
|
//#endregion
|
|
52
|
-
export {
|
|
76
|
+
export { m as default };
|
|
@@ -1,56 +1,76 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { whenExitSettles as t } from "../../utils/presence.js";
|
|
5
|
+
import { useFocusScope as n } from "../../utils/focus-scope.js";
|
|
6
|
+
import { useViewTransitionFlip as r } from "../../utils/view-transition.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useCallback as
|
|
9
|
-
import { useControl as
|
|
8
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
9
|
+
import { useCallback as a, useEffect as o, useImperativeHandle as s, useRef as c } from "react";
|
|
10
|
+
import { useControl as l } from "react-use-control";
|
|
10
11
|
//#region src/lib/components/Drawer/Drawer.tsx
|
|
11
|
-
var
|
|
12
|
+
var u = "haze-Drawer__overlay", d = {
|
|
12
13
|
left: "haze-Drawer__left",
|
|
13
14
|
right: "haze-Drawer__right",
|
|
14
15
|
top: "haze-Drawer__top",
|
|
15
16
|
bottom: "haze-Drawer__bottom"
|
|
16
17
|
};
|
|
17
|
-
function
|
|
18
|
-
let [
|
|
19
|
-
|
|
18
|
+
function f({ open: f, placement: p = "right", onClose: m, viewTransition: h = !1, className: g, children: _, ref: v }) {
|
|
19
|
+
let [y, b] = l(f, !1), x = r(h, b), S = c(null);
|
|
20
|
+
o(() => {
|
|
21
|
+
if (!y) return;
|
|
22
|
+
let e = document.activeElement;
|
|
23
|
+
S.current = e instanceof HTMLElement ? e : null;
|
|
24
|
+
}, [y]);
|
|
25
|
+
let C = c(null), w = n({
|
|
26
|
+
enabled: y,
|
|
20
27
|
trapped: !1
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
});
|
|
29
|
+
s(v, () => ({
|
|
30
|
+
open: () => {
|
|
31
|
+
x(!0);
|
|
32
|
+
},
|
|
33
|
+
close: () => {
|
|
34
|
+
x(!1);
|
|
35
|
+
},
|
|
36
|
+
focusTrigger: () => {
|
|
37
|
+
let e = S.current;
|
|
38
|
+
e?.isConnected && e.focus();
|
|
39
|
+
}
|
|
40
|
+
}), [x]);
|
|
41
|
+
let T = a((e) => {
|
|
42
|
+
C.current = e, w(e);
|
|
43
|
+
}, [w]);
|
|
44
|
+
return o(() => {
|
|
45
|
+
let e = C.current;
|
|
26
46
|
if (e) {
|
|
27
|
-
if (
|
|
28
|
-
else if (!
|
|
29
|
-
let
|
|
47
|
+
if (y && !e.open) e.showModal();
|
|
48
|
+
else if (!y && e.open) {
|
|
49
|
+
let n = t(e), r = () => {
|
|
30
50
|
e.getAttribute("data-state") === "closed" && e.close();
|
|
31
51
|
};
|
|
32
|
-
|
|
52
|
+
n ? n.then(r) : r();
|
|
33
53
|
}
|
|
34
54
|
}
|
|
35
|
-
}, [
|
|
36
|
-
ref:
|
|
37
|
-
"data-state":
|
|
55
|
+
}, [y]), /* @__PURE__ */ i("dialog", {
|
|
56
|
+
ref: T,
|
|
57
|
+
"data-state": y ? "open" : "closed",
|
|
38
58
|
onClose: () => {
|
|
39
|
-
|
|
59
|
+
b(!1), m?.();
|
|
40
60
|
},
|
|
41
61
|
onCancel: (e) => {
|
|
42
|
-
e.preventDefault(),
|
|
62
|
+
e.preventDefault(), x(!1);
|
|
43
63
|
},
|
|
44
64
|
onClick: (e) => {
|
|
45
|
-
e.target ===
|
|
65
|
+
e.target === C.current && x(!1);
|
|
46
66
|
},
|
|
47
67
|
className: e([
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
u,
|
|
69
|
+
d[p],
|
|
70
|
+
g
|
|
51
71
|
]),
|
|
52
|
-
children:
|
|
72
|
+
children: _
|
|
53
73
|
});
|
|
54
74
|
}
|
|
55
75
|
//#endregion
|
|
56
|
-
export {
|
|
76
|
+
export { f as default };
|
|
@@ -5,41 +5,53 @@ import { useFloating as t } from "../../utils/floating.js";
|
|
|
5
5
|
import { DropdownMenuProvider as n } from "./DropdownMenuContext.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
import { useCallback as i, useId as a,
|
|
9
|
-
import { useControl as
|
|
8
|
+
import { useCallback as i, useId as a, useImperativeHandle as o, useMemo as s, useRef as c } from "react";
|
|
9
|
+
import { useControl as l } from "react-use-control";
|
|
10
10
|
//#region src/lib/components/DropdownMenu/DropdownMenu.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let [
|
|
14
|
-
let t = typeof e == "function" ? e(
|
|
15
|
-
|
|
11
|
+
var u = "haze-DropdownMenu__wrapper";
|
|
12
|
+
function d({ open: d, onOpenChange: f, collisionPadding: p, children: m, className: h, ref: g }) {
|
|
13
|
+
let [_, v] = l(d, !1), y = c(null), b = c(null), x = a(), S = c(null), C = i((e) => {
|
|
14
|
+
let t = typeof e == "function" ? e(_) : e;
|
|
15
|
+
v(t), f?.(t);
|
|
16
16
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
])
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
_,
|
|
18
|
+
v,
|
|
19
|
+
f
|
|
20
|
+
]);
|
|
21
|
+
o(g, () => ({
|
|
22
|
+
open: () => {
|
|
23
|
+
C(!0);
|
|
24
|
+
},
|
|
25
|
+
close: () => {
|
|
26
|
+
C(!1);
|
|
27
|
+
},
|
|
28
|
+
focusTrigger: () => {
|
|
29
|
+
y.current?.focus();
|
|
30
|
+
}
|
|
31
|
+
}), [C]);
|
|
32
|
+
let w = s(() => p === void 0 ? void 0 : { collisionPadding: p }, [p]), T = t({
|
|
33
|
+
open: _,
|
|
34
|
+
setOpen: C,
|
|
35
|
+
triggerRef: y,
|
|
36
|
+
panelRef: b,
|
|
25
37
|
animated: !0,
|
|
26
|
-
collision:
|
|
38
|
+
collision: w
|
|
27
39
|
});
|
|
28
40
|
return /* @__PURE__ */ r(n, {
|
|
29
41
|
value: {
|
|
30
|
-
open:
|
|
31
|
-
setOpen:
|
|
32
|
-
triggerRef:
|
|
33
|
-
contentRef:
|
|
34
|
-
contentId:
|
|
35
|
-
focusRequestRef:
|
|
36
|
-
floating:
|
|
42
|
+
open: _,
|
|
43
|
+
setOpen: C,
|
|
44
|
+
triggerRef: y,
|
|
45
|
+
contentRef: b,
|
|
46
|
+
contentId: x,
|
|
47
|
+
focusRequestRef: S,
|
|
48
|
+
floating: T
|
|
37
49
|
},
|
|
38
50
|
children: r("div", {
|
|
39
|
-
className: e([
|
|
40
|
-
children:
|
|
51
|
+
className: e([u, h]),
|
|
52
|
+
children: m
|
|
41
53
|
})
|
|
42
54
|
});
|
|
43
55
|
}
|
|
44
56
|
//#endregion
|
|
45
|
-
export {
|
|
57
|
+
export { d as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { SubmenuProvider as t, useSubmenu as n } from "../../utils/submenu.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
|
+
//#region src/lib/components/DropdownMenu/DropdownMenuSub.tsx
|
|
8
|
+
var i = "haze-DropdownMenuSub__wrapper";
|
|
9
|
+
function a({ open: a, onOpenChange: o, className: s, children: c }) {
|
|
10
|
+
let l = n({
|
|
11
|
+
open: a,
|
|
12
|
+
onOpenChange: o
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ r(t, {
|
|
15
|
+
value: l,
|
|
16
|
+
children: r("div", {
|
|
17
|
+
className: e([i, s]),
|
|
18
|
+
children: c
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as default };
|