haze-ui 1.24.1 → 1.26.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 +237 -0
- package/dist/components/Accordion/Accordion.js +1 -0
- package/dist/components/Accordion/AccordionItem.js +1 -0
- package/dist/components/Accordion/index.js +1 -0
- package/dist/components/Affix/Affix.js +1 -0
- package/dist/components/Affix/index.js +1 -0
- package/dist/components/Alert/Alert.js +20 -18
- package/dist/components/Alert/index.js +1 -0
- package/dist/components/ApprovalCard/ApprovalCard.js +28 -25
- package/dist/components/ApprovalCard/index.js +1 -0
- package/dist/components/AspectRatio/AspectRatio.js +1 -0
- package/dist/components/AspectRatio/index.js +1 -0
- package/dist/components/AsyncSection/AsyncSection.js +33 -30
- package/dist/components/AsyncSection/index.js +1 -0
- package/dist/components/Avatar/Avatar.js +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +30 -0
- package/dist/components/AvatarGroup/index.js +3 -0
- package/dist/components/BackToTop/BackToTop.js +16 -14
- package/dist/components/BackToTop/index.js +1 -0
- package/dist/components/Badge/Badge.js +1 -0
- package/dist/components/Badge/index.js +1 -0
- package/dist/components/Banner/Banner.js +20 -18
- package/dist/components/Banner/index.js +1 -0
- package/dist/components/BottomSheet/BottomSheet.js +1 -0
- package/dist/components/BottomSheet/index.js +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +19 -17
- package/dist/components/Breadcrumb/BreadcrumbItem.js +1 -0
- package/dist/components/Breadcrumb/index.js +1 -0
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Button/ButtonLink.js +1 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/Button/styles.js +1 -0
- package/dist/components/Calendar/Calendar.js +124 -0
- package/dist/components/Calendar/date.js +54 -0
- package/dist/components/Calendar/index.js +3 -0
- package/dist/components/Card/Card.js +1 -0
- package/dist/components/Card/index.js +1 -0
- package/dist/components/Carousel/Carousel.js +43 -40
- package/dist/components/Carousel/CarouselSlide.js +1 -0
- package/dist/components/Carousel/index.js +1 -0
- package/dist/components/Cascader/Cascader.js +228 -0
- package/dist/components/Cascader/index.js +3 -0
- package/dist/components/ChatContainer/ChatContainer.js +1 -0
- package/dist/components/ChatContainer/index.js +1 -0
- package/dist/components/ChatInput/ChatInput.js +31 -29
- package/dist/components/ChatInput/index.js +1 -0
- package/dist/components/ChatMessage/ChatMessage.js +29 -27
- package/dist/components/ChatMessage/index.js +1 -0
- package/dist/components/Checkbox/Checkbox.js +1 -0
- package/dist/components/Checkbox/CheckboxCore.js +1 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/Chip/Chip.js +21 -19
- package/dist/components/Chip/index.js +1 -0
- package/dist/components/CodeBlock/CodeBlock.js +1 -0
- package/dist/components/CodeBlock/index.js +1 -0
- package/dist/components/Collapsible/Collapsible.js +1 -0
- package/dist/components/Collapsible/index.js +1 -0
- package/dist/components/ColorPicker/ColorPicker.js +1 -0
- package/dist/components/ColorPicker/ColorPickerCore.js +29 -26
- package/dist/components/ColorPicker/index.js +1 -0
- package/dist/components/Combobox/Combobox.js +70 -41
- package/dist/components/Combobox/ComboboxOption.js +9 -5
- package/dist/components/Combobox/index.js +1 -0
- package/dist/components/Command/Command.js +1 -0
- package/dist/components/Command/index.js +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.js +41 -39
- package/dist/components/ConfirmDialog/index.js +1 -0
- package/dist/components/Container/Container.js +1 -0
- package/dist/components/Container/index.js +1 -0
- package/dist/components/ContextMenu/ContextMenu.js +1 -0
- package/dist/components/ContextMenu/ContextMenuContent.js +1 -0
- package/dist/components/ContextMenu/ContextMenuContext.js +1 -0
- 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/ContextMenu/index.js +1 -0
- package/dist/components/ConversationList/ConversationItem.js +1 -0
- package/dist/components/ConversationList/ConversationList.js +1 -0
- package/dist/components/ConversationList/index.js +1 -0
- package/dist/components/DataTable/DataTable.js +193 -0
- package/dist/components/DataTable/index.js +3 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +1 -0
- package/dist/components/DateRangePicker/DateRangePickerCore.js +22 -19
- package/dist/components/DateRangePicker/index.js +1 -0
- package/dist/components/Datepicker/Datepicker.js +11 -8
- package/dist/components/Datepicker/DatepickerCore.js +19 -16
- package/dist/components/Datepicker/index.js +1 -0
- package/dist/components/Dialog/Dialog.js +1 -0
- package/dist/components/Dialog/index.js +1 -0
- package/dist/components/DiffViewer/DiffViewer.js +1 -0
- package/dist/components/DiffViewer/index.js +1 -0
- package/dist/components/Disclosure/Disclosure.js +1 -0
- package/dist/components/Disclosure/index.js +1 -0
- package/dist/components/Divider/Divider.js +1 -0
- package/dist/components/Divider/index.js +1 -0
- package/dist/components/Drawer/Drawer.js +1 -0
- package/dist/components/Drawer/index.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuContext.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuTrigger.js +1 -0
- package/dist/components/DropdownMenu/index.js +1 -0
- package/dist/components/Empty/Empty.js +22 -19
- package/dist/components/Empty/index.js +1 -0
- package/dist/components/FileInput/FileInput.js +15 -13
- package/dist/components/FileInput/index.js +1 -0
- package/dist/components/Flex/Flex.js +1 -0
- package/dist/components/Flex/index.js +1 -0
- package/dist/components/Grid/Grid.js +1 -0
- package/dist/components/Grid/GridItem.js +1 -0
- package/dist/components/Grid/index.js +1 -0
- package/dist/components/HoverCard/HoverCard.js +54 -0
- package/dist/components/HoverCard/index.js +3 -0
- package/dist/components/Icon/Icon.js +1 -0
- package/dist/components/Icon/index.js +1 -0
- package/dist/components/Image/Image.js +1 -0
- package/dist/components/Image/index.js +1 -0
- package/dist/components/InlineEdit/InlineEdit.js +33 -31
- package/dist/components/InlineEdit/index.js +1 -0
- package/dist/components/Input/Input.js +1 -0
- package/dist/components/Input/InputCore.js +1 -0
- package/dist/components/Input/index.js +1 -0
- package/dist/components/Kbd/Kbd.js +22 -0
- package/dist/components/Kbd/index.js +3 -0
- package/dist/components/List/List.js +1 -0
- package/dist/components/List/ListItem.js +1 -0
- package/dist/components/List/index.js +1 -0
- package/dist/components/LocaleProvider/LocaleContext.js +6 -0
- package/dist/components/LocaleProvider/LocaleProvider.js +22 -0
- package/dist/components/LocaleProvider/index.js +6 -0
- package/dist/components/LocaleProvider/locale.js +132 -0
- package/dist/components/LocaleProvider/useStrings.js +27 -0
- package/dist/components/LocaleProvider/zh-cn.js +128 -0
- package/dist/components/LogViewer/LogViewer.js +45 -43
- package/dist/components/LogViewer/index.js +1 -0
- package/dist/components/MarkdownRenderer/MarkdownRenderer.js +20 -19
- package/dist/components/MarkdownRenderer/index.js +1 -0
- package/dist/components/MarkdownRenderer/markdown-blocks.js +42 -0
- package/dist/components/Mentions/Mentions.js +17 -0
- package/dist/components/Mentions/MentionsCore.js +116 -0
- package/dist/components/Mentions/index.js +4 -0
- package/dist/components/Menu/Menu.js +1 -0
- package/dist/components/Menu/MenuDivider.js +1 -0
- package/dist/components/Menu/MenuItem.js +1 -0
- package/dist/components/Menu/index.js +1 -0
- package/dist/components/ModelPicker/ModelPicker.js +17 -15
- package/dist/components/ModelPicker/index.js +1 -0
- package/dist/components/NavigationBar/NavLink.js +1 -0
- package/dist/components/NavigationBar/NavigationBar.js +1 -0
- package/dist/components/NavigationBar/index.js +1 -0
- package/dist/components/NumberInput/NumberInput.js +1 -0
- package/dist/components/NumberInput/NumberInputCore.js +35 -33
- package/dist/components/NumberInput/index.js +1 -0
- package/dist/components/OTPInput/OTPInput.js +1 -0
- package/dist/components/OTPInput/OTPInputCore.js +36 -30
- package/dist/components/OTPInput/index.js +1 -0
- package/dist/components/Pagination/Pagination.js +32 -30
- package/dist/components/Pagination/index.js +1 -0
- package/dist/components/PasswordInput/PasswordInput.js +1 -0
- package/dist/components/PasswordInput/PasswordInputCore.js +23 -21
- package/dist/components/PasswordInput/index.js +1 -0
- package/dist/components/Popover/Popover.js +1 -0
- package/dist/components/Popover/index.js +1 -0
- package/dist/components/Progress/Progress.js +41 -39
- package/dist/components/Progress/index.js +1 -0
- package/dist/components/Radio/Radio.js +1 -0
- package/dist/components/Radio/RadioContext.js +1 -0
- package/dist/components/Radio/RadioGroup.js +1 -0
- package/dist/components/Radio/RadioGroupCore.js +1 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/Rating/Rating.js +1 -0
- package/dist/components/Rating/RatingCore.js +29 -26
- package/dist/components/Rating/index.js +1 -0
- package/dist/components/Resizable/Resizable.js +1 -0
- package/dist/components/Resizable/index.js +1 -0
- package/dist/components/ScrollArea/ScrollArea.js +1 -0
- package/dist/components/ScrollArea/index.js +1 -0
- package/dist/components/Segmented/Segmented.js +1 -0
- package/dist/components/Segmented/SegmentedCore.js +1 -0
- package/dist/components/Segmented/index.js +1 -0
- package/dist/components/Select/Option.js +1 -0
- package/dist/components/Select/Select.js +1 -0
- package/dist/components/Select/SelectCore.js +1 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Sidebar/Sidebar.js +113 -0
- package/dist/components/Sidebar/index.js +3 -0
- package/dist/components/Skeleton/Skeleton.js +1 -0
- package/dist/components/Skeleton/index.js +1 -0
- package/dist/components/Slider/Slider.js +1 -0
- package/dist/components/Slider/SliderCore.js +1 -0
- package/dist/components/Slider/index.js +1 -0
- package/dist/components/Spinner/Spinner.js +15 -12
- package/dist/components/Spinner/index.js +1 -0
- package/dist/components/Stat/Stat.js +1 -0
- package/dist/components/Stat/index.js +1 -0
- package/dist/components/StepTimeline/StepTimeline.js +1 -0
- package/dist/components/StepTimeline/index.js +1 -0
- package/dist/components/Stepper/Step.js +1 -0
- package/dist/components/Stepper/Stepper.js +1 -0
- package/dist/components/Stepper/StepperContext.js +1 -0
- package/dist/components/Stepper/index.js +1 -0
- package/dist/components/StreamingText/StreamingText.js +39 -18
- package/dist/components/StreamingText/index.js +1 -0
- package/dist/components/SwipeAction/SwipeAction.js +1 -0
- package/dist/components/SwipeAction/index.js +1 -0
- package/dist/components/Switch/Switch.js +1 -0
- package/dist/components/Switch/SwitchCore.js +1 -0
- package/dist/components/Switch/index.js +1 -0
- package/dist/components/Table/Table.js +1 -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/Table/index.js +1 -0
- package/dist/components/Tabs/Tab.js +1 -0
- package/dist/components/Tabs/TabList.js +1 -0
- package/dist/components/Tabs/TabPanel.js +1 -0
- package/dist/components/Tabs/Tabs.js +1 -0
- package/dist/components/Tabs/TabsContext.js +1 -0
- package/dist/components/Tabs/index.js +1 -0
- package/dist/components/Tag/Tag.js +17 -14
- package/dist/components/Tag/index.js +1 -0
- package/dist/components/TagGroup/TagGroup.js +1 -0
- package/dist/components/TagGroup/TagGroupItem.js +13 -10
- package/dist/components/TagGroup/index.js +1 -0
- package/dist/components/TagInput/TagInput.js +1 -0
- package/dist/components/TagInput/TagInputCore.js +53 -50
- package/dist/components/TagInput/index.js +1 -0
- package/dist/components/Textarea/Textarea.js +1 -0
- package/dist/components/Textarea/TextareaCore.js +1 -0
- package/dist/components/Textarea/index.js +1 -0
- package/dist/components/ThinkingIndicator/ThinkingIndicator.js +14 -11
- package/dist/components/ThinkingIndicator/index.js +1 -0
- package/dist/components/TimePicker/TimePicker.js +1 -0
- package/dist/components/TimePicker/TimePickerCore.js +1 -0
- package/dist/components/TimePicker/index.js +1 -0
- package/dist/components/Timeline/Timeline.js +1 -0
- package/dist/components/Timeline/index.js +1 -0
- package/dist/components/Toast/Toast.js +36 -30
- package/dist/components/Toast/ToastContainer.js +45 -28
- package/dist/components/Toast/ToastContext.js +1 -0
- package/dist/components/Toast/index.js +5 -3
- package/dist/components/Toast/toast2.js +45 -0
- package/dist/components/Toast/useToast.js +1 -0
- package/dist/components/TokenCounter/TokenCounter.js +20 -18
- package/dist/components/TokenCounter/index.js +1 -0
- package/dist/components/ToolCallCard/ToolCallCard.js +40 -37
- package/dist/components/ToolCallCard/index.js +1 -0
- package/dist/components/Toolbar/Toolbar.js +60 -0
- package/dist/components/Toolbar/ToolbarButton.js +26 -0
- package/dist/components/Toolbar/ToolbarContext.js +9 -0
- package/dist/components/Toolbar/ToolbarSeparator.js +23 -0
- package/dist/components/Toolbar/index.js +5 -0
- package/dist/components/Tooltip/Tooltip.js +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/Tour/Tour.js +198 -0
- package/dist/components/Tour/index.js +3 -0
- package/dist/components/Transfer/Transfer.js +1 -0
- package/dist/components/Transfer/TransferCore.js +62 -67
- package/dist/components/Transfer/index.js +1 -0
- package/dist/components/Tree/Tree.js +1 -0
- package/dist/components/Tree/TreeItem.js +57 -55
- package/dist/components/Tree/index.js +1 -0
- package/dist/components/Tree/utils.js +1 -0
- package/dist/components/Typography/Typography.js +1 -0
- package/dist/components/Typography/index.js +1 -0
- package/dist/components/Upload/Upload.js +1 -0
- package/dist/components/Upload/UploadCore.js +37 -35
- package/dist/components/Upload/index.js +1 -0
- package/dist/components/VirtualList/VirtualList.js +141 -26
- package/dist/components/VirtualList/index.js +1 -0
- package/dist/css/accordion.css +1 -1
- package/dist/css/affix.css +1 -1
- package/dist/css/alert.css +1 -1
- package/dist/css/approval-card.css +1 -1
- package/dist/css/async-section.css +1 -1
- package/dist/css/avatar-group.css +2 -0
- package/dist/css/back-to-top.css +1 -1
- package/dist/css/breadcrumb.css +1 -1
- package/dist/css/button.css +1 -1
- package/dist/css/calendar.css +2 -0
- package/dist/css/carousel.css +1 -1
- package/dist/css/cascader.css +2 -0
- package/dist/css/chat-input.css +1 -1
- package/dist/css/chat-message.css +1 -1
- package/dist/css/checkbox.css +1 -1
- package/dist/css/chip.css +1 -1
- package/dist/css/code-block.css +1 -1
- package/dist/css/color-picker.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/command.css +1 -1
- package/dist/css/container.css +1 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/conversation-list.css +1 -1
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-range-picker.css +1 -1
- package/dist/css/datepicker.css +1 -2
- package/dist/css/diff-viewer.css +1 -1
- package/dist/css/disclosure.css +1 -1
- package/dist/css/dropdown-menu.css +1 -1
- package/dist/css/file-input.css +1 -1
- package/dist/css/hover-card.css +2 -0
- package/dist/css/inline-edit.css +1 -1
- package/dist/css/input.css +1 -1
- package/dist/css/kbd.css +2 -0
- package/dist/css/list.css +1 -1
- package/dist/css/log-viewer.css +1 -1
- package/dist/css/markdown-renderer.css +1 -1
- package/dist/css/mentions.css +2 -0
- package/dist/css/menu.css +1 -1
- package/dist/css/model-picker.css +1 -1
- package/dist/css/navigation-bar.css +2 -2
- package/dist/css/number-input.css +1 -1
- package/dist/css/otp-input.css +1 -1
- package/dist/css/pagination.css +1 -1
- package/dist/css/password-input.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/select.css +1 -1
- package/dist/css/sidebar.css +2 -0
- package/dist/css/slider.css +1 -1
- package/dist/css/step-timeline.css +1 -1
- package/dist/css/stepper.css +1 -1
- package/dist/css/streaming-text.css +1 -1
- package/dist/css/swipe-action.css +1 -1
- package/dist/css/switch.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/tabs.css +1 -1
- package/dist/css/tag-input.css +1 -1
- package/dist/css/tag.css +1 -1
- package/dist/css/textarea.css +1 -1
- package/dist/css/time-picker.css +1 -1
- package/dist/css/token-counter.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/dist/css/toolbar.css +4 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/tree.css +1 -1
- package/dist/css/upload.css +1 -1
- package/dist/css/virtual-list.css +1 -1
- package/dist/css-manifest.json +29 -1
- package/dist/form/FormItem.js +1 -0
- package/dist/form/index.js +1 -0
- package/dist/haze-ui.css +74 -63
- package/dist/hooks/useClipboard.js +30 -0
- package/dist/hooks/useDebouncedCallback.js +17 -0
- package/dist/hooks/useDebouncedValue.js +12 -0
- package/dist/hooks/useMediaQuery.js +13 -0
- package/dist/hooks/usePrefersReducedMotion.js +9 -0
- package/dist/hooks/useTitle.js +1 -0
- package/dist/index.js +139 -115
- package/dist/registry.json +247 -0
- package/dist/tokens/colors.js +1 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/motion.js +1 -0
- package/dist/tokens/oklch.js +1 -0
- package/dist/tokens/palette.js +1 -0
- package/dist/tokens/registry.js +1 -0
- package/dist/tokens/spacing.js +1 -0
- package/dist/tokens/typography.js +1 -0
- package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +9 -0
- package/dist/types/components/AvatarGroup/index.d.ts +2 -0
- package/dist/types/components/Calendar/Calendar.d.ts +21 -0
- package/dist/types/components/Calendar/date.d.ts +79 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/components/Cascader/Cascader.d.ts +26 -0
- package/dist/types/components/Cascader/index.d.ts +2 -0
- package/dist/types/components/Combobox/Combobox.d.ts +7 -1
- package/dist/types/components/Combobox/ComboboxOption.d.ts +13 -1
- package/dist/types/components/DataTable/DataTable.d.ts +102 -0
- package/dist/types/components/DataTable/index.d.ts +2 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +3 -1
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +3 -1
- package/dist/types/components/HoverCard/HoverCard.d.ts +49 -0
- package/dist/types/components/HoverCard/index.d.ts +2 -0
- package/dist/types/components/Kbd/Kbd.d.ts +6 -0
- package/dist/types/components/Kbd/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/LocaleContext.d.ts +19 -0
- package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +16 -0
- package/dist/types/components/LocaleProvider/index.d.ts +7 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +182 -0
- package/dist/types/components/LocaleProvider/useStrings.d.ts +10 -0
- package/dist/types/components/LocaleProvider/zh-cn.d.ts +13 -0
- package/dist/types/components/MarkdownRenderer/markdown-blocks.d.ts +6 -0
- package/dist/types/components/Mentions/Mentions.d.ts +17 -0
- package/dist/types/components/Mentions/MentionsCore.d.ts +21 -0
- package/dist/types/components/Mentions/index.d.ts +4 -0
- package/dist/types/components/Sidebar/Sidebar.d.ts +64 -0
- package/dist/types/components/Sidebar/index.d.ts +4 -0
- package/dist/types/components/Toast/index.d.ts +2 -0
- package/dist/types/components/Toast/toast.d.ts +46 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +16 -0
- package/dist/types/components/Toolbar/ToolbarButton.d.ts +20 -0
- package/dist/types/components/Toolbar/ToolbarContext.d.ts +5 -0
- package/dist/types/components/Toolbar/ToolbarSeparator.d.ts +14 -0
- package/dist/types/components/Toolbar/index.d.ts +6 -0
- package/dist/types/components/Tour/Tour.d.ts +46 -0
- package/dist/types/components/Tour/index.d.ts +2 -0
- package/dist/types/components/VirtualList/VirtualList.d.ts +58 -4
- package/dist/types/components/VirtualList/index.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/hooks/useClipboard.d.ts +31 -0
- package/dist/types/hooks/useDebouncedCallback.d.ts +21 -0
- package/dist/types/hooks/useDebouncedValue.d.ts +20 -0
- package/dist/types/hooks/useMediaQuery.d.ts +17 -0
- package/dist/types/hooks/usePrefersReducedMotion.d.ts +14 -0
- package/dist/types/index.d.ts +28 -4
- package/dist/utils/classnames.js +1 -0
- package/dist/utils/collision.js +1 -0
- package/dist/utils/floating.js +1 -0
- package/dist/utils/focus-scope.js +1 -0
- package/dist/utils/focus.js +1 -0
- package/dist/utils/menuKeyboard.js +1 -0
- package/dist/utils/presence.js +1 -0
- package/package.json +34 -18
- package/dist/components/Datepicker/Calendar.js +0 -120
- package/dist/types/components/Datepicker/Calendar.d.ts +0 -8
package/README.md
CHANGED
|
@@ -10,10 +10,19 @@ English | [简体中文](./README-zh_CN.md)
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- Integrated [react use control](https://github.com/wmzy/react-use-control) provides component internal states
|
|
13
|
+
- Built for React 19+ (`ref` as a prop, `ControlOrValue<T>` state protocol) — no React 18 compatibility layer
|
|
13
14
|
- Keep strict, provide lightweight, composable, and easily extendable components
|
|
14
15
|
- Support themes customization
|
|
15
16
|
- Support Tree-shaking
|
|
16
17
|
|
|
18
|
+
## Why npm-distributed (not copy-paste)
|
|
19
|
+
|
|
20
|
+
**Interaction states are formulas, not values.** Every hover/active/subtle/focus-ring color is a CSS relative-color expression — `oklch(from var(--haze-color-primary) calc(l - 0.045) c h)` — baked into `tokens.css`. Override `--haze-color-primary` on a theme class and the entire interaction-state family re-derives at runtime in the browser, no rebuild, no codegen. In a copy-paste setup every pasted file owns its own copy of that formula, and each theme tweak means re-applying it by hand, file by file.
|
|
21
|
+
|
|
22
|
+
**`haze-ui/css-manifest.json` is machine-readable data.** The authoritative export → CSS-file mapping (family absorption included) is regenerated on every build, so bundler plugins and codemods read one source of truth instead of re-deriving kebab-case file names. A directory of pasted components has no equivalent — the mapping exists only in your head or your fork, and it drifts.
|
|
23
|
+
|
|
24
|
+
**The `ControlOrValue<T>` protocol needs a real runtime.** One prop — `checked?: Control<T> | T` — covers controlled *and* uncontrolled usage because `react-use-control` carries the wiring; a published package is the contract that keeps that behavior identical across every component and version. None of this is hostile to the shadcn / Base UI ecosystem: haze-ui tokens are plain CSS custom properties, so they interoperate with a Tailwind v4 `@theme` block, and haze components compose alongside copy-pasted primitives wherever each fits.
|
|
25
|
+
|
|
17
26
|
## Getting Started
|
|
18
27
|
|
|
19
28
|
### Installation
|
|
@@ -24,6 +33,46 @@ npm i haze-ui
|
|
|
24
33
|
pnpm add haze-ui
|
|
25
34
|
```
|
|
26
35
|
|
|
36
|
+
### React 19+ by design
|
|
37
|
+
|
|
38
|
+
The peer range is `react: ^19.0.0` on purpose — haze-ui is built on
|
|
39
|
+
modern React rather than carrying a compatibility layer for 18:
|
|
40
|
+
|
|
41
|
+
- **`ref` as a prop.** React 19 passes `ref` to function components
|
|
42
|
+
directly, so components that expose refs accept one prop instead of a
|
|
43
|
+
`forwardRef` wrapper layer.
|
|
44
|
+
- **A modern-platform baseline.** Floating panels (Popover, DropdownMenu,
|
|
45
|
+
Tooltip, ContextMenu, Combobox, Datepicker) choose between three tiers
|
|
46
|
+
by feature detection — native `popover` + CSS anchor positioning,
|
|
47
|
+
`popover` alone, or a JS fallback — with the newest platform features
|
|
48
|
+
as the primary path, not an enhancement layered on top.
|
|
49
|
+
- **`ControlOrValue<T>`** — the `Control<T> | T` state protocol — is
|
|
50
|
+
designed for modern React semantics throughout.
|
|
51
|
+
|
|
52
|
+
On React 18? Upgrade first. haze-ui ships no React 18 compatibility
|
|
53
|
+
layer, and none is planned.
|
|
54
|
+
|
|
55
|
+
### Optional peer dependencies
|
|
56
|
+
|
|
57
|
+
haze-ui's only required runtime dependency is `react-use-control` — the
|
|
58
|
+
engine behind `ControlOrValue<T>`. Two integrations are optional peers,
|
|
59
|
+
installed only when you use the components that need them:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
npm i react-f0rm # FormItem (peer range ^1.1.1)
|
|
63
|
+
npm i @tanstack/react-table # DataTable (peer range ^9.2.4)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Everything else — `Button`, `Input`, `Dialog`, `Select`, … — runs with
|
|
67
|
+
nothing beyond `react` and `react-use-control`. The dist is ESM with
|
|
68
|
+
`preserveModules` and side-effect-free JS, so bundlers (Next.js, Vite,
|
|
69
|
+
webpack, Turbopack, Rollup) tree-shake the unused re-export chains and
|
|
70
|
+
never resolve peers you haven't installed: `import { Button } from
|
|
71
|
+
'haze-ui'` works without `react-f0rm`. Only bundler-less consumers
|
|
72
|
+
(bare Node ESM importing the barrel, which links the module graph
|
|
73
|
+
eagerly) must install both peers; the `haze-ui/form` and
|
|
74
|
+
`haze-ui/components/DataTable` subpaths bypass the barrel entirely.
|
|
75
|
+
|
|
27
76
|
### Browser support
|
|
28
77
|
|
|
29
78
|
Since v1.13, haze-ui colors are generated in **OKLCH**, with interaction
|
|
@@ -75,6 +124,27 @@ included); `noCss` lists pure-logic exports with no css of their own.
|
|
|
75
124
|
Bundler plugins and codemods should read this manifest instead of
|
|
76
125
|
re-deriving file names — the mapping changes in lockstep with the build.
|
|
77
126
|
|
|
127
|
+
### Server Components (Next.js App Router)
|
|
128
|
+
|
|
129
|
+
Every JS module in `dist/` starts with the `'use client'` directive,
|
|
130
|
+
injected at build time — the same convention Radix, Base UI and React
|
|
131
|
+
Aria ship. In an App Router project you import haze-ui straight from
|
|
132
|
+
your client components; there is no need for a wrapper module that
|
|
133
|
+
re-exports the library under its own `'use client'` banner:
|
|
134
|
+
|
|
135
|
+
```jsx
|
|
136
|
+
// any client component — import straight from the package
|
|
137
|
+
import { Button } from 'haze-ui';
|
|
138
|
+
|
|
139
|
+
export function Actions() {
|
|
140
|
+
return <Button>Start</Button>;
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
CSS loading is unchanged from the two modes above — `haze-ui/styles.css`
|
|
145
|
+
in the root layout, or the `haze-ui/css/*` subpaths. A runnable Next.js
|
|
146
|
+
15 project lives in [`examples/nextjs`](./examples/nextjs).
|
|
147
|
+
|
|
78
148
|
## ButtonLink: a real anchor with the Button skin
|
|
79
149
|
|
|
80
150
|
Navigation that must look like a button should still *be* a link —
|
|
@@ -152,6 +222,53 @@ function SettingsView() {
|
|
|
152
222
|
}
|
|
153
223
|
```
|
|
154
224
|
|
|
225
|
+
## Design tokens export (Figma)
|
|
226
|
+
|
|
227
|
+
`toDesignTokens()` converts the token registry into a [W3C Design Tokens](https://tr.designtokens.org/) JSON file — grouped by category (`color` / `font` / `spacing` / `dimension` / `shadow`), each token carrying a W3C `$type` and the source CSS variable in `$extensions['haze-ui.css-var']`, with `$value` being the resolved value of the chosen theme (`light` by default). The Theme Editor ships a one-click entry: the **Export W3C tokens (.json)** button in the toolbar downloads the file for the mode currently being edited, live edits included. The exported file can be imported directly into Figma Tokens / Tokens Studio.
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"color": {
|
|
232
|
+
"color-primary": {
|
|
233
|
+
"$value": "oklch(0.563 0.241 260.8)",
|
|
234
|
+
"$type": "color",
|
|
235
|
+
"$extensions": { "haze-ui.css-var": "--haze-color-primary" }
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"spacing": {
|
|
239
|
+
"space-2": {
|
|
240
|
+
"$value": "8px",
|
|
241
|
+
"$type": "dimension",
|
|
242
|
+
"$extensions": { "haze-ui.css-var": "--haze-space-2" }
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## AI-friendly distribution
|
|
249
|
+
|
|
250
|
+
**llms.txt** — a markdown overview of the whole library (the `ControlOrValue<T>`
|
|
251
|
+
state protocol, both CSS loading modes, all 101 components grouped with one-line
|
|
252
|
+
purposes, the token system, the floating-overlay tiers, form integration) written
|
|
253
|
+
for AI coding tools and crawlers. It lives at the repo root
|
|
254
|
+
([llms.txt](./llms.txt)) and, on the docs site, at
|
|
255
|
+
<https://wmzy.github.io/haze-ui/llms.txt> (`build:demo` copies it into `dist/`).
|
|
256
|
+
|
|
257
|
+
**registry.json** — a shadcn/ui-compatible registry shipped as the
|
|
258
|
+
`haze-ui/registry.json` npm artifact (regenerated by `scripts/generate-registry.mjs`
|
|
259
|
+
on every build), also reachable at <https://unpkg.com/haze-ui/registry.json>.
|
|
260
|
+
Consume it with the shadcn CLI:
|
|
261
|
+
|
|
262
|
+
```sh
|
|
263
|
+
pnpm dlx shadcn@latest add https://unpkg.com/haze-ui/registry.json
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
To be precise about coverage: it contains only the **agent components** (the
|
|
267
|
+
AI & Chat group plus AsyncSection). Each item is a wrapper file, not vendored
|
|
268
|
+
source — it re-exports the published component and imports its stylesheet, so
|
|
269
|
+
haze-ui stays an npm dependency that keeps updating underneath; treat the
|
|
270
|
+
generated file as your customization layer.
|
|
271
|
+
|
|
155
272
|
## react-f0rm Integration
|
|
156
273
|
|
|
157
274
|
react-f0rm owns form field state, and its headless `useField` hook is
|
|
@@ -424,6 +541,95 @@ All three are optional; omit them and the field behaves exactly as
|
|
|
424
541
|
before (immediate validation per the form's `mode`, immediate error
|
|
425
542
|
display, `validate`-only).
|
|
426
543
|
|
|
544
|
+
## Accessibility & RTL
|
|
545
|
+
|
|
546
|
+
Accessibility is a baseline, not an opt-in: every component's test suite
|
|
547
|
+
includes axe checks, and the token sheet ships a global
|
|
548
|
+
`@media (prefers-reduced-motion: reduce)` block that collapses every
|
|
549
|
+
animation duration token to `0ms` — motion-sensitive users get instant
|
|
550
|
+
state changes with no per-component wiring.
|
|
551
|
+
|
|
552
|
+
haze-ui supports RTL via CSS logical properties wherever a side is
|
|
553
|
+
semantic (the *start/end* of reading flow), not just decorative. Set
|
|
554
|
+
`dir="rtl"` (or `direction: rtl`) on an ancestor and those sides mirror
|
|
555
|
+
automatically — no component props change. A regression smoke test
|
|
556
|
+
(`src/lib/rtl.test.tsx`) renders Progress, Alert, Badge, Tag and Dialog
|
|
557
|
+
in a `dir="rtl"` subtree asserting rendering, axe cleanliness and
|
|
558
|
+
unchanged aria contracts.
|
|
559
|
+
|
|
560
|
+
### Direction-responsive by construction (no physical CSS)
|
|
561
|
+
|
|
562
|
+
- **Progress (bar)** — the fill is a normal-flow block with a percentage
|
|
563
|
+
`width`, so it grows from the inline-start edge (right in RTL) with no
|
|
564
|
+
`left`/`right` in its CSS.
|
|
565
|
+
- **Slider** — a native `<input type="range">`; the browser mirrors fill
|
|
566
|
+
and thumb under `dir="rtl"`.
|
|
567
|
+
- **Flex gap / `flex-direction: row`** — gap and row order follow the
|
|
568
|
+
writing mode, so icon-to-label spacing in Tag, ChatMessage, Alert, etc.
|
|
569
|
+
mirrors for free.
|
|
570
|
+
- **Carousel track scrolling** — uses `scrollIntoView({ inline: 'start' })`,
|
|
571
|
+
a logical scroll position.
|
|
572
|
+
|
|
573
|
+
### Fixed: physical → logical conversions
|
|
574
|
+
|
|
575
|
+
| File | Change |
|
|
576
|
+
| --- | --- |
|
|
577
|
+
| `Carousel.tsx` | prev/next buttons `left`/`right` → `inset-inline-start`/`inset-inline-end`, plus a `[dir='rtl']` `scale: -1 1` mirror so the `‹`/`›` glyphs point along the reading direction |
|
|
578
|
+
| `ChatMessage.tsx` | bubble tail corners `border-bottom-right-radius` / `border-bottom-left-radius` → `border-end-end-radius` / `border-end-start-radius` (tail follows the bubble's anchored side) |
|
|
579
|
+
| `Chip.tsx` | close-button `margin-left` → `margin-inline-start` |
|
|
580
|
+
| `Container.tsx` | `margin-left/right: auto` → `margin-inline: auto`; `padding-left/right` → `padding-inline` |
|
|
581
|
+
| `ContextMenuItem.tsx`, `DropdownMenuItem.tsx`, `MenuItem.tsx`, `ConversationItem.tsx` | `text-align: left` → `text-align: start` |
|
|
582
|
+
| `DiffViewer.tsx` | line-number gutter `text-align: right` → `end`, `border-right` → `border-inline-end` (gutter stays on the leading side) |
|
|
583
|
+
| `List.tsx` | `padding-left` → `padding-inline-start` (list indent), both variants |
|
|
584
|
+
| `NavigationBar.tsx` | end-slot `margin-left: auto` → `margin-inline-start: auto` |
|
|
585
|
+
| `StepTimeline.tsx` | connector line `left` → `inset-inline-start` (stays under the inline-start marker column) |
|
|
586
|
+
| `Stepper/Step.tsx` | connector `left: 50%` → `inset-inline-start: 50%` (extends toward the next step) |
|
|
587
|
+
| `TableHead.tsx` | `th { text-align: left }` → `start` |
|
|
588
|
+
| `TreeItem.tsx` | checkbox/icon `margin-right` → `margin-inline-end`; indent guide `border-left` → `border-inline-start` |
|
|
589
|
+
|
|
590
|
+
Kept physical on purpose — glyph geometry or symmetric layout, not
|
|
591
|
+
reading-flow sides: the rotated border chevrons in Accordion/Disclosure,
|
|
592
|
+
Checkbox's rotated checkmark, Radio's centered dot, Affix's symmetric
|
|
593
|
+
`left: 0; right: 0` stretch.
|
|
594
|
+
|
|
595
|
+
### Partial support: known gaps
|
|
596
|
+
|
|
597
|
+
- **Floating panels (Popover, DropdownMenu, Tooltip, ContextMenu,
|
|
598
|
+
Combobox, Datepicker)** — placements are physical sides
|
|
599
|
+
(`'left'`/`'right'`/`'bottom-end'`, …). The CSS anchor-positioning
|
|
600
|
+
`position-area` grid keywords and the JS collision math
|
|
601
|
+
(`utils/collision.ts`, viewport coordinates) are physical; migrating to
|
|
602
|
+
logical `position-area` keywords is a tracked future change. In RTL the
|
|
603
|
+
panels position identically to LTR.
|
|
604
|
+
- **Input adornments** — `SelectCore` / `ModelPicker` chevrons
|
|
605
|
+
(`background-position: right …` + `padding-right`) and
|
|
606
|
+
`PasswordInputCore`'s absolute reveal button sit on the physical right
|
|
607
|
+
with matching padding. Consistent under RTL, but not mirrored.
|
|
608
|
+
- **Progress (circle)** — SVG `stroke-dashoffset` fill runs clockwise
|
|
609
|
+
regardless of direction (SVG has no inline axis).
|
|
610
|
+
- **Physical-by-design placement APIs** — `Drawer` `placement`
|
|
611
|
+
(`'left'`/`'right'`), `Toast` placement (`'top-left'`, …),
|
|
612
|
+
`SwipeAction` left/right action edges, `BackToTop`'s bottom-right
|
|
613
|
+
corner, `CodeBlock`'s top-right language badge: the side is the API,
|
|
614
|
+
so it stays physical.
|
|
615
|
+
|
|
616
|
+
### Workaround for remaining gaps
|
|
617
|
+
|
|
618
|
+
Wrap with `dir="rtl"` for everything above; for the physical-by-design
|
|
619
|
+
cases, override with logical insets through the `className` every
|
|
620
|
+
component accepts:
|
|
621
|
+
|
|
622
|
+
```jsx
|
|
623
|
+
<Drawer placement="right" className="rtl-drawer" />
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
```css
|
|
627
|
+
[dir='rtl'] .rtl-drawer {
|
|
628
|
+
/* nudge a physical placement back to the reading-flow side */
|
|
629
|
+
inset-inline-end: 0;
|
|
630
|
+
}
|
|
631
|
+
```
|
|
632
|
+
|
|
427
633
|
## Related Projects
|
|
428
634
|
|
|
429
635
|
- [react-use-control](https://github.com/wmzy/react-use-control)
|
|
@@ -458,3 +664,34 @@ import 'haze-ui/css/button.css';
|
|
|
458
664
|
|
|
459
665
|
No — haze-ui is ESM-only (`"type": "module"`). Use a bundler or runtime
|
|
460
666
|
with ESM support (Vite, webpack 5, Next.js, Node ≥ 18, …).
|
|
667
|
+
|
|
668
|
+
### Does haze-ui support React 18?
|
|
669
|
+
|
|
670
|
+
No — the peer range is `react@^19.0.0` by design (see
|
|
671
|
+
[React 19+ by design](#react-19-by-design)). Upgrade to React 19 first;
|
|
672
|
+
haze-ui ships no React 18 compatibility layer.
|
|
673
|
+
|
|
674
|
+
### How do I detect (or degrade) the relative-color syntax?
|
|
675
|
+
|
|
676
|
+
Since v1.13, theme interaction states are derived with CSS relative
|
|
677
|
+
colors, so the browser baseline from [Browser support](#browser-support)
|
|
678
|
+
applies — Chrome/Edge 119+, Safari 16.4+, Firefox 128+, with no HSL/hex
|
|
679
|
+
fallbacks shipped. To gate your own fallback styling on support, probe
|
|
680
|
+
the syntax in CSS:
|
|
681
|
+
|
|
682
|
+
```css
|
|
683
|
+
@supports (color: oklch(from red calc(l + 0.05) 0 h)) {
|
|
684
|
+
/* relative colors available: derive custom states from tokens */
|
|
685
|
+
}
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
or from JS before deciding which stylesheet to load:
|
|
689
|
+
|
|
690
|
+
```js
|
|
691
|
+
if (CSS.supports('color: oklch(from red calc(l + 0.05) 0 h)')) {
|
|
692
|
+
// relative colors available — load the v1.13+ token sheet
|
|
693
|
+
} else {
|
|
694
|
+
// below baseline: pin a pre-OKLCH version or ship your own fallbacks
|
|
695
|
+
}
|
|
696
|
+
```
|
|
697
|
+
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
|
|
2
|
+
"use client";
|
|
2
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useControl as
|
|
6
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
7
|
+
import { useControl as i } from "react-use-control";
|
|
6
8
|
//#region src/lib/components/Alert/Alert.tsx
|
|
7
|
-
var
|
|
9
|
+
var a = "haze-Alert__base", o = {
|
|
8
10
|
info: "haze-Alert__info",
|
|
9
11
|
success: "haze-Alert__success",
|
|
10
12
|
warning: "haze-Alert__warning",
|
|
11
13
|
danger: "haze-Alert__danger"
|
|
12
|
-
},
|
|
13
|
-
function
|
|
14
|
-
let [
|
|
15
|
-
return
|
|
14
|
+
}, s = "haze-Alert__contentStyle", c = "haze-Alert__closeBtn";
|
|
15
|
+
function l({ visible: l, onClose: u, variant: d = "info", closable: f = !1, className: p, children: m }) {
|
|
16
|
+
let [h, g] = i(l, !0), _ = t("alert");
|
|
17
|
+
return h ? /* @__PURE__ */ r("div", {
|
|
16
18
|
role: "alert",
|
|
17
19
|
className: e([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
a,
|
|
21
|
+
o[d],
|
|
22
|
+
p
|
|
21
23
|
]),
|
|
22
|
-
children: [/* @__PURE__ */
|
|
23
|
-
className: o,
|
|
24
|
-
children: p
|
|
25
|
-
}), d && /* @__PURE__ */ t("button", {
|
|
26
|
-
type: "button",
|
|
24
|
+
children: [/* @__PURE__ */ n("div", {
|
|
27
25
|
className: s,
|
|
28
|
-
|
|
26
|
+
children: m
|
|
27
|
+
}), f && /* @__PURE__ */ n("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
className: c,
|
|
30
|
+
"aria-label": _.close,
|
|
29
31
|
onClick: () => {
|
|
30
|
-
|
|
32
|
+
g(!1), u?.();
|
|
31
33
|
},
|
|
32
34
|
children: "×"
|
|
33
35
|
})]
|
|
34
36
|
}) : null;
|
|
35
37
|
}
|
|
36
38
|
//#endregion
|
|
37
|
-
export {
|
|
39
|
+
export { l as default };
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
|
|
2
|
+
"use client";
|
|
2
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
6
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
7
|
//#region src/lib/components/ApprovalCard/ApprovalCard.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var i = "haze-ApprovalCard__card", a = "haze-ApprovalCard__header", o = "haze-ApprovalCard__body", s = "haze-ApprovalCard__desc", c = "haze-ApprovalCard__content", l = "haze-ApprovalCard__actions", u = "haze-ApprovalCard__btn", d = "haze-ApprovalCard__denyBtn", f = "haze-ApprovalCard__approveBtn";
|
|
9
|
+
function p({ title: p, description: m, onApprove: h, onDeny: g, approveText: _, denyText: v, children: y, className: b }) {
|
|
10
|
+
let x = t("approvalCard"), S = p ?? x.title, C = _ ?? x.approve, w = v ?? x.deny;
|
|
11
|
+
return /* @__PURE__ */ r("div", {
|
|
12
|
+
className: e([i, b]),
|
|
10
13
|
children: [
|
|
11
|
-
/* @__PURE__ */ t("div", {
|
|
12
|
-
className: e([i]),
|
|
13
|
-
children: f
|
|
14
|
-
}),
|
|
15
14
|
/* @__PURE__ */ n("div", {
|
|
16
15
|
className: e([a]),
|
|
17
|
-
children:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
children: S
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ r("div", {
|
|
19
|
+
className: e([o]),
|
|
20
|
+
children: [m && /* @__PURE__ */ n("div", {
|
|
21
21
|
className: e([s]),
|
|
22
|
-
children:
|
|
22
|
+
children: m
|
|
23
|
+
}), y && /* @__PURE__ */ n("div", {
|
|
24
|
+
className: e([c]),
|
|
25
|
+
children: y
|
|
23
26
|
})]
|
|
24
27
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
className: e([
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ r("div", {
|
|
29
|
+
className: e([l]),
|
|
30
|
+
children: [/* @__PURE__ */ n("button", {
|
|
28
31
|
type: "button",
|
|
29
|
-
onClick:
|
|
30
|
-
className: e([
|
|
31
|
-
children:
|
|
32
|
-
}), /* @__PURE__ */
|
|
32
|
+
onClick: g,
|
|
33
|
+
className: e([u, d]),
|
|
34
|
+
children: w
|
|
35
|
+
}), /* @__PURE__ */ n("button", {
|
|
33
36
|
type: "button",
|
|
34
|
-
onClick:
|
|
35
|
-
className: e([
|
|
36
|
-
children:
|
|
37
|
+
onClick: h,
|
|
38
|
+
className: e([u, f]),
|
|
39
|
+
children: C
|
|
37
40
|
})]
|
|
38
41
|
})
|
|
39
42
|
]
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
45
|
//#endregion
|
|
43
|
-
export {
|
|
46
|
+
export { p as default };
|
|
@@ -1,62 +1,65 @@
|
|
|
1
1
|
|
|
2
|
+
"use client";
|
|
2
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
6
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
7
|
//#region src/lib/components/AsyncSection/AsyncSection.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
|
|
8
|
+
var i = "haze-AsyncSection__base", a = "haze-AsyncSection__placeholder", o = "haze-AsyncSection__spin", s = "haze-AsyncSection__errorBox", c = "haze-AsyncSection__errorMessage", l = "haze-AsyncSection__retryButton";
|
|
9
|
+
function u({ loading: u = !1, error: d, onRetry: f, loadingText: p, errorText: m, retryText: h, className: g, children: _ }) {
|
|
10
|
+
let v = t("asyncSection"), y = p ?? v.loading, b = h ?? v.retry;
|
|
11
|
+
if (u) return /* @__PURE__ */ n("section", {
|
|
9
12
|
"aria-busy": "true",
|
|
10
|
-
className: e([
|
|
11
|
-
children:
|
|
13
|
+
className: e([i, g]),
|
|
14
|
+
children: r("div", {
|
|
12
15
|
role: "status",
|
|
13
|
-
className: e([
|
|
14
|
-
children: [/* @__PURE__ */
|
|
16
|
+
className: e([a]),
|
|
17
|
+
children: [/* @__PURE__ */ n("span", {
|
|
15
18
|
"aria-hidden": "true",
|
|
16
|
-
className: e([
|
|
17
|
-
children: /* @__PURE__ */
|
|
19
|
+
className: e([o]),
|
|
20
|
+
children: /* @__PURE__ */ r("svg", {
|
|
18
21
|
viewBox: "0 0 24 24",
|
|
19
22
|
fill: "none",
|
|
20
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ n("circle", {
|
|
22
25
|
cx: "12",
|
|
23
26
|
cy: "12",
|
|
24
27
|
r: "10",
|
|
25
28
|
stroke: "var(--haze-color-border)",
|
|
26
29
|
strokeWidth: "3"
|
|
27
|
-
}), /* @__PURE__ */
|
|
30
|
+
}), /* @__PURE__ */ n("path", {
|
|
28
31
|
d: "M12 2a10 10 0 0 1 10 10",
|
|
29
32
|
stroke: "var(--haze-color-primary)",
|
|
30
33
|
strokeWidth: "3",
|
|
31
34
|
strokeLinecap: "round"
|
|
32
35
|
})]
|
|
33
36
|
})
|
|
34
|
-
}),
|
|
37
|
+
}), y]
|
|
35
38
|
})
|
|
36
39
|
});
|
|
37
|
-
if (
|
|
38
|
-
let
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
className: e([
|
|
41
|
-
children:
|
|
40
|
+
if (d != null) {
|
|
41
|
+
let t = m ?? (d instanceof Error && d.message ? d.message : void 0) ?? v.error;
|
|
42
|
+
return /* @__PURE__ */ n("section", {
|
|
43
|
+
className: e([i, g]),
|
|
44
|
+
children: r("div", {
|
|
42
45
|
role: "alert",
|
|
43
|
-
className: e([
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
-
className: e([s]),
|
|
46
|
-
children: i
|
|
47
|
-
}), d && /* @__PURE__ */ t("button", {
|
|
48
|
-
type: "button",
|
|
49
|
-
onClick: d,
|
|
46
|
+
className: e([s]),
|
|
47
|
+
children: [/* @__PURE__ */ n("p", {
|
|
50
48
|
className: e([c]),
|
|
51
|
-
children:
|
|
49
|
+
children: t
|
|
50
|
+
}), f && /* @__PURE__ */ n("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
onClick: f,
|
|
53
|
+
className: e([l]),
|
|
54
|
+
children: b
|
|
52
55
|
})]
|
|
53
56
|
})
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
className: e([
|
|
58
|
-
children:
|
|
59
|
+
return /* @__PURE__ */ n("section", {
|
|
60
|
+
className: e([i, g]),
|
|
61
|
+
children: _
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
//#endregion
|
|
62
|
-
export {
|
|
65
|
+
export { u as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { formatString as t } from "../LocaleProvider/locale.js";
|
|
5
|
+
import { useStrings as n } from "../LocaleProvider/useStrings.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
8
|
+
import { Children as a } from "react";
|
|
9
|
+
//#region src/lib/components/AvatarGroup/AvatarGroup.tsx
|
|
10
|
+
var o = "haze-AvatarGroup__base", s = "haze-AvatarGroup__item", c = "haze-AvatarGroup__itemStacked", l = "haze-AvatarGroup__overflowChip";
|
|
11
|
+
function u({ max: u, total: d, className: f, children: p, ...m }) {
|
|
12
|
+
let h = n("avatarGroup"), g = a.toArray(p), _ = u === void 0 ? g.length : Math.max(u, 0), v = g.length > _, y = v ? g.slice(0, _) : g, b = d ?? g.length - _;
|
|
13
|
+
return /* @__PURE__ */ i("div", {
|
|
14
|
+
...m,
|
|
15
|
+
className: e([o, f]),
|
|
16
|
+
children: [y.map((t, n) => /* @__PURE__ */ r("span", {
|
|
17
|
+
className: e([s, n > 0 && c]),
|
|
18
|
+
children: t
|
|
19
|
+
}, n)), v && /* @__PURE__ */ r("span", {
|
|
20
|
+
className: e([
|
|
21
|
+
s,
|
|
22
|
+
l,
|
|
23
|
+
y.length > 0 && c
|
|
24
|
+
]),
|
|
25
|
+
children: t(h.more, { count: b })
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { u as default };
|