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
|
@@ -1,31 +1,33 @@
|
|
|
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/TokenCounter/TokenCounter.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
className: e([
|
|
11
|
-
children: [/* @__PURE__ */
|
|
12
|
-
className: e([
|
|
13
|
-
children: [/* @__PURE__ */
|
|
14
|
-
className: e([
|
|
8
|
+
var i = "haze-TokenCounter__wrapper", a = "haze-TokenCounter__bar", o = "haze-TokenCounter__fill", s = "haze-TokenCounter__fillNormal", c = "haze-TokenCounter__fillWarning", l = "haze-TokenCounter__fillDanger", u = "haze-TokenCounter__info", d = "haze-TokenCounter__count";
|
|
9
|
+
function f({ used: f, max: p, label: m, className: h }) {
|
|
10
|
+
let g = p > 0 ? Math.min(100, f / p * 100) : 0, _ = g > 90 ? l : g > 70 ? c : s, v = t("tokenCounter");
|
|
11
|
+
return /* @__PURE__ */ r("div", {
|
|
12
|
+
className: e([i, h]),
|
|
13
|
+
children: [/* @__PURE__ */ r("div", {
|
|
14
|
+
className: e([u]),
|
|
15
|
+
children: [/* @__PURE__ */ n("span", { children: m || v.label }), /* @__PURE__ */ r("span", {
|
|
16
|
+
className: e([d]),
|
|
15
17
|
children: [
|
|
16
|
-
|
|
18
|
+
f.toLocaleString(),
|
|
17
19
|
" / ",
|
|
18
|
-
|
|
20
|
+
p.toLocaleString()
|
|
19
21
|
]
|
|
20
22
|
})]
|
|
21
|
-
}), /* @__PURE__ */
|
|
22
|
-
className: e([
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
style: { width: `${
|
|
25
|
-
className: e([
|
|
23
|
+
}), /* @__PURE__ */ n("div", {
|
|
24
|
+
className: e([a]),
|
|
25
|
+
children: /* @__PURE__ */ n("div", {
|
|
26
|
+
style: { width: `${g}%` },
|
|
27
|
+
className: e([o, _])
|
|
26
28
|
})
|
|
27
29
|
})]
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
//#endregion
|
|
31
|
-
export {
|
|
33
|
+
export { f as default };
|
|
@@ -1,54 +1,57 @@
|
|
|
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/ToolCallCard/ToolCallCard.tsx
|
|
6
|
-
var
|
|
7
|
-
pending:
|
|
8
|
-
running:
|
|
9
|
-
done:
|
|
10
|
-
error:
|
|
11
|
-
}, h = {
|
|
12
|
-
pending: "Pending",
|
|
13
|
-
running: "Running...",
|
|
14
|
-
done: "Done",
|
|
15
|
-
error: "Error"
|
|
8
|
+
var i = "haze-ToolCallCard__card", a = "haze-ToolCallCard__header", o = "haze-ToolCallCard__statusIcon", s = "haze-ToolCallCard__statusPending", c = "haze-ToolCallCard__statusRunning", l = "haze-ToolCallCard__statusDone", u = "haze-ToolCallCard__statusError", d = "haze-ToolCallCard__body", f = "haze-ToolCallCard__section", p = "haze-ToolCallCard__sectionLabel", m = "haze-ToolCallCard__content", h = {
|
|
9
|
+
pending: s,
|
|
10
|
+
running: c,
|
|
11
|
+
done: l,
|
|
12
|
+
error: u
|
|
16
13
|
};
|
|
17
|
-
function g({ name:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
function g({ name: s, input: c, output: l, status: u = "pending", className: g }) {
|
|
15
|
+
let _ = t("toolCallCard"), v = {
|
|
16
|
+
pending: _.pending,
|
|
17
|
+
running: _.running,
|
|
18
|
+
done: _.done,
|
|
19
|
+
error: _.error
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ r("div", {
|
|
22
|
+
className: e([i, g]),
|
|
23
|
+
children: [/* @__PURE__ */ r("div", {
|
|
24
|
+
className: e([a]),
|
|
22
25
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ n("span", { className: e([o, h[u]]) }),
|
|
27
|
+
/* @__PURE__ */ n("span", { children: s }),
|
|
28
|
+
/* @__PURE__ */ n("span", {
|
|
26
29
|
style: {
|
|
27
|
-
|
|
30
|
+
marginInlineStart: "auto",
|
|
28
31
|
color: "var(--haze-color-text-muted)"
|
|
29
32
|
},
|
|
30
|
-
children:
|
|
33
|
+
children: v[u]
|
|
31
34
|
})
|
|
32
35
|
]
|
|
33
|
-
}), (
|
|
34
|
-
className: e([
|
|
35
|
-
children: [
|
|
36
|
-
className: e([
|
|
37
|
-
children: [/* @__PURE__ */
|
|
38
|
-
className: e([f]),
|
|
39
|
-
children: "Input"
|
|
40
|
-
}), /* @__PURE__ */ t("div", {
|
|
36
|
+
}), (c || l) && /* @__PURE__ */ r("div", {
|
|
37
|
+
className: e([d]),
|
|
38
|
+
children: [c && /* @__PURE__ */ r("div", {
|
|
39
|
+
className: e([f]),
|
|
40
|
+
children: [/* @__PURE__ */ n("div", {
|
|
41
41
|
className: e([p]),
|
|
42
|
-
children:
|
|
42
|
+
children: _.inputLabel
|
|
43
|
+
}), /* @__PURE__ */ n("div", {
|
|
44
|
+
className: e([m]),
|
|
45
|
+
children: c
|
|
43
46
|
})]
|
|
44
|
-
}),
|
|
45
|
-
className: e([
|
|
46
|
-
children: [/* @__PURE__ */
|
|
47
|
-
className: e([f]),
|
|
48
|
-
children: "Output"
|
|
49
|
-
}), /* @__PURE__ */ t("div", {
|
|
47
|
+
}), l && /* @__PURE__ */ r("div", {
|
|
48
|
+
className: e([f]),
|
|
49
|
+
children: [/* @__PURE__ */ n("div", {
|
|
50
50
|
className: e([p]),
|
|
51
|
-
children:
|
|
51
|
+
children: _.outputLabel
|
|
52
|
+
}), /* @__PURE__ */ n("div", {
|
|
53
|
+
className: e([m]),
|
|
54
|
+
children: l
|
|
52
55
|
})]
|
|
53
56
|
})]
|
|
54
57
|
})]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { getEnabledMenuItems as t, useRovingTabindex as n } from "../../utils/menuKeyboard.js";
|
|
5
|
+
import { ToolbarProvider as r } from "./ToolbarContext.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
8
|
+
import { useCallback as a, useRef as o } from "react";
|
|
9
|
+
//#region src/lib/components/Toolbar/Toolbar.tsx
|
|
10
|
+
var s = "[data-haze-toolbar-item]:not([disabled])", c = "haze-Toolbar__toolbar", l = "haze-Toolbar__vertical";
|
|
11
|
+
function u(e, n) {
|
|
12
|
+
return a((r) => {
|
|
13
|
+
let i = e === "horizontal" ? "ArrowRight" : "ArrowDown", a = e === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
14
|
+
if (r.key !== i && r.key !== a && r.key !== "Home" && r.key !== "End") return;
|
|
15
|
+
let o = t(n.current, s);
|
|
16
|
+
if (o.length === 0) return;
|
|
17
|
+
let c = o.indexOf(document.activeElement), l = (e) => o[e]?.focus();
|
|
18
|
+
switch (r.preventDefault(), r.key) {
|
|
19
|
+
case i:
|
|
20
|
+
l((c + 1) % o.length);
|
|
21
|
+
return;
|
|
22
|
+
case a:
|
|
23
|
+
l((c - 1 + o.length) % o.length);
|
|
24
|
+
return;
|
|
25
|
+
case "Home":
|
|
26
|
+
l(0);
|
|
27
|
+
return;
|
|
28
|
+
case "End":
|
|
29
|
+
l(o.length - 1);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}, [e, n]);
|
|
33
|
+
}
|
|
34
|
+
function d({ orientation: t = "horizontal", className: a, children: d, ...f }) {
|
|
35
|
+
let p = o(null);
|
|
36
|
+
n({
|
|
37
|
+
menuRef: p,
|
|
38
|
+
active: !0,
|
|
39
|
+
selector: s
|
|
40
|
+
});
|
|
41
|
+
let m = u(t, p);
|
|
42
|
+
return /* @__PURE__ */ i(r, {
|
|
43
|
+
value: t,
|
|
44
|
+
children: i("div", {
|
|
45
|
+
ref: p,
|
|
46
|
+
role: "toolbar",
|
|
47
|
+
"aria-orientation": t,
|
|
48
|
+
onKeyDown: m,
|
|
49
|
+
...f,
|
|
50
|
+
className: e([
|
|
51
|
+
c,
|
|
52
|
+
t === "vertical" && l,
|
|
53
|
+
a
|
|
54
|
+
]),
|
|
55
|
+
children: d
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { d as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { base as t, sizes as n, squareSizes as r, variants as i } from "../Button/styles.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/lib/components/Toolbar/ToolbarButton.tsx
|
|
8
|
+
var o = "haze-ToolbarButton__toolbarItem";
|
|
9
|
+
function s({ variant: s = "ghost", size: c = "md", square: l = !1, className: u, ...d }) {
|
|
10
|
+
let f = l ? r[c] : n[c];
|
|
11
|
+
return /* @__PURE__ */ a("button", {
|
|
12
|
+
type: "button",
|
|
13
|
+
"data-haze-toolbar-item": "",
|
|
14
|
+
tabIndex: -1,
|
|
15
|
+
...d,
|
|
16
|
+
className: e([
|
|
17
|
+
t,
|
|
18
|
+
i[s],
|
|
19
|
+
f,
|
|
20
|
+
o,
|
|
21
|
+
u
|
|
22
|
+
])
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { s as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as e, useContext as t } from "react";
|
|
3
|
+
//#region src/lib/components/Toolbar/ToolbarContext.ts
|
|
4
|
+
var n = e(void 0), r = n.Provider;
|
|
5
|
+
function i() {
|
|
6
|
+
return t(n) ?? "horizontal";
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { r as ToolbarProvider, i as useToolbarOrientation };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { useToolbarOrientation as t } from "./ToolbarContext.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
7
|
+
//#region src/lib/components/Toolbar/ToolbarSeparator.tsx
|
|
8
|
+
var r = "haze-ToolbarSeparator__separator", i = "haze-ToolbarSeparator__horizontalRule";
|
|
9
|
+
function a({ className: a, ...o }) {
|
|
10
|
+
let s = t() === "vertical";
|
|
11
|
+
return /* @__PURE__ */ n("div", {
|
|
12
|
+
role: "separator",
|
|
13
|
+
"aria-orientation": s ? "horizontal" : "vertical",
|
|
14
|
+
...o,
|
|
15
|
+
className: e([
|
|
16
|
+
r,
|
|
17
|
+
s && i,
|
|
18
|
+
a
|
|
19
|
+
])
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as default };
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { Presence as t } from "../../utils/presence.js";
|
|
5
|
+
import { computeFloatingPosition as n, resolvePadding as r } from "../../utils/collision.js";
|
|
6
|
+
import { formatString as i } from "../LocaleProvider/locale.js";
|
|
7
|
+
import { useStrings as a } from "../LocaleProvider/useStrings.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
10
|
+
import { useCallback as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import { useControl as p } from "react-use-control";
|
|
12
|
+
import { createPortal as m } from "react-dom";
|
|
13
|
+
//#region src/lib/components/Tour/Tour.tsx
|
|
14
|
+
var h = 8, g = 16;
|
|
15
|
+
function _(e) {
|
|
16
|
+
let { target: t } = e;
|
|
17
|
+
if (typeof t == "function") return t();
|
|
18
|
+
try {
|
|
19
|
+
return document.querySelector(t);
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
var v = "haze-Tour__overlay", y = "haze-Tour__spotlight", b = "haze-Tour__mask", ee = "haze-Tour__card", te = "haze-Tour__centeredCard", ne = "haze-Tour__titleStyle", re = "haze-Tour__bodyStyle", x = "haze-Tour__footerStyle", S = "haze-Tour__counterStyle", C = "haze-Tour__btn", w = "haze-Tour__subtleBtn", ie = "haze-Tour__primaryBtn";
|
|
25
|
+
function T({ steps: T, open: E, current: D, onClose: O, onStepChange: k, maskClosable: A = !1, className: j, ...M }) {
|
|
26
|
+
let [N, P] = p(E, !1), [F, I] = p(D, 0), L = a("tour"), R = `haze-tour-title-${u()}`, z = `haze-tour-step-${u()}`, B = T.length, V = Math.min(Math.max(F, 0), Math.max(B - 1, 0)), H = B > 0 ? T[V] : void 0, U = V >= B - 1, W = H?.placement ?? "bottom", G = i(L.stepOf, {
|
|
27
|
+
current: V + 1,
|
|
28
|
+
total: B
|
|
29
|
+
}), [K, q] = f(N);
|
|
30
|
+
N !== K && (q(N), N && D === void 0 && I(0));
|
|
31
|
+
let J = d(null), Y = d(-1), [X, ae] = f(null), Z = d(null), Q = c((e) => {
|
|
32
|
+
P(!1), O?.(e);
|
|
33
|
+
}, [O, P]), $ = c((e) => {
|
|
34
|
+
I(e), k?.(e);
|
|
35
|
+
}, [k, I]);
|
|
36
|
+
return l(() => {
|
|
37
|
+
if (!N) return;
|
|
38
|
+
let e = B > 0 ? T[V] : void 0, t = J.current;
|
|
39
|
+
if (!e || !t) return;
|
|
40
|
+
let i = _(e);
|
|
41
|
+
i?.scrollIntoView({ block: "nearest" });
|
|
42
|
+
let a = (e) => {
|
|
43
|
+
let t = Z.current;
|
|
44
|
+
(t === null != (e === null) || t !== null && e !== null && (t.top !== e.top || t.left !== e.left || t.width !== e.width || t.height !== e.height)) && (Z.current = e, ae(e));
|
|
45
|
+
}, o = () => {
|
|
46
|
+
let e = i?.getBoundingClientRect();
|
|
47
|
+
if (!i || !e || e.width === 0 && e.height === 0) {
|
|
48
|
+
t.style.top = "", t.style.left = "", a(null);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
let o = t.getBoundingClientRect(), { top: s, left: c } = n({
|
|
52
|
+
trigger: e,
|
|
53
|
+
panel: {
|
|
54
|
+
width: o.width,
|
|
55
|
+
height: o.height
|
|
56
|
+
},
|
|
57
|
+
viewport: {
|
|
58
|
+
width: window.innerWidth,
|
|
59
|
+
height: window.innerHeight
|
|
60
|
+
},
|
|
61
|
+
placement: W,
|
|
62
|
+
gap: {
|
|
63
|
+
below: g,
|
|
64
|
+
above: g,
|
|
65
|
+
before: g,
|
|
66
|
+
after: g
|
|
67
|
+
},
|
|
68
|
+
strategy: {
|
|
69
|
+
flip: !0,
|
|
70
|
+
shift: !0,
|
|
71
|
+
padding: r()
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
t.style.top = `${s}px`, t.style.left = `${c}px`, a({
|
|
75
|
+
top: e.top - h,
|
|
76
|
+
left: e.left - h,
|
|
77
|
+
width: e.width + 16,
|
|
78
|
+
height: e.height + 16
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
o();
|
|
82
|
+
let s = 0, c = () => {
|
|
83
|
+
s ||= requestAnimationFrame(() => {
|
|
84
|
+
s = 0, o();
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
|
|
88
|
+
s && cancelAnimationFrame(s), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
|
|
89
|
+
};
|
|
90
|
+
}, [
|
|
91
|
+
N,
|
|
92
|
+
T,
|
|
93
|
+
V,
|
|
94
|
+
B,
|
|
95
|
+
W
|
|
96
|
+
]), l(() => {
|
|
97
|
+
if (!N) {
|
|
98
|
+
Y.current = -1;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
Y.current !== V && (Y.current = V, J.current?.focus());
|
|
102
|
+
}, [N, V]), l(() => {
|
|
103
|
+
if (!N || B === 0) return;
|
|
104
|
+
let e = (e) => {
|
|
105
|
+
if (e.defaultPrevented) return;
|
|
106
|
+
if (e.key === "Escape") {
|
|
107
|
+
Q("skip");
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
let t = e.target;
|
|
111
|
+
t instanceof HTMLElement && (t.isContentEditable || t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT") || (e.key === "ArrowRight" && !U ? (e.preventDefault(), $(V + 1)) : e.key === "ArrowLeft" && V > 0 && (e.preventDefault(), $(V - 1)));
|
|
112
|
+
};
|
|
113
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
114
|
+
}, [
|
|
115
|
+
N,
|
|
116
|
+
B,
|
|
117
|
+
V,
|
|
118
|
+
U,
|
|
119
|
+
Q,
|
|
120
|
+
$
|
|
121
|
+
]), !H || typeof document > "u" ? null : m(/* @__PURE__ */ o(t, {
|
|
122
|
+
present: N,
|
|
123
|
+
children: s("div", {
|
|
124
|
+
onClick: A ? (e) => {
|
|
125
|
+
N && e.target === e.currentTarget && Q("skip");
|
|
126
|
+
} : void 0,
|
|
127
|
+
className: e([v]),
|
|
128
|
+
children: [X === null ? /* @__PURE__ */ o("div", {
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
className: e([b])
|
|
131
|
+
}) : /* @__PURE__ */ o("div", {
|
|
132
|
+
"data-haze-tour-spotlight": "",
|
|
133
|
+
"aria-hidden": "true",
|
|
134
|
+
style: {
|
|
135
|
+
top: X.top,
|
|
136
|
+
left: X.left,
|
|
137
|
+
width: X.width,
|
|
138
|
+
height: X.height
|
|
139
|
+
},
|
|
140
|
+
className: e([y])
|
|
141
|
+
}), /* @__PURE__ */ s("div", {
|
|
142
|
+
ref: J,
|
|
143
|
+
role: "dialog",
|
|
144
|
+
"aria-modal": "false",
|
|
145
|
+
"aria-labelledby": H.title === void 0 ? z : R,
|
|
146
|
+
tabIndex: -1,
|
|
147
|
+
...M,
|
|
148
|
+
className: e([
|
|
149
|
+
ee,
|
|
150
|
+
X === null && te,
|
|
151
|
+
j
|
|
152
|
+
]),
|
|
153
|
+
children: [
|
|
154
|
+
H.title !== void 0 && /* @__PURE__ */ o("h2", {
|
|
155
|
+
id: R,
|
|
156
|
+
className: e([ne]),
|
|
157
|
+
children: H.title
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ o("div", {
|
|
160
|
+
className: e([re]),
|
|
161
|
+
children: H.content
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ s("div", {
|
|
164
|
+
className: e([x]),
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ o("span", {
|
|
167
|
+
id: z,
|
|
168
|
+
className: e([S]),
|
|
169
|
+
children: G
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ o("button", {
|
|
172
|
+
type: "button",
|
|
173
|
+
onClick: () => Q("skip"),
|
|
174
|
+
className: e([C, w]),
|
|
175
|
+
children: L.skip
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ o("button", {
|
|
178
|
+
type: "button",
|
|
179
|
+
disabled: V === 0,
|
|
180
|
+
onClick: () => $(V - 1),
|
|
181
|
+
className: e([C, w]),
|
|
182
|
+
children: L.back
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ o("button", {
|
|
185
|
+
type: "button",
|
|
186
|
+
onClick: () => U ? Q("done") : $(V + 1),
|
|
187
|
+
className: e([C, ie]),
|
|
188
|
+
children: U ? L.done : L.next
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
})]
|
|
194
|
+
})
|
|
195
|
+
}), document.body);
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
export { T as default };
|
|
@@ -1,90 +1,85 @@
|
|
|
1
1
|
|
|
2
|
+
"use client";
|
|
2
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";
|
|
3
6
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useState as
|
|
7
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
8
|
+
import { useState as a } from "react";
|
|
6
9
|
//#region src/lib/components/Transfer/TransferCore.tsx
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let [
|
|
10
|
-
_((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
11
|
-
}, C = (e) => {
|
|
10
|
+
var o = "haze-TransferCore__container", s = "haze-TransferCore__panel", c = "haze-TransferCore__panelHeader", l = "haze-TransferCore__panelBody", u = "haze-TransferCore__itemStyle", d = "haze-TransferCore__actions", f = "haze-TransferCore__actionBtn";
|
|
11
|
+
function p({ dataSource: p, value: m, onChange: h, className: g, ..._ }) {
|
|
12
|
+
let [v, y] = a([]), [b, x] = a([]), S = n("transfer"), C = p.filter((e) => !m.includes(e.key)), w = p.filter((e) => m.includes(e.key)), T = (e) => {
|
|
12
13
|
y((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
v.length !== 0 && (
|
|
14
|
+
}, E = (e) => {
|
|
15
|
+
x((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
16
|
+
}, D = () => {
|
|
17
|
+
v.length !== 0 && (h([...m, ...v], "right", v), y([]));
|
|
18
|
+
}, O = () => {
|
|
19
|
+
b.length !== 0 && (h(m.filter((e) => !b.includes(e)), "left", b), x([]));
|
|
17
20
|
};
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
...
|
|
20
|
-
className: e([
|
|
21
|
+
return /* @__PURE__ */ i("div", {
|
|
22
|
+
..._,
|
|
23
|
+
className: e([o, g]),
|
|
21
24
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
className: e([
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
-
className: e([
|
|
26
|
-
children:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className: e([s]),
|
|
33
|
-
children: b.map((r) => /* @__PURE__ */ n("label", {
|
|
34
|
-
className: e([c]),
|
|
35
|
-
children: [/* @__PURE__ */ t("input", {
|
|
25
|
+
/* @__PURE__ */ i("div", {
|
|
26
|
+
className: e([s]),
|
|
27
|
+
children: [/* @__PURE__ */ r("div", {
|
|
28
|
+
className: e([c]),
|
|
29
|
+
children: t(S.source, { count: C.length })
|
|
30
|
+
}), /* @__PURE__ */ r("div", {
|
|
31
|
+
className: e([l]),
|
|
32
|
+
children: C.map((t) => /* @__PURE__ */ i("label", {
|
|
33
|
+
className: e([u]),
|
|
34
|
+
children: [/* @__PURE__ */ r("input", {
|
|
36
35
|
type: "checkbox",
|
|
37
|
-
checked:
|
|
38
|
-
disabled:
|
|
39
|
-
onChange: () =>
|
|
40
|
-
"aria-label":
|
|
41
|
-
}),
|
|
42
|
-
},
|
|
36
|
+
checked: v.includes(t.key),
|
|
37
|
+
disabled: t.disabled,
|
|
38
|
+
onChange: () => T(t.key),
|
|
39
|
+
"aria-label": t.title
|
|
40
|
+
}), t.title]
|
|
41
|
+
}, t.key))
|
|
43
42
|
})]
|
|
44
43
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
className: e([
|
|
47
|
-
children: [/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ i("div", {
|
|
45
|
+
className: e([d]),
|
|
46
|
+
children: [/* @__PURE__ */ r("button", {
|
|
48
47
|
type: "button",
|
|
49
|
-
disabled:
|
|
50
|
-
onClick:
|
|
51
|
-
"aria-label":
|
|
52
|
-
className: e([
|
|
48
|
+
disabled: v.length === 0,
|
|
49
|
+
onClick: D,
|
|
50
|
+
"aria-label": S.moveToTarget,
|
|
51
|
+
className: e([f]),
|
|
53
52
|
children: "›"
|
|
54
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ r("button", {
|
|
55
54
|
type: "button",
|
|
56
|
-
disabled:
|
|
57
|
-
onClick:
|
|
58
|
-
"aria-label":
|
|
59
|
-
className: e([
|
|
55
|
+
disabled: b.length === 0,
|
|
56
|
+
onClick: O,
|
|
57
|
+
"aria-label": S.moveToSource,
|
|
58
|
+
className: e([f]),
|
|
60
59
|
children: "‹"
|
|
61
60
|
})]
|
|
62
61
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
className: e([
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
-
className: e([
|
|
67
|
-
children:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
className: e([s]),
|
|
74
|
-
children: x.map((r) => /* @__PURE__ */ n("label", {
|
|
75
|
-
className: e([c]),
|
|
76
|
-
children: [/* @__PURE__ */ t("input", {
|
|
62
|
+
/* @__PURE__ */ i("div", {
|
|
63
|
+
className: e([s]),
|
|
64
|
+
children: [/* @__PURE__ */ r("div", {
|
|
65
|
+
className: e([c]),
|
|
66
|
+
children: t(S.target, { count: w.length })
|
|
67
|
+
}), /* @__PURE__ */ r("div", {
|
|
68
|
+
className: e([l]),
|
|
69
|
+
children: w.map((t) => /* @__PURE__ */ i("label", {
|
|
70
|
+
className: e([u]),
|
|
71
|
+
children: [/* @__PURE__ */ r("input", {
|
|
77
72
|
type: "checkbox",
|
|
78
|
-
checked:
|
|
79
|
-
disabled:
|
|
80
|
-
onChange: () =>
|
|
81
|
-
"aria-label":
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
73
|
+
checked: b.includes(t.key),
|
|
74
|
+
disabled: t.disabled,
|
|
75
|
+
onChange: () => E(t.key),
|
|
76
|
+
"aria-label": t.title
|
|
77
|
+
}), t.title]
|
|
78
|
+
}, t.key))
|
|
84
79
|
})]
|
|
85
80
|
})
|
|
86
81
|
]
|
|
87
82
|
});
|
|
88
83
|
}
|
|
89
84
|
//#endregion
|
|
90
|
-
export {
|
|
85
|
+
export { p as default };
|