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
|
@@ -3,24 +3,27 @@ import e from "./DatepickerCore.js";
|
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import { useControl as n } from "react-use-control";
|
|
5
5
|
//#region src/lib/components/Datepicker/Datepicker.tsx
|
|
6
|
-
function r({ value: r, open: i, picker: a, min: o, max: s, disabledDate: c, presets: l, showTime: u,
|
|
7
|
-
let [
|
|
6
|
+
function r({ value: r, open: i, picker: a, min: o, max: s, disabledDate: c, presets: l, showTime: u, format: d, parse: f, locale: p, weekStartsOn: m, cellRender: h, placeholder: g, className: _, ref: v }) {
|
|
7
|
+
let [y, b] = n(r, ""), [x, S] = n(i, !1);
|
|
8
8
|
return /* @__PURE__ */ t(e, {
|
|
9
|
-
ref:
|
|
10
|
-
value:
|
|
11
|
-
onChange:
|
|
12
|
-
open:
|
|
13
|
-
onOpenChange:
|
|
9
|
+
ref: v,
|
|
10
|
+
value: y,
|
|
11
|
+
onChange: b,
|
|
12
|
+
open: x,
|
|
13
|
+
onOpenChange: S,
|
|
14
14
|
picker: a,
|
|
15
15
|
min: o,
|
|
16
16
|
max: s,
|
|
17
17
|
disabledDate: c,
|
|
18
18
|
presets: l,
|
|
19
19
|
showTime: u,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
format: d,
|
|
21
|
+
parse: f,
|
|
22
|
+
locale: p,
|
|
23
|
+
weekStartsOn: m,
|
|
24
|
+
cellRender: h,
|
|
25
|
+
placeholder: g,
|
|
26
|
+
className: _
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
29
|
//#endregion
|
|
@@ -1,83 +1,98 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import { formatDate as e, formatWeekValue as t, getISOWeek as n, getISOWeekStartDate as r, parseCivilDate as ee, parseWeekValue as i } from "../Calendar/date.js";
|
|
4
|
+
import { classnames as a } from "../../utils/classnames.js";
|
|
5
|
+
import { mergeRefs as o } from "../../utils/refs.js";
|
|
6
|
+
import { useStrings as te } from "../LocaleProvider/useStrings.js";
|
|
7
|
+
import { FloatingPanel as ne, useFloating as re } from "../../utils/floating.js";
|
|
8
|
+
import s from "../Calendar/Calendar.js";
|
|
9
|
+
import { applyTimeToCivilDate as c, formatDateTimeValue as l, normalizeTime as ie, splitDateTimeValue as ae, timeOf as oe } from "./datetime.js";
|
|
9
10
|
/* empty css */
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { useCallback as u, useId as se, useRef as d, useState as f } from "react";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
13
|
//#region src/lib/components/Datepicker/DatepickerCore.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
var h = "haze-DatepickerCore__wrapper", g = "haze-DatepickerCore__input", ce = "haze-DatepickerCore__dropdown", le = "haze-DatepickerCore__presetList", _ = "haze-DatepickerCore__presetRow", v = "haze-DatepickerCore__timeRow", y = "haze-DatepickerCore__timeLabel", b = "haze-DatepickerCore__timeInput";
|
|
15
|
+
function x({ value: x, onChange: S, open: C, onOpenChange: w, picker: T, min: E, max: D, disabledDate: O, presets: k, showTime: A, format: j, parse: M, locale: N, weekStartsOn: P, cellRender: F, placeholder: I = "Select date", className: L, ref: R }) {
|
|
16
|
+
let z = te("datepicker"), B = d(null), ue = u((e) => o(B, R)(e), [B, R]), V = d(null), H = se(), U = (A === !0 || typeof A == "object") && (T ?? "date") === "date", W = U && typeof A == "object" && A.seconds === !0, G = j !== void 0 || M !== void 0, K = M && x !== "" ? M(x) : null, [de, fe] = f(() => W ? "00:00:00" : "00:00"), q = U && !G ? ae(x) : null, J = K && T === "week" ? n(K.getFullYear(), K.getMonth(), K.getDate()) : null, Y = G ? J ? t(J.year, J.week) : K ? e(K.getFullYear(), K.getMonth(), K.getDate()) : "" : U ? q?.date ?? "" : x, X = G ? U && K ? oe(K, W) : null : q?.time ?? null, Z = X === null ? de : ie(X, W), Q = (e, t) => {
|
|
17
|
+
if (G && j) {
|
|
18
|
+
let n = T === "week" ? i(e) : null, a = n ? r(n.year, n.week) : null, o = a && new Date(a.year, a.month, a.day) || ee(e);
|
|
19
|
+
return o ? j(t === void 0 ? o : c(o, t)) : t === void 0 ? e : `${e} ${t}`;
|
|
20
|
+
}
|
|
21
|
+
return t === void 0 ? e : l(e, t);
|
|
22
|
+
}, pe = u((e) => w(typeof e == "function" ? e(C) : e), [w, C]), $ = re({
|
|
23
|
+
open: C,
|
|
24
|
+
setOpen: pe,
|
|
25
|
+
triggerRef: B,
|
|
26
|
+
panelRef: V,
|
|
20
27
|
animated: !0
|
|
21
28
|
});
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
className:
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
-
ref:
|
|
29
|
+
return /* @__PURE__ */ m("div", {
|
|
30
|
+
className: a([h, L]),
|
|
31
|
+
children: [/* @__PURE__ */ p("input", {
|
|
32
|
+
ref: ue,
|
|
33
|
+
"data-slot": "input",
|
|
26
34
|
readOnly: !0,
|
|
27
|
-
style:
|
|
28
|
-
className:
|
|
29
|
-
value:
|
|
30
|
-
placeholder:
|
|
35
|
+
style: $.triggerStyle,
|
|
36
|
+
className: g,
|
|
37
|
+
value: x,
|
|
38
|
+
placeholder: I,
|
|
31
39
|
role: "combobox",
|
|
32
40
|
"aria-haspopup": "dialog",
|
|
33
|
-
"aria-expanded":
|
|
34
|
-
"aria-controls":
|
|
35
|
-
onPointerDown:
|
|
36
|
-
onClick:
|
|
37
|
-
}), /* @__PURE__ */
|
|
38
|
-
ref:
|
|
39
|
-
behavior:
|
|
41
|
+
"aria-expanded": C,
|
|
42
|
+
"aria-controls": H,
|
|
43
|
+
onPointerDown: $.onTriggerPointerDown,
|
|
44
|
+
onClick: $.onTriggerClick
|
|
45
|
+
}), /* @__PURE__ */ m(ne, {
|
|
46
|
+
ref: V,
|
|
47
|
+
behavior: $,
|
|
40
48
|
placement: "bottom",
|
|
41
|
-
visualClass:
|
|
42
|
-
id:
|
|
49
|
+
visualClass: ce,
|
|
50
|
+
id: H,
|
|
43
51
|
children: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
k && k.length > 0 && /* @__PURE__ */ p("div", {
|
|
53
|
+
"data-slot": "presets",
|
|
54
|
+
className: a([le]),
|
|
55
|
+
children: k.map((e) => /* @__PURE__ */ p("button", {
|
|
56
|
+
"data-slot": "preset",
|
|
47
57
|
type: "button",
|
|
48
58
|
onClick: () => {
|
|
49
|
-
|
|
59
|
+
S(e.value), w(!1);
|
|
50
60
|
},
|
|
51
|
-
className:
|
|
52
|
-
children:
|
|
53
|
-
}, `${
|
|
61
|
+
className: a([_]),
|
|
62
|
+
children: e.label
|
|
63
|
+
}, `${e.label}:${e.value}`))
|
|
54
64
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
picker:
|
|
57
|
-
value:
|
|
58
|
-
min:
|
|
59
|
-
max:
|
|
60
|
-
disabledDate:
|
|
61
|
-
locale:
|
|
62
|
-
weekStartsOn:
|
|
65
|
+
/* @__PURE__ */ p(s, {
|
|
66
|
+
picker: T,
|
|
67
|
+
value: Y,
|
|
68
|
+
min: E,
|
|
69
|
+
max: D,
|
|
70
|
+
disabledDate: O,
|
|
71
|
+
locale: N,
|
|
72
|
+
weekStartsOn: P,
|
|
73
|
+
cellRender: F,
|
|
63
74
|
onSelect: (e) => {
|
|
64
|
-
|
|
75
|
+
U ? S(Q(e, Z)) : (S(Q(e)), w(!1));
|
|
65
76
|
}
|
|
66
77
|
}),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
U && /* @__PURE__ */ m("div", {
|
|
79
|
+
"data-slot": "footer",
|
|
80
|
+
className: a([v]),
|
|
81
|
+
children: [/* @__PURE__ */ p("span", {
|
|
82
|
+
"data-slot": "label",
|
|
83
|
+
className: a([y]),
|
|
84
|
+
children: z.time
|
|
85
|
+
}), /* @__PURE__ */ p("input", {
|
|
86
|
+
"data-slot": "time-input",
|
|
73
87
|
type: "time",
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
step: W ? 1 : void 0,
|
|
89
|
+
"aria-label": z.time,
|
|
90
|
+
value: Z,
|
|
76
91
|
onChange: (e) => {
|
|
77
|
-
let t = e.target.value || "00:00";
|
|
78
|
-
|
|
92
|
+
let t = e.target.value || (W ? "00:00:00" : "00:00");
|
|
93
|
+
fe(t), Y && S(Q(Y, t));
|
|
79
94
|
},
|
|
80
|
-
className:
|
|
95
|
+
className: a([b])
|
|
81
96
|
})]
|
|
82
97
|
})
|
|
83
98
|
]
|
|
@@ -85,4 +100,4 @@ function S({ value: S, onChange: C, open: w, onOpenChange: T, picker: E, min: D,
|
|
|
85
100
|
});
|
|
86
101
|
}
|
|
87
102
|
//#endregion
|
|
88
|
-
export {
|
|
103
|
+
export { x as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { parseCivilDate as e } from "../Calendar/date.js";
|
|
3
3
|
//#region src/lib/components/Datepicker/datetime.ts
|
|
4
|
-
var t = /^(\d{4}-\d{2}-\d{2}) (2[0-3]|[01]\d):([0-5]\d)
|
|
4
|
+
var t = /^(\d{4}-\d{2}-\d{2}) (2[0-3]|[01]\d):([0-5]\d)(?::([0-5]\d))?$/;
|
|
5
5
|
function n(n) {
|
|
6
6
|
let r = t.exec(n);
|
|
7
7
|
if (r) {
|
|
8
8
|
let t = r[1];
|
|
9
9
|
return e(t) ? {
|
|
10
10
|
date: t,
|
|
11
|
-
time: `${r[2]}:${r[3]}`
|
|
11
|
+
time: r[4] === void 0 ? `${r[2]}:${r[3]}` : `${r[2]}:${r[3]}:${r[4]}`
|
|
12
12
|
} : null;
|
|
13
13
|
}
|
|
14
14
|
return e(n) ? {
|
|
@@ -19,5 +19,16 @@ function n(n) {
|
|
|
19
19
|
function r(e, t) {
|
|
20
20
|
return `${e} ${t}`;
|
|
21
21
|
}
|
|
22
|
+
function i(e, t) {
|
|
23
|
+
return t ? e.length === 5 ? `${e}:00` : e : e.slice(0, 5);
|
|
24
|
+
}
|
|
25
|
+
function a(e, t) {
|
|
26
|
+
let n = (e) => String(e).padStart(2, "0"), r = `${n(e.getHours())}:${n(e.getMinutes())}`;
|
|
27
|
+
return t ? `${r}:${n(e.getSeconds())}` : r;
|
|
28
|
+
}
|
|
29
|
+
function o(e, t) {
|
|
30
|
+
let [n = "0", r = "0", i = "0"] = t.split(":");
|
|
31
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), Number(n), Number(r), Number(i));
|
|
32
|
+
}
|
|
22
33
|
//#endregion
|
|
23
|
-
export { r as formatDateTimeValue, n as splitDateTimeValue };
|
|
34
|
+
export { o as applyTimeToCivilDate, r as formatDateTimeValue, i as normalizeTime, n as splitDateTimeValue, a as timeOf };
|
|
@@ -8,20 +8,25 @@ var r = "haze-Descriptions__root", i = "haze-Descriptions__titleStyle", a = "haz
|
|
|
8
8
|
function m({ items: m, columns: h = 3, bordered: g = !1, size: _ = "md", title: v, className: y, style: b, ...x }) {
|
|
9
9
|
let S = Math.max(1, Math.floor(h)), C = _ === "sm" ? f : p;
|
|
10
10
|
return /* @__PURE__ */ n("div", {
|
|
11
|
+
"data-slot": "descriptions",
|
|
11
12
|
style: b,
|
|
12
13
|
...x,
|
|
13
14
|
className: e([r, y]),
|
|
14
15
|
children: [v && /* @__PURE__ */ t("div", {
|
|
16
|
+
"data-slot": "title",
|
|
15
17
|
className: e([i]),
|
|
16
18
|
children: v
|
|
17
19
|
}), /* @__PURE__ */ t("dl", {
|
|
20
|
+
"data-slot": "list",
|
|
18
21
|
style: { gridTemplateColumns: `repeat(${S}, auto minmax(0, 1fr))` },
|
|
19
22
|
className: e([g ? o : a]),
|
|
20
23
|
children: m.map(({ key: r, label: i, children: a, span: o = 1 }) => {
|
|
21
24
|
let f = Math.min(Math.max(o, 1), S);
|
|
22
25
|
return /* @__PURE__ */ n("div", {
|
|
26
|
+
"data-slot": "group",
|
|
23
27
|
className: e([s]),
|
|
24
28
|
children: [/* @__PURE__ */ t("dt", {
|
|
29
|
+
"data-slot": "label",
|
|
25
30
|
className: e([
|
|
26
31
|
c,
|
|
27
32
|
C,
|
|
@@ -29,6 +34,7 @@ function m({ items: m, columns: h = 3, bordered: g = !1, size: _ = "md", title:
|
|
|
29
34
|
]),
|
|
30
35
|
children: i
|
|
31
36
|
}), /* @__PURE__ */ t("dd", {
|
|
37
|
+
"data-slot": "content",
|
|
32
38
|
style: { gridColumn: `span ${f * 2 - 1}` },
|
|
33
39
|
className: e([
|
|
34
40
|
l,
|
|
@@ -5,23 +5,23 @@ import { whenExitSettles as t } from "../../utils/presence.js";
|
|
|
5
5
|
import { useFocusScope as n } from "../../utils/focus-scope.js";
|
|
6
6
|
import { useViewTransitionFlip as r } from "../../utils/view-transition.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useCallback as i, useEffect as a, useId as o, useImperativeHandle as s, useRef as c } from "react";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
import { useControl as d } from "react-use-control";
|
|
11
11
|
//#region src/lib/components/Dialog/Dialog.tsx
|
|
12
12
|
var f = "haze-Dialog__overlay", p = "haze-Dialog__titleText";
|
|
13
13
|
function m({ open: m, onClose: h, title: g, viewTransition: _ = !1, classNames: v, className: y, children: b, ref: x }) {
|
|
14
|
-
let [S, C] = d(m, !1), w = r(_, C), T =
|
|
15
|
-
|
|
14
|
+
let [S, C] = d(m, !1), w = r(_, C), T = c(null);
|
|
15
|
+
a(() => {
|
|
16
16
|
if (!S) return;
|
|
17
17
|
let e = document.activeElement;
|
|
18
18
|
T.current = e instanceof HTMLElement ? e : null;
|
|
19
19
|
}, [S]);
|
|
20
|
-
let E =
|
|
20
|
+
let E = c(null), D = n({
|
|
21
21
|
enabled: S,
|
|
22
22
|
trapped: !1
|
|
23
|
-
}), O = `haze-dialog-title-${
|
|
24
|
-
|
|
23
|
+
}), O = `haze-dialog-title-${o()}`;
|
|
24
|
+
s(x, () => ({
|
|
25
25
|
open: () => {
|
|
26
26
|
w(!0);
|
|
27
27
|
},
|
|
@@ -33,10 +33,10 @@ function m({ open: m, onClose: h, title: g, viewTransition: _ = !1, classNames:
|
|
|
33
33
|
e?.isConnected && e.focus();
|
|
34
34
|
}
|
|
35
35
|
}), [w]);
|
|
36
|
-
let k =
|
|
36
|
+
let k = i((e) => {
|
|
37
37
|
E.current = e, D(e);
|
|
38
38
|
}, [D]);
|
|
39
|
-
return
|
|
39
|
+
return a(() => {
|
|
40
40
|
let e = E.current;
|
|
41
41
|
if (e) {
|
|
42
42
|
if (S && !e.open) e.showModal();
|
|
@@ -47,8 +47,9 @@ function m({ open: m, onClose: h, title: g, viewTransition: _ = !1, classNames:
|
|
|
47
47
|
n ? n.then(r) : r();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
}, [S]), /* @__PURE__ */
|
|
50
|
+
}, [S]), /* @__PURE__ */ u("dialog", {
|
|
51
51
|
ref: k,
|
|
52
|
+
"data-slot": "content",
|
|
52
53
|
"data-state": S ? "open" : "closed",
|
|
53
54
|
"aria-labelledby": g === void 0 ? void 0 : O,
|
|
54
55
|
onClose: () => {
|
|
@@ -65,8 +66,9 @@ function m({ open: m, onClose: h, title: g, viewTransition: _ = !1, classNames:
|
|
|
65
66
|
y,
|
|
66
67
|
v?.root
|
|
67
68
|
]),
|
|
68
|
-
children: [g !== void 0 && /* @__PURE__ */
|
|
69
|
+
children: [g !== void 0 && /* @__PURE__ */ l("h2", {
|
|
69
70
|
id: O,
|
|
71
|
+
"data-slot": "title",
|
|
70
72
|
className: e([p, v?.header]),
|
|
71
73
|
children: g
|
|
72
74
|
}), b]
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useMemo as n } from "react";
|
|
7
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
8
8
|
//#region src/lib/components/DiffViewer/DiffViewer.tsx
|
|
9
9
|
var a = "haze-DiffViewer__wrapper", o = "haze-DiffViewer__header", s = "haze-DiffViewer__body", c = "haze-DiffViewer__line", l = "haze-DiffViewer__lineNum", u = "haze-DiffViewer__lineContent", d = "haze-DiffViewer__added", f = "haze-DiffViewer__removed", p = "haze-DiffViewer__addedPrefix", m = "haze-DiffViewer__removedPrefix";
|
|
10
10
|
function h(e, t) {
|
|
@@ -37,37 +37,46 @@ function h(e, t) {
|
|
|
37
37
|
return i;
|
|
38
38
|
}
|
|
39
39
|
function g({ oldValue: c, newValue: g, className: v }) {
|
|
40
|
-
let y = t("diffViewer"), b =
|
|
41
|
-
return /* @__PURE__ */
|
|
40
|
+
let y = t("diffViewer"), b = n(() => h(c, g), [c, g]);
|
|
41
|
+
return /* @__PURE__ */ i("div", {
|
|
42
|
+
"data-slot": "diff-viewer",
|
|
42
43
|
className: e([a, v]),
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ r("div", {
|
|
45
|
+
"data-slot": "header",
|
|
44
46
|
className: e([o]),
|
|
45
47
|
children: y.header
|
|
46
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ r("div", {
|
|
49
|
+
"data-slot": "body",
|
|
47
50
|
className: e([s]),
|
|
48
|
-
children: b.map((t,
|
|
51
|
+
children: b.map((t, n) => /* @__PURE__ */ i("div", {
|
|
52
|
+
"data-slot": "line",
|
|
49
53
|
className: e([
|
|
50
54
|
_,
|
|
51
55
|
t.type === "added" && d,
|
|
52
56
|
t.type === "removed" && f
|
|
53
57
|
]),
|
|
54
58
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ r("span", {
|
|
60
|
+
"data-slot": "gutter",
|
|
56
61
|
className: e([l]),
|
|
57
62
|
children: t.oldLine ?? ""
|
|
58
63
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ r("span", {
|
|
65
|
+
"data-slot": "gutter",
|
|
60
66
|
className: e([l]),
|
|
61
67
|
children: t.newLine ?? ""
|
|
62
68
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ i("span", {
|
|
70
|
+
"data-slot": "content",
|
|
64
71
|
className: e([u]),
|
|
65
72
|
children: [
|
|
66
|
-
t.type === "added" && /* @__PURE__ */
|
|
73
|
+
t.type === "added" && /* @__PURE__ */ r("span", {
|
|
74
|
+
"data-slot": "sign",
|
|
67
75
|
className: e([p]),
|
|
68
76
|
children: "+ "
|
|
69
77
|
}),
|
|
70
|
-
t.type === "removed" && /* @__PURE__ */
|
|
78
|
+
t.type === "removed" && /* @__PURE__ */ r("span", {
|
|
79
|
+
"data-slot": "sign",
|
|
71
80
|
className: e([m]),
|
|
72
81
|
children: "- "
|
|
73
82
|
}),
|
|
@@ -75,7 +84,7 @@ function g({ oldValue: c, newValue: g, className: v }) {
|
|
|
75
84
|
]
|
|
76
85
|
})
|
|
77
86
|
]
|
|
78
|
-
},
|
|
87
|
+
}, n))
|
|
79
88
|
})]
|
|
80
89
|
});
|
|
81
90
|
}
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useEffect as t, useRef as n } from "react";
|
|
6
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
7
7
|
import { useControl as a } from "react-use-control";
|
|
8
8
|
//#region src/lib/components/Disclosure/Disclosure.tsx
|
|
9
9
|
var o = "haze-Disclosure__details", s = "haze-Disclosure__summaryStyle", c = "haze-Disclosure__content";
|
|
10
10
|
function l({ open: l, summary: u, className: d, children: f }) {
|
|
11
|
-
let [p] = a(l, !1), m =
|
|
12
|
-
return
|
|
11
|
+
let [p] = a(l, !1), m = n(null);
|
|
12
|
+
return t(() => {
|
|
13
13
|
m.current && (m.current.open = p);
|
|
14
|
-
}, [p]), /* @__PURE__ */
|
|
14
|
+
}, [p]), /* @__PURE__ */ i("details", {
|
|
15
15
|
ref: m,
|
|
16
|
+
"data-slot": "disclosure",
|
|
16
17
|
className: e([o, d]),
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ r("summary", {
|
|
19
|
+
"data-slot": "trigger",
|
|
18
20
|
className: s,
|
|
19
21
|
children: u
|
|
20
|
-
}), /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ r("div", {
|
|
23
|
+
"data-slot": "content",
|
|
21
24
|
className: c,
|
|
22
25
|
children: f
|
|
23
26
|
})]
|
|
@@ -6,6 +6,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
6
6
|
var n = "haze-Divider__base", r = "haze-Divider__horizontal", i = "haze-Divider__vertical";
|
|
7
7
|
function a({ orientation: a = "horizontal", className: o }) {
|
|
8
8
|
return a === "vertical" ? /* @__PURE__ */ t("div", {
|
|
9
|
+
"data-slot": "divider",
|
|
9
10
|
role: "separator",
|
|
10
11
|
"aria-orientation": "vertical",
|
|
11
12
|
className: e([
|
|
@@ -14,6 +15,7 @@ function a({ orientation: a = "horizontal", className: o }) {
|
|
|
14
15
|
o
|
|
15
16
|
])
|
|
16
17
|
}) : /* @__PURE__ */ t("hr", {
|
|
18
|
+
"data-slot": "divider",
|
|
17
19
|
role: "separator",
|
|
18
20
|
className: e([
|
|
19
21
|
n,
|
|
@@ -5,8 +5,8 @@ import { whenExitSettles as t } from "../../utils/presence.js";
|
|
|
5
5
|
import { useFocusScope as n } from "../../utils/focus-scope.js";
|
|
6
6
|
import { useViewTransitionFlip as r } from "../../utils/view-transition.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useCallback as i, useEffect as a, useImperativeHandle as o, useRef as s } from "react";
|
|
9
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
10
10
|
import { useControl as l } from "react-use-control";
|
|
11
11
|
//#region src/lib/components/Drawer/Drawer.tsx
|
|
12
12
|
var u = "haze-Drawer__overlay", d = {
|
|
@@ -16,17 +16,17 @@ var u = "haze-Drawer__overlay", d = {
|
|
|
16
16
|
bottom: "haze-Drawer__bottom"
|
|
17
17
|
};
|
|
18
18
|
function f({ open: f, placement: p = "right", onClose: m, viewTransition: h = !1, className: g, children: _, ref: v }) {
|
|
19
|
-
let [y, b] = l(f, !1), x = r(h, b), S =
|
|
20
|
-
|
|
19
|
+
let [y, b] = l(f, !1), x = r(h, b), S = s(null);
|
|
20
|
+
a(() => {
|
|
21
21
|
if (!y) return;
|
|
22
22
|
let e = document.activeElement;
|
|
23
23
|
S.current = e instanceof HTMLElement ? e : null;
|
|
24
24
|
}, [y]);
|
|
25
|
-
let C =
|
|
25
|
+
let C = s(null), w = n({
|
|
26
26
|
enabled: y,
|
|
27
27
|
trapped: !1
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
o(v, () => ({
|
|
30
30
|
open: () => {
|
|
31
31
|
x(!0);
|
|
32
32
|
},
|
|
@@ -38,10 +38,10 @@ function f({ open: f, placement: p = "right", onClose: m, viewTransition: h = !1
|
|
|
38
38
|
e?.isConnected && e.focus();
|
|
39
39
|
}
|
|
40
40
|
}), [x]);
|
|
41
|
-
let T =
|
|
41
|
+
let T = i((e) => {
|
|
42
42
|
C.current = e, w(e);
|
|
43
43
|
}, [w]);
|
|
44
|
-
return
|
|
44
|
+
return a(() => {
|
|
45
45
|
let e = C.current;
|
|
46
46
|
if (e) {
|
|
47
47
|
if (y && !e.open) e.showModal();
|
|
@@ -52,8 +52,9 @@ function f({ open: f, placement: p = "right", onClose: m, viewTransition: h = !1
|
|
|
52
52
|
n ? n.then(r) : r();
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
}, [y]), /* @__PURE__ */
|
|
55
|
+
}, [y]), /* @__PURE__ */ c("dialog", {
|
|
56
56
|
ref: T,
|
|
57
|
+
"data-slot": "content",
|
|
57
58
|
"data-state": y ? "open" : "closed",
|
|
58
59
|
onClose: () => {
|
|
59
60
|
b(!1), m?.();
|
|
@@ -2,56 +2,79 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
4
|
import { useFloating as t } from "../../utils/floating.js";
|
|
5
|
-
import {
|
|
5
|
+
import { renderMenuDataItems as n } from "../../utils/menuItems.js";
|
|
6
|
+
import r from "./DropdownMenuCheckboxItem.js";
|
|
7
|
+
import { DropdownMenuProvider as i } from "./DropdownMenuContext.js";
|
|
8
|
+
import a from "./DropdownMenuContent.js";
|
|
9
|
+
import o from "./DropdownMenuGroup.js";
|
|
10
|
+
import s from "./DropdownMenuItem.js";
|
|
11
|
+
import c from "./DropdownMenuRadioGroup.js";
|
|
12
|
+
import l from "./DropdownMenuRadioItem.js";
|
|
13
|
+
import u from "./DropdownMenuSeparator.js";
|
|
14
|
+
import d from "./DropdownMenuSub.js";
|
|
15
|
+
import f from "./DropdownMenuSubContent.js";
|
|
16
|
+
import p from "./DropdownMenuSubTrigger.js";
|
|
17
|
+
import m from "./DropdownMenuTrigger.js";
|
|
6
18
|
/* empty css */
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useControl as
|
|
19
|
+
import { useCallback as h, useId as g, useImperativeHandle as _, useMemo as v, useRef as y } from "react";
|
|
20
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
21
|
+
import { useControl as C } from "react-use-control";
|
|
10
22
|
//#region src/lib/components/DropdownMenu/DropdownMenu.tsx
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
var w = "haze-DropdownMenu__wrapper", T = {
|
|
24
|
+
Item: s,
|
|
25
|
+
CheckboxItem: r,
|
|
26
|
+
RadioGroup: c,
|
|
27
|
+
RadioItem: l,
|
|
28
|
+
Group: o,
|
|
29
|
+
Divider: u,
|
|
30
|
+
Sub: d,
|
|
31
|
+
SubTrigger: p,
|
|
32
|
+
SubContent: f
|
|
33
|
+
};
|
|
34
|
+
function E({ open: r, onOpenChange: o, collisionPadding: s, items: c, children: l, className: u, ref: d }) {
|
|
35
|
+
let [f, p] = C(r, !1), E = y(null), D = y(null), O = g(), k = y(null), A = h((e) => {
|
|
36
|
+
let t = typeof e == "function" ? e(f) : e;
|
|
37
|
+
p(t), o?.(t);
|
|
16
38
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
f,
|
|
40
|
+
p,
|
|
41
|
+
o
|
|
20
42
|
]);
|
|
21
|
-
|
|
43
|
+
_(d, () => ({
|
|
22
44
|
open: () => {
|
|
23
|
-
|
|
45
|
+
A(!0);
|
|
24
46
|
},
|
|
25
47
|
close: () => {
|
|
26
|
-
|
|
48
|
+
A(!1);
|
|
27
49
|
},
|
|
28
50
|
focusTrigger: () => {
|
|
29
|
-
|
|
51
|
+
E.current?.focus();
|
|
30
52
|
}
|
|
31
|
-
}), [
|
|
32
|
-
let
|
|
33
|
-
open:
|
|
34
|
-
setOpen:
|
|
35
|
-
triggerRef:
|
|
36
|
-
panelRef:
|
|
53
|
+
}), [A]);
|
|
54
|
+
let j = v(() => s === void 0 ? void 0 : { collisionPadding: s }, [s]), M = t({
|
|
55
|
+
open: f,
|
|
56
|
+
setOpen: A,
|
|
57
|
+
triggerRef: E,
|
|
58
|
+
panelRef: D,
|
|
37
59
|
animated: !0,
|
|
38
|
-
collision:
|
|
60
|
+
collision: j
|
|
39
61
|
});
|
|
40
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ x(i, {
|
|
41
63
|
value: {
|
|
42
|
-
open:
|
|
43
|
-
setOpen:
|
|
44
|
-
triggerRef:
|
|
45
|
-
contentRef:
|
|
46
|
-
contentId:
|
|
47
|
-
focusRequestRef:
|
|
48
|
-
floating:
|
|
64
|
+
open: f,
|
|
65
|
+
setOpen: A,
|
|
66
|
+
triggerRef: E,
|
|
67
|
+
contentRef: D,
|
|
68
|
+
contentId: O,
|
|
69
|
+
focusRequestRef: k,
|
|
70
|
+
floating: M
|
|
49
71
|
},
|
|
50
|
-
children:
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
children: x("div", {
|
|
73
|
+
"data-slot": "dropdown-menu",
|
|
74
|
+
className: e([w, u]),
|
|
75
|
+
children: c === void 0 ? l : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(m, { children: "⋯" }), /* @__PURE__ */ x(a, { children: n(c, T) })] })
|
|
53
76
|
})
|
|
54
77
|
});
|
|
55
78
|
}
|
|
56
79
|
//#endregion
|
|
57
|
-
export {
|
|
80
|
+
export { E as default };
|