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
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** One plotted series: `key` picks the datum field to plot, `label` names
|
|
3
|
+
* the series in the legend and tooltip (defaults to `key`), and `color`
|
|
4
|
+
* opts out of the semantic token cycle. */
|
|
5
|
+
export type ChartSeries = {
|
|
6
|
+
key: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
};
|
|
10
|
+
/** A series after Chart's label default is applied — what reaches
|
|
11
|
+
* recharts. `color` is only present when the consumer set it; the plot
|
|
12
|
+
* elements apply the semantic cycle themselves (cartesian: per series
|
|
13
|
+
* index, pie: per datum index). */
|
|
14
|
+
export type ResolvedChartSeries = {
|
|
15
|
+
key: string;
|
|
16
|
+
label: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Cartesian chart shapes; each maps onto a recharts chart container and
|
|
20
|
+
* its matching series element (see `chartElement` / `seriesElement`). */
|
|
21
|
+
export type CartesianChartType = 'line' | 'area' | 'bar';
|
|
22
|
+
/** Supported chart shapes — the cartesian families plus `pie`, where each
|
|
23
|
+
* datum is one sector named by the chart's `xKey`. */
|
|
24
|
+
export type ChartType = CartesianChartType | 'pie';
|
|
25
|
+
/** One hovered entry as handed to Chart's `renderTooltip` slot. */
|
|
26
|
+
export type ChartTooltipEntry<T = unknown> = {
|
|
27
|
+
/** Series label (cartesian) or sector name (pie). */
|
|
28
|
+
name: string;
|
|
29
|
+
/** The plotted value. */
|
|
30
|
+
value: number | string;
|
|
31
|
+
/** The series/sector color as passed to recharts (any CSS color). */
|
|
32
|
+
color: string;
|
|
33
|
+
/** The source datum the entry was plotted from. */
|
|
34
|
+
dataEntry: T;
|
|
35
|
+
};
|
|
36
|
+
/** Payload handed to Chart's `renderTooltip` slot. */
|
|
37
|
+
export type ChartTooltipPayload<T = unknown> = {
|
|
38
|
+
/** The hovered X value (cartesian) or sector name (pie). */
|
|
39
|
+
label?: unknown;
|
|
40
|
+
/** One entry per series (cartesian) or per sector (pie). */
|
|
41
|
+
entries: ChartTooltipEntry<T>[];
|
|
42
|
+
};
|
|
43
|
+
export declare const AXIS_STROKE = "var(--haze-color-border)";
|
|
44
|
+
export declare const AXIS_TICK: {
|
|
45
|
+
readonly fontSize: "var(--haze-text-sm)";
|
|
46
|
+
readonly fill: "var(--haze-color-text-secondary)";
|
|
47
|
+
};
|
|
48
|
+
export declare const TOOLTIP_STYLE: {
|
|
49
|
+
readonly fontSize: "var(--haze-text-sm)";
|
|
50
|
+
readonly color: "var(--haze-color-text)";
|
|
51
|
+
};
|
|
52
|
+
export declare const LEGEND_STYLE: {
|
|
53
|
+
readonly fontSize: "var(--haze-text-sm)";
|
|
54
|
+
};
|
|
55
|
+
/** Applies the per-series default: `label` falls back to `key`. An
|
|
56
|
+
* explicit `color` passes through untouched — the plot elements cycle
|
|
57
|
+
* `SERIES_COLOR_CYCLE` when it is omitted. */
|
|
58
|
+
export declare function resolveChartSeries(series: readonly ChartSeries[]): ResolvedChartSeries[];
|
|
59
|
+
/** The recharts series element for one resolved entry. Line and Area carry
|
|
60
|
+
* the token color as `stroke` (Area also fills with it — recharts applies
|
|
61
|
+
* its default 0.6 fill opacity), Bar carries it as `fill`. */
|
|
62
|
+
export declare function seriesElement(type: CartesianChartType, entry: ResolvedChartSeries, index?: number): ReactElement;
|
|
63
|
+
/** Radial band for pie ring `index` of `ringCount`: a single ring spans
|
|
64
|
+
* [innerRadius, 80%]; multiple rings band the radial space evenly with
|
|
65
|
+
* series 0 innermost. A percentage `innerRadius` offsets the innermost
|
|
66
|
+
* ring — a pixel value only applies to single-ring charts. */
|
|
67
|
+
export declare function pieRingRadii(index: number, ringCount: number, innerRadius: number | string): {
|
|
68
|
+
innerRadius: number | string;
|
|
69
|
+
outerRadius: string;
|
|
70
|
+
};
|
|
71
|
+
/** The recharts Pie for one resolved series: every datum is one sector
|
|
72
|
+
* named by `nameKey` and valued by the series `key`. Sector fills cycle
|
|
73
|
+
* the semantic tokens per datum unless the series pins an explicit
|
|
74
|
+
* `color`, which monochromes the whole ring. */
|
|
75
|
+
export declare function pieElement(options: {
|
|
76
|
+
entry: ResolvedChartSeries;
|
|
77
|
+
data: readonly unknown[];
|
|
78
|
+
nameKey: string;
|
|
79
|
+
ringIndex: number;
|
|
80
|
+
ringCount: number;
|
|
81
|
+
innerRadius: number | string;
|
|
82
|
+
}): ReactElement;
|
|
83
|
+
/** The recharts chart container for `type` (line → LineChart, area →
|
|
84
|
+
* AreaChart, bar → BarChart, pie → PieChart) plotting `data` with the
|
|
85
|
+
* given series children; cartesian containers carry `layout`. */
|
|
86
|
+
export declare function chartElement(type: ChartType, data: readonly unknown[], children: ReactNode, layout?: 'horizontal' | 'vertical'): ReactElement;
|
|
87
|
+
/** Wraps a `renderTooltip` slot into a recharts Tooltip `content`
|
|
88
|
+
* function, mapping recharts' payload items onto ChartTooltipEntry
|
|
89
|
+
* (name falling back to the dataKey, missing colors to ''). */
|
|
90
|
+
export declare function buildTooltipContent(render: (payload: ChartTooltipPayload) => ReactNode): (props: unknown) => ReactNode;
|
|
91
|
+
/** The full token-styled chart tree Chart renders — kept beside the pure
|
|
92
|
+
* helpers so the component module stays a single component export. */
|
|
93
|
+
export declare function chartTree(options: {
|
|
94
|
+
type: ChartType;
|
|
95
|
+
data: readonly unknown[];
|
|
96
|
+
xKey: string;
|
|
97
|
+
showGrid: boolean;
|
|
98
|
+
showTooltip: boolean;
|
|
99
|
+
showLegend: boolean;
|
|
100
|
+
series: readonly ResolvedChartSeries[];
|
|
101
|
+
layout?: 'horizontal' | 'vertical';
|
|
102
|
+
innerRadius?: number | string;
|
|
103
|
+
renderTooltip?: (payload: ChartTooltipPayload) => ReactNode;
|
|
104
|
+
}): ReactElement;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
type ChatContainerProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Follow content changes (defaults to `true`): while the reader is
|
|
6
|
+
* parked at the bottom — within ~40px — new content keeps the view
|
|
7
|
+
* glued to the newest message. Scrolling up pauses the follow (the
|
|
8
|
+
* reading position stays put), and content arriving while paused
|
|
9
|
+
* surfaces the jump pill; clicking it returns to the bottom.
|
|
10
|
+
* `false` disables all scroll management (e.g. when an inner
|
|
11
|
+
* VirtualList owns the scrollport).
|
|
12
|
+
*/
|
|
4
13
|
autoScroll?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Label of the jump pill shown when new content arrives while the
|
|
16
|
+
* reader is scrolled up. Defaults to the `chat.newMessages` string
|
|
17
|
+
* (`"New messages"` in the English pack).
|
|
18
|
+
*/
|
|
19
|
+
unreadLabel?: ReactNode;
|
|
5
20
|
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export default function ChatContainer({ children, autoScroll, className, }: ChatContainerProps): import("react").JSX.Element;
|
|
21
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
22
|
+
export default function ChatContainer({ children, autoScroll, unreadLabel, className, ...rest }: ChatContainerProps): import("react").JSX.Element;
|
|
8
23
|
export type { ChatContainerProps };
|
|
@@ -2,10 +2,20 @@ import type { ControlOrValue } from 'react-use-control';
|
|
|
2
2
|
type ChatInputProps = {
|
|
3
3
|
value?: ControlOrValue<string>;
|
|
4
4
|
onSend?: (message: string) => void;
|
|
5
|
+
/**
|
|
6
|
+
* While `true` the send button becomes a stop control: it shows the
|
|
7
|
+
* stop glyph with the `chat.stopGeneration` label, stays enabled
|
|
8
|
+
* regardless of the draft, and activating it — by click or by Enter —
|
|
9
|
+
* calls `onStop` instead of `onSend` (Enter never sends mid-generation;
|
|
10
|
+
* Shift+Enter still inserts a newline).
|
|
11
|
+
*/
|
|
12
|
+
generating?: boolean;
|
|
13
|
+
/** Called when the user requests the running generation to stop. */
|
|
14
|
+
onStop?: () => void;
|
|
5
15
|
placeholder?: string;
|
|
6
16
|
disabled?: boolean;
|
|
7
17
|
maxLength?: number;
|
|
8
18
|
className?: string;
|
|
9
19
|
};
|
|
10
|
-
export default function ChatInput({ value: valueControl, onSend, placeholder, disabled, maxLength, className, }: ChatInputProps): import("react").JSX.Element;
|
|
20
|
+
export default function ChatInput({ value: valueControl, onSend, generating, onStop, placeholder, disabled, maxLength, className, }: ChatInputProps): import("react").JSX.Element;
|
|
11
21
|
export type { ChatInputProps };
|
|
@@ -6,8 +6,20 @@ type ChatMessageProps = {
|
|
|
6
6
|
name?: ReactNode;
|
|
7
7
|
timestamp?: ReactNode;
|
|
8
8
|
status?: 'sending' | 'sent' | 'error';
|
|
9
|
+
/**
|
|
10
|
+
* Opt in to the built-in copy action: a button in the hover/focus
|
|
11
|
+
* reveal bar that copies the message's text content (the bubble's
|
|
12
|
+
* rendered text) and flips to a success glyph for 1.5s.
|
|
13
|
+
*/
|
|
14
|
+
copyable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Custom action nodes (retry, edit, branch…) rendered beside the
|
|
17
|
+
* built-in copy button. Providing `actions` alone opts the message
|
|
18
|
+
* into the reveal bar without the copy button.
|
|
19
|
+
*/
|
|
20
|
+
actions?: ReactNode;
|
|
9
21
|
children: ReactNode;
|
|
10
22
|
className?: string;
|
|
11
23
|
};
|
|
12
|
-
export default function ChatMessage({ role, avatar, name, timestamp, status, children, className, }: ChatMessageProps): import("react").JSX.Element;
|
|
24
|
+
export default function ChatMessage({ role, avatar, name, timestamp, status, copyable, actions, children, className, }: ChatMessageProps): import("react").JSX.Element;
|
|
13
25
|
export type { ChatMessageProps, ChatMessageRole };
|
|
@@ -1,8 +1,12 @@
|
|
|
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
|
type CheckboxProps = {
|
|
4
4
|
checked?: ControlOrValue<boolean>;
|
|
5
5
|
label?: ReactNode;
|
|
6
|
+
/** Forwarded to the underlying checkbox `<input>` (or through the
|
|
7
|
+
* label wrapper to it) — form bridges and `ref.current.focus()`
|
|
8
|
+
* reach. */
|
|
9
|
+
ref?: Ref<HTMLInputElement>;
|
|
6
10
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'checked' | 'type'>;
|
|
7
|
-
export default function Checkbox({ checked: checkedControl, className, label, onChange, ...rest }: CheckboxProps): import("react").JSX.Element;
|
|
11
|
+
export default function Checkbox({ checked: checkedControl, className, label, onChange, ref, ...rest }: CheckboxProps): import("react").JSX.Element;
|
|
8
12
|
export type { CheckboxProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref, ReactNode } from 'react';
|
|
2
2
|
type CheckboxCoreProps = {
|
|
3
3
|
checked: boolean;
|
|
4
4
|
onChange: (checked: boolean) => void;
|
|
@@ -7,6 +7,8 @@ type CheckboxCoreProps = {
|
|
|
7
7
|
onNativeChange?: ComponentPropsWithoutRef<'input'>['onChange'];
|
|
8
8
|
label?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
|
+
/** Forwarded to the checkbox `<input>` element. */
|
|
11
|
+
ref?: Ref<HTMLInputElement>;
|
|
10
12
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'checked' | 'onChange' | 'type'>;
|
|
11
|
-
export default function CheckboxCore({ checked, onChange, onNativeChange, className, label, ...rest }: CheckboxCoreProps): import("react").JSX.Element;
|
|
13
|
+
export default function CheckboxCore({ checked, onChange, onNativeChange, className, label, ref, ...rest }: CheckboxCoreProps): import("react").JSX.Element;
|
|
12
14
|
export type { CheckboxCoreProps };
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Pluggable syntax highlighting. Receives the raw code and language,
|
|
4
|
+
* returns an HTML fragment (`<span>`-wrapped tokens) — synchronously or as a
|
|
5
|
+
* Promise. The library ships no built-in highlighter: consumers wire up
|
|
6
|
+
* shiki, Prism, highlight.js, etc. themselves.
|
|
7
|
+
*
|
|
8
|
+
* The returned HTML is injected via `dangerouslySetInnerHTML` as-is —
|
|
9
|
+
* sanitize it or only pass trusted sources.
|
|
10
|
+
*/
|
|
11
|
+
type Highlighter = (code: string, language: string) => string | Promise<string>;
|
|
2
12
|
type CodeBlockProps = {
|
|
3
13
|
children: ReactNode;
|
|
4
14
|
language?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional highlighter for string children. Sync results render in the
|
|
17
|
+
* same commit; async results render plain text first, then swap in once
|
|
18
|
+
* the Promise settles (a rejected Promise falls back to plain text).
|
|
19
|
+
* Non-string children are rendered unhighlighted.
|
|
20
|
+
*/
|
|
21
|
+
highlight?: Highlighter;
|
|
5
22
|
className?: string;
|
|
6
23
|
};
|
|
7
|
-
export default function CodeBlock({ children, language, className }: CodeBlockProps): import("react").JSX.Element;
|
|
8
|
-
export type { CodeBlockProps };
|
|
24
|
+
export default function CodeBlock({ children, language, highlight, className }: CodeBlockProps): import("react").JSX.Element;
|
|
25
|
+
export type { CodeBlockProps, Highlighter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as CodeBlock } from './CodeBlock';
|
|
2
|
-
export type { CodeBlockProps } from './CodeBlock';
|
|
2
|
+
export type { CodeBlockProps, Highlighter } from './CodeBlock';
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
/**
|
|
4
|
+
* Semantic slot classes (AntD v6 `classNames` shape): keys map to the
|
|
5
|
+
* compound structure, consumer classes appended at the end of each
|
|
6
|
+
* part's class list (able to override component defaults). The record
|
|
7
|
+
* is declared once on the `<Collapsible>` root and reaches every
|
|
8
|
+
* sub-component through context; per-part `className` props stay
|
|
9
|
+
* available for one-off tweaks and still land after the slot class.
|
|
10
|
+
*/
|
|
11
|
+
type CollapsibleClassNames = {
|
|
12
|
+
/** The wrapper `<div>` `<Collapsible>` renders. */
|
|
13
|
+
root?: string;
|
|
14
|
+
/** The `<CollapsibleTrigger>` `<button>`. */
|
|
15
|
+
trigger?: string;
|
|
16
|
+
/** The `<CollapsibleContent>` outer `<div>` (the animated grid row). */
|
|
17
|
+
content?: string;
|
|
18
|
+
};
|
|
3
19
|
type CollapsibleProps = {
|
|
4
20
|
open?: ControlOrValue<boolean>;
|
|
5
21
|
defaultOpen?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Semantic slot classes (AntD v6 `classNames` shape): declared once
|
|
24
|
+
* here and distributed to every sub-component via context — see
|
|
25
|
+
* {@link CollapsibleClassNames}. Omitting it changes nothing.
|
|
26
|
+
*/
|
|
27
|
+
classNames?: CollapsibleClassNames;
|
|
6
28
|
children: ReactNode;
|
|
7
29
|
className?: string;
|
|
8
30
|
};
|
|
9
|
-
export declare function Collapsible({ open: openControl, defaultOpen, children, className, }: CollapsibleProps): import("react").JSX.Element;
|
|
31
|
+
export declare function Collapsible({ open: openControl, defaultOpen, classNames, children, className, }: CollapsibleProps): import("react").JSX.Element;
|
|
10
32
|
type CollapsibleTriggerProps = {
|
|
11
33
|
children: ReactNode;
|
|
12
34
|
className?: string;
|
|
@@ -17,4 +39,4 @@ type CollapsibleContentProps = {
|
|
|
17
39
|
className?: string;
|
|
18
40
|
};
|
|
19
41
|
export declare function CollapsibleContent({ children, className }: CollapsibleContentProps): import("react").JSX.Element;
|
|
20
|
-
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps };
|
|
42
|
+
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps, CollapsibleClassNames };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './Collapsible';
|
|
2
|
-
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps } from './Collapsible';
|
|
2
|
+
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps, CollapsibleClassNames } from './Collapsible';
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
1
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
2
3
|
type ColorPickerProps = {
|
|
3
4
|
value?: ControlOrValue<string>;
|
|
4
5
|
presets?: string[];
|
|
5
6
|
onChange?: (color: string) => void;
|
|
6
7
|
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Forwarded to the color swatch `<input type='color'>` (not the root
|
|
10
|
+
* div) — the element form bridges and `ref.current.focus()` reach.
|
|
11
|
+
*/
|
|
12
|
+
ref?: Ref<HTMLInputElement>;
|
|
7
13
|
};
|
|
8
|
-
export default function ColorPicker({ value: valueControl, presets, onChange, className, }: ColorPickerProps): import("react").JSX.Element;
|
|
14
|
+
export default function ColorPicker({ value: valueControl, presets, onChange, className, ref, }: ColorPickerProps): import("react").JSX.Element;
|
|
9
15
|
export type { ColorPickerProps };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
1
2
|
type ColorPickerCoreProps = {
|
|
2
3
|
value: string;
|
|
3
4
|
onChange: (value: string) => void;
|
|
4
5
|
presets?: string[];
|
|
5
6
|
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Forwarded to the color swatch `<input type='color'>` (not the root
|
|
9
|
+
* div).
|
|
10
|
+
*/
|
|
11
|
+
ref?: Ref<HTMLInputElement>;
|
|
6
12
|
};
|
|
7
|
-
export default function ColorPickerCore({ value, onChange, presets, className, }: ColorPickerCoreProps): import("react").JSX.Element;
|
|
13
|
+
export default function ColorPickerCore({ value, onChange, presets, className, ref, }: ColorPickerCoreProps): import("react").JSX.Element;
|
|
8
14
|
export type { ColorPickerCoreProps };
|
|
@@ -1,11 +1,99 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
1
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
/** Metrics override for the `virtualized` option list of Combobox. */
|
|
4
|
+
type ComboboxVirtualizedConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Row height in px of one option row. Defaults to 37 —
|
|
7
|
+
* ComboboxOption's natural box: space-2 padding top+bottom + text-sm
|
|
8
|
+
* at leading-normal = 8 + 21 + 8. Virtualization math needs it as a
|
|
9
|
+
* JS number; rows are stretched to fill it (`virtualRow`), so the two
|
|
10
|
+
* cannot drift apart.
|
|
11
|
+
*/
|
|
12
|
+
itemHeight?: number;
|
|
13
|
+
/** Extra rows kept mounted above/below the visible window. Defaults
|
|
14
|
+
* to VirtualList's 5. */
|
|
15
|
+
overscan?: number;
|
|
16
|
+
};
|
|
17
|
+
/** One entry of the `options` prop. */
|
|
18
|
+
type ComboboxOptionData = {
|
|
19
|
+
value: string;
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional group heading: consecutive options carrying the same
|
|
23
|
+
* `group` cluster into one `ComboboxGroup` section (sticky heading,
|
|
24
|
+
* `role="group"` — the cmdk shape); options without a `group` stay
|
|
25
|
+
* direct listbox children. A group whose every option was filtered
|
|
26
|
+
* out hides entirely.
|
|
27
|
+
*/
|
|
28
|
+
group?: string;
|
|
29
|
+
};
|
|
2
30
|
type ComboboxProps = {
|
|
3
|
-
|
|
31
|
+
/**
|
|
32
|
+
* `string` in single mode, `string[]` when `multiple` is set. The
|
|
33
|
+
* uncontrolled empty value is `''` in single mode, `[]` in multiple
|
|
34
|
+
* mode.
|
|
35
|
+
*/
|
|
36
|
+
value?: ControlOrValue<string | string[]>;
|
|
4
37
|
open?: ControlOrValue<boolean>;
|
|
5
|
-
options:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
38
|
+
options: ComboboxOptionData[];
|
|
39
|
+
/**
|
|
40
|
+
* Multiple-selection mode: selected values render as chips inside
|
|
41
|
+
* the trigger, Enter toggles the highlighted option without closing
|
|
42
|
+
* the panel, and Backspace on an empty query drops the most recently
|
|
43
|
+
* selected chip.
|
|
44
|
+
*/
|
|
45
|
+
multiple?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Value callback for both modes — `string` in single mode,
|
|
48
|
+
* `string[]` when `multiple` is set — fired after the value updates.
|
|
49
|
+
*/
|
|
50
|
+
onValuesChange?: (value: string | string[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Offer the current query as a creatable option: when nothing
|
|
53
|
+
* matches a non-blank query, a localized `Create "…"` row renders at
|
|
54
|
+
* the top of the list. Committing it calls `onCreate` and appends the
|
|
55
|
+
* new value to a local option set layered on top of `options` — the
|
|
56
|
+
* controlled `options` array is never mutated, and local creations
|
|
57
|
+
* are dropped when the component unmounts (re-pass `options` to own
|
|
58
|
+
* them permanently).
|
|
59
|
+
*/
|
|
60
|
+
creatable?: boolean;
|
|
61
|
+
/** Fired with the created query when the creatable row is committed. */
|
|
62
|
+
onCreate?: (query: string) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Remote search: while set, local query filtering is suspended — the
|
|
65
|
+
* list renders exactly the `options` the consumer passes — and every
|
|
66
|
+
* query transition fires this callback instead: each keystroke,
|
|
67
|
+
* clearing the input, and the resets that follow a selection (the
|
|
68
|
+
* empty query restores the full list). The consumer owns the options
|
|
69
|
+
* end to end; pair with `loading` for the pending state. Debouncing
|
|
70
|
+
* is the consumer's concern.
|
|
71
|
+
*/
|
|
72
|
+
onSearch?: (query: string) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Async-search pending state: the combobox input carries
|
|
75
|
+
* `aria-busy` and the panel shows a spinner row instead of the
|
|
76
|
+
* (stale) option list.
|
|
77
|
+
*/
|
|
78
|
+
loading?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Wrap the case-insensitive query match inside each option label in
|
|
81
|
+
* a token-styled `<mark>` (first occurrence; the label stays one
|
|
82
|
+
* text node otherwise). Off by default so the un-enabled rendering
|
|
83
|
+
* stays byte-identical; works through the virtualized path too.
|
|
84
|
+
*/
|
|
85
|
+
highlightMatches?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Custom no-results content for the empty filtered list. Defaults to
|
|
88
|
+
* the `combobox.noResults` locale string.
|
|
89
|
+
*/
|
|
90
|
+
empty?: ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* Panel max height in px: caps the plain listbox's scroll box and
|
|
93
|
+
* the virtualized scrollport alike. Defaults to 200 (the historical
|
|
94
|
+
* cap); omitted leaves the DOM untouched.
|
|
95
|
+
*/
|
|
96
|
+
maxHeight?: number;
|
|
9
97
|
placeholder?: string;
|
|
10
98
|
/**
|
|
11
99
|
* Render the dropdown through VirtualList once the filtered list is
|
|
@@ -13,7 +101,23 @@ type ComboboxProps = {
|
|
|
13
101
|
* virtualization entirely (plain DOM rendering at any length).
|
|
14
102
|
*/
|
|
15
103
|
virtualThreshold?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Explicit VirtualList override, bypassing `virtualThreshold`: `true`
|
|
106
|
+
* (or an object) always renders the list virtually — at any length,
|
|
107
|
+
* including below the threshold — while an object additionally
|
|
108
|
+
* customizes row metrics; `false` never virtualizes, even past the
|
|
109
|
+
* threshold. Omitted (default) keeps the threshold behavior
|
|
110
|
+
* untouched.
|
|
111
|
+
*/
|
|
112
|
+
virtualized?: boolean | ComboboxVirtualizedConfig;
|
|
16
113
|
className?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Forwarded to the combobox `<input>` — the focusable field in both
|
|
116
|
+
* single and multiple mode (multiple mode's chip box wraps it but is
|
|
117
|
+
* not itself the combobox) — so form bridges and
|
|
118
|
+
* `ref.current.focus()` reach.
|
|
119
|
+
*/
|
|
120
|
+
ref?: Ref<HTMLInputElement>;
|
|
17
121
|
};
|
|
18
|
-
export default function Combobox({ value: valueControl, open: openControl, options, placeholder, virtualThreshold, className, }: ComboboxProps): import("react").JSX.Element;
|
|
19
|
-
export type { ComboboxProps };
|
|
122
|
+
export default function Combobox({ value: valueControl, open: openControl, options, multiple, onValuesChange, creatable, onCreate, onSearch, loading, empty, highlightMatches, maxHeight, placeholder, virtualThreshold, virtualized: virtualizedProp, className, ref, }: ComboboxProps): import("react").JSX.Element;
|
|
123
|
+
export type { ComboboxProps, ComboboxVirtualizedConfig, ComboboxOptionData };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type ComboboxGroupProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Heading rendered above the group's options. Sticky while the
|
|
5
|
+
* listbox scrolls: pinned to the scrollport top until the next
|
|
6
|
+
* group's heading pushes past it (cmdk's form).
|
|
7
|
+
*/
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
/** The group's `role="option"` rows. */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* One labelled section of combobox options: `role="group"` named by
|
|
15
|
+
* its heading (`aria-labelledby`), the cmdk `CommandGroup` shape.
|
|
16
|
+
* Combobox clusters consecutive options sharing a `group` label into
|
|
17
|
+
* one section; groups whose every option was filtered out are not
|
|
18
|
+
* rendered at all, and keyboard navigation stays continuous across
|
|
19
|
+
* sections (the highlight lives in the flat option order).
|
|
20
|
+
*/
|
|
21
|
+
export default function ComboboxGroup({ label, className, children, }: ComboboxGroupProps): import("react").JSX.Element;
|
|
22
|
+
export type { ComboboxGroupProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
type ComboboxOptionProps = {
|
|
3
3
|
value: string;
|
|
4
4
|
highlighted?: boolean;
|
|
@@ -8,6 +8,11 @@ type ComboboxOptionProps = {
|
|
|
8
8
|
* aria-activedescendant while the row holds the keyboard highlight.
|
|
9
9
|
*/
|
|
10
10
|
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Ref to the row element (React 19 ref-as-prop). Combobox points it
|
|
13
|
+
* at the keyboard-highlighted row to keep it scrolled into view.
|
|
14
|
+
*/
|
|
15
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
16
|
/**
|
|
12
17
|
* Size of the whole option set, per aria-setsize. Must count every
|
|
13
18
|
* option, not just the rows a windowed (virtualized) list mounted.
|
|
@@ -19,5 +24,5 @@ type ComboboxOptionProps = {
|
|
|
19
24
|
className?: string;
|
|
20
25
|
children: ReactNode;
|
|
21
26
|
};
|
|
22
|
-
export default function ComboboxOption({ value, highlighted, selected, id, setSize, posInSet, onSelect, className, children, }: ComboboxOptionProps): import("react").JSX.Element;
|
|
27
|
+
export default function ComboboxOption({ value, highlighted, selected, id, ref, setSize, posInSet, onSelect, className, children, }: ComboboxOptionProps): import("react").JSX.Element;
|
|
23
28
|
export type { ComboboxOptionProps };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as Combobox } from './Combobox';
|
|
2
|
-
export type { ComboboxProps } from './Combobox';
|
|
2
|
+
export type { ComboboxProps, ComboboxVirtualizedConfig, ComboboxOptionData } from './Combobox';
|
|
3
3
|
export { default as ComboboxOption } from './ComboboxOption';
|
|
4
4
|
export type { ComboboxOptionProps } from './ComboboxOption';
|
|
5
|
+
export { default as ComboboxGroup } from './ComboboxGroup';
|
|
6
|
+
export type { ComboboxGroupProps } from './ComboboxGroup';
|
|
@@ -1,25 +1,89 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
type CommandProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The palette's search query (controlled `Control<string>` or plain
|
|
6
|
+
* uncontrolled initial value). Drives built-in filtering and is
|
|
7
|
+
* writable through `CommandInput`; consumers may also drive it
|
|
8
|
+
* themselves — filtering only reads the value.
|
|
9
|
+
*/
|
|
4
10
|
query?: ControlOrValue<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Whether items filter themselves against `query` (case-insensitive
|
|
13
|
+
* substring over the item's `value`/children text and `keywords`).
|
|
14
|
+
* Default `true` — the palette's historical behavior; pass `false`
|
|
15
|
+
* when the consumer filters externally (e.g. server-side search).
|
|
16
|
+
*/
|
|
17
|
+
shouldFilter?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Palette-level select hook: invoked after any item's own `onSelect`
|
|
20
|
+
* when it activates (click or Enter/Space). The composition channel
|
|
21
|
+
* `CommandDialog` uses to close itself on selection; on a bare
|
|
22
|
+
* `Command` it is a convenient place for logging/focus handoff.
|
|
23
|
+
*/
|
|
24
|
+
onItemSelect?: () => void;
|
|
5
25
|
children: ReactNode;
|
|
6
26
|
className?: string;
|
|
7
27
|
};
|
|
8
|
-
export default function Command({ query: queryControl, children, className }: CommandProps): import("react").JSX.Element;
|
|
28
|
+
export default function Command({ query: queryControl, shouldFilter, onItemSelect, children, className, }: CommandProps): import("react").JSX.Element;
|
|
9
29
|
type CommandInputProps = {
|
|
10
30
|
placeholder?: string;
|
|
11
31
|
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Ref to the underlying `<input>` — the palette's focusable element
|
|
34
|
+
* (Wave 1 ref-channel convention); `CommandDialog` uses it to focus
|
|
35
|
+
* the input on open.
|
|
36
|
+
*/
|
|
37
|
+
ref?: Ref<HTMLInputElement>;
|
|
12
38
|
};
|
|
13
|
-
export declare function CommandInput({ placeholder, className }: CommandInputProps): import("react").JSX.Element;
|
|
39
|
+
export declare function CommandInput({ placeholder, className, ref }: CommandInputProps): import("react").JSX.Element;
|
|
14
40
|
type CommandListProps = {
|
|
15
41
|
children: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Custom no-results content for the empty filtered list. Defaults to
|
|
44
|
+
* the `command.noResults` locale string.
|
|
45
|
+
*/
|
|
46
|
+
empty?: ReactNode;
|
|
16
47
|
className?: string;
|
|
17
48
|
};
|
|
18
|
-
export declare function CommandList({ children, className }: CommandListProps): import("react").JSX.Element;
|
|
49
|
+
export declare function CommandList({ children, empty, className }: CommandListProps): import("react").JSX.Element;
|
|
50
|
+
type CommandGroupProps = {
|
|
51
|
+
/**
|
|
52
|
+
* Heading rendered above the group's items. Sticky while the list
|
|
53
|
+
* scrolls: pinned to the scrollport top until the next group's
|
|
54
|
+
* heading pushes past it (the cmdk shape). Optional — a group may
|
|
55
|
+
* exist purely to opt its items into empty-group hiding.
|
|
56
|
+
*/
|
|
57
|
+
heading?: ReactNode;
|
|
58
|
+
className?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The group's `CommandItem` rows (and any wrappers around them).
|
|
61
|
+
* Optional — a childless group renders nothing (the empty-group
|
|
62
|
+
* hiding contract covers zero-item groups too).
|
|
63
|
+
*/
|
|
64
|
+
children?: ReactNode;
|
|
65
|
+
};
|
|
66
|
+
export declare function CommandGroup({ heading, children, className }: CommandGroupProps): import("react").JSX.Element | null;
|
|
19
67
|
type CommandItemProps = {
|
|
20
68
|
children: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Explicit filter target. Defaults to the concatenated text of the
|
|
71
|
+
* item's children (icons and wrappers are walked transparently).
|
|
72
|
+
*/
|
|
73
|
+
value?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Extra filter targets that should surface the item even when its
|
|
76
|
+
* displayed text misses the query (e.g. synonyms, aliases).
|
|
77
|
+
*/
|
|
78
|
+
keywords?: readonly string[];
|
|
79
|
+
/**
|
|
80
|
+
* Shortcut hint rendered as a `Kbd` badge on the item's inline end —
|
|
81
|
+
* purely decorative, the binding itself belongs to the consumer
|
|
82
|
+
* (e.g. `useHotkeys`).
|
|
83
|
+
*/
|
|
84
|
+
shortcut?: string;
|
|
21
85
|
className?: string;
|
|
22
86
|
onSelect?: () => void;
|
|
23
87
|
};
|
|
24
|
-
export declare function CommandItem({ children, className, onSelect }: CommandItemProps): import("react").JSX.Element | null;
|
|
25
|
-
export type { CommandProps, CommandInputProps, CommandListProps, CommandItemProps };
|
|
88
|
+
export declare function CommandItem({ children, value, keywords, shortcut, className, onSelect, }: CommandItemProps): import("react").JSX.Element | null;
|
|
89
|
+
export type { CommandProps, CommandInputProps, CommandListProps, CommandGroupProps, CommandItemProps, };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
type CommandDialogProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the palette dialog is open (controlled `Control<boolean>`
|
|
6
|
+
* or plain uncontrolled initial value).
|
|
7
|
+
*/
|
|
8
|
+
open?: ControlOrValue<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* Called whenever the open state changes through user interaction —
|
|
11
|
+
* the `hotkey` toggle, selecting an item, Esc or backdrop close.
|
|
12
|
+
*/
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Global shortcut that toggles the palette, e.g. `'mod+k'` (macOS ⌘K,
|
|
16
|
+
* elsewhere Ctrl+K; comma-joined aliases and full `useHotkeys` spec
|
|
17
|
+
* syntax apply). Unset — the default — registers no listener at all.
|
|
18
|
+
* The binding fires even while focus is inside an input: palette
|
|
19
|
+
* chords never collide with plain typing.
|
|
20
|
+
*/
|
|
21
|
+
hotkey?: string;
|
|
22
|
+
/** Dialog title, rendered as the palette's accessible name (`h2`). */
|
|
23
|
+
title?: ReactNode;
|
|
24
|
+
/** Placeholder of the palette's search input. */
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Palette body below the input — `CommandList` (with `CommandGroup` /
|
|
28
|
+
* `CommandItem` rows). Selecting any item closes the palette; wire
|
|
29
|
+
* per-item behavior through `CommandItem`'s `onSelect`, which runs
|
|
30
|
+
* before the close.
|
|
31
|
+
*/
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
};
|
|
35
|
+
export default function CommandDialog({ open: openControl, onOpenChange, hotkey: hotkeySpec, title, placeholder, children, className, }: CommandDialogProps): import("react").JSX.Element;
|
|
36
|
+
export type { CommandDialogProps };
|