@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":"Empty.js","sources":["../../src/components/Empty.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { useComponentLocale } from './ConfigProvider'\n\nexport interface EmptyProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Extra content like buttons or actions */\n children?: React.ReactNode\n /** Text or node to display as description */\n description?: React.ReactNode\n /** Custom image or icon; set to null to hide */\n image?: React.ReactNode\n /** Styling applied to the image container */\n imageStyle?: React.CSSProperties\n /** Test ID for the component */\n 'data-testid'?: string\n}\n\nconst DefaultEmptyImage: React.FC = () => (\n <svg\n width=\"184\"\n height=\"152\"\n viewBox=\"0 0 184 152\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"mx-auto\"\n aria-hidden=\"true\"\n >\n <g fill=\"none\" fillRule=\"evenodd\">\n <g transform=\"translate(24 31.67)\">\n <ellipse\n className=\"fill-base-300\"\n cx=\"67.797\"\n cy=\"106.89\"\n rx=\"67.797\"\n ry=\"12.668\"\n />\n <path\n className=\"fill-base-200\"\n d=\"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z\"\n />\n <path\n className=\"fill-base-100\"\n d=\"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z\"\n transform=\"translate(13.56)\"\n />\n <ellipse\n className=\"fill-base-300\"\n cx=\"67.797\"\n cy=\"106.89\"\n rx=\"67.797\"\n ry=\"12.668\"\n />\n <path\n className=\"fill-base-200\"\n d=\"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z\"\n />\n <path\n className=\"fill-base-content opacity-10\"\n d=\"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z\"\n />\n <path\n className=\"fill-base-100\"\n d=\"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z\"\n />\n </g>\n <path\n className=\"fill-base-content opacity-10\"\n d=\"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z\"\n />\n <g className=\"fill-base-100\" transform=\"translate(149.65 15.383)\">\n <ellipse cx=\"20.654\" cy=\"3.167\" rx=\"2.849\" ry=\"2.815\" />\n <path d=\"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z\" />\n </g>\n </g>\n </svg>\n)\n\n// Simple/minimal empty image (matches Ant Design's PRESENTED_IMAGE_SIMPLE)\nconst SimpleEmptyImage: React.FC = () => (\n <svg\n width=\"64\"\n height=\"41\"\n viewBox=\"0 0 64 41\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"mx-auto\"\n aria-hidden=\"true\"\n >\n <g transform=\"translate(0 1)\" fill=\"none\" fillRule=\"evenodd\">\n <ellipse className=\"fill-base-300\" cx=\"32\" cy=\"33\" rx=\"32\" ry=\"7\" />\n <g fillRule=\"nonzero\" className=\"stroke-base-content/20\">\n <path d=\"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z\" />\n <path\n d=\"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z\"\n className=\"fill-base-200\"\n />\n </g>\n </g>\n </svg>\n)\n\nconst EmptyRoot = forwardRef<HTMLDivElement, EmptyProps>(\n (\n {\n children,\n className = '',\n description,\n image,\n imageStyle,\n 'data-testid': testId = 'empty',\n ...rest\n },\n ref\n ) => {\n const locale = useComponentLocale('Empty')\n const displayDescription = description ?? locale.description\n\n const classes = ['flex flex-col items-center justify-center py-8 px-4', className]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n ref={ref}\n className={classes}\n role=\"status\"\n aria-label={typeof displayDescription === 'string' ? displayDescription : 'Empty'}\n data-testid={testId}\n {...rest}\n >\n {image !== null && (\n <div className=\"mb-2\" style={imageStyle} data-testid={`${testId}-image`}>\n {image === undefined ? <DefaultEmptyImage /> : image}\n </div>\n )}\n {displayDescription && (\n <div className=\"text-base-content/60 text-sm mb-4\" data-testid={`${testId}-description`}>\n {displayDescription}\n </div>\n )}\n {children && (\n <div className=\"mt-2\" data-testid={`${testId}-footer`}>\n {children}\n </div>\n )}\n </div>\n )\n }\n)\n\nEmptyRoot.displayName = 'Empty'\n\n// Export with static image constants (like Ant Design)\nexport const Empty = Object.assign(EmptyRoot, {\n PRESENTED_IMAGE_DEFAULT: <DefaultEmptyImage />,\n PRESENTED_IMAGE_SIMPLE: <SimpleEmptyImage />,\n})\n"],"names":["DefaultEmptyImage","jsx","jsxs","SimpleEmptyImage","EmptyRoot","forwardRef","children","className","description","image","imageStyle","testId","rest","ref","locale","useComponentLocale","displayDescription","classes","Empty"],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FieldsetLegendProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FieldsetLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function FieldsetRoot({ children, className, ...props }: FieldsetProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function FieldsetLegend({ children, className }: FieldsetLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function FieldsetLabel({ children, className, ...props }: FieldsetLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const Fieldset: typeof FieldsetRoot & {
|
|
18
|
+
Legend: typeof FieldsetLegend;
|
|
19
|
+
Label: typeof FieldsetLabel;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
const d = "d-fieldset", i = "d-fieldset-legend", o = "d-fieldset-label";
|
|
3
|
+
function a({ children: e, className: s = "", ...l }) {
|
|
4
|
+
const t = [d, s].filter(Boolean).join(" ");
|
|
5
|
+
return /* @__PURE__ */ n("fieldset", { className: t, ...l, children: e });
|
|
6
|
+
}
|
|
7
|
+
function c({ children: e, className: s = "" }) {
|
|
8
|
+
return /* @__PURE__ */ n("legend", { className: `${i} ${s}`, children: e });
|
|
9
|
+
}
|
|
10
|
+
function r({ children: e, className: s = "", ...l }) {
|
|
11
|
+
const t = [o, s].filter(Boolean).join(" ");
|
|
12
|
+
return /* @__PURE__ */ n("label", { className: t, ...l, children: e });
|
|
13
|
+
}
|
|
14
|
+
const F = Object.assign(a, {
|
|
15
|
+
Legend: c,
|
|
16
|
+
Label: r
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
F as Fieldset
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Fieldset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fieldset.js","sources":["../../src/components/Fieldset.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dFieldset = 'd-fieldset'\nconst dFieldsetLegend = 'd-fieldset-legend'\nconst dFieldsetLabel = 'd-fieldset-label'\n\nexport interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {\n children: React.ReactNode\n className?: string\n}\n\nexport interface FieldsetLegendProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface FieldsetLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children: React.ReactNode\n className?: string\n}\n\nfunction FieldsetRoot({ children, className = '', ...props }: FieldsetProps) {\n const classes = [dFieldset, className].filter(Boolean).join(' ')\n\n return (\n <fieldset className={classes} {...props}>\n {children}\n </fieldset>\n )\n}\n\nfunction FieldsetLegend({ children, className = '' }: FieldsetLegendProps) {\n return <legend className={`${dFieldsetLegend} ${className}`}>{children}</legend>\n}\n\nfunction FieldsetLabel({ children, className = '', ...props }: FieldsetLabelProps) {\n const classes = [dFieldsetLabel, className].filter(Boolean).join(' ')\n return <label className={classes} {...props}>{children}</label>\n}\n\nexport const Fieldset = Object.assign(FieldsetRoot, {\n Legend: FieldsetLegend,\n Label: FieldsetLabel,\n})\n"],"names":["dFieldset","dFieldsetLegend","dFieldsetLabel","FieldsetRoot","children","className","props","classes","FieldsetLegend","jsx","FieldsetLabel","Fieldset"],"mappings":";AAGA,MAAMA,IAAY,cACZC,IAAkB,qBAClBC,IAAiB;AAiBvB,SAASC,EAAa,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAAwB;AAC3E,QAAMC,IAAU,CAACP,GAAWK,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE/D,2BACG,YAAA,EAAS,WAAWE,GAAU,GAAGD,GAC/B,UAAAF,GACH;AAEJ;AAEA,SAASI,EAAe,EAAE,UAAAJ,GAAU,WAAAC,IAAY,MAA2B;AACzE,SAAO,gBAAAI,EAAC,YAAO,WAAW,GAAGR,CAAe,IAAII,CAAS,IAAK,UAAAD,GAAS;AACzE;AAEA,SAASM,EAAc,EAAE,UAAAN,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAA6B;AACjF,QAAMC,IAAU,CAACL,GAAgBG,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACpE,2BAAQ,SAAA,EAAM,WAAWE,GAAU,GAAGD,GAAQ,UAAAF,GAAS;AACzD;AAEO,MAAMO,IAAW,OAAO,OAAOR,GAAc;AAAA,EAClD,QAAQK;AAAA,EACR,OAAOE;AACT,CAAC;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
|
|
3
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
ghost?: boolean;
|
|
6
|
+
bordered?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I } from "react";
|
|
3
|
+
import { useConfig as m } from "./ConfigProvider.js";
|
|
4
|
+
const F = "d-file-input", g = "d-file-input-xs", y = "d-file-input-sm", x = "d-file-input-md", S = "d-file-input-lg", w = "d-file-input-xl", C = "d-file-input-neutral", z = "d-file-input-primary", N = "d-file-input-secondary", h = "d-file-input-accent", j = "d-file-input-info", X = "d-file-input-success", v = "d-file-input-warning", A = "d-file-input-error", e = "d-file-input-ghost", B = I(
|
|
5
|
+
({ size: i, color: n, ghost: s = !1, bordered: l = !0, className: o = "", ...u }, p) => {
|
|
6
|
+
const { componentSize: c } = m(), t = i ?? c ?? "md", d = {
|
|
7
|
+
xs: g,
|
|
8
|
+
sm: y,
|
|
9
|
+
md: x,
|
|
10
|
+
lg: S,
|
|
11
|
+
xl: w
|
|
12
|
+
}, r = {
|
|
13
|
+
neutral: C,
|
|
14
|
+
primary: z,
|
|
15
|
+
secondary: N,
|
|
16
|
+
accent: h,
|
|
17
|
+
info: j,
|
|
18
|
+
success: X,
|
|
19
|
+
warning: v,
|
|
20
|
+
error: A
|
|
21
|
+
}, f = [
|
|
22
|
+
F,
|
|
23
|
+
"w-full",
|
|
24
|
+
// In DaisyUI 5, borders are on by default. Use ghost to remove them.
|
|
25
|
+
!l && e,
|
|
26
|
+
s && e,
|
|
27
|
+
t && d[t],
|
|
28
|
+
n && r[n],
|
|
29
|
+
o
|
|
30
|
+
].filter(Boolean).join(" ");
|
|
31
|
+
return /* @__PURE__ */ a("input", { ref: p, type: "file", className: f, ...u });
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
B.displayName = "FileInput";
|
|
35
|
+
export {
|
|
36
|
+
B as FileInput
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=FileInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileInput.js","sources":["../../src/components/FileInput.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { useConfig } from './ConfigProvider'\n\n// DaisyUI classes\nconst dFileInput = 'd-file-input'\nconst dFileInputXs = 'd-file-input-xs'\nconst dFileInputSm = 'd-file-input-sm'\nconst dFileInputMd = 'd-file-input-md'\nconst dFileInputLg = 'd-file-input-lg'\nconst dFileInputXl = 'd-file-input-xl'\nconst dFileInputNeutral = 'd-file-input-neutral'\nconst dFileInputPrimary = 'd-file-input-primary'\nconst dFileInputSecondary = 'd-file-input-secondary'\nconst dFileInputAccent = 'd-file-input-accent'\nconst dFileInputInfo = 'd-file-input-info'\nconst dFileInputSuccess = 'd-file-input-success'\nconst dFileInputWarning = 'd-file-input-warning'\nconst dFileInputError = 'd-file-input-error'\nconst dFileInputGhost = 'd-file-input-ghost'\n\nexport interface FileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n ghost?: boolean\n bordered?: boolean\n className?: string\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(\n ({ size, color, ghost = false, bordered = true, className = '', ...props }, ref) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const sizeClasses = {\n xs: dFileInputXs,\n sm: dFileInputSm,\n md: dFileInputMd,\n lg: dFileInputLg,\n xl: dFileInputXl,\n }\n\n const colorClasses = {\n neutral: dFileInputNeutral,\n primary: dFileInputPrimary,\n secondary: dFileInputSecondary,\n accent: dFileInputAccent,\n info: dFileInputInfo,\n success: dFileInputSuccess,\n warning: dFileInputWarning,\n error: dFileInputError,\n }\n\n const fileInputClasses = [\n dFileInput,\n 'w-full',\n // In DaisyUI 5, borders are on by default. Use ghost to remove them.\n !bordered && dFileInputGhost,\n ghost && dFileInputGhost,\n effectiveSize && sizeClasses[effectiveSize],\n color && colorClasses[color],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <input ref={ref} type=\"file\" className={fileInputClasses} {...props} />\n }\n)\n\nFileInput.displayName = 'FileInput'\n"],"names":["dFileInput","dFileInputXs","dFileInputSm","dFileInputMd","dFileInputLg","dFileInputXl","dFileInputNeutral","dFileInputPrimary","dFileInputSecondary","dFileInputAccent","dFileInputInfo","dFileInputSuccess","dFileInputWarning","dFileInputError","dFileInputGhost","FileInput","forwardRef","size","color","ghost","bordered","className","props","ref","componentSize","useConfig","effectiveSize","sizeClasses","colorClasses","fileInputClasses","jsx"],"mappings":";;;AAIA,MAAMA,IAAa,gBACbC,IAAe,mBACfC,IAAe,mBACfC,IAAe,mBACfC,IAAe,mBACfC,IAAe,mBACfC,IAAoB,wBACpBC,IAAoB,wBACpBC,IAAsB,0BACtBC,IAAmB,uBACnBC,IAAiB,qBACjBC,IAAoB,wBACpBC,IAAoB,wBACpBC,IAAkB,sBAClBC,IAAkB,sBAUXC,IAAYC;AAAA,EACvB,CAAC,EAAE,MAAAC,GAAM,OAAAC,GAAO,OAAAC,IAAQ,IAAO,UAAAC,IAAW,IAAM,WAAAC,IAAY,IAAI,GAAGC,EAAA,GAASC,MAAQ;AAClF,UAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAA,GACpBC,IAAgBT,KAAQO,KAAiB,MAEzCG,IAAc;AAAA,MAClB,IAAI1B;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,IAAA,GAGAuB,IAAe;AAAA,MACnB,SAAStB;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,QAAQC;AAAA,MACR,MAAMC;AAAA,MACN,SAASC;AAAA,MACT,SAASC;AAAA,MACT,OAAOC;AAAA,IAAA,GAGHgB,IAAmB;AAAA,MACvB7B;AAAA,MACA;AAAA;AAAA,MAEA,CAACoB,KAAYN;AAAA,MACbK,KAASL;AAAA,MACTY,KAAiBC,EAAYD,CAAa;AAAA,MAC1CR,KAASU,EAAaV,CAAK;AAAA,MAC3BG;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,WAAO,gBAAAS,EAAC,WAAM,KAAAP,GAAU,MAAK,QAAO,WAAWM,GAAmB,GAAGP,GAAO;AAAA,EAC9E;AACF;AAEAP,EAAU,cAAc;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FilterOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface FilterProps {
|
|
8
|
+
/** Filter options */
|
|
9
|
+
options: (string | FilterOption)[];
|
|
10
|
+
/** Controlled value */
|
|
11
|
+
value?: string;
|
|
12
|
+
/** Default value for uncontrolled mode */
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
/** Change handler */
|
|
15
|
+
onChange?: (value: string | undefined) => void;
|
|
16
|
+
/** Radio group name (auto-generated if not provided) */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** Button size */
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
20
|
+
/** Show reset button */
|
|
21
|
+
showReset?: boolean;
|
|
22
|
+
/** Reset button label */
|
|
23
|
+
resetLabel?: React.ReactNode;
|
|
24
|
+
/** Additional CSS classes for container */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const Filter: React.FC<FilterProps>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as N, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useId as I, useState as R } from "react";
|
|
3
|
+
import { useConfig as $ } from "./ConfigProvider.js";
|
|
4
|
+
const q = "d-filter", d = "d-btn", F = "d-btn-xs", V = "d-btn-sm", X = "d-btn-lg", k = "d-btn-xl", O = "d-btn-square", i = {
|
|
5
|
+
xs: F,
|
|
6
|
+
sm: V,
|
|
7
|
+
md: "",
|
|
8
|
+
lg: X,
|
|
9
|
+
xl: k
|
|
10
|
+
}, G = ({
|
|
11
|
+
options: c,
|
|
12
|
+
value: t,
|
|
13
|
+
defaultValue: m,
|
|
14
|
+
onChange: s,
|
|
15
|
+
name: u,
|
|
16
|
+
size: f,
|
|
17
|
+
showReset: b = !0,
|
|
18
|
+
resetLabel: n = "×",
|
|
19
|
+
className: v = ""
|
|
20
|
+
}) => {
|
|
21
|
+
const { componentSize: g } = $(), l = f ?? g ?? "md", B = I(), p = u || `filter-${B}`, [x, a] = R(m), C = t !== void 0 ? t : x, o = t !== void 0, h = c.map(
|
|
22
|
+
(e) => typeof e == "string" ? { label: e, value: e } : e
|
|
23
|
+
), S = (e) => {
|
|
24
|
+
o || a(e), s?.(e);
|
|
25
|
+
}, j = () => {
|
|
26
|
+
o || a(void 0), s?.(void 0);
|
|
27
|
+
}, y = [d, i[l]].filter(Boolean).join(" "), z = [d, O, i[l]].filter(Boolean).join(" ");
|
|
28
|
+
return /* @__PURE__ */ N("form", { className: `${q} ${v}`.trim(), onReset: j, children: [
|
|
29
|
+
b && /* @__PURE__ */ r(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
className: z,
|
|
33
|
+
type: "reset",
|
|
34
|
+
value: typeof n == "string" ? n : void 0,
|
|
35
|
+
"aria-label": "Reset filter"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
h.map((e) => /* @__PURE__ */ r(
|
|
39
|
+
"input",
|
|
40
|
+
{
|
|
41
|
+
className: y,
|
|
42
|
+
type: "radio",
|
|
43
|
+
name: p,
|
|
44
|
+
value: e.value,
|
|
45
|
+
"aria-label": e.label,
|
|
46
|
+
checked: C === e.value,
|
|
47
|
+
onChange: () => S(e.value),
|
|
48
|
+
disabled: e.disabled
|
|
49
|
+
},
|
|
50
|
+
e.value
|
|
51
|
+
))
|
|
52
|
+
] });
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
G as Filter
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=Filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.js","sources":["../../src/components/Filter.tsx"],"sourcesContent":["import React, { useState, useId } from 'react'\nimport { useConfig } from './ConfigProvider'\n\n// DaisyUI classes\nconst dFilter = 'd-filter'\nconst dBtn = 'd-btn'\nconst dBtnXs = 'd-btn-xs'\nconst dBtnSm = 'd-btn-sm'\nconst dBtnLg = 'd-btn-lg'\nconst dBtnXl = 'd-btn-xl'\nconst dBtnSquare = 'd-btn-square'\n\nexport interface FilterOption {\n label: string\n value: string\n disabled?: boolean\n}\n\nexport interface FilterProps {\n /** Filter options */\n options: (string | FilterOption)[]\n /** Controlled value */\n value?: string\n /** Default value for uncontrolled mode */\n defaultValue?: string\n /** Change handler */\n onChange?: (value: string | undefined) => void\n /** Radio group name (auto-generated if not provided) */\n name?: string\n /** Button size */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Show reset button */\n showReset?: boolean\n /** Reset button label */\n resetLabel?: React.ReactNode\n /** Additional CSS classes for container */\n className?: string\n}\n\nconst sizeClasses: Record<string, string> = {\n xs: dBtnXs,\n sm: dBtnSm,\n md: '',\n lg: dBtnLg,\n xl: dBtnXl,\n}\n\nexport const Filter: React.FC<FilterProps> = ({\n options,\n value,\n defaultValue,\n onChange,\n name,\n size,\n showReset = true,\n resetLabel = '×',\n className = '',\n}) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const autoId = useId()\n const groupName = name || `filter-${autoId}`\n\n const [internalValue, setInternalValue] = useState<string | undefined>(defaultValue)\n const currentValue = value !== undefined ? value : internalValue\n const isControlled = value !== undefined\n\n const normalizedOptions: FilterOption[] = options.map((opt) =>\n typeof opt === 'string' ? { label: opt, value: opt } : opt\n )\n\n const handleChange = (newValue: string) => {\n if (!isControlled) {\n setInternalValue(newValue)\n }\n onChange?.(newValue)\n }\n\n const handleReset = () => {\n if (!isControlled) {\n setInternalValue(undefined)\n }\n onChange?.(undefined)\n }\n\n const buttonClasses = [dBtn, sizeClasses[effectiveSize]].filter(Boolean).join(' ')\n const resetClasses = [dBtn, dBtnSquare, sizeClasses[effectiveSize]].filter(Boolean).join(' ')\n\n return (\n <form className={`${dFilter} ${className}`.trim()} onReset={handleReset}>\n {showReset && (\n <input\n className={resetClasses}\n type=\"reset\"\n value={typeof resetLabel === 'string' ? resetLabel : undefined}\n aria-label=\"Reset filter\"\n />\n )}\n {normalizedOptions.map((option) => (\n <input\n key={option.value}\n className={buttonClasses}\n type=\"radio\"\n name={groupName}\n value={option.value}\n aria-label={option.label}\n checked={currentValue === option.value}\n onChange={() => handleChange(option.value)}\n disabled={option.disabled}\n />\n ))}\n </form>\n )\n}\n"],"names":["dFilter","dBtn","dBtnXs","dBtnSm","dBtnLg","dBtnXl","dBtnSquare","sizeClasses","Filter","options","value","defaultValue","onChange","name","size","showReset","resetLabel","className","componentSize","useConfig","effectiveSize","autoId","useId","groupName","internalValue","setInternalValue","useState","currentValue","isControlled","normalizedOptions","opt","handleChange","newValue","handleReset","buttonClasses","resetClasses","jsxs","jsx","option"],"mappings":";;;AAIA,MAAMA,IAAU,YACVC,IAAO,SACPC,IAAS,YACTC,IAAS,YACTC,IAAS,YACTC,IAAS,YACTC,IAAa,gBA6BbC,IAAsC;AAAA,EAC1C,IAAIL;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAI;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAIC;AACN,GAEaG,IAAgC,CAAC;AAAA,EAC5C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC,IAAY;AACd,MAAM;AACJ,QAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAA,GACpBC,IAAgBN,KAAQI,KAAiB,MAEzCG,IAASC,EAAA,GACTC,IAAYV,KAAQ,UAAUQ,CAAM,IAEpC,CAACG,GAAeC,CAAgB,IAAIC,EAA6Bf,CAAY,GAC7EgB,IAAejB,MAAU,SAAYA,IAAQc,GAC7CI,IAAelB,MAAU,QAEzBmB,IAAoCpB,EAAQ;AAAA,IAAI,CAACqB,MACrD,OAAOA,KAAQ,WAAW,EAAE,OAAOA,GAAK,OAAOA,MAAQA;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAAqB;AACzC,IAAKJ,KACHH,EAAiBO,CAAQ,GAE3BpB,IAAWoB,CAAQ;AAAA,EACrB,GAEMC,IAAc,MAAM;AACxB,IAAKL,KACHH,EAAiB,MAAS,GAE5Bb,IAAW,MAAS;AAAA,EACtB,GAEMsB,IAAgB,CAACjC,GAAMM,EAAYa,CAAa,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAC3Ee,IAAe,CAAClC,GAAMK,GAAYC,EAAYa,CAAa,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE5F,SACE,gBAAAgB,EAAC,QAAA,EAAK,WAAW,GAAGpC,CAAO,IAAIiB,CAAS,GAAG,KAAA,GAAQ,SAASgB,GACzD,UAAA;AAAA,IAAAlB,KACC,gBAAAsB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWF;AAAA,QACX,MAAK;AAAA,QACL,OAAO,OAAOnB,KAAe,WAAWA,IAAa;AAAA,QACrD,cAAW;AAAA,MAAA;AAAA,IAAA;AAAA,IAGda,EAAkB,IAAI,CAACS,MACtB,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWH;AAAA,QACX,MAAK;AAAA,QACL,MAAMX;AAAA,QACN,OAAOe,EAAO;AAAA,QACd,cAAYA,EAAO;AAAA,QACnB,SAASX,MAAiBW,EAAO;AAAA,QACjC,UAAU,MAAMP,EAAaO,EAAO,KAAK;AAAA,QACzC,UAAUA,EAAO;AAAA,MAAA;AAAA,MARZA,EAAO;AAAA,IAAA,CAUf;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
4
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
5
|
+
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
6
|
+
wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
7
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
8
|
+
flex?: '1' | 'auto' | 'initial' | 'none';
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max';
|
|
11
|
+
minWidth?: 'full' | 'fit' | 'min' | 'max';
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Flex: React.FC<FlexProps>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
const y = ({
|
|
3
|
+
direction: t,
|
|
4
|
+
justify: r,
|
|
5
|
+
align: s,
|
|
6
|
+
wrap: m,
|
|
7
|
+
gap: e,
|
|
8
|
+
flex: o,
|
|
9
|
+
inline: a = !1,
|
|
10
|
+
minHeight: l,
|
|
11
|
+
minWidth: f,
|
|
12
|
+
className: x = "",
|
|
13
|
+
style: c,
|
|
14
|
+
children: i,
|
|
15
|
+
...u
|
|
16
|
+
}) => {
|
|
17
|
+
const n = typeof e == "number", w = [
|
|
18
|
+
a ? "inline-flex" : "flex",
|
|
19
|
+
t === "row" && "flex-row",
|
|
20
|
+
t === "column" && "flex-col",
|
|
21
|
+
t === "row-reverse" && "flex-row-reverse",
|
|
22
|
+
t === "column-reverse" && "flex-col-reverse",
|
|
23
|
+
r === "start" && "justify-start",
|
|
24
|
+
r === "end" && "justify-end",
|
|
25
|
+
r === "center" && "justify-center",
|
|
26
|
+
r === "between" && "justify-between",
|
|
27
|
+
r === "around" && "justify-around",
|
|
28
|
+
r === "evenly" && "justify-evenly",
|
|
29
|
+
s === "start" && "items-start",
|
|
30
|
+
s === "end" && "items-end",
|
|
31
|
+
s === "center" && "items-center",
|
|
32
|
+
s === "baseline" && "items-baseline",
|
|
33
|
+
s === "stretch" && "items-stretch",
|
|
34
|
+
m === !0 && "flex-wrap",
|
|
35
|
+
m === "wrap" && "flex-wrap",
|
|
36
|
+
m === "nowrap" && "flex-nowrap",
|
|
37
|
+
m === "wrap-reverse" && "flex-wrap-reverse",
|
|
38
|
+
!n && e === "xs" && "gap-1",
|
|
39
|
+
!n && e === "sm" && "gap-2",
|
|
40
|
+
!n && e === "md" && "gap-4",
|
|
41
|
+
!n && e === "lg" && "gap-6",
|
|
42
|
+
!n && e === "xl" && "gap-8",
|
|
43
|
+
o === "1" && "flex-1",
|
|
44
|
+
o === "auto" && "flex-auto",
|
|
45
|
+
o === "initial" && "flex-initial",
|
|
46
|
+
o === "none" && "flex-none",
|
|
47
|
+
l === "screen" && "min-h-screen",
|
|
48
|
+
l === "full" && "min-h-full",
|
|
49
|
+
l === "fit" && "min-h-fit",
|
|
50
|
+
l === "min" && "min-h-min",
|
|
51
|
+
l === "max" && "min-h-max",
|
|
52
|
+
f === "full" && "min-w-full",
|
|
53
|
+
f === "fit" && "min-w-fit",
|
|
54
|
+
f === "min" && "min-w-min",
|
|
55
|
+
f === "max" && "min-w-max",
|
|
56
|
+
x
|
|
57
|
+
].filter(Boolean).join(" "), p = {
|
|
58
|
+
...c,
|
|
59
|
+
...n ? { gap: `${e}px` } : {}
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ v("div", { className: w, style: p, ...u, children: i });
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
y as Flex
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=Flex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse'\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n flex?: '1' | 'auto' | 'initial' | 'none'\n inline?: boolean\n minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max'\n minWidth?: 'full' | 'fit' | 'min' | 'max'\n children?: React.ReactNode\n}\n\nexport const Flex: React.FC<FlexProps> = ({\n direction,\n justify,\n align,\n wrap,\n gap,\n flex,\n inline = false,\n minHeight,\n minWidth,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericGap = typeof gap === 'number'\n\n const classes = [\n inline ? 'inline-flex' : 'flex',\n direction === 'row' && 'flex-row',\n direction === 'column' && 'flex-col',\n direction === 'row-reverse' && 'flex-row-reverse',\n direction === 'column-reverse' && 'flex-col-reverse',\n justify === 'start' && 'justify-start',\n justify === 'end' && 'justify-end',\n justify === 'center' && 'justify-center',\n justify === 'between' && 'justify-between',\n justify === 'around' && 'justify-around',\n justify === 'evenly' && 'justify-evenly',\n align === 'start' && 'items-start',\n align === 'end' && 'items-end',\n align === 'center' && 'items-center',\n align === 'baseline' && 'items-baseline',\n align === 'stretch' && 'items-stretch',\n wrap === true && 'flex-wrap',\n wrap === 'wrap' && 'flex-wrap',\n wrap === 'nowrap' && 'flex-nowrap',\n wrap === 'wrap-reverse' && 'flex-wrap-reverse',\n !isNumericGap && gap === 'xs' && 'gap-1',\n !isNumericGap && gap === 'sm' && 'gap-2',\n !isNumericGap && gap === 'md' && 'gap-4',\n !isNumericGap && gap === 'lg' && 'gap-6',\n !isNumericGap && gap === 'xl' && 'gap-8',\n flex === '1' && 'flex-1',\n flex === 'auto' && 'flex-auto',\n flex === 'initial' && 'flex-initial',\n flex === 'none' && 'flex-none',\n minHeight === 'screen' && 'min-h-screen',\n minHeight === 'full' && 'min-h-full',\n minHeight === 'fit' && 'min-h-fit',\n minHeight === 'min' && 'min-h-min',\n minHeight === 'max' && 'min-h-max',\n minWidth === 'full' && 'min-w-full',\n minWidth === 'fit' && 'min-w-fit',\n minWidth === 'min' && 'min-w-min',\n minWidth === 'max' && 'min-w-max',\n className,\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericGap ? { gap: `${gap}px` } : {}),\n }\n\n return (\n <div className={classes} style={combinedStyle} {...rest}>\n {children}\n </div>\n )\n}\n"],"names":["Flex","direction","justify","align","wrap","gap","flex","inline","minHeight","minWidth","className","style","children","rest","isNumericGap","classes","combinedStyle","jsx"],"mappings":";AAeO,MAAMA,IAA4B,CAAC;AAAA,EACxC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAe,OAAOT,KAAQ,UAE9BU,IAAU;AAAA,IACdR,IAAS,gBAAgB;AAAA,IACzBN,MAAc,SAAS;AAAA,IACvBA,MAAc,YAAY;AAAA,IAC1BA,MAAc,iBAAiB;AAAA,IAC/BA,MAAc,oBAAoB;AAAA,IAClCC,MAAY,WAAW;AAAA,IACvBA,MAAY,SAAS;AAAA,IACrBA,MAAY,YAAY;AAAA,IACxBA,MAAY,aAAa;AAAA,IACzBA,MAAY,YAAY;AAAA,IACxBA,MAAY,YAAY;AAAA,IACxBC,MAAU,WAAW;AAAA,IACrBA,MAAU,SAAS;AAAA,IACnBA,MAAU,YAAY;AAAA,IACtBA,MAAU,cAAc;AAAA,IACxBA,MAAU,aAAa;AAAA,IACvBC,MAAS,MAAQ;AAAA,IACjBA,MAAS,UAAU;AAAA,IACnBA,MAAS,YAAY;AAAA,IACrBA,MAAS,kBAAkB;AAAA,IAC3B,CAACU,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjCC,MAAS,OAAO;AAAA,IAChBA,MAAS,UAAU;AAAA,IACnBA,MAAS,aAAa;AAAA,IACtBA,MAAS,UAAU;AAAA,IACnBE,MAAc,YAAY;AAAA,IAC1BA,MAAc,UAAU;AAAA,IACxBA,MAAc,SAAS;AAAA,IACvBA,MAAc,SAAS;AAAA,IACvBA,MAAc,SAAS;AAAA,IACvBC,MAAa,UAAU;AAAA,IACvBA,MAAa,SAAS;AAAA,IACtBA,MAAa,SAAS;AAAA,IACtBA,MAAa,SAAS;AAAA,IACtBC;AAAA,EAAA,EACA,OAAO,OAAO,EAAE,KAAK,GAAG,GAEpBM,IAAqC;AAAA,IACzC,GAAGL;AAAA,IACH,GAAIG,IAAe,EAAE,KAAK,GAAGT,CAAG,SAAS,CAAA;AAAA,EAAC;AAG5C,SACE,gBAAAY,EAAC,SAAI,WAAWF,GAAS,OAAOC,GAAgB,GAAGH,GAChD,UAAAD,GACH;AAEJ;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FloatButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
3
|
+
/** Icon to display */
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
/** Description text below icon */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
/** Button type/color */
|
|
8
|
+
type?: 'default' | 'primary';
|
|
9
|
+
/** Button shape */
|
|
10
|
+
shape?: 'circle' | 'square';
|
|
11
|
+
/** Tooltip text */
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
/** Tooltip placement */
|
|
14
|
+
tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';
|
|
15
|
+
/** Badge content */
|
|
16
|
+
badge?: number | React.ReactNode;
|
|
17
|
+
/** Link URL (renders as anchor) */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Link target */
|
|
20
|
+
target?: string;
|
|
21
|
+
/** @deprecated Use icon prop instead */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface FloatButtonGroupProps {
|
|
25
|
+
/** Child FloatButton components */
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/** Arrange buttons in a quarter-circle (radial) layout */
|
|
28
|
+
flower?: boolean;
|
|
29
|
+
/** Button shape for children */
|
|
30
|
+
shape?: 'circle' | 'square';
|
|
31
|
+
/** Main trigger button icon */
|
|
32
|
+
icon?: React.ReactNode;
|
|
33
|
+
/** Main action button that replaces trigger when open (fab-main-action) */
|
|
34
|
+
mainAction?: React.ReactNode;
|
|
35
|
+
/** Click handler for main action button */
|
|
36
|
+
onMainAction?: () => void;
|
|
37
|
+
/** Show close button when open (fab-close) */
|
|
38
|
+
showClose?: boolean;
|
|
39
|
+
/** Button type/color */
|
|
40
|
+
type?: 'default' | 'primary';
|
|
41
|
+
/** Position on screen */
|
|
42
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
43
|
+
/** Distance from edge */
|
|
44
|
+
offset?: number;
|
|
45
|
+
/** Additional CSS classes */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Custom styles */
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
export interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {
|
|
51
|
+
/** Scroll threshold to show button (pixels) */
|
|
52
|
+
visibilityHeight?: number;
|
|
53
|
+
/** Scroll target (default: window) */
|
|
54
|
+
target?: () => HTMLElement | Window;
|
|
55
|
+
/** Click handler (called before scrolling) */
|
|
56
|
+
onClick?: () => void;
|
|
57
|
+
/** Custom icon */
|
|
58
|
+
icon?: React.ReactNode;
|
|
59
|
+
/** Duration of scroll animation in ms */
|
|
60
|
+
duration?: number;
|
|
61
|
+
/** Position on screen */
|
|
62
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
63
|
+
/** Distance from edge in pixels */
|
|
64
|
+
offset?: number;
|
|
65
|
+
/** @deprecated Use icon prop instead */
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
}
|
|
68
|
+
interface FloatButtonComponent extends React.FC<FloatButtonProps> {
|
|
69
|
+
Group: React.FC<FloatButtonGroupProps>;
|
|
70
|
+
BackTop: React.FC<BackTopProps>;
|
|
71
|
+
}
|
|
72
|
+
export declare const FloatButton: FloatButtonComponent;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as j, createContext as z, useState as A, useEffect as R } from "react";
|
|
3
|
+
const f = "d-btn", x = "d-btn-lg", I = "d-btn-circle", U = "d-btn-square", k = "d-btn-neutral", V = "d-btn-primary", Y = "d-tooltip", D = "d-tooltip-left", H = "d-tooltip-right", J = "d-tooltip-top", K = "d-tooltip-bottom", T = "d-indicator", $ = "d-indicator-item", y = "d-badge", L = "d-badge-secondary", O = "d-fab", Q = "d-fab-flower", X = "d-fab-main-action", Z = "d-fab-close", G = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), _ = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }), tt = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), C = z({ inGroup: !1 }), ot = {
|
|
4
|
+
left: D,
|
|
5
|
+
right: H,
|
|
6
|
+
top: J,
|
|
7
|
+
bottom: K
|
|
8
|
+
}, S = {
|
|
9
|
+
default: k,
|
|
10
|
+
primary: V
|
|
11
|
+
}, M = {
|
|
12
|
+
circle: I,
|
|
13
|
+
square: U
|
|
14
|
+
}, F = ({
|
|
15
|
+
icon: d,
|
|
16
|
+
description: l,
|
|
17
|
+
onClick: o,
|
|
18
|
+
type: h = "default",
|
|
19
|
+
shape: u = "circle",
|
|
20
|
+
className: w = "",
|
|
21
|
+
tooltip: a,
|
|
22
|
+
tooltipPlacement: v = "left",
|
|
23
|
+
badge: r,
|
|
24
|
+
href: e,
|
|
25
|
+
target: i,
|
|
26
|
+
children: N,
|
|
27
|
+
style: m,
|
|
28
|
+
...s
|
|
29
|
+
}) => {
|
|
30
|
+
const p = j(C), B = p.inGroup && p.shape || u, n = [
|
|
31
|
+
f,
|
|
32
|
+
x,
|
|
33
|
+
"shadow-lg",
|
|
34
|
+
M[B],
|
|
35
|
+
S[h],
|
|
36
|
+
w
|
|
37
|
+
].filter(Boolean).join(" "), b = d || N || /* @__PURE__ */ t(G, {}), c = /* @__PURE__ */ t(q, { children: l ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center", children: [
|
|
38
|
+
b,
|
|
39
|
+
/* @__PURE__ */ t("span", { className: "text-xs mt-1", children: l })
|
|
40
|
+
] }) : b });
|
|
41
|
+
if (p.inGroup)
|
|
42
|
+
return e ? /* @__PURE__ */ t(
|
|
43
|
+
"a",
|
|
44
|
+
{
|
|
45
|
+
href: e,
|
|
46
|
+
target: i,
|
|
47
|
+
className: n,
|
|
48
|
+
title: a,
|
|
49
|
+
onClick: o,
|
|
50
|
+
...s,
|
|
51
|
+
children: c
|
|
52
|
+
}
|
|
53
|
+
) : /* @__PURE__ */ t("button", { className: n, title: a, onClick: o, ...s, children: c });
|
|
54
|
+
const E = e ? /* @__PURE__ */ t(
|
|
55
|
+
"a",
|
|
56
|
+
{
|
|
57
|
+
href: e,
|
|
58
|
+
target: i,
|
|
59
|
+
className: n,
|
|
60
|
+
style: m,
|
|
61
|
+
onClick: o,
|
|
62
|
+
...s,
|
|
63
|
+
children: c
|
|
64
|
+
}
|
|
65
|
+
) : /* @__PURE__ */ t("button", { className: n, onClick: o, style: m, ...s, children: c }), P = r !== void 0 ? /* @__PURE__ */ g("div", { className: T, style: m, children: [
|
|
66
|
+
/* @__PURE__ */ t("span", { className: `${$} ${y} ${L}`, children: r }),
|
|
67
|
+
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: c }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: c })
|
|
68
|
+
] }) : E;
|
|
69
|
+
return a ? /* @__PURE__ */ t("div", { className: `${Y} ${ot[v]}`, "data-tip": a, style: m, children: r !== void 0 ? /* @__PURE__ */ g("div", { className: T, children: [
|
|
70
|
+
/* @__PURE__ */ t("span", { className: `${$} ${y} ${L}`, children: r }),
|
|
71
|
+
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: c }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: c })
|
|
72
|
+
] }) : e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: c }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: c }) }) : P;
|
|
73
|
+
}, W = (d) => {
|
|
74
|
+
const {
|
|
75
|
+
style: l,
|
|
76
|
+
...o
|
|
77
|
+
} = d;
|
|
78
|
+
if (j(C).inGroup)
|
|
79
|
+
return /* @__PURE__ */ t(F, { ...o });
|
|
80
|
+
const u = {
|
|
81
|
+
position: "fixed",
|
|
82
|
+
zIndex: 1e3,
|
|
83
|
+
bottom: 24,
|
|
84
|
+
right: 24,
|
|
85
|
+
...l
|
|
86
|
+
};
|
|
87
|
+
return /* @__PURE__ */ t(F, { ...o, style: u });
|
|
88
|
+
}, nt = ({
|
|
89
|
+
children: d,
|
|
90
|
+
flower: l = !1,
|
|
91
|
+
shape: o = "circle",
|
|
92
|
+
icon: h,
|
|
93
|
+
mainAction: u,
|
|
94
|
+
onMainAction: w,
|
|
95
|
+
showClose: a = !1,
|
|
96
|
+
type: v = "default",
|
|
97
|
+
position: r = "bottom-right",
|
|
98
|
+
offset: e = 24,
|
|
99
|
+
className: i = "",
|
|
100
|
+
style: N
|
|
101
|
+
}) => {
|
|
102
|
+
const m = [
|
|
103
|
+
O,
|
|
104
|
+
l ? Q : "",
|
|
105
|
+
i
|
|
106
|
+
].filter(Boolean).join(" "), s = [
|
|
107
|
+
f,
|
|
108
|
+
x,
|
|
109
|
+
"shadow-lg",
|
|
110
|
+
M[o],
|
|
111
|
+
S[v]
|
|
112
|
+
].filter(Boolean).join(" "), p = {
|
|
113
|
+
...r.includes("bottom") ? { bottom: e } : { top: e },
|
|
114
|
+
...r.includes("right") ? { right: e } : { left: e },
|
|
115
|
+
...N
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ g("div", { className: m, style: p, children: [
|
|
118
|
+
/* @__PURE__ */ t(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
tabIndex: 0,
|
|
122
|
+
role: "button",
|
|
123
|
+
className: s,
|
|
124
|
+
children: h || /* @__PURE__ */ t(G, {})
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
u && /* @__PURE__ */ t(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
className: `${s} ${X}`,
|
|
131
|
+
onClick: w,
|
|
132
|
+
children: u
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
a && /* @__PURE__ */ t("button", { className: `${s} ${Z}`, children: /* @__PURE__ */ t(tt, {}) }),
|
|
136
|
+
/* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: o }, children: d })
|
|
137
|
+
] });
|
|
138
|
+
}, et = ({
|
|
139
|
+
visibilityHeight: d = 400,
|
|
140
|
+
target: l,
|
|
141
|
+
onClick: o,
|
|
142
|
+
icon: h,
|
|
143
|
+
duration: u = 450,
|
|
144
|
+
position: w = "bottom-right",
|
|
145
|
+
offset: a = 24,
|
|
146
|
+
className: v = "",
|
|
147
|
+
children: r,
|
|
148
|
+
style: e,
|
|
149
|
+
...i
|
|
150
|
+
}) => {
|
|
151
|
+
const [N, m] = A(!1);
|
|
152
|
+
R(() => {
|
|
153
|
+
const n = l ? l() : window, b = () => {
|
|
154
|
+
const c = n instanceof Window ? window.scrollY : n.scrollTop;
|
|
155
|
+
m(c >= d);
|
|
156
|
+
};
|
|
157
|
+
return n.addEventListener("scroll", b), b(), () => n.removeEventListener("scroll", b);
|
|
158
|
+
}, [l, d]);
|
|
159
|
+
const s = () => {
|
|
160
|
+
o?.();
|
|
161
|
+
const n = l ? l() : window;
|
|
162
|
+
n instanceof Window ? window.scrollTo({ top: 0, behavior: "smooth" }) : n.scrollTo({ top: 0, behavior: "smooth" });
|
|
163
|
+
};
|
|
164
|
+
if (!N) return null;
|
|
165
|
+
const p = [
|
|
166
|
+
f,
|
|
167
|
+
x,
|
|
168
|
+
I,
|
|
169
|
+
k,
|
|
170
|
+
"shadow-lg",
|
|
171
|
+
"transition-opacity",
|
|
172
|
+
v
|
|
173
|
+
].filter(Boolean).join(" "), B = {
|
|
174
|
+
position: "fixed",
|
|
175
|
+
zIndex: 1e3,
|
|
176
|
+
bottom: a,
|
|
177
|
+
...w.includes("right") ? { right: a } : { left: a },
|
|
178
|
+
...e
|
|
179
|
+
};
|
|
180
|
+
return /* @__PURE__ */ t("button", { className: p, onClick: s, style: B, ...i, children: h || r || /* @__PURE__ */ t(_, {}) });
|
|
181
|
+
};
|
|
182
|
+
W.Group = nt;
|
|
183
|
+
W.BackTop = et;
|
|
184
|
+
export {
|
|
185
|
+
W as FloatButton
|
|
186
|
+
};
|
|
187
|
+
//# sourceMappingURL=FloatButton.js.map
|