haze-ui 1.29.0 → 1.30.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 +58 -0
- 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/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 +21 -16
- 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 +1 -0
- 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 +1 -0
- package/dist/components/List/ListItem.js +1 -0
- package/dist/components/LocaleProvider/LocaleProvider.js +4 -4
- package/dist/components/LocaleProvider/ar-sa.js +24 -2
- package/dist/components/LocaleProvider/de-de.js +24 -2
- package/dist/components/LocaleProvider/es-es.js +24 -2
- package/dist/components/LocaleProvider/fr-fr.js +24 -2
- package/dist/components/LocaleProvider/it-it.js +24 -2
- package/dist/components/LocaleProvider/ja-jp.js +24 -2
- package/dist/components/LocaleProvider/ko-kr.js +24 -2
- package/dist/components/LocaleProvider/locale.js +24 -2
- package/dist/components/LocaleProvider/pt-br.js +24 -2
- package/dist/components/LocaleProvider/ru-ru.js +24 -2
- package/dist/components/LocaleProvider/zh-cn.js +24 -2
- package/dist/components/LogViewer/LogViewer.js +25 -14
- 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 +9 -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 +25 -22
- 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/Spinner/Spinner.js +1 -0
- package/dist/components/Stat/Stat.js +7 -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/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/Tab.js +1 -0
- package/dist/components/Tabs/TabList.js +5 -4
- package/dist/components/Tabs/TabPanel.js +1 -0
- package/dist/components/Tabs/Tabs.js +1 -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 +13 -10
- 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/toast2.js +20 -14
- 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 +229 -124
- package/dist/components/Watermark/Watermark.js +8 -6
- package/dist/css/accordion.css +1 -1
- package/dist/css/alert.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/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/context-menu.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/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/segmented.css +1 -1
- package/dist/css/skeleton.css +1 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/spinner.css +1 -1
- 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/tabs.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-manifest.json +22 -0
- package/dist/dates/adapter.js +13 -0
- package/dist/dates/gregory.js +44 -0
- package/dist/dates/islamic.js +87 -0
- package/dist/dates/registry.js +13 -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 +63 -48
- package/dist/index.js +249 -232
- package/dist/mcp-docs.json +1011 -82
- package/dist/registry.json +17 -17
- 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/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/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/LocaleProvider/locale.d.ts +24 -0
- 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/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/StreamingText/StreamingText.d.ts +8 -1
- 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 +1 -1
- package/dist/types/components/Toast/toast.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 +79 -26
- package/dist/types/components/VirtualList/index.d.ts +1 -1
- package/dist/types/dates/adapter.d.ts +74 -0
- package/dist/types/dates/gregory.d.ts +10 -0
- package/dist/types/dates/index.d.ts +6 -0
- package/dist/types/dates/islamic.d.ts +17 -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 +19 -11
- 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/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-shared.js +3 -3
- package/dist/utils/sortable.js +12 -11
- package/package.json +18 -9
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
type PaginationProps = {
|
|
4
4
|
page?: ControlOrValue<number>;
|
|
5
5
|
total: number;
|
|
6
|
-
pageSize?: number
|
|
6
|
+
pageSize?: ControlOrValue<number>;
|
|
7
|
+
/** Page sizes offered by the size changer (`showSizeChanger`). */
|
|
8
|
+
pageSizeOptions?: number[];
|
|
9
|
+
/** Renders a page-size select; changing it resets to page 1. */
|
|
10
|
+
showSizeChanger?: boolean;
|
|
11
|
+
/** Renders a "Go to [input]" control that jumps on Enter (clamped). */
|
|
12
|
+
showQuickJumper?: boolean;
|
|
13
|
+
/** Renders a summary of `total` and the current page's item range. */
|
|
14
|
+
showTotal?: (total: number, range: [number, number]) => ReactNode;
|
|
15
|
+
/** Minimal mode: a page input plus prev/next instead of the page list. */
|
|
16
|
+
simple?: boolean;
|
|
17
|
+
/** Turns the ellipsis markers into buttons jumping ±5 pages (clamped). */
|
|
18
|
+
ellipsisJump?: boolean;
|
|
19
|
+
/** Value callback fired for every page jump and page-size change. */
|
|
20
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
7
21
|
size?: 'sm' | 'md' | 'lg';
|
|
8
22
|
className?: string;
|
|
9
23
|
} & Omit<ComponentPropsWithoutRef<'nav'>, 'onChange'>;
|
|
10
|
-
export default function Pagination({ page: pageControl, total, pageSize, size, className, ...rest }: PaginationProps): import("react").JSX.Element;
|
|
24
|
+
export default function Pagination({ page: pageControl, total, pageSize: pageSizeControl, pageSizeOptions, showSizeChanger, showQuickJumper, showTotal, simple, ellipsisJump, onPageChange, size, className, ...rest }: PaginationProps): import("react").JSX.Element;
|
|
11
25
|
export type { PaginationProps };
|
|
@@ -49,7 +49,7 @@ export declare const SidebarItem: import("react").ForwardRefExoticComponent<{
|
|
|
49
49
|
*/
|
|
50
50
|
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
51
51
|
className?: string;
|
|
52
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "
|
|
52
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "children" | "className" | "onClick"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
53
53
|
type SidebarFooterProps = {
|
|
54
54
|
children: ReactNode;
|
|
55
55
|
className?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
type SliderProps = {
|
|
4
4
|
/** `number` in single mode, `[low, high]` when `range` is set. */
|
|
@@ -22,11 +22,33 @@ type SliderProps = {
|
|
|
22
22
|
* identically named sliders are ambiguous — prefer the tuple).
|
|
23
23
|
*/
|
|
24
24
|
'aria-label'?: string | [string, string];
|
|
25
|
+
/**
|
|
26
|
+
* Value bubble over the active thumb while dragging or focused
|
|
27
|
+
* (see SliderCoreProps.tooltip). Opt-in; in single mode it wraps the
|
|
28
|
+
* input in a positioning span (the input keeps `className`).
|
|
29
|
+
*/
|
|
30
|
+
tooltip?: boolean;
|
|
31
|
+
/** Bubble content formatter (see SliderCoreProps.tooltipFormatter). */
|
|
32
|
+
tooltipFormatter?: (value: number) => ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Tick labels under the track, clickable onto the nearest thumb
|
|
35
|
+
* (see SliderCoreProps.marks).
|
|
36
|
+
*/
|
|
37
|
+
marks?: Record<number, ReactNode>;
|
|
38
|
+
/**
|
|
39
|
+
* Vertical orientation, bottom-to-top (see SliderCoreProps.vertical).
|
|
40
|
+
*/
|
|
41
|
+
vertical?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* `null` restricts the selectable values to the `marks` keys
|
|
44
|
+
* (see SliderCoreProps.step); a number forwards to the native input.
|
|
45
|
+
*/
|
|
46
|
+
step?: number | null;
|
|
25
47
|
/**
|
|
26
48
|
* Forwarded to the `<input type='range'>` — the only input in single
|
|
27
49
|
* mode, the low thumb (first tab stop) in range mode.
|
|
28
50
|
*/
|
|
29
51
|
ref?: Ref<HTMLInputElement>;
|
|
30
|
-
} & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'aria-label'>;
|
|
52
|
+
} & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'aria-label' | 'step'>;
|
|
31
53
|
export default function Slider({ value: valueControl, range, className, onChange, onValuesChange, ref, ...rest }: SliderProps): import("react").JSX.Element;
|
|
32
54
|
export type { SliderProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
type SliderCoreProps = {
|
|
3
3
|
/** `number` in single mode, `[low, high]` when `range` is set. An
|
|
4
4
|
* inverted tuple renders normalized (low ≤ high). */
|
|
@@ -21,6 +21,44 @@ type SliderCoreProps = {
|
|
|
21
21
|
* pointer input.
|
|
22
22
|
*/
|
|
23
23
|
range?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Shows a value bubble over the active thumb while it is being
|
|
26
|
+
* dragged (pointerdown until pointerup) or focused. Opt-in: without
|
|
27
|
+
* it nothing extra renders. The bubble is visual only
|
|
28
|
+
* (`aria-hidden`) — the native input keeps exposing the value, so
|
|
29
|
+
* `aria-valuetext` semantics are untouched. In range mode each thumb
|
|
30
|
+
* carries its own bubble.
|
|
31
|
+
*/
|
|
32
|
+
tooltip?: boolean;
|
|
33
|
+
/** Formats the bubble content (both modes); defaults to the raw
|
|
34
|
+
* number. */
|
|
35
|
+
tooltipFormatter?: (value: number) => ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Tick labels rendered under the track (beside it when `vertical`).
|
|
38
|
+
* Clicking a label commits that value to the nearest thumb (ties go
|
|
39
|
+
* to the low thumb; a value past the other thumb still snaps against
|
|
40
|
+
* it instead of crossing). Combine with `step={null}` to restrict
|
|
41
|
+
* the selectable values to the mark keys.
|
|
42
|
+
*/
|
|
43
|
+
marks?: Record<number, ReactNode>;
|
|
44
|
+
/**
|
|
45
|
+
* Vertical orientation (bottom-to-top) via the modern
|
|
46
|
+
* `writing-mode: vertical-lr; direction: rtl` slider recipe
|
|
47
|
+
* (Chromium 119+ / Firefox 120+ / Safari 17.4+; older engines keep
|
|
48
|
+
* rendering horizontally). Keyboard behavior stays native — the
|
|
49
|
+
* RTL arrow mirroring only applies to horizontal sliders. The track
|
|
50
|
+
* length defaults to `calc(var(--haze-space-16) * 2)`; override it
|
|
51
|
+
* by setting `--haze-slider-track` on the slider or an ancestor.
|
|
52
|
+
*/
|
|
53
|
+
vertical?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Pass `null` (with `marks`) to make the marks the only selectable
|
|
56
|
+
* values: the native inputs receive `step='any'` and every change —
|
|
57
|
+
* drag, click or keyboard — snaps to the nearest mark key. A number
|
|
58
|
+
* is forwarded to the native inputs as-is; omitted keeps the native
|
|
59
|
+
* default.
|
|
60
|
+
*/
|
|
61
|
+
step?: number | null;
|
|
24
62
|
className?: string;
|
|
25
63
|
/**
|
|
26
64
|
* Single mode: forwarded to the input untouched. Range mode: a
|
|
@@ -35,6 +73,6 @@ type SliderCoreProps = {
|
|
|
35
73
|
* mode, the low thumb (first tab stop) in range mode.
|
|
36
74
|
*/
|
|
37
75
|
ref?: Ref<HTMLInputElement>;
|
|
38
|
-
} & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'onChange' | 'aria-label'>;
|
|
39
|
-
export default function SliderCore({ value, onChange, onNativeChange, range, className, onKeyDown, 'aria-label': ariaLabel, ref, ...rest }: SliderCoreProps): import("react").JSX.Element;
|
|
76
|
+
} & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'onChange' | 'aria-label' | 'step'>;
|
|
77
|
+
export default function SliderCore({ value, onChange, onNativeChange, range, className, onKeyDown, 'aria-label': ariaLabel, tooltip, tooltipFormatter, marks, vertical, step, onPointerDown, onFocus, onBlur, ref, ...rest }: SliderCoreProps): import("react").JSX.Element;
|
|
40
78
|
export type { SliderCoreProps };
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
type StreamingTextProps = {
|
|
2
2
|
text: string;
|
|
3
3
|
speed?: number;
|
|
4
|
+
/**
|
|
5
|
+
* How often (ms) the screen-reader live region picks up a new snapshot
|
|
6
|
+
* of the streamed text. Everything streamed in between stays silent:
|
|
7
|
+
* announcing per character would restart the reader's utterance on
|
|
8
|
+
* every tick, so the throttle is the point, not an optimization.
|
|
9
|
+
*/
|
|
10
|
+
announceInterval?: number;
|
|
4
11
|
onComplete?: () => void;
|
|
5
12
|
showCursor?: boolean;
|
|
6
13
|
className?: string;
|
|
7
14
|
};
|
|
8
|
-
export default function StreamingText({ text, speed, onComplete, showCursor, className, }: StreamingTextProps): import("react").JSX.Element;
|
|
15
|
+
export default function StreamingText({ text, speed, announceInterval, onComplete, showCursor, className, }: StreamingTextProps): import("react").JSX.Element;
|
|
9
16
|
export type { StreamingTextProps };
|
|
@@ -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, };
|
|
@@ -4,4 +4,4 @@ export { default as ToastContainer } from './ToastContainer';
|
|
|
4
4
|
export type { ToastContainerProps } from './ToastContainer';
|
|
5
5
|
export { default as useToast } from './useToast';
|
|
6
6
|
export { toast } from './toast';
|
|
7
|
-
export type { ToastOptions, ToastVariant } from './toast';
|
|
7
|
+
export type { ToastAction, ToastOptions, ToastVariant } from './toast';
|
|
@@ -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';
|
|
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;
|