haze-ui 1.26.0 → 1.28.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 +525 -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 +222 -140
- package/dist/components/Chart/Chart.js +34 -0
- package/dist/components/Chart/chart-elements.js +164 -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 +39 -10
- 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 +202 -75
- 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 +394 -143
- package/dist/components/DataTable/csv.js +29 -0
- package/dist/components/DataTable/features.js +25 -0
- package/dist/components/DataTable/index.js +3 -1
- package/dist/components/DataTable/summary.js +17 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +31 -13
- package/dist/components/DateRangePicker/DateRangePickerCore.js +59 -27
- package/dist/components/DateRangePicker/presets.js +43 -0
- package/dist/components/Datepicker/Datepicker.js +17 -12
- package/dist/components/Datepicker/DatepickerCore.js +73 -39
- package/dist/components/Datepicker/datetime.js +23 -0
- package/dist/components/Descriptions/Descriptions.js +46 -0
- package/dist/components/Descriptions/index.js +3 -0
- package/dist/components/Dialog/Dialog.js +56 -32
- package/dist/components/DiffViewer/DiffViewer.js +31 -30
- 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/FilePreview/FilePreview.js +135 -0
- package/dist/components/FilePreview/file-preview-format.js +23 -0
- package/dist/components/FilePreview/index.js +3 -0
- package/dist/components/Flex/Flex.js +0 -1
- package/dist/components/Flex/index.js +0 -1
- package/dist/components/FloatButton/FloatButton.js +42 -0
- package/dist/components/FloatButton/FloatButtonGroup.js +58 -0
- package/dist/components/FloatButton/float-button-context.js +9 -0
- package/dist/components/FloatButton/float-button-glyphs.js +26 -0
- package/dist/components/FloatButton/float-button-styles.js +14 -0
- package/dist/components/FloatButton/index.js +4 -0
- 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/InlineCompletion/InlineCompletion.js +81 -0
- package/dist/components/InlineCompletion/index.js +3 -0
- package/dist/components/Input/Input.js +6 -5
- package/dist/components/Input/InputCore.js +3 -2
- package/dist/components/JsonView/JsonView.js +209 -0
- package/dist/components/JsonView/index.js +3 -0
- package/dist/components/JsonView/json-view-utils.js +24 -0
- 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 +5 -3
- package/dist/components/LocaleProvider/ja-jp.js +222 -0
- package/dist/components/LocaleProvider/locale.js +99 -5
- package/dist/components/LocaleProvider/strings.js +15 -0
- package/dist/components/LocaleProvider/useStrings.js +13 -11
- package/dist/components/LocaleProvider/zh-cn.js +99 -5
- package/dist/components/Masonry/Masonry.js +29 -0
- package/dist/components/Masonry/index.js +3 -0
- package/dist/components/Masonry/masonry-distribute.js +15 -0
- 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 +20 -9
- package/dist/components/Select/SelectCore.js +74 -13
- package/dist/components/Select/SelectFloating.js +256 -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/Signature/Signature.js +165 -0
- package/dist/components/Signature/index.js +3 -0
- package/dist/components/Signature/signature-points.js +28 -0
- 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/Sources/Sources.js +109 -0
- package/dist/components/Sources/index.js +3 -0
- 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/SortableTagGroup.js +26 -0
- package/dist/components/TagGroup/TagGroup.js +4 -6
- package/dist/components/TagGroup/TagGroupItem.js +17 -11
- package/dist/components/TagGroup/index.js +2 -1
- package/dist/components/TagGroup/tag-group-styles.js +7 -0
- package/dist/components/TagInput/SortableTagInput.js +24 -0
- package/dist/components/TagInput/SortableTagInputCore.js +52 -0
- package/dist/components/TagInput/TagInput.js +5 -4
- package/dist/components/TagInput/TagInputCore.js +71 -57
- package/dist/components/TagInput/index.js +3 -1
- package/dist/components/TagInput/tag-input-styles.js +7 -0
- 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 +44 -42
- 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 +265 -80
- package/dist/components/Tree/TreeItem.js +91 -55
- package/dist/components/Tree/utils.js +82 -10
- package/dist/components/Typography/Typography.js +0 -1
- package/dist/components/Typography/index.js +0 -1
- package/dist/components/Upload/Upload.js +24 -8
- package/dist/components/Upload/UploadCore.js +230 -37
- package/dist/components/Upload/UploadList.js +300 -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/descriptions.css +2 -0
- package/dist/css/dialog.css +1 -1
- package/dist/css/drawer.css +1 -1
- package/dist/css/dropdown-menu.css +4 -1
- package/dist/css/file-preview.css +2 -0
- package/dist/css/float-button.css +2 -0
- package/dist/css/image.css +2 -1
- package/dist/css/inline-completion.css +2 -0
- package/dist/css/json-view.css +2 -0
- package/dist/css/masonry.css +2 -0
- 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/signature.css +2 -0
- package/dist/css/slider.css +1 -1
- package/dist/css/sources.css +2 -0
- package/dist/css/tag-group.css +3 -1
- package/dist/css/tag-input.css +2 -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 +2 -2
- package/dist/css/upload.css +2 -1
- package/dist/css/watermark.css +2 -0
- package/dist/css-manifest.json +75 -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 +61 -30
- package/dist/headless/index.js +19 -0
- package/dist/hooks/useClickOutside.js +24 -0
- package/dist/hooks/useDarkMode.js +27 -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 +220 -171
- package/dist/registry.json +2435 -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 +48 -3
- package/dist/types/components/Chart/Chart.d.ts +43 -0
- package/dist/types/components/Chart/chart-elements.d.ts +104 -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/CodeBlock/CodeBlock.d.ts +19 -2
- package/dist/types/components/CodeBlock/index.d.ts +1 -1
- 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 +111 -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 +184 -32
- package/dist/types/components/DataTable/csv.d.ts +36 -0
- package/dist/types/components/DataTable/features.d.ts +124 -0
- package/dist/types/components/DataTable/index.d.ts +4 -1
- package/dist/types/components/DataTable/summary.d.ts +19 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +28 -2
- package/dist/types/components/DateRangePicker/DateRangePickerCore.d.ts +26 -2
- package/dist/types/components/DateRangePicker/index.d.ts +2 -2
- package/dist/types/components/DateRangePicker/presets.d.ts +23 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +21 -1
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +29 -2
- package/dist/types/components/Datepicker/datetime.d.ts +27 -0
- package/dist/types/components/Datepicker/index.d.ts +1 -1
- package/dist/types/components/Descriptions/Descriptions.d.ts +30 -0
- package/dist/types/components/Descriptions/index.d.ts +2 -0
- 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/FilePreview/FilePreview.d.ts +35 -0
- package/dist/types/components/FilePreview/file-preview-format.d.ts +20 -0
- package/dist/types/components/FilePreview/index.d.ts +2 -0
- package/dist/types/components/FloatButton/FloatButton.d.ts +43 -0
- package/dist/types/components/FloatButton/FloatButtonGroup.d.ts +33 -0
- package/dist/types/components/FloatButton/float-button-context.d.ts +11 -0
- package/dist/types/components/FloatButton/float-button-glyphs.d.ts +3 -0
- package/dist/types/components/FloatButton/float-button-styles.d.ts +58 -0
- package/dist/types/components/FloatButton/index.d.ts +4 -0
- 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/InlineCompletion/InlineCompletion.d.ts +29 -0
- package/dist/types/components/InlineCompletion/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +5 -2
- package/dist/types/components/Input/InputCore.d.ts +4 -2
- package/dist/types/components/JsonView/JsonView.d.ts +26 -0
- package/dist/types/components/JsonView/index.d.ts +2 -0
- package/dist/types/components/JsonView/json-view-utils.d.ts +22 -0
- 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 +3 -0
- package/dist/types/components/LocaleProvider/ja-jp.d.ts +13 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +100 -0
- package/dist/types/components/LocaleProvider/strings.d.ts +28 -0
- package/dist/types/components/Masonry/Masonry.d.ts +34 -0
- package/dist/types/components/Masonry/index.d.ts +2 -0
- package/dist/types/components/Masonry/masonry-distribute.d.ts +16 -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 +78 -4
- package/dist/types/components/Select/SelectCore.d.ts +79 -6
- package/dist/types/components/Select/SelectFloating.d.ts +94 -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/Signature/Signature.d.ts +51 -0
- package/dist/types/components/Signature/index.d.ts +2 -0
- package/dist/types/components/Signature/signature-points.d.ts +31 -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/Sources/Sources.d.ts +37 -0
- package/dist/types/components/Sources/index.d.ts +2 -0
- 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/SortableTagGroup.d.ts +20 -0
- package/dist/types/components/TagGroup/TagGroup.d.ts +3 -0
- package/dist/types/components/TagGroup/index.d.ts +2 -0
- package/dist/types/components/TagGroup/tag-group-styles.d.ts +7 -0
- package/dist/types/components/TagInput/SortableTagInput.d.ts +34 -0
- package/dist/types/components/TagInput/SortableTagInputCore.d.ts +18 -0
- package/dist/types/components/TagInput/TagInput.d.ts +5 -1
- package/dist/types/components/TagInput/TagInputCore.d.ts +6 -2
- package/dist/types/components/TagInput/index.d.ts +4 -0
- package/dist/types/components/TagInput/tag-input-styles.d.ts +12 -0
- 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 +16 -1
- package/dist/types/components/Tree/types.d.ts +51 -0
- package/dist/types/components/Tree/utils.d.ts +73 -0
- package/dist/types/components/Upload/Upload.d.ts +47 -3
- package/dist/types/components/Upload/UploadCore.d.ts +95 -4
- package/dist/types/components/Upload/UploadList.d.ts +18 -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 +399 -0
- package/dist/types/hooks/index.d.ts +13 -0
- package/dist/types/hooks/useClickOutside.d.ts +46 -0
- package/dist/types/hooks/useDarkMode.d.ts +40 -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 +79 -37
- 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-handle.d.ts +25 -0
- package/dist/types/utils/sortable-shared.d.ts +30 -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-handle.js +12 -0
- package/dist/utils/sortable-shared.js +16 -0
- package/dist/utils/sortable.js +47 -0
- package/dist/utils/submenu.js +106 -0
- package/dist/utils/view-transition.js +26 -0
- package/package.json +169 -16
|
@@ -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 };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { FloatingPanel as e } from "../../utils/floating.js";
|
|
4
|
+
import { useSubmenuContext as t } from "../../utils/submenu.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
7
|
+
//#region src/lib/components/DropdownMenu/DropdownMenuSubContent.tsx
|
|
8
|
+
var r = "haze-DropdownMenuSubContent__content";
|
|
9
|
+
function i({ className: i, children: a }) {
|
|
10
|
+
let o = t();
|
|
11
|
+
return !o.open && o.floating.exited ? null : /* @__PURE__ */ n(e, {
|
|
12
|
+
ref: o.contentRef,
|
|
13
|
+
behavior: o.floating,
|
|
14
|
+
placement: "right",
|
|
15
|
+
id: o.contentId,
|
|
16
|
+
role: "menu",
|
|
17
|
+
visualClass: r,
|
|
18
|
+
className: i,
|
|
19
|
+
onKeyDown: o.contentKeyDown,
|
|
20
|
+
children: a
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useSubmenuContext as t } from "../../utils/submenu.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
7
|
+
//#region src/lib/components/DropdownMenu/DropdownMenuSubTrigger.tsx
|
|
8
|
+
var r = "haze-DropdownMenuSubTrigger__trigger";
|
|
9
|
+
function i({ disabled: i = !1, className: a, children: o }) {
|
|
10
|
+
let s = t();
|
|
11
|
+
return /* @__PURE__ */ n("button", {
|
|
12
|
+
ref: s.triggerRef,
|
|
13
|
+
type: "button",
|
|
14
|
+
role: "menuitem",
|
|
15
|
+
tabIndex: -1,
|
|
16
|
+
"aria-haspopup": "menu",
|
|
17
|
+
"aria-expanded": s.open,
|
|
18
|
+
"aria-owns": s.open ? s.contentId : void 0,
|
|
19
|
+
disabled: i,
|
|
20
|
+
style: s.floating.triggerStyle,
|
|
21
|
+
onPointerDown: s.floating.onTriggerPointerDown,
|
|
22
|
+
onPointerEnter: s.onTriggerPointerEnter,
|
|
23
|
+
onClick: s.floating.onTriggerClick,
|
|
24
|
+
onKeyDown: s.handleTriggerKeyDown,
|
|
25
|
+
className: e([r, a]),
|
|
26
|
+
children: o
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as default };
|
|
@@ -4,4 +4,7 @@ import t from "./DropdownMenuTrigger.js";
|
|
|
4
4
|
import n from "./DropdownMenuContent.js";
|
|
5
5
|
import r from "./DropdownMenuItem.js";
|
|
6
6
|
import i from "./DropdownMenuSeparator.js";
|
|
7
|
-
|
|
7
|
+
import a from "./DropdownMenuSub.js";
|
|
8
|
+
import o from "./DropdownMenuSubTrigger.js";
|
|
9
|
+
import s from "./DropdownMenuSubContent.js";
|
|
10
|
+
export { e as DropdownMenu, n as DropdownMenuContent, r as DropdownMenuItem, i as DropdownMenuSeparator, a as DropdownMenuSub, s as DropdownMenuSubContent, o as DropdownMenuSubTrigger, t as DropdownMenuTrigger };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
|
+
import n from "../Progress/Progress.js";
|
|
6
|
+
import { formatFileSize as r, getFileExtension as i } from "./file-preview-format.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
9
|
+
//#region src/lib/components/FilePreview/FilePreview.tsx
|
|
10
|
+
var s = "haze-FilePreview__card", c = "haze-FilePreview__thumbWrap", l = "haze-FilePreview__thumb", u = "haze-FilePreview__extBadge", d = "haze-FilePreview__info", f = "haze-FilePreview__nameClass", p = "haze-FilePreview__meta", m = "haze-FilePreview__statusUploading", h = "haze-FilePreview__statusError", g = "haze-FilePreview__srOnly", _ = "haze-FilePreview__actions", v = "haze-FilePreview__actionBtn", y = "haze-FilePreview__actionBtnRetry", b = "haze-FilePreview__progressRow", x = "haze-FilePreview__percentClass", S = () => /* @__PURE__ */ o("svg", {
|
|
11
|
+
width: "16",
|
|
12
|
+
height: "16",
|
|
13
|
+
viewBox: "0 0 16 16",
|
|
14
|
+
fill: "none",
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
strokeWidth: "1.25",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
focusable: "false",
|
|
21
|
+
children: [/* @__PURE__ */ a("path", { d: "M9 1.5H4A1.5 1.5 0 0 0 2.5 3v10A1.5 1.5 0 0 0 4 14.5h8a1.5 1.5 0 0 0 1.5-1.5V6L9 1.5Z" }), /* @__PURE__ */ a("path", { d: "M9 1.5V6h4.5" })]
|
|
22
|
+
}), C = () => /* @__PURE__ */ a("svg", {
|
|
23
|
+
width: "12",
|
|
24
|
+
height: "12",
|
|
25
|
+
viewBox: "0 0 12 12",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "1.5",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
focusable: "false",
|
|
33
|
+
children: a("path", { d: "M2 6.5 4.8 9.2 10 3.5" })
|
|
34
|
+
}), w = () => /* @__PURE__ */ o("svg", {
|
|
35
|
+
width: "12",
|
|
36
|
+
height: "12",
|
|
37
|
+
viewBox: "0 0 12 12",
|
|
38
|
+
fill: "none",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "1.5",
|
|
41
|
+
strokeLinecap: "round",
|
|
42
|
+
strokeLinejoin: "round",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
focusable: "false",
|
|
45
|
+
children: [/* @__PURE__ */ a("path", { d: "M10.5 6a4.5 4.5 0 1 1-1.32-3.18" }), /* @__PURE__ */ a("path", { d: "M10.5 1v2.5H8" })]
|
|
46
|
+
}), T = () => /* @__PURE__ */ a("svg", {
|
|
47
|
+
width: "12",
|
|
48
|
+
height: "12",
|
|
49
|
+
viewBox: "0 0 12 12",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
strokeWidth: "1.5",
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
focusable: "false",
|
|
56
|
+
children: a("path", { d: "M2.5 2.5l7 7M9.5 2.5l-7 7" })
|
|
57
|
+
});
|
|
58
|
+
function E({ file: E, status: D = "uploaded", progress: O, onRemove: k, onRetry: A, removeLabel: j, retryLabel: M, uploadingLabel: N, uploadedLabel: P, errorLabel: F, className: I, ...L }) {
|
|
59
|
+
let R = t("filePreview"), z = j ?? R.remove, B = M ?? R.retry, V = N ?? R.uploading, H = P ?? R.uploaded, U = F ?? R.error, W = (E.type?.startsWith("image/") ?? !1) && E.url !== void 0, G = W ? "" : i(E.name), K = r(E.size), q = O === void 0 ? void 0 : Math.max(0, Math.min(100, O));
|
|
60
|
+
return /* @__PURE__ */ o("div", {
|
|
61
|
+
...L,
|
|
62
|
+
className: e([s, I]),
|
|
63
|
+
children: [
|
|
64
|
+
W ? /* @__PURE__ */ a("img", {
|
|
65
|
+
src: E.url,
|
|
66
|
+
alt: "",
|
|
67
|
+
loading: "lazy",
|
|
68
|
+
className: e([l])
|
|
69
|
+
}) : /* @__PURE__ */ o("span", {
|
|
70
|
+
className: e([c]),
|
|
71
|
+
children: [/* @__PURE__ */ a(S, {}), G && /* @__PURE__ */ a("span", {
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
className: e([u]),
|
|
74
|
+
children: G
|
|
75
|
+
})]
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ o("div", {
|
|
78
|
+
className: e([d]),
|
|
79
|
+
children: [/* @__PURE__ */ a("span", {
|
|
80
|
+
title: E.name,
|
|
81
|
+
className: e([f]),
|
|
82
|
+
children: E.name
|
|
83
|
+
}), /* @__PURE__ */ o("div", {
|
|
84
|
+
className: e([p]),
|
|
85
|
+
children: [
|
|
86
|
+
K && /* @__PURE__ */ a("span", { children: K }),
|
|
87
|
+
D === "uploading" && /* @__PURE__ */ a("span", {
|
|
88
|
+
className: e([m]),
|
|
89
|
+
children: V
|
|
90
|
+
}),
|
|
91
|
+
D === "uploaded" && /* @__PURE__ */ o("span", {
|
|
92
|
+
className: e([m]),
|
|
93
|
+
children: [/* @__PURE__ */ a(C, {}), /* @__PURE__ */ a("span", {
|
|
94
|
+
className: e([g]),
|
|
95
|
+
children: H
|
|
96
|
+
})]
|
|
97
|
+
}),
|
|
98
|
+
D === "error" && /* @__PURE__ */ a("span", {
|
|
99
|
+
className: e([h]),
|
|
100
|
+
children: U
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
})]
|
|
104
|
+
}),
|
|
105
|
+
(k || D === "error" && A) && /* @__PURE__ */ o("div", {
|
|
106
|
+
className: e([_]),
|
|
107
|
+
children: [D === "error" && A && /* @__PURE__ */ a("button", {
|
|
108
|
+
type: "button",
|
|
109
|
+
"aria-label": B,
|
|
110
|
+
onClick: A,
|
|
111
|
+
className: e([v, y]),
|
|
112
|
+
children: /* @__PURE__ */ a(w, {})
|
|
113
|
+
}), k && /* @__PURE__ */ a("button", {
|
|
114
|
+
type: "button",
|
|
115
|
+
"aria-label": z,
|
|
116
|
+
onClick: k,
|
|
117
|
+
className: e([v]),
|
|
118
|
+
children: /* @__PURE__ */ a(T, {})
|
|
119
|
+
})]
|
|
120
|
+
}),
|
|
121
|
+
D === "uploading" && /* @__PURE__ */ o("div", {
|
|
122
|
+
className: e([b]),
|
|
123
|
+
children: [/* @__PURE__ */ a(n, {
|
|
124
|
+
value: q ?? 0,
|
|
125
|
+
size: "sm"
|
|
126
|
+
}), q !== void 0 && /* @__PURE__ */ o("span", {
|
|
127
|
+
className: e([x]),
|
|
128
|
+
children: [Math.round(q), "%"]
|
|
129
|
+
})]
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { E as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/lib/components/FilePreview/file-preview-format.ts
|
|
3
|
+
function e(e) {
|
|
4
|
+
if (e == null || !Number.isFinite(e) || e < 0) return "";
|
|
5
|
+
if (e < 1024) return `${e} B`;
|
|
6
|
+
let t = [
|
|
7
|
+
"KB",
|
|
8
|
+
"MB",
|
|
9
|
+
"GB",
|
|
10
|
+
"TB"
|
|
11
|
+
], n = e, r = -1;
|
|
12
|
+
do
|
|
13
|
+
n /= 1024, r += 1;
|
|
14
|
+
while (n >= 1024 && r < t.length - 1);
|
|
15
|
+
let i = n >= 100 ? 0 : n >= 10 ? 1 : 2;
|
|
16
|
+
return `${n.toFixed(i)} ${t[r]}`;
|
|
17
|
+
}
|
|
18
|
+
function t(e) {
|
|
19
|
+
let t = e.lastIndexOf(".");
|
|
20
|
+
return t <= 0 || t === e.length - 1 ? "" : e.slice(t + 1).toUpperCase();
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { e as formatFileSize, t as getFileExtension };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { fab as t, iconBox as n, shapes as r, variants as i } from "./float-button-styles.js";
|
|
4
|
+
import { PlusGlyph as a } from "./float-button-glyphs.js";
|
|
5
|
+
import { useFloatButtonGroup as o } from "./float-button-context.js";
|
|
6
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
//#region src/lib/components/FloatButton/FloatButton.tsx
|
|
8
|
+
function u({ icon: u, description: d, shape: f = "circle", variant: p = "solid", href: m, className: h, onClick: g, ..._ }) {
|
|
9
|
+
let v = o(), y = /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
className: e([n]),
|
|
12
|
+
children: u ?? /* @__PURE__ */ c(a, {})
|
|
13
|
+
}), d != null && /* @__PURE__ */ c("span", {
|
|
14
|
+
className: e(["haze-float-button-styles__descBox"]),
|
|
15
|
+
children: d
|
|
16
|
+
})] }), b = [
|
|
17
|
+
t,
|
|
18
|
+
r[f],
|
|
19
|
+
i[p],
|
|
20
|
+
!v && "haze-float-button-styles__anchored",
|
|
21
|
+
h
|
|
22
|
+
];
|
|
23
|
+
return m == null ? /* @__PURE__ */ c("button", {
|
|
24
|
+
type: "button",
|
|
25
|
+
..._,
|
|
26
|
+
onClick: (e) => {
|
|
27
|
+
g?.(e), v?.closeMenu();
|
|
28
|
+
},
|
|
29
|
+
className: e(b),
|
|
30
|
+
children: y
|
|
31
|
+
}) : /* @__PURE__ */ c("a", {
|
|
32
|
+
href: m,
|
|
33
|
+
..._,
|
|
34
|
+
onClick: (e) => {
|
|
35
|
+
g?.(e), v?.closeMenu();
|
|
36
|
+
},
|
|
37
|
+
className: e(b),
|
|
38
|
+
children: y
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { u as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { anchored as t, fab as n, groupAnchor as r, iconBox as i, menuList as a, shapes as o, variants as s } from "./float-button-styles.js";
|
|
4
|
+
import { PlusGlyph as c } from "./float-button-glyphs.js";
|
|
5
|
+
import { FloatButtonGroupContext as l } from "./float-button-context.js";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback as f, useId as p, useMemo as m } from "react";
|
|
8
|
+
import { useControl as h } from "react-use-control";
|
|
9
|
+
//#region src/lib/components/FloatButton/FloatButtonGroup.tsx
|
|
10
|
+
function g({ open: g, onOpenChange: _, icon: v, description: y, shape: b = "circle", variant: x = "solid", children: S, className: C, onKeyDown: w, ...T }) {
|
|
11
|
+
let [E, D] = h(g, !1), O = p(), k = E ? "open" : "closed", A = f((e) => {
|
|
12
|
+
D(e), _?.(e);
|
|
13
|
+
}, [D, _]), j = f(() => {
|
|
14
|
+
E && A(!1);
|
|
15
|
+
}, [E, A]), M = m(() => ({ closeMenu: j }), [j]);
|
|
16
|
+
return /* @__PURE__ */ u(l.Provider, {
|
|
17
|
+
value: M,
|
|
18
|
+
children: /* @__PURE__ */ d("div", {
|
|
19
|
+
"data-state": k,
|
|
20
|
+
onKeyDown: (e) => {
|
|
21
|
+
w?.(e), e.key === "Escape" && j();
|
|
22
|
+
},
|
|
23
|
+
...T,
|
|
24
|
+
className: e([
|
|
25
|
+
r,
|
|
26
|
+
t,
|
|
27
|
+
C
|
|
28
|
+
]),
|
|
29
|
+
children: [/* @__PURE__ */ u("div", {
|
|
30
|
+
id: O,
|
|
31
|
+
"data-state": k,
|
|
32
|
+
className: e([a]),
|
|
33
|
+
children: /* @__PURE__ */ u("div", { children: S })
|
|
34
|
+
}), /* @__PURE__ */ d("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
"data-state": k,
|
|
37
|
+
"aria-expanded": E,
|
|
38
|
+
"aria-controls": O,
|
|
39
|
+
onClick: () => A(!E),
|
|
40
|
+
className: e([
|
|
41
|
+
n,
|
|
42
|
+
o[b],
|
|
43
|
+
s[x]
|
|
44
|
+
]),
|
|
45
|
+
children: [/* @__PURE__ */ u("span", {
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: e([i, E && "haze-float-button-styles__iconOpen"]),
|
|
48
|
+
children: v ?? /* @__PURE__ */ u(c, {})
|
|
49
|
+
}), y != null && /* @__PURE__ */ u("span", {
|
|
50
|
+
className: e(["haze-float-button-styles__descBox"]),
|
|
51
|
+
children: y
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { g as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as e, useContext as t } from "react";
|
|
3
|
+
//#region src/lib/components/FloatButton/float-button-context.ts
|
|
4
|
+
var n = e(void 0);
|
|
5
|
+
function r() {
|
|
6
|
+
return t(n);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as FloatButtonGroupContext, r as useFloatButtonGroup };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/lib/components/FloatButton/float-button-glyphs.tsx
|
|
4
|
+
function n() {
|
|
5
|
+
return /* @__PURE__ */ t("svg", {
|
|
6
|
+
width: "20",
|
|
7
|
+
height: "20",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
children: [/* @__PURE__ */ e("line", {
|
|
13
|
+
x1: "12",
|
|
14
|
+
y1: "5",
|
|
15
|
+
x2: "12",
|
|
16
|
+
y2: "19"
|
|
17
|
+
}), /* @__PURE__ */ e("line", {
|
|
18
|
+
x1: "5",
|
|
19
|
+
y1: "12",
|
|
20
|
+
x2: "19",
|
|
21
|
+
y2: "12"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { n as PlusGlyph };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/lib/components/FloatButton/float-button-styles.ts
|
|
5
|
+
var e = "haze-float-button-styles__fab", t = {
|
|
6
|
+
circle: "haze-float-button-styles__circle",
|
|
7
|
+
square: "haze-float-button-styles__square"
|
|
8
|
+
}, n = {
|
|
9
|
+
solid: "haze-float-button-styles__solid",
|
|
10
|
+
outline: "haze-float-button-styles__outline",
|
|
11
|
+
ghost: "haze-float-button-styles__ghost"
|
|
12
|
+
}, r = "haze-float-button-styles__anchored", i = "haze-float-button-styles__groupAnchor", a = "haze-float-button-styles__menuList", o = "haze-float-button-styles__iconBox", s = "haze-float-button-styles__iconOpen", c = "haze-float-button-styles__descBox";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as anchored, c as descBox, e as fab, i as groupAnchor, o as iconBox, s as iconOpen, a as menuList, t as shapes, n as variants };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useFullscreen as e } from "../../hooks/useFullscreen.js";
|
|
3
|
+
import { Children as t, cloneElement as n, useEffect as r, useRef as i } from "react";
|
|
4
|
+
import { useControl as a } from "react-use-control";
|
|
5
|
+
//#region src/lib/components/Fullscreen/Fullscreen.tsx
|
|
6
|
+
function o({ fullscreen: o, onChange: s, target: c, children: l }) {
|
|
7
|
+
let [u, d] = a(o, !1), [f, , p] = e(c), m = i(null);
|
|
8
|
+
r(() => {
|
|
9
|
+
m.current !== u && (m.current = u, u !== f && (u ? p.enter() : p.exit()));
|
|
10
|
+
}, [
|
|
11
|
+
u,
|
|
12
|
+
f,
|
|
13
|
+
p
|
|
14
|
+
]);
|
|
15
|
+
let h = i(!1);
|
|
16
|
+
r(() => {
|
|
17
|
+
h.current !== f && (h.current = f, d(f), s?.(f));
|
|
18
|
+
}, [
|
|
19
|
+
f,
|
|
20
|
+
d,
|
|
21
|
+
s
|
|
22
|
+
]);
|
|
23
|
+
let g = t.only(l);
|
|
24
|
+
return n(g, { onClick: (e) => {
|
|
25
|
+
g.props.onClick?.(e), d((e) => !e);
|
|
26
|
+
} });
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { o as default };
|