@aster-ui/prefixed 0.12.50
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/LICENSE +15 -0
- package/README.md +40 -0
- package/dist/chart.d.ts +2 -0
- package/dist/chart.js +5 -0
- package/dist/chart.js.map +1 -0
- package/dist/components/Affix.d.ts +14 -0
- package/dist/components/Affix.js +57 -0
- package/dist/components/Affix.js.map +1 -0
- package/dist/components/Alert.d.ts +10 -0
- package/dist/components/Alert.js +31 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/Anchor.d.ts +55 -0
- package/dist/components/Anchor.js +116 -0
- package/dist/components/Anchor.js.map +1 -0
- package/dist/components/Autocomplete.d.ts +38 -0
- package/dist/components/Autocomplete.js +186 -0
- package/dist/components/Autocomplete.js.map +1 -0
- package/dist/components/Avatar.d.ts +28 -0
- package/dist/components/Avatar.js +65 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Badge.d.ts +39 -0
- package/dist/components/Badge.js +220 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Breadcrumb.d.ts +32 -0
- package/dist/components/Breadcrumb.js +39 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/components/Browser.d.ts +7 -0
- package/dist/components/Browser.js +15 -0
- package/dist/components/Browser.js.map +1 -0
- package/dist/components/Button.d.ts +38 -0
- package/dist/components/Button.js +114 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.d.ts +57 -0
- package/dist/components/Card.js +202 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Carousel.d.ts +55 -0
- package/dist/components/Carousel.js +205 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/Cascader.d.ts +71 -0
- package/dist/components/Cascader.js +416 -0
- package/dist/components/Cascader.js.map +1 -0
- package/dist/components/Chart.d.ts +19 -0
- package/dist/components/Chart.js +153 -0
- package/dist/components/Chart.js.map +1 -0
- package/dist/components/Chat.d.ts +11 -0
- package/dist/components/Chat.js +33 -0
- package/dist/components/Chat.js.map +1 -0
- package/dist/components/Checkbox.d.ts +42 -0
- package/dist/components/Checkbox.js +156 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Code.d.ts +16 -0
- package/dist/components/Code.js +60 -0
- package/dist/components/Code.js.map +1 -0
- package/dist/components/Collapse.d.ts +45 -0
- package/dist/components/Collapse.js +115 -0
- package/dist/components/Collapse.js.map +1 -0
- package/dist/components/ColorPicker.d.ts +16 -0
- package/dist/components/ColorPicker.js +368 -0
- package/dist/components/ColorPicker.js.map +1 -0
- package/dist/components/Command.d.ts +65 -0
- package/dist/components/Command.js +422 -0
- package/dist/components/Command.js.map +1 -0
- package/dist/components/ConfigProvider.d.ts +59 -0
- package/dist/components/ConfigProvider.js +46 -0
- package/dist/components/ConfigProvider.js.map +1 -0
- package/dist/components/Container.d.ts +12 -0
- package/dist/components/Container.js +28 -0
- package/dist/components/Container.js.map +1 -0
- package/dist/components/ContextMenu.d.ts +59 -0
- package/dist/components/ContextMenu.js +206 -0
- package/dist/components/ContextMenu.js.map +1 -0
- package/dist/components/CopyButton.d.ts +37 -0
- package/dist/components/CopyButton.js +123 -0
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/components/Countdown.d.ts +27 -0
- package/dist/components/Countdown.js +118 -0
- package/dist/components/Countdown.js.map +1 -0
- package/dist/components/DatePicker.d.ts +11 -0
- package/dist/components/DatePicker.js +188 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/Descriptions.d.ts +84 -0
- package/dist/components/Descriptions.js +234 -0
- package/dist/components/Descriptions.js.map +1 -0
- package/dist/components/Diff.d.ts +12 -0
- package/dist/components/Diff.js +22 -0
- package/dist/components/Diff.js.map +1 -0
- package/dist/components/Divider.d.ts +8 -0
- package/dist/components/Divider.js +36 -0
- package/dist/components/Divider.js.map +1 -0
- package/dist/components/Dock.d.ts +38 -0
- package/dist/components/Dock.js +47 -0
- package/dist/components/Dock.js.map +1 -0
- package/dist/components/Drawer.d.ts +81 -0
- package/dist/components/Drawer.js +246 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/Dropdown.d.ts +104 -0
- package/dist/components/Dropdown.js +407 -0
- package/dist/components/Dropdown.js.map +1 -0
- package/dist/components/Empty.d.ts +17 -0
- package/dist/components/Empty.js +145 -0
- package/dist/components/Empty.js.map +1 -0
- package/dist/components/Fieldset.d.ts +21 -0
- package/dist/components/Fieldset.js +21 -0
- package/dist/components/Fieldset.js.map +1 -0
- package/dist/components/FileInput.d.ts +9 -0
- package/dist/components/FileInput.js +38 -0
- package/dist/components/FileInput.js.map +1 -0
- package/dist/components/Filter.d.ts +27 -0
- package/dist/components/Filter.js +57 -0
- package/dist/components/Filter.js.map +1 -0
- package/dist/components/Flex.d.ts +14 -0
- package/dist/components/Flex.js +66 -0
- package/dist/components/Flex.js.map +1 -0
- package/dist/components/FloatButton.d.ts +73 -0
- package/dist/components/FloatButton.js +187 -0
- package/dist/components/FloatButton.js.map +1 -0
- package/dist/components/Footer.d.ts +16 -0
- package/dist/components/Footer.js +22 -0
- package/dist/components/Footer.js.map +1 -0
- package/dist/components/Form.d.ts +107 -0
- package/dist/components/Form.js +277 -0
- package/dist/components/Form.js.map +1 -0
- package/dist/components/Grid.d.ts +26 -0
- package/dist/components/Grid.js +1090 -0
- package/dist/components/Grid.js.map +1 -0
- package/dist/components/Hero.d.ts +11 -0
- package/dist/components/Hero.js +21 -0
- package/dist/components/Hero.js.map +1 -0
- package/dist/components/HoverGallery.d.ts +10 -0
- package/dist/components/HoverGallery.js +20 -0
- package/dist/components/HoverGallery.js.map +1 -0
- package/dist/components/Image.d.ts +26 -0
- package/dist/components/Image.js +172 -0
- package/dist/components/Image.js.map +1 -0
- package/dist/components/Input.d.ts +36 -0
- package/dist/components/Input.js +263 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/InputNumber.d.ts +19 -0
- package/dist/components/InputNumber.js +158 -0
- package/dist/components/InputNumber.js.map +1 -0
- package/dist/components/Join.d.ts +6 -0
- package/dist/components/Join.js +19 -0
- package/dist/components/Join.js.map +1 -0
- package/dist/components/Kbd.d.ts +9 -0
- package/dist/components/Kbd.js +20 -0
- package/dist/components/Kbd.js.map +1 -0
- package/dist/components/Layout.d.ts +67 -0
- package/dist/components/Layout.js +188 -0
- package/dist/components/Layout.js.map +1 -0
- package/dist/components/List.d.ts +79 -0
- package/dist/components/List.js +128 -0
- package/dist/components/List.js.map +1 -0
- package/dist/components/Loading.d.ts +9 -0
- package/dist/components/Loading.js +40 -0
- package/dist/components/Loading.js.map +1 -0
- package/dist/components/Mask.d.ts +14 -0
- package/dist/components/Mask.js +37 -0
- package/dist/components/Mask.js.map +1 -0
- package/dist/components/Masonry.d.ts +15 -0
- package/dist/components/Masonry.js +84 -0
- package/dist/components/Masonry.js.map +1 -0
- package/dist/components/Mention.d.ts +30 -0
- package/dist/components/Mention.js +179 -0
- package/dist/components/Mention.js.map +1 -0
- package/dist/components/Menu.d.ts +72 -0
- package/dist/components/Menu.js +163 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/Message.d.ts +20 -0
- package/dist/components/Message.js +57 -0
- package/dist/components/Message.js.map +1 -0
- package/dist/components/Modal.d.ts +57 -0
- package/dist/components/Modal.js +338 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/MonthCalendar.d.ts +31 -0
- package/dist/components/MonthCalendar.js +205 -0
- package/dist/components/MonthCalendar.js.map +1 -0
- package/dist/components/Navbar.d.ts +22 -0
- package/dist/components/Navbar.js +50 -0
- package/dist/components/Navbar.js.map +1 -0
- package/dist/components/Notification.d.ts +50 -0
- package/dist/components/Notification.js +150 -0
- package/dist/components/Notification.js.map +1 -0
- package/dist/components/OTPInput.d.ts +32 -0
- package/dist/components/OTPInput.js +114 -0
- package/dist/components/OTPInput.js.map +1 -0
- package/dist/components/Pagination.d.ts +18 -0
- package/dist/components/Pagination.js +175 -0
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Phone.d.ts +8 -0
- package/dist/components/Phone.js +17 -0
- package/dist/components/Phone.js.map +1 -0
- package/dist/components/Popconfirm.d.ts +17 -0
- package/dist/components/Popconfirm.js +125 -0
- package/dist/components/Popconfirm.js.map +1 -0
- package/dist/components/Popover.d.ts +15 -0
- package/dist/components/Popover.js +89 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/Progress.d.ts +5 -0
- package/dist/components/Progress.js +23 -0
- package/dist/components/Progress.js.map +1 -0
- package/dist/components/QRCode.d.ts +19 -0
- package/dist/components/QRCode.js +75 -0
- package/dist/components/QRCode.js.map +1 -0
- package/dist/components/RadialProgress.d.ts +10 -0
- package/dist/components/RadialProgress.js +48 -0
- package/dist/components/RadialProgress.js.map +1 -0
- package/dist/components/Radio.d.ts +26 -0
- package/dist/components/Radio.js +61 -0
- package/dist/components/Radio.js.map +1 -0
- package/dist/components/Range.d.ts +16 -0
- package/dist/components/Range.js +57 -0
- package/dist/components/Range.js.map +1 -0
- package/dist/components/Rating.d.ts +30 -0
- package/dist/components/Rating.js +127 -0
- package/dist/components/Rating.js.map +1 -0
- package/dist/components/Responsive.d.ts +18 -0
- package/dist/components/Responsive.js +17 -0
- package/dist/components/Responsive.js.map +1 -0
- package/dist/components/ResponsiveDrawer.d.ts +34 -0
- package/dist/components/ResponsiveDrawer.js +75 -0
- package/dist/components/ResponsiveDrawer.js.map +1 -0
- package/dist/components/Result.d.ts +12 -0
- package/dist/components/Result.js +110 -0
- package/dist/components/Result.js.map +1 -0
- package/dist/components/RichTextEditor.d.ts +32 -0
- package/dist/components/RichTextEditor.js +335 -0
- package/dist/components/RichTextEditor.js.map +1 -0
- package/dist/components/Segmented.d.ts +37 -0
- package/dist/components/Segmented.js +73 -0
- package/dist/components/Segmented.js.map +1 -0
- package/dist/components/Select.d.ts +18 -0
- package/dist/components/Select.js +78 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/Skeleton.d.ts +9 -0
- package/dist/components/Skeleton.js +24 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Space.d.ts +11 -0
- package/dist/components/Space.js +61 -0
- package/dist/components/Space.js.map +1 -0
- package/dist/components/Splitter.d.ts +29 -0
- package/dist/components/Splitter.js +257 -0
- package/dist/components/Splitter.js.map +1 -0
- package/dist/components/Stat.d.ts +18 -0
- package/dist/components/Stat.js +26 -0
- package/dist/components/Stat.js.map +1 -0
- package/dist/components/Status.d.ts +18 -0
- package/dist/components/Status.js +34 -0
- package/dist/components/Status.js.map +1 -0
- package/dist/components/Steps.d.ts +52 -0
- package/dist/components/Steps.js +97 -0
- package/dist/components/Steps.js.map +1 -0
- package/dist/components/Table.d.ts +105 -0
- package/dist/components/Table.js +637 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Tabs.d.ts +45 -0
- package/dist/components/Tabs.js +86 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/Tag.d.ts +34 -0
- package/dist/components/Tag.js +210 -0
- package/dist/components/Tag.js.map +1 -0
- package/dist/components/TextRotate.d.ts +13 -0
- package/dist/components/TextRotate.js +26 -0
- package/dist/components/TextRotate.js.map +1 -0
- package/dist/components/Textarea.d.ts +9 -0
- package/dist/components/Textarea.js +44 -0
- package/dist/components/Textarea.js.map +1 -0
- package/dist/components/ThemeController.d.ts +28 -0
- package/dist/components/ThemeController.js +162 -0
- package/dist/components/ThemeController.js.map +1 -0
- package/dist/components/TimePicker.d.ts +20 -0
- package/dist/components/TimePicker.js +304 -0
- package/dist/components/TimePicker.js.map +1 -0
- package/dist/components/Timeline.d.ts +79 -0
- package/dist/components/Timeline.js +151 -0
- package/dist/components/Timeline.js.map +1 -0
- package/dist/components/Toggle.d.ts +7 -0
- package/dist/components/Toggle.js +39 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/components/Tooltip.d.ts +9 -0
- package/dist/components/Tooltip.js +37 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Tour.d.ts +123 -0
- package/dist/components/Tour.js +400 -0
- package/dist/components/Tour.js.map +1 -0
- package/dist/components/Transfer.d.ts +22 -0
- package/dist/components/Transfer.js +214 -0
- package/dist/components/Transfer.js.map +1 -0
- package/dist/components/Tree.d.ts +118 -0
- package/dist/components/Tree.js +444 -0
- package/dist/components/Tree.js.map +1 -0
- package/dist/components/TreeSelect.d.ts +84 -0
- package/dist/components/TreeSelect.js +755 -0
- package/dist/components/TreeSelect.js.map +1 -0
- package/dist/components/Typography.d.ts +53 -0
- package/dist/components/Typography.js +182 -0
- package/dist/components/Typography.js.map +1 -0
- package/dist/components/Upload.d.ts +38 -0
- package/dist/components/Upload.js +261 -0
- package/dist/components/Upload.js.map +1 -0
- package/dist/components/VirtualList.d.ts +29 -0
- package/dist/components/VirtualList.js +69 -0
- package/dist/components/VirtualList.js.map +1 -0
- package/dist/components/Watermark.d.ts +40 -0
- package/dist/components/Watermark.js +129 -0
- package/dist/components/Watermark.js.map +1 -0
- package/dist/components/WeekCalendar.d.ts +35 -0
- package/dist/components/WeekCalendar.js +204 -0
- package/dist/components/WeekCalendar.js.map +1 -0
- package/dist/components/Window.d.ts +7 -0
- package/dist/components/Window.js +10 -0
- package/dist/components/Window.js.map +1 -0
- package/dist/contexts/IconSizeContext.d.ts +2 -0
- package/dist/contexts/IconSizeContext.js +6 -0
- package/dist/contexts/IconSizeContext.js.map +1 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +5 -0
- package/dist/editor.js.map +1 -0
- package/dist/hooks/useBreakpoint.d.ts +10 -0
- package/dist/hooks/useBreakpoint.js +36 -0
- package/dist/hooks/useBreakpoint.js.map +1 -0
- package/dist/hooks/useClickOutside.d.ts +17 -0
- package/dist/hooks/useClickOutside.js +18 -0
- package/dist/hooks/useClickOutside.js.map +1 -0
- package/dist/hooks/useClipboard.d.ts +20 -0
- package/dist/hooks/useClipboard.js +17 -0
- package/dist/hooks/useClipboard.js.map +1 -0
- package/dist/hooks/useDebounce.d.ts +18 -0
- package/dist/hooks/useDebounce.js +16 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useDisclosure.d.ts +20 -0
- package/dist/hooks/useDisclosure.js +9 -0
- package/dist/hooks/useDisclosure.js.map +1 -0
- package/dist/hooks/useHover.d.ts +18 -0
- package/dist/hooks/useHover.js +16 -0
- package/dist/hooks/useHover.js.map +1 -0
- package/dist/hooks/useKeyPress.d.ts +40 -0
- package/dist/hooks/useKeyPress.js +34 -0
- package/dist/hooks/useKeyPress.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +12 -0
- package/dist/hooks/useLocalStorage.js +49 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/usePrevious.d.ts +15 -0
- package/dist/hooks/usePrevious.js +11 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useWindowSize.d.ts +21 -0
- package/dist/hooks/useWindowSize.js +21 -0
- package/dist/hooks/useWindowSize.js.map +1 -0
- package/dist/index.d.ts +216 -0
- package/dist/index.js +256 -0
- package/dist/index.js.map +1 -0
- package/dist/locale/de-DE.d.ts +3 -0
- package/dist/locale/de-DE.js +100 -0
- package/dist/locale/de-DE.js.map +1 -0
- package/dist/locale/en-CA.d.ts +3 -0
- package/dist/locale/en-CA.js +11 -0
- package/dist/locale/en-CA.js.map +1 -0
- package/dist/locale/en-GB.d.ts +3 -0
- package/dist/locale/en-GB.js +11 -0
- package/dist/locale/en-GB.js.map +1 -0
- package/dist/locale/en-US.d.ts +3 -0
- package/dist/locale/en-US.js +100 -0
- package/dist/locale/en-US.js.map +1 -0
- package/dist/locale/es-ES.d.ts +3 -0
- package/dist/locale/es-ES.js +100 -0
- package/dist/locale/es-ES.js.map +1 -0
- package/dist/locale/fr-FR.d.ts +3 -0
- package/dist/locale/fr-FR.js +100 -0
- package/dist/locale/fr-FR.js.map +1 -0
- package/dist/locale/index.d.ts +107 -0
- package/dist/locale/ja-JP.d.ts +3 -0
- package/dist/locale/ja-JP.js +100 -0
- package/dist/locale/ja-JP.js.map +1 -0
- package/dist/locale/ko-KR.d.ts +3 -0
- package/dist/locale/ko-KR.js +100 -0
- package/dist/locale/ko-KR.js.map +1 -0
- package/dist/locale/pt-BR.d.ts +3 -0
- package/dist/locale/pt-BR.js +100 -0
- package/dist/locale/pt-BR.js.map +1 -0
- package/dist/locale/zh-CN.d.ts +3 -0
- package/dist/locale/zh-CN.js +100 -0
- package/dist/locale/zh-CN.js.map +1 -0
- package/dist/qrcode.d.ts +2 -0
- package/dist/qrcode.js +5 -0
- package/dist/qrcode.js.map +1 -0
- package/dist/virtuallist.d.ts +2 -0
- package/dist/virtuallist.js +5 -0
- package/dist/virtuallist.js.map +1 -0
- package/package.json +130 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../src/components/Select.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react'\nimport { useConfig } from './ConfigProvider'\n\n// DaisyUI classes\nconst dSelect = 'd-select'\nconst dSelectBordered = 'd-select-bordered'\nconst dSelectGhost = 'd-select-ghost'\nconst dSelectXs = 'd-select-xs'\nconst dSelectSm = 'd-select-sm'\nconst dSelectMd = 'd-select-md'\nconst dSelectLg = 'd-select-lg'\nconst dSelectXl = 'd-select-xl'\nconst dSelectNeutral = 'd-select-neutral'\nconst dSelectPrimary = 'd-select-primary'\nconst dSelectSecondary = 'd-select-secondary'\nconst dSelectAccent = 'd-select-accent'\nconst dSelectInfo = 'd-select-info'\nconst dSelectSuccess = 'd-select-success'\nconst dSelectWarning = 'd-select-warning'\nconst dSelectError = 'd-select-error'\nconst dFloatingLabel = 'd-floating-label'\n\nexport interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n /** Validation status */\n status?: 'error' | 'warning'\n ghost?: boolean\n bordered?: boolean\n /** Floating label text (uses DaisyUI floating-label) */\n floatingLabel?: string\n /** Text/element before select (outside, using DaisyUI label) */\n addonBefore?: React.ReactNode\n /** Text/element after select (outside, using DaisyUI label) */\n addonAfter?: React.ReactNode\n className?: string\n children?: React.ReactNode\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n size,\n color,\n status,\n ghost = false,\n bordered = true,\n floatingLabel,\n addonBefore,\n addonAfter,\n className = '',\n children,\n ...props\n },\n ref\n ) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const innerRef = useRef<HTMLSelectElement>(null)\n const selectRef = (ref as React.RefObject<HTMLSelectElement>) || innerRef\n\n const sizeClasses = {\n xs: dSelectXs,\n sm: dSelectSm,\n md: dSelectMd,\n lg: dSelectLg,\n xl: dSelectXl,\n }\n\n const colorClasses = {\n neutral: dSelectNeutral,\n primary: dSelectPrimary,\n secondary: dSelectSecondary,\n accent: dSelectAccent,\n info: dSelectInfo,\n success: dSelectSuccess,\n warning: dSelectWarning,\n error: dSelectError,\n }\n\n const statusClasses = {\n error: dSelectError,\n warning: dSelectWarning,\n }\n\n // Status takes precedence over color for validation feedback\n const effectiveColorClass = status ? statusClasses[status] : (color ? colorClasses[color] : '')\n\n // When wrapped with external addons, the wrapper has the styling\n const hasExternalAddons = addonBefore || addonAfter\n\n const selectClasses = hasExternalAddons\n ? ['grow', 'bg-transparent', 'border-0', 'outline-none', 'focus:outline-none', className].filter(Boolean).join(' ')\n : [\n dSelect,\n 'w-full',\n bordered && dSelectBordered,\n ghost && dSelectGhost,\n effectiveSize && sizeClasses[effectiveSize],\n effectiveColorClass,\n className,\n ].filter(Boolean).join(' ')\n\n // Build the core select element\n const selectElement = (\n <select ref={selectRef} className={selectClasses} {...props}>\n {children}\n </select>\n )\n\n // Wrap with floating label if specified\n if (floatingLabel) {\n const floatingClasses = [\n dFloatingLabel,\n effectiveSize && sizeClasses[effectiveSize],\n ].filter(Boolean).join(' ')\n\n return (\n <label className={floatingClasses}>\n <select ref={selectRef} className={`${dSelect} ${dSelectBordered} w-full`} {...props}>\n {children}\n </select>\n <span>{floatingLabel}</span>\n </label>\n )\n }\n\n // Wrap with external addons if specified\n if (hasExternalAddons) {\n const addonClasses = [\n dSelect,\n dSelectBordered,\n 'flex',\n 'items-center',\n 'gap-2',\n effectiveSize && sizeClasses[effectiveSize],\n effectiveColorClass,\n ].filter(Boolean).join(' ')\n\n return (\n <label className={addonClasses}>\n {addonBefore && <span className=\"text-base-content/70\">{addonBefore}</span>}\n {selectElement}\n {addonAfter && <span className=\"text-base-content/70\">{addonAfter}</span>}\n </label>\n )\n }\n\n return selectElement\n }\n)\n\nSelect.displayName = 'Select'\n"],"names":["dSelect","dSelectBordered","dSelectGhost","dSelectXs","dSelectSm","dSelectMd","dSelectLg","dSelectXl","dSelectNeutral","dSelectPrimary","dSelectSecondary","dSelectAccent","dSelectInfo","dSelectSuccess","dSelectWarning","dSelectError","dFloatingLabel","Select","forwardRef","size","color","status","ghost","bordered","floatingLabel","addonBefore","addonAfter","className","children","props","ref","componentSize","useConfig","effectiveSize","innerRef","useRef","selectRef","sizeClasses","effectiveColorClass","hasExternalAddons","selectClasses","selectElement","floatingClasses","jsxs","jsx","addonClasses"],"mappings":";;;AAIA,MAAMA,IAAU,YACVC,IAAkB,qBAClBC,IAAe,kBACfC,IAAY,eACZC,IAAY,eACZC,IAAY,eACZC,IAAY,eACZC,IAAY,eACZC,IAAiB,oBACjBC,IAAiB,oBACjBC,IAAmB,sBACnBC,IAAgB,mBAChBC,IAAc,iBACdC,IAAiB,oBACjBC,IAAiB,oBACjBC,IAAe,kBACfC,IAAiB,oBAmBVC,IAASC;AAAA,EACpB,CACE;AAAA,IACE,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,UAAAC,IAAW;AAAA,IACX,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA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,WAAY,GAAG4B,GAC5E,UAAAD,EAAA,CACH;AAAA,QACA,gBAAAgB,EAAC,UAAM,UAAApB,EAAA,CAAc;AAAA,MAAA,GACvB;AAAA,IAEJ;AAGA,QAAIe,GAAmB;AACrB,YAAMM,IAAe;AAAA,QACnB7C;AAAA,QACAC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAgC,KAAiBI,EAAYJ,CAAa;AAAA,QAC1CK;AAAA,MAAA,EACA,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,aACE,gBAAAK,EAAC,SAAA,EAAM,WAAWE,GACf,UAAA;AAAA,QAAApB,KAAe,gBAAAmB,EAAC,QAAA,EAAK,WAAU,wBAAwB,UAAAnB,GAAY;AAAA,QACnEgB;AAAA,QACAf,KAAc,gBAAAkB,EAAC,QAAA,EAAK,WAAU,wBAAwB,UAAAlB,EAAA,CAAW;AAAA,MAAA,GACpE;AAAA,IAEJ;AAEA,WAAOe;AAAA,EACT;AACF;AAEAxB,EAAO,cAAc;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
width?: string | number;
|
|
4
|
+
height?: string | number;
|
|
5
|
+
circle?: boolean;
|
|
6
|
+
variant?: 'default' | 'text';
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Skeleton: React.FC<SkeletonProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
const x = "d-skeleton", k = "d-skeleton-text", i = ({
|
|
3
|
+
width: t,
|
|
4
|
+
height: s,
|
|
5
|
+
circle: o = !1,
|
|
6
|
+
variant: l = "default",
|
|
7
|
+
className: n = "",
|
|
8
|
+
children: r,
|
|
9
|
+
style: f,
|
|
10
|
+
...u
|
|
11
|
+
}) => {
|
|
12
|
+
const c = () => {
|
|
13
|
+
const e = [x];
|
|
14
|
+
return l === "text" && e.push(k), o && e.push("rounded-full"), n && e.push(n), e.join(" ");
|
|
15
|
+
}, p = () => {
|
|
16
|
+
const e = {};
|
|
17
|
+
return t && (e.width = typeof t == "number" ? `${t}px` : t), s && (e.height = typeof s == "number" ? `${s}px` : s), Object.keys(e).length > 0 ? e : void 0;
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ d("div", { className: c(), style: { ...p(), ...f }, ...u, children: r });
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
i as Skeleton
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sources":["../../src/components/Skeleton.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dSkeleton = 'd-skeleton'\nconst dSkeletonText = 'd-skeleton-text'\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n width?: string | number\n height?: string | number\n circle?: boolean\n variant?: 'default' | 'text'\n children?: React.ReactNode\n}\n\nexport const Skeleton: React.FC<SkeletonProps> = ({\n width,\n height,\n circle = false,\n variant = 'default',\n className = '',\n children,\n style,\n ...rest\n}) => {\n const getClasses = () => {\n const classes = [dSkeleton]\n\n if (variant === 'text') {\n classes.push(dSkeletonText)\n }\n\n if (circle) {\n classes.push('rounded-full')\n }\n\n if (className) {\n classes.push(className)\n }\n\n return classes.join(' ')\n }\n\n const getStyles = () => {\n const styles: React.CSSProperties = {}\n\n if (width) {\n styles.width = typeof width === 'number' ? `${width}px` : width\n }\n\n if (height) {\n styles.height = typeof height === 'number' ? `${height}px` : height\n }\n\n return Object.keys(styles).length > 0 ? styles : undefined\n }\n\n return (\n <div className={getClasses()} style={{ ...getStyles(), ...style }} {...rest}>\n {children}\n </div>\n )\n}\n"],"names":["dSkeleton","dSkeletonText","Skeleton","width","height","circle","variant","className","children","style","rest","getClasses","classes","getStyles","styles","jsx"],"mappings":";AAGA,MAAMA,IAAY,cACZC,IAAgB,mBAUTC,IAAoC,CAAC;AAAA,EAChD,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAa,MAAM;AACvB,UAAMC,IAAU,CAACZ,CAAS;AAE1B,WAAIM,MAAY,UACdM,EAAQ,KAAKX,CAAa,GAGxBI,KACFO,EAAQ,KAAK,cAAc,GAGzBL,KACFK,EAAQ,KAAKL,CAAS,GAGjBK,EAAQ,KAAK,GAAG;AAAA,EACzB,GAEMC,IAAY,MAAM;AACtB,UAAMC,IAA8B,CAAA;AAEpC,WAAIX,MACFW,EAAO,QAAQ,OAAOX,KAAU,WAAW,GAAGA,CAAK,OAAOA,IAGxDC,MACFU,EAAO,SAAS,OAAOV,KAAW,WAAW,GAAGA,CAAM,OAAOA,IAGxD,OAAO,KAAKU,CAAM,EAAE,SAAS,IAAIA,IAAS;AAAA,EACnD;AAEA,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWJ,EAAA,GAAc,OAAO,EAAE,GAAGE,EAAA,GAAa,GAAGJ,EAAA,GAAU,GAAGC,GACpE,UAAAF,EAAA,CACH;AAEJ;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
direction?: 'horizontal' | 'vertical';
|
|
4
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
5
|
+
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
6
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
|
+
wrap?: boolean;
|
|
8
|
+
split?: React.ReactNode;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const Space: React.FC<SpaceProps>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import v from "react";
|
|
3
|
+
const w = {
|
|
4
|
+
xs: "gap-1",
|
|
5
|
+
sm: "gap-2",
|
|
6
|
+
md: "gap-4",
|
|
7
|
+
lg: "gap-6",
|
|
8
|
+
xl: "gap-8"
|
|
9
|
+
}, A = {
|
|
10
|
+
start: "items-start",
|
|
11
|
+
end: "items-end",
|
|
12
|
+
center: "items-center",
|
|
13
|
+
baseline: "items-baseline",
|
|
14
|
+
stretch: "items-stretch"
|
|
15
|
+
}, N = {
|
|
16
|
+
start: "justify-start",
|
|
17
|
+
end: "justify-end",
|
|
18
|
+
center: "justify-center",
|
|
19
|
+
between: "justify-between",
|
|
20
|
+
around: "justify-around",
|
|
21
|
+
evenly: "justify-evenly"
|
|
22
|
+
}, E = ({
|
|
23
|
+
direction: r = "horizontal",
|
|
24
|
+
size: s = "sm",
|
|
25
|
+
align: p,
|
|
26
|
+
justify: a,
|
|
27
|
+
wrap: u = !1,
|
|
28
|
+
split: l,
|
|
29
|
+
className: m = "",
|
|
30
|
+
style: d,
|
|
31
|
+
children: e,
|
|
32
|
+
...g
|
|
33
|
+
}) => {
|
|
34
|
+
const o = typeof s == "number", h = o ? "" : w[s], i = p ?? (r === "vertical" ? "start" : void 0), y = i ? A[i] : "", C = a ? N[a] : "", j = [
|
|
35
|
+
"flex",
|
|
36
|
+
r === "horizontal" ? "flex-row" : "flex-col",
|
|
37
|
+
h,
|
|
38
|
+
y,
|
|
39
|
+
C,
|
|
40
|
+
u ? "flex-wrap" : "",
|
|
41
|
+
m
|
|
42
|
+
].filter(Boolean).join(" "), x = {
|
|
43
|
+
...d,
|
|
44
|
+
...o ? { gap: `${s}px` } : {}
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ f("div", { className: j, style: x, ...g, children: (() => {
|
|
47
|
+
if (!l) return e;
|
|
48
|
+
const t = v.Children.toArray(e).filter(Boolean);
|
|
49
|
+
if (t.length <= 1) return e;
|
|
50
|
+
const n = [];
|
|
51
|
+
return t.forEach((b, c) => {
|
|
52
|
+
n.push(b), c < t.length - 1 && n.push(
|
|
53
|
+
/* @__PURE__ */ f("span", { className: "flex-shrink-0", children: l }, `split-${c}`)
|
|
54
|
+
);
|
|
55
|
+
}), n;
|
|
56
|
+
})() });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
E as Space
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=Space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Space.js","sources":["../../src/components/Space.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'horizontal' | 'vertical'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n wrap?: boolean\n split?: React.ReactNode\n children: React.ReactNode\n}\n\nconst gapClasses = {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n} as const\n\nconst alignClasses = {\n start: 'items-start',\n end: 'items-end',\n center: 'items-center',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n} as const\n\nconst justifyClasses = {\n start: 'justify-start',\n end: 'justify-end',\n center: 'justify-center',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n} as const\n\nexport const Space: React.FC<SpaceProps> = ({\n direction = 'horizontal',\n size = 'sm',\n align,\n justify,\n wrap = false,\n split,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericSize = typeof size === 'number'\n const gapClass = isNumericSize ? '' : gapClasses[size]\n const effectiveAlign = align ?? (direction === 'vertical' ? 'start' : undefined)\n const alignClass = effectiveAlign ? alignClasses[effectiveAlign] : ''\n const justifyClass = justify ? justifyClasses[justify] : ''\n const wrapClass = wrap ? 'flex-wrap' : ''\n const directionClass = direction === 'horizontal' ? 'flex-row' : 'flex-col'\n\n const classes = [\n 'flex',\n directionClass,\n gapClass,\n alignClass,\n justifyClass,\n wrapClass,\n className\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericSize ? { gap: `${size}px` } : {}),\n }\n\n // If split is provided, interleave separator between children\n const renderChildren = () => {\n if (!split) return children\n\n const childArray = React.Children.toArray(children).filter(Boolean)\n if (childArray.length <= 1) return children\n\n const result: React.ReactNode[] = []\n childArray.forEach((child, index) => {\n result.push(child)\n if (index < childArray.length - 1) {\n result.push(\n <span key={`split-${index}`} className=\"flex-shrink-0\">\n {split}\n </span>\n )\n }\n })\n return result\n }\n\n return <div className={classes} style={combinedStyle} {...rest}>{renderChildren()}</div>\n}\n"],"names":["gapClasses","alignClasses","justifyClasses","Space","direction","size","align","justify","wrap","split","className","style","children","rest","isNumericSize","gapClass","effectiveAlign","alignClass","justifyClass","classes","combinedStyle","jsx","childArray","React","result","child","index"],"mappings":";;AAYA,MAAMA,IAAa;AAAA,EACjB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAe;AAAA,EACnB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AACX,GAEMC,IAAiB;AAAA,EACrB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AACV,GAEaC,IAA8B,CAAC;AAAA,EAC1C,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAgB,OAAOT,KAAS,UAChCU,IAAWD,IAAgB,KAAKd,EAAWK,CAAI,GAC/CW,IAAiBV,MAAUF,MAAc,aAAa,UAAU,SAChEa,IAAaD,IAAiBf,EAAae,CAAc,IAAI,IAC7DE,IAAeX,IAAUL,EAAeK,CAAO,IAAI,IAInDY,IAAU;AAAA,IACd;AAAA,IAHqBf,MAAc,eAAe,aAAa;AAAA,IAK/DW;AAAA,IACAE;AAAA,IACAC;AAAA,IARgBV,IAAO,cAAc;AAAA,IAUrCE;AAAA,EAAA,EACA,OAAO,OAAO,EAAE,KAAK,GAAG,GAEpBU,IAAqC;AAAA,IACzC,GAAGT;AAAA,IACH,GAAIG,IAAgB,EAAE,KAAK,GAAGT,CAAI,SAAS,CAAA;AAAA,EAAC;AAwB9C,SAAO,gBAAAgB,EAAC,SAAI,WAAWF,GAAS,OAAOC,GAAgB,GAAGP,GAAO,WApB1C,MAAM;AAC3B,QAAI,CAACJ,EAAO,QAAOG;AAEnB,UAAMU,IAAaC,EAAM,SAAS,QAAQX,CAAQ,EAAE,OAAO,OAAO;AAClE,QAAIU,EAAW,UAAU,EAAG,QAAOV;AAEnC,UAAMY,IAA4B,CAAA;AAClC,WAAAF,EAAW,QAAQ,CAACG,GAAOC,MAAU;AACnC,MAAAF,EAAO,KAAKC,CAAK,GACbC,IAAQJ,EAAW,SAAS,KAC9BE,EAAO;AAAA,0BACJ,QAAA,EAA4B,WAAU,iBACpC,UAAAf,KADQ,SAASiB,CAAK,EAEzB;AAAA,MAAA;AAAA,IAGN,CAAC,GACMF;AAAA,EACT,GAEiE,EAAe,CAAE;AACpF;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SplitterPanelProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
defaultSize?: number;
|
|
5
|
+
size?: number;
|
|
6
|
+
minSize?: number;
|
|
7
|
+
maxSize?: number;
|
|
8
|
+
collapsible?: boolean;
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
defaultCollapsed?: boolean;
|
|
11
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
12
|
+
resizable?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SplitterProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
direction?: 'horizontal' | 'vertical';
|
|
18
|
+
sizes?: number[];
|
|
19
|
+
defaultSizes?: number[];
|
|
20
|
+
onSizesChange?: (sizes: number[]) => void;
|
|
21
|
+
gutterSize?: number;
|
|
22
|
+
minSize?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const Panel: React.FC<SplitterPanelProps>;
|
|
26
|
+
export declare const Splitter: React.FC<SplitterProps> & {
|
|
27
|
+
Panel: typeof Panel;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { jsx as h, jsxs as U, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import F, { useRef as L, useState as I, useCallback as b, useEffect as ee } from "react";
|
|
3
|
+
const ze = "d-bg-base-300", ge = "d-bg-primary", B = "d-text-base-content", we = "d-hover:bg-primary", te = "d-hover:text-base-content", K = "d-group-hover:bg-primary", oe = "d-hover:bg-base-content", ne = "d-rounded", G = "d-rounded-full", Ce = ({ children: M }) => /* @__PURE__ */ h(me, { children: M }), ve = ({
|
|
4
|
+
children: M,
|
|
5
|
+
direction: g = "horizontal",
|
|
6
|
+
sizes: $,
|
|
7
|
+
defaultSizes: N,
|
|
8
|
+
onSizesChange: W,
|
|
9
|
+
gutterSize: R = 8,
|
|
10
|
+
minSize: E = 50,
|
|
11
|
+
className: se = ""
|
|
12
|
+
}) => {
|
|
13
|
+
const D = L(null), re = L([]), x = L(null), u = F.Children.toArray(M).filter(
|
|
14
|
+
(e) => F.isValidElement(e)
|
|
15
|
+
), m = u.length, [d, X] = I(
|
|
16
|
+
() => u.map((e) => e.props.defaultCollapsed ?? e.props.collapsed ?? !1)
|
|
17
|
+
), Y = L([]), j = b(() => {
|
|
18
|
+
const e = u.map((s) => s.props.defaultSize), o = e.some((s) => s !== void 0);
|
|
19
|
+
if (N && N.length === m)
|
|
20
|
+
return N;
|
|
21
|
+
if (o) {
|
|
22
|
+
const s = e.reduce((l, n) => l + (n ?? 0), 0), r = e.filter((l) => l === void 0).length, a = Math.max(0, 100 - s), t = r > 0 ? a / r : 0;
|
|
23
|
+
return e.map((l) => l ?? t);
|
|
24
|
+
}
|
|
25
|
+
const i = 100 / m;
|
|
26
|
+
return Array(m).fill(i);
|
|
27
|
+
}, [N, m, u]), [y, _] = I(j), le = b(() => {
|
|
28
|
+
const e = u.map((t) => t.props.size);
|
|
29
|
+
if (!e.some((t) => t !== void 0)) return null;
|
|
30
|
+
const i = e.reduce((t, l) => t + (l ?? 0), 0), s = e.filter((t) => t === void 0).length, r = Math.max(0, 100 - i), a = s > 0 ? r / s : 0;
|
|
31
|
+
return e.map((t, l) => t ?? y[l] ?? a);
|
|
32
|
+
}, [u, y]), f = $ || le() || y;
|
|
33
|
+
ee(() => {
|
|
34
|
+
!$ && y.length !== m && _(j());
|
|
35
|
+
}, [m, $, y.length, j]), ee(() => {
|
|
36
|
+
const e = u.map(
|
|
37
|
+
(i, s) => i.props.collapsed ?? d[s] ?? !1
|
|
38
|
+
);
|
|
39
|
+
e.some((i, s) => i !== d[s]) && X(e);
|
|
40
|
+
}, [u.map((e) => e.props.collapsed).join(",")]);
|
|
41
|
+
const w = b(
|
|
42
|
+
(e) => {
|
|
43
|
+
$ || _(e), W?.(e);
|
|
44
|
+
},
|
|
45
|
+
[$, W]
|
|
46
|
+
), q = b(
|
|
47
|
+
(e) => {
|
|
48
|
+
const o = u[e];
|
|
49
|
+
if (!o?.props.collapsible) return;
|
|
50
|
+
const s = !d[e], r = [...d];
|
|
51
|
+
if (r[e] = s, X(r), o.props.onCollapse?.(s), s) {
|
|
52
|
+
Y.current = [...f];
|
|
53
|
+
const a = 0, t = f[e] - a, l = f.map((n, c) => ({ size: n, index: c })).filter((n, c) => c !== e && !r[c]);
|
|
54
|
+
if (l.length > 0) {
|
|
55
|
+
const n = t / l.length, c = f.map((p, C) => C === e ? a : r[C] ? p : p + n);
|
|
56
|
+
w(c);
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
const a = Y.current[e] || 100 / m, l = f.map((n, c) => ({ size: n, index: c })).filter((n, c) => c !== e && !r[c]).reduce((n, c) => n + c.size, 0);
|
|
60
|
+
if (l > 0) {
|
|
61
|
+
const n = f.map((c, p) => {
|
|
62
|
+
if (p === e) return a;
|
|
63
|
+
if (!r[p]) {
|
|
64
|
+
const C = c / l;
|
|
65
|
+
return c - a * C;
|
|
66
|
+
}
|
|
67
|
+
return c;
|
|
68
|
+
});
|
|
69
|
+
w(n);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[u, d, f, m, w]
|
|
74
|
+
), ae = b(
|
|
75
|
+
(e, o) => {
|
|
76
|
+
const i = u[e]?.props || {}, s = u[e + 1]?.props || {};
|
|
77
|
+
if (i.resizable === !1 || s.resizable === !1 || d[e] || d[e + 1])
|
|
78
|
+
return;
|
|
79
|
+
o.preventDefault();
|
|
80
|
+
const r = g === "horizontal" ? o.clientX : o.clientY;
|
|
81
|
+
x.current = {
|
|
82
|
+
index: e,
|
|
83
|
+
startPos: r,
|
|
84
|
+
startSizes: [...f]
|
|
85
|
+
};
|
|
86
|
+
const a = (l) => {
|
|
87
|
+
if (!x.current || !D.current) return;
|
|
88
|
+
const { index: n, startPos: c, startSizes: p } = x.current, C = D.current.getBoundingClientRect(), pe = g === "horizontal" ? C.width : C.height, ue = g === "horizontal" ? l.clientX : l.clientY, de = (m - 1) * R, k = pe - de, O = (ue - c) / k * 100, V = u[n]?.props || {}, J = u[n + 1]?.props || {}, fe = V.minSize ?? E, he = J.minSize ?? E, A = fe / k * 100, H = he / k * 100;
|
|
89
|
+
let v = p[n] + O, S = p[n + 1] - O;
|
|
90
|
+
v < A && (v = A, S = p[n] + p[n + 1] - A), S < H && (S = H, v = p[n] + p[n + 1] - H);
|
|
91
|
+
const Q = V.maxSize, Z = J.maxSize;
|
|
92
|
+
if (Q) {
|
|
93
|
+
const P = Q / k * 100;
|
|
94
|
+
v > P && (v = P, S = p[n] + p[n + 1] - P);
|
|
95
|
+
}
|
|
96
|
+
if (Z) {
|
|
97
|
+
const P = Z / k * 100;
|
|
98
|
+
S > P && (S = P, v = p[n] + p[n + 1] - P);
|
|
99
|
+
}
|
|
100
|
+
const T = [...p];
|
|
101
|
+
T[n] = v, T[n + 1] = S, w(T);
|
|
102
|
+
}, t = () => {
|
|
103
|
+
x.current = null, document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", t), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
104
|
+
};
|
|
105
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", t), document.body.style.cursor = g === "horizontal" ? "col-resize" : "row-resize", document.body.style.userSelect = "none";
|
|
106
|
+
},
|
|
107
|
+
[g, f, m, R, u, E, w, d]
|
|
108
|
+
), ce = b(
|
|
109
|
+
(e, o) => {
|
|
110
|
+
if (d[e] || d[e + 1])
|
|
111
|
+
return;
|
|
112
|
+
const i = o.shiftKey ? 10 : 1;
|
|
113
|
+
let s = 0;
|
|
114
|
+
if (g === "horizontal" ? o.key === "ArrowLeft" ? s = -i : o.key === "ArrowRight" && (s = i) : o.key === "ArrowUp" ? s = -i : o.key === "ArrowDown" && (s = i), s !== 0) {
|
|
115
|
+
o.preventDefault();
|
|
116
|
+
const r = [...f], a = 5;
|
|
117
|
+
let t = r[e] + s, l = r[e + 1] - s;
|
|
118
|
+
t >= a && l >= a && (r[e] = t, r[e + 1] = l, w(r));
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
[g, f, w, d]
|
|
122
|
+
), z = g === "horizontal", ie = (e) => {
|
|
123
|
+
const o = u[e], i = u[e + 1], s = o?.props.collapsible, r = i?.props.collapsible, a = d[e], t = d[e + 1];
|
|
124
|
+
return {
|
|
125
|
+
showStart: s && !t,
|
|
126
|
+
showEnd: r && !a,
|
|
127
|
+
panel1Collapsed: a,
|
|
128
|
+
panel2Collapsed: t
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ h(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
ref: D,
|
|
135
|
+
className: `flex ${z ? "flex-row" : "flex-col"} h-full w-full ${se}`,
|
|
136
|
+
children: u.map((e, o) => {
|
|
137
|
+
const i = e.props, s = o === u.length - 1, r = d[o], a = i.resizable !== !1 && !r;
|
|
138
|
+
return /* @__PURE__ */ U(F.Fragment, { children: [
|
|
139
|
+
/* @__PURE__ */ h(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
ref: (t) => {
|
|
143
|
+
re.current[o] = t;
|
|
144
|
+
},
|
|
145
|
+
className: `overflow-auto ${i.className || ""}`,
|
|
146
|
+
style: {
|
|
147
|
+
[z ? "width" : "height"]: r ? "0px" : `calc(${f[o]}% - ${(m - 1) * R / m}px)`,
|
|
148
|
+
flexShrink: 0,
|
|
149
|
+
overflow: r ? "hidden" : "auto"
|
|
150
|
+
},
|
|
151
|
+
"data-collapsed": r,
|
|
152
|
+
children: i.children
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
!s && /* @__PURE__ */ h(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
role: "separator",
|
|
159
|
+
"aria-orientation": z ? "vertical" : "horizontal",
|
|
160
|
+
"aria-valuenow": Math.round(f[o]),
|
|
161
|
+
tabIndex: a ? 0 : -1,
|
|
162
|
+
className: `
|
|
163
|
+
flex-shrink-0 ${ze} transition-colors duration-150 relative group
|
|
164
|
+
${a ? `${we}/30 active:${ge}/50` : ""}
|
|
165
|
+
${a ? z ? "cursor-col-resize" : "cursor-row-resize" : "cursor-default"}
|
|
166
|
+
`,
|
|
167
|
+
style: {
|
|
168
|
+
[z ? "width" : "height"]: `${R}px`
|
|
169
|
+
},
|
|
170
|
+
onMouseDown: (t) => ae(o, t),
|
|
171
|
+
onKeyDown: (t) => ce(o, t),
|
|
172
|
+
children: (() => {
|
|
173
|
+
const { showStart: t, showEnd: l, panel1Collapsed: n, panel2Collapsed: c } = ie(o);
|
|
174
|
+
return !t && !l ? /* @__PURE__ */ U(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: `
|
|
178
|
+
absolute inset-0 flex items-center justify-center
|
|
179
|
+
${z ? "flex-col gap-0.5" : "flex-row gap-0.5"}
|
|
180
|
+
`,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ h("div", { className: `w-1 h-1 ${G} ${B}/30 ${K}/60` }),
|
|
183
|
+
/* @__PURE__ */ h("div", { className: `w-1 h-1 ${G} ${B}/30 ${K}/60` }),
|
|
184
|
+
/* @__PURE__ */ h("div", { className: `w-1 h-1 ${G} ${B}/30 ${K}/60` })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
) : /* @__PURE__ */ U(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
className: `
|
|
191
|
+
absolute inset-0 flex items-center justify-center
|
|
192
|
+
${z ? "flex-col" : "flex-row"}
|
|
193
|
+
`,
|
|
194
|
+
children: [
|
|
195
|
+
t && /* @__PURE__ */ h(
|
|
196
|
+
"button",
|
|
197
|
+
{
|
|
198
|
+
type: "button",
|
|
199
|
+
onClick: (p) => {
|
|
200
|
+
p.stopPropagation(), q(o);
|
|
201
|
+
},
|
|
202
|
+
className: `
|
|
203
|
+
p-0.5 ${ne} ${oe}/20 transition-colors
|
|
204
|
+
|
|
205
|
+
`,
|
|
206
|
+
"aria-label": n ? "Expand panel" : "Collapse panel",
|
|
207
|
+
children: /* @__PURE__ */ h(
|
|
208
|
+
"svg",
|
|
209
|
+
{
|
|
210
|
+
className: `w-3 h-3 ${B}/50 ${te} transition-transform ${n ? z ? "rotate-180" : "-rotate-90" : z ? "rotate-0" : "rotate-90"}`,
|
|
211
|
+
fill: "none",
|
|
212
|
+
viewBox: "0 0 24 24",
|
|
213
|
+
stroke: "currentColor",
|
|
214
|
+
children: /* @__PURE__ */ h("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
l && /* @__PURE__ */ h(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
type: "button",
|
|
223
|
+
onClick: (p) => {
|
|
224
|
+
p.stopPropagation(), q(o + 1);
|
|
225
|
+
},
|
|
226
|
+
className: `
|
|
227
|
+
p-0.5 ${ne} ${oe}/20 transition-colors
|
|
228
|
+
`,
|
|
229
|
+
"aria-label": c ? "Expand panel" : "Collapse panel",
|
|
230
|
+
children: /* @__PURE__ */ h(
|
|
231
|
+
"svg",
|
|
232
|
+
{
|
|
233
|
+
className: `w-3 h-3 ${B}/50 ${te} transition-transform ${c ? z ? "rotate-0" : "rotate-90" : z ? "rotate-180" : "-rotate-90"}`,
|
|
234
|
+
fill: "none",
|
|
235
|
+
viewBox: "0 0 24 24",
|
|
236
|
+
stroke: "currentColor",
|
|
237
|
+
children: /* @__PURE__ */ h("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
})()
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] }, o);
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
};
|
|
253
|
+
ve.Panel = Ce;
|
|
254
|
+
export {
|
|
255
|
+
ve as Splitter
|
|
256
|
+
};
|
|
257
|
+
//# sourceMappingURL=Splitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Splitter.js","sources":["../../src/components/Splitter.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback, useEffect } from 'react'\n\n// DaisyUI classes\nconst dBgBase300 = 'd-bg-base-300'\nconst dBgPrimary = 'd-bg-primary'\nconst dTextBaseContent = 'd-text-base-content'\nconst dHoverBgPrimary = 'd-hover:bg-primary'\nconst dHoverTextBaseContent = 'd-hover:text-base-content'\nconst dGroupHoverBgPrimary = 'd-group-hover:bg-primary'\nconst dHoverBgBaseContent = 'd-hover:bg-base-content'\nconst dRounded = 'd-rounded'\nconst dRoundedFull = 'd-rounded-full'\n\nexport interface SplitterPanelProps {\n children: React.ReactNode\n defaultSize?: number\n size?: number\n minSize?: number\n maxSize?: number\n collapsible?: boolean\n collapsed?: boolean\n defaultCollapsed?: boolean\n onCollapse?: (collapsed: boolean) => void\n resizable?: boolean\n className?: string\n}\n\nexport interface SplitterProps {\n children: React.ReactNode\n direction?: 'horizontal' | 'vertical'\n sizes?: number[]\n defaultSizes?: number[]\n onSizesChange?: (sizes: number[]) => void\n gutterSize?: number\n minSize?: number\n className?: string\n}\n\nconst Panel: React.FC<SplitterPanelProps> = ({ children }) => {\n return <>{children}</>\n}\n\nexport const Splitter: React.FC<SplitterProps> & { Panel: typeof Panel } = ({\n children,\n direction = 'horizontal',\n sizes,\n defaultSizes,\n onSizesChange,\n gutterSize = 8,\n minSize = 50,\n className = '',\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const panelsRef = useRef<(HTMLDivElement | null)[]>([])\n const draggingRef = useRef<{ index: number; startPos: number; startSizes: number[] } | null>(null)\n\n // Extract panel props from children\n const panels = React.Children.toArray(children).filter(\n (child): child is React.ReactElement<SplitterPanelProps> =>\n React.isValidElement(child)\n )\n\n const panelCount = panels.length\n\n // Track collapsed state for each panel\n const [collapsedStates, setCollapsedStates] = useState<boolean[]>(() =>\n panels.map((panel) => panel.props.defaultCollapsed ?? panel.props.collapsed ?? false)\n )\n\n // Store sizes before collapse for restoration\n const sizesBeforeCollapseRef = useRef<number[]>([])\n\n // Initialize sizes from panel props or defaults\n const getInitialSizes = useCallback(() => {\n // First check if any panels have defaultSize\n const panelDefaultSizes = panels.map((panel) => panel.props.defaultSize)\n const hasAnyPanelSize = panelDefaultSizes.some((s) => s !== undefined)\n\n if (defaultSizes && defaultSizes.length === panelCount) {\n return defaultSizes\n }\n\n if (hasAnyPanelSize) {\n // Calculate sizes from panel props\n const definedTotal = panelDefaultSizes.reduce<number>((sum, s) => sum + (s ?? 0), 0)\n const undefinedCount = panelDefaultSizes.filter((s) => s === undefined).length\n const remainingSize = Math.max(0, 100 - definedTotal)\n const sizePerUndefined = undefinedCount > 0 ? remainingSize / undefinedCount : 0\n\n return panelDefaultSizes.map((s) => s ?? sizePerUndefined)\n }\n\n // Equal distribution\n const equalSize = 100 / panelCount\n return Array(panelCount).fill(equalSize)\n }, [defaultSizes, panelCount, panels])\n\n const [internalSizes, setInternalSizes] = useState<number[]>(getInitialSizes)\n\n // Handle controlled sizes from panel props\n const getControlledSizes = useCallback(() => {\n const panelSizes = panels.map((panel) => panel.props.size)\n const hasControlledPanel = panelSizes.some((s) => s !== undefined)\n\n if (!hasControlledPanel) return null\n\n // Mix controlled and uncontrolled\n const definedTotal = panelSizes.reduce<number>((sum, s) => sum + (s ?? 0), 0)\n const undefinedCount = panelSizes.filter((s) => s === undefined).length\n const remainingSize = Math.max(0, 100 - definedTotal)\n const sizePerUndefined = undefinedCount > 0 ? remainingSize / undefinedCount : 0\n\n return panelSizes.map((s, i) => s ?? internalSizes[i] ?? sizePerUndefined)\n }, [panels, internalSizes])\n\n const currentSizes = sizes || getControlledSizes() || internalSizes\n\n // Update internal sizes when panel count changes\n useEffect(() => {\n if (!sizes && internalSizes.length !== panelCount) {\n setInternalSizes(getInitialSizes())\n }\n }, [panelCount, sizes, internalSizes.length, getInitialSizes])\n\n // Sync controlled collapsed states from props\n useEffect(() => {\n const newCollapsedStates = panels.map((panel, i) =>\n panel.props.collapsed ?? collapsedStates[i] ?? false\n )\n const hasChange = newCollapsedStates.some((s, i) => s !== collapsedStates[i])\n if (hasChange) {\n setCollapsedStates(newCollapsedStates)\n }\n }, [panels.map(p => p.props.collapsed).join(',')])\n\n const updateSizes = useCallback(\n (newSizes: number[]) => {\n if (!sizes) {\n setInternalSizes(newSizes)\n }\n onSizesChange?.(newSizes)\n },\n [sizes, onSizesChange]\n )\n\n const toggleCollapse = useCallback(\n (panelIndex: number) => {\n const panel = panels[panelIndex]\n if (!panel?.props.collapsible) return\n\n const isCurrentlyCollapsed = collapsedStates[panelIndex]\n const newCollapsed = !isCurrentlyCollapsed\n\n // Update collapsed state\n const newCollapsedStates = [...collapsedStates]\n newCollapsedStates[panelIndex] = newCollapsed\n setCollapsedStates(newCollapsedStates)\n\n // Call panel's onCollapse callback\n panel.props.onCollapse?.(newCollapsed)\n\n // Adjust sizes\n if (newCollapsed) {\n // Store current sizes before collapse\n sizesBeforeCollapseRef.current = [...currentSizes]\n\n // Collapse: set to minimum (we'll use 0 for collapsed)\n const collapsedSize = 0\n const sizeToRedistribute = currentSizes[panelIndex] - collapsedSize\n\n // Find panels that can receive the size\n const otherPanels = currentSizes\n .map((s, i) => ({ size: s, index: i }))\n .filter((_, i) => i !== panelIndex && !newCollapsedStates[i])\n\n if (otherPanels.length > 0) {\n const sizePerPanel = sizeToRedistribute / otherPanels.length\n const newSizes = currentSizes.map((s, i) => {\n if (i === panelIndex) return collapsedSize\n if (!newCollapsedStates[i]) return s + sizePerPanel\n return s\n })\n updateSizes(newSizes)\n }\n } else {\n // Expand: restore previous size\n const previousSize = sizesBeforeCollapseRef.current[panelIndex] || (100 / panelCount)\n\n // Take size from other panels proportionally\n const otherPanels = currentSizes\n .map((s, i) => ({ size: s, index: i }))\n .filter((_, i) => i !== panelIndex && !newCollapsedStates[i])\n\n const totalOtherSize = otherPanels.reduce((sum, p) => sum + p.size, 0)\n\n if (totalOtherSize > 0) {\n const newSizes = currentSizes.map((s, i) => {\n if (i === panelIndex) return previousSize\n if (!newCollapsedStates[i]) {\n const proportion = s / totalOtherSize\n return s - previousSize * proportion\n }\n return s\n })\n updateSizes(newSizes)\n }\n }\n },\n [panels, collapsedStates, currentSizes, panelCount, updateSizes]\n )\n\n const handleMouseDown = useCallback(\n (index: number, e: React.MouseEvent) => {\n // Check if either panel is non-resizable\n const panel1Props = panels[index]?.props || {}\n const panel2Props = panels[index + 1]?.props || {}\n\n if (panel1Props.resizable === false || panel2Props.resizable === false) {\n return // Don't allow dragging\n }\n\n // Don't allow dragging if either panel is collapsed\n if (collapsedStates[index] || collapsedStates[index + 1]) {\n return\n }\n\n e.preventDefault()\n const startPos = direction === 'horizontal' ? e.clientX : e.clientY\n draggingRef.current = {\n index,\n startPos,\n startSizes: [...currentSizes],\n }\n\n const handleMouseMove = (moveEvent: MouseEvent) => {\n if (!draggingRef.current || !containerRef.current) return\n\n const { index: dragIndex, startPos: dragStartPos, startSizes } = draggingRef.current\n const containerRect = containerRef.current.getBoundingClientRect()\n const containerSize = direction === 'horizontal' ? containerRect.width : containerRect.height\n const currentPos = direction === 'horizontal' ? moveEvent.clientX : moveEvent.clientY\n\n // Calculate delta as percentage\n const gutterCount = panelCount - 1\n const totalGutterSize = gutterCount * gutterSize\n const availableSize = containerSize - totalGutterSize\n const deltaPixels = currentPos - dragStartPos\n const deltaPercent = (deltaPixels / availableSize) * 100\n\n // Get min sizes for panels\n const panel1Props = panels[dragIndex]?.props || {}\n const panel2Props = panels[dragIndex + 1]?.props || {}\n const minSize1 = panel1Props.minSize ?? minSize\n const minSize2 = panel2Props.minSize ?? minSize\n const minPercent1 = (minSize1 / availableSize) * 100\n const minPercent2 = (minSize2 / availableSize) * 100\n\n // Calculate new sizes\n let newSize1 = startSizes[dragIndex] + deltaPercent\n let newSize2 = startSizes[dragIndex + 1] - deltaPercent\n\n // Apply min constraints\n if (newSize1 < minPercent1) {\n newSize1 = minPercent1\n newSize2 = startSizes[dragIndex] + startSizes[dragIndex + 1] - minPercent1\n }\n if (newSize2 < minPercent2) {\n newSize2 = minPercent2\n newSize1 = startSizes[dragIndex] + startSizes[dragIndex + 1] - minPercent2\n }\n\n // Apply max constraints\n const maxSize1 = panel1Props.maxSize\n const maxSize2 = panel2Props.maxSize\n if (maxSize1) {\n const maxPercent1 = (maxSize1 / availableSize) * 100\n if (newSize1 > maxPercent1) {\n newSize1 = maxPercent1\n newSize2 = startSizes[dragIndex] + startSizes[dragIndex + 1] - maxPercent1\n }\n }\n if (maxSize2) {\n const maxPercent2 = (maxSize2 / availableSize) * 100\n if (newSize2 > maxPercent2) {\n newSize2 = maxPercent2\n newSize1 = startSizes[dragIndex] + startSizes[dragIndex + 1] - maxPercent2\n }\n }\n\n const newSizes = [...startSizes]\n newSizes[dragIndex] = newSize1\n newSizes[dragIndex + 1] = newSize2\n updateSizes(newSizes)\n }\n\n const handleMouseUp = () => {\n draggingRef.current = null\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = direction === 'horizontal' ? 'col-resize' : 'row-resize'\n document.body.style.userSelect = 'none'\n },\n [direction, currentSizes, panelCount, gutterSize, panels, minSize, updateSizes, collapsedStates]\n )\n\n const handleKeyDown = useCallback(\n (index: number, e: React.KeyboardEvent) => {\n // Don't allow keyboard resize if either panel is collapsed\n if (collapsedStates[index] || collapsedStates[index + 1]) {\n return\n }\n\n const step = e.shiftKey ? 10 : 1\n let delta = 0\n\n if (direction === 'horizontal') {\n if (e.key === 'ArrowLeft') delta = -step\n else if (e.key === 'ArrowRight') delta = step\n } else {\n if (e.key === 'ArrowUp') delta = -step\n else if (e.key === 'ArrowDown') delta = step\n }\n\n if (delta !== 0) {\n e.preventDefault()\n const newSizes = [...currentSizes]\n const minPercent = 5 // Minimum 5% when using keyboard\n\n let newSize1 = newSizes[index] + delta\n let newSize2 = newSizes[index + 1] - delta\n\n if (newSize1 >= minPercent && newSize2 >= minPercent) {\n newSizes[index] = newSize1\n newSizes[index + 1] = newSize2\n updateSizes(newSizes)\n }\n }\n },\n [direction, currentSizes, updateSizes, collapsedStates]\n )\n\n const isHorizontal = direction === 'horizontal'\n\n // Determine if gutter should show collapse buttons\n const getCollapseConfig = (index: number) => {\n const panel1 = panels[index]\n const panel2 = panels[index + 1]\n const panel1Collapsible = panel1?.props.collapsible\n const panel2Collapsible = panel2?.props.collapsible\n const panel1Collapsed = collapsedStates[index]\n const panel2Collapsed = collapsedStates[index + 1]\n\n return {\n showStart: panel1Collapsible && !panel2Collapsed,\n showEnd: panel2Collapsible && !panel1Collapsed,\n panel1Collapsed,\n panel2Collapsed,\n }\n }\n\n return (\n <div\n ref={containerRef}\n className={`flex ${isHorizontal ? 'flex-row' : 'flex-col'} h-full w-full ${className}`}\n >\n {panels.map((panel, index) => {\n const panelProps = panel.props\n const isLast = index === panels.length - 1\n const isCollapsed = collapsedStates[index]\n const canResize = panelProps.resizable !== false && !isCollapsed\n\n return (\n <React.Fragment key={index}>\n <div\n ref={(el) => {\n panelsRef.current[index] = el\n }}\n className={`overflow-auto ${panelProps.className || ''}`}\n style={{\n [isHorizontal ? 'width' : 'height']: isCollapsed\n ? '0px'\n : `calc(${currentSizes[index]}% - ${((panelCount - 1) * gutterSize) / panelCount}px)`,\n flexShrink: 0,\n overflow: isCollapsed ? 'hidden' : 'auto',\n }}\n data-collapsed={isCollapsed}\n >\n {panelProps.children}\n </div>\n {!isLast && (\n <div\n role=\"separator\"\n aria-orientation={isHorizontal ? 'vertical' : 'horizontal'}\n aria-valuenow={Math.round(currentSizes[index])}\n tabIndex={canResize ? 0 : -1}\n className={`\n flex-shrink-0 ${dBgBase300} transition-colors duration-150 relative group\n ${canResize ? `${dHoverBgPrimary}/30 active:${dBgPrimary}/50` : ''}\n ${canResize ? (isHorizontal ? 'cursor-col-resize' : 'cursor-row-resize') : 'cursor-default'}\n `}\n style={{\n [isHorizontal ? 'width' : 'height']: `${gutterSize}px`,\n }}\n onMouseDown={(e) => handleMouseDown(index, e)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n >\n {/* Collapse buttons */}\n {(() => {\n const { showStart, showEnd, panel1Collapsed, panel2Collapsed } = getCollapseConfig(index)\n\n if (!showStart && !showEnd) {\n // Just show grip indicator\n return (\n <div\n className={`\n absolute inset-0 flex items-center justify-center\n ${isHorizontal ? 'flex-col gap-0.5' : 'flex-row gap-0.5'}\n `}\n >\n <div className={`w-1 h-1 ${dRoundedFull} ${dTextBaseContent}/30 ${dGroupHoverBgPrimary}/60`} />\n <div className={`w-1 h-1 ${dRoundedFull} ${dTextBaseContent}/30 ${dGroupHoverBgPrimary}/60`} />\n <div className={`w-1 h-1 ${dRoundedFull} ${dTextBaseContent}/30 ${dGroupHoverBgPrimary}/60`} />\n </div>\n )\n }\n\n return (\n <div\n className={`\n absolute inset-0 flex items-center justify-center\n ${isHorizontal ? 'flex-col' : 'flex-row'}\n `}\n >\n {showStart && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n toggleCollapse(index)\n }}\n className={`\n p-0.5 ${dRounded} ${dHoverBgBaseContent}/20 transition-colors\n ${isHorizontal ? '' : ''}\n `}\n aria-label={panel1Collapsed ? 'Expand panel' : 'Collapse panel'}\n >\n <svg\n className={`w-3 h-3 ${dTextBaseContent}/50 ${dHoverTextBaseContent} transition-transform ${\n panel1Collapsed\n ? isHorizontal ? 'rotate-180' : '-rotate-90'\n : isHorizontal ? 'rotate-0' : 'rotate-90'\n }`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )}\n {showEnd && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n toggleCollapse(index + 1)\n }}\n className={`\n p-0.5 ${dRounded} ${dHoverBgBaseContent}/20 transition-colors\n `}\n aria-label={panel2Collapsed ? 'Expand panel' : 'Collapse panel'}\n >\n <svg\n className={`w-3 h-3 ${dTextBaseContent}/50 ${dHoverTextBaseContent} transition-transform ${\n panel2Collapsed\n ? isHorizontal ? 'rotate-0' : 'rotate-90'\n : isHorizontal ? 'rotate-180' : '-rotate-90'\n }`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )}\n </div>\n )\n })()}\n </div>\n )}\n </React.Fragment>\n )\n })}\n </div>\n )\n}\n\nSplitter.Panel = Panel\n"],"names":["dBgBase300","dBgPrimary","dTextBaseContent","dHoverBgPrimary","dHoverTextBaseContent","dGroupHoverBgPrimary","dHoverBgBaseContent","dRounded","dRoundedFull","Panel","children","Splitter","direction","sizes","defaultSizes","onSizesChange","gutterSize","minSize","className","containerRef","useRef","panelsRef","draggingRef","panels","React","child","panelCount","collapsedStates","setCollapsedStates","useState","panel","sizesBeforeCollapseRef","getInitialSizes","useCallback","panelDefaultSizes","hasAnyPanelSize","definedTotal","sum","s","undefinedCount","remainingSize","sizePerUndefined","equalSize","internalSizes","setInternalSizes","getControlledSizes","panelSizes","i","currentSizes","useEffect","newCollapsedStates","p","updateSizes","newSizes","toggleCollapse","panelIndex","newCollapsed","collapsedSize","sizeToRedistribute","otherPanels","_","sizePerPanel","previousSize","totalOtherSize","proportion","handleMouseDown","index","e","panel1Props","panel2Props","startPos","handleMouseMove","moveEvent","dragIndex","dragStartPos","startSizes","containerRect","containerSize","currentPos","totalGutterSize","availableSize","deltaPercent","minSize1","minSize2","minPercent1","minPercent2","newSize1","newSize2","maxSize1","maxSize2","maxPercent1","maxPercent2","handleMouseUp","handleKeyDown","step","delta","minPercent","isHorizontal","getCollapseConfig","panel1","panel2","panel1Collapsible","panel2Collapsible","panel1Collapsed","panel2Collapsed","jsx","panelProps","isLast","isCollapsed","canResize","jsxs","el","showStart","showEnd"],"mappings":";;AAGA,MAAMA,KAAa,iBACbC,KAAa,gBACbC,IAAmB,uBACnBC,KAAkB,sBAClBC,KAAwB,6BACxBC,IAAuB,4BACvBC,KAAsB,2BACtBC,KAAW,aACXC,IAAe,kBA2BfC,KAAsC,CAAC,EAAE,UAAAC,gCACnC,UAAAA,GAAS,GAGRC,KAA8D,CAAC;AAAA,EAC1E,UAAAD;AAAA,EACA,WAAAE,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,WAAAC,KAAY;AACd,MAAM;AACJ,QAAMC,IAAeC,EAAuB,IAAI,GAC1CC,KAAYD,EAAkC,EAAE,GAChDE,IAAcF,EAAyE,IAAI,GAG3FG,IAASC,EAAM,SAAS,QAAQd,CAAQ,EAAE;AAAA,IAC9C,CAACe,MACCD,EAAM,eAAeC,CAAK;AAAA,EAAA,GAGxBC,IAAaH,EAAO,QAGpB,CAACI,GAAiBC,CAAkB,IAAIC;AAAA,IAAoB,MAChEN,EAAO,IAAI,CAACO,MAAUA,EAAM,MAAM,oBAAoBA,EAAM,MAAM,aAAa,EAAK;AAAA,EAAA,GAIhFC,IAAyBX,EAAiB,EAAE,GAG5CY,IAAkBC,EAAY,MAAM;AAExC,UAAMC,IAAoBX,EAAO,IAAI,CAACO,MAAUA,EAAM,MAAM,WAAW,GACjEK,IAAkBD,EAAkB,KAAK,CAAC,MAAM,MAAM,MAAS;AAErE,QAAIpB,KAAgBA,EAAa,WAAWY;AAC1C,aAAOZ;AAGT,QAAIqB,GAAiB;AAEnB,YAAMC,IAAeF,EAAkB,OAAe,CAACG,GAAKC,MAAMD,KAAOC,KAAK,IAAI,CAAC,GAC7EC,IAAiBL,EAAkB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,EAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,kBAAA,CAAkB;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACzF;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAIR,GAAA;AAAA,YAAG;AAAA,UAAA;AAAA,QACL,EAAA,GArHiBvC,CAuHrB;AAAA,MAEJ,CAAC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAvD,GAAS,QAAQF;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
vertical?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
value?: React.ReactNode;
|
|
9
|
+
desc?: React.ReactNode;
|
|
10
|
+
figure?: React.ReactNode;
|
|
11
|
+
actions?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare function StatsRoot({ children, className, vertical, ...rest }: StatsProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function StatItem({ title, value, desc, figure, actions, className, ...rest }: StatProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Stats: typeof StatsRoot & {
|
|
16
|
+
Stat: typeof StatItem;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
const l = "d-stats", r = "d-stats-horizontal", S = "d-stats-vertical", m = "d-stat", v = "d-stat-figure", h = "d-stat-title", N = "d-stat-value", u = "d-stat-desc", f = "d-stat-actions";
|
|
3
|
+
function j({ children: s, className: a = "", vertical: c = !1, ...d }) {
|
|
4
|
+
const n = [
|
|
5
|
+
l,
|
|
6
|
+
c ? S : r,
|
|
7
|
+
a
|
|
8
|
+
].filter(Boolean).join(" ");
|
|
9
|
+
return /* @__PURE__ */ t("div", { className: n, ...d, children: s });
|
|
10
|
+
}
|
|
11
|
+
function x({ title: s, value: a, desc: c, figure: d, actions: n, className: e = "", ...i }) {
|
|
12
|
+
return /* @__PURE__ */ o("div", { className: `${m} ${e}`, ...i, children: [
|
|
13
|
+
d && /* @__PURE__ */ t("div", { className: v, children: d }),
|
|
14
|
+
s && /* @__PURE__ */ t("div", { className: h, children: s }),
|
|
15
|
+
a && /* @__PURE__ */ t("div", { className: N, children: a }),
|
|
16
|
+
c && /* @__PURE__ */ t("div", { className: u, children: c }),
|
|
17
|
+
n && /* @__PURE__ */ t("div", { className: f, children: n })
|
|
18
|
+
] });
|
|
19
|
+
}
|
|
20
|
+
const p = Object.assign(j, {
|
|
21
|
+
Stat: x
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
p as Stats
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=Stat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stat.js","sources":["../../src/components/Stat.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dStats = 'd-stats'\nconst dStatsHorizontal = 'd-stats-horizontal'\nconst dStatsVertical = 'd-stats-vertical'\nconst dStat = 'd-stat'\nconst dStatFigure = 'd-stat-figure'\nconst dStatTitle = 'd-stat-title'\nconst dStatValue = 'd-stat-value'\nconst dStatDesc = 'd-stat-desc'\nconst dStatActions = 'd-stat-actions'\n\nexport interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n vertical?: boolean\n}\n\nexport interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: React.ReactNode\n value?: React.ReactNode\n desc?: React.ReactNode\n figure?: React.ReactNode\n actions?: React.ReactNode\n}\n\nfunction StatsRoot({ children, className = '', vertical = false, ...rest }: StatsProps) {\n const classes = [\n dStats,\n vertical ? dStatsVertical : dStatsHorizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n\nfunction StatItem({ title, value, desc, figure, actions, className = '', ...rest }: StatProps) {\n return (\n <div className={`${dStat} ${className}`} {...rest}>\n {figure && <div className={dStatFigure}>{figure}</div>}\n {title && <div className={dStatTitle}>{title}</div>}\n {value && <div className={dStatValue}>{value}</div>}\n {desc && <div className={dStatDesc}>{desc}</div>}\n {actions && <div className={dStatActions}>{actions}</div>}\n </div>\n )\n}\n\nexport const Stats = Object.assign(StatsRoot, {\n Stat: StatItem,\n})\n"],"names":["dStats","dStatsHorizontal","dStatsVertical","dStat","dStatFigure","dStatTitle","dStatValue","dStatDesc","dStatActions","StatsRoot","children","className","vertical","rest","classes","StatItem","title","value","desc","figure","actions","jsxs","jsx","Stats"],"mappings":";AAGA,MAAMA,IAAS,WACTC,IAAmB,sBACnBC,IAAiB,oBACjBC,IAAQ,UACRC,IAAc,iBACdC,IAAa,gBACbC,IAAa,gBACbC,IAAY,eACZC,IAAe;AAerB,SAASC,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,UAAAC,IAAW,IAAO,GAAGC,KAAoB;AACtF,QAAMC,IAAU;AAAA,IACdd;AAAA,IACAY,IAAWV,IAAiBD;AAAA,IAC5BU;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWG,GAAU,GAAGD,GAAO,UAAAH,GAAS;AACtD;AAEA,SAASK,EAAS,EAAE,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,SAAAC,GAAS,WAAAT,IAAY,IAAI,GAAGE,KAAmB;AAC7F,SACE,gBAAAQ,EAAC,SAAI,WAAW,GAAGlB,CAAK,IAAIQ,CAAS,IAAK,GAAGE,GAC1C,UAAA;AAAA,IAAAM,KAAU,gBAAAG,EAAC,OAAA,EAAI,WAAWlB,GAAc,UAAAe,GAAO;AAAA,IAC/CH,KAAS,gBAAAM,EAAC,OAAA,EAAI,WAAWjB,GAAa,UAAAW,GAAM;AAAA,IAC5CC,KAAS,gBAAAK,EAAC,OAAA,EAAI,WAAWhB,GAAa,UAAAW,GAAM;AAAA,IAC5CC,KAAQ,gBAAAI,EAAC,OAAA,EAAI,WAAWf,GAAY,UAAAW,GAAK;AAAA,IACzCE,KAAW,gBAAAE,EAAC,OAAA,EAAI,WAAWd,GAAe,UAAAY,EAAA,CAAQ;AAAA,EAAA,GACrD;AAEJ;AAEO,MAAMG,IAAQ,OAAO,OAAOd,GAAW;AAAA,EAC5C,MAAMM;AACR,CAAC;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type StatusType = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type StatusSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export interface StatusProps {
|
|
5
|
+
/** Status color type */
|
|
6
|
+
type?: StatusType;
|
|
7
|
+
/** Status size */
|
|
8
|
+
size?: StatusSize;
|
|
9
|
+
/** Ping animation effect */
|
|
10
|
+
ping?: boolean;
|
|
11
|
+
/** Bounce animation effect */
|
|
12
|
+
bounce?: boolean;
|
|
13
|
+
/** Accessibility label */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Additional CSS classes */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const Status: React.FC<StatusProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
const o = "d-status", i = "d-status-neutral", l = "d-status-primary", m = "d-status-secondary", S = "d-status-accent", g = "d-status-info", f = "d-status-success", x = "d-status-warning", y = "d-status-error", p = "d-status-xs", $ = "d-status-sm", N = "d-status-md", v = "d-status-lg", b = "d-status-xl", C = {
|
|
3
|
+
neutral: i,
|
|
4
|
+
primary: l,
|
|
5
|
+
secondary: m,
|
|
6
|
+
accent: S,
|
|
7
|
+
info: g,
|
|
8
|
+
success: f,
|
|
9
|
+
warning: x,
|
|
10
|
+
error: y
|
|
11
|
+
}, j = {
|
|
12
|
+
xs: p,
|
|
13
|
+
sm: $,
|
|
14
|
+
md: N,
|
|
15
|
+
lg: v,
|
|
16
|
+
xl: b
|
|
17
|
+
}, X = ({
|
|
18
|
+
type: n = "neutral",
|
|
19
|
+
size: d = "md",
|
|
20
|
+
ping: c = !1,
|
|
21
|
+
bounce: r = !1,
|
|
22
|
+
label: a,
|
|
23
|
+
className: u = ""
|
|
24
|
+
}) => {
|
|
25
|
+
const s = `${o} ${C[n]} ${j[d]} ${r ? "animate-bounce" : ""} ${u}`.trim();
|
|
26
|
+
return c ? /* @__PURE__ */ e("div", { className: "inline-grid *:[grid-area:1/1]", "aria-label": a, children: [
|
|
27
|
+
/* @__PURE__ */ t("div", { className: `${s} animate-ping` }),
|
|
28
|
+
/* @__PURE__ */ t("div", { className: s })
|
|
29
|
+
] }) : /* @__PURE__ */ t("div", { className: s, "aria-label": a });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
X as Status
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Status.js","sources":["../../src/components/Status.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dStatus = 'd-status'\nconst dStatusNeutral = 'd-status-neutral'\nconst dStatusPrimary = 'd-status-primary'\nconst dStatusSecondary = 'd-status-secondary'\nconst dStatusAccent = 'd-status-accent'\nconst dStatusInfo = 'd-status-info'\nconst dStatusSuccess = 'd-status-success'\nconst dStatusWarning = 'd-status-warning'\nconst dStatusError = 'd-status-error'\nconst dStatusXs = 'd-status-xs'\nconst dStatusSm = 'd-status-sm'\nconst dStatusMd = 'd-status-md'\nconst dStatusLg = 'd-status-lg'\nconst dStatusXl = 'd-status-xl'\n\nexport type StatusType = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\nexport type StatusSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface StatusProps {\n /** Status color type */\n type?: StatusType\n /** Status size */\n size?: StatusSize\n /** Ping animation effect */\n ping?: boolean\n /** Bounce animation effect */\n bounce?: boolean\n /** Accessibility label */\n label?: string\n /** Additional CSS classes */\n className?: string\n}\n\nconst typeClasses: Record<StatusType, string> = {\n neutral: dStatusNeutral,\n primary: dStatusPrimary,\n secondary: dStatusSecondary,\n accent: dStatusAccent,\n info: dStatusInfo,\n success: dStatusSuccess,\n warning: dStatusWarning,\n error: dStatusError,\n}\n\nconst sizeClasses: Record<StatusSize, string> = {\n xs: dStatusXs,\n sm: dStatusSm,\n md: dStatusMd,\n lg: dStatusLg,\n xl: dStatusXl,\n}\n\nexport const Status: React.FC<StatusProps> = ({\n type = 'neutral',\n size = 'md',\n ping = false,\n bounce = false,\n label,\n className = '',\n}) => {\n const baseClasses = `${dStatus} ${typeClasses[type]} ${sizeClasses[size]} ${bounce ? 'animate-bounce' : ''} ${className}`.trim()\n\n if (ping) {\n return (\n <div className=\"inline-grid *:[grid-area:1/1]\" aria-label={label}>\n <div className={`${baseClasses} animate-ping`} />\n <div className={baseClasses} />\n </div>\n )\n }\n\n return <div className={baseClasses} aria-label={label} />\n}\n"],"names":["dStatus","dStatusNeutral","dStatusPrimary","dStatusSecondary","dStatusAccent","dStatusInfo","dStatusSuccess","dStatusWarning","dStatusError","dStatusXs","dStatusSm","dStatusMd","dStatusLg","dStatusXl","typeClasses","sizeClasses","Status","type","size","ping","bounce","label","className","baseClasses","jsxs","jsx"],"mappings":";AAGA,MAAMA,IAAU,YACVC,IAAiB,oBACjBC,IAAiB,oBACjBC,IAAmB,sBACnBC,IAAgB,mBAChBC,IAAc,iBACdC,IAAiB,oBACjBC,IAAiB,oBACjBC,IAAe,kBACfC,IAAY,eACZC,IAAY,eACZC,IAAY,eACZC,IAAY,eACZC,IAAY,eAoBZC,IAA0C;AAAA,EAC9C,SAASb;AAAA,EACT,SAASC;AAAA,EACT,WAAWC;AAAA,EACX,QAAQC;AAAA,EACR,MAAMC;AAAA,EACN,SAASC;AAAA,EACT,SAASC;AAAA,EACT,OAAOC;AACT,GAEMO,IAA0C;AAAA,EAC9C,IAAIN;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAIC;AACN,GAEaG,IAAgC,CAAC;AAAA,EAC5C,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAAc,GAAGvB,CAAO,IAAIc,EAAYG,CAAI,CAAC,IAAIF,EAAYG,CAAI,CAAC,IAAIE,IAAS,mBAAmB,EAAE,IAAIE,CAAS,GAAG,KAAA;AAE1H,SAAIH,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,iCAAgC,cAAYH,GACzD,UAAA;AAAA,IAAA,gBAAAI,EAAC,OAAA,EAAI,WAAW,GAAGF,CAAW,iBAAiB;AAAA,IAC/C,gBAAAE,EAAC,OAAA,EAAI,WAAWF,EAAA,CAAa;AAAA,EAAA,GAC/B,IAIG,gBAAAE,EAAC,OAAA,EAAI,WAAWF,GAAa,cAAYF,GAAO;AACzD;"}
|