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,34 @@
|
|
|
1
|
+
import type { ReactElement, MouseEvent } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
import type { FullscreenTarget } from '../../hooks/useFullscreen';
|
|
4
|
+
type MouseEventEventHandler = (event: MouseEvent<HTMLElement>) => void;
|
|
5
|
+
type FullscreenProps = {
|
|
6
|
+
/** Whether the target should be fullscreen — control or plain initial value. */
|
|
7
|
+
fullscreen?: ControlOrValue<boolean>;
|
|
8
|
+
/** Fires whenever the actual fullscreen state changes (toggle, Esc, …). */
|
|
9
|
+
onChange?: (fullscreen: boolean) => void;
|
|
10
|
+
/** Element (or ref) to fullscreen; defaults to the document element. */
|
|
11
|
+
target?: FullscreenTarget;
|
|
12
|
+
/** The trigger — its click toggles fullscreen. */
|
|
13
|
+
children: ReactElement<{
|
|
14
|
+
onClick?: MouseEventEventHandler;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Wrap-mode fullscreen: the single child becomes the trigger.
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Fullscreen target={boxRef}>
|
|
22
|
+
* <Button>Maximize</Button>
|
|
23
|
+
* </Fullscreen>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* The desired state (`fullscreen`) and the browser's actual state are
|
|
27
|
+
* reconciled both ways: prop writes request/exit the API, and browser-side
|
|
28
|
+
* changes (including the Esc shortcut) write back and fire `onChange`.
|
|
29
|
+
* Without the Fullscreen API the trigger stays inert instead of throwing.
|
|
30
|
+
*/
|
|
31
|
+
export default function Fullscreen({ fullscreen: fullscreenControl, onChange, target, children, }: FullscreenProps): ReactElement<{
|
|
32
|
+
onClick?: MouseEventEventHandler;
|
|
33
|
+
}, string | import("react").JSXElementConstructor<any>>;
|
|
34
|
+
export type { FullscreenProps };
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Preview overlay configuration: absent/false disables the preview; each
|
|
4
|
+
* flag opts out of one control (default enabled), mirroring antd's
|
|
5
|
+
* PreviewOperations config.
|
|
6
|
+
*/
|
|
7
|
+
type ImagePreviewConfig = {
|
|
8
|
+
zoom?: boolean;
|
|
9
|
+
rotate?: boolean;
|
|
10
|
+
};
|
|
2
11
|
type ImageProps = {
|
|
3
12
|
src: string;
|
|
4
13
|
alt: string;
|
|
5
14
|
fallback?: ReactNode;
|
|
6
15
|
aspectRatio?: string;
|
|
7
16
|
objectFit?: CSSProperties['objectFit'];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Enable the fullscreen click-to-preview overlay (default `false` —
|
|
19
|
+
* rendering and behavior are unchanged). `true` turns on every control;
|
|
20
|
+
* an object opts out per control: `zoom: false` drops the zoom
|
|
21
|
+
* buttons, wheel zoom and drag pan, `rotate: false` the rotate button.
|
|
22
|
+
*/
|
|
23
|
+
preview?: boolean | ImagePreviewConfig;
|
|
24
|
+
} & Omit<ComponentPropsWithoutRef<'img'>, 'src' | 'alt'>;
|
|
25
|
+
export default function Image({ src, alt, fallback, aspectRatio, objectFit, preview, className, style, onClick, onError, ...rest }: ImageProps): import("react").JSX.Element;
|
|
26
|
+
export type { ImageProps, ImagePreviewConfig };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
2
|
+
type ImagePreviewProps = {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
/** Shared open state — Image passes its control so both ends drive it. */
|
|
6
|
+
open?: ControlOrValue<boolean>;
|
|
7
|
+
/** Zoom buttons, wheel zoom and drag pan are available (default true). */
|
|
8
|
+
zoom?: boolean;
|
|
9
|
+
/** The rotate control is available (default true). */
|
|
10
|
+
rotate?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export default function ImagePreview({ src, alt, open: openControl, zoom, rotate, }: ImagePreviewProps): import("react").JSX.Element;
|
|
13
|
+
export type { ImagePreviewProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Image } from './Image';
|
|
2
|
-
export type { ImageProps } from './Image';
|
|
2
|
+
export type { ImageProps, ImagePreviewConfig } from './Image';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
type InlineCompletionProps = {
|
|
4
|
+
/** The remaining completion, rendered as ghost text after `value`. */
|
|
5
|
+
suggestion?: string;
|
|
6
|
+
value?: ControlOrValue<string>;
|
|
7
|
+
/** Fired after the suggestion has been accepted into `value` (Tab). */
|
|
8
|
+
onAccept?: () => void;
|
|
9
|
+
/** Fired when the active suggestion is dismissed (Escape). */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
/** Render a `<textarea>` host instead of a single-line `<input>`. */
|
|
12
|
+
multiline?: boolean;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Screen-reader hint, announced while a suggestion is active.
|
|
16
|
+
* Default from `inlineCompletion.hint` in the locale packs. */
|
|
17
|
+
hint?: string;
|
|
18
|
+
/** Visible rows of the `multiline` host. */
|
|
19
|
+
rows?: number;
|
|
20
|
+
/** Native change event passthrough — stays a native handler (Input
|
|
21
|
+
* sugar contract); the value itself leaves through the `value` control. */
|
|
22
|
+
onChange?: ComponentPropsWithoutRef<'input'>['onChange'];
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Forwarded to the host input/textarea — form bridges and
|
|
25
|
+
* `ref.current.focus()` reach the focusable element, not the wrapper. */
|
|
26
|
+
ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;
|
|
27
|
+
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'size' | 'defaultValue'>;
|
|
28
|
+
export default function InlineCompletion({ suggestion, value: valueControl, onAccept, onDismiss, multiline, placeholder, disabled, hint, rows, className, ref, onChange, onFocus, onBlur, onKeyDown, 'aria-describedby': ariaDescribedby, ...rest }: InlineCompletionProps): import("react").JSX.Element;
|
|
29
|
+
export type { InlineCompletionProps };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
type InputProps = {
|
|
4
4
|
value?: ControlOrValue<string>;
|
|
5
5
|
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
/** Forwarded to the underlying `<input>` — the element form bridges
|
|
7
|
+
* (react-f0rm `focusRef`), tests and `ref.current.focus()` reach. */
|
|
8
|
+
ref?: Ref<HTMLInputElement>;
|
|
6
9
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'size'>;
|
|
7
|
-
export default function Input({ value: valueControl, size, className, onChange, ...rest }: InputProps): import("react").JSX.Element;
|
|
10
|
+
export default function Input({ value: valueControl, size, className, onChange, ref, ...rest }: InputProps): import("react").JSX.Element;
|
|
8
11
|
export type { InputProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
type InputCoreProps = {
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
@@ -8,6 +8,8 @@ type InputCoreProps = {
|
|
|
8
8
|
onNativeChange?: ComponentPropsWithoutRef<'input'>['onChange'];
|
|
9
9
|
size?: 'sm' | 'md' | 'lg';
|
|
10
10
|
className?: string;
|
|
11
|
+
/** Forwarded to the `<input>` element. */
|
|
12
|
+
ref?: Ref<HTMLInputElement>;
|
|
11
13
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'size'>;
|
|
12
|
-
export default function InputCore({ value, onChange, onNativeChange, size, className, ...rest }: InputCoreProps): import("react").JSX.Element;
|
|
14
|
+
export default function InputCore({ value, onChange, onNativeChange, size, className, ref, ...rest }: InputCoreProps): import("react").JSX.Element;
|
|
13
15
|
export type { InputCoreProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type MoreLabelFn = (count: number) => string;
|
|
3
|
+
type JsonViewProps = {
|
|
4
|
+
/** The value to render — any JSON shape (or plain JS value). */
|
|
5
|
+
data: unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Nodes at `depth >= defaultExpandedDepth` start collapsed (the root
|
|
8
|
+
* is depth 0). Default `Infinity` — everything expanded. Collapsed
|
|
9
|
+
* state is internal UI state; toggling a node never needs a parent.
|
|
10
|
+
*/
|
|
11
|
+
defaultExpandedDepth?: number;
|
|
12
|
+
/** Opt in to the corner copy button (pretty-printed `data`). */
|
|
13
|
+
copyable?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Accessible label for the copy button. Default from
|
|
16
|
+
* `jsonView.copy` in the locale packs.
|
|
17
|
+
*/
|
|
18
|
+
copyLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Formats the "+N more" hint on truncated collections. Default
|
|
21
|
+
* derives from `jsonView.more` in the locale packs.
|
|
22
|
+
*/
|
|
23
|
+
moreLabel?: MoreLabelFn;
|
|
24
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
25
|
+
export default function JsonView({ data, defaultExpandedDepth, copyable, copyLabel, moreLabel, className, ...rest }: JsonViewProps): import("react").JSX.Element;
|
|
26
|
+
export type { JsonViewProps, MoreLabelFn };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape tags for the JSON tree renderer. `other` covers non-JSON JS
|
|
3
|
+
* values (functions, symbols, bigint, Date, RegExp) rendered as leaf
|
|
4
|
+
* text — robustness for hand-built `data`, since JSON.parse output only
|
|
5
|
+
* ever produces the first seven kinds.
|
|
6
|
+
*/
|
|
7
|
+
export type JsonValueKind = 'string' | 'number' | 'boolean' | 'null' | 'undefined' | 'array' | 'object' | 'other';
|
|
8
|
+
export declare function getJsonValueKind(value: unknown): JsonValueKind;
|
|
9
|
+
/** Entries of a branch node: `Object.entries` pairs for objects, index
|
|
10
|
+
* keys for arrays. Leaves (and empty branches) yield `[]`. */
|
|
11
|
+
export declare function jsonEntries(value: unknown): [string, unknown][];
|
|
12
|
+
/** Collections beyond this many entries render only their head plus a
|
|
13
|
+
* "+N more" hint, keeping huge API payloads cheap to render. */
|
|
14
|
+
export declare const JSON_VIEW_MAX_ENTRIES = 100;
|
|
15
|
+
export type SlicedEntries = {
|
|
16
|
+
visible: [string, unknown][];
|
|
17
|
+
hiddenCount: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function sliceEntries(entries: [string, unknown][], max: number): SlicedEntries;
|
|
20
|
+
/** Leaf display text. Strings round-trip through JSON.stringify so the
|
|
21
|
+
* quotes and any escapes render exactly as they would serialized. */
|
|
22
|
+
export declare function formatJsonLeaf(value: unknown, kind: JsonValueKind): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Direction } from '../../utils/direction';
|
|
1
2
|
import type { HazeStrings } from './locale';
|
|
2
3
|
/** String overrides keyed by component; every level is optional. */
|
|
3
4
|
type HazeStringsOverrides = {
|
|
@@ -11,6 +12,14 @@ type HazeStringsOverrides = {
|
|
|
11
12
|
type LocaleContextValue = {
|
|
12
13
|
/** BCP 47 tag; `useStrings` resolves it to a built-in string pack. */
|
|
13
14
|
locale?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Declared writing direction: an explicit `direction` prop on some
|
|
17
|
+
* provider in the chain, else derived from the resolved locale.
|
|
18
|
+
* `undefined` only when no provider is mounted. Note this is declared
|
|
19
|
+
* intent — layout truth stays the DOM's `[dir]` resolution (see
|
|
20
|
+
* `utils/direction.ts`).
|
|
21
|
+
*/
|
|
22
|
+
direction?: Direction;
|
|
14
23
|
strings?: HazeStringsOverrides;
|
|
15
24
|
parent?: LocaleContextValue;
|
|
16
25
|
};
|
|
@@ -9,8 +9,19 @@ type LocaleProviderProps = {
|
|
|
9
9
|
* of the selected pack.
|
|
10
10
|
*/
|
|
11
11
|
locale?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Declared writing direction of the subtree. Takes precedence over
|
|
14
|
+
* everything the chain would otherwise derive: an explicit value on
|
|
15
|
+
* an outer provider survives inner providers that only narrow the
|
|
16
|
+
* locale. When nobody declares one, the direction is derived from
|
|
17
|
+
* the resolved locale (Arabic, Hebrew, Persian, … → 'rtl'). The
|
|
18
|
+
* provider never writes a `dir` attribute — setting the document's
|
|
19
|
+
* direction is the app's job; this value only informs library
|
|
20
|
+
* logic that cannot read the DOM (`useDirection`).
|
|
21
|
+
*/
|
|
22
|
+
direction?: 'ltr' | 'rtl';
|
|
12
23
|
strings?: HazeStringsOverrides;
|
|
13
24
|
children: ReactNode;
|
|
14
25
|
};
|
|
15
|
-
export default function LocaleProvider({ locale, strings, children, }: LocaleProviderProps): import("react").JSX.Element;
|
|
26
|
+
export default function LocaleProvider({ locale, direction, strings, children, }: LocaleProviderProps): import("react").JSX.Element;
|
|
16
27
|
export type { LocaleProviderProps };
|
|
@@ -5,3 +5,6 @@ export type { HazeStringsOverrides } from './LocaleContext';
|
|
|
5
5
|
export { defaultStrings, enUS } from './locale';
|
|
6
6
|
export type { HazeStrings } from './locale';
|
|
7
7
|
export { zhCN } from './zh-cn';
|
|
8
|
+
export { jaJP } from './ja-jp';
|
|
9
|
+
export { createStrings } from './strings';
|
|
10
|
+
export type { DeepPartial } from './strings';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HazeStrings } from './locale';
|
|
2
|
+
/**
|
|
3
|
+
* Japanese (ja-JP) copy for every user-visible literal in the library.
|
|
4
|
+
* `LocaleProvider` selects this pack automatically for Japanese BCP 47
|
|
5
|
+
* tags ('ja', 'ja-JP', 'ja_JP', …).
|
|
6
|
+
*
|
|
7
|
+
* Keys mirror `defaultStrings` 1:1 — the `HazeStrings` annotation fails
|
|
8
|
+
* the build when either pack drifts out of sync. `{name}` placeholders
|
|
9
|
+
* must survive translation verbatim; they are expanded by
|
|
10
|
+
* `formatString` at runtime.
|
|
11
|
+
*/
|
|
12
|
+
declare const jaJP: HazeStrings;
|
|
13
|
+
export { jaJP };
|
|
@@ -29,10 +29,25 @@ declare const defaultStrings: {
|
|
|
29
29
|
previousMonth: string;
|
|
30
30
|
nextMonth: string;
|
|
31
31
|
today: string;
|
|
32
|
+
selectMonth: string;
|
|
33
|
+
selectQuarter: string;
|
|
34
|
+
selectYear: string;
|
|
35
|
+
previousYear: string;
|
|
36
|
+
nextYear: string;
|
|
37
|
+
previousDecade: string;
|
|
38
|
+
nextDecade: string;
|
|
39
|
+
weekNumber: string;
|
|
32
40
|
};
|
|
33
41
|
cascader: {
|
|
34
42
|
expand: string;
|
|
35
43
|
};
|
|
44
|
+
combobox: {
|
|
45
|
+
create: string;
|
|
46
|
+
noResults: string;
|
|
47
|
+
};
|
|
48
|
+
command: {
|
|
49
|
+
noResults: string;
|
|
50
|
+
};
|
|
36
51
|
sidebar: {
|
|
37
52
|
toggle: string;
|
|
38
53
|
expand: string;
|
|
@@ -60,6 +75,11 @@ declare const defaultStrings: {
|
|
|
60
75
|
nextSlide: string;
|
|
61
76
|
goToSlide: string;
|
|
62
77
|
};
|
|
78
|
+
chat: {
|
|
79
|
+
newMessages: string;
|
|
80
|
+
stopGeneration: string;
|
|
81
|
+
copy: string;
|
|
82
|
+
};
|
|
63
83
|
chatInput: {
|
|
64
84
|
placeholder: string;
|
|
65
85
|
send: string;
|
|
@@ -83,6 +103,22 @@ declare const defaultStrings: {
|
|
|
83
103
|
dateRangePicker: {
|
|
84
104
|
startDate: string;
|
|
85
105
|
endDate: string;
|
|
106
|
+
presetToday: string;
|
|
107
|
+
presetYesterday: string;
|
|
108
|
+
presetLast7Days: string;
|
|
109
|
+
presetLast30Days: string;
|
|
110
|
+
presetThisMonth: string;
|
|
111
|
+
presetLastMonth: string;
|
|
112
|
+
};
|
|
113
|
+
datepicker: {
|
|
114
|
+
time: string;
|
|
115
|
+
};
|
|
116
|
+
dataTable: {
|
|
117
|
+
selectAll: string;
|
|
118
|
+
filterPlaceholder: string;
|
|
119
|
+
};
|
|
120
|
+
diffViewer: {
|
|
121
|
+
header: string;
|
|
86
122
|
};
|
|
87
123
|
empty: {
|
|
88
124
|
description: string;
|
|
@@ -90,9 +126,30 @@ declare const defaultStrings: {
|
|
|
90
126
|
fileInput: {
|
|
91
127
|
label: string;
|
|
92
128
|
};
|
|
129
|
+
filePreview: {
|
|
130
|
+
remove: string;
|
|
131
|
+
retry: string;
|
|
132
|
+
uploading: string;
|
|
133
|
+
uploaded: string;
|
|
134
|
+
error: string;
|
|
135
|
+
};
|
|
136
|
+
image: {
|
|
137
|
+
zoomIn: string;
|
|
138
|
+
zoomOut: string;
|
|
139
|
+
reset: string;
|
|
140
|
+
rotate: string;
|
|
141
|
+
close: string;
|
|
142
|
+
};
|
|
93
143
|
inlineEdit: {
|
|
94
144
|
placeholder: string;
|
|
95
145
|
};
|
|
146
|
+
inlineCompletion: {
|
|
147
|
+
hint: string;
|
|
148
|
+
};
|
|
149
|
+
jsonView: {
|
|
150
|
+
copy: string;
|
|
151
|
+
more: string;
|
|
152
|
+
};
|
|
96
153
|
logViewer: {
|
|
97
154
|
all: string;
|
|
98
155
|
noLogs: string;
|
|
@@ -123,13 +180,39 @@ declare const defaultStrings: {
|
|
|
123
180
|
progress: {
|
|
124
181
|
label: string;
|
|
125
182
|
};
|
|
183
|
+
promptInput: {
|
|
184
|
+
label: string;
|
|
185
|
+
removeTag: string;
|
|
186
|
+
noMatch: string;
|
|
187
|
+
loading: string;
|
|
188
|
+
};
|
|
126
189
|
rating: {
|
|
127
190
|
star: string;
|
|
128
191
|
stars: string;
|
|
129
192
|
};
|
|
193
|
+
signature: {
|
|
194
|
+
clear: string;
|
|
195
|
+
undo: string;
|
|
196
|
+
unsupported: string;
|
|
197
|
+
};
|
|
198
|
+
select: {
|
|
199
|
+
placeholder: string;
|
|
200
|
+
listboxLabel: string;
|
|
201
|
+
clear: string;
|
|
202
|
+
searchLabel: string;
|
|
203
|
+
searchPlaceholder: string;
|
|
204
|
+
noMatch: string;
|
|
205
|
+
loading: string;
|
|
206
|
+
moreTags: string;
|
|
207
|
+
};
|
|
130
208
|
spinner: {
|
|
131
209
|
loading: string;
|
|
132
210
|
};
|
|
211
|
+
sources: {
|
|
212
|
+
label: string;
|
|
213
|
+
expand: string;
|
|
214
|
+
collapse: string;
|
|
215
|
+
};
|
|
133
216
|
tag: {
|
|
134
217
|
remove: string;
|
|
135
218
|
};
|
|
@@ -145,6 +228,12 @@ declare const defaultStrings: {
|
|
|
145
228
|
thinkingIndicator: {
|
|
146
229
|
text: string;
|
|
147
230
|
};
|
|
231
|
+
toast: {
|
|
232
|
+
loading: string;
|
|
233
|
+
success: string;
|
|
234
|
+
error: string;
|
|
235
|
+
close: string;
|
|
236
|
+
};
|
|
148
237
|
tokenCounter: {
|
|
149
238
|
label: string;
|
|
150
239
|
};
|
|
@@ -165,9 +254,20 @@ declare const defaultStrings: {
|
|
|
165
254
|
tree: {
|
|
166
255
|
expand: string;
|
|
167
256
|
collapse: string;
|
|
257
|
+
loadError: string;
|
|
258
|
+
retry: string;
|
|
259
|
+
noMatch: string;
|
|
168
260
|
};
|
|
169
261
|
upload: {
|
|
170
262
|
hint: string;
|
|
263
|
+
clickHint: string;
|
|
264
|
+
label: string;
|
|
265
|
+
retry: string;
|
|
266
|
+
cancel: string;
|
|
267
|
+
remove: string;
|
|
268
|
+
uploading: string;
|
|
269
|
+
success: string;
|
|
270
|
+
error: string;
|
|
171
271
|
};
|
|
172
272
|
};
|
|
173
273
|
export type HazeStrings = typeof defaultStrings;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HazeStrings } from './locale';
|
|
2
|
+
/**
|
|
3
|
+
* Recursive partial of a strings pack: every level is optional down to
|
|
4
|
+
* the leaf messages, so an override names exactly the copy it rewords.
|
|
5
|
+
* For the pack topology (section → message) this is structurally the
|
|
6
|
+
* provider's `HazeStringsOverrides`; the recursive form keeps it valid
|
|
7
|
+
* if a section ever grows nested groups.
|
|
8
|
+
*/
|
|
9
|
+
type DeepPartial<T> = {
|
|
10
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Deep-merges a partial override onto a base string pack, returning a
|
|
14
|
+
* complete `HazeStrings`. Consumers can derive a customized pack —
|
|
15
|
+
* "zh-CN with our terminology", "English with brand copy" — without
|
|
16
|
+
* forking the entire literal set: sections and keys the override does
|
|
17
|
+
* not name keep the base copy verbatim.
|
|
18
|
+
*
|
|
19
|
+
* Neither input is mutated and every section of the result is a fresh
|
|
20
|
+
* object, so the returned pack is safe to mutate or layer further.
|
|
21
|
+
* Built on the provider chain instead, a bare partial passed as
|
|
22
|
+
* `strings` achieves the same layering per component; `createStrings`
|
|
23
|
+
* is for when you need the resolved pack as a value (sharing it
|
|
24
|
+
* across providers, persisting it, or translating it wholesale).
|
|
25
|
+
*/
|
|
26
|
+
declare function createStrings(base: HazeStrings, overrides: DeepPartial<HazeStrings>): HazeStrings;
|
|
27
|
+
export { createStrings };
|
|
28
|
+
export type { DeepPartial };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Masonry ("Pinterest-style") column layout: children flow into N
|
|
4
|
+
* equal-width columns and stack independently, so a tall card never
|
|
5
|
+
* stretches a row of short ones.
|
|
6
|
+
*
|
|
7
|
+
* Unlike `Grid` — a uniform two-dimensional grid where cells share row
|
|
8
|
+
* alignment and each item occupies a rect of equal-height rows —
|
|
9
|
+
* Masonry aligns items to the *column* only. Nothing is row-aligned:
|
|
10
|
+
* each column is an independent flex stack.
|
|
11
|
+
*
|
|
12
|
+
* Column assignment happens in JS, not CSS multicolumn, for one reason:
|
|
13
|
+
* CSS `columns` fill vertically (column 1 top-to-bottom, then column 2),
|
|
14
|
+
* scrambling the reading order of a list. The JS pass distributes
|
|
15
|
+
* children greedily to the currently-shortest column **in source
|
|
16
|
+
* order**, so `items[0], items[1], items[2]` read left-to-right as
|
|
17
|
+
* expected. It is estimation-based (all children assumed equally tall,
|
|
18
|
+
* which degenerates to round-robin) and never measures the DOM; see
|
|
19
|
+
* ./masonry-distribute for the height-oracle upgrade path
|
|
20
|
+
* (`ResizeObserver` per item) — the distribution function already
|
|
21
|
+
* accepts per-item heights, only the measurement wiring is future work.
|
|
22
|
+
*/
|
|
23
|
+
type MasonryProps = {
|
|
24
|
+
/** Number of equal-width columns (≥ 1). Responsive breakpoints are a
|
|
25
|
+
* follow-up; wrap in a container query or render a different
|
|
26
|
+
* `columns` per breakpoint for now. */
|
|
27
|
+
columns?: number;
|
|
28
|
+
/** Vertical and horizontal gutter, as a `--haze-space-*` scale index
|
|
29
|
+
* (Grid's `gap` convention; default `4` = `--haze-space-4`). */
|
|
30
|
+
gap?: number;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
33
|
+
export default function Masonry({ columns, gap, children, className, ...rest }: MasonryProps): import("react").JSX.Element;
|
|
34
|
+
export type { MasonryProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Greedy shortest-column distribution for `Masonry`.
|
|
3
|
+
*
|
|
4
|
+
* Children are visited in source order (row-major reading preserved:
|
|
5
|
+
* item `i` lands in column `i % columns` when every estimate is equal,
|
|
6
|
+
* which is the default) and each is appended to the currently shortest
|
|
7
|
+
* column — the classic "pack the shortest stack" heuristic that keeps
|
|
8
|
+
* column heights balanced as estimates diverge.
|
|
9
|
+
*
|
|
10
|
+
* This is the estimation-based simplified pass: the height oracle
|
|
11
|
+
* defaults to a constant, so distribution is stable, SSR-safe and free
|
|
12
|
+
* of measurement. Feeding real heights (e.g. from a `ResizeObserver`
|
|
13
|
+
* over mounted items) is a drop-in extension of the same function —
|
|
14
|
+
* the component documents that upgrade path.
|
|
15
|
+
*/
|
|
16
|
+
export declare function distributeIndices(count: number, columns: number, estimateHeight?: (index: number) => number): number[][];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
import type { MentionsOption } from './MentionsCore';
|
|
4
4
|
type MentionsProps = {
|
|
@@ -12,6 +12,9 @@ type MentionsProps = {
|
|
|
12
12
|
trigger?: string;
|
|
13
13
|
placeholder?: string;
|
|
14
14
|
className?: string;
|
|
15
|
+
/** Forwarded to the underlying `<textarea>` — the element form bridges
|
|
16
|
+
* and `ref.current.focus()` reach. */
|
|
17
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
15
18
|
} & Omit<ComponentPropsWithoutRef<'textarea'>, 'value' | 'onChange' | 'placeholder' | 'className' | 'style'>;
|
|
16
|
-
export default function Mentions({ value: valueControl, onChange, ...rest }: MentionsProps): import("react").JSX.Element;
|
|
19
|
+
export default function Mentions({ value: valueControl, onChange, ref, ...rest }: MentionsProps): import("react").JSX.Element;
|
|
17
20
|
export type { MentionsProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
export type MentionsOption = {
|
|
3
3
|
/** Text inserted after the trigger character when picked. */
|
|
4
4
|
value: string;
|
|
@@ -16,6 +16,8 @@ type MentionsCoreProps = {
|
|
|
16
16
|
trigger?: string;
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
className?: string;
|
|
19
|
+
/** Forwarded to the `<textarea>` element. */
|
|
20
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
19
21
|
} & Omit<ComponentPropsWithoutRef<'textarea'>, 'value' | 'onChange' | 'placeholder' | 'className' | 'style'>;
|
|
20
|
-
export default function MentionsCore({ value, onChange, options, trigger, placeholder, className, 'aria-label': ariaLabel, ...rest }: MentionsCoreProps): import("react").JSX.Element;
|
|
22
|
+
export default function MentionsCore({ value, onChange, options, trigger, placeholder, className, 'aria-label': ariaLabel, ref, ...rest }: MentionsCoreProps): import("react").JSX.Element;
|
|
21
23
|
export type { MentionsCoreProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
type MenuSubProps = {
|
|
4
|
+
/** Whether the submenu is open — controlled control or uncontrolled initial value. */
|
|
5
|
+
open?: ControlOrValue<boolean>;
|
|
6
|
+
/** Fires on every open transition, whatever drove it (keyboard, hover, click, light dismiss). */
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** `<MenuSubTrigger>` followed by `<MenuSubContent>`. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* State container for a nested submenu inside a Menu. Wraps a
|
|
14
|
+
* MenuSubTrigger + MenuSubContent pair; the open state is controllable
|
|
15
|
+
* through the standard `ControlOrValue` prop.
|
|
16
|
+
*/
|
|
17
|
+
export default function MenuSub({ open, onOpenChange, className, children, }: MenuSubProps): import("react").JSX.Element;
|
|
18
|
+
export type { MenuSubProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type MenuSubContentProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The panel of a MenuSub submenu. Resident like the Menu panel itself
|
|
8
|
+
* (hidden through the floating lifecycle while closed); keyboard focus
|
|
9
|
+
* is contained to this level — Escape closes only this submenu.
|
|
10
|
+
*/
|
|
11
|
+
export default function MenuSubContent({ className, children, }: MenuSubContentProps): import("react").JSX.Element;
|
|
12
|
+
export type { MenuSubContentProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type MenuSubTriggerProps = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The menuitem that opens a MenuSub submenu: hover opens it after a
|
|
9
|
+
* short intent delay, click toggles, and the inline-end arrow (ArrowRight
|
|
10
|
+
* in LTR, ArrowLeft under `dir="rtl"`) opens it with focus on its first
|
|
11
|
+
* item.
|
|
12
|
+
*/
|
|
13
|
+
export default function MenuSubTrigger({ disabled, className, children, }: MenuSubTriggerProps): import("react").JSX.Element;
|
|
14
|
+
export type { MenuSubTriggerProps };
|
|
@@ -3,3 +3,9 @@ export type { MenuProps } from './Menu';
|
|
|
3
3
|
export { default as MenuItem } from './MenuItem';
|
|
4
4
|
export type { MenuItemProps } from './MenuItem';
|
|
5
5
|
export { default as MenuDivider } from './MenuDivider';
|
|
6
|
+
export { default as MenuSub } from './MenuSub';
|
|
7
|
+
export type { MenuSubProps } from './MenuSub';
|
|
8
|
+
export { default as MenuSubTrigger } from './MenuSubTrigger';
|
|
9
|
+
export type { MenuSubTriggerProps } from './MenuSubTrigger';
|
|
10
|
+
export { default as MenuSubContent } from './MenuSubContent';
|
|
11
|
+
export type { MenuSubContentProps } from './MenuSubContent';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
type NumberInputProps = {
|
|
4
4
|
value?: ControlOrValue<number>;
|
|
@@ -6,6 +6,9 @@ type NumberInputProps = {
|
|
|
6
6
|
max?: number;
|
|
7
7
|
step?: number;
|
|
8
8
|
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
/** Forwarded to the inner number `<input>` (not the wrapper div) —
|
|
10
|
+
* the element form bridges and `ref.current.focus()` reach. */
|
|
11
|
+
ref?: Ref<HTMLInputElement>;
|
|
9
12
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'size'>;
|
|
10
|
-
export default function NumberInput({ value: valueControl, min, max, step, size, className, onChange, ...rest }: NumberInputProps): import("react").JSX.Element;
|
|
13
|
+
export default function NumberInput({ value: valueControl, min, max, step, size, className, onChange, ref, ...rest }: NumberInputProps): import("react").JSX.Element;
|
|
11
14
|
export type { NumberInputProps };
|