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
|
@@ -3,63 +3,66 @@
|
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
import { Presence as t } from "../../utils/presence.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { createContext as n, useContext as r } from "react";
|
|
7
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
8
8
|
import { useControl as a } from "react-use-control";
|
|
9
9
|
//#region src/lib/components/Collapsible/Collapsible.tsx
|
|
10
|
-
var o =
|
|
10
|
+
var o = n(void 0);
|
|
11
11
|
function s() {
|
|
12
|
-
let e =
|
|
12
|
+
let e = r(o);
|
|
13
13
|
if (!e) throw Error("Collapsible sub-components must be used within <Collapsible>");
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
16
16
|
var c = "haze-Collapsible__base";
|
|
17
|
-
function l({ open: t, defaultOpen:
|
|
18
|
-
let [u, d] = a(t,
|
|
19
|
-
return /* @__PURE__ */
|
|
17
|
+
function l({ open: t, defaultOpen: n = !1, classNames: r, children: s, className: l }) {
|
|
18
|
+
let [u, d] = a(t, n);
|
|
19
|
+
return /* @__PURE__ */ i(o.Provider, {
|
|
20
20
|
value: {
|
|
21
21
|
open: u,
|
|
22
22
|
toggle: () => d((e) => !e),
|
|
23
|
-
classNames:
|
|
23
|
+
classNames: r
|
|
24
24
|
},
|
|
25
|
-
children:
|
|
25
|
+
children: i("div", {
|
|
26
|
+
"data-slot": "collapsible",
|
|
26
27
|
className: e([
|
|
27
28
|
c,
|
|
28
29
|
l,
|
|
29
|
-
|
|
30
|
+
r?.root
|
|
30
31
|
]),
|
|
31
32
|
children: s
|
|
32
33
|
})
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
var u = "haze-Collapsible__triggerStyle";
|
|
36
|
-
function d({ children: t, className:
|
|
37
|
-
let { toggle:
|
|
38
|
-
return /* @__PURE__ */
|
|
37
|
+
function d({ children: t, className: n }) {
|
|
38
|
+
let { toggle: r, classNames: a } = s();
|
|
39
|
+
return /* @__PURE__ */ i("button", {
|
|
39
40
|
type: "button",
|
|
40
|
-
|
|
41
|
+
"data-slot": "trigger",
|
|
42
|
+
onClick: r,
|
|
41
43
|
className: e([
|
|
42
44
|
u,
|
|
43
|
-
|
|
45
|
+
n,
|
|
44
46
|
a?.trigger
|
|
45
47
|
]),
|
|
46
48
|
children: t
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
51
|
var f = "haze-Collapsible__contentOuter", p = "haze-Collapsible__contentInner";
|
|
50
|
-
function m({ children:
|
|
52
|
+
function m({ children: n, className: r }) {
|
|
51
53
|
let { open: a, classNames: o } = s();
|
|
52
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ i(t, {
|
|
53
55
|
present: a,
|
|
54
|
-
children:
|
|
56
|
+
children: i("div", {
|
|
57
|
+
"data-slot": "content",
|
|
55
58
|
className: e([
|
|
56
59
|
f,
|
|
57
|
-
|
|
60
|
+
r,
|
|
58
61
|
o?.content
|
|
59
62
|
]),
|
|
60
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ i("div", {
|
|
61
64
|
className: e(p),
|
|
62
|
-
children:
|
|
65
|
+
children: n
|
|
63
66
|
})
|
|
64
67
|
})
|
|
65
68
|
});
|
|
@@ -1,19 +1,90 @@
|
|
|
1
|
+
|
|
1
2
|
"use client";
|
|
2
|
-
import e from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import { mergeRefs as t } from "../../utils/refs.js";
|
|
5
|
+
import { useStrings as n } from "../LocaleProvider/useStrings.js";
|
|
6
|
+
import { FloatingPanel as r, useFloating as i } from "../../utils/floating.js";
|
|
7
|
+
import { cssColor as a, parseColor as o, rgbHexKey as s } from "./color-math.js";
|
|
8
|
+
import { checkerboard as c, panelVisuals as l, swatchFill as u, trigger as d } from "./color-picker-styles.js";
|
|
9
|
+
import f from "./ColorPickerPanel.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
import { useCallback as p, useEffect as m, useId as h, useRef as g, useState as _ } from "react";
|
|
12
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
|
+
import { useControl as b } from "react-use-control";
|
|
5
14
|
//#region src/lib/components/ColorPicker/ColorPicker.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var x = 10, S = "haze-ColorPicker__container";
|
|
16
|
+
function C({ value: C, onChange: w, open: T, inline: E = !1, format: D = "hex", allowAlpha: O = !1, presets: k, recent: A = !1, className: j, "aria-label": M, ref: N }) {
|
|
17
|
+
let P = n("colorPicker"), [F, I] = b(C, "#000000"), [L, R] = b(T, !1), z = M ?? P.pickColor, B = o(F)?.rgb ?? {
|
|
18
|
+
r: 0,
|
|
19
|
+
g: 0,
|
|
20
|
+
b: 0
|
|
21
|
+
}, V = p((e) => {
|
|
22
|
+
I(e), w?.(e);
|
|
23
|
+
}, [I, w]), [H, U] = _([]), W = p((e) => {
|
|
24
|
+
if (!A) return;
|
|
25
|
+
let t = s(o(e)?.rgb ?? {
|
|
26
|
+
r: 0,
|
|
27
|
+
g: 0,
|
|
28
|
+
b: 0
|
|
29
|
+
});
|
|
30
|
+
U((n) => [e, ...n.filter((e) => {
|
|
31
|
+
let n = o(e);
|
|
32
|
+
return n === null || s(n.rgb) !== t;
|
|
33
|
+
})].slice(0, x));
|
|
34
|
+
}, [A]), G = /* @__PURE__ */ v(f, {
|
|
35
|
+
value: F,
|
|
36
|
+
onChange: V,
|
|
37
|
+
onCommit: W,
|
|
38
|
+
format: D,
|
|
39
|
+
allowAlpha: O,
|
|
40
|
+
presets: k,
|
|
41
|
+
recentColors: A ? H : void 0
|
|
42
|
+
}), K = g(null), q = g(null), J = p((e) => t(K, N)(e), [N]), Y = h(), X = i({
|
|
43
|
+
open: L,
|
|
44
|
+
setOpen: R,
|
|
45
|
+
triggerRef: K,
|
|
46
|
+
panelRef: q,
|
|
47
|
+
animated: !0
|
|
48
|
+
});
|
|
49
|
+
return m(() => {
|
|
50
|
+
X.shown && q.current?.querySelector("[role='slider']")?.focus();
|
|
51
|
+
}, [X.shown]), E ? /* @__PURE__ */ v("div", {
|
|
52
|
+
ref: N,
|
|
53
|
+
"data-slot": "color-picker",
|
|
54
|
+
className: e([l, j]),
|
|
55
|
+
children: G
|
|
56
|
+
}) : /* @__PURE__ */ y("span", {
|
|
57
|
+
"data-slot": "color-picker",
|
|
58
|
+
className: S,
|
|
59
|
+
children: [/* @__PURE__ */ v("button", {
|
|
60
|
+
ref: J,
|
|
61
|
+
type: "button",
|
|
62
|
+
"data-slot": "trigger",
|
|
63
|
+
style: X.triggerStyle,
|
|
64
|
+
"aria-label": z,
|
|
65
|
+
"aria-haspopup": "dialog",
|
|
66
|
+
"aria-expanded": L,
|
|
67
|
+
"aria-controls": Y,
|
|
68
|
+
onPointerDown: X.onTriggerPointerDown,
|
|
69
|
+
onClick: X.onTriggerClick,
|
|
70
|
+
className: e([d, c]),
|
|
71
|
+
children: /* @__PURE__ */ v("span", {
|
|
72
|
+
"data-slot": "swatch",
|
|
73
|
+
style: { background: a(B) },
|
|
74
|
+
className: e([u])
|
|
75
|
+
})
|
|
76
|
+
}), /* @__PURE__ */ v(r, {
|
|
77
|
+
ref: q,
|
|
78
|
+
behavior: X,
|
|
79
|
+
placement: "bottom",
|
|
80
|
+
id: Y,
|
|
81
|
+
role: "dialog",
|
|
82
|
+
"aria-label": z,
|
|
83
|
+
visualClass: l,
|
|
84
|
+
className: j,
|
|
85
|
+
children: G
|
|
86
|
+
})]
|
|
16
87
|
});
|
|
17
88
|
}
|
|
18
89
|
//#endregion
|
|
19
|
-
export {
|
|
90
|
+
export { C as default };
|
|
@@ -9,27 +9,33 @@ var i = "haze-ColorPickerCore__container", a = "haze-ColorPickerCore__previewRow
|
|
|
9
9
|
function d({ value: d, onChange: f, presets: p, className: m, ref: h }) {
|
|
10
10
|
let g = t("colorPicker");
|
|
11
11
|
return /* @__PURE__ */ r("div", {
|
|
12
|
+
"data-slot": "color-picker",
|
|
12
13
|
className: e([i, m]),
|
|
13
14
|
children: [/* @__PURE__ */ r("div", {
|
|
15
|
+
"data-slot": "preview",
|
|
14
16
|
className: e([a]),
|
|
15
17
|
children: [/* @__PURE__ */ n("input", {
|
|
16
18
|
ref: h,
|
|
17
19
|
type: "color",
|
|
20
|
+
"data-slot": "color-input",
|
|
18
21
|
value: d,
|
|
19
22
|
"aria-label": g.pickColor,
|
|
20
23
|
onChange: (e) => f(e.target.value),
|
|
21
24
|
className: e([o])
|
|
22
25
|
}), /* @__PURE__ */ n("input", {
|
|
23
26
|
type: "text",
|
|
27
|
+
"data-slot": "text-input",
|
|
24
28
|
value: d,
|
|
25
29
|
"aria-label": g.hexColor,
|
|
26
30
|
onChange: (e) => f(e.target.value),
|
|
27
31
|
className: e([s])
|
|
28
32
|
})]
|
|
29
33
|
}), p && p.length > 0 && /* @__PURE__ */ n("div", {
|
|
34
|
+
"data-slot": "swatch-row",
|
|
30
35
|
className: e([c]),
|
|
31
36
|
children: p.map((t) => /* @__PURE__ */ n("button", {
|
|
32
37
|
type: "button",
|
|
38
|
+
"data-slot": "swatch-item",
|
|
33
39
|
style: { background: t },
|
|
34
40
|
"aria-label": t,
|
|
35
41
|
onClick: () => f(t),
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
4
|
+
import { cssColor as n, formatColor as r, hsvToRgb as i, parseColor as a, rgbHexKey as o, rgbToHsv as s } from "./color-math.js";
|
|
5
|
+
import { checkerboard as c, hueTrack as l, panelContent as u, svArea as d, svThumb as f, swatchBtn as p, swatchFill as m, swatchRow as h, track as g, trackThumb as _, valueInput as v } from "./color-picker-styles.js";
|
|
6
|
+
import { useRef as y, useState as b } from "react";
|
|
7
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
|
+
//#region src/lib/components/ColorPicker/ColorPickerPanel.tsx
|
|
9
|
+
var w = {
|
|
10
|
+
r: 0,
|
|
11
|
+
g: 0,
|
|
12
|
+
b: 0
|
|
13
|
+
};
|
|
14
|
+
function T(e) {
|
|
15
|
+
return Math.min(Math.max(e, 0), 1);
|
|
16
|
+
}
|
|
17
|
+
function E(e) {
|
|
18
|
+
let t = e.getBoundingClientRect();
|
|
19
|
+
return t.width > 0 && t.height > 0 ? t : null;
|
|
20
|
+
}
|
|
21
|
+
function D(e, t, n) {
|
|
22
|
+
let r = y(null);
|
|
23
|
+
return {
|
|
24
|
+
onPointerDown(n) {
|
|
25
|
+
if (n.button !== 0) return;
|
|
26
|
+
let i = e(n);
|
|
27
|
+
if (i !== null) {
|
|
28
|
+
if (n.preventDefault(), r.current = n.pointerId, typeof n.currentTarget.setPointerCapture == "function") try {
|
|
29
|
+
n.currentTarget.setPointerCapture(n.pointerId);
|
|
30
|
+
} catch {}
|
|
31
|
+
t(i);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
onPointerMove(n) {
|
|
35
|
+
if (r.current !== n.pointerId) return;
|
|
36
|
+
let i = e(n);
|
|
37
|
+
i !== null && t(i);
|
|
38
|
+
},
|
|
39
|
+
onPointerUp(t) {
|
|
40
|
+
if (r.current !== t.pointerId) return;
|
|
41
|
+
r.current = null;
|
|
42
|
+
let i = e(t);
|
|
43
|
+
i !== null && n(i);
|
|
44
|
+
},
|
|
45
|
+
onPointerCancel(e) {
|
|
46
|
+
r.current === e.pointerId && (r.current = null);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function O(e) {
|
|
51
|
+
let t = E(e.currentTarget);
|
|
52
|
+
return t ? T((e.clientX - t.left) / t.width) : null;
|
|
53
|
+
}
|
|
54
|
+
function k({ value: y, onChange: k, onCommit: A, format: j = "hex", allowAlpha: M = !1, presets: N, recentColors: P, className: F }) {
|
|
55
|
+
let I = t("colorPicker"), L = a(y)?.rgb ?? w, R = M ? L.a ?? 1 : 1, z = s(L), B = o({
|
|
56
|
+
...L,
|
|
57
|
+
a: R
|
|
58
|
+
}), V = (e, t) => {
|
|
59
|
+
let n = r({
|
|
60
|
+
...e,
|
|
61
|
+
a: M ? e.a : void 0
|
|
62
|
+
}, j, M);
|
|
63
|
+
k(n), t && A?.(n);
|
|
64
|
+
}, H = (e, t) => {
|
|
65
|
+
V({
|
|
66
|
+
...i(e),
|
|
67
|
+
a: R
|
|
68
|
+
}, t);
|
|
69
|
+
}, U = (e, t) => {
|
|
70
|
+
V({
|
|
71
|
+
...L,
|
|
72
|
+
a: e
|
|
73
|
+
}, t);
|
|
74
|
+
}, W = D((e) => {
|
|
75
|
+
let t = E(e.currentTarget);
|
|
76
|
+
return t ? {
|
|
77
|
+
h: z.h,
|
|
78
|
+
s: T((e.clientX - t.left) / t.width),
|
|
79
|
+
v: 1 - T((e.clientY - t.top) / t.height)
|
|
80
|
+
} : null;
|
|
81
|
+
}, (e) => H(e, !1), (e) => H(e, !0)), G = D((e) => {
|
|
82
|
+
let t = O(e);
|
|
83
|
+
return t === null ? null : t * 360;
|
|
84
|
+
}, (e) => H({
|
|
85
|
+
...z,
|
|
86
|
+
h: e
|
|
87
|
+
}, !1), (e) => H({
|
|
88
|
+
...z,
|
|
89
|
+
h: e
|
|
90
|
+
}, !0)), K = D((e) => O(e), (e) => U(e, !1), (e) => U(e, !0)), q = (e) => {
|
|
91
|
+
let t = (e.shiftKey ? 10 : 1) / 100;
|
|
92
|
+
switch (e.key) {
|
|
93
|
+
case "ArrowLeft":
|
|
94
|
+
H({
|
|
95
|
+
...z,
|
|
96
|
+
s: T(z.s - t)
|
|
97
|
+
}, !0);
|
|
98
|
+
break;
|
|
99
|
+
case "ArrowRight":
|
|
100
|
+
H({
|
|
101
|
+
...z,
|
|
102
|
+
s: T(z.s + t)
|
|
103
|
+
}, !0);
|
|
104
|
+
break;
|
|
105
|
+
case "ArrowDown":
|
|
106
|
+
H({
|
|
107
|
+
...z,
|
|
108
|
+
v: T(z.v - t)
|
|
109
|
+
}, !0);
|
|
110
|
+
break;
|
|
111
|
+
case "ArrowUp":
|
|
112
|
+
H({
|
|
113
|
+
...z,
|
|
114
|
+
v: T(z.v + t)
|
|
115
|
+
}, !0);
|
|
116
|
+
break;
|
|
117
|
+
default: return;
|
|
118
|
+
}
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
}, J = (e) => {
|
|
121
|
+
let t = e.shiftKey ? 10 : 1;
|
|
122
|
+
switch (e.key) {
|
|
123
|
+
case "ArrowLeft":
|
|
124
|
+
case "ArrowDown":
|
|
125
|
+
H({
|
|
126
|
+
...z,
|
|
127
|
+
h: ((z.h - t) % 360 + 360) % 360
|
|
128
|
+
}, !0);
|
|
129
|
+
break;
|
|
130
|
+
case "ArrowRight":
|
|
131
|
+
case "ArrowUp":
|
|
132
|
+
H({
|
|
133
|
+
...z,
|
|
134
|
+
h: (z.h + t) % 360
|
|
135
|
+
}, !0);
|
|
136
|
+
break;
|
|
137
|
+
default: return;
|
|
138
|
+
}
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
}, Y = (e) => {
|
|
141
|
+
let t = (e.shiftKey ? 10 : 1) / 100;
|
|
142
|
+
switch (e.key) {
|
|
143
|
+
case "ArrowLeft":
|
|
144
|
+
case "ArrowDown":
|
|
145
|
+
U(T(R - t), !0);
|
|
146
|
+
break;
|
|
147
|
+
case "ArrowRight":
|
|
148
|
+
case "ArrowUp":
|
|
149
|
+
U(T(R + t), !0);
|
|
150
|
+
break;
|
|
151
|
+
default: return;
|
|
152
|
+
}
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
}, [X, Z] = b(null), ee = X ?? r({
|
|
155
|
+
...L,
|
|
156
|
+
a: R
|
|
157
|
+
}, j, M), Q = () => {
|
|
158
|
+
if (X === null) return;
|
|
159
|
+
let e = a(X);
|
|
160
|
+
Z(null), e && V(e.rgb, !0);
|
|
161
|
+
}, $ = (t, r) => /* @__PURE__ */ S("div", {
|
|
162
|
+
"data-slot": "swatch-row",
|
|
163
|
+
className: e([h]),
|
|
164
|
+
children: t.map((t) => {
|
|
165
|
+
let i = a(t)?.rgb;
|
|
166
|
+
return i ? /* @__PURE__ */ S("button", {
|
|
167
|
+
type: "button",
|
|
168
|
+
"data-slot": "swatch-item",
|
|
169
|
+
"aria-label": t,
|
|
170
|
+
onClick: () => V(i, !0),
|
|
171
|
+
className: e([
|
|
172
|
+
p,
|
|
173
|
+
c,
|
|
174
|
+
o(i) === B && "haze-color-picker-styles__swatchActive"
|
|
175
|
+
]),
|
|
176
|
+
children: /* @__PURE__ */ S("span", {
|
|
177
|
+
"data-slot": "swatch",
|
|
178
|
+
style: { background: n(i) },
|
|
179
|
+
className: e([m])
|
|
180
|
+
})
|
|
181
|
+
}, `${r}:${t}`) : null;
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
return /* @__PURE__ */ C("div", {
|
|
185
|
+
"data-slot": "panel",
|
|
186
|
+
className: e([u, F]),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ S("div", {
|
|
189
|
+
"data-slot": "saturation",
|
|
190
|
+
role: "slider",
|
|
191
|
+
tabIndex: 0,
|
|
192
|
+
"aria-label": I.saturationBrightness,
|
|
193
|
+
"aria-valuemin": 0,
|
|
194
|
+
"aria-valuemax": 100,
|
|
195
|
+
"aria-valuenow": Math.round(z.s * 100),
|
|
196
|
+
"aria-valuetext": r(L, "hex", !1),
|
|
197
|
+
style: { background: `linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0)), hsl(${z.h}, 100%, 50%)` },
|
|
198
|
+
onKeyDown: q,
|
|
199
|
+
...W,
|
|
200
|
+
className: e([d]),
|
|
201
|
+
children: /* @__PURE__ */ S("span", {
|
|
202
|
+
"data-slot": "thumb",
|
|
203
|
+
style: {
|
|
204
|
+
left: `${z.s * 100}%`,
|
|
205
|
+
top: `${(1 - z.v) * 100}%`
|
|
206
|
+
},
|
|
207
|
+
className: e([f])
|
|
208
|
+
})
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ S("div", {
|
|
211
|
+
"data-slot": "hue-track",
|
|
212
|
+
role: "slider",
|
|
213
|
+
tabIndex: 0,
|
|
214
|
+
"aria-label": I.hue,
|
|
215
|
+
"aria-valuemin": 0,
|
|
216
|
+
"aria-valuemax": 360,
|
|
217
|
+
"aria-valuenow": Math.round(z.h),
|
|
218
|
+
"aria-valuetext": `${Math.round(z.h)}deg`,
|
|
219
|
+
onKeyDown: J,
|
|
220
|
+
...G,
|
|
221
|
+
className: e([g, l]),
|
|
222
|
+
children: /* @__PURE__ */ S("span", {
|
|
223
|
+
"data-slot": "thumb",
|
|
224
|
+
style: { left: `${z.h / 360 * 100}%` },
|
|
225
|
+
className: e([_])
|
|
226
|
+
})
|
|
227
|
+
}),
|
|
228
|
+
M && /* @__PURE__ */ C("div", {
|
|
229
|
+
"data-slot": "alpha-track",
|
|
230
|
+
role: "slider",
|
|
231
|
+
tabIndex: 0,
|
|
232
|
+
"aria-label": I.alpha,
|
|
233
|
+
"aria-valuemin": 0,
|
|
234
|
+
"aria-valuemax": 100,
|
|
235
|
+
"aria-valuenow": Math.round(R * 100),
|
|
236
|
+
"aria-valuetext": `${Math.round(R * 100)}%`,
|
|
237
|
+
onKeyDown: Y,
|
|
238
|
+
...K,
|
|
239
|
+
className: e(["haze-color-picker-styles__track", "haze-color-picker-styles__checkerboard"]),
|
|
240
|
+
children: [/* @__PURE__ */ S("span", {
|
|
241
|
+
"data-slot": "fill",
|
|
242
|
+
style: { background: `linear-gradient(to right, rgba(${L.r}, ${L.g}, ${L.b}, 0), rgba(${L.r}, ${L.g}, ${L.b}, 1))` },
|
|
243
|
+
className: e(["haze-color-picker-styles__trackFill"])
|
|
244
|
+
}), /* @__PURE__ */ S("span", {
|
|
245
|
+
"data-slot": "thumb",
|
|
246
|
+
style: { left: `${R * 100}%` },
|
|
247
|
+
className: e(["haze-color-picker-styles__trackThumb"])
|
|
248
|
+
})]
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ S("input", {
|
|
251
|
+
type: "text",
|
|
252
|
+
"data-slot": "input",
|
|
253
|
+
"aria-label": I.hexColor,
|
|
254
|
+
spellCheck: !1,
|
|
255
|
+
value: ee,
|
|
256
|
+
onChange: (e) => Z(e.target.value),
|
|
257
|
+
onBlur: Q,
|
|
258
|
+
onKeyDown: (e) => {
|
|
259
|
+
e.key === "Enter" ? (e.preventDefault(), Q()) : e.key === "Escape" && (e.stopPropagation(), Z(null));
|
|
260
|
+
},
|
|
261
|
+
className: e([v])
|
|
262
|
+
}),
|
|
263
|
+
N !== void 0 && N.length > 0 && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
|
|
264
|
+
"data-slot": "group-label",
|
|
265
|
+
className: e(["haze-color-picker-styles__groupLabel"]),
|
|
266
|
+
children: I.presetsLabel
|
|
267
|
+
}), $(N, "preset")] }),
|
|
268
|
+
P !== void 0 && P.length > 0 && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
|
|
269
|
+
"data-slot": "group-label",
|
|
270
|
+
className: e(["haze-color-picker-styles__groupLabel"]),
|
|
271
|
+
children: I.recentColors
|
|
272
|
+
}), $(P, "recent")] })
|
|
273
|
+
]
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
export { k as default };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/lib/components/ColorPicker/color-math.ts
|
|
3
|
+
function e(e, t, n) {
|
|
4
|
+
return Math.min(Math.max(e, t), n);
|
|
5
|
+
}
|
|
6
|
+
function t(t) {
|
|
7
|
+
return e(t, 0, 1);
|
|
8
|
+
}
|
|
9
|
+
var n = /^#?([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
10
|
+
function r(t, n) {
|
|
11
|
+
let r = t.endsWith("%"), i = Number(r ? t.slice(0, -1) : t);
|
|
12
|
+
return Number.isFinite(i) ? e(r ? i / 100 * n : i, 0, n) : NaN;
|
|
13
|
+
}
|
|
14
|
+
function i(e) {
|
|
15
|
+
if (e === void 0) return;
|
|
16
|
+
let t = r(e, 1);
|
|
17
|
+
return Number.isFinite(t) ? t : 1;
|
|
18
|
+
}
|
|
19
|
+
var a = String.raw`\d*\.?\d+`, o = RegExp(`^rgba?\\(\\s*(${a}%?)\\s*[,\\s]\\s*(${a}%?)\\s*[,\\s]\\s*(${a}%?)\\s*(?:[,/]\\s*(${a}%?)\\s*)?\\)$`, "i"), s = RegExp(`^hsla?\\(\\s*(-?${a})(?:deg)?\\s*[,\\s]\\s*(${a})%\\s*[,\\s]\\s*(${a})%\\s*(?:[,/]\\s*(${a}%?)\\s*)?\\)$`, "i");
|
|
20
|
+
function c(e) {
|
|
21
|
+
let a = e.trim(), c = n.exec(a);
|
|
22
|
+
if (c) {
|
|
23
|
+
let e = c[1] ?? "", n = e.length === 3 || e.length === 4 ? e.split("").map((e) => e + e).join("") : e, r = Number.parseInt(n, 16);
|
|
24
|
+
return {
|
|
25
|
+
format: "hex",
|
|
26
|
+
rgb: n.length === 8 ? {
|
|
27
|
+
r: r >>> 24 & 255,
|
|
28
|
+
g: r >>> 16 & 255,
|
|
29
|
+
b: r >>> 8 & 255,
|
|
30
|
+
a: t((r & 255) / 255)
|
|
31
|
+
} : {
|
|
32
|
+
r: r >>> 16 & 255,
|
|
33
|
+
g: r >>> 8 & 255,
|
|
34
|
+
b: r & 255
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let l = o.exec(a);
|
|
39
|
+
if (l) {
|
|
40
|
+
let e = r(l[1] ?? "0", 255), t = r(l[2] ?? "0", 255), n = r(l[3] ?? "0", 255);
|
|
41
|
+
return [
|
|
42
|
+
e,
|
|
43
|
+
t,
|
|
44
|
+
n
|
|
45
|
+
].every(Number.isFinite) ? {
|
|
46
|
+
format: "rgb",
|
|
47
|
+
rgb: {
|
|
48
|
+
r: Math.round(e),
|
|
49
|
+
g: Math.round(t),
|
|
50
|
+
b: Math.round(n),
|
|
51
|
+
a: i(l[4])
|
|
52
|
+
}
|
|
53
|
+
} : null;
|
|
54
|
+
}
|
|
55
|
+
let u = s.exec(a);
|
|
56
|
+
if (u) {
|
|
57
|
+
let e = Number(u[1]), t = r(u[2] ?? "0", 100) / 100, n = r(u[3] ?? "0", 100) / 100;
|
|
58
|
+
return [
|
|
59
|
+
e,
|
|
60
|
+
t,
|
|
61
|
+
n
|
|
62
|
+
].every(Number.isFinite) ? {
|
|
63
|
+
format: "hsl",
|
|
64
|
+
rgb: {
|
|
65
|
+
..._({
|
|
66
|
+
h: (e % 360 + 360) % 360,
|
|
67
|
+
s: t,
|
|
68
|
+
l: n
|
|
69
|
+
}),
|
|
70
|
+
a: i(u[4])
|
|
71
|
+
}
|
|
72
|
+
} : null;
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
function l(t) {
|
|
77
|
+
return e(Math.round(t), 0, 255).toString(16).padStart(2, "0");
|
|
78
|
+
}
|
|
79
|
+
function u(e) {
|
|
80
|
+
let n = t(e).toFixed(3).replace(/0+$/, "").replace(/\.$/, "");
|
|
81
|
+
return n === "" ? "0" : n;
|
|
82
|
+
}
|
|
83
|
+
function d(e, t, n) {
|
|
84
|
+
let r = e.a ?? 1, i = n && r < 1;
|
|
85
|
+
if (t === "hex") {
|
|
86
|
+
let t = `#${l(e.r)}${l(e.g)}${l(e.b)}`;
|
|
87
|
+
return i ? `${t}${l(r * 255)}` : t;
|
|
88
|
+
}
|
|
89
|
+
if (t === "rgb") return i ? `rgba(${e.r}, ${e.g}, ${e.b}, ${u(r)})` : `rgb(${e.r}, ${e.g}, ${e.b})`;
|
|
90
|
+
let a = g(e), o = Math.round(a.h), s = Math.round(a.s * 100), c = Math.round(a.l * 100);
|
|
91
|
+
return i ? `hsla(${o}, ${s}%, ${c}%, ${u(r)})` : `hsl(${o}, ${s}%, ${c}%)`;
|
|
92
|
+
}
|
|
93
|
+
function f(e) {
|
|
94
|
+
return `rgba(${e.r}, ${e.g}, ${e.b}, ${u(e.a ?? 1)})`;
|
|
95
|
+
}
|
|
96
|
+
function p(e) {
|
|
97
|
+
return `#${l(e.r)}${l(e.g)}${l(e.b)}${l((e.a ?? 1) * 255)}`;
|
|
98
|
+
}
|
|
99
|
+
function m({ r: e, g: t, b: n }) {
|
|
100
|
+
let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = o - Math.min(r, i, a), c = 0;
|
|
101
|
+
return s !== 0 && (c = o === r ? ((i - a) / s % 6 + 6) % 6 : o === i ? (a - r) / s + 2 : (r - i) / s + 4, c *= 60), {
|
|
102
|
+
h: c,
|
|
103
|
+
s: o === 0 ? 0 : s / o,
|
|
104
|
+
v: o
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function h({ h: e, s: t, v: n }) {
|
|
108
|
+
let r = (e % 360 + 360) % 360 / 60, i = n * t, a = i * (1 - Math.abs(r % 2 - 1)), o = n - i, s;
|
|
109
|
+
return s = r < 1 ? [
|
|
110
|
+
i,
|
|
111
|
+
a,
|
|
112
|
+
0
|
|
113
|
+
] : r < 2 ? [
|
|
114
|
+
a,
|
|
115
|
+
i,
|
|
116
|
+
0
|
|
117
|
+
] : r < 3 ? [
|
|
118
|
+
0,
|
|
119
|
+
i,
|
|
120
|
+
a
|
|
121
|
+
] : r < 4 ? [
|
|
122
|
+
0,
|
|
123
|
+
a,
|
|
124
|
+
i
|
|
125
|
+
] : r < 5 ? [
|
|
126
|
+
a,
|
|
127
|
+
0,
|
|
128
|
+
i
|
|
129
|
+
] : [
|
|
130
|
+
i,
|
|
131
|
+
0,
|
|
132
|
+
a
|
|
133
|
+
], {
|
|
134
|
+
r: Math.round((s[0] + o) * 255),
|
|
135
|
+
g: Math.round((s[1] + o) * 255),
|
|
136
|
+
b: Math.round((s[2] + o) * 255)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function g({ r: e, g: t, b: n }) {
|
|
140
|
+
let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = (o + s) / 2, l = o - s, u = 0, d = 0;
|
|
141
|
+
return l !== 0 && (d = l / (1 - Math.abs(2 * c - 1)), u = o === r ? ((i - a) / l % 6 + 6) % 6 : o === i ? (a - r) / l + 2 : (r - i) / l + 4, u *= 60), {
|
|
142
|
+
h: u,
|
|
143
|
+
s: d,
|
|
144
|
+
l: c
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function _({ h: e, s: t, l: n }) {
|
|
148
|
+
let r = (e % 360 + 360) % 360 / 360;
|
|
149
|
+
if (t === 0) {
|
|
150
|
+
let e = Math.round(n * 255);
|
|
151
|
+
return {
|
|
152
|
+
r: e,
|
|
153
|
+
g: e,
|
|
154
|
+
b: e
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
let i = n < .5 ? n * (1 + t) : n + t - n * t, a = 2 * n - i, o = (e) => {
|
|
158
|
+
let t = e;
|
|
159
|
+
return t < 0 && (t += 1), t > 1 && --t, t < 1 / 6 ? a + (i - a) * 6 * t : t < 1 / 2 ? i : t < 2 / 3 ? a + (i - a) * (2 / 3 - t) * 6 : a;
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
r: Math.round(o(r + 1 / 3) * 255),
|
|
163
|
+
g: Math.round(o(r) * 255),
|
|
164
|
+
b: Math.round(o(r - 1 / 3) * 255)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
export { f as cssColor, d as formatColor, _ as hslToRgb, h as hsvToRgb, c as parseColor, p as rgbHexKey, g as rgbToHsl, m as rgbToHsv };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/lib/components/ColorPicker/color-picker-styles.ts
|
|
5
|
+
var e = "haze-color-picker-styles__panelVisuals", t = "haze-color-picker-styles__panelContent", n = "haze-color-picker-styles__svArea", r = "haze-color-picker-styles__svThumb", i = "haze-color-picker-styles__track", a = "haze-color-picker-styles__hueTrack", o = "haze-color-picker-styles__checkerboard", s = "haze-color-picker-styles__trackFill", c = "haze-color-picker-styles__trackThumb", l = "haze-color-picker-styles__valueInput", u = "haze-color-picker-styles__groupLabel", d = "haze-color-picker-styles__swatchRow", f = "haze-color-picker-styles__swatchBtn", p = "haze-color-picker-styles__swatchFill", m = "haze-color-picker-styles__swatchActive", h = "haze-color-picker-styles__trigger";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { o as checkerboard, u as groupLabel, a as hueTrack, t as panelContent, e as panelVisuals, n as svArea, r as svThumb, m as swatchActive, f as swatchBtn, p as swatchFill, d as swatchRow, i as track, s as trackFill, c as trackThumb, h as trigger, l as valueInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "./
|
|
3
|
-
import t from "./
|
|
4
|
-
export {
|
|
2
|
+
import e from "./ColorPicker.js";
|
|
3
|
+
import t from "./ColorPickerCore.js";
|
|
4
|
+
export { e as ColorPicker, t as ColorPickerCore };
|