haze-ui 1.29.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 +58 -0
- 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 +14 -10
- 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 +6 -5
- 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 +11 -8
- 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 +24 -2
- package/dist/components/LocaleProvider/de-de.js +24 -2
- package/dist/components/LocaleProvider/es-es.js +24 -2
- package/dist/components/LocaleProvider/fr-fr.js +24 -2
- package/dist/components/LocaleProvider/it-it.js +24 -2
- package/dist/components/LocaleProvider/ja-jp.js +24 -2
- package/dist/components/LocaleProvider/ko-kr.js +24 -2
- package/dist/components/LocaleProvider/locale.js +24 -2
- package/dist/components/LocaleProvider/pt-br.js +24 -2
- package/dist/components/LocaleProvider/ru-ru.js +24 -2
- package/dist/components/LocaleProvider/zh-cn.js +24 -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 +9 -7
- 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 +5 -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 +44 -34
- package/dist/components/Typography/Typography.js +3 -0
- 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/dialog.css +1 -1
- package/dist/css/drawer.css +1 -1
- package/dist/css/dropdown-menu.css +7 -2
- 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/radio.css +1 -1
- package/dist/css/rating.css +1 -1
- 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 +1 -1
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree.css +2 -1
- package/dist/css/upload.css +1 -1
- package/dist/css/virtual-list.css +1 -1
- package/dist/css-manifest.json +22 -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/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 +63 -48
- package/dist/index.js +249 -232
- package/dist/mcp-docs.json +1011 -82
- package/dist/registry.json +17 -17
- package/dist/tokens/index.js +7 -7
- package/dist/tokens/motion.js +9 -2
- package/dist/tokens/palette.js +244 -84
- 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 +13 -6
- package/dist/types/components/Chart/chart-elements.d.ts +27 -6
- 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/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/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/locale.d.ts +24 -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/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/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/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 +19 -11
- package/dist/types/tokens/index.d.ts +4 -2
- package/dist/types/tokens/motion.d.ts +16 -0
- package/dist/types/tokens/palette.d.ts +59 -2
- package/dist/types/utils/menuItems.d.ts +126 -0
- package/dist/types/utils/menuRadio.d.ts +21 -0
- 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/package.json +18 -9
package/dist/tokens/palette.js
CHANGED
|
@@ -56,6 +56,57 @@ var i = {
|
|
|
56
56
|
red: { 8: "#ef4444" }
|
|
57
57
|
}
|
|
58
58
|
}, c = {
|
|
59
|
+
violet: {
|
|
60
|
+
light: {
|
|
61
|
+
9: "#7c3aed",
|
|
62
|
+
10: "#6d28d9"
|
|
63
|
+
},
|
|
64
|
+
dark: {
|
|
65
|
+
8: "#9b76fa",
|
|
66
|
+
9: "#a78bfa"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
teal: {
|
|
70
|
+
light: {
|
|
71
|
+
9: "#0f766e",
|
|
72
|
+
10: "#134e4a"
|
|
73
|
+
},
|
|
74
|
+
dark: {
|
|
75
|
+
8: "#14b8a6",
|
|
76
|
+
9: "#2dd4bf"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
cyan: {
|
|
80
|
+
light: {
|
|
81
|
+
9: "#0e7490",
|
|
82
|
+
10: "#155e75"
|
|
83
|
+
},
|
|
84
|
+
dark: {
|
|
85
|
+
8: "#06b6d4",
|
|
86
|
+
9: "#22d3ee"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
orange: {
|
|
90
|
+
light: {
|
|
91
|
+
9: "#c2410c",
|
|
92
|
+
10: "#9a3412"
|
|
93
|
+
},
|
|
94
|
+
dark: {
|
|
95
|
+
8: "#f97316",
|
|
96
|
+
9: "#fb923c"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
rose: {
|
|
100
|
+
light: {
|
|
101
|
+
9: "#dd1645",
|
|
102
|
+
10: "#be123c"
|
|
103
|
+
},
|
|
104
|
+
dark: {
|
|
105
|
+
8: "#f43f5e",
|
|
106
|
+
9: "#fb7185"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, l = {
|
|
59
110
|
light: {
|
|
60
111
|
l1: .982,
|
|
61
112
|
l12: .16,
|
|
@@ -69,7 +120,7 @@ var i = {
|
|
|
69
120
|
c12: .012
|
|
70
121
|
}
|
|
71
122
|
};
|
|
72
|
-
function
|
|
123
|
+
function u(e, t) {
|
|
73
124
|
let n = e[0];
|
|
74
125
|
if (t <= n.x) return n.y;
|
|
75
126
|
for (let n = 1; n < e.length; n++) {
|
|
@@ -81,7 +132,7 @@ function l(e, t) {
|
|
|
81
132
|
}
|
|
82
133
|
return e[e.length - 1].y;
|
|
83
134
|
}
|
|
84
|
-
function
|
|
135
|
+
function d(e, t, r) {
|
|
85
136
|
return Object.entries(e).map(([e, i]) => {
|
|
86
137
|
let a = n(i), s = r && Number(e) === 9 ? a.l + o[t] : a.l;
|
|
87
138
|
return {
|
|
@@ -94,92 +145,95 @@ function u(e, t, r) {
|
|
|
94
145
|
};
|
|
95
146
|
}).sort((e, t) => e.step - t.step);
|
|
96
147
|
}
|
|
97
|
-
function
|
|
148
|
+
function f(n, r, i) {
|
|
98
149
|
let a = [];
|
|
99
150
|
for (let o = 1; o <= 12; o++) a.push(t(e({
|
|
100
|
-
l:
|
|
151
|
+
l: u(n, o),
|
|
101
152
|
c: r(o),
|
|
102
153
|
h: i(o)
|
|
103
154
|
})));
|
|
104
155
|
return a;
|
|
105
156
|
}
|
|
106
|
-
function
|
|
107
|
-
return d(
|
|
157
|
+
function p(e, t) {
|
|
158
|
+
return f(d(e, t, !0).map((e) => ({
|
|
108
159
|
x: e.step,
|
|
109
160
|
y: e.color.l
|
|
110
161
|
})), () => 0, () => 0);
|
|
111
162
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
163
|
+
function m(e, t) {
|
|
164
|
+
return h(d(e, t, !1), t);
|
|
165
|
+
}
|
|
166
|
+
function h(e, t) {
|
|
167
|
+
let n = l[t], r = [
|
|
114
168
|
{
|
|
115
169
|
x: 1,
|
|
116
|
-
y:
|
|
170
|
+
y: n.l1
|
|
117
171
|
},
|
|
118
|
-
...
|
|
172
|
+
...e.map((e) => ({
|
|
119
173
|
x: e.step,
|
|
120
174
|
y: e.color.l
|
|
121
175
|
})),
|
|
122
176
|
{
|
|
123
177
|
x: 12,
|
|
124
|
-
y:
|
|
178
|
+
y: n.l12
|
|
125
179
|
}
|
|
126
|
-
],
|
|
180
|
+
], i = [
|
|
127
181
|
{
|
|
128
182
|
x: 1,
|
|
129
|
-
y:
|
|
183
|
+
y: n.c1
|
|
130
184
|
},
|
|
131
|
-
...
|
|
185
|
+
...e.map((e) => ({
|
|
132
186
|
x: e.step,
|
|
133
187
|
y: e.color.c
|
|
134
188
|
})),
|
|
135
189
|
{
|
|
136
190
|
x: 12,
|
|
137
|
-
y:
|
|
191
|
+
y: n.c12
|
|
138
192
|
}
|
|
139
|
-
],
|
|
193
|
+
], a = [
|
|
140
194
|
{
|
|
141
195
|
x: 1,
|
|
142
|
-
y:
|
|
196
|
+
y: e[0].color.h
|
|
143
197
|
},
|
|
144
|
-
...
|
|
198
|
+
...e.map((e) => ({
|
|
145
199
|
x: e.step,
|
|
146
200
|
y: e.color.h
|
|
147
201
|
})),
|
|
148
202
|
{
|
|
149
203
|
x: 12,
|
|
150
|
-
y:
|
|
204
|
+
y: e[e.length - 1].color.h
|
|
151
205
|
}
|
|
152
206
|
];
|
|
153
|
-
return
|
|
207
|
+
return f(r, (e) => u(i, e), (e) => u(a, e));
|
|
154
208
|
}
|
|
155
|
-
var
|
|
209
|
+
var g = {
|
|
156
210
|
light: {
|
|
157
|
-
gray:
|
|
158
|
-
blue:
|
|
159
|
-
green:
|
|
160
|
-
amber:
|
|
161
|
-
red:
|
|
211
|
+
gray: p(s.light.gray, "light"),
|
|
212
|
+
blue: m(s.light.blue, "light"),
|
|
213
|
+
green: m(s.light.green, "light"),
|
|
214
|
+
amber: m(s.light.amber, "light"),
|
|
215
|
+
red: m(s.light.red, "light")
|
|
162
216
|
},
|
|
163
217
|
dark: {
|
|
164
|
-
gray:
|
|
165
|
-
blue:
|
|
166
|
-
green:
|
|
167
|
-
amber:
|
|
168
|
-
red:
|
|
218
|
+
gray: p(s.dark.gray, "dark"),
|
|
219
|
+
blue: m(s.dark.blue, "dark"),
|
|
220
|
+
green: m(s.dark.green, "dark"),
|
|
221
|
+
amber: m(s.dark.amber, "dark"),
|
|
222
|
+
red: m(s.dark.red, "dark")
|
|
169
223
|
}
|
|
170
224
|
};
|
|
171
|
-
function
|
|
225
|
+
function _(e, t, n, r) {
|
|
172
226
|
let i = e[t][n]?.[r - 1];
|
|
173
227
|
if (i === void 0) throw Error(`Missing primitive ${n}-${r} in ${t} mode`);
|
|
174
228
|
return i;
|
|
175
229
|
}
|
|
176
|
-
var
|
|
230
|
+
var v = {
|
|
177
231
|
primary: "blue",
|
|
178
232
|
success: "green",
|
|
179
233
|
warning: "amber",
|
|
180
234
|
danger: "red",
|
|
181
235
|
info: "blue"
|
|
182
|
-
},
|
|
236
|
+
}, y = {
|
|
183
237
|
light: {
|
|
184
238
|
primary: 9,
|
|
185
239
|
success: 9,
|
|
@@ -194,7 +248,7 @@ var g = {
|
|
|
194
248
|
danger: 8,
|
|
195
249
|
info: 8
|
|
196
250
|
}
|
|
197
|
-
},
|
|
251
|
+
}, b = {
|
|
198
252
|
bg: 1,
|
|
199
253
|
"bg-subtle": 2,
|
|
200
254
|
"bg-muted": 3,
|
|
@@ -202,18 +256,18 @@ var g = {
|
|
|
202
256
|
"text-secondary": 11,
|
|
203
257
|
"text-muted": 9,
|
|
204
258
|
border: 4
|
|
205
|
-
},
|
|
206
|
-
function
|
|
259
|
+
}, x = (e, t) => `var(--haze-${e}-${t})`, S = (e) => `calc(l ${e < 0 ? "-" : "+"} ${Math.abs(e)})`;
|
|
260
|
+
function C(e, t, n) {
|
|
207
261
|
let r = i[e];
|
|
208
262
|
switch (n) {
|
|
209
|
-
case "hover": return `oklch(from ${t} ${
|
|
210
|
-
case "active": return `oklch(from ${t} ${
|
|
263
|
+
case "hover": return `oklch(from ${t} ${S(r.hover)} c h)`;
|
|
264
|
+
case "active": return `oklch(from ${t} ${S(r.active)} c h)`;
|
|
211
265
|
case "subtle": return `oklch(from ${t} ${r.subtleL} calc(c * ${r.subtleC}) h)`;
|
|
212
|
-
case "border-hover": return `oklch(from ${t} ${
|
|
266
|
+
case "border-hover": return `oklch(from ${t} ${S(r.borderHover)} c h)`;
|
|
213
267
|
case "focus-ring": return `oklch(from ${t} l c h / ${a})`;
|
|
214
268
|
}
|
|
215
269
|
}
|
|
216
|
-
function
|
|
270
|
+
function w(t, n, r) {
|
|
217
271
|
let o = i[t];
|
|
218
272
|
switch (r) {
|
|
219
273
|
case "hover": return e({
|
|
@@ -244,59 +298,59 @@ function S(t, n, r) {
|
|
|
244
298
|
};
|
|
245
299
|
}
|
|
246
300
|
}
|
|
247
|
-
function
|
|
301
|
+
function T(e, t, n, i, a) {
|
|
248
302
|
return {
|
|
249
303
|
name: t,
|
|
250
304
|
label: n,
|
|
251
305
|
css: {
|
|
252
|
-
light:
|
|
253
|
-
dark:
|
|
306
|
+
light: x(i, a.light),
|
|
307
|
+
dark: x(i, a.dark)
|
|
254
308
|
},
|
|
255
309
|
resolved: {
|
|
256
|
-
light: r(
|
|
257
|
-
dark: r(
|
|
310
|
+
light: r(_(e.scales, "light", i, a.light)),
|
|
311
|
+
dark: r(_(e.scales, "dark", i, a.dark))
|
|
258
312
|
}
|
|
259
313
|
};
|
|
260
314
|
}
|
|
261
|
-
function
|
|
315
|
+
function E(e, t, n, r, i) {
|
|
262
316
|
let a = `var(${n})`;
|
|
263
317
|
return {
|
|
264
318
|
name: e,
|
|
265
319
|
label: t,
|
|
266
320
|
css: {
|
|
267
|
-
light:
|
|
268
|
-
dark:
|
|
321
|
+
light: C("light", a, i),
|
|
322
|
+
dark: C("dark", a, i)
|
|
269
323
|
},
|
|
270
324
|
resolved: {
|
|
271
|
-
light:
|
|
272
|
-
dark:
|
|
325
|
+
light: w("light", r.light, i),
|
|
326
|
+
dark: w("dark", r.dark, i)
|
|
273
327
|
}
|
|
274
328
|
};
|
|
275
329
|
}
|
|
276
|
-
function
|
|
277
|
-
let n =
|
|
278
|
-
light:
|
|
279
|
-
dark:
|
|
330
|
+
function D(e, t) {
|
|
331
|
+
let n = T(e, `--haze-color-${t}`, t[0].toUpperCase() + t.slice(1), e.statusFamily[t], {
|
|
332
|
+
light: y.light[t],
|
|
333
|
+
dark: y.dark[t]
|
|
280
334
|
});
|
|
281
335
|
return [
|
|
282
336
|
n,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
337
|
+
E(`${n.name}-hover`, `${n.label} Hover`, n.name, n.resolved, "hover"),
|
|
338
|
+
E(`${n.name}-active`, `${n.label} Active`, n.name, n.resolved, "active"),
|
|
339
|
+
E(`${n.name}-subtle`, `${n.label} Subtle`, n.name, n.resolved, "subtle")
|
|
286
340
|
];
|
|
287
341
|
}
|
|
288
|
-
function
|
|
289
|
-
return
|
|
290
|
-
light:
|
|
291
|
-
dark:
|
|
342
|
+
function O(e, t, n) {
|
|
343
|
+
return T(e, `--haze-color-${t}`, n, "gray", {
|
|
344
|
+
light: b[t],
|
|
345
|
+
dark: b[t]
|
|
292
346
|
});
|
|
293
347
|
}
|
|
294
|
-
var
|
|
348
|
+
var k = (e) => ({
|
|
295
349
|
name: "--haze-color-text-inverse",
|
|
296
350
|
label: "Text Inverse",
|
|
297
351
|
css: {
|
|
298
352
|
light: "oklch(1 0 0)",
|
|
299
|
-
dark:
|
|
353
|
+
dark: _(e.scales, "light", "gray", 12)
|
|
300
354
|
},
|
|
301
355
|
resolved: {
|
|
302
356
|
light: {
|
|
@@ -304,32 +358,138 @@ var D = (e) => ({
|
|
|
304
358
|
c: 0,
|
|
305
359
|
h: 0
|
|
306
360
|
},
|
|
307
|
-
dark: r(
|
|
361
|
+
dark: r(_(e.scales, "light", "gray", 12))
|
|
308
362
|
}
|
|
309
363
|
});
|
|
310
|
-
function
|
|
311
|
-
let t =
|
|
364
|
+
function A(e) {
|
|
365
|
+
let t = D(e, "primary"), n = t[0], r = O(e, "border", "Border");
|
|
312
366
|
return [
|
|
313
367
|
...t,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
368
|
+
O(e, "bg", "Background"),
|
|
369
|
+
O(e, "bg-subtle", "Background Subtle"),
|
|
370
|
+
O(e, "bg-muted", "Background Muted"),
|
|
371
|
+
O(e, "text", "Text"),
|
|
372
|
+
O(e, "text-secondary", "Text Secondary"),
|
|
373
|
+
O(e, "text-muted", "Text Muted"),
|
|
374
|
+
k(e),
|
|
321
375
|
r,
|
|
322
|
-
|
|
323
|
-
...
|
|
324
|
-
...
|
|
325
|
-
...
|
|
326
|
-
...
|
|
327
|
-
|
|
376
|
+
E("--haze-color-border-hover", "Border Hover", r.name, r.resolved, "border-hover"),
|
|
377
|
+
...D(e, "success"),
|
|
378
|
+
...D(e, "warning"),
|
|
379
|
+
...D(e, "danger"),
|
|
380
|
+
...D(e, "info"),
|
|
381
|
+
E("--haze-color-focus-ring", "Focus Ring", n.name, n.resolved, "focus-ring")
|
|
328
382
|
];
|
|
329
383
|
}
|
|
330
|
-
var
|
|
331
|
-
scales:
|
|
332
|
-
statusFamily:
|
|
384
|
+
var j = A({
|
|
385
|
+
scales: g,
|
|
386
|
+
statusFamily: v
|
|
387
|
+
}), M = [
|
|
388
|
+
"violet",
|
|
389
|
+
"teal",
|
|
390
|
+
"cyan",
|
|
391
|
+
"orange",
|
|
392
|
+
"rose"
|
|
393
|
+
];
|
|
394
|
+
function N(e) {
|
|
395
|
+
let t = (t) => Object.fromEntries([
|
|
396
|
+
["gray", g[t].gray],
|
|
397
|
+
[e, m(c[e][t], t)],
|
|
398
|
+
["green", g[t].green],
|
|
399
|
+
["amber", g[t].amber],
|
|
400
|
+
["red", g[t].red]
|
|
401
|
+
]);
|
|
402
|
+
return {
|
|
403
|
+
light: t("light"),
|
|
404
|
+
dark: t("dark")
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function P(e) {
|
|
408
|
+
let t = N(e), n = A({
|
|
409
|
+
scales: t,
|
|
410
|
+
statusFamily: {
|
|
411
|
+
...v,
|
|
412
|
+
primary: e,
|
|
413
|
+
info: e
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
return {
|
|
417
|
+
family: e,
|
|
418
|
+
primitives: t,
|
|
419
|
+
semanticTokens: n,
|
|
420
|
+
declarations: {
|
|
421
|
+
light: F("light", t, n),
|
|
422
|
+
dark: F("dark", t, n)
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
function F(e, t, n) {
|
|
427
|
+
return `${Object.entries(t[e]).flatMap(([e, t]) => t.map((t, n) => `--haze-${e}-${n + 1}: ${t};`)).join("\n")}\n\n${n.map((t) => `${t.name}: ${t.css[e]};`).join("\n")}`;
|
|
428
|
+
}
|
|
429
|
+
var I = /* @__PURE__ */ new Set([
|
|
430
|
+
"gray",
|
|
431
|
+
"green",
|
|
432
|
+
"amber",
|
|
433
|
+
"red"
|
|
434
|
+
]), L = /^[a-z][a-z0-9-]*$/, R = {
|
|
435
|
+
infoStep: -.07,
|
|
436
|
+
darkPrimary: .2
|
|
437
|
+
}, z = (e) => Math.min(1, Math.max(0, e)), B = (t, n) => e({
|
|
438
|
+
l: z(t.l + n),
|
|
439
|
+
c: t.c,
|
|
440
|
+
h: t.h
|
|
333
441
|
});
|
|
442
|
+
function V(e, t) {
|
|
443
|
+
let r = new Map(e.map((e) => [e.step, e.color]));
|
|
444
|
+
for (let [e, i] of Object.entries(t ?? {})) {
|
|
445
|
+
if (Number(e) < 1 || Number(e) > 12) throw Error(`Seed anchor step ${e} is outside the 1–12 scale`);
|
|
446
|
+
r.set(Number(e), n(i));
|
|
447
|
+
}
|
|
448
|
+
return [...r.entries()].map(([e, t]) => ({
|
|
449
|
+
step: e,
|
|
450
|
+
color: t
|
|
451
|
+
})).sort((e, t) => e.step - t.step);
|
|
452
|
+
}
|
|
453
|
+
function H({ name: e, light: t, dark: r, overrides: i }) {
|
|
454
|
+
if (!L.test(e)) throw Error(`Invalid brand name "${e}" — use a lowercase kebab identifier (letters, digits, hyphens)`);
|
|
455
|
+
if (I.has(e)) throw Error(`Brand name "${e}" collides with a fixed neutral family (gray/green/amber/red)`);
|
|
456
|
+
let a = n(t), o = r === void 0 ? B(a, R.darkPrimary) : n(r), s = {
|
|
457
|
+
light: V([{
|
|
458
|
+
step: 9,
|
|
459
|
+
color: a
|
|
460
|
+
}, {
|
|
461
|
+
step: 10,
|
|
462
|
+
color: B(a, R.infoStep)
|
|
463
|
+
}], i?.light),
|
|
464
|
+
dark: V([{
|
|
465
|
+
step: 9,
|
|
466
|
+
color: o
|
|
467
|
+
}, {
|
|
468
|
+
step: 8,
|
|
469
|
+
color: B(o, R.infoStep)
|
|
470
|
+
}], i?.dark)
|
|
471
|
+
}, c = (t) => Object.fromEntries([
|
|
472
|
+
["gray", g[t].gray],
|
|
473
|
+
[e, h(s[t], t)],
|
|
474
|
+
["green", g[t].green],
|
|
475
|
+
["amber", g[t].amber],
|
|
476
|
+
["red", g[t].red]
|
|
477
|
+
]), l = {
|
|
478
|
+
light: c("light"),
|
|
479
|
+
dark: c("dark")
|
|
480
|
+
}, u = A({
|
|
481
|
+
scales: l,
|
|
482
|
+
statusFamily: {
|
|
483
|
+
...v,
|
|
484
|
+
primary: e,
|
|
485
|
+
info: e
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
return {
|
|
489
|
+
name: e,
|
|
490
|
+
light: F("light", l, u),
|
|
491
|
+
dark: F("dark", l, u)
|
|
492
|
+
};
|
|
493
|
+
}
|
|
334
494
|
//#endregion
|
|
335
|
-
export {
|
|
495
|
+
export { M as BRAND_FAMILIES, c as BRAND_SEEDS, g as PRIMITIVES, j as SEMANTIC_COLOR_TOKENS, P as buildBrandTheme, H as createBrandTheme, F as themeDeclarations };
|
package/dist/tokens/registry.js
CHANGED
|
@@ -747,10 +747,25 @@ var n = [
|
|
|
747
747
|
slider: [
|
|
748
748
|
"--haze-color-bg",
|
|
749
749
|
"--haze-color-bg-muted",
|
|
750
|
-
"--haze-color-primary",
|
|
751
750
|
"--haze-color-focus-ring",
|
|
751
|
+
"--haze-color-primary",
|
|
752
|
+
"--haze-color-text",
|
|
753
|
+
"--haze-color-text-inverse",
|
|
754
|
+
"--haze-color-text-muted",
|
|
755
|
+
"--haze-color-text-secondary",
|
|
756
|
+
"--haze-duration-fast",
|
|
757
|
+
"--haze-ease",
|
|
758
|
+
"--haze-font-sans",
|
|
759
|
+
"--haze-leading-normal",
|
|
752
760
|
"--haze-radius-full",
|
|
753
|
-
"--haze-
|
|
761
|
+
"--haze-radius-md",
|
|
762
|
+
"--haze-shadow-sm",
|
|
763
|
+
"--haze-space-1",
|
|
764
|
+
"--haze-space-12",
|
|
765
|
+
"--haze-space-16",
|
|
766
|
+
"--haze-space-2",
|
|
767
|
+
"--haze-space-6",
|
|
768
|
+
"--haze-text-xs"
|
|
754
769
|
],
|
|
755
770
|
steptimeline: [
|
|
756
771
|
"--haze-color-bg",
|
|
@@ -842,26 +857,7 @@ var n = [
|
|
|
842
857
|
"--haze-text-sm",
|
|
843
858
|
"--haze-text-base"
|
|
844
859
|
],
|
|
845
|
-
toast:
|
|
846
|
-
"--haze-color-bg",
|
|
847
|
-
"--haze-color-border",
|
|
848
|
-
"--haze-color-text",
|
|
849
|
-
"--haze-color-success",
|
|
850
|
-
"--haze-color-success-subtle",
|
|
851
|
-
"--haze-color-warning",
|
|
852
|
-
"--haze-color-warning-subtle",
|
|
853
|
-
"--haze-color-danger",
|
|
854
|
-
"--haze-color-danger-subtle",
|
|
855
|
-
"--haze-font-sans",
|
|
856
|
-
"--haze-leading-normal",
|
|
857
|
-
"--haze-radius-md",
|
|
858
|
-
"--haze-shadow-lg",
|
|
859
|
-
"--haze-space-2",
|
|
860
|
-
"--haze-space-3",
|
|
861
|
-
"--haze-space-4",
|
|
862
|
-
"--haze-text-sm",
|
|
863
|
-
"--haze-text-lg"
|
|
864
|
-
],
|
|
860
|
+
toast: /* @__PURE__ */ "--haze-color-bg.--haze-color-border.--haze-color-danger.--haze-color-danger-subtle.--haze-color-focus-ring.--haze-color-primary.--haze-color-primary-active.--haze-color-primary-hover.--haze-color-success.--haze-color-success-subtle.--haze-color-text.--haze-color-text-secondary.--haze-color-warning.--haze-color-warning-subtle.--haze-font-sans.--haze-leading-normal.--haze-radius-md.--haze-shadow-lg.--haze-space-1.--haze-space-2.--haze-space-3.--haze-space-4.--haze-text-base.--haze-text-lg.--haze-text-sm.--haze-weight-medium".split("."),
|
|
865
861
|
tooltip: [
|
|
866
862
|
"--haze-color-text",
|
|
867
863
|
"--haze-color-text-inverse",
|
|
@@ -11,5 +11,5 @@ type ButtonProps = {
|
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
12
|
square?: boolean;
|
|
13
13
|
} & Omit<ComponentPropsWithoutRef<'button'>, 'type'>;
|
|
14
|
-
export default function Button({ variant, size, square, className, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
14
|
+
export default function Button({ variant, size: sizeProp, square, className, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
15
15
|
export type { ButtonProps };
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
/** Granularity Calendar picks at. Each mode serializes its `value` and
|
|
4
|
-
* `onSelect` payload to a plain string: `"YYYY-MM-DD"` (date),
|
|
5
|
-
* `"YYYY-
|
|
6
|
-
* (year). */
|
|
7
|
-
type CalendarPickerMode = 'date' | 'month' | 'quarter' | 'year';
|
|
4
|
+
* `onSelect` payload to a plain string: `"YYYY-MM-DD"` (date), an ISO
|
|
5
|
+
* 8601 week `"YYYY-Www"` (week), `"YYYY-MM"` (month), `"YYYY-Qn"` with
|
|
6
|
+
* n 1–4 (quarter) or `"YYYY"` (year). */
|
|
7
|
+
type CalendarPickerMode = 'date' | 'week' | 'month' | 'quarter' | 'year';
|
|
8
|
+
/**
|
|
9
|
+
* Extra render position appended inside picker cells (day numbers, month
|
|
10
|
+
* / quarter / year labels) — schedule dots, badges, custom chrome. Called
|
|
11
|
+
* with the cell's representative civil date (`day` 1 for the
|
|
12
|
+
* month/quarter/year cells) and the picker mode the cell renders in, so
|
|
13
|
+
* one callback can decorate a date grid and the header drill-down grids
|
|
14
|
+
* differently.
|
|
15
|
+
*/
|
|
16
|
+
type CalendarCellRender = (date: {
|
|
17
|
+
year: number;
|
|
18
|
+
month: number;
|
|
19
|
+
day: number;
|
|
20
|
+
}, mode: CalendarPickerMode) => ReactNode;
|
|
8
21
|
type CalendarProps = {
|
|
9
22
|
/**
|
|
10
23
|
* Granularity the calendar picks at. `"date"` (default) renders the
|
|
11
|
-
* day grid; `"
|
|
24
|
+
* day grid; `"week"` the same day grid with whole-ISO-week row
|
|
25
|
+
* selection (rows run Monday–Sunday, the week-number column is always
|
|
26
|
+
* shown and `weekStartsOn` is ignored — ISO weeks are Monday-first by
|
|
27
|
+
* definition); `"month"` a 3×4 month grid over one year; `"quarter"`
|
|
12
28
|
* a 4-quarter grid over one year; `"year"` a 12-year grid stepped a
|
|
13
29
|
* decade at a time. Values follow each mode's serialization (see
|
|
14
30
|
* {@link CalendarPickerMode}); `months`, `showWeekNumbers`,
|
|
@@ -18,8 +34,9 @@ type CalendarProps = {
|
|
|
18
34
|
picker?: CalendarPickerMode;
|
|
19
35
|
/**
|
|
20
36
|
* Selected value as a plain string whose format follows `picker`:
|
|
21
|
-
* "YYYY-MM-DD" (date, the default), "YYYY-
|
|
22
|
-
* (quarter) or "YYYY" (year). Empty
|
|
37
|
+
* "YYYY-MM-DD" (date, the default), an ISO week "YYYY-Www" (week),
|
|
38
|
+
* "YYYY-MM" (month), "YYYY-Qn" (quarter) or "YYYY" (year). Empty
|
|
39
|
+
* string means nothing selected.
|
|
23
40
|
*/
|
|
24
41
|
value?: ControlOrValue<string>;
|
|
25
42
|
/**
|
|
@@ -74,12 +91,20 @@ type CalendarProps = {
|
|
|
74
91
|
*/
|
|
75
92
|
rangeEnd?: string;
|
|
76
93
|
/**
|
|
77
|
-
* Called with the picked value — "YYYY-MM-DD" (date),
|
|
78
|
-
* (month), "YYYY-Qn" (quarter) or "YYYY"
|
|
79
|
-
* Still fires alongside the controllable
|
|
80
|
-
* prefer event-style wiring.
|
|
94
|
+
* Called with the picked value — "YYYY-MM-DD" (date), an ISO week
|
|
95
|
+
* "YYYY-Www" (week), "YYYY-MM" (month), "YYYY-Qn" (quarter) or "YYYY"
|
|
96
|
+
* (year), matching `picker`. Still fires alongside the controllable
|
|
97
|
+
* `value` for callers that prefer event-style wiring.
|
|
81
98
|
*/
|
|
82
99
|
onSelect?: (date: string) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Appends a custom render inside every picker cell — day numbers,
|
|
102
|
+
* month/quarter/year labels and the header drill-down grids alike
|
|
103
|
+
* (schedule dots, badges). Receives the cell's representative civil
|
|
104
|
+
* date (`day` 1 for month/quarter/year cells) and the mode the cell
|
|
105
|
+
* renders in. Opt-in: without it the cells render exactly as before.
|
|
106
|
+
*/
|
|
107
|
+
cellRender?: CalendarCellRender;
|
|
83
108
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'>;
|
|
84
|
-
export default function Calendar({ picker, value: valueControl, min, max, disabledDate, locale, weekStartsOn, showWeekNumbers, months, rangeStart, rangeEnd, onSelect, className, ...rest }: CalendarProps): import("react").JSX.Element;
|
|
85
|
-
export type { CalendarProps, CalendarPickerMode };
|
|
109
|
+
export default function Calendar({ picker, value: valueControl, min, max, disabledDate, locale, weekStartsOn, showWeekNumbers, months, rangeStart, rangeEnd, onSelect, cellRender, className, ...rest }: CalendarProps): import("react").JSX.Element;
|
|
110
|
+
export type { CalendarProps, CalendarPickerMode, CalendarCellRender };
|
|
@@ -59,6 +59,15 @@ export declare function getLeadingDays(year: number, month: number, weekStart: n
|
|
|
59
59
|
* added. The result length is always a multiple of 7.
|
|
60
60
|
*/
|
|
61
61
|
export declare function buildMonthCells(year: number, month: number, weekStart: number): CalendarCell[];
|
|
62
|
+
/** ISO 8601 week identity of a civil date: the week number together with
|
|
63
|
+
* the ISO week-numbering **year** it belongs to. Days at the calendar
|
|
64
|
+
* year's edges borrow the neighbor year's numbering, so `year` here is
|
|
65
|
+
* not necessarily the civil date's own year (2025-12-31 is week 1 of
|
|
66
|
+
* 2026; 2027-01-01 is week 53 of 2026). */
|
|
67
|
+
export type ISOWeek = {
|
|
68
|
+
year: number;
|
|
69
|
+
week: number;
|
|
70
|
+
};
|
|
62
71
|
/**
|
|
63
72
|
* ISO 8601 week number of a civil date. ISO weeks run Monday–Sunday and
|
|
64
73
|
* week 1 is the week containing the year's first Thursday, so days at the
|
|
@@ -71,6 +80,30 @@ export declare function buildMonthCells(year: number, month: number, weekStart:
|
|
|
71
80
|
* spans from that ISO year's January 1.
|
|
72
81
|
*/
|
|
73
82
|
export declare function getISOWeekNumber(year: number, month: number, day: number): number;
|
|
83
|
+
/**
|
|
84
|
+
* Full ISO 8601 week identity of a civil date (`{@link getISOWeekNumber}`
|
|
85
|
+
* plus the ISO week-numbering year the week belongs to). Same Thursday
|
|
86
|
+
* anchoring: the Thursday of a date's Monday–Sunday week carries the ISO
|
|
87
|
+
* year, which is what `"YYYY-Www"` values (see
|
|
88
|
+
* {@link formatWeekValue}) number weeks against.
|
|
89
|
+
*/
|
|
90
|
+
export declare function getISOWeek(year: number, month: number, day: number): ISOWeek;
|
|
91
|
+
/**
|
|
92
|
+
* Monday of an ISO week as a civil date — the anchor
|
|
93
|
+
* `picker="week"` derives its month view and row highlight from. January
|
|
94
|
+
* 4 always sits in week 1 (the first-Thursday rule), so Monday of week 1
|
|
95
|
+
* is `Jan 4 − (Jan 4's ISO weekday − 1)`; every later week adds whole
|
|
96
|
+
* seven-day spans. All arithmetic rides UTC milliseconds (whole days, no
|
|
97
|
+
* DST drift); the result is read back as a civil triple. Weeks beyond the
|
|
98
|
+
* year's last (52 or 53 per the ISO calendar) resolve into the neighbor
|
|
99
|
+
* year — callers validate with a `getISOWeek` round-trip (see
|
|
100
|
+
* {@link parseWeekValue}).
|
|
101
|
+
*/
|
|
102
|
+
export declare function getISOWeekStartDate(isoYear: number, week: number): {
|
|
103
|
+
year: number;
|
|
104
|
+
month: number;
|
|
105
|
+
day: number;
|
|
106
|
+
};
|
|
74
107
|
/**
|
|
75
108
|
* Format a civil date as the `"YYYY-MM-DD"` string Calendar uses as its
|
|
76
109
|
* value. Value semantics: the string denotes the **local** civil date — it
|
|
@@ -119,6 +152,24 @@ export declare function formatYearValue(year: number): string;
|
|
|
119
152
|
export declare function parseYearValue(value: string): {
|
|
120
153
|
year: number;
|
|
121
154
|
} | null;
|
|
155
|
+
/**
|
|
156
|
+
* Format an ISO week as the `"YYYY-Www"` string Calendar's
|
|
157
|
+
* `picker="week"` mode uses as its value (`isoYear` is the ISO
|
|
158
|
+
* week-numbering year — not necessarily the civil year of every day in
|
|
159
|
+
* the week — and `week` is 1-based, zero-padded: 2026 week 37 →
|
|
160
|
+
* `"2026-W37"`). Pure string math; no Date construction.
|
|
161
|
+
*/
|
|
162
|
+
export declare function formatWeekValue(isoYear: number, week: number): string;
|
|
163
|
+
/**
|
|
164
|
+
* Parse a `"YYYY-Www"` week-picker value (`{@link formatWeekValue}`'s
|
|
165
|
+
* inverse). Accepts weeks `01`…`53` shape-wise, then rejects the ones
|
|
166
|
+
* that do not exist in the given ISO year via a round-trip: 2025 is a
|
|
167
|
+
* 52-week year, so `"2025-W53"` resolves to a Monday that belongs to
|
|
168
|
+
* 2026 week 1 and is rejected. Anything with another shape
|
|
169
|
+
* (`"2026-W1"`, `"2026-w05"`, a date/month/quarter serialization) is
|
|
170
|
+
* rejected outright.
|
|
171
|
+
*/
|
|
172
|
+
export declare function parseWeekValue(value: string): ISOWeek | null;
|
|
122
173
|
/**
|
|
123
174
|
* Parse a `"YYYY-MM-DD"` value string into a local-midnight Date — the
|
|
124
175
|
* inverse of {@link formatDate} and the only safe way to turn a value into
|