haze-ui 1.28.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 +139 -33
- 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 +117 -52
- 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 +46 -0
- package/dist/components/CountUp/index.js +3 -0
- 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 +56 -0
- package/dist/components/Ellipsis/index.js +3 -0
- 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 +255 -0
- package/dist/components/LocaleProvider/de-de.js +255 -0
- package/dist/components/LocaleProvider/es-es.js +255 -0
- package/dist/components/LocaleProvider/fr-fr.js +255 -0
- package/dist/components/LocaleProvider/index.js +10 -2
- package/dist/components/LocaleProvider/it-it.js +255 -0
- package/dist/components/LocaleProvider/ja-jp.js +35 -2
- package/dist/components/LocaleProvider/ko-kr.js +255 -0
- package/dist/components/LocaleProvider/locale.js +35 -2
- package/dist/components/LocaleProvider/pt-br.js +255 -0
- package/dist/components/LocaleProvider/ru-ru.js +255 -0
- package/dist/components/LocaleProvider/zh-cn.js +35 -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 +45 -0
- package/dist/components/QRCode/index.js +3 -0
- 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 +234 -0
- package/dist/components/Result/index.js +3 -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 +240 -0
- package/dist/components/TreeSelect/index.js +3 -0
- package/dist/components/Typography/Typography.js +42 -12
- 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/count-up.css +2 -0
- 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/ellipsis.css +2 -0
- 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/qr-code.css +2 -0
- package/dist/css/radio.css +1 -1
- package/dist/css/rating.css +1 -1
- package/dist/css/result.css +2 -0
- 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 +4 -2
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree-select.css +3 -0
- package/dist/css/tree.css +2 -1
- package/dist/css/typography.css +1 -1
- package/dist/css/upload.css +1 -1
- package/dist/css/virtual-list.css +1 -1
- package/dist/css-manifest.json +41 -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/dark.json +355 -0
- package/dist/design-tokens/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 +73 -50
- package/dist/index.js +250 -218
- package/dist/mcp-docs.json +10312 -0
- package/dist/registry.json +144 -42
- package/dist/tokens/brands.js +21 -0
- package/dist/tokens/density.js +6 -0
- package/dist/tokens/index.js +7 -6
- package/dist/tokens/motion.js +9 -2
- package/dist/tokens/palette.js +256 -88
- 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 +24 -13
- package/dist/types/components/Chart/chart-elements.d.ts +39 -10
- 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/CountUp/CountUp.d.ts +20 -0
- package/dist/types/components/CountUp/index.d.ts +2 -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/Ellipsis/Ellipsis.d.ts +19 -0
- package/dist/types/components/Ellipsis/index.d.ts +2 -0
- 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/ar-sa.d.ts +22 -0
- package/dist/types/components/LocaleProvider/de-de.d.ts +15 -0
- package/dist/types/components/LocaleProvider/es-es.d.ts +15 -0
- package/dist/types/components/LocaleProvider/fr-fr.d.ts +15 -0
- package/dist/types/components/LocaleProvider/index.d.ts +8 -0
- package/dist/types/components/LocaleProvider/it-it.d.ts +15 -0
- package/dist/types/components/LocaleProvider/ko-kr.d.ts +15 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +35 -0
- package/dist/types/components/LocaleProvider/pt-br.d.ts +16 -0
- package/dist/types/components/LocaleProvider/ru-ru.d.ts +15 -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/QRCode/QRCode.d.ts +33 -0
- package/dist/types/components/QRCode/index.d.ts +2 -0
- package/dist/types/components/Result/Result.d.ts +16 -0
- package/dist/types/components/Result/index.d.ts +2 -0
- 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/TagGroup/SortableTagGroup.d.ts +3 -2
- package/dist/types/components/TagGroup/TagGroup.d.ts +1 -1
- package/dist/types/components/TagInput/SortableTagInput.d.ts +2 -3
- package/dist/types/components/TagInput/SortableTagInputCore.d.ts +3 -3
- 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/TreeSelect/TreeSelect.d.ts +93 -0
- package/dist/types/components/TreeSelect/index.d.ts +2 -0
- package/dist/types/components/Typography/Typography.d.ts +12 -3
- package/dist/types/components/Typography/index.d.ts +1 -1
- 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 +34 -13
- package/dist/types/tokens/brands.d.ts +28 -0
- package/dist/types/tokens/density.d.ts +3 -0
- package/dist/types/tokens/index.d.ts +5 -2
- package/dist/types/tokens/motion.d.ts +16 -0
- package/dist/types/tokens/palette.d.ts +95 -1
- package/dist/types/tokens/spacing.d.ts +13 -0
- package/dist/types/utils/menuItems.d.ts +126 -0
- package/dist/types/utils/menuRadio.d.ts +21 -0
- package/dist/types/utils/sortable-shared.d.ts +4 -4
- 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/mcp/index.mjs +64 -0
- package/mcp/server.mjs +89 -0
- package/mcp/server.test.mjs +281 -0
- package/mcp/tools.mjs +240 -0
- package/package.json +74 -47
|
@@ -1,52 +1,68 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { Area as r, AreaChart as i, Bar as a, BarChart as o, CartesianGrid as s, Legend as c, Line as l, LineChart as u, Pie as d, PieChart as f,
|
|
3
|
+
import { Area as r, AreaChart as i, Bar as a, BarChart as o, CartesianGrid as s, Legend as c, Line as l, LineChart as u, Pie as d, PieChart as f, PolarAngleAxis as p, PolarGrid as m, PolarRadiusAxis as h, Radar as g, RadarChart as _, ResponsiveContainer as v, Scatter as y, ScatterChart as b, Tooltip as x, XAxis as S, YAxis as C } from "recharts";
|
|
4
4
|
//#region src/lib/components/Chart/chart-elements.tsx
|
|
5
|
-
var
|
|
5
|
+
var w = [
|
|
6
6
|
"var(--haze-color-primary)",
|
|
7
7
|
"var(--haze-color-info)",
|
|
8
8
|
"var(--haze-color-success)",
|
|
9
9
|
"var(--haze-color-warning)",
|
|
10
10
|
"var(--haze-color-danger)"
|
|
11
|
-
],
|
|
11
|
+
], T = "var(--haze-color-border)", E = {
|
|
12
12
|
fontSize: "var(--haze-text-sm)",
|
|
13
13
|
fill: "var(--haze-color-text-secondary)"
|
|
14
|
-
},
|
|
14
|
+
}, D = {
|
|
15
15
|
fontSize: "var(--haze-text-sm)",
|
|
16
16
|
color: "var(--haze-color-text)"
|
|
17
|
-
},
|
|
18
|
-
function
|
|
19
|
-
return
|
|
17
|
+
}, O = { fontSize: "var(--haze-text-sm)" };
|
|
18
|
+
function k(e) {
|
|
19
|
+
return w[e % w.length];
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function A(e) {
|
|
22
22
|
return e.map((e) => ({
|
|
23
23
|
key: e.key,
|
|
24
24
|
label: e.label ?? e.key,
|
|
25
|
-
color: e.color
|
|
25
|
+
color: e.color,
|
|
26
|
+
type: e.type,
|
|
27
|
+
stackId: e.stackId
|
|
26
28
|
}));
|
|
27
29
|
}
|
|
28
|
-
function
|
|
29
|
-
let { key: o, label: s } = n,
|
|
30
|
+
function j(e, n, i = 0) {
|
|
31
|
+
let { key: o, label: s, stackId: c } = n, u = n.color ?? k(i);
|
|
30
32
|
switch (e) {
|
|
31
33
|
case "area": return /* @__PURE__ */ t(r, {
|
|
32
34
|
dataKey: o,
|
|
33
35
|
name: s,
|
|
34
|
-
stroke:
|
|
35
|
-
fill:
|
|
36
|
+
stroke: u,
|
|
37
|
+
fill: u,
|
|
38
|
+
stackId: c
|
|
36
39
|
}, o);
|
|
37
40
|
case "bar": return /* @__PURE__ */ t(a, {
|
|
38
41
|
dataKey: o,
|
|
39
42
|
name: s,
|
|
40
|
-
fill:
|
|
43
|
+
fill: u,
|
|
44
|
+
stackId: c
|
|
41
45
|
}, o);
|
|
42
46
|
case "line": return /* @__PURE__ */ t(l, {
|
|
43
47
|
dataKey: o,
|
|
44
48
|
name: s,
|
|
45
|
-
stroke:
|
|
49
|
+
stroke: u
|
|
50
|
+
}, o);
|
|
51
|
+
case "radar": return /* @__PURE__ */ t(g, {
|
|
52
|
+
dataKey: o,
|
|
53
|
+
name: s,
|
|
54
|
+
stroke: u,
|
|
55
|
+
fill: u,
|
|
56
|
+
fillOpacity: .3
|
|
57
|
+
}, o);
|
|
58
|
+
case "scatter": return /* @__PURE__ */ t(y, {
|
|
59
|
+
dataKey: o,
|
|
60
|
+
name: s,
|
|
61
|
+
fill: u
|
|
46
62
|
}, o);
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
|
-
function
|
|
65
|
+
function M(e, t, n) {
|
|
50
66
|
if (t <= 1) return {
|
|
51
67
|
innerRadius: n,
|
|
52
68
|
outerRadius: "80%"
|
|
@@ -57,10 +73,10 @@ function T(e, t, n) {
|
|
|
57
73
|
outerRadius: `${i + (e + 1) * a}%`
|
|
58
74
|
};
|
|
59
75
|
}
|
|
60
|
-
function
|
|
61
|
-
let { entry: n, data: r, nameKey: i, ringIndex: a, ringCount: o, innerRadius: s } = e, c =
|
|
76
|
+
function N(e) {
|
|
77
|
+
let { entry: n, data: r, nameKey: i, ringIndex: a, ringCount: o, innerRadius: s } = e, c = M(a, o, s), l = r.map((e, t) => ({
|
|
62
78
|
...e,
|
|
63
|
-
fill: n.color ??
|
|
79
|
+
fill: n.color ?? k(t)
|
|
64
80
|
}));
|
|
65
81
|
return /* @__PURE__ */ t(d, {
|
|
66
82
|
data: l,
|
|
@@ -71,7 +87,7 @@ function E(e) {
|
|
|
71
87
|
stroke: "var(--haze-color-bg)"
|
|
72
88
|
}, n.key);
|
|
73
89
|
}
|
|
74
|
-
function
|
|
90
|
+
function P(e, n, r, a = "horizontal") {
|
|
75
91
|
switch (e) {
|
|
76
92
|
case "area": return /* @__PURE__ */ t(i, {
|
|
77
93
|
data: n,
|
|
@@ -92,9 +108,17 @@ function D(e, n, r, a = "horizontal") {
|
|
|
92
108
|
data: n,
|
|
93
109
|
children: r
|
|
94
110
|
});
|
|
111
|
+
case "radar": return /* @__PURE__ */ t(_, {
|
|
112
|
+
data: n,
|
|
113
|
+
children: r
|
|
114
|
+
});
|
|
115
|
+
case "scatter": return /* @__PURE__ */ t(b, {
|
|
116
|
+
data: n,
|
|
117
|
+
children: r
|
|
118
|
+
});
|
|
95
119
|
}
|
|
96
120
|
}
|
|
97
|
-
function
|
|
121
|
+
function F(e) {
|
|
98
122
|
return (t) => {
|
|
99
123
|
let { payload: n, label: r } = t;
|
|
100
124
|
return e({
|
|
@@ -108,57 +132,98 @@ function O(e) {
|
|
|
108
132
|
});
|
|
109
133
|
};
|
|
110
134
|
}
|
|
111
|
-
function
|
|
112
|
-
let { type: i, data: a, xKey: o, showGrid: l, showTooltip: u, showLegend: d, series: f, layout:
|
|
113
|
-
return i === "pie" ? /* @__PURE__ */ t(
|
|
135
|
+
function I(r) {
|
|
136
|
+
let { type: i, data: a, xKey: o, showGrid: l, showTooltip: u, showLegend: d, series: f, layout: g = "horizontal", innerRadius: _ = 0, renderTooltip: y } = r, b = y ? F(y) : void 0;
|
|
137
|
+
return i === "pie" ? /* @__PURE__ */ t(v, {
|
|
114
138
|
width: "100%",
|
|
115
139
|
height: "100%",
|
|
116
|
-
children:
|
|
117
|
-
u && /* @__PURE__ */ t(
|
|
118
|
-
contentStyle:
|
|
119
|
-
content:
|
|
140
|
+
children: P(i, a, /* @__PURE__ */ n(e, { children: [
|
|
141
|
+
u && /* @__PURE__ */ t(x, {
|
|
142
|
+
contentStyle: D,
|
|
143
|
+
content: b
|
|
120
144
|
}),
|
|
121
|
-
d && /* @__PURE__ */ t(c, { wrapperStyle:
|
|
122
|
-
f.map((e, t) =>
|
|
145
|
+
d && /* @__PURE__ */ t(c, { wrapperStyle: O }),
|
|
146
|
+
f.map((e, t) => N({
|
|
123
147
|
entry: e,
|
|
124
148
|
data: a,
|
|
125
149
|
nameKey: o,
|
|
126
150
|
ringIndex: t,
|
|
127
151
|
ringCount: f.length,
|
|
128
|
-
innerRadius:
|
|
152
|
+
innerRadius: _
|
|
129
153
|
}))
|
|
130
154
|
] }))
|
|
131
|
-
}) : /* @__PURE__ */ t(
|
|
155
|
+
}) : i === "radar" ? /* @__PURE__ */ t(v, {
|
|
156
|
+
width: "100%",
|
|
157
|
+
height: "100%",
|
|
158
|
+
children: P(i, a, /* @__PURE__ */ n(e, { children: [
|
|
159
|
+
l && /* @__PURE__ */ t(m, { stroke: "var(--haze-color-border)" }),
|
|
160
|
+
/* @__PURE__ */ t(p, {
|
|
161
|
+
dataKey: o,
|
|
162
|
+
tick: E
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ t(h, { tick: E }),
|
|
165
|
+
u && /* @__PURE__ */ t(x, {
|
|
166
|
+
contentStyle: D,
|
|
167
|
+
content: b
|
|
168
|
+
}),
|
|
169
|
+
d && /* @__PURE__ */ t(c, { wrapperStyle: O }),
|
|
170
|
+
f.map((e, t) => j("radar", e, t))
|
|
171
|
+
] }))
|
|
172
|
+
}) : i === "scatter" ? /* @__PURE__ */ t(v, {
|
|
173
|
+
width: "100%",
|
|
174
|
+
height: "100%",
|
|
175
|
+
children: P(i, a, /* @__PURE__ */ n(e, { children: [
|
|
176
|
+
l && /* @__PURE__ */ t(s, { stroke: "var(--haze-color-border)" }),
|
|
177
|
+
/* @__PURE__ */ t(S, {
|
|
178
|
+
type: "number",
|
|
179
|
+
dataKey: o,
|
|
180
|
+
stroke: T,
|
|
181
|
+
tick: E
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ t(C, {
|
|
184
|
+
type: "number",
|
|
185
|
+
stroke: T,
|
|
186
|
+
tick: E
|
|
187
|
+
}),
|
|
188
|
+
u && /* @__PURE__ */ t(x, {
|
|
189
|
+
cursor: { stroke: "var(--haze-color-border)" },
|
|
190
|
+
contentStyle: D,
|
|
191
|
+
content: b
|
|
192
|
+
}),
|
|
193
|
+
d && /* @__PURE__ */ t(c, { wrapperStyle: O }),
|
|
194
|
+
f.map((e, t) => j("scatter", e, t))
|
|
195
|
+
] }))
|
|
196
|
+
}) : /* @__PURE__ */ t(v, {
|
|
132
197
|
width: "100%",
|
|
133
198
|
height: "100%",
|
|
134
|
-
children:
|
|
199
|
+
children: P(i, a, /* @__PURE__ */ n(e, { children: [
|
|
135
200
|
l && /* @__PURE__ */ t(s, { stroke: "var(--haze-color-border)" }),
|
|
136
|
-
|
|
201
|
+
g === "vertical" ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(S, {
|
|
137
202
|
type: "number",
|
|
138
|
-
stroke:
|
|
139
|
-
tick:
|
|
140
|
-
}), /* @__PURE__ */ t(
|
|
203
|
+
stroke: T,
|
|
204
|
+
tick: E
|
|
205
|
+
}), /* @__PURE__ */ t(C, {
|
|
141
206
|
type: "category",
|
|
142
207
|
dataKey: o,
|
|
143
|
-
stroke:
|
|
144
|
-
tick:
|
|
145
|
-
})] }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(
|
|
208
|
+
stroke: T,
|
|
209
|
+
tick: E
|
|
210
|
+
})] }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(S, {
|
|
146
211
|
dataKey: o,
|
|
147
|
-
stroke:
|
|
148
|
-
tick:
|
|
149
|
-
}), /* @__PURE__ */ t(
|
|
150
|
-
stroke:
|
|
151
|
-
tick:
|
|
212
|
+
stroke: T,
|
|
213
|
+
tick: E
|
|
214
|
+
}), /* @__PURE__ */ t(C, {
|
|
215
|
+
stroke: T,
|
|
216
|
+
tick: E
|
|
152
217
|
})] }),
|
|
153
|
-
u && /* @__PURE__ */ t(
|
|
218
|
+
u && /* @__PURE__ */ t(x, {
|
|
154
219
|
cursor: { stroke: "var(--haze-color-border)" },
|
|
155
|
-
contentStyle:
|
|
156
|
-
content:
|
|
220
|
+
contentStyle: D,
|
|
221
|
+
content: b
|
|
157
222
|
}),
|
|
158
|
-
d && /* @__PURE__ */ t(c, { wrapperStyle:
|
|
159
|
-
f.map((e, t) =>
|
|
160
|
-
] }),
|
|
223
|
+
d && /* @__PURE__ */ t(c, { wrapperStyle: O }),
|
|
224
|
+
f.map((e, t) => j(e.type ?? i, e, t))
|
|
225
|
+
] }), g)
|
|
161
226
|
});
|
|
162
227
|
}
|
|
163
228
|
//#endregion
|
|
164
|
-
export {
|
|
229
|
+
export { T as AXIS_STROKE, E as AXIS_TICK, O as LEGEND_STYLE, D as TOOLTIP_STYLE, F as buildTooltipContent, P as chartElement, I as chartTree, N as pieElement, M as pieRingRadii, A as resolveChartSeries, j as seriesElement };
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
//#region src/lib/components/ChatContainer/ChatContainer.tsx
|
|
9
9
|
var c = 40, l = "haze-ChatContainer__container", u = "haze-ChatContainer__jumpPill";
|
|
10
10
|
function d({ children: d, autoScroll: f = !0, unreadLabel: p, className: m, ...h }) {
|
|
11
|
-
let g =
|
|
11
|
+
let g = i(null), [_, v] = a(!1), y = i(!0), b = t("chat"), x = n(() => {
|
|
12
12
|
let e = g.current;
|
|
13
13
|
e && (y.current = !0, e.scrollTop = e.scrollHeight, v(!1));
|
|
14
14
|
}, []);
|
|
15
|
-
return
|
|
15
|
+
return r(() => {
|
|
16
16
|
let e = g.current;
|
|
17
17
|
if (!e || !f) return;
|
|
18
18
|
let t = () => e.scrollHeight - e.scrollTop - e.clientHeight, n = () => {
|
|
@@ -28,15 +28,17 @@ function d({ children: d, autoScroll: f = !0, unreadLabel: p, className: m, ...h
|
|
|
28
28
|
}), () => {
|
|
29
29
|
e.removeEventListener("scroll", n), r.disconnect();
|
|
30
30
|
};
|
|
31
|
-
}, [f]), /* @__PURE__ */
|
|
31
|
+
}, [f]), /* @__PURE__ */ s("div", {
|
|
32
32
|
ref: g,
|
|
33
|
+
"data-slot": "chat-container",
|
|
33
34
|
...h,
|
|
34
35
|
className: e([l, m]),
|
|
35
|
-
children: [d, f && _ && /* @__PURE__ */
|
|
36
|
+
children: [d, f && _ && /* @__PURE__ */ s("button", {
|
|
36
37
|
type: "button",
|
|
38
|
+
"data-slot": "jump-button",
|
|
37
39
|
onClick: x,
|
|
38
40
|
className: e([u]),
|
|
39
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ o("span", {
|
|
40
42
|
"aria-hidden": "true",
|
|
41
43
|
children: "↓"
|
|
42
44
|
}), p ?? b.newMessages]
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useCallback as n, useRef as r } from "react";
|
|
7
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
8
|
import { useControl as s } from "react-use-control";
|
|
9
9
|
//#region src/lib/components/ChatInput/ChatInput.tsx
|
|
10
|
-
var c = "haze-ChatInput__wrapper", l = "haze-ChatInput__textarea", u = "haze-ChatInput__sendBtn", d = () => /* @__PURE__ */
|
|
10
|
+
var c = "haze-ChatInput__wrapper", l = "haze-ChatInput__textarea", u = "haze-ChatInput__sendBtn", d = () => /* @__PURE__ */ a("svg", {
|
|
11
11
|
width: "12",
|
|
12
12
|
height: "12",
|
|
13
13
|
viewBox: "0 0 12 12",
|
|
14
14
|
fill: "currentColor",
|
|
15
15
|
"aria-hidden": "true",
|
|
16
16
|
focusable: "false",
|
|
17
|
-
children:
|
|
17
|
+
children: a("rect", {
|
|
18
18
|
x: "2",
|
|
19
19
|
y: "2",
|
|
20
20
|
width: "8",
|
|
@@ -23,7 +23,7 @@ var c = "haze-ChatInput__wrapper", l = "haze-ChatInput__textarea", u = "haze-Cha
|
|
|
23
23
|
})
|
|
24
24
|
});
|
|
25
25
|
function f({ value: f, onSend: p, generating: m = !1, onStop: h, placeholder: g, disabled: _, maxLength: v, className: y }) {
|
|
26
|
-
let [b, x] = s(f, ""), S =
|
|
26
|
+
let [b, x] = s(f, ""), S = r(null), C = t("chatInput"), w = t("chat"), T = g ?? C.placeholder, E = n(() => {
|
|
27
27
|
if (m) {
|
|
28
28
|
h?.();
|
|
29
29
|
return;
|
|
@@ -38,10 +38,12 @@ function f({ value: f, onSend: p, generating: m = !1, onStop: h, placeholder: g,
|
|
|
38
38
|
p,
|
|
39
39
|
x
|
|
40
40
|
]);
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ o("div", {
|
|
42
|
+
"data-slot": "chat-input",
|
|
42
43
|
className: e([c, y]),
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ a("textarea", {
|
|
44
45
|
ref: S,
|
|
46
|
+
"data-slot": "input",
|
|
45
47
|
value: b,
|
|
46
48
|
onChange: (e) => {
|
|
47
49
|
x(e.target.value), S.current && (S.current.style.height = "auto", S.current.style.height = `${S.current.scrollHeight}px`);
|
|
@@ -54,13 +56,14 @@ function f({ value: f, onSend: p, generating: m = !1, onStop: h, placeholder: g,
|
|
|
54
56
|
maxLength: v,
|
|
55
57
|
rows: 1,
|
|
56
58
|
className: e([l])
|
|
57
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ a("button", {
|
|
60
|
+
"data-slot": m ? "stop-button" : "send-button",
|
|
58
61
|
type: "button",
|
|
59
62
|
onClick: E,
|
|
60
63
|
disabled: _ || !m && !b.trim(),
|
|
61
64
|
"aria-label": m ? w.stopGeneration : C.send,
|
|
62
65
|
className: e([u]),
|
|
63
|
-
children: m ? /* @__PURE__ */
|
|
66
|
+
children: m ? /* @__PURE__ */ a(d, {}) : /* @__PURE__ */ a(i, { children: "↑" })
|
|
64
67
|
})]
|
|
65
68
|
});
|
|
66
69
|
}
|
|
@@ -4,14 +4,22 @@ import { classnames as e } from "../../utils/classnames.js";
|
|
|
4
4
|
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
5
|
import { useClipboard as n } from "../../hooks/useClipboard.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
//#region src/lib/components/ChatMessage/ChatMessage.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
var c = 1500, l = 1200, u = "haze-ChatMessage__actionsRow", d = "haze-ChatMessage__wrapper", f = "haze-ChatMessage__wrapperUser", p = "haze-ChatMessage__avatarSlot", m = "haze-ChatMessage__body", h = "haze-ChatMessage__header", g = "haze-ChatMessage__headerUser", _ = "haze-ChatMessage__bubble", v = "haze-ChatMessage__bubbleUser", y = "haze-ChatMessage__bubbleAssistant", b = "haze-ChatMessage__bubbleSystem", x = "haze-ChatMessage__statusText", S = "haze-ChatMessage__statusError", C = "haze-ChatMessage__actionBtn", w = "haze-ChatMessage__actionBtnCopied", T = "haze-ChatMessage__srOnly";
|
|
11
|
+
function E(e) {
|
|
12
|
+
if (!e) return "";
|
|
13
|
+
if (e.querySelector("[data-slot='live-region']") === null) return e.textContent;
|
|
14
|
+
let t = e.cloneNode(!0);
|
|
15
|
+
for (let e of t.querySelectorAll("[data-slot='live-region']")) e.remove();
|
|
16
|
+
return t.textContent;
|
|
17
|
+
}
|
|
18
|
+
var D = {
|
|
19
|
+
user: v,
|
|
20
|
+
assistant: y,
|
|
21
|
+
system: b
|
|
22
|
+
}, O = () => /* @__PURE__ */ s("svg", {
|
|
15
23
|
width: "14",
|
|
16
24
|
height: "14",
|
|
17
25
|
viewBox: "0 0 24 24",
|
|
@@ -22,15 +30,15 @@ var o = 1500, s = "haze-ChatMessage__actionsRow", c = "haze-ChatMessage__wrapper
|
|
|
22
30
|
strokeLinejoin: "round",
|
|
23
31
|
"aria-hidden": "true",
|
|
24
32
|
focusable: "false",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ o("rect", {
|
|
26
34
|
x: "9",
|
|
27
35
|
y: "9",
|
|
28
36
|
width: "13",
|
|
29
37
|
height: "13",
|
|
30
38
|
rx: "2",
|
|
31
39
|
ry: "2"
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
-
}),
|
|
40
|
+
}), /* @__PURE__ */ o("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })]
|
|
41
|
+
}), k = () => /* @__PURE__ */ o("svg", {
|
|
34
42
|
width: "14",
|
|
35
43
|
height: "14",
|
|
36
44
|
viewBox: "0 0 24 24",
|
|
@@ -41,50 +49,81 @@ var o = 1500, s = "haze-ChatMessage__actionsRow", c = "haze-ChatMessage__wrapper
|
|
|
41
49
|
strokeLinejoin: "round",
|
|
42
50
|
"aria-hidden": "true",
|
|
43
51
|
focusable: "false",
|
|
44
|
-
children:
|
|
52
|
+
children: o("path", { d: "M20 6 9 17l-5-5" })
|
|
45
53
|
});
|
|
46
|
-
function
|
|
47
|
-
let
|
|
48
|
-
return
|
|
49
|
-
|
|
54
|
+
function A({ role: v, avatar: y, name: b, timestamp: A, status: j, streaming: M = !1, copyable: N = !1, actions: P, children: F, className: I }) {
|
|
55
|
+
let L = v === "user", R = t("chatMessage"), z = t("chat"), B = t("streamingText"), V = i(null), { copied: H, copy: U } = n(c), W = N || P !== void 0, [G, K] = a(""), q = i(!1);
|
|
56
|
+
return r(() => {
|
|
57
|
+
if (!M) {
|
|
58
|
+
q.current && (q.current = !1, K(E(V.current)));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
q.current = !0, K(B.generating);
|
|
62
|
+
let e = setInterval(() => {
|
|
63
|
+
K(E(V.current));
|
|
64
|
+
}, l);
|
|
65
|
+
return () => clearInterval(e);
|
|
66
|
+
}, [M, B.generating]), /* @__PURE__ */ s("div", {
|
|
67
|
+
"data-slot": "chat-message",
|
|
68
|
+
"data-chat-actions": W ? !0 : void 0,
|
|
50
69
|
className: e([
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
d,
|
|
71
|
+
L && f,
|
|
72
|
+
I
|
|
54
73
|
]),
|
|
55
|
-
children: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
children: [v !== "system" && /* @__PURE__ */ o("div", {
|
|
75
|
+
"data-slot": "avatar",
|
|
76
|
+
className: e([p]),
|
|
77
|
+
children: y || (v === "user" ? "U" : "A")
|
|
78
|
+
}), /* @__PURE__ */ s("div", {
|
|
79
|
+
"data-slot": "body",
|
|
80
|
+
className: e([m]),
|
|
60
81
|
children: [
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
82
|
+
(b || A) && /* @__PURE__ */ s("div", {
|
|
83
|
+
"data-slot": "header",
|
|
84
|
+
className: e([h, L && g]),
|
|
85
|
+
children: [b && /* @__PURE__ */ o("span", {
|
|
86
|
+
"data-slot": "name",
|
|
87
|
+
children: b
|
|
88
|
+
}), A && /* @__PURE__ */ o("span", {
|
|
89
|
+
"data-slot": "timestamp",
|
|
90
|
+
children: A
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ o("div", {
|
|
94
|
+
"data-slot": "bubble",
|
|
95
|
+
ref: V,
|
|
96
|
+
"aria-busy": M || void 0,
|
|
97
|
+
className: e([_, D[v]]),
|
|
98
|
+
children: F
|
|
64
99
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
100
|
+
v === "assistant" && /* @__PURE__ */ o("span", {
|
|
101
|
+
"data-slot": "live-region",
|
|
102
|
+
role: "status",
|
|
103
|
+
className: e([T]),
|
|
104
|
+
children: G
|
|
69
105
|
}),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
106
|
+
W && /* @__PURE__ */ s("div", {
|
|
107
|
+
"data-slot": "actions",
|
|
108
|
+
className: e([u]),
|
|
109
|
+
children: [N && /* @__PURE__ */ o("button", {
|
|
73
110
|
type: "button",
|
|
111
|
+
"data-slot": "copy-button",
|
|
74
112
|
onClick: () => {
|
|
75
|
-
|
|
113
|
+
U(E(V.current));
|
|
76
114
|
},
|
|
77
|
-
"aria-label":
|
|
78
|
-
className: e([
|
|
79
|
-
children:
|
|
80
|
-
}),
|
|
115
|
+
"aria-label": z.copy,
|
|
116
|
+
className: e([C, H && w]),
|
|
117
|
+
children: o(H ? k : O, {})
|
|
118
|
+
}), P]
|
|
81
119
|
}),
|
|
82
|
-
|
|
83
|
-
|
|
120
|
+
j && /* @__PURE__ */ s("div", {
|
|
121
|
+
"data-slot": "status",
|
|
122
|
+
className: e([x, j === "error" && S]),
|
|
84
123
|
children: [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
124
|
+
j === "sending" && R.sending,
|
|
125
|
+
j === "sent" && R.sent,
|
|
126
|
+
j === "error" && R.failedToSend
|
|
88
127
|
]
|
|
89
128
|
})
|
|
90
129
|
]
|
|
@@ -92,4 +131,4 @@ function T({ role: h, avatar: g, name: _, timestamp: T, status: E, copyable: D =
|
|
|
92
131
|
});
|
|
93
132
|
}
|
|
94
133
|
//#endregion
|
|
95
|
-
export {
|
|
134
|
+
export { A as default };
|
|
@@ -9,6 +9,7 @@ function a({ checked: a, onChange: o, onNativeChange: s, className: c, label: l,
|
|
|
9
9
|
let f = /* @__PURE__ */ t("input", {
|
|
10
10
|
ref: u,
|
|
11
11
|
type: "checkbox",
|
|
12
|
+
"data-slot": "checkbox",
|
|
12
13
|
checked: a,
|
|
13
14
|
onChange: (e) => {
|
|
14
15
|
o(e.target.checked), s?.(e);
|
|
@@ -17,6 +18,7 @@ function a({ checked: a, onChange: o, onNativeChange: s, className: c, label: l,
|
|
|
17
18
|
className: e([r, c])
|
|
18
19
|
});
|
|
19
20
|
return l === void 0 ? f : /* @__PURE__ */ n("label", {
|
|
21
|
+
"data-slot": "label",
|
|
20
22
|
className: e(i),
|
|
21
23
|
children: [f, l]
|
|
22
24
|
});
|
|
@@ -21,6 +21,7 @@ var i = "haze-Chip__base", a = {
|
|
|
21
21
|
function l({ variant: l = "solid", color: u = "default", icon: d, onClose: f, className: p, children: m }) {
|
|
22
22
|
let h = t("chip"), g = l === "outline" ? o[u] : a[u];
|
|
23
23
|
return /* @__PURE__ */ r("span", {
|
|
24
|
+
"data-slot": "chip",
|
|
24
25
|
className: e([
|
|
25
26
|
i,
|
|
26
27
|
g,
|
|
@@ -28,11 +29,13 @@ function l({ variant: l = "solid", color: u = "default", icon: d, onClose: f, cl
|
|
|
28
29
|
]),
|
|
29
30
|
children: [
|
|
30
31
|
d && /* @__PURE__ */ n("span", {
|
|
32
|
+
"data-slot": "icon",
|
|
31
33
|
className: e([s]),
|
|
32
34
|
children: d
|
|
33
35
|
}),
|
|
34
36
|
m,
|
|
35
37
|
f && /* @__PURE__ */ n("button", {
|
|
38
|
+
"data-slot": "remove-button",
|
|
36
39
|
type: "button",
|
|
37
40
|
onClick: f,
|
|
38
41
|
"aria-label": h.remove,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useEffect as t, useMemo as n, useState as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
//#region src/lib/components/CodeBlock/CodeBlock.tsx
|
|
7
7
|
var o = "haze-CodeBlock__block", s = "haze-CodeBlock__pre", c = "haze-CodeBlock__lang";
|
|
8
8
|
function l({ children: l, language: u, highlight: d, className: f }) {
|
|
9
|
-
let p = typeof l == "string" ? l : void 0, m =
|
|
9
|
+
let p = typeof l == "string" ? l : void 0, m = n(() => {
|
|
10
10
|
if (d !== void 0 && p !== void 0) try {
|
|
11
11
|
return d(p, u ?? "");
|
|
12
12
|
} catch {
|
|
@@ -16,8 +16,8 @@ function l({ children: l, language: u, highlight: d, className: f }) {
|
|
|
16
16
|
d,
|
|
17
17
|
p,
|
|
18
18
|
u
|
|
19
|
-
]), h = m instanceof Promise ? m : void 0, [g, _] =
|
|
20
|
-
|
|
19
|
+
]), h = m instanceof Promise ? m : void 0, [g, _] = r(null);
|
|
20
|
+
t(() => {
|
|
21
21
|
if (h === void 0) return;
|
|
22
22
|
let e = !0;
|
|
23
23
|
return h.then((t) => {
|
|
@@ -35,14 +35,23 @@ function l({ children: l, language: u, highlight: d, className: f }) {
|
|
|
35
35
|
};
|
|
36
36
|
}, [h]);
|
|
37
37
|
let v = typeof m == "string" ? m : g !== null && g.pending === h ? g.html : null;
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ a("div", {
|
|
39
|
+
"data-slot": "code-block",
|
|
39
40
|
className: e([o, f]),
|
|
40
|
-
children: [u && /* @__PURE__ */
|
|
41
|
+
children: [u && /* @__PURE__ */ i("span", {
|
|
42
|
+
"data-slot": "language-label",
|
|
41
43
|
className: e([c]),
|
|
42
44
|
children: u
|
|
43
|
-
}), /* @__PURE__ */
|
|
45
|
+
}), /* @__PURE__ */ i("pre", {
|
|
46
|
+
"data-slot": "code",
|
|
44
47
|
className: e([s]),
|
|
45
|
-
children: v === null ? /* @__PURE__ */
|
|
48
|
+
children: v === null ? /* @__PURE__ */ i("code", {
|
|
49
|
+
"data-slot": "code-text",
|
|
50
|
+
children: l
|
|
51
|
+
}) : /* @__PURE__ */ i("code", {
|
|
52
|
+
"data-slot": "code-text",
|
|
53
|
+
dangerouslySetInnerHTML: { __html: v }
|
|
54
|
+
})
|
|
46
55
|
})]
|
|
47
56
|
});
|
|
48
57
|
}
|