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
|
@@ -11,25 +11,26 @@ import ie from "../VirtualList/VirtualList.js";
|
|
|
11
11
|
import ae from "./ComboboxGroup.js";
|
|
12
12
|
import oe from "./ComboboxOption.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { useCallback as se, useEffect as i, useId as ce, useMemo as le, useRef as a, useState as o } from "react";
|
|
15
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
16
16
|
import { useControl as u } from "react-use-control";
|
|
17
17
|
//#region src/lib/components/Combobox/Combobox.tsx
|
|
18
18
|
var ue = "haze-Combobox__wrapper", de = "haze-Combobox__input", fe = "haze-Combobox__multiBox", pe = "haze-Combobox__multiInput", d = "haze-Combobox__matchMark", f = "haze-Combobox__stateRow", me = "haze-Combobox__groupHeadingText", he = "haze-Combobox__listbox", ge = "haze-Combobox__listboxVirtual", _e = 200, ve = 37, ye = "haze-Combobox__virtualRow";
|
|
19
19
|
function be(t, n) {
|
|
20
20
|
if (n === "") return t;
|
|
21
21
|
let r = t.toLowerCase().indexOf(n.toLowerCase());
|
|
22
|
-
return r < 0 ? t : /* @__PURE__ */
|
|
22
|
+
return r < 0 ? t : /* @__PURE__ */ l(s, { children: [
|
|
23
23
|
t.slice(0, r),
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ c("mark", {
|
|
25
|
+
"data-slot": "match",
|
|
25
26
|
className: e([d]),
|
|
26
27
|
children: t.slice(r, r + n.length)
|
|
27
28
|
}),
|
|
28
29
|
t.slice(r + n.length)
|
|
29
30
|
] });
|
|
30
31
|
}
|
|
31
|
-
function p({ value:
|
|
32
|
-
let S = r("combobox"), [C, w] = u(
|
|
32
|
+
function p({ value: s, open: d, options: p, multiple: m = !1, onValuesChange: h, creatable: xe = !1, onCreate: Se, onSearch: g, loading: _ = !1, empty: Ce, highlightMatches: we = !1, maxHeight: v, placeholder: Te, virtualThreshold: y = 100, virtualized: b, className: Ee, ref: x }) {
|
|
33
|
+
let S = r("combobox"), [C, w] = u(s, m ? [] : ""), [T, De] = o([]), [E, D] = o(""), [O, k] = u(d, !1), [A, j] = o(-1), [Oe, ke] = o(E), M = ce(), N = a(null), Ae = se((e) => t(N, x)(e), [N, x]), P = a(null), F = a(null), I = a(null), L = a(null), R = te({
|
|
33
34
|
open: O,
|
|
34
35
|
setOpen: k,
|
|
35
36
|
triggerRef: m ? P : N,
|
|
@@ -74,7 +75,7 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
77
|
let Pe = Y.some((e) => e.label !== void 0);
|
|
77
|
-
|
|
78
|
+
i(() => {
|
|
78
79
|
if (!R.shown || A < 0) return;
|
|
79
80
|
if (K) {
|
|
80
81
|
I.current?.scrollToIndex(A, "auto");
|
|
@@ -87,12 +88,12 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
87
88
|
R.shown,
|
|
88
89
|
A
|
|
89
90
|
]);
|
|
90
|
-
let X =
|
|
91
|
-
|
|
91
|
+
let X = a(g);
|
|
92
|
+
i(() => {
|
|
92
93
|
X.current = g;
|
|
93
94
|
}, [g]);
|
|
94
|
-
let Z =
|
|
95
|
-
|
|
95
|
+
let Z = a(E);
|
|
96
|
+
i(() => {
|
|
96
97
|
Z.current !== E && (Z.current = E, X.current?.(E));
|
|
97
98
|
}, [E]), E !== Oe && (ke(E), j(-1));
|
|
98
99
|
let Fe = (e) => m ? z.includes(e) : C === e, Ie = (e) => B.find((t) => t.value === e)?.label ?? e, Le = (e, t) => {
|
|
@@ -120,7 +121,7 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
120
121
|
let t = z.slice(0, -1);
|
|
121
122
|
w(t), h?.(t);
|
|
122
123
|
}
|
|
123
|
-
}, Q = (e, t, n) => /* @__PURE__ */
|
|
124
|
+
}, Q = (e, t, n) => /* @__PURE__ */ c(oe, {
|
|
124
125
|
ref: !n && t === A ? L : void 0,
|
|
125
126
|
value: e.value,
|
|
126
127
|
id: J(t),
|
|
@@ -131,8 +132,9 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
131
132
|
onSelect: ze,
|
|
132
133
|
className: n ? ye : void 0,
|
|
133
134
|
children: H && t === 0 ? je : we ? be(e.label, E) : e.label
|
|
134
|
-
}, e.value), $ = /* @__PURE__ */
|
|
135
|
+
}, e.value), $ = /* @__PURE__ */ c("input", {
|
|
135
136
|
ref: Ae,
|
|
137
|
+
"data-slot": "input",
|
|
136
138
|
role: "combobox",
|
|
137
139
|
style: m ? void 0 : R.triggerStyle,
|
|
138
140
|
"aria-expanded": O,
|
|
@@ -150,19 +152,21 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
150
152
|
onClick: m ? void 0 : R.onTriggerClick,
|
|
151
153
|
onKeyDown: Be
|
|
152
154
|
});
|
|
153
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ l("div", {
|
|
154
156
|
className: e([ue, Ee]),
|
|
155
|
-
children: [m ? /* @__PURE__ */
|
|
157
|
+
children: [m ? /* @__PURE__ */ l("div", {
|
|
156
158
|
ref: P,
|
|
159
|
+
"data-slot": "trigger",
|
|
157
160
|
style: R.triggerStyle,
|
|
158
161
|
onPointerDown: R.onTriggerPointerDown,
|
|
159
162
|
onClick: () => {
|
|
160
163
|
R.onTriggerClick(), N.current?.focus();
|
|
161
164
|
},
|
|
162
165
|
className: e(fe),
|
|
163
|
-
children: [z.map((e) => /* @__PURE__ */
|
|
166
|
+
children: [z.map((e) => /* @__PURE__ */ c("span", {
|
|
167
|
+
"data-slot": "item",
|
|
164
168
|
onClick: (e) => e.stopPropagation(),
|
|
165
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ c(ne, {
|
|
166
170
|
color: "primary",
|
|
167
171
|
onClose: () => {
|
|
168
172
|
let t = z.filter((t) => t !== e);
|
|
@@ -171,7 +175,7 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
171
175
|
children: Ie(e)
|
|
172
176
|
})
|
|
173
177
|
}, e)), $]
|
|
174
|
-
}) : $, /* @__PURE__ */
|
|
178
|
+
}) : $, /* @__PURE__ */ c(ee, {
|
|
175
179
|
ref: F,
|
|
176
180
|
behavior: R,
|
|
177
181
|
placement: "bottom-span",
|
|
@@ -180,19 +184,21 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
180
184
|
"aria-multiselectable": m ? "true" : void 0,
|
|
181
185
|
visualClass: K ? ge : he,
|
|
182
186
|
style: v !== void 0 && !K ? { maxHeight: `${v}px` } : void 0,
|
|
183
|
-
children: _ ? /* @__PURE__ */
|
|
187
|
+
children: _ ? /* @__PURE__ */ c("div", {
|
|
184
188
|
role: "option",
|
|
189
|
+
"data-slot": "loading",
|
|
185
190
|
"aria-selected": !1,
|
|
186
191
|
"aria-disabled": "true",
|
|
187
192
|
className: e([f]),
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
-
}) : W.length === 0 ? /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ c(re, { size: "sm" })
|
|
194
|
+
}) : W.length === 0 ? /* @__PURE__ */ c("div", {
|
|
190
195
|
role: "option",
|
|
196
|
+
"data-slot": "empty",
|
|
191
197
|
"aria-selected": !1,
|
|
192
198
|
"aria-disabled": "true",
|
|
193
199
|
className: e([f]),
|
|
194
200
|
children: Ce ?? S.noResults
|
|
195
|
-
}) : K ? /* @__PURE__ */
|
|
201
|
+
}) : K ? /* @__PURE__ */ c(ie, {
|
|
196
202
|
ref: I,
|
|
197
203
|
"data-virtualized": !0,
|
|
198
204
|
items: W,
|
|
@@ -202,13 +208,14 @@ function p({ value: i, open: d, options: p, multiple: m = !1, onValuesChange: h,
|
|
|
202
208
|
groups: Pe ? Y.filter((e) => e.label !== void 0).map((t) => ({
|
|
203
209
|
startIndex: t.rows[0]?.index ?? 0,
|
|
204
210
|
key: t.key,
|
|
205
|
-
render: () => /* @__PURE__ */
|
|
211
|
+
render: () => /* @__PURE__ */ c("div", {
|
|
212
|
+
"data-slot": "group-label",
|
|
206
213
|
className: e([me]),
|
|
207
214
|
children: t.label
|
|
208
215
|
})
|
|
209
216
|
})) : void 0,
|
|
210
217
|
renderItem: (e, t) => Q(e, t, !0)
|
|
211
|
-
}) : Y.flatMap((e) => e.label === void 0 ? e.rows.map(({ option: e, index: t }) => Q(e, t, !1)) : [/* @__PURE__ */
|
|
218
|
+
}) : Y.flatMap((e) => e.label === void 0 ? e.rows.map(({ option: e, index: t }) => Q(e, t, !1)) : [/* @__PURE__ */ c(ae, {
|
|
212
219
|
label: e.label,
|
|
213
220
|
children: e.rows.map(({ option: e, index: t }) => Q(e, t, !1))
|
|
214
221
|
}, e.key)])
|
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useId as t } from "react";
|
|
6
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
7
7
|
//#region src/lib/components/Combobox/ComboboxGroup.tsx
|
|
8
8
|
var i = "haze-ComboboxGroup__groupHeading";
|
|
9
9
|
function a({ label: a, className: o, children: s }) {
|
|
10
|
-
let c =
|
|
11
|
-
return /* @__PURE__ */
|
|
10
|
+
let c = t();
|
|
11
|
+
return /* @__PURE__ */ r("div", {
|
|
12
|
+
"data-slot": "group",
|
|
12
13
|
role: "group",
|
|
13
14
|
"aria-labelledby": c,
|
|
14
15
|
className: e([o]),
|
|
15
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ n("div", {
|
|
16
17
|
id: c,
|
|
18
|
+
"data-slot": "group-label",
|
|
17
19
|
className: e([i]),
|
|
18
20
|
children: a
|
|
19
21
|
}), s]
|
|
@@ -8,6 +8,7 @@ var n = "haze-ComboboxOption__option", r = "haze-ComboboxOption__highlightedStyl
|
|
|
8
8
|
function a({ value: a, highlighted: o = !1, selected: s = !1, id: c, ref: l, setSize: u, posInSet: d, onSelect: f, className: p, children: m }) {
|
|
9
9
|
return /* @__PURE__ */ t("div", {
|
|
10
10
|
ref: l,
|
|
11
|
+
"data-slot": "option",
|
|
11
12
|
role: "option",
|
|
12
13
|
id: c,
|
|
13
14
|
"aria-selected": s || o,
|
|
@@ -7,39 +7,40 @@ import { getEnabledMenuItems as r, useMenuKeyboard as i, useRovingTabindex as a
|
|
|
7
7
|
import o from "../Kbd/Kbd.js";
|
|
8
8
|
import { collectCommandItems as s, commandItemMatches as c } from "./command-filter.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { Children as l, createContext as u, useContext as d, useId as f, useMemo as p, useRef as m } from "react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
12
|
import { useControl as _ } from "react-use-control";
|
|
13
13
|
//#region src/lib/components/Command/Command.tsx
|
|
14
|
-
var v = "[role=\"option\"]", y =
|
|
14
|
+
var v = "[role=\"option\"]", y = u(void 0);
|
|
15
15
|
function b() {
|
|
16
|
-
let e =
|
|
16
|
+
let e = d(y);
|
|
17
17
|
if (!e) throw Error("Command sub-components must be used within <Command>");
|
|
18
18
|
return e;
|
|
19
19
|
}
|
|
20
20
|
var x = "haze-Command__base";
|
|
21
21
|
function S({ query: t, shouldFilter: n = !0, onItemSelect: r, children: i, className: a }) {
|
|
22
|
-
let [o, s] = _(t, ""), c =
|
|
22
|
+
let [o, s] = _(t, ""), c = m(null), l = m(null), u = f(), d = p(() => ({
|
|
23
23
|
query: o,
|
|
24
24
|
setQuery: s,
|
|
25
25
|
shouldFilter: n,
|
|
26
26
|
onItemSelect: r,
|
|
27
27
|
inputRef: c,
|
|
28
|
-
listRef:
|
|
29
|
-
listId:
|
|
28
|
+
listRef: l,
|
|
29
|
+
listId: u
|
|
30
30
|
}), [
|
|
31
31
|
o,
|
|
32
32
|
s,
|
|
33
33
|
n,
|
|
34
34
|
r,
|
|
35
|
-
|
|
35
|
+
u
|
|
36
36
|
]);
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
value:
|
|
39
|
-
children:
|
|
37
|
+
return /* @__PURE__ */ h(y.Provider, {
|
|
38
|
+
value: d,
|
|
39
|
+
children: h("div", {
|
|
40
|
+
"data-slot": "command",
|
|
40
41
|
role: "combobox",
|
|
41
42
|
"aria-expanded": !0,
|
|
42
|
-
"aria-controls":
|
|
43
|
+
"aria-controls": u,
|
|
43
44
|
className: e([x, a]),
|
|
44
45
|
children: i
|
|
45
46
|
})
|
|
@@ -47,9 +48,10 @@ function S({ query: t, shouldFilter: n = !0, onItemSelect: r, children: i, class
|
|
|
47
48
|
}
|
|
48
49
|
var C = "haze-Command__inputStyle";
|
|
49
50
|
function w({ placeholder: n, className: i, ref: a }) {
|
|
50
|
-
let { query: o, setQuery: s, inputRef: c, listRef:
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
let { query: o, setQuery: s, inputRef: c, listRef: l } = b();
|
|
52
|
+
return /* @__PURE__ */ h("input", {
|
|
52
53
|
ref: t(c, a),
|
|
54
|
+
"data-slot": "input",
|
|
53
55
|
type: "text",
|
|
54
56
|
placeholder: n,
|
|
55
57
|
value: o,
|
|
@@ -57,7 +59,7 @@ function w({ placeholder: n, className: i, ref: a }) {
|
|
|
57
59
|
onKeyDown: (e) => {
|
|
58
60
|
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
59
61
|
e.preventDefault();
|
|
60
|
-
let t = r(
|
|
62
|
+
let t = r(l.current, v);
|
|
61
63
|
(e.key === "ArrowDown" ? t[0] : t[t.length - 1])?.focus();
|
|
62
64
|
},
|
|
63
65
|
className: e([C, i])
|
|
@@ -65,41 +67,45 @@ function w({ placeholder: n, className: i, ref: a }) {
|
|
|
65
67
|
}
|
|
66
68
|
var T = "haze-Command__listStyle", E = "haze-Command__emptyStyle";
|
|
67
69
|
function D({ children: t, empty: r, className: o }) {
|
|
68
|
-
let { inputRef:
|
|
70
|
+
let { inputRef: l, listRef: u, listId: d, shouldFilter: f, query: p } = b(), m = n("command");
|
|
69
71
|
a({
|
|
70
|
-
menuRef:
|
|
72
|
+
menuRef: u,
|
|
71
73
|
active: !0,
|
|
72
74
|
selector: v
|
|
73
75
|
});
|
|
74
76
|
let _ = i({
|
|
75
|
-
menuRef:
|
|
77
|
+
menuRef: u,
|
|
76
78
|
selector: v,
|
|
77
|
-
onClose: () =>
|
|
78
|
-
}), y = s(t, M), x =
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
ref:
|
|
79
|
+
onClose: () => l.current?.focus()
|
|
80
|
+
}), y = s(t, M), x = f && y.length > 0 && !y.some((e) => c(e.props, p));
|
|
81
|
+
return /* @__PURE__ */ g("div", {
|
|
82
|
+
ref: u,
|
|
83
|
+
"data-slot": "list",
|
|
81
84
|
role: "listbox",
|
|
82
|
-
id:
|
|
85
|
+
id: d,
|
|
83
86
|
onKeyDown: _,
|
|
84
87
|
className: e([T, o]),
|
|
85
|
-
children: [t, x && /* @__PURE__ */
|
|
88
|
+
children: [t, x && /* @__PURE__ */ h("div", {
|
|
89
|
+
"data-slot": "empty",
|
|
86
90
|
role: "option",
|
|
87
91
|
"aria-selected": !1,
|
|
88
92
|
"aria-disabled": "true",
|
|
89
93
|
className: e([E]),
|
|
90
|
-
children: r ??
|
|
94
|
+
children: r ?? m.noResults
|
|
91
95
|
})]
|
|
92
96
|
});
|
|
93
97
|
}
|
|
94
98
|
var O = "haze-Command__groupHeading";
|
|
95
99
|
function k({ heading: t, children: n, className: r }) {
|
|
96
|
-
let { shouldFilter: i, query: a } = b(), o =
|
|
97
|
-
return (
|
|
100
|
+
let { shouldFilter: i, query: a } = b(), o = f(), u = s(n, M);
|
|
101
|
+
return (u.length === 0 ? l.count(n) > 0 : !i || u.some((e) => c(e.props, a))) ? /* @__PURE__ */ g("div", {
|
|
102
|
+
"data-slot": "group",
|
|
98
103
|
role: "group",
|
|
99
104
|
"aria-labelledby": t === void 0 ? void 0 : o,
|
|
100
105
|
className: e([r]),
|
|
101
|
-
children: [t !== void 0 && /* @__PURE__ */
|
|
106
|
+
children: [t !== void 0 && /* @__PURE__ */ h("div", {
|
|
102
107
|
id: o,
|
|
108
|
+
"data-slot": "group-label",
|
|
103
109
|
className: e([O]),
|
|
104
110
|
children: t
|
|
105
111
|
}), n]
|
|
@@ -107,28 +113,29 @@ function k({ heading: t, children: n, className: r }) {
|
|
|
107
113
|
}
|
|
108
114
|
var A = "haze-Command__itemStyle", j = "haze-Command__itemWithShortcut";
|
|
109
115
|
function M({ children: t, value: n, keywords: r, shortcut: i, className: a, onSelect: s }) {
|
|
110
|
-
let { shouldFilter:
|
|
111
|
-
if (
|
|
116
|
+
let { shouldFilter: l, query: u, onItemSelect: d } = b();
|
|
117
|
+
if (l && !c({
|
|
112
118
|
value: n,
|
|
113
119
|
keywords: r,
|
|
114
120
|
children: t
|
|
115
|
-
},
|
|
116
|
-
let
|
|
117
|
-
s?.(),
|
|
121
|
+
}, u)) return null;
|
|
122
|
+
let f = () => {
|
|
123
|
+
s?.(), d?.();
|
|
118
124
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ g("div", {
|
|
126
|
+
"data-slot": "item",
|
|
120
127
|
role: "option",
|
|
121
128
|
tabIndex: -1,
|
|
122
|
-
onClick:
|
|
129
|
+
onClick: f,
|
|
123
130
|
onKeyDown: (e) => {
|
|
124
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
131
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), f());
|
|
125
132
|
},
|
|
126
133
|
className: e([
|
|
127
134
|
A,
|
|
128
135
|
i !== void 0 && j,
|
|
129
136
|
a
|
|
130
137
|
]),
|
|
131
|
-
children: [t, i !== void 0 && /* @__PURE__ */
|
|
138
|
+
children: [t, i !== void 0 && /* @__PURE__ */ h(o, {
|
|
132
139
|
size: "sm",
|
|
133
140
|
children: i
|
|
134
141
|
})]
|
|
@@ -4,28 +4,28 @@ import e from "../Dialog/Dialog.js";
|
|
|
4
4
|
import t, { CommandInput as n } from "./Command.js";
|
|
5
5
|
import { useHotkeys as r } from "../../hooks/useHotkeys.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCallback as i, useEffect as a, useRef as o } from "react";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
9
|
import { useControl as l } from "react-use-control";
|
|
10
10
|
//#region src/lib/components/Command/CommandDialog.tsx
|
|
11
11
|
var u = "haze-CommandDialog__panel", d = "haze-CommandDialog__panelTitle", f = "haze-CommandDialog__palette";
|
|
12
12
|
function p({ open: p, onOpenChange: m, hotkey: h, title: g, placeholder: _, children: v, className: y }) {
|
|
13
|
-
let [b, x, S] = l(p, !1), C =
|
|
13
|
+
let [b, x, S] = l(p, !1), C = o(null), w = i(() => {
|
|
14
14
|
let e = !b;
|
|
15
15
|
x(e), m?.(e);
|
|
16
16
|
}, [
|
|
17
17
|
b,
|
|
18
18
|
x,
|
|
19
19
|
m
|
|
20
|
-
]), T =
|
|
20
|
+
]), T = i(() => {
|
|
21
21
|
x(!1), m?.(!1);
|
|
22
22
|
}, [x, m]);
|
|
23
23
|
return r(h === void 0 ? {} : { [h]: w }, {
|
|
24
24
|
enabled: h !== void 0,
|
|
25
25
|
allowInInput: !0
|
|
26
|
-
}),
|
|
26
|
+
}), a(() => {
|
|
27
27
|
b && C.current?.focus();
|
|
28
|
-
}, [b]), /* @__PURE__ */
|
|
28
|
+
}, [b]), /* @__PURE__ */ s(e, {
|
|
29
29
|
open: S,
|
|
30
30
|
onClose: () => m?.(!1),
|
|
31
31
|
title: g,
|
|
@@ -34,10 +34,10 @@ function p({ open: p, onOpenChange: m, hotkey: h, title: g, placeholder: _, chil
|
|
|
34
34
|
header: d
|
|
35
35
|
},
|
|
36
36
|
className: y,
|
|
37
|
-
children:
|
|
37
|
+
children: c(t, {
|
|
38
38
|
className: f,
|
|
39
39
|
onItemSelect: T,
|
|
40
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ s(n, {
|
|
41
41
|
ref: C,
|
|
42
42
|
placeholder: _
|
|
43
43
|
}), v]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as e } from "react";
|
|
3
|
+
//#region src/lib/components/ConfigProvider/ConfigContext.ts
|
|
4
|
+
var t = e(void 0);
|
|
5
|
+
function n(e, t) {
|
|
6
|
+
return e === void 0 ? t ?? {} : t === void 0 ? e : {
|
|
7
|
+
Button: {
|
|
8
|
+
...e.Button ?? {},
|
|
9
|
+
...t.Button ?? {}
|
|
10
|
+
},
|
|
11
|
+
ButtonLink: {
|
|
12
|
+
...e.ButtonLink ?? {},
|
|
13
|
+
...t.ButtonLink ?? {}
|
|
14
|
+
},
|
|
15
|
+
Toast: {
|
|
16
|
+
...e.Toast ?? {},
|
|
17
|
+
...t.Toast ?? {}
|
|
18
|
+
},
|
|
19
|
+
Tooltip: {
|
|
20
|
+
...e.Tooltip ?? {},
|
|
21
|
+
...t.Tooltip ?? {}
|
|
22
|
+
},
|
|
23
|
+
HoverCard: {
|
|
24
|
+
...e.HoverCard ?? {},
|
|
25
|
+
...t.HoverCard ?? {}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { t as ConfigContext, n as mergeConfig };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ConfigContext as e, mergeConfig as t } from "./ConfigContext.js";
|
|
3
|
+
import { useContext as n, useMemo as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/lib/components/ConfigProvider/ConfigProvider.tsx
|
|
6
|
+
function a({ defaults: a, children: o }) {
|
|
7
|
+
let s = n(e), c = r(() => t(s, a), [s, a]);
|
|
8
|
+
return /* @__PURE__ */ i(e.Provider, {
|
|
9
|
+
value: c,
|
|
10
|
+
children: o
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { a as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ConfigContext as e } from "./ConfigContext.js";
|
|
3
|
+
import { useContext as t } from "react";
|
|
4
|
+
//#region src/lib/components/ConfigProvider/useConfigDefaults.ts
|
|
5
|
+
var n = Object.freeze({});
|
|
6
|
+
function r(r) {
|
|
7
|
+
return t(e)?.[r] ?? n;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as useConfigDefaults };
|
|
@@ -5,8 +5,8 @@ import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
|
5
5
|
import { Presence as n } from "../../utils/presence.js";
|
|
6
6
|
import { useFocusScope as r } from "../../utils/focus-scope.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useId as i } from "react";
|
|
9
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
10
10
|
import { useControl as s } from "react-use-control";
|
|
11
11
|
//#region src/lib/components/ConfirmDialog/ConfirmDialog.tsx
|
|
12
12
|
var c = "haze-ConfirmDialog__overlay", l = "haze-ConfirmDialog__dialog", u = "haze-ConfirmDialog__header", d = "haze-ConfirmDialog__body", f = "haze-ConfirmDialog__footer", p = "haze-ConfirmDialog__btn", m = "haze-ConfirmDialog__cancelBtn", h = "haze-ConfirmDialog__confirmBtn", g = "haze-ConfirmDialog__dangerBtn";
|
|
@@ -14,16 +14,17 @@ function _({ open: _, onClose: v, onConfirm: y, onCancel: b, title: x, children:
|
|
|
14
14
|
let [O, k] = s(_, !1), A = t("confirmDialog"), j = C ?? A.confirm, M = w ?? A.cancel, N = r({
|
|
15
15
|
enabled: O,
|
|
16
16
|
trapped: !0
|
|
17
|
-
}), P = `haze-confirm-title-${
|
|
17
|
+
}), P = `haze-confirm-title-${i()}`, F = () => {
|
|
18
18
|
k(!1), v?.();
|
|
19
19
|
}, I = () => {
|
|
20
20
|
b?.(), F();
|
|
21
21
|
}, L = () => {
|
|
22
22
|
y?.(), F();
|
|
23
23
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ a(n, {
|
|
25
25
|
present: O,
|
|
26
|
-
children:
|
|
26
|
+
children: a("div", {
|
|
27
|
+
"data-slot": "mask",
|
|
27
28
|
onClick: () => {
|
|
28
29
|
O && F();
|
|
29
30
|
},
|
|
@@ -31,8 +32,9 @@ function _({ open: _, onClose: v, onConfirm: y, onCancel: b, title: x, children:
|
|
|
31
32
|
e.key === "Escape" && O && F();
|
|
32
33
|
},
|
|
33
34
|
className: e([c, E]),
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ o("div", {
|
|
35
36
|
ref: N,
|
|
37
|
+
"data-slot": "content",
|
|
36
38
|
role: "dialog",
|
|
37
39
|
"aria-modal": "true",
|
|
38
40
|
"aria-labelledby": x === void 0 ? void 0 : P,
|
|
@@ -40,23 +42,28 @@ function _({ open: _, onClose: v, onConfirm: y, onCancel: b, title: x, children:
|
|
|
40
42
|
onClick: (e) => e.stopPropagation(),
|
|
41
43
|
className: e([l]),
|
|
42
44
|
children: [
|
|
43
|
-
x && /* @__PURE__ */
|
|
45
|
+
x && /* @__PURE__ */ a("div", {
|
|
44
46
|
id: P,
|
|
47
|
+
"data-slot": "title",
|
|
45
48
|
className: e([u]),
|
|
46
49
|
children: x
|
|
47
50
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ a("div", {
|
|
52
|
+
"data-slot": "description",
|
|
49
53
|
className: e([d]),
|
|
50
54
|
children: S
|
|
51
55
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ o("div", {
|
|
57
|
+
"data-slot": "footer",
|
|
53
58
|
className: e([f]),
|
|
54
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ a("button", {
|
|
60
|
+
"data-slot": "cancel-button",
|
|
55
61
|
type: "button",
|
|
56
62
|
onClick: I,
|
|
57
63
|
className: e([p, m]),
|
|
58
64
|
children: M
|
|
59
|
-
}), /* @__PURE__ */
|
|
65
|
+
}), /* @__PURE__ */ a("button", {
|
|
66
|
+
"data-slot": "confirm-button",
|
|
60
67
|
type: "button",
|
|
61
68
|
onClick: L,
|
|
62
69
|
className: e([p, T === "danger" ? g : h]),
|
|
@@ -4,20 +4,20 @@ import { classnames as e } from "../../utils/classnames.js";
|
|
|
4
4
|
import { useFloating as t } from "../../utils/floating.js";
|
|
5
5
|
import { ContextMenuProvider as n } from "./ContextMenuContext.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCallback as r, useRef as i, useState as a } from "react";
|
|
8
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
9
9
|
import { useControl as s } from "react-use-control";
|
|
10
10
|
//#region src/lib/components/ContextMenu/ContextMenu.tsx
|
|
11
11
|
var c = "haze-ContextMenu__wrapper";
|
|
12
12
|
function l({ open: l, onOpenChange: u, children: d, className: f }) {
|
|
13
|
-
let [p, m] = s(l, !1), [h, g] =
|
|
13
|
+
let [p, m] = s(l, !1), [h, g] = a(0), [_, v] = a(0), y = i(null), b = i(null), x = r((e) => {
|
|
14
14
|
let t = typeof e == "function" ? e(p) : e;
|
|
15
15
|
m(t), u?.(t);
|
|
16
16
|
}, [
|
|
17
17
|
p,
|
|
18
18
|
m,
|
|
19
19
|
u
|
|
20
|
-
]), S =
|
|
20
|
+
]), S = r((e, t) => {
|
|
21
21
|
g(e), v(t);
|
|
22
22
|
}, []), C = t({
|
|
23
23
|
open: p,
|
|
@@ -26,7 +26,7 @@ function l({ open: l, onOpenChange: u, children: d, className: f }) {
|
|
|
26
26
|
panelRef: b,
|
|
27
27
|
animated: !0
|
|
28
28
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ o(n, {
|
|
30
30
|
value: {
|
|
31
31
|
open: p,
|
|
32
32
|
setOpen: x,
|
|
@@ -36,8 +36,9 @@ function l({ open: l, onOpenChange: u, children: d, className: f }) {
|
|
|
36
36
|
contentRef: b,
|
|
37
37
|
floating: C
|
|
38
38
|
},
|
|
39
|
-
children:
|
|
39
|
+
children: o("div", {
|
|
40
40
|
ref: y,
|
|
41
|
+
"data-slot": "context-menu",
|
|
41
42
|
className: e([c, f]),
|
|
42
43
|
children: d
|
|
43
44
|
})
|
|
@@ -5,8 +5,8 @@ import { useFocusScope as t } from "../../utils/focus-scope.js";
|
|
|
5
5
|
import { useMenuKeyboard as n, useRovingTabindex as r } from "../../utils/menuKeyboard.js";
|
|
6
6
|
import { useContextMenuContext as i } from "./ContextMenuContext.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useCallback as a } from "react";
|
|
9
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
10
10
|
//#region src/lib/components/ContextMenu/ContextMenuContent.tsx
|
|
11
11
|
var s = "haze-ContextMenuContent__content";
|
|
12
12
|
function c({ children: c, className: l }) {
|
|
@@ -22,10 +22,10 @@ function c({ children: c, className: l }) {
|
|
|
22
22
|
enabled: u && h.shown,
|
|
23
23
|
autoFocus: !0,
|
|
24
24
|
returnFocus: !0
|
|
25
|
-
}), v =
|
|
25
|
+
}), v = a((e) => {
|
|
26
26
|
m.current = e, _(e);
|
|
27
27
|
}, [m, _]);
|
|
28
|
-
return !u && h.exited ? null : /* @__PURE__ */
|
|
28
|
+
return !u && h.exited ? null : /* @__PURE__ */ o(e, {
|
|
29
29
|
ref: v,
|
|
30
30
|
behavior: h,
|
|
31
31
|
role: "menu",
|
|
@@ -9,6 +9,7 @@ var r = "haze-ContextMenuTrigger__trigger";
|
|
|
9
9
|
function i({ children: i, className: a }) {
|
|
10
10
|
let { setOpen: o, setPosition: s } = t();
|
|
11
11
|
return /* @__PURE__ */ n("div", {
|
|
12
|
+
"data-slot": "trigger",
|
|
12
13
|
onContextMenu: (e) => {
|
|
13
14
|
e.preventDefault(), s(e.clientX, e.clientY), o(!0);
|
|
14
15
|
},
|