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
package/dist/tokens/colors.js
CHANGED
package/dist/tokens/index.js
CHANGED
package/dist/tokens/motion.js
CHANGED
package/dist/tokens/oklch.js
CHANGED
package/dist/tokens/palette.js
CHANGED
package/dist/tokens/registry.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { formatOklch as e } from "./oklch.js";
|
|
3
2
|
import { SEMANTIC_COLOR_TOKENS as t } from "./palette.js";
|
|
4
3
|
//#region src/lib/tokens/registry.ts
|
|
@@ -448,29 +447,7 @@ var n = [
|
|
|
448
447
|
"--haze-text-sm",
|
|
449
448
|
"--haze-weight-medium"
|
|
450
449
|
],
|
|
451
|
-
button:
|
|
452
|
-
"--haze-color-primary",
|
|
453
|
-
"--haze-color-primary-hover",
|
|
454
|
-
"--haze-color-primary-active",
|
|
455
|
-
"--haze-color-text",
|
|
456
|
-
"--haze-color-text-inverse",
|
|
457
|
-
"--haze-color-border",
|
|
458
|
-
"--haze-color-border-hover",
|
|
459
|
-
"--haze-color-bg-subtle",
|
|
460
|
-
"--haze-color-bg-muted",
|
|
461
|
-
"--haze-color-focus-ring",
|
|
462
|
-
"--haze-font-sans",
|
|
463
|
-
"--haze-leading-tight",
|
|
464
|
-
"--haze-radius-md",
|
|
465
|
-
"--haze-space-1",
|
|
466
|
-
"--haze-space-2",
|
|
467
|
-
"--haze-space-3",
|
|
468
|
-
"--haze-space-4",
|
|
469
|
-
"--haze-space-6",
|
|
470
|
-
"--haze-text-sm",
|
|
471
|
-
"--haze-text-base",
|
|
472
|
-
"--haze-weight-medium"
|
|
473
|
-
],
|
|
450
|
+
button: /* @__PURE__ */ "--haze-button-font-size-lg.--haze-button-font-size-md.--haze-button-font-size-sm.--haze-button-height-lg.--haze-button-height-md.--haze-button-height-sm.--haze-button-radius.--haze-color-primary.--haze-color-primary-hover.--haze-color-primary-active.--haze-color-text.--haze-color-text-inverse.--haze-color-border.--haze-color-border-hover.--haze-color-bg-subtle.--haze-color-bg-muted.--haze-color-focus-ring.--haze-font-sans.--haze-leading-tight.--haze-radius-md.--haze-space-1.--haze-space-2.--haze-space-3.--haze-space-4.--haze-space-6.--haze-text-sm.--haze-text-base.--haze-weight-medium".split("."),
|
|
474
451
|
card: [
|
|
475
452
|
"--haze-color-bg",
|
|
476
453
|
"--haze-color-border",
|
|
@@ -552,19 +529,24 @@ var n = [
|
|
|
552
529
|
],
|
|
553
530
|
combobox: [
|
|
554
531
|
"--haze-color-bg",
|
|
532
|
+
"--haze-color-bg-subtle",
|
|
555
533
|
"--haze-color-border",
|
|
556
|
-
"--haze-color-text",
|
|
557
|
-
"--haze-color-primary",
|
|
558
534
|
"--haze-color-focus-ring",
|
|
559
|
-
"--haze-color-
|
|
535
|
+
"--haze-color-primary",
|
|
536
|
+
"--haze-color-primary-subtle",
|
|
537
|
+
"--haze-color-text",
|
|
538
|
+
"--haze-color-text-muted",
|
|
539
|
+
"--haze-duration-fast",
|
|
560
540
|
"--haze-font-sans",
|
|
561
541
|
"--haze-leading-normal",
|
|
562
542
|
"--haze-radius-md",
|
|
543
|
+
"--haze-radius-sm",
|
|
563
544
|
"--haze-shadow-lg",
|
|
564
545
|
"--haze-space-1",
|
|
565
546
|
"--haze-space-2",
|
|
566
547
|
"--haze-space-3",
|
|
567
548
|
"--haze-text-sm",
|
|
549
|
+
"--haze-text-xs",
|
|
568
550
|
"--haze-weight-medium"
|
|
569
551
|
],
|
|
570
552
|
datepicker: [
|
|
@@ -591,13 +573,20 @@ var n = [
|
|
|
591
573
|
"--haze-weight-medium"
|
|
592
574
|
],
|
|
593
575
|
dialog: [
|
|
576
|
+
"--haze-dialog-padding",
|
|
577
|
+
"--haze-dialog-radius",
|
|
578
|
+
"--haze-dialog-title-font-size",
|
|
579
|
+
"--haze-dialog-title-gap",
|
|
580
|
+
"--haze-dialog-width",
|
|
594
581
|
"--haze-color-bg",
|
|
595
582
|
"--haze-color-text",
|
|
596
583
|
"--haze-color-focus-ring",
|
|
597
584
|
"--haze-font-sans",
|
|
598
585
|
"--haze-radius-xl",
|
|
599
586
|
"--haze-shadow-xl",
|
|
600
|
-
"--haze-space-
|
|
587
|
+
"--haze-space-4",
|
|
588
|
+
"--haze-space-6",
|
|
589
|
+
"--haze-text-lg"
|
|
601
590
|
],
|
|
602
591
|
diffviewer: [
|
|
603
592
|
"--haze-color-border",
|
package/dist/tokens/spacing.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
export type AnchorItem = {
|
|
4
|
+
/** Section id — the scroll target is `document.getElementById(id)`. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Link content. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
type AnchorProps = {
|
|
10
|
+
/** Anchor sections, in document order. */
|
|
11
|
+
items: AnchorItem[];
|
|
12
|
+
/** Highlighted section id. Accepts a control (controlled) or a plain value (uncontrolled initial). */
|
|
13
|
+
activeId?: ControlOrValue<string>;
|
|
14
|
+
/** Fires when a link is clicked, after the highlight moves and before scrolling is queued. */
|
|
15
|
+
onClick?: (id: string) => void;
|
|
16
|
+
/** Distance kept between the container top and the section top when scrolling (sticky header height), px. */
|
|
17
|
+
offsetTop?: number;
|
|
18
|
+
/** Scroll-spy trigger line, px from the container top (fallback engines only). */
|
|
19
|
+
bounds?: number;
|
|
20
|
+
/** Scroll container; defaults to `window`. */
|
|
21
|
+
getContainer?: () => HTMLElement | Window;
|
|
22
|
+
className?: string;
|
|
23
|
+
} & Omit<ComponentPropsWithoutRef<'nav'>, 'className' | 'onClick' | 'children'>;
|
|
24
|
+
export default function Anchor({ items, activeId: activeIdControl, onClick, offsetTop, bounds, getContainer, className, ...rest }: AnchorProps): import("react").JSX.Element;
|
|
25
|
+
export type { AnchorProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
type AppShellProps = {
|
|
4
|
+
/** Top region, rendered inside a sticky <header> spanning the full width. */
|
|
5
|
+
header?: ReactNode;
|
|
6
|
+
/** Side region, rendered inside an <aside> column left of the content. */
|
|
7
|
+
sidebar?: ReactNode;
|
|
8
|
+
/** Bottom region, rendered inside a <footer> spanning the full width. */
|
|
9
|
+
footer?: ReactNode;
|
|
10
|
+
/** Collapsed state of the sidebar column; a Control drives it live, a plain boolean is the uncontrolled initial value. */
|
|
11
|
+
sidebarCollapsed?: ControlOrValue<boolean>;
|
|
12
|
+
/** Expanded sidebar width, any CSS width. Consumers theme it by overriding --haze-appshell-sidebar-width instead of hardcoding. */
|
|
13
|
+
sidebarWidth?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
16
|
+
export default function AppShell({ header: headerSlot, sidebar: sidebarSlot, footer: footerSlot, sidebarCollapsed: collapsedControl, sidebarWidth, className, style, children, ...rest }: AppShellProps): import("react").JSX.Element;
|
|
17
|
+
export type { AppShellProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Badge skin — the base, variant and size classes the `Badge`
|
|
3
|
+
* component wears. Living in their own module keeps the component file
|
|
4
|
+
* free of style internals (react-refresh boundary) and lets the
|
|
5
|
+
* variants/sizes maps ship as public constants (`badgeVariants` /
|
|
6
|
+
* `badgeSizes`, the shadcn `buttonVariants` precedent) for consumers
|
|
7
|
+
* composing custom elements with the same skin; split-css groups the
|
|
8
|
+
* emitted CSS into `haze-ui/css/badge.css` with them.
|
|
9
|
+
*/
|
|
10
|
+
export declare const base: import("@linaria/core").LinariaClassName;
|
|
11
|
+
export declare const variants: {
|
|
12
|
+
readonly default: import("@linaria/core").LinariaClassName;
|
|
13
|
+
readonly success: import("@linaria/core").LinariaClassName;
|
|
14
|
+
readonly warning: import("@linaria/core").LinariaClassName;
|
|
15
|
+
readonly danger: import("@linaria/core").LinariaClassName;
|
|
16
|
+
readonly info: import("@linaria/core").LinariaClassName;
|
|
17
|
+
};
|
|
18
|
+
export declare const sizes: {
|
|
19
|
+
readonly sm: import("@linaria/core").LinariaClassName;
|
|
20
|
+
readonly md: import("@linaria/core").LinariaClassName;
|
|
21
|
+
};
|
|
@@ -1,10 +1,59 @@
|
|
|
1
|
-
import type { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ReactNode, ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
/**
|
|
4
|
+
* Imperative handle exposed through the React 19 `ref` prop (same API
|
|
5
|
+
* choice as VirtualList). Unlike Dialog/Drawer there is no native close
|
|
6
|
+
* event to defer to — every exit path (overlay click, Escape, handle)
|
|
7
|
+
* runs through the same `handleClose`, so `onClose` still fires exactly
|
|
8
|
+
* once per close.
|
|
9
|
+
*/
|
|
10
|
+
type BottomSheetHandle = {
|
|
11
|
+
/** Show the sheet (Presence mounts it, focus moves in). */
|
|
12
|
+
open: () => void;
|
|
13
|
+
/** Close the sheet through the animated exit; `onClose` fires once. */
|
|
14
|
+
close: () => void;
|
|
15
|
+
/** Focus the element that held focus when the sheet last opened. */
|
|
16
|
+
focusTrigger: () => void;
|
|
17
|
+
};
|
|
3
18
|
type BottomSheetProps = {
|
|
4
19
|
open?: ControlOrValue<boolean>;
|
|
5
20
|
onClose?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* 开/关状态翻转是否包进 View Transitions API(默认 `false`,行为与
|
|
23
|
+
* 不传完全一致)。开启后每次显隐翻转都运行在
|
|
24
|
+
* `document.startViewTransition(() => flushSync(...))` 里(React 官方
|
|
25
|
+
* 要求的同步 DOM 更新模式),页面获得原生过渡;命令式 handle、
|
|
26
|
+
* Esc、遮罩点击等路径共用同一出口。引擎不支持
|
|
27
|
+
* `startViewTransition` 或用户偏好 `prefers-reduced-motion: reduce`
|
|
28
|
+
* 时自动退化为直接翻转。过渡外观由消费方的 `::view-transition-*`
|
|
29
|
+
* 样式定义,组件自身的进退场动画照常运行在新快照内。
|
|
30
|
+
*/
|
|
31
|
+
viewTransition?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 开启移动端下滑关闭手势(默认 `false`,不开启时零行为、零 DOM
|
|
34
|
+
* 差异——不挂任何 pointer 监听)。开启后 sheet 可被 pointer 拖拽
|
|
35
|
+
* 向下:拖拽实时跟随(`translateY`),松手时超过阈值(`88px` 与
|
|
36
|
+
* sheet 高度 25% 取小)走既有关闭路径(`onClose` 恰好一次,退场
|
|
37
|
+
* 动画照常从当前位置滑出),不足阈值则以 `--haze-duration-fast`
|
|
38
|
+
* 回弹。与内容滚动的冲突按 touch 惯例处理:仅当拖拽起点到 sheet
|
|
39
|
+
* 之间的滚动容器都已滚到顶部、且方向向下时才接管手势,否则让位给
|
|
40
|
+
* 原生滚动。手势本身不受 `prefers-reduced-motion` 影响(用户驱动),
|
|
41
|
+
* 只有回弹动画时长走 motion token(reduce 偏好下自动归零)。
|
|
42
|
+
*/
|
|
43
|
+
swipeToDismiss?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 开启虚拟键盘避让(默认 `false`,对标 Base UI Drawer 的
|
|
46
|
+
* VirtualKeyboardProvider)。开启后监听 `window.visualViewport` 的
|
|
47
|
+
* `resize`/`scroll`:键盘弹出(视口高度收缩/被上推)时把 sheet 上移
|
|
48
|
+
* `translateY(-inset)` 并压低最大高度,贴底的 sheet 不被键盘遮住;
|
|
49
|
+
* 当前 inset 同时以 inline 自定义属性 `--haze-sheet-kb-inset` 暴露
|
|
50
|
+
* 给消费方 CSS。环境无 `visualViewport`(SSR/jsdom)时静默降级为
|
|
51
|
+
* `dvh` 基线(`max-height: min(80dvh, 100dvh - inset)`),不抛错。
|
|
52
|
+
*/
|
|
53
|
+
virtualKeyboard?: boolean;
|
|
6
54
|
children: ReactNode;
|
|
7
55
|
className?: string;
|
|
56
|
+
ref?: Ref<BottomSheetHandle>;
|
|
8
57
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
9
|
-
export default function BottomSheet({ open: openControl, onClose, children, className, ...rest }: BottomSheetProps): import("react").JSX.Element;
|
|
10
|
-
export type { BottomSheetProps };
|
|
58
|
+
export default function BottomSheet({ open: openControl, onClose, viewTransition, swipeToDismiss, virtualKeyboard, children, className, style, ref, ...rest }: BottomSheetProps): import("react").JSX.Element;
|
|
59
|
+
export type { BottomSheetProps, BottomSheetHandle };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as BottomSheet } from './BottomSheet';
|
|
2
|
-
export type { BottomSheetProps } from './BottomSheet';
|
|
2
|
+
export type { BottomSheetProps, BottomSheetHandle } from './BottomSheet';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Component-level tokens: Button can be rethemed per-component by setting
|
|
4
|
+
* `--haze-button-*` custom properties on `:root` or any ancestor —
|
|
5
|
+
* `--haze-button-height-sm|md|lg`, `--haze-button-font-size-sm|md|lg`,
|
|
6
|
+
* `--haze-button-radius` (fallbacks and usage documented in ./styles).
|
|
7
|
+
* ButtonLink and Toggle wear the same skin and follow along.
|
|
8
|
+
*/
|
|
2
9
|
type ButtonProps = {
|
|
3
10
|
variant?: 'solid' | 'outline' | 'ghost';
|
|
4
11
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -16,6 +16,9 @@ import type { ComponentPropsWithoutRef } from 'react';
|
|
|
16
16
|
* `aria-disabled` (and `tabIndex={-1}` to drop it from the focus
|
|
17
17
|
* order) — ButtonLink styles `aria-disabled` exactly like Button's
|
|
18
18
|
* `:disabled`.
|
|
19
|
+
*
|
|
20
|
+
* Component-level theming tokens (`--haze-button-*`) apply here too —
|
|
21
|
+
* this anchor wears the exact same skin as Button (see ./styles).
|
|
19
22
|
*/
|
|
20
23
|
type ButtonLinkProps = {
|
|
21
24
|
variant?: 'solid' | 'outline' | 'ghost';
|
|
@@ -2,3 +2,4 @@ export { default as Button } from './Button';
|
|
|
2
2
|
export type { ButtonProps } from './Button';
|
|
3
3
|
export { default as ButtonLink } from './ButtonLink';
|
|
4
4
|
export type { ButtonLinkProps } from './ButtonLink';
|
|
5
|
+
export { variants as buttonVariants, sizes as buttonSizes } from './styles';
|
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
* components' visual contract in one place (one edit re-skins both) and
|
|
5
5
|
* keeps component files free of style internals; split-css groups the
|
|
6
6
|
* emitted CSS into `haze-ui/css/button.css` with them.
|
|
7
|
+
*
|
|
8
|
+
* ## Component-level tokens
|
|
9
|
+
*
|
|
10
|
+
* The skin exposes component-scoped custom properties for per-component
|
|
11
|
+
* theming. The library never *defines* them — every usage below is a
|
|
12
|
+
* fallback chain, so the shipped look is the fallback until a consumer
|
|
13
|
+
* sets the variable on `:root` or any ancestor (scoping is plain CSS
|
|
14
|
+
* inheritance: set it on a wrapper to retheme only that subtree):
|
|
15
|
+
*
|
|
16
|
+
* - `--haze-button-height-sm` / `-md` / `-lg` — height per size
|
|
17
|
+
* (fallback `auto`: content-driven, the unchanged shipped look)
|
|
18
|
+
* - `--haze-button-font-size-sm` / `-md` / `-lg` — label size per size
|
|
19
|
+
* (fallbacks `--haze-text-sm` / `--haze-text-sm` / `--haze-text-base`)
|
|
20
|
+
* - `--haze-button-radius` — corner radius (fallback `--haze-radius-md`)
|
|
21
|
+
*
|
|
22
|
+
* `Button`, `ButtonLink`, `Toggle` and the Toolbar items all wear this
|
|
23
|
+
* skin, so one variable rethemes the whole family.
|
|
7
24
|
*/
|
|
8
25
|
export declare const base: import("@linaria/core").LinariaClassName;
|
|
9
26
|
export declare const variants: {
|
|
@@ -1,21 +1,85 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
/** Granularity Calendar picks at. Each mode serializes its `value` and
|
|
4
|
+
* `onSelect` payload to a plain string: `"YYYY-MM-DD"` (date),
|
|
5
|
+
* `"YYYY-MM"` (month), `"YYYY-Qn"` with n 1–4 (quarter) or `"YYYY"`
|
|
6
|
+
* (year). */
|
|
7
|
+
type CalendarPickerMode = 'date' | 'month' | 'quarter' | 'year';
|
|
3
8
|
type CalendarProps = {
|
|
4
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Granularity the calendar picks at. `"date"` (default) renders the
|
|
11
|
+
* day grid; `"month"` a 3×4 month grid over one year; `"quarter"`
|
|
12
|
+
* a 4-quarter grid over one year; `"year"` a 12-year grid stepped a
|
|
13
|
+
* decade at a time. Values follow each mode's serialization (see
|
|
14
|
+
* {@link CalendarPickerMode}); `months`, `showWeekNumbers`,
|
|
15
|
+
* `weekStartsOn` and the range props apply to the day grid only.
|
|
16
|
+
* @default 'date'
|
|
17
|
+
*/
|
|
18
|
+
picker?: CalendarPickerMode;
|
|
19
|
+
/**
|
|
20
|
+
* Selected value as a plain string whose format follows `picker`:
|
|
21
|
+
* "YYYY-MM-DD" (date, the default), "YYYY-MM" (month), "YYYY-Qn"
|
|
22
|
+
* (quarter) or "YYYY" (year). Empty string means nothing selected.
|
|
23
|
+
*/
|
|
5
24
|
value?: ControlOrValue<string>;
|
|
6
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Earliest selectable date ("YYYY-MM-DD"). In the month/quarter/year
|
|
27
|
+
* modes a cell is disabled only when its whole period lies before
|
|
28
|
+
* `min` (the period's last day < `min`).
|
|
29
|
+
*/
|
|
7
30
|
min?: string;
|
|
8
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Latest selectable date ("YYYY-MM-DD"). In the month/quarter/year
|
|
33
|
+
* modes a cell is disabled only when its whole period lies after
|
|
34
|
+
* `max` (the period's first day > `max`).
|
|
35
|
+
*/
|
|
9
36
|
max?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Disables individual cells by predicate, alongside `min`/`max` (a
|
|
39
|
+
* cell is disabled when either hits). Called with the cell's
|
|
40
|
+
* representative date as a local-midnight `Date`: the day itself in
|
|
41
|
+
* the date mode, day 1 of the month in the month mode, day 1 of the
|
|
42
|
+
* quarter's first month in the quarter mode, January 1 in the year
|
|
43
|
+
* mode. Disabled cells render natively disabled (inert to clicks,
|
|
44
|
+
* skipped by keyboard roving).
|
|
45
|
+
*/
|
|
46
|
+
disabledDate?: (date: Date) => boolean;
|
|
10
47
|
/** BCP 47 locale used for month and weekday formatting. */
|
|
11
48
|
locale?: string;
|
|
12
49
|
/** Explicit first day of the week: 0 = Sunday, 1 = Monday. */
|
|
13
50
|
weekStartsOn?: 0 | 1;
|
|
14
51
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
52
|
+
* Render a leading ISO 8601 week-number column on every month grid
|
|
53
|
+
* (labeled "Wk" / localized via the `calendar.weekNumber` string).
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
showWeekNumbers?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Number of adjacent month grids rendered side by side. Both grids
|
|
59
|
+
* share one navigation state: prev/next, the Today button and the
|
|
60
|
+
* month quick-select move every grid together, and each grid keeps
|
|
61
|
+
* its own keyboard roving.
|
|
62
|
+
* @default 1
|
|
63
|
+
*/
|
|
64
|
+
months?: 1 | 2;
|
|
65
|
+
/**
|
|
66
|
+
* Start of a highlighted date range ("YYYY-MM-DD"), drawn as a filled
|
|
67
|
+
* endpoint on its day. Purely presentational — range picking logic
|
|
68
|
+
* stays with the caller (see DateRangePicker's dual-month panel).
|
|
69
|
+
*/
|
|
70
|
+
rangeStart?: string;
|
|
71
|
+
/**
|
|
72
|
+
* End of a highlighted date range ("YYYY-MM-DD"); together with
|
|
73
|
+
* `rangeStart` fills every day in between with a subtle background.
|
|
74
|
+
*/
|
|
75
|
+
rangeEnd?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Called with the picked value — "YYYY-MM-DD" (date), "YYYY-MM"
|
|
78
|
+
* (month), "YYYY-Qn" (quarter) or "YYYY" (year), matching `picker`.
|
|
79
|
+
* Still fires alongside the controllable `value` for callers that
|
|
80
|
+
* prefer event-style wiring.
|
|
17
81
|
*/
|
|
18
82
|
onSelect?: (date: string) => void;
|
|
19
83
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'>;
|
|
20
|
-
export default function Calendar({ value: valueControl, min, max, locale, weekStartsOn, onSelect, className, ...rest }: CalendarProps): import("react").JSX.Element;
|
|
21
|
-
export type { CalendarProps };
|
|
84
|
+
export default function Calendar({ picker, value: valueControl, min, max, disabledDate, locale, weekStartsOn, showWeekNumbers, months, rangeStart, rangeEnd, onSelect, className, ...rest }: CalendarProps): import("react").JSX.Element;
|
|
85
|
+
export type { CalendarProps, CalendarPickerMode };
|
|
@@ -59,6 +59,18 @@ export declare function getLeadingDays(year: number, month: number, weekStart: n
|
|
|
59
59
|
* added. The result length is always a multiple of 7.
|
|
60
60
|
*/
|
|
61
61
|
export declare function buildMonthCells(year: number, month: number, weekStart: number): CalendarCell[];
|
|
62
|
+
/**
|
|
63
|
+
* ISO 8601 week number of a civil date. ISO weeks run Monday–Sunday and
|
|
64
|
+
* week 1 is the week containing the year's first Thursday, so days at the
|
|
65
|
+
* year's edges borrow the neighbor year's numbering (2025-12-31 is week 1
|
|
66
|
+
* of 2026; 2027-01-01 is week 53 of 2026). The weekday is read from the
|
|
67
|
+
* local-midnight Date of the civil triple (a calendar date's weekday is a
|
|
68
|
+
* civil property, identical in every zone); the day arithmetic then moves
|
|
69
|
+
* to UTC milliseconds — whole-day multiples with no DST drift — to reach
|
|
70
|
+
* the week's Thursday, whose year is the ISO year, and counts seven-day
|
|
71
|
+
* spans from that ISO year's January 1.
|
|
72
|
+
*/
|
|
73
|
+
export declare function getISOWeekNumber(year: number, month: number, day: number): number;
|
|
62
74
|
/**
|
|
63
75
|
* Format a civil date as the `"YYYY-MM-DD"` string Calendar uses as its
|
|
64
76
|
* value. Value semantics: the string denotes the **local** civil date — it
|
|
@@ -67,6 +79,46 @@ export declare function buildMonthCells(year: number, month: number, weekStart:
|
|
|
67
79
|
* behind UTC). Pure string math; no Date construction.
|
|
68
80
|
*/
|
|
69
81
|
export declare function formatDate(year: number, month: number, day: number): string;
|
|
82
|
+
/**
|
|
83
|
+
* Format a month as the `"YYYY-MM"` string Calendar's `picker="month"`
|
|
84
|
+
* mode uses as its value. Pure string math; no Date construction.
|
|
85
|
+
*/
|
|
86
|
+
export declare function formatMonthValue(year: number, month: number): string;
|
|
87
|
+
/**
|
|
88
|
+
* Parse a `"YYYY-MM"` month-picker value (`{@link formatMonthValue}`'s
|
|
89
|
+
* inverse). Returns `null` unless the month is `01`…`12`; anything with
|
|
90
|
+
* another shape (`"2026-3"`, `"2026-03-15"`, malformed input) is rejected.
|
|
91
|
+
*/
|
|
92
|
+
export declare function parseMonthValue(value: string): {
|
|
93
|
+
year: number;
|
|
94
|
+
month: number;
|
|
95
|
+
} | null;
|
|
96
|
+
/**
|
|
97
|
+
* Format a quarter as the `"YYYY-Qn"` string Calendar's
|
|
98
|
+
* `picker="quarter"` mode uses as its value, with `quarter` 1-based
|
|
99
|
+
* (`2026` Q1 → `"2026-Q1"`).
|
|
100
|
+
*/
|
|
101
|
+
export declare function formatQuarterValue(year: number, quarter: number): string;
|
|
102
|
+
/**
|
|
103
|
+
* Parse a `"YYYY-Qn"` quarter-picker value (`{@link formatQuarterValue}`'s
|
|
104
|
+
* inverse). Returns `null` unless `n` is 1…4.
|
|
105
|
+
*/
|
|
106
|
+
export declare function parseQuarterValue(value: string): {
|
|
107
|
+
year: number;
|
|
108
|
+
quarter: number;
|
|
109
|
+
} | null;
|
|
110
|
+
/**
|
|
111
|
+
* Format a year as the `"YYYY"` string Calendar's `picker="year"` mode
|
|
112
|
+
* uses as its value.
|
|
113
|
+
*/
|
|
114
|
+
export declare function formatYearValue(year: number): string;
|
|
115
|
+
/**
|
|
116
|
+
* Parse a `"YYYY"` year-picker value (`{@link formatYearValue}`'s
|
|
117
|
+
* inverse). Returns `null` for anything that is not exactly four digits.
|
|
118
|
+
*/
|
|
119
|
+
export declare function parseYearValue(value: string): {
|
|
120
|
+
year: number;
|
|
121
|
+
} | null;
|
|
70
122
|
/**
|
|
71
123
|
* Parse a `"YYYY-MM-DD"` value string into a local-midnight Date — the
|
|
72
124
|
* inverse of {@link formatDate} and the only safe way to turn a value into
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Calendar } from './Calendar';
|
|
2
|
-
export type { CalendarProps } from './Calendar';
|
|
2
|
+
export type { CalendarProps, CalendarPickerMode } from './Calendar';
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
export type CascaderOption = {
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
value: string;
|
|
6
6
|
children?: CascaderOption[];
|
|
7
7
|
};
|
|
8
|
+
/** Metrics override for the `virtualized` columns of Cascader. */
|
|
9
|
+
type CascaderVirtualizedConfig = {
|
|
10
|
+
/**
|
|
11
|
+
* Row height in px of one column item. Defaults to 37 — the natural
|
|
12
|
+
* box of a column item: space-2 padding top+bottom + text-sm at
|
|
13
|
+
* leading-normal = 8 + 21 + 8. Virtualization math needs it as a JS
|
|
14
|
+
* number; items are stretched to fill it (`virtualRow`), so the two
|
|
15
|
+
* cannot drift apart.
|
|
16
|
+
*/
|
|
17
|
+
itemHeight?: number;
|
|
18
|
+
/** Extra rows kept mounted above/below the visible window. Defaults
|
|
19
|
+
* to VirtualList's 5. */
|
|
20
|
+
overscan?: number;
|
|
21
|
+
};
|
|
8
22
|
type CascaderProps = {
|
|
9
23
|
/** Full option tree; each level becomes one column in the drill-down panel. */
|
|
10
24
|
options: CascaderOption[];
|
|
@@ -20,7 +34,38 @@ type CascaderProps = {
|
|
|
20
34
|
changeOnSelect?: boolean;
|
|
21
35
|
/** Whether hovering a parent option expands its column; defaults to click. */
|
|
22
36
|
expandTrigger?: 'click' | 'hover';
|
|
37
|
+
/**
|
|
38
|
+
* Remote search: when set, the panel opens with a search input on top
|
|
39
|
+
* of the columns and all local option logic defers to the consumer —
|
|
40
|
+
* typing fires this callback with the raw query (empty queries
|
|
41
|
+
* included, and the reset back to `''` when the panel closes, so the
|
|
42
|
+
* consumer can restore the full tree), and the panel simply renders
|
|
43
|
+
* whatever `options` the consumer rebuilds in response. Selecting
|
|
44
|
+
* from a rebuilt tree commits the path that tree defines. Pair with
|
|
45
|
+
* `loading` for the pending state; debouncing is the consumer's
|
|
46
|
+
* concern.
|
|
47
|
+
*/
|
|
48
|
+
onSearch?: (query: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Async option state: the panel's column area shows a Spinner with
|
|
51
|
+
* `aria-busy="true"` on the panel instead of the (stale) columns
|
|
52
|
+
* until it clears. Works with or without `onSearch` (lazy root-tree
|
|
53
|
+
* loads included).
|
|
54
|
+
*/
|
|
55
|
+
loading?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Render every column through VirtualList so wide trees mount only
|
|
58
|
+
* the visible window (plus overscan) per column instead of the full
|
|
59
|
+
* DOM list. `false`/omitted (default) keeps the plain DOM path
|
|
60
|
+
* byte-for-byte; an object additionally customizes row metrics.
|
|
61
|
+
*/
|
|
62
|
+
virtualized?: boolean | CascaderVirtualizedConfig;
|
|
23
63
|
className?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Forwarded to the trigger `<button>` (not the root div) — the element
|
|
66
|
+
* form bridges and `ref.current.focus()` reach.
|
|
67
|
+
*/
|
|
68
|
+
ref?: Ref<HTMLButtonElement>;
|
|
24
69
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'onChange' | 'className'>;
|
|
25
|
-
export default function Cascader({ options, value: valueControl, onChange, placeholder, changeOnSelect, expandTrigger, className, ...rest }: CascaderProps): import("react").JSX.Element;
|
|
26
|
-
export type { CascaderProps };
|
|
70
|
+
export default function Cascader({ options, value: valueControl, onChange, placeholder, changeOnSelect, expandTrigger, onSearch, loading, virtualized, className, ref, ...rest }: CascaderProps): import("react").JSX.Element;
|
|
71
|
+
export type { CascaderProps, CascaderVirtualizedConfig };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { ChartSeries, ChartTooltipEntry, ChartTooltipPayload, ChartType } from './chart-elements';
|
|
3
|
+
type ChartProps<T> = {
|
|
4
|
+
/** Which recharts chart family to render. `pie` maps each datum to one
|
|
5
|
+
* sector named by `xKey` and valued by each series `key`. */
|
|
6
|
+
type: ChartType;
|
|
7
|
+
/** One datum per point (pie: per sector); series values are read by
|
|
8
|
+
* `ChartSeries.key`. */
|
|
9
|
+
data: T[];
|
|
10
|
+
/** The series to plot — colors cycle through the semantic status tokens
|
|
11
|
+
* when `color` is omitted. With `type='pie'` each series is one
|
|
12
|
+
* concentric ring. */
|
|
13
|
+
series: ChartSeries[];
|
|
14
|
+
/** Datum field driving the X axis (pie: naming each sector). */
|
|
15
|
+
xKey: keyof T & string;
|
|
16
|
+
/** Container height in px; the chart stretches to the full width. */
|
|
17
|
+
height?: number;
|
|
18
|
+
/** Pie only: inner radius in px (or a % string) — above 0 renders a
|
|
19
|
+
* donut. Multiple pie series band the radial space evenly; a %
|
|
20
|
+
* `innerRadius` offsets the innermost ring. Default `0`. */
|
|
21
|
+
innerRadius?: number | string;
|
|
22
|
+
/** Cartesian charts only: `vertical` swaps the axes for horizontal
|
|
23
|
+
* bars/lines (ignored by `pie`). Default `'horizontal'`. */
|
|
24
|
+
layout?: 'horizontal' | 'vertical';
|
|
25
|
+
/** Replaces the default recharts tooltip. Receives the hovered label
|
|
26
|
+
* (X value / sector name) plus one entry per series or sector. */
|
|
27
|
+
renderTooltip?: (payload: ChartTooltipPayload<T>) => ReactNode;
|
|
28
|
+
/** Renders a recharts Legend naming each series. Default `false`. */
|
|
29
|
+
showLegend?: boolean;
|
|
30
|
+
/** Renders background grid lines (cartesian charts only). Default
|
|
31
|
+
* `true`. */
|
|
32
|
+
showGrid?: boolean;
|
|
33
|
+
/** Renders a hover tooltip. Default `true`. */
|
|
34
|
+
showTooltip?: boolean;
|
|
35
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
36
|
+
/** Token-driven chart over recharts: line, area, bar or pie series
|
|
37
|
+
* rendered with haze semantic colors, axis/grid/tooltip/legend chrome
|
|
38
|
+
* toggles, and the default-omittable `series`/`xKey` mapping. recharts is
|
|
39
|
+
* an optional peer — this module's helpers import it statically, so under
|
|
40
|
+
* preserveModules only bundles that actually render Chart resolve the
|
|
41
|
+
* dependency. */
|
|
42
|
+
export default function Chart<T>({ type, data, series, xKey, height, innerRadius, layout, renderTooltip, showLegend, showGrid, showTooltip, className, style, ...rest }: ChartProps<T>): import("react").JSX.Element;
|
|
43
|
+
export type { ChartProps, ChartSeries, ChartTooltipEntry, ChartTooltipPayload, ChartType, };
|