haze-ui 1.29.0 → 1.31.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 +93 -1
- package/cli/theme.mjs +446 -0
- package/dist/components/Accordion/Accordion.js +1 -0
- package/dist/components/Accordion/AccordionItem.js +3 -0
- package/dist/components/ActivityRail/ActivityRail.js +76 -0
- package/dist/components/ActivityRail/index.js +3 -0
- package/dist/components/Affix/Affix.js +1 -0
- package/dist/components/Alert/Alert.js +3 -0
- package/dist/components/Anchor/Anchor.js +21 -15
- package/dist/components/AppShell/AppShell.js +5 -0
- package/dist/components/ApprovalCard/ApprovalCard.js +8 -0
- package/dist/components/AspectRatio/AspectRatio.js +2 -0
- package/dist/components/AsyncSection/AsyncSection.js +8 -0
- package/dist/components/Avatar/Avatar.js +11 -6
- package/dist/components/AvatarGroup/AvatarGroup.js +9 -6
- package/dist/components/BackToTop/BackToTop.js +5 -4
- package/dist/components/Badge/Badge.js +1 -0
- package/dist/components/Banner/Banner.js +3 -0
- package/dist/components/BottomSheet/BottomSheet.js +22 -31
- package/dist/components/Breadcrumb/Breadcrumb.js +11 -7
- package/dist/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/dist/components/Button/Button.js +13 -11
- package/dist/components/Button/ButtonLink.js +15 -13
- package/dist/components/Calendar/Calendar.js +523 -368
- package/dist/components/Calendar/date.js +35 -10
- package/dist/components/Card/Card.js +1 -0
- package/dist/components/Carousel/Carousel.js +157 -60
- package/dist/components/Carousel/CarouselSlide.js +3 -1
- package/dist/components/Cascader/Cascader.js +48 -35
- package/dist/components/Chart/Chart.js +5 -4
- package/dist/components/Chart/chart-elements.js +14 -10
- package/dist/components/ChatContainer/ChatContainer.js +9 -7
- package/dist/components/ChatInput/ChatInput.js +12 -9
- package/dist/components/ChatMessage/ChatMessage.js +83 -44
- package/dist/components/Checkbox/CheckboxCore.js +2 -0
- package/dist/components/Chip/Chip.js +3 -0
- package/dist/components/CodeBlock/CodeBlock.js +18 -9
- package/dist/components/Collapsible/Collapsible.js +24 -21
- package/dist/components/ColorPicker/ColorPicker.js +85 -14
- package/dist/components/ColorPicker/ColorPickerCore.js +6 -0
- package/dist/components/ColorPicker/ColorPickerPanel.js +277 -0
- package/dist/components/ColorPicker/color-math.js +168 -0
- package/dist/components/ColorPicker/color-picker-styles.js +7 -0
- package/dist/components/ColorPicker/index.js +3 -3
- package/dist/components/Combobox/Combobox.js +31 -24
- package/dist/components/Combobox/ComboboxGroup.js +7 -5
- package/dist/components/Combobox/ComboboxOption.js +1 -0
- package/dist/components/Command/Command.js +44 -37
- package/dist/components/Command/CommandDialog.js +8 -8
- package/dist/components/ConfigProvider/ConfigContext.js +30 -0
- package/dist/components/ConfigProvider/ConfigProvider.js +14 -0
- package/dist/components/ConfigProvider/index.js +4 -0
- package/dist/components/ConfigProvider/useConfigDefaults.js +10 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.js +18 -11
- package/dist/components/Container/Container.js +1 -0
- package/dist/components/ContextMenu/ContextMenu.js +7 -6
- package/dist/components/ContextMenu/ContextMenuContent.js +4 -4
- package/dist/components/ContextMenu/ContextMenuItem.js +1 -0
- package/dist/components/ContextMenu/ContextMenuSeparator.js +1 -0
- package/dist/components/ContextMenu/ContextMenuTrigger.js +1 -0
- package/dist/components/ConversationList/ConversationItem.js +4 -0
- package/dist/components/ConversationList/ConversationList.js +17 -7
- package/dist/components/CountUp/CountUp.js +6 -5
- package/dist/components/DataTable/CellEditor.js +4 -4
- package/dist/components/DataTable/DataTable.js +236 -168
- package/dist/components/DateRangePicker/DateRangePickerCore.js +9 -0
- package/dist/components/Datepicker/Datepicker.js +14 -11
- package/dist/components/Datepicker/DatepickerCore.js +75 -60
- package/dist/components/Datepicker/datetime.js +14 -3
- package/dist/components/Descriptions/Descriptions.js +6 -0
- package/dist/components/Dialog/Dialog.js +13 -11
- package/dist/components/DiffViewer/DiffViewer.js +22 -13
- package/dist/components/Disclosure/Disclosure.js +10 -7
- package/dist/components/Divider/Divider.js +2 -0
- package/dist/components/Drawer/Drawer.js +10 -9
- package/dist/components/DropdownMenu/DropdownMenu.js +58 -35
- package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.js +63 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.js +5 -5
- package/dist/components/DropdownMenu/DropdownMenuGroup.js +26 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.js +29 -10
- package/dist/components/DropdownMenu/DropdownMenuRadioGroup.js +30 -0
- package/dist/components/DropdownMenu/DropdownMenuRadioItem.js +59 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuSub.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuSubTrigger.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuTrigger.js +1 -0
- package/dist/components/DropdownMenu/dropdown-menu-item-styles.js +7 -0
- package/dist/components/DropdownMenu/index.js +12 -8
- package/dist/components/Ellipsis/Ellipsis.js +11 -8
- package/dist/components/Empty/Empty.js +4 -0
- package/dist/components/FileInput/FileInput.js +7 -5
- package/dist/components/FilePreview/FilePreview.js +19 -1
- package/dist/components/Flex/Flex.js +1 -0
- package/dist/components/FloatButton/FloatButton.js +4 -0
- package/dist/components/FloatButton/FloatButtonGroup.js +18 -13
- package/dist/components/Fullscreen/Fullscreen.js +6 -3
- package/dist/components/Grid/Grid.js +12 -7
- package/dist/components/Grid/GridItem.js +17 -7
- package/dist/components/Grid/grid-item-styles.js +58 -0
- package/dist/components/HoverCard/HoverCard.js +46 -43
- package/dist/components/Icon/Icon.js +1 -0
- package/dist/components/Image/Image.js +10 -7
- package/dist/components/Image/ImagePreview.js +42 -34
- package/dist/components/InlineCompletion/InlineCompletion.js +15 -11
- package/dist/components/InlineEdit/InlineEdit.js +8 -6
- package/dist/components/Input/InputCore.js +1 -0
- package/dist/components/JsonView/JsonView.js +104 -79
- package/dist/components/Kbd/Kbd.js +1 -0
- package/dist/components/List/List.js +15 -10
- package/dist/components/List/ListItem.js +1 -0
- package/dist/components/LocaleProvider/LocaleProvider.js +4 -4
- package/dist/components/LocaleProvider/ar-sa.js +31 -2
- package/dist/components/LocaleProvider/de-de.js +31 -2
- package/dist/components/LocaleProvider/es-es.js +31 -2
- package/dist/components/LocaleProvider/fr-fr.js +31 -2
- package/dist/components/LocaleProvider/it-it.js +31 -2
- package/dist/components/LocaleProvider/ja-jp.js +31 -2
- package/dist/components/LocaleProvider/ko-kr.js +31 -2
- package/dist/components/LocaleProvider/locale.js +31 -2
- package/dist/components/LocaleProvider/pt-br.js +31 -2
- package/dist/components/LocaleProvider/ru-ru.js +31 -2
- package/dist/components/LocaleProvider/zh-cn.js +31 -2
- package/dist/components/LogViewer/LogViewer.js +56 -38
- package/dist/components/MarkdownRenderer/MarkdownRenderer.js +6 -5
- package/dist/components/MarkdownRenderer/markdown-blocks.js +1 -1
- package/dist/components/Masonry/Masonry.js +13 -10
- package/dist/components/Mentions/MentionsCore.js +15 -11
- package/dist/components/Menu/Menu.js +58 -36
- package/dist/components/Menu/MenuCheckboxItem.js +63 -0
- package/dist/components/Menu/MenuDivider.js +1 -0
- package/dist/components/Menu/MenuGroup.js +26 -0
- package/dist/components/Menu/MenuItem.js +28 -9
- package/dist/components/Menu/MenuRadioGroup.js +30 -0
- package/dist/components/Menu/MenuRadioItem.js +59 -0
- package/dist/components/Menu/MenuSub.js +1 -0
- package/dist/components/Menu/MenuSubTrigger.js +1 -0
- package/dist/components/Menu/index.js +11 -7
- package/dist/components/Menu/menu-item-styles.js +7 -0
- package/dist/components/ModelPicker/ModelPicker.js +3 -0
- package/dist/components/NavigationBar/NavLink.js +7 -6
- package/dist/components/NavigationBar/NavigationBar.js +4 -0
- package/dist/components/NumberInput/NumberInputCore.js +4 -0
- package/dist/components/OTPInput/OTPInputCore.js +10 -7
- package/dist/components/Pagination/Pagination.js +125 -33
- package/dist/components/PasswordInput/PasswordInputCore.js +9 -6
- package/dist/components/Popover/Popover.js +9 -7
- package/dist/components/Progress/Progress.js +5 -0
- package/dist/components/PromptInput/PromptInput.js +49 -41
- package/dist/components/QRCode/QRCode.js +9 -7
- package/dist/components/Radio/Radio.js +2 -0
- package/dist/components/Radio/RadioGroupCore.js +7 -6
- package/dist/components/Rating/RatingCore.js +18 -15
- package/dist/components/Resizable/Resizable.js +269 -36
- package/dist/components/Result/Result.js +5 -0
- package/dist/components/ScrollArea/ScrollArea.js +1 -0
- package/dist/components/Segmented/SegmentedCore.js +9 -7
- package/dist/components/Select/Option.js +1 -0
- package/dist/components/Select/OptionGroup.js +1 -0
- package/dist/components/Select/SelectCore.js +11 -8
- package/dist/components/Select/SelectFloating.js +54 -36
- package/dist/components/Sidebar/Sidebar.js +52 -42
- package/dist/components/Signature/Signature.js +101 -91
- package/dist/components/Skeleton/Skeleton.js +1 -0
- package/dist/components/Slider/SliderCore.js +149 -43
- package/dist/components/Sources/Sources.js +31 -21
- package/dist/components/Sparkline/Sparkline.js +45 -0
- package/dist/components/Sparkline/index.js +3 -0
- package/dist/components/Sparkline/sparkline-styles.js +18 -0
- package/dist/components/Spinner/Spinner.js +1 -0
- package/dist/components/Stat/Stat.js +7 -0
- package/dist/components/StatusBar/StatusBar.js +47 -0
- package/dist/components/StatusBar/index.js +3 -0
- package/dist/components/StepTimeline/StepTimeline.js +6 -0
- package/dist/components/Stepper/Step.js +8 -1
- package/dist/components/Stepper/Stepper.js +7 -6
- package/dist/components/StreamingText/StreamingText.js +62 -29
- package/dist/components/SwipeAction/SwipeAction.js +11 -9
- package/dist/components/Switch/SwitchCore.js +9 -5
- package/dist/components/TabBar/TabBar.js +60 -0
- package/dist/components/TabBar/index.js +3 -0
- package/dist/components/Table/Table.js +2 -0
- package/dist/components/Table/TableBody.js +1 -0
- package/dist/components/Table/TableCell.js +1 -0
- package/dist/components/Table/TableHead.js +1 -0
- package/dist/components/Table/TableRow.js +1 -0
- package/dist/components/Tabs/SortableTabList.js +116 -0
- package/dist/components/Tabs/Tab.js +84 -16
- package/dist/components/Tabs/TabList.js +94 -37
- package/dist/components/Tabs/TabPanel.js +1 -0
- package/dist/components/Tabs/Tabs.js +1 -0
- package/dist/components/Tabs/edge-scroll.js +6 -0
- package/dist/components/Tabs/index.js +4 -3
- package/dist/components/Tabs/tab-metas.js +24 -0
- package/dist/components/Tag/Tag.js +2 -0
- package/dist/components/TagGroup/SortableTagGroup.js +7 -6
- package/dist/components/TagGroup/TagGroup.js +1 -0
- package/dist/components/TagGroup/TagGroupItem.js +3 -0
- package/dist/components/TagInput/SortableTagInputCore.js +16 -13
- package/dist/components/TagInput/TagInputCore.js +17 -12
- package/dist/components/Textarea/TextareaCore.js +1 -0
- package/dist/components/ThinkingIndicator/ThinkingIndicator.js +18 -4
- package/dist/components/TimePicker/TimePicker.js +30 -14
- package/dist/components/TimePicker/TimePickerCore.js +1 -0
- package/dist/components/TimePicker/TimePickerPanel.js +260 -0
- package/dist/components/TimePicker/time-picker-styles.js +7 -0
- package/dist/components/TimePicker/time.js +51 -0
- package/dist/components/Timeline/Timeline.js +14 -1
- package/dist/components/Toast/Toast.js +94 -48
- package/dist/components/Toast/ToastContainer.js +60 -56
- package/dist/components/Toast/ToastContext.js +3 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/{toast2.js → toast-channel.js} +21 -15
- package/dist/components/Toast/useToast.js +36 -11
- package/dist/components/Toggle/ToggleCore.js +1 -0
- package/dist/components/TokenCounter/TokenCounter.js +8 -1
- package/dist/components/ToolCallCard/ToolCallCard.js +18 -2
- package/dist/components/Toolbar/Toolbar.js +9 -8
- package/dist/components/Toolbar/ToolbarButton.js +1 -0
- package/dist/components/Toolbar/ToolbarSeparator.js +1 -0
- package/dist/components/Toolbar/ToolbarToggle.js +1 -0
- package/dist/components/Tooltip/Tooltip.js +46 -42
- package/dist/components/Tour/Tour.js +76 -65
- package/dist/components/Transfer/TransferCore.js +31 -17
- package/dist/components/Tree/SortableTree.js +151 -0
- package/dist/components/Tree/Tree.js +163 -154
- package/dist/components/Tree/TreeItem.js +52 -39
- package/dist/components/Tree/index.js +2 -1
- package/dist/components/Tree/sortable-tree-styles.js +7 -0
- package/dist/components/Tree/sortable-tree-utils.js +36 -0
- package/dist/components/TreeSelect/TreeSelect.js +44 -34
- package/dist/components/Typography/Typography.js +3 -0
- package/dist/components/Upload/Upload.js +12 -11
- package/dist/components/Upload/UploadCore.js +92 -65
- package/dist/components/Upload/UploadList.js +177 -105
- package/dist/components/VirtualList/VirtualList.js +239 -122
- package/dist/components/Watermark/Watermark.js +8 -6
- package/dist/components/Workbench/Workbench.js +144 -0
- package/dist/components/Workbench/index.js +3 -0
- package/dist/css/accordion.css +1 -1
- package/dist/css/activity-rail.css +2 -0
- package/dist/css/alert.css +1 -1
- package/dist/css/app-shell.css +1 -1
- package/dist/css/async-section.css +1 -1
- package/dist/css/banner.css +1 -1
- package/dist/css/bottom-sheet.css +1 -1
- package/dist/css/breadcrumb.css +1 -1
- package/dist/css/button.css +2 -2
- package/dist/css/calendar.css +1 -1
- package/dist/css/carousel.css +1 -1
- package/dist/css/chat-message.css +1 -1
- package/dist/css/checkbox.css +1 -1
- package/dist/css/color-picker.css +2 -0
- package/dist/css/combobox.css +2 -2
- package/dist/css/command.css +1 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/date-range-picker.css +1 -1
- package/dist/css/dialog.css +1 -1
- package/dist/css/drawer.css +1 -1
- package/dist/css/dropdown-menu.css +7 -2
- package/dist/css/form.css +1 -1
- package/dist/css/grid.css +2 -1
- package/dist/css/hover-card.css +1 -1
- package/dist/css/input.css +1 -1
- package/dist/css/list.css +1 -1
- package/dist/css/menu.css +9 -4
- package/dist/css/pagination.css +1 -1
- package/dist/css/popover.css +1 -1
- package/dist/css/progress.css +1 -1
- package/dist/css/radio.css +1 -1
- package/dist/css/rating.css +1 -1
- package/dist/css/resizable.css +1 -1
- package/dist/css/segmented.css +1 -1
- package/dist/css/sidebar.css +1 -1
- package/dist/css/skeleton.css +1 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/sparkline.css +2 -0
- package/dist/css/spinner.css +1 -1
- package/dist/css/status-bar.css +2 -0
- package/dist/css/stepper.css +1 -1
- package/dist/css/streaming-text.css +1 -1
- package/dist/css/switch.css +1 -1
- package/dist/css/tab-bar.css +2 -0
- package/dist/css/tabs.css +3 -2
- package/dist/css/tag.css +1 -1
- package/dist/css/textarea.css +1 -1
- package/dist/css/thinking-indicator.css +1 -1
- package/dist/css/time-picker.css +1 -0
- package/dist/css/toast.css +1 -1
- package/dist/css/toggle.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree.css +2 -1
- package/dist/css/upload.css +1 -1
- package/dist/css/virtual-list.css +1 -1
- package/dist/css/workbench.css +2 -0
- package/dist/css-manifest.json +38 -0
- package/dist/dates/adapter.js +21 -0
- package/dist/dates/buddhist.js +43 -0
- package/dist/dates/ethiopic.js +67 -0
- package/dist/dates/gregory.js +44 -0
- package/dist/dates/hebrew.js +95 -0
- package/dist/dates/islamic.js +87 -0
- package/dist/dates/japanese.js +41 -0
- package/dist/dates/persian.js +121 -0
- package/dist/dates/registry.js +23 -0
- package/dist/dates/timezone.js +29 -0
- package/dist/design-tokens/cyan-dark.json +355 -0
- package/dist/design-tokens/cyan-light.json +355 -0
- package/dist/design-tokens/orange-dark.json +355 -0
- package/dist/design-tokens/orange-light.json +355 -0
- package/dist/design-tokens/rose-dark.json +355 -0
- package/dist/design-tokens/rose-light.json +355 -0
- package/dist/design-tokens/teal-dark.json +355 -0
- package/dist/design-tokens/teal-light.json +355 -0
- package/dist/design-tokens/violet-dark.json +355 -0
- package/dist/design-tokens/violet-light.json +355 -0
- package/dist/form/FormItem.js +71 -63
- package/dist/form/FormList.js +6 -6
- package/dist/form/form-item-styles.js +7 -0
- package/dist/haze-ui.css +78 -57
- package/dist/index.js +261 -232
- package/dist/mcp-docs.json +1587 -113
- package/dist/registry.json +132 -22
- package/dist/tokens/index.js +7 -7
- package/dist/tokens/motion.js +9 -2
- package/dist/tokens/palette.js +244 -84
- package/dist/tokens/registry.js +18 -22
- package/dist/types/components/ActivityRail/ActivityRail.d.ts +30 -0
- package/dist/types/components/ActivityRail/index.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Calendar/Calendar.d.ts +39 -14
- package/dist/types/components/Calendar/date.d.ts +51 -0
- package/dist/types/components/Calendar/index.d.ts +1 -1
- package/dist/types/components/Carousel/Carousel.d.ts +5 -1
- package/dist/types/components/Carousel/CarouselSlide.d.ts +3 -3
- package/dist/types/components/Chart/Chart.d.ts +13 -6
- package/dist/types/components/Chart/chart-elements.d.ts +27 -6
- package/dist/types/components/ChatMessage/ChatMessage.d.ts +10 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +44 -5
- package/dist/types/components/ColorPicker/ColorPickerPanel.d.ts +28 -0
- package/dist/types/components/ColorPicker/color-math.d.ts +63 -0
- package/dist/types/components/ColorPicker/color-picker-styles.d.ts +50 -0
- package/dist/types/components/ConfigProvider/ConfigContext.d.ts +67 -0
- package/dist/types/components/ConfigProvider/ConfigProvider.d.ts +25 -0
- package/dist/types/components/ConfigProvider/index.d.ts +4 -0
- package/dist/types/components/ConfigProvider/useConfigDefaults.d.ts +28 -0
- package/dist/types/components/ConversationList/ConversationList.d.ts +10 -1
- package/dist/types/components/Datepicker/Datepicker.d.ts +23 -10
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +40 -10
- package/dist/types/components/Datepicker/datetime.d.ts +33 -11
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +12 -2
- package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +26 -0
- package/dist/types/components/DropdownMenu/DropdownMenuGroup.d.ts +16 -0
- package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +7 -1
- package/dist/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +21 -0
- package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +22 -0
- package/dist/types/components/DropdownMenu/dropdown-menu-item-styles.d.ts +29 -0
- package/dist/types/components/DropdownMenu/index.d.ts +9 -1
- package/dist/types/components/Fullscreen/Fullscreen.d.ts +1 -0
- package/dist/types/components/Grid/Grid.d.ts +8 -1
- package/dist/types/components/Grid/GridItem.d.ts +24 -1
- package/dist/types/components/Grid/grid-item-styles.d.ts +57 -0
- package/dist/types/components/HoverCard/HoverCard.d.ts +1 -1
- package/dist/types/components/List/List.d.ts +10 -1
- package/dist/types/components/LocaleProvider/locale.d.ts +31 -0
- package/dist/types/components/LogViewer/LogViewer.d.ts +10 -1
- package/dist/types/components/Menu/Menu.d.ts +11 -2
- package/dist/types/components/Menu/MenuCheckboxItem.d.ts +25 -0
- package/dist/types/components/Menu/MenuGroup.d.ts +16 -0
- package/dist/types/components/Menu/MenuItem.d.ts +7 -1
- package/dist/types/components/Menu/MenuRadioGroup.d.ts +20 -0
- package/dist/types/components/Menu/MenuRadioItem.d.ts +22 -0
- package/dist/types/components/Menu/index.d.ts +9 -1
- package/dist/types/components/Menu/menu-item-styles.d.ts +28 -0
- package/dist/types/components/NavigationBar/NavLink.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +17 -3
- package/dist/types/components/Resizable/Resizable.d.ts +24 -7
- package/dist/types/components/Resizable/index.d.ts +1 -1
- package/dist/types/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts +24 -2
- package/dist/types/components/Slider/SliderCore.d.ts +41 -3
- package/dist/types/components/Sparkline/Sparkline.d.ts +31 -0
- package/dist/types/components/Sparkline/index.d.ts +3 -0
- package/dist/types/components/Sparkline/sparkline-styles.d.ts +26 -0
- package/dist/types/components/StatusBar/StatusBar.d.ts +18 -0
- package/dist/types/components/StatusBar/index.d.ts +3 -0
- package/dist/types/components/StreamingText/StreamingText.d.ts +8 -1
- package/dist/types/components/TabBar/TabBar.d.ts +23 -0
- package/dist/types/components/TabBar/index.d.ts +4 -0
- package/dist/types/components/Tabs/SortableTabList.d.ts +46 -0
- package/dist/types/components/Tabs/Tab.d.ts +54 -3
- package/dist/types/components/Tabs/TabList.d.ts +26 -2
- package/dist/types/components/Tabs/edge-scroll.d.ts +17 -0
- package/dist/types/components/Tabs/index.d.ts +3 -1
- package/dist/types/components/Tabs/tab-metas.d.ts +20 -0
- package/dist/types/components/TimePicker/TimePicker.d.ts +36 -4
- package/dist/types/components/TimePicker/TimePickerPanel.d.ts +26 -0
- package/dist/types/components/TimePicker/index.d.ts +1 -0
- package/dist/types/components/TimePicker/time-picker-styles.d.ts +30 -0
- package/dist/types/components/TimePicker/time.d.ts +49 -0
- package/dist/types/components/Toast/Toast.d.ts +19 -6
- package/dist/types/components/Toast/ToastContainer.d.ts +1 -1
- package/dist/types/components/Toast/ToastContext.d.ts +22 -2
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Toast/{toast.d.ts → toast-channel.d.ts} +20 -14
- package/dist/types/components/Toast/useToast.d.ts +14 -4
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/Tree/SortableTree.d.ts +38 -0
- package/dist/types/components/Tree/Tree.d.ts +1 -1
- package/dist/types/components/Tree/index.d.ts +2 -0
- package/dist/types/components/Tree/sortable-tree-styles.d.ts +36 -0
- package/dist/types/components/Tree/sortable-tree-utils.d.ts +40 -0
- package/dist/types/components/Upload/Upload.d.ts +17 -10
- package/dist/types/components/Upload/UploadCore.d.ts +26 -12
- package/dist/types/components/Upload/UploadList.d.ts +10 -7
- package/dist/types/components/Upload/index.d.ts +1 -1
- package/dist/types/components/Upload/types.d.ts +33 -7
- package/dist/types/components/VirtualList/VirtualList.d.ts +98 -26
- package/dist/types/components/VirtualList/index.d.ts +1 -1
- package/dist/types/components/Workbench/Workbench.d.ts +50 -0
- package/dist/types/components/Workbench/index.d.ts +2 -0
- package/dist/types/dates/adapter.d.ts +101 -0
- package/dist/types/dates/buddhist.d.ts +14 -0
- package/dist/types/dates/ethiopic.d.ts +15 -0
- package/dist/types/dates/gregory.d.ts +10 -0
- package/dist/types/dates/hebrew.d.ts +19 -0
- package/dist/types/dates/index.d.ts +11 -0
- package/dist/types/dates/islamic.d.ts +17 -0
- package/dist/types/dates/japanese.d.ts +16 -0
- package/dist/types/dates/persian.d.ts +18 -0
- package/dist/types/dates/registry.d.ts +13 -0
- package/dist/types/dates/timezone.d.ts +36 -0
- package/dist/types/form/FormItem.d.ts +31 -1
- package/dist/types/form/form-item-styles.d.ts +24 -0
- package/dist/types/index.d.ts +31 -13
- package/dist/types/tokens/index.d.ts +4 -2
- package/dist/types/tokens/motion.d.ts +16 -0
- package/dist/types/tokens/palette.d.ts +59 -2
- package/dist/types/utils/menuItems.d.ts +126 -0
- package/dist/types/utils/menuRadio.d.ts +21 -0
- package/dist/types/utils/sortable.d.ts +8 -1
- package/dist/types/utils/use-end-reached.d.ts +56 -0
- package/dist/types/utils/viewport.d.ts +12 -0
- package/dist/utils/floating.js +45 -44
- package/dist/utils/menuItems.js +55 -0
- package/dist/utils/menuKeyboard.js +31 -31
- package/dist/utils/menuRadio.js +28 -0
- package/dist/utils/sortable.js +7 -5
- package/dist/utils/use-end-reached.js +46 -0
- package/dist/utils/viewport.js +20 -0
- package/package.json +26 -9
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
import type { TimeParts, TimePickerFormat } from './time';
|
|
3
4
|
type TimePickerProps = {
|
|
4
5
|
value?: ControlOrValue<string>;
|
|
6
|
+
/** Panel visibility; defaults to the trigger's own toggle state. */
|
|
7
|
+
open?: ControlOrValue<boolean>;
|
|
5
8
|
onChange?: (value: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Column granularity and the value's serialization shape. The panel
|
|
11
|
+
* shows hour/minute columns for `'HH:mm'` (default) and adds a second
|
|
12
|
+
* column for `'HH:mm:ss'`; `value` always serializes to match.
|
|
13
|
+
*/
|
|
14
|
+
format?: TimePickerFormat;
|
|
15
|
+
/** Hour column step — only multiples of it are offered. Default 1. */
|
|
16
|
+
hourStep?: number;
|
|
17
|
+
/** Minute column step — only multiples of it are offered. Default 1. */
|
|
18
|
+
minuteStep?: number;
|
|
19
|
+
/** Second column step — only multiples of it are offered. Default 1. */
|
|
20
|
+
secondStep?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Presents a 12-hour clock column plus an AM/PM column. The value
|
|
23
|
+
* stays 24-hour `"HH:mm[:ss]"` either way (12:34 AM is `00:34`).
|
|
24
|
+
*/
|
|
25
|
+
use12Hours?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Disables candidate times on the panel's columns: return `true` to
|
|
28
|
+
* make that cell unselectable (muted + not clickable). Each candidate
|
|
29
|
+
* is judged against the currently selected parts of the other
|
|
30
|
+
* fields, so a disabled hour re-evaluates as minutes change.
|
|
31
|
+
*/
|
|
32
|
+
disabledTime?: (parts: TimeParts) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Falls back to the bare native `<input type="time">` form
|
|
35
|
+
* (TimePickerCore) — the panel props above do not apply to it.
|
|
36
|
+
*/
|
|
37
|
+
native?: boolean;
|
|
6
38
|
placeholder?: string;
|
|
7
39
|
className?: string;
|
|
8
|
-
/** Forwarded to the
|
|
9
|
-
*
|
|
40
|
+
/** Forwarded to the trigger `<input>` — the element form bridges and
|
|
41
|
+
* `ref.current.focus()` reach. */
|
|
10
42
|
ref?: Ref<HTMLInputElement>;
|
|
11
|
-
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'type' | 'placeholder'>;
|
|
12
|
-
export default function TimePicker({ value: valueControl, onChange, placeholder, className, ref, ...rest }: TimePickerProps): import("react").JSX.Element;
|
|
43
|
+
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'type' | 'placeholder' | 'defaultValue'>;
|
|
44
|
+
export default function TimePicker({ value: valueControl, open: openControl, onChange, format, hourStep, minuteStep, secondStep, use12Hours, disabledTime, native, placeholder, className, ref, ...rest }: TimePickerProps): import("react").JSX.Element;
|
|
13
45
|
export type { TimePickerProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
|
+
import type { TimeParts, TimePickerFormat } from './time';
|
|
3
|
+
/**
|
|
4
|
+
* One enabled/disabled decision for a candidate cell. The predicate is
|
|
5
|
+
* evaluated against the currently selected parts for the other fields
|
|
6
|
+
* (see `disabledTime` on TimePickerProps).
|
|
7
|
+
*/
|
|
8
|
+
type TimePredicate = (parts: TimeParts) => boolean;
|
|
9
|
+
type TimePickerPanelProps = {
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
14
|
+
format: TimePickerFormat;
|
|
15
|
+
hourStep: number;
|
|
16
|
+
minuteStep: number;
|
|
17
|
+
secondStep: number;
|
|
18
|
+
use12Hours: boolean;
|
|
19
|
+
disabledTime?: TimePredicate;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Forwarded to the trigger `<input>` — focus bridges reach it. */
|
|
23
|
+
ref?: Ref<HTMLInputElement>;
|
|
24
|
+
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'type' | 'placeholder' | 'defaultValue'>;
|
|
25
|
+
export default function TimePickerPanel({ value, onChange, open, onOpenChange, format, hourStep, minuteStep, secondStep, use12Hours, disabledTime, placeholder, className, onKeyDown: consumerKeyDown, ref, ...rest }: TimePickerPanelProps): import("react").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -2,3 +2,4 @@ export { default as TimePicker } from './TimePicker';
|
|
|
2
2
|
export type { TimePickerProps } from './TimePicker';
|
|
3
3
|
export { default as TimePickerCore } from './TimePickerCore';
|
|
4
4
|
export type { TimePickerCoreProps } from './TimePickerCore';
|
|
5
|
+
export type { TimeParts, TimePickerFormat } from './time';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linaria classes for the TimePicker panel form (TimePicker.tsx /
|
|
3
|
+
* TimePickerPanel.tsx). Lives in a sibling file — component files only
|
|
4
|
+
* export components and types (react-refresh/only-export-components).
|
|
5
|
+
*/
|
|
6
|
+
export declare const wrapper: import("@linaria/core").LinariaClassName;
|
|
7
|
+
/** Readonly trigger input (Datepicker's trigger look). */
|
|
8
|
+
export declare const trigger: import("@linaria/core").LinariaClassName;
|
|
9
|
+
/** Panel visual skin applied on every rendering tier. */
|
|
10
|
+
export declare const panel: import("@linaria/core").LinariaClassName;
|
|
11
|
+
export declare const columns: import("@linaria/core").LinariaClassName;
|
|
12
|
+
/**
|
|
13
|
+
* One column frame: fixed height (7 option rows), the highlight band
|
|
14
|
+
* behind the center row, and the scrolling list on top of it. The band
|
|
15
|
+
* is where a committed selection scrolls to, so it stays put while the
|
|
16
|
+
* list moves under it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const columnWrap: import("@linaria/core").LinariaClassName;
|
|
19
|
+
/**
|
|
20
|
+
* The scrolling option list. Padding of three rows lets the first and
|
|
21
|
+
* last options center in the band like every other row. Positioned
|
|
22
|
+
* above the wrap's ::before band.
|
|
23
|
+
*/
|
|
24
|
+
export declare const columnList: import("@linaria/core").LinariaClassName;
|
|
25
|
+
export declare const columnOption: import("@linaria/core").LinariaClassName;
|
|
26
|
+
export declare const columnOptionSelected: import("@linaria/core").LinariaClassName;
|
|
27
|
+
export declare const columnOptionDisabled: import("@linaria/core").LinariaClassName;
|
|
28
|
+
/** Panel footer: the "Now" action row. */
|
|
29
|
+
export declare const footer: import("@linaria/core").LinariaClassName;
|
|
30
|
+
export declare const nowButton: import("@linaria/core").LinariaClassName;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-of-day value helpers for the TimePicker panel form.
|
|
3
|
+
*
|
|
4
|
+
* The value is a 24-hour `"HH:mm"` / `"HH:mm:ss"` string (per `format`,
|
|
5
|
+
* always zero-padded). With `use12Hours` the columns present a 12-hour
|
|
6
|
+
* clock plus an AM/PM column, but serialization stays 24-hour — `12:34`
|
|
7
|
+
* is midday, `00:34` (12:34 AM) is half past midnight.
|
|
8
|
+
*/
|
|
9
|
+
/** 24-hour time-of-day, the serialization coordinate of every form. */
|
|
10
|
+
export type TimeParts = {
|
|
11
|
+
hour: number;
|
|
12
|
+
minute: number;
|
|
13
|
+
second: number;
|
|
14
|
+
};
|
|
15
|
+
/** Column granularity and the value's serialization shape. */
|
|
16
|
+
export type TimePickerFormat = 'HH:mm' | 'HH:mm:ss';
|
|
17
|
+
/**
|
|
18
|
+
* Parse a `"HH:mm"`/`"HH:mm:ss"` value into 24-hour parts. A missing
|
|
19
|
+
* second field reads as `0`. Returns `null` for empty or impossible
|
|
20
|
+
* times (`"25:00"`, `"12:61"`) so the caller can treat it as "unset".
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseTimeValue(value: string): TimeParts | null;
|
|
23
|
+
/** Serialize 24-hour parts per `format`, zero-padded. */
|
|
24
|
+
export declare function formatTimeValue(parts: TimeParts, format: TimePickerFormat): string;
|
|
25
|
+
/** 24-hour hour → 12-hour clock hour: 0→12, 13→1, 12→12. */
|
|
26
|
+
export declare function to12Hour(hour: number): number;
|
|
27
|
+
/** 12-hour clock hour + period → 24-hour hour: (12, AM)→0, (12, PM)→12. */
|
|
28
|
+
export declare function from12Hour(hour12: number, pm: boolean): number;
|
|
29
|
+
/**
|
|
30
|
+
* The values of one step grid: multiples of `step` from 0 through `max`
|
|
31
|
+
* inclusive (`max` itself lands on the grid only when divisible).
|
|
32
|
+
*/
|
|
33
|
+
export declare function stepValues(max: number, step: number): number[];
|
|
34
|
+
/**
|
|
35
|
+
* The 12-hour column's display order — 12 first, then 1 through 11
|
|
36
|
+
* (AntD's order) — filtered to the `step` grid. `12` sits on the grid
|
|
37
|
+
* whenever `step` divides 12 or 0, matching the 24-hour grid's 0/12.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hour12Values(step: number): number[];
|
|
40
|
+
/**
|
|
41
|
+
* Next enabled value walking from `from` by `±step` around the
|
|
42
|
+
* `0..max` ring (negative `step` walks down). Skips candidates
|
|
43
|
+
* rejected by `isEnabled`; after a full lap without a hit returns
|
|
44
|
+
* `null` (every grid value is disabled — caller keeps the current
|
|
45
|
+
* value). A `step` of 0 is treated as 1.
|
|
46
|
+
*/
|
|
47
|
+
export declare function stepValue(from: number, step: number, max: number, isEnabled: (value: number) => boolean): number | null;
|
|
48
|
+
/** Two-digit, zero-padded column label (`0` → `"00"`). */
|
|
49
|
+
export declare function pad2(value: number): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import type { ToastAction } from './ToastContext';
|
|
2
3
|
/**
|
|
3
4
|
* Semantic slot classes (AntD v6 `classNames` shape) for the toast
|
|
4
5
|
* family. Toasts are usually fired imperatively (`useToast()` /
|
|
@@ -18,21 +19,33 @@ type ToastClassNames = {
|
|
|
18
19
|
item?: string;
|
|
19
20
|
/** The body wrapper around the toast content. */
|
|
20
21
|
content?: string;
|
|
22
|
+
/** The action button (only rendered for toasts carrying an action). */
|
|
23
|
+
action?: string;
|
|
24
|
+
/** The bold title line (only rendered for toasts carrying a title). */
|
|
25
|
+
title?: string;
|
|
21
26
|
/** The dismiss × button. */
|
|
22
27
|
close?: string;
|
|
23
28
|
};
|
|
24
29
|
type ToastProps = {
|
|
25
|
-
variant?: 'info' | 'success' | 'warning' | 'danger';
|
|
30
|
+
variant?: 'info' | 'success' | 'warning' | 'danger' | 'loading';
|
|
31
|
+
/**
|
|
32
|
+
* Action button rendered right of the content and left of the dismiss
|
|
33
|
+
* × — a real focusable button (see {@link ToastAction}). `close`
|
|
34
|
+
* defaults to `true`: the toast dismisses right after `onClick` runs.
|
|
35
|
+
*/
|
|
36
|
+
action?: ToastAction;
|
|
37
|
+
/** Bold first line rendered above the content. */
|
|
38
|
+
title?: ReactNode;
|
|
26
39
|
onClose: () => void;
|
|
27
40
|
duration: number;
|
|
28
41
|
children: ReactNode;
|
|
29
42
|
/**
|
|
30
43
|
* Semantic slot classes (AntD v6 `classNames` shape) — see
|
|
31
|
-
* {@link ToastClassNames}. Only `item`/`content`/`
|
|
32
|
-
* directly rendered toast; `viewport` is a
|
|
33
|
-
* Omitting it changes nothing.
|
|
44
|
+
* {@link ToastClassNames}. Only `item`/`content`/`action`/`title`/
|
|
45
|
+
* `close` apply to a directly rendered toast; `viewport` is a
|
|
46
|
+
* `ToastContainer` part. Omitting it changes nothing.
|
|
34
47
|
*/
|
|
35
48
|
classNames?: ToastClassNames;
|
|
36
|
-
} & Omit<ComponentPropsWithRef<'div'>, 'children' | 'onClose'>;
|
|
37
|
-
export default function Toast({ variant, onClose, duration, children, classNames, className, ...rest }: ToastProps): import("react").JSX.Element;
|
|
49
|
+
} & Omit<ComponentPropsWithRef<'div'>, 'children' | 'onClose' | 'title'>;
|
|
50
|
+
export default function Toast({ variant, action, title, onClose, duration, children, classNames, className, ...rest }: ToastProps): import("react").JSX.Element;
|
|
38
51
|
export type { ToastProps, ToastClassNames };
|
|
@@ -23,5 +23,5 @@ export declare const toastPlacements: {
|
|
|
23
23
|
readonly 'bottom-left': import("@linaria/core").LinariaClassName;
|
|
24
24
|
readonly 'bottom-right': import("@linaria/core").LinariaClassName;
|
|
25
25
|
};
|
|
26
|
-
export default function ToastContainer({ children, maxCount, placement, classNames, }: ToastContainerProps): import("react").JSX.Element;
|
|
26
|
+
export default function ToastContainer({ children, maxCount: maxCountProp, placement: placementProp, classNames, }: ToastContainerProps): import("react").JSX.Element;
|
|
27
27
|
export type { ToastContainerProps, ToastPlacement };
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
type ToastVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
2
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'danger' | 'loading';
|
|
3
|
+
/**
|
|
4
|
+
* Action button carried by a toast: rendered right of the content and
|
|
5
|
+
* left of the dismiss ×, as a real focusable `<button>`.
|
|
6
|
+
*/
|
|
7
|
+
type ToastAction = {
|
|
8
|
+
/** Button label. */
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
/** Runs when the action button is activated. */
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
/** Dismiss the toast right after `onClick` runs. Default `true`. */
|
|
13
|
+
close?: boolean;
|
|
14
|
+
};
|
|
3
15
|
type ToastItem = {
|
|
4
16
|
id: number;
|
|
5
17
|
variant: ToastVariant;
|
|
6
18
|
content: ReactNode;
|
|
7
19
|
duration: number;
|
|
20
|
+
/** Action button — omitted renders no button. */
|
|
21
|
+
action?: ToastAction;
|
|
22
|
+
/** Bold first line rendered above the content. */
|
|
23
|
+
title?: ReactNode;
|
|
8
24
|
};
|
|
9
25
|
/**
|
|
10
26
|
* Patch accepted by `toast.update(id, patch)` and `useToast().update(id,
|
|
@@ -19,6 +35,10 @@ type ToastUpdateOptions = {
|
|
|
19
35
|
/** New auto-dismiss budget in ms. Changing it re-arms the countdown
|
|
20
36
|
* from the full value; leaving it out keeps the running countdown. */
|
|
21
37
|
duration?: number;
|
|
38
|
+
/** Replacement (or first) action button. */
|
|
39
|
+
action?: ToastAction;
|
|
40
|
+
/** Replacement (or first) title line. */
|
|
41
|
+
title?: ReactNode;
|
|
22
42
|
};
|
|
23
43
|
/** The `toast.promise` phases whose default copy lives in the locale pack. */
|
|
24
44
|
type ToastDeferredCopyKey = 'loading' | 'success' | 'error';
|
|
@@ -53,4 +73,4 @@ type ToastContextValue = {
|
|
|
53
73
|
export declare const ToastProvider: import("react").Provider<ToastContextValue | undefined>;
|
|
54
74
|
export declare function useToastContext(): ToastContextValue;
|
|
55
75
|
export { applyToastPatch, deferredCopyKey, deferredToastCopy, };
|
|
56
|
-
export type { ToastDeferredCopy, ToastDeferredCopyKey, ToastItem, ToastContextValue, ToastUpdateOptions, ToastVariant, };
|
|
76
|
+
export type { ToastAction, ToastDeferredCopy, ToastDeferredCopyKey, ToastItem, ToastContextValue, ToastUpdateOptions, ToastVariant, };
|
|
@@ -3,5 +3,5 @@ export type { ToastProps, ToastClassNames } from './Toast';
|
|
|
3
3
|
export { default as ToastContainer } from './ToastContainer';
|
|
4
4
|
export type { ToastContainerProps } from './ToastContainer';
|
|
5
5
|
export { default as useToast } from './useToast';
|
|
6
|
-
export { toast } from './toast';
|
|
7
|
-
export type { ToastOptions, ToastVariant } from './toast';
|
|
6
|
+
export { toast } from './toast-channel';
|
|
7
|
+
export type { ToastAction, ToastOptions, ToastVariant } from './toast-channel';
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ToastDeferredCopyKey, ToastItem, ToastUpdateOptions, ToastVariant } from './ToastContext';
|
|
2
|
+
import type { ToastAction, ToastDeferredCopyKey, ToastItem, ToastUpdateOptions, ToastVariant } from './ToastContext';
|
|
3
3
|
/** Options accepted by `toast()` — the same call shape `useToast()` takes. */
|
|
4
4
|
type ToastOptions = {
|
|
5
5
|
variant?: ToastVariant;
|
|
6
6
|
duration?: number;
|
|
7
|
+
/** Action button rendered right of the content (left of the dismiss ×);
|
|
8
|
+
* `close` defaults to `true` — the toast dismisses after `onClick`. */
|
|
9
|
+
action?: ToastAction;
|
|
10
|
+
/** Bold first line rendered above the content. */
|
|
11
|
+
title?: ReactNode;
|
|
7
12
|
};
|
|
8
13
|
/** Options accepted by the variant sugar methods (`toast.success()` …). */
|
|
9
14
|
type ToastVariantOptions = Omit<ToastOptions, 'variant'>;
|
|
@@ -42,10 +47,10 @@ export declare function nextToastId(): number;
|
|
|
42
47
|
* Returns the toast id, usable with `toast.dismiss(id)` and
|
|
43
48
|
* `toast.update(id, patch)`.
|
|
44
49
|
*
|
|
45
|
-
* Mirrors the `useToast()` call shape (content + `{variant, duration
|
|
46
|
-
* defaulting to `info` / 3000ms). With no container
|
|
47
|
-
* silently queued (never throws) and replayed when
|
|
48
|
-
* mounts.
|
|
50
|
+
* Mirrors the `useToast()` call shape (content + `{variant, duration,
|
|
51
|
+
* action, title}`, defaulting to `info` / 3000ms). With no container
|
|
52
|
+
* mounted the toast is silently queued (never throws) and replayed when
|
|
53
|
+
* a `ToastContainer` mounts.
|
|
49
54
|
*/
|
|
50
55
|
declare function toast(content: ReactNode, options?: ToastOptions): number;
|
|
51
56
|
declare namespace toast {
|
|
@@ -53,20 +58,21 @@ declare namespace toast {
|
|
|
53
58
|
var success: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
54
59
|
var warning: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
55
60
|
var danger: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
61
|
+
var loading: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
56
62
|
var dismiss: (id?: number) => void;
|
|
57
63
|
var update: (id: number, patch: ToastUpdateOptions) => void;
|
|
58
64
|
var promise: <T>(p: Promise<T>, options?: ToastPromiseOptions<T>) => Promise<T>;
|
|
59
65
|
}
|
|
60
66
|
/**
|
|
61
|
-
* Shared engine behind `toast.promise` and `useToast().promise`: fires
|
|
62
|
-
* loading toast through `
|
|
63
|
-
* in place when the promise settles, so the
|
|
64
|
-
* animations never replay. Returns the
|
|
65
|
-
* rejections keep propagating to the
|
|
66
|
-
* loading toast dismissed before
|
|
67
|
-
* update — it never resurrects.
|
|
67
|
+
* Shared engine behind `toast.promise` and `useToast().promise`: fires
|
|
68
|
+
* the loading toast through `showLoading` (spinner icon, persistent —
|
|
69
|
+
* duration 0), then patches it in place when the promise settles, so the
|
|
70
|
+
* toast never remounts and its animations never replay. Returns the
|
|
71
|
+
* original promise untouched: rejections keep propagating to the
|
|
72
|
+
* caller's `await`/`catch`, and a loading toast dismissed before
|
|
73
|
+
* settling is simply not found by the update — it never resurrects.
|
|
68
74
|
*/
|
|
69
|
-
export declare function driveToastPromise<T>(
|
|
75
|
+
export declare function driveToastPromise<T>(showLoading: (content: ReactNode) => number, updateById: (id: number, patch: ToastUpdateOptions) => void, promise: Promise<T>, options?: ToastPromiseOptions<T>): Promise<T>;
|
|
70
76
|
/**
|
|
71
77
|
* Called from `ToastContainer`'s mount effect. The first subscriber also
|
|
72
78
|
* replays everything queued before any container existed, in call order;
|
|
@@ -74,4 +80,4 @@ export declare function driveToastPromise<T>(show: (content: ReactNode, options?
|
|
|
74
80
|
*/
|
|
75
81
|
export declare function subscribeToastChannel(channel: ToastChannel): () => void;
|
|
76
82
|
export { toast };
|
|
77
|
-
export type { ToastDeferredCopyKey, ToastOptions, ToastPhaseContent, ToastPromiseOptions, ToastUpdateOptions, ToastVariant, ToastVariantOptions, };
|
|
83
|
+
export type { ToastAction, ToastDeferredCopyKey, ToastOptions, ToastPhaseContent, ToastPromiseOptions, ToastUpdateOptions, ToastVariant, ToastVariantOptions, };
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ToastOptions, ToastPromiseOptions, ToastUpdateOptions } from './toast';
|
|
2
|
+
import type { ToastOptions, ToastPromiseOptions, ToastUpdateOptions, ToastVariantOptions } from './toast-channel';
|
|
3
3
|
/**
|
|
4
4
|
* The `useToast()` return value: the toast trigger itself (returns the id,
|
|
5
|
-
* usable with `update`) plus `update
|
|
6
|
-
* module-level `toast` API, but routed through the enclosing
|
|
7
|
-
* context instead of the first-mounted channel subscriber.
|
|
5
|
+
* usable with `update`) plus `loading`/`update`/`promise` — one-to-one
|
|
6
|
+
* with the module-level `toast` API, but routed through the enclosing
|
|
7
|
+
* container's context instead of the first-mounted channel subscriber.
|
|
8
8
|
*/
|
|
9
9
|
type ShowToast = {
|
|
10
10
|
(content: ReactNode, options?: ToastOptions): number;
|
|
11
|
+
/** Info toast — see `toast.info`. */
|
|
12
|
+
info: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
13
|
+
/** Success toast — see `toast.success`. */
|
|
14
|
+
success: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
15
|
+
/** Warning toast — see `toast.warning`. */
|
|
16
|
+
warning: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
17
|
+
/** Danger toast — see `toast.danger`. */
|
|
18
|
+
danger: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
19
|
+
/** Loading toast with the spinner icon — see `toast.loading`. */
|
|
20
|
+
loading: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
11
21
|
/** Patches a toast in place — see `toast.update`. */
|
|
12
22
|
update: (id: number, patch: ToastUpdateOptions) => void;
|
|
13
23
|
/** Loading → success/danger lifecycle — see `toast.promise`. */
|
|
@@ -12,5 +12,5 @@ type TooltipProps = {
|
|
|
12
12
|
className?: string;
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
};
|
|
15
|
-
export default function Tooltip({ content, position, delay, open: openControl, collisionPadding, className, children, }: TooltipProps): import("react").JSX.Element;
|
|
15
|
+
export default function Tooltip({ content, position, delay: delayProp, open: openControl, collisionPadding, className, children, }: TooltipProps): import("react").JSX.Element;
|
|
16
16
|
export type { TooltipProps };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SortableTreeMoveInfo } from './sortable-tree-utils';
|
|
2
|
+
import type { TreeProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for `SortableTree` — the full `TreeProps` field set (the tree
|
|
5
|
+
* keeps all of its expand/select/check/keyboard/virtual behavior) plus
|
|
6
|
+
* the drag contract. The internal injection seams are hidden: drag
|
|
7
|
+
* reordering owns them.
|
|
8
|
+
*/
|
|
9
|
+
export type SortableTreeProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Reports a completed drag: the dragged `key` should become the child
|
|
12
|
+
* at `index` of `parentKey` (`null` = root level), computed after
|
|
13
|
+
* removing the node from its old spot — splice it right in. Update
|
|
14
|
+
* `treeData` accordingly (controlled, one-way — the same philosophy as
|
|
15
|
+
* `SortableTagGroup`); without a handler a drop only animates back to
|
|
16
|
+
* the source position. The node's whole subtree travels with it.
|
|
17
|
+
*/
|
|
18
|
+
onMove?: (info: SortableTreeMoveInfo) => void;
|
|
19
|
+
/**
|
|
20
|
+
* `false` (default): the whole row is the drag activator — an 8px
|
|
21
|
+
* pointer move threshold keeps clicks, expands and checks untouched.
|
|
22
|
+
* `true`: only the leading grip icon starts pointer drags; keyboard
|
|
23
|
+
* drags (Space lifts on the focused row) work either way.
|
|
24
|
+
*/
|
|
25
|
+
dragHandle?: boolean;
|
|
26
|
+
} & Omit<TreeProps, 'rowWrap' | 'keyboardNavigation'>;
|
|
27
|
+
/**
|
|
28
|
+
* Drag-and-drop reorderable variant of Tree — built on the @dnd-kit
|
|
29
|
+
* dependency (the plain `Tree` never touches it): same-level reorders
|
|
30
|
+
* and cross-parent moves, the dragged node's whole subtree follows, and
|
|
31
|
+
* keyboard sortable works with Space / arrows / Space / Escape on the
|
|
32
|
+
* focused row. Dropping onto a row inserts right after it, so a drop on
|
|
33
|
+
* a child of another parent reparents; nodes never drop into their own
|
|
34
|
+
* subtree. All tree state stays controlled — `onMove` reports
|
|
35
|
+
* `{ key, parentKey, index }` and the consumer updates `treeData`.
|
|
36
|
+
*/
|
|
37
|
+
export default function SortableTree({ treeData, disabled, dragHandle, titleRender, searchValue, expandedKeys, onExpand, onMove, className, ...rest }: SortableTreeProps): import("react").JSX.Element;
|
|
38
|
+
export type { SortableTreeMoveInfo };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TreeProps, TreeVirtualizedConfig } from './types';
|
|
2
|
-
export default function Tree({ treeData, multiple, checkable, checkStrictly, selectable, disabled, blockNode, showLine, showIcon, switcherIcon, loadingIcon, titleRender, iconRender, virtualized, loadData, searchValue, expandedKeys: expandedKeysControl, selectedKeys: selectedKeysControl, checkedKeys: checkedKeysControl, className, onExpand, onSelect, onCheck, }: TreeProps): import("react").JSX.Element;
|
|
2
|
+
export default function Tree({ treeData, multiple, checkable, checkStrictly, selectable, disabled, blockNode, showLine, showIcon, switcherIcon, loadingIcon, titleRender, iconRender, virtualized, loadData, searchValue, rowWrap, keyboardNavigation, expandedKeys: expandedKeysControl, selectedKeys: selectedKeysControl, checkedKeys: checkedKeysControl, className, onExpand, onSelect, onCheck, }: TreeProps): import("react").JSX.Element;
|
|
3
3
|
export type { TreeProps, TreeVirtualizedConfig };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linaria classes for SortableTree — sibling file per the repo convention
|
|
3
|
+
* (sortable-tree- prefix keeps the class slug distinct from every other
|
|
4
|
+
* *-styles.ts, the tag-group-styles precedent). The classes land in the
|
|
5
|
+
* `tree` css family automatically (same component directory).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The sortable node wrapper around every treeitem (the element that
|
|
9
|
+
* carries useSortable's ref). `position: relative` anchors the dragging
|
|
10
|
+
* row's z-index stack; the inline transform/transition (from
|
|
11
|
+
* sortableItemStyle) animates the drag and the snap-back.
|
|
12
|
+
*/
|
|
13
|
+
export declare const row: import("@linaria/core").LinariaClassName;
|
|
14
|
+
/**
|
|
15
|
+
* Whole-row drag affordance (`dragHandle: false`): the wrapper grabs the
|
|
16
|
+
* pointer for PointerSensor (touch-action: none) and shows the grab
|
|
17
|
+
* cursor — the treeitem's own `cursor: pointer` is inherited over so the
|
|
18
|
+
* row reads as draggable while the switcher/checkbox keep their cursors.
|
|
19
|
+
* Clicks still work: PointerSensor's 8px distance constraint keeps plain
|
|
20
|
+
* taps from ever starting a drag.
|
|
21
|
+
*/
|
|
22
|
+
export declare const rowDraggable: import("@linaria/core").LinariaClassName;
|
|
23
|
+
/** The dragged row stacks above its siblings while it flies. */
|
|
24
|
+
export declare const rowDragging: import("@linaria/core").LinariaClassName;
|
|
25
|
+
/**
|
|
26
|
+
* Rows inside the dragged subtree dim while their ancestor flies — the
|
|
27
|
+
* subtree follows as one block, so its rows are never drop targets.
|
|
28
|
+
*/
|
|
29
|
+
export declare const rowInSubtree: import("@linaria/core").LinariaClassName;
|
|
30
|
+
/**
|
|
31
|
+
* The drag grip (`dragHandle: true`): pointer-activated only and hidden
|
|
32
|
+
* from the accessibility tree — keyboard drags stay on the treeitem row
|
|
33
|
+
* (Space lifts, arrows move, Space drops), keeping the tree's single
|
|
34
|
+
* roving tab stop intact.
|
|
35
|
+
*/
|
|
36
|
+
export declare const grip: import("@linaria/core").LinariaClassName;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TreeNodeData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Pure move math for SortableTree — no React, no dnd, fully unit-testable.
|
|
4
|
+
* The drag runtime reports a target row; these functions turn that into the
|
|
5
|
+
* `onMove` payload and back into a controlled treeData update.
|
|
6
|
+
*/
|
|
7
|
+
/** Payload `SortableTree` reports after a completed drag. */
|
|
8
|
+
export type SortableTreeMoveInfo = {
|
|
9
|
+
/** The dragged node's key. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** The new parent's key — `null` for the root level. */
|
|
12
|
+
parentKey: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Insertion index among the **new** parent's children, computed after
|
|
15
|
+
* removing the dragged node from the tree — `splice(index, 0, node)`
|
|
16
|
+
* lands exactly.
|
|
17
|
+
*/
|
|
18
|
+
index: number;
|
|
19
|
+
};
|
|
20
|
+
/** Every key in the node's own subtree, including itself. */
|
|
21
|
+
export declare function subtreeKeys(node: TreeNodeData): Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve a completed drag into the `onMove` payload. Dropping onto a row
|
|
24
|
+
* inserts the dragged node **right after it** — as the target's next
|
|
25
|
+
* sibling at the target's level — so a drop on a same-level row reorders
|
|
26
|
+
* and a drop on a child of another parent reparents. Returns `null` when
|
|
27
|
+
* nothing should happen: drop on itself, on one of its own descendants
|
|
28
|
+
* (the subtree travels as one block and cannot move into itself), back
|
|
29
|
+
* onto its own current position, or an unknown key.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveTreeMove(data: TreeNodeData[], dragKey: string, overKey: string): SortableTreeMoveInfo | null;
|
|
32
|
+
/**
|
|
33
|
+
* Apply a reported move to a tree array — the controlled `treeData`
|
|
34
|
+
* update a consumer makes in `onMove`: detach the node with its whole
|
|
35
|
+
* subtree, then splice it into the new parent's children. Returns fresh
|
|
36
|
+
* arrays on every changed path (originals untouched). A parent key that
|
|
37
|
+
* no longer resolves falls back to appending at the root level rather
|
|
38
|
+
* than dropping the node.
|
|
39
|
+
*/
|
|
40
|
+
export declare function applyTreeMove(data: TreeNodeData[], info: SortableTreeMoveInfo): TreeNodeData[];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
-
import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest } from './types';
|
|
3
|
+
import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest, UploadValueItem } from './types';
|
|
4
4
|
type UploadProps = {
|
|
5
|
-
/** Selected files
|
|
6
|
-
|
|
5
|
+
/** Selected files — local `File` picks mixed freely with `UploadFile`
|
|
6
|
+
* echo entries (files already on the server); uncontrolled
|
|
7
|
+
* (accumulating internally) when omitted. */
|
|
8
|
+
value?: ControlOrValue<UploadValueItem[]>;
|
|
7
9
|
accept?: string;
|
|
8
10
|
/** Renders the drag-and-drop drop area (default) or a plain
|
|
9
11
|
* click-only picker area — see `UploadCoreProps.droppable`. */
|
|
@@ -35,9 +37,13 @@ type UploadProps = {
|
|
|
35
37
|
showUploadList?: boolean | {
|
|
36
38
|
itemRender?: UploadListItemRender;
|
|
37
39
|
};
|
|
38
|
-
/** Rendering style of the built-in list (`text` rows
|
|
39
|
-
* `picture-card` thumbnail
|
|
40
|
-
|
|
40
|
+
/** Rendering style of the built-in list (`text` rows, a `picture`
|
|
41
|
+
* row with a 32px inline thumbnail, or a `picture-card` thumbnail
|
|
42
|
+
* grid) — see `UploadCoreProps.listType`. */
|
|
43
|
+
listType?: 'text' | 'picture' | 'picture-card';
|
|
44
|
+
/** Click handler for `picture` / `picture-card` thumbnails (e.g. a
|
|
45
|
+
* lightbox) — see `UploadCoreProps.onPreview`. */
|
|
46
|
+
onPreview?: (file: UploadValueItem) => void;
|
|
41
47
|
/** Overrides the built-in remove-button label — see
|
|
42
48
|
* `UploadCoreProps.removeLabel`. */
|
|
43
49
|
removeLabel?: string;
|
|
@@ -47,13 +53,14 @@ type UploadProps = {
|
|
|
47
53
|
/** Status-machine snapshot callback — see
|
|
48
54
|
* `UploadCoreProps.onStatusChange`. */
|
|
49
55
|
onStatusChange?: (files: UploadFileStatus[]) => void;
|
|
50
|
-
/** Fires with the freshly picked files only
|
|
51
|
-
* the `value` channel (or internal state
|
|
52
|
-
* Removals and `clear()` do not fire this (they
|
|
56
|
+
/** Fires with the freshly picked files only (always local `File`s)
|
|
57
|
+
* — the accumulated list is the `value` channel (or internal state
|
|
58
|
+
* when uncontrolled). Removals and `clear()` do not fire this (they
|
|
59
|
+
* are not picks). */
|
|
53
60
|
onChange?: (files: File[]) => void;
|
|
54
61
|
className?: string;
|
|
55
62
|
children?: ReactNode;
|
|
56
63
|
ref?: Ref<UploadHandle>;
|
|
57
64
|
};
|
|
58
|
-
export default function Upload({ value: valueControl, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, removeLabel, directory, onStatusChange, onChange, className, children, ref, }: UploadProps): import("react").JSX.Element;
|
|
65
|
+
export default function Upload({ value: valueControl, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, onPreview, removeLabel, directory, onStatusChange, onChange, className, children, ref, }: UploadProps): import("react").JSX.Element;
|
|
59
66
|
export type { UploadProps };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
|
-
import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest } from './types';
|
|
2
|
+
import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest, UploadValueItem } from './types';
|
|
3
3
|
type UploadCoreProps = {
|
|
4
4
|
/** The selected files — the field value, emitted verbatim (as the
|
|
5
|
-
* complete next list) by `onChange`.
|
|
6
|
-
|
|
5
|
+
* complete next list) by `onChange`. Local `File` picks mix freely
|
|
6
|
+
* with `UploadFile` echo entries describing files already on the
|
|
7
|
+
* server; echo entries only render (and stay removable), they never
|
|
8
|
+
* enter the upload pipeline. */
|
|
9
|
+
value: UploadValueItem[];
|
|
7
10
|
/** Emits the next file list: a single pick replaces `value`, a
|
|
8
11
|
* `multiple` pick appends to it. Removals from the built-in list
|
|
9
|
-
* (and `clear()`) also flow through here
|
|
10
|
-
|
|
12
|
+
* (and `clear()`) also flow through here — echo entries come back
|
|
13
|
+
* as the very objects the consumer passed in. */
|
|
14
|
+
onChange: (files: UploadValueItem[]) => void;
|
|
11
15
|
/** Comma-separated accept tokens (`.txt`, `image/*`, `text/plain`) —
|
|
12
16
|
* the same grammar the native picker uses. Dropped files that do not
|
|
13
17
|
* match are discarded silently (the native dialog already enforces
|
|
@@ -74,12 +78,21 @@ type UploadCoreProps = {
|
|
|
74
78
|
};
|
|
75
79
|
/**
|
|
76
80
|
* Rendering style of the built-in list (default `text`): `text`
|
|
77
|
-
* rows
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
+
* rows; `picture` — a text row with a 32px inline thumbnail before
|
|
82
|
+
* the name (a `url` image for `UploadFile` echoes, an object-URL
|
|
83
|
+
* preview for image files, a type-icon fallback otherwise); or a
|
|
84
|
+
* `picture-card` grid of square thumbnail cards with the upload
|
|
85
|
+
* mask, danger border + retry on error, and corner remove button.
|
|
81
86
|
*/
|
|
82
|
-
listType?: 'text' | 'picture-card';
|
|
87
|
+
listType?: 'text' | 'picture' | 'picture-card';
|
|
88
|
+
/**
|
|
89
|
+
* Click handler for the thumbnails of `picture` / `picture-card`
|
|
90
|
+
* lists — the natural spot to open a lightbox (wire it to
|
|
91
|
+
* `Image`/`ImagePreview`). Receives the value item the thumbnail
|
|
92
|
+
* describes. The remove/retry/cancel buttons sit outside the hit
|
|
93
|
+
* area and keep working.
|
|
94
|
+
*/
|
|
95
|
+
onPreview?: (file: UploadValueItem) => void;
|
|
83
96
|
/**
|
|
84
97
|
* Overrides the built-in remove-button label (list rows and
|
|
85
98
|
* picture-card corners); defaults to the locale string.
|
|
@@ -95,12 +108,13 @@ type UploadCoreProps = {
|
|
|
95
108
|
/**
|
|
96
109
|
* Fires whenever the tracked entries change (added, removed, status
|
|
97
110
|
* or percent) with the complete snapshot in value order. Only tracks
|
|
98
|
-
* while `request`/`action` or `showUploadList` is in play.
|
|
111
|
+
* while `request`/`action` or `showUploadList` is in play. `UploadFile`
|
|
112
|
+
* echoes report their terminal `status`/`percent` like any row.
|
|
99
113
|
*/
|
|
100
114
|
onStatusChange?: (files: UploadFileStatus[]) => void;
|
|
101
115
|
className?: string;
|
|
102
116
|
children?: ReactNode;
|
|
103
117
|
ref?: Ref<UploadHandle>;
|
|
104
118
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'value' | 'onChange' | 'children' | 'onClick' | 'onDrop' | 'onDragOver' | 'onDragEnter' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex'>;
|
|
105
|
-
export default function UploadCore({ value, onChange, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, removeLabel, directory, onStatusChange, className, children, ref, ...rest }: UploadCoreProps): import("react").JSX.Element;
|
|
119
|
+
export default function UploadCore({ value, onChange, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, onPreview, removeLabel, directory, onStatusChange, className, children, ref, ...rest }: UploadCoreProps): import("react").JSX.Element;
|
|
106
120
|
export type { UploadCoreProps };
|