moduix 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/components/Accordion/Accordion.cjs +65 -0
- package/dist/components/Accordion/Accordion.css +99 -0
- package/dist/components/Accordion/Accordion.d.ts +17 -9
- package/dist/components/Accordion/Accordion.js +60 -0
- package/dist/components/Accordion/Accordion.module.cjs +12 -0
- package/dist/components/Accordion/Accordion.module.js +12 -0
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Alert/Alert.cjs +50 -0
- package/dist/components/Alert/Alert.css +114 -0
- package/dist/components/Alert/Alert.d.ts +30 -10
- package/dist/components/Alert/Alert.js +44 -0
- package/dist/components/Alert/Alert.module.cjs +11 -0
- package/dist/components/Alert/Alert.module.js +11 -0
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/AlertDialog.cjs +122 -0
- package/dist/components/AlertDialog/AlertDialog.css +159 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +66 -19
- package/dist/components/AlertDialog/AlertDialog.js +107 -0
- package/dist/components/AlertDialog/AlertDialog.module.cjs +18 -0
- package/dist/components/AlertDialog/AlertDialog.module.js +18 -0
- package/dist/components/AlertDialog/index.d.ts +1 -1
- package/dist/components/AspectRatio/AspectRatio.cjs +24 -0
- package/dist/components/AspectRatio/AspectRatio.css +14 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +12 -5
- package/dist/components/AspectRatio/AspectRatio.js +24 -0
- package/dist/components/AspectRatio/AspectRatio.module.cjs +5 -0
- package/dist/components/AspectRatio/AspectRatio.module.js +5 -0
- package/dist/components/AspectRatio/index.d.ts +1 -2
- package/dist/components/Autocomplete/Autocomplete.cjs +303 -0
- package/dist/components/Autocomplete/Autocomplete.css +454 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +40 -37
- package/dist/components/Autocomplete/Autocomplete.js +271 -0
- package/dist/components/Autocomplete/Autocomplete.module.cjs +37 -0
- package/dist/components/Autocomplete/Autocomplete.module.js +37 -0
- package/dist/components/Autocomplete/index.d.ts +1 -1
- package/dist/components/Avatar/Avatar.cjs +31 -0
- package/dist/components/Avatar/Avatar.css +74 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -6
- package/dist/components/Avatar/Avatar.js +29 -0
- package/dist/components/Avatar/Avatar.module.cjs +9 -0
- package/dist/components/Avatar/Avatar.module.js +9 -0
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/Badge.cjs +25 -0
- package/dist/components/Badge/Badge.css +66 -0
- package/dist/components/Badge/Badge.d.ts +15 -6
- package/dist/components/Badge/Badge.js +22 -0
- package/dist/components/Badge/Badge.module.cjs +8 -0
- package/dist/components/Badge/Badge.module.js +8 -0
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Bleed/Bleed.cjs +17 -0
- package/dist/components/Bleed/Bleed.css +51 -0
- package/dist/components/Bleed/Bleed.d.ts +15 -6
- package/dist/components/Bleed/Bleed.js +15 -0
- package/dist/components/Bleed/Bleed.module.cjs +5 -0
- package/dist/components/Bleed/Bleed.module.js +5 -0
- package/dist/components/Bleed/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +72 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.css +88 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +38 -10
- package/dist/components/Breadcrumbs/Breadcrumbs.js +66 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs +13 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.module.js +13 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/Button/Button.cjs +18 -0
- package/dist/components/Button/Button.css +194 -0
- package/dist/components/Button/Button.d.ts +9 -7
- package/dist/components/Button/Button.js +18 -0
- package/dist/components/Button/Button.module.cjs +5 -0
- package/dist/components/Button/Button.module.js +5 -0
- package/dist/components/Button/index.d.ts +1 -2
- package/dist/components/Card/Card.cjs +81 -0
- package/dist/components/Card/Card.css +136 -0
- package/dist/components/Card/Card.d.ts +45 -15
- package/dist/components/Card/Card.js +72 -0
- package/dist/components/Card/Card.module.cjs +14 -0
- package/dist/components/Card/Card.module.js +14 -0
- package/dist/components/Card/index.d.ts +1 -2
- package/dist/components/Checkbox/Checkbox.cjs +63 -0
- package/dist/components/Checkbox/Checkbox.css +131 -0
- package/dist/components/Checkbox/Checkbox.d.ts +27 -10
- package/dist/components/Checkbox/Checkbox.js +59 -0
- package/dist/components/Checkbox/Checkbox.module.cjs +13 -0
- package/dist/components/Checkbox/Checkbox.module.js +13 -0
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +55 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.css +33 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +27 -9
- package/dist/components/CheckboxGroup/CheckboxGroup.js +50 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.module.cjs +11 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.module.js +11 -0
- package/dist/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/components/CloseButton/CloseButton.cjs +22 -0
- package/dist/components/CloseButton/CloseButton.css +49 -0
- package/dist/components/CloseButton/CloseButton.d.ts +4 -2
- package/dist/components/CloseButton/CloseButton.js +22 -0
- package/dist/components/CloseButton/CloseButton.module.cjs +5 -0
- package/dist/components/CloseButton/CloseButton.module.js +5 -0
- package/dist/components/Collapsible/Collapsible.cjs +47 -0
- package/dist/components/Collapsible/Collapsible.css +92 -0
- package/dist/components/Collapsible/Collapsible.d.ts +14 -6
- package/dist/components/Collapsible/Collapsible.js +44 -0
- package/dist/components/Collapsible/Collapsible.module.cjs +10 -0
- package/dist/components/Collapsible/Collapsible.module.js +10 -0
- package/dist/components/Collapsible/index.d.ts +1 -1
- package/dist/components/Combobox/Combobox.cjs +330 -0
- package/dist/components/Combobox/Combobox.css +497 -0
- package/dist/components/Combobox/Combobox.d.ts +58 -43
- package/dist/components/Combobox/Combobox.js +295 -0
- package/dist/components/Combobox/Combobox.module.cjs +42 -0
- package/dist/components/Combobox/Combobox.module.js +42 -0
- package/dist/components/Combobox/index.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPalette.cjs +304 -0
- package/dist/components/CommandPalette/CommandPalette.css +375 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +134 -42
- package/dist/components/CommandPalette/CommandPalette.js +278 -0
- package/dist/components/CommandPalette/CommandPalette.module.cjs +30 -0
- package/dist/components/CommandPalette/CommandPalette.module.js +30 -0
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/Container/Container.cjs +17 -0
- package/dist/components/Container/Container.css +45 -0
- package/dist/components/Container/Container.d.ts +15 -6
- package/dist/components/Container/Container.js +15 -0
- package/dist/components/Container/Container.module.cjs +5 -0
- package/dist/components/Container/Container.module.js +5 -0
- package/dist/components/Container/index.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.cjs +241 -0
- package/dist/components/ContextMenu/ContextMenu.css +308 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +131 -38
- package/dist/components/ContextMenu/ContextMenu.js +215 -0
- package/dist/components/ContextMenu/ContextMenu.module.cjs +33 -0
- package/dist/components/ContextMenu/ContextMenu.module.js +33 -0
- package/dist/components/ContextMenu/index.d.ts +1 -2
- package/dist/components/CopyButton/CopyButton.cjs +66 -0
- package/dist/components/CopyButton/CopyButton.css +14 -0
- package/dist/components/CopyButton/CopyButton.d.ts +14 -13
- package/dist/components/CopyButton/CopyButton.js +66 -0
- package/dist/components/CopyButton/CopyButton.module.cjs +5 -0
- package/dist/components/CopyButton/CopyButton.module.js +5 -0
- package/dist/components/CopyButton/index.d.ts +1 -2
- package/dist/components/Dialog/Dialog.cjs +136 -0
- package/dist/components/Dialog/Dialog.css +186 -0
- package/dist/components/Dialog/Dialog.d.ts +68 -18
- package/dist/components/Dialog/Dialog.js +122 -0
- package/dist/components/Dialog/Dialog.module.cjs +18 -0
- package/dist/components/Dialog/Dialog.module.js +18 -0
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.cjs +202 -0
- package/dist/components/Drawer/Drawer.css +483 -0
- package/dist/components/Drawer/Drawer.d.ts +95 -27
- package/dist/components/Drawer/Drawer.js +182 -0
- package/dist/components/Drawer/Drawer.module.cjs +24 -0
- package/dist/components/Drawer/Drawer.module.js +24 -0
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Empty/Empty.cjs +55 -0
- package/dist/components/Empty/Empty.css +78 -0
- package/dist/components/Empty/Empty.d.ts +31 -9
- package/dist/components/Empty/Empty.js +48 -0
- package/dist/components/Empty/Empty.module.cjs +12 -0
- package/dist/components/Empty/Empty.module.js +12 -0
- package/dist/components/Empty/index.d.ts +1 -1
- package/dist/components/Field/Field.cjs +56 -0
- package/dist/components/Field/Field.css +86 -0
- package/dist/components/Field/Field.d.ts +30 -9
- package/dist/components/Field/Field.js +50 -0
- package/dist/components/Field/Field.module.cjs +12 -0
- package/dist/components/Field/Field.module.js +12 -0
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.cjs +22 -0
- package/dist/components/Fieldset/Fieldset.css +39 -0
- package/dist/components/Fieldset/Fieldset.d.ts +13 -4
- package/dist/components/Fieldset/Fieldset.js +21 -0
- package/dist/components/Fieldset/Fieldset.module.cjs +8 -0
- package/dist/components/Fieldset/Fieldset.module.js +8 -0
- package/dist/components/Fieldset/index.d.ts +1 -1
- package/dist/components/Form/Form.cjs +16 -0
- package/dist/components/Form/Form.css +9 -0
- package/dist/components/Form/Form.d.ts +6 -3
- package/dist/components/Form/Form.js +16 -0
- package/dist/components/Form/Form.module.cjs +5 -0
- package/dist/components/Form/Form.module.js +5 -0
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/Heading/Heading.cjs +25 -0
- package/dist/components/Heading/Heading.css +50 -0
- package/dist/components/Heading/Heading.d.ts +21 -13
- package/dist/components/Heading/Heading.js +23 -0
- package/dist/components/Heading/Heading.module.cjs +5 -0
- package/dist/components/Heading/Heading.module.js +5 -0
- package/dist/components/Heading/index.d.ts +1 -1
- package/dist/components/Input/Input.cjs +18 -0
- package/dist/components/Input/Input.css +78 -0
- package/dist/components/Input/Input.d.ts +10 -8
- package/dist/components/Input/Input.js +18 -0
- package/dist/components/Input/Input.module.cjs +5 -0
- package/dist/components/Input/Input.module.js +5 -0
- package/dist/components/Input/index.d.ts +1 -2
- package/dist/components/InputGroup/InputGroup.cjs +77 -0
- package/dist/components/InputGroup/InputGroup.css +160 -0
- package/dist/components/InputGroup/InputGroup.d.ts +14 -10
- package/dist/components/InputGroup/InputGroup.js +73 -0
- package/dist/components/InputGroup/InputGroup.module.cjs +11 -0
- package/dist/components/InputGroup/InputGroup.module.js +11 -0
- package/dist/components/InputGroup/index.d.ts +1 -1
- package/dist/components/Kbd/Kbd.cjs +23 -0
- package/dist/components/Kbd/Kbd.css +49 -0
- package/dist/components/Kbd/Kbd.d.ts +13 -4
- package/dist/components/Kbd/Kbd.js +20 -0
- package/dist/components/Kbd/Kbd.module.cjs +8 -0
- package/dist/components/Kbd/Kbd.module.js +8 -0
- package/dist/components/Kbd/index.d.ts +1 -1
- package/dist/components/Lightbox/Lightbox.cjs +220 -0
- package/dist/components/Lightbox/Lightbox.css +114 -0
- package/dist/components/Lightbox/Lightbox.d.ts +81 -28
- package/dist/components/Lightbox/Lightbox.js +208 -0
- package/dist/components/Lightbox/Lightbox.module.cjs +14 -0
- package/dist/components/Lightbox/Lightbox.module.js +14 -0
- package/dist/components/Lightbox/index.d.ts +1 -1
- package/dist/components/List/List.cjs +31 -0
- package/dist/components/List/List.css +114 -0
- package/dist/components/List/List.d.ts +26 -12
- package/dist/components/List/List.js +28 -0
- package/dist/components/List/List.module.cjs +5 -0
- package/dist/components/List/List.module.js +5 -0
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/Menu/Menu.cjs +260 -0
- package/dist/components/Menu/Menu.css +377 -0
- package/dist/components/Menu/Menu.d.ts +141 -41
- package/dist/components/Menu/Menu.js +231 -0
- package/dist/components/Menu/Menu.module.cjs +36 -0
- package/dist/components/Menu/Menu.module.js +36 -0
- package/dist/components/Menu/index.d.ts +1 -2
- package/dist/components/Menubar/Menubar.cjs +261 -0
- package/dist/components/Menubar/Menubar.css +387 -0
- package/dist/components/Menubar/Menubar.d.ts +144 -42
- package/dist/components/Menubar/Menubar.js +232 -0
- package/dist/components/Menubar/Menubar.module.cjs +36 -0
- package/dist/components/Menubar/Menubar.module.js +36 -0
- package/dist/components/Menubar/index.d.ts +1 -2
- package/dist/components/Meter/Meter.cjs +60 -0
- package/dist/components/Meter/Meter.css +46 -0
- package/dist/components/Meter/Meter.d.ts +9 -7
- package/dist/components/Meter/Meter.js +55 -0
- package/dist/components/Meter/Meter.module.cjs +11 -0
- package/dist/components/Meter/Meter.module.js +11 -0
- package/dist/components/NavigationMenu/NavigationMenu.cjs +146 -0
- package/dist/components/NavigationMenu/NavigationMenu.css +319 -0
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +81 -22
- package/dist/components/NavigationMenu/NavigationMenu.js +134 -0
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs +21 -0
- package/dist/components/NavigationMenu/NavigationMenu.module.js +21 -0
- package/dist/components/NavigationMenu/index.d.ts +1 -2
- package/dist/components/NumberField/NumberField.cjs +82 -0
- package/dist/components/NumberField/NumberField.css +158 -0
- package/dist/components/NumberField/NumberField.d.ts +48 -14
- package/dist/components/NumberField/NumberField.js +75 -0
- package/dist/components/NumberField/NumberField.module.cjs +13 -0
- package/dist/components/NumberField/NumberField.module.js +13 -0
- package/dist/components/NumberField/index.d.ts +1 -2
- package/dist/components/OTPField/OTPField.cjs +41 -0
- package/dist/components/OTPField/OTPField.css +78 -0
- package/dist/components/OTPField/OTPField.d.ts +19 -5
- package/dist/components/OTPField/OTPField.js +39 -0
- package/dist/components/OTPField/OTPField.module.cjs +9 -0
- package/dist/components/OTPField/OTPField.module.js +9 -0
- package/dist/components/OTPField/index.d.ts +1 -1
- package/dist/components/Pagination/Pagination.cjs +123 -0
- package/dist/components/Pagination/Pagination.css +103 -0
- package/dist/components/Pagination/Pagination.d.ts +60 -22
- package/dist/components/Pagination/Pagination.js +116 -0
- package/dist/components/Pagination/Pagination.module.cjs +16 -0
- package/dist/components/Pagination/Pagination.module.js +16 -0
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.cjs +47 -0
- package/dist/components/PasswordInput/PasswordInput.css +19 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +14 -12
- package/dist/components/PasswordInput/PasswordInput.js +47 -0
- package/dist/components/PasswordInput/PasswordInput.module.cjs +9 -0
- package/dist/components/PasswordInput/PasswordInput.module.js +9 -0
- package/dist/components/PasswordInput/index.d.ts +1 -2
- package/dist/components/Popover/Popover.cjs +146 -0
- package/dist/components/Popover/Popover.css +200 -0
- package/dist/components/Popover/Popover.d.ts +79 -22
- package/dist/components/Popover/Popover.js +131 -0
- package/dist/components/Popover/Popover.module.cjs +22 -0
- package/dist/components/Popover/Popover.module.js +22 -0
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/PreviewCard/PreviewCard.cjs +96 -0
- package/dist/components/PreviewCard/PreviewCard.css +136 -0
- package/dist/components/PreviewCard/PreviewCard.d.ts +51 -15
- package/dist/components/PreviewCard/PreviewCard.js +87 -0
- package/dist/components/PreviewCard/PreviewCard.module.cjs +16 -0
- package/dist/components/PreviewCard/PreviewCard.module.js +16 -0
- package/dist/components/PreviewCard/index.d.ts +1 -1
- package/dist/components/Progress/Progress.cjs +60 -0
- package/dist/components/Progress/Progress.css +68 -0
- package/dist/components/Progress/Progress.d.ts +9 -7
- package/dist/components/Progress/Progress.js +55 -0
- package/dist/components/Progress/Progress.module.cjs +12 -0
- package/dist/components/Progress/Progress.module.js +12 -0
- package/dist/components/Radio/Radio.cjs +78 -0
- package/dist/components/Radio/Radio.css +141 -0
- package/dist/components/Radio/Radio.d.ts +39 -14
- package/dist/components/Radio/Radio.js +71 -0
- package/dist/components/Radio/Radio.module.cjs +14 -0
- package/dist/components/Radio/Radio.module.js +14 -0
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Rating/Rating.cjs +61 -0
- package/dist/components/Rating/Rating.css +79 -0
- package/dist/components/Rating/Rating.d.ts +12 -10
- package/dist/components/Rating/Rating.js +61 -0
- package/dist/components/Rating/Rating.module.cjs +9 -0
- package/dist/components/Rating/Rating.module.js +9 -0
- package/dist/components/Rating/index.d.ts +1 -2
- package/dist/components/ScrollArea/ScrollArea.cjs +82 -0
- package/dist/components/ScrollArea/ScrollArea.css +205 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +16 -13
- package/dist/components/ScrollArea/ScrollArea.js +76 -0
- package/dist/components/ScrollArea/ScrollArea.module.cjs +12 -0
- package/dist/components/ScrollArea/ScrollArea.module.js +12 -0
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/Select/Select.cjs +219 -0
- package/dist/components/Select/Select.css +357 -0
- package/dist/components/Select/Select.d.ts +116 -30
- package/dist/components/Select/Select.js +196 -0
- package/dist/components/Select/Select.module.cjs +33 -0
- package/dist/components/Select/Select.module.js +33 -0
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Separator/Separator.cjs +16 -0
- package/dist/components/Separator/Separator.css +17 -0
- package/dist/components/Separator/Separator.d.ts +4 -2
- package/dist/components/Separator/Separator.js +16 -0
- package/dist/components/Separator/Separator.module.cjs +5 -0
- package/dist/components/Separator/Separator.module.js +5 -0
- package/dist/components/Skeleton/Skeleton.cjs +25 -0
- package/dist/components/Skeleton/Skeleton.css +21 -0
- package/dist/components/Skeleton/Skeleton.d.ts +22 -9
- package/dist/components/Skeleton/Skeleton.js +25 -0
- package/dist/components/Skeleton/Skeleton.module.cjs +5 -0
- package/dist/components/Skeleton/Skeleton.module.js +5 -0
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/Slider.cjs +106 -0
- package/dist/components/Slider/Slider.css +115 -0
- package/dist/components/Slider/Slider.d.ts +14 -11
- package/dist/components/Slider/Slider.js +99 -0
- package/dist/components/Slider/Slider.module.cjs +13 -0
- package/dist/components/Slider/Slider.module.js +13 -0
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/SnapCarousel/SnapCarousel.cjs +130 -0
- package/dist/components/SnapCarousel/SnapCarousel.css +131 -0
- package/dist/components/SnapCarousel/SnapCarousel.d.ts +37 -10
- package/dist/components/SnapCarousel/SnapCarousel.js +125 -0
- package/dist/components/SnapCarousel/SnapCarousel.module.cjs +13 -0
- package/dist/components/SnapCarousel/SnapCarousel.module.js +13 -0
- package/dist/components/SnapCarousel/index.d.ts +1 -2
- package/dist/components/Spinner/Spinner.cjs +30 -0
- package/dist/components/Spinner/Spinner.css +60 -0
- package/dist/components/Spinner/Spinner.d.ts +16 -6
- package/dist/components/Spinner/Spinner.js +28 -0
- package/dist/components/Spinner/Spinner.module.cjs +9 -0
- package/dist/components/Spinner/Spinner.module.js +9 -0
- package/dist/components/Spinner/index.d.ts +1 -2
- package/dist/components/SplitButton/SplitButton.cjs +69 -0
- package/dist/components/SplitButton/SplitButton.css +59 -0
- package/dist/components/SplitButton/SplitButton.d.ts +39 -20
- package/dist/components/SplitButton/SplitButton.js +66 -0
- package/dist/components/SplitButton/SplitButton.module.cjs +9 -0
- package/dist/components/SplitButton/SplitButton.module.js +9 -0
- package/dist/components/SplitButton/index.d.ts +1 -2
- package/dist/components/Stack/Stack.cjs +27 -0
- package/dist/components/Stack/Stack.css +13 -0
- package/dist/components/Stack/Stack.d.ts +27 -13
- package/dist/components/Stack/Stack.js +27 -0
- package/dist/components/Stack/Stack.module.cjs +5 -0
- package/dist/components/Stack/Stack.module.js +5 -0
- package/dist/components/Stack/index.d.ts +1 -1
- package/dist/components/Stepper/Stepper.cjs +138 -0
- package/dist/components/Stepper/Stepper.css +174 -0
- package/dist/components/Stepper/Stepper.d.ts +55 -16
- package/dist/components/Stepper/Stepper.js +131 -0
- package/dist/components/Stepper/Stepper.module.cjs +14 -0
- package/dist/components/Stepper/Stepper.module.js +14 -0
- package/dist/components/Stepper/index.d.ts +1 -2
- package/dist/components/Switch/Switch.cjs +43 -0
- package/dist/components/Switch/Switch.css +138 -0
- package/dist/components/Switch/Switch.d.ts +21 -9
- package/dist/components/Switch/Switch.js +40 -0
- package/dist/components/Switch/Switch.module.cjs +10 -0
- package/dist/components/Switch/Switch.module.js +10 -0
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Table/Table.cjs +96 -0
- package/dist/components/Table/Table.css +107 -0
- package/dist/components/Table/Table.d.ts +54 -16
- package/dist/components/Table/Table.js +85 -0
- package/dist/components/Table/Table.module.cjs +18 -0
- package/dist/components/Table/Table.module.js +18 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.cjs +70 -0
- package/dist/components/Tabs/Tabs.css +181 -0
- package/dist/components/Tabs/Tabs.d.ts +10 -8
- package/dist/components/Tabs/Tabs.js +66 -0
- package/dist/components/Tabs/Tabs.module.cjs +11 -0
- package/dist/components/Tabs/Tabs.module.js +11 -0
- package/dist/components/Text/Text.cjs +42 -0
- package/dist/components/Text/Text.css +73 -0
- package/dist/components/Text/Text.d.ts +20 -9
- package/dist/components/Text/Text.js +42 -0
- package/dist/components/Text/Text.module.cjs +5 -0
- package/dist/components/Text/Text.module.js +5 -0
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Textarea/Textarea.cjs +28 -0
- package/dist/components/Textarea/Textarea.css +59 -0
- package/dist/components/Textarea/Textarea.d.ts +7 -5
- package/dist/components/Textarea/Textarea.js +28 -0
- package/dist/components/Textarea/Textarea.module.cjs +5 -0
- package/dist/components/Textarea/Textarea.module.js +5 -0
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/Toast/Toast.cjs +278 -0
- package/dist/components/Toast/Toast.css +351 -0
- package/dist/components/Toast/Toast.d.ts +79 -38
- package/dist/components/Toast/Toast.js +263 -0
- package/dist/components/Toast/Toast.module.cjs +26 -0
- package/dist/components/Toast/Toast.module.js +26 -0
- package/dist/components/Toast/index.d.ts +1 -2
- package/dist/components/Toggle/Toggle.cjs +18 -0
- package/dist/components/Toggle/Toggle.css +147 -0
- package/dist/components/Toggle/Toggle.d.ts +9 -6
- package/dist/components/Toggle/Toggle.js +18 -0
- package/dist/components/Toggle/Toggle.module.cjs +5 -0
- package/dist/components/Toggle/Toggle.module.js +5 -0
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.cjs +42 -0
- package/dist/components/ToggleGroup/ToggleGroup.css +42 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +15 -12
- package/dist/components/ToggleGroup/ToggleGroup.js +41 -0
- package/dist/components/ToggleGroup/ToggleGroup.module.cjs +8 -0
- package/dist/components/ToggleGroup/ToggleGroup.module.js +8 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.cjs +61 -0
- package/dist/components/Toolbar/Toolbar.css +203 -0
- package/dist/components/Toolbar/Toolbar.d.ts +9 -7
- package/dist/components/Toolbar/Toolbar.js +56 -0
- package/dist/components/Toolbar/Toolbar.module.cjs +12 -0
- package/dist/components/Toolbar/Toolbar.module.js +12 -0
- package/dist/components/Tooltip/Tooltip.cjs +91 -0
- package/dist/components/Tooltip/Tooltip.css +155 -0
- package/dist/components/Tooltip/Tooltip.d.ts +51 -15
- package/dist/components/Tooltip/Tooltip.js +82 -0
- package/dist/components/Tooltip/Tooltip.module.cjs +15 -0
- package/dist/components/Tooltip/Tooltip.module.js +15 -0
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/icons/demo/Icons.cjs +234 -0
- package/dist/icons/demo/Icons.d.ts +15 -12
- package/dist/icons/demo/Icons.js +225 -0
- package/dist/icons/demo/index.d.ts +1 -1
- package/dist/icons/ui/Icons.cjs +324 -0
- package/dist/icons/ui/Icons.d.ts +30 -22
- package/dist/icons/ui/Icons.js +308 -0
- package/dist/icons/ui/index.d.ts +1 -1
- package/dist/index.cjs +619 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +68 -67
- package/dist/index.js +68 -5775
- package/dist/reset.cjs +1 -0
- package/dist/reset.d.cts +1 -0
- package/dist/reset.d.ts +1 -0
- package/dist/reset.js +1 -0
- package/dist/style.cjs +1 -0
- package/dist/style.d.cts +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +1 -0
- package/dist/styles/reset.css +175 -0
- package/dist/styles/style.css +263 -0
- package/dist/utils/mergeClassName.cjs +8 -0
- package/dist/utils/mergeClassName.js +8 -0
- package/package.json +6 -5
- package/dist/components/CloseButton/index.d.ts +0 -1
- package/dist/components/Meter/index.d.ts +0 -1
- package/dist/components/Progress/index.d.ts +0 -1
- package/dist/components/Separator/index.d.ts +0 -1
- package/dist/components/Tabs/index.d.ts +0 -1
- package/dist/components/Toolbar/index.d.ts +0 -1
- package/dist/data/insideScrollSections.d.ts +0 -4
- package/dist/index.css +0 -1
- package/dist/reset.css +0 -334
- package/dist/utils/mergeClassName.d.ts +0 -4
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
const require_mergeClassName = require("../../utils/mergeClassName.cjs");
|
|
2
|
+
const require_CloseButton = require("../CloseButton/CloseButton.cjs");
|
|
3
|
+
const require_Lightbox_module = require("./Lightbox.module.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let clsx = require("clsx");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let _base_ui_react_dialog = require("@base-ui/react/dialog");
|
|
8
|
+
//#region src/components/Lightbox/Lightbox.tsx
|
|
9
|
+
const DEFAULT_CLOSE_LABEL = "Close image";
|
|
10
|
+
const createLightboxHandle = _base_ui_react_dialog.Dialog.createHandle;
|
|
11
|
+
const LightboxImageContext = (0, react.createContext)(null);
|
|
12
|
+
const LightboxSetImageContext = (0, react.createContext)(null);
|
|
13
|
+
const isSameImage = (currentImage, nextImage) => {
|
|
14
|
+
return currentImage?.src === nextImage.src && currentImage?.fullSrc === nextImage.fullSrc && currentImage?.alt === nextImage.alt;
|
|
15
|
+
};
|
|
16
|
+
const getGalleryRoot = (rootRef, rootSelector) => {
|
|
17
|
+
return rootRef?.current ?? (rootSelector ? document.querySelector(rootSelector) : null);
|
|
18
|
+
};
|
|
19
|
+
const getGalleryImage = (target, selector) => {
|
|
20
|
+
if (!(target instanceof Element)) return null;
|
|
21
|
+
const matchedNode = target.closest(selector);
|
|
22
|
+
if (!matchedNode) return null;
|
|
23
|
+
const imageNode = matchedNode instanceof HTMLImageElement ? matchedNode : matchedNode.querySelector("img");
|
|
24
|
+
if (!(imageNode instanceof HTMLImageElement)) return null;
|
|
25
|
+
const source = imageNode.dataset.lightboxSrc ?? imageNode.currentSrc ?? imageNode.src;
|
|
26
|
+
if (!source) return null;
|
|
27
|
+
return {
|
|
28
|
+
src: source,
|
|
29
|
+
alt: imageNode.alt
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
function Lightbox(props) {
|
|
33
|
+
const [image, setImage] = (0, react.useState)(null);
|
|
34
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxSetImageContext.Provider, {
|
|
35
|
+
value: setImage,
|
|
36
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxImageContext.Provider, {
|
|
37
|
+
value: image,
|
|
38
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Root, { ...props })
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function LightboxTrigger({ className, render, ...props }) {
|
|
43
|
+
const triggerClassName = render ? className : require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.trigger);
|
|
44
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Trigger, {
|
|
45
|
+
"data-slot": "lightbox-trigger",
|
|
46
|
+
className: triggerClassName,
|
|
47
|
+
render,
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function LightboxPortal({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Portal, {
|
|
53
|
+
"data-slot": "lightbox-portal",
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function LightboxBackdrop({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, {
|
|
60
|
+
"data-slot": "lightbox-backdrop",
|
|
61
|
+
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.backdrop),
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function LightboxViewport({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Viewport, {
|
|
67
|
+
"data-slot": "lightbox-viewport",
|
|
68
|
+
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.viewport),
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function LightboxPopup({ className, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Popup, {
|
|
74
|
+
"data-slot": "lightbox-popup",
|
|
75
|
+
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.popup),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function LightboxClose({ className, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Close, {
|
|
81
|
+
"data-slot": "lightbox-close",
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function LightboxCloseButton({ className, children, "aria-label": ariaLabel = DEFAULT_CLOSE_LABEL, render, ...props }) {
|
|
87
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Close, {
|
|
88
|
+
"data-slot": "lightbox-close-button",
|
|
89
|
+
render: render ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CloseButton.CloseButton, {
|
|
90
|
+
"aria-label": ariaLabel,
|
|
91
|
+
children
|
|
92
|
+
}),
|
|
93
|
+
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.closeButton),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function LightboxFrame({ className, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
99
|
+
"data-slot": "lightbox-frame",
|
|
100
|
+
className: (0, clsx.clsx)(require_Lightbox_module.default.frame, className),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function LightboxImage({ src, fullSrc, alt, className, onClick, ...props }) {
|
|
105
|
+
const setImage = (0, react.useContext)(LightboxSetImageContext);
|
|
106
|
+
const image = {
|
|
107
|
+
src,
|
|
108
|
+
fullSrc,
|
|
109
|
+
alt
|
|
110
|
+
};
|
|
111
|
+
(0, react.useEffect)(() => {
|
|
112
|
+
setImage?.(image);
|
|
113
|
+
return () => {
|
|
114
|
+
setImage?.((currentImage) => isSameImage(currentImage, image) ? null : currentImage);
|
|
115
|
+
};
|
|
116
|
+
}, [
|
|
117
|
+
alt,
|
|
118
|
+
fullSrc,
|
|
119
|
+
setImage,
|
|
120
|
+
src
|
|
121
|
+
]);
|
|
122
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxTrigger, {
|
|
123
|
+
nativeButton: false,
|
|
124
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
125
|
+
"data-slot": "lightbox-image",
|
|
126
|
+
src,
|
|
127
|
+
alt,
|
|
128
|
+
className: (0, clsx.clsx)(require_Lightbox_module.default.trigger, className),
|
|
129
|
+
"data-lightbox-src": fullSrc,
|
|
130
|
+
onClick: (event) => {
|
|
131
|
+
onClick?.(event);
|
|
132
|
+
if (!event.defaultPrevented) setImage?.(image);
|
|
133
|
+
},
|
|
134
|
+
...props
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function LightboxContent({ className, showCloseButton = true, closeOnContentClick = true, closeLabel = DEFAULT_CLOSE_LABEL, children, ...props }) {
|
|
139
|
+
const image = (0, react.useContext)(LightboxImageContext);
|
|
140
|
+
const contentChildren = children ?? (image ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
141
|
+
"data-slot": "lightbox-content-image",
|
|
142
|
+
src: image.fullSrc ?? image.src,
|
|
143
|
+
alt: image.alt ?? ""
|
|
144
|
+
}) : null);
|
|
145
|
+
const content = closeOnContentClick ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxClose, {
|
|
146
|
+
className: require_Lightbox_module.default.contentClose,
|
|
147
|
+
nativeButton: false,
|
|
148
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {}),
|
|
149
|
+
children: contentChildren
|
|
150
|
+
}) : contentChildren;
|
|
151
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LightboxPortal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxBackdrop, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LightboxViewport, { children: [showCloseButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxCloseButton, { "aria-label": closeLabel }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxPopup, {
|
|
152
|
+
className,
|
|
153
|
+
...props,
|
|
154
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxFrame, { children: content })
|
|
155
|
+
})] })] });
|
|
156
|
+
}
|
|
157
|
+
function LightboxGallery({ selector = "img", rootRef, rootSelector, className, closeLabel, showCloseButton, closeOnContentClick }) {
|
|
158
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
159
|
+
const [image, setImage] = (0, react.useState)(null);
|
|
160
|
+
(0, react.useEffect)(() => {
|
|
161
|
+
const rootNode = getGalleryRoot(rootRef, rootSelector);
|
|
162
|
+
if (!rootNode) return;
|
|
163
|
+
const handleOpen = (target) => {
|
|
164
|
+
const nextImage = getGalleryImage(target, selector);
|
|
165
|
+
if (!nextImage) return false;
|
|
166
|
+
setImage(nextImage);
|
|
167
|
+
setOpen(true);
|
|
168
|
+
return true;
|
|
169
|
+
};
|
|
170
|
+
const handleClick = (event) => {
|
|
171
|
+
handleOpen(event.target);
|
|
172
|
+
};
|
|
173
|
+
const handleKeyDown = (event) => {
|
|
174
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.key !== "Enter" && event.key !== " ") return;
|
|
175
|
+
if (handleOpen(event.target)) event.preventDefault();
|
|
176
|
+
};
|
|
177
|
+
rootNode.addEventListener("click", handleClick);
|
|
178
|
+
rootNode.addEventListener("keydown", handleKeyDown);
|
|
179
|
+
return () => {
|
|
180
|
+
rootNode.removeEventListener("click", handleClick);
|
|
181
|
+
rootNode.removeEventListener("keydown", handleKeyDown);
|
|
182
|
+
};
|
|
183
|
+
}, [
|
|
184
|
+
rootRef,
|
|
185
|
+
rootSelector,
|
|
186
|
+
selector
|
|
187
|
+
]);
|
|
188
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Lightbox, {
|
|
189
|
+
open,
|
|
190
|
+
onOpenChange: setOpen,
|
|
191
|
+
onOpenChangeComplete: (nextOpen) => {
|
|
192
|
+
if (!nextOpen) setImage(null);
|
|
193
|
+
},
|
|
194
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxContent, {
|
|
195
|
+
className,
|
|
196
|
+
closeLabel,
|
|
197
|
+
showCloseButton,
|
|
198
|
+
closeOnContentClick,
|
|
199
|
+
children: image ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
200
|
+
"data-slot": "lightbox-content-image",
|
|
201
|
+
src: image.src,
|
|
202
|
+
alt: image.alt ?? ""
|
|
203
|
+
}) : null
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
exports.Lightbox = Lightbox;
|
|
209
|
+
exports.LightboxBackdrop = LightboxBackdrop;
|
|
210
|
+
exports.LightboxClose = LightboxClose;
|
|
211
|
+
exports.LightboxCloseButton = LightboxCloseButton;
|
|
212
|
+
exports.LightboxContent = LightboxContent;
|
|
213
|
+
exports.LightboxFrame = LightboxFrame;
|
|
214
|
+
exports.LightboxGallery = LightboxGallery;
|
|
215
|
+
exports.LightboxImage = LightboxImage;
|
|
216
|
+
exports.LightboxPopup = LightboxPopup;
|
|
217
|
+
exports.LightboxPortal = LightboxPortal;
|
|
218
|
+
exports.LightboxTrigger = LightboxTrigger;
|
|
219
|
+
exports.LightboxViewport = LightboxViewport;
|
|
220
|
+
exports.createLightboxHandle = createLightboxHandle;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
@layer ui.components {
|
|
2
|
+
.LTYCWG_trigger {
|
|
3
|
+
cursor: zoom-in;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.LTYCWG_backdrop {
|
|
7
|
+
z-index: var(--z-backdrop);
|
|
8
|
+
background-color: var(--lightbox-backdrop-bg, var(--backdrop-bg, var(--color-overlay)));
|
|
9
|
+
min-height: 100dvh;
|
|
10
|
+
backdrop-filter: var(--backdrop-filter, blur(var(--lightbox-backdrop-blur, 4px)));
|
|
11
|
+
transition: opacity var(--lightbox-backdrop-transition, var(--transition-default)),
|
|
12
|
+
backdrop-filter var(--lightbox-backdrop-transition, var(--transition-default));
|
|
13
|
+
position: fixed;
|
|
14
|
+
inset: 0;
|
|
15
|
+
|
|
16
|
+
&[data-starting-style], &[data-ending-style] {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
backdrop-filter: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.LTYCWG_viewport {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
z-index: var(--z-modal);
|
|
25
|
+
padding: var(--lightbox-viewport-padding, var(--spacing-4));
|
|
26
|
+
place-items: center;
|
|
27
|
+
display: grid;
|
|
28
|
+
position: fixed;
|
|
29
|
+
inset: 0;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.LTYCWG_popup {
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
width: auto;
|
|
36
|
+
max-width: min(var(--lightbox-max-width, 80vw),
|
|
37
|
+
var(--available-width, calc(100vw - var(--spacing-8))));
|
|
38
|
+
max-height: min(var(--lightbox-max-height, 80dvh),
|
|
39
|
+
var(--available-height, calc(100dvh - var(--spacing-8))));
|
|
40
|
+
transition: opacity var(--lightbox-transition, .22s ease),
|
|
41
|
+
transform var(--lightbox-transition, .22s ease);
|
|
42
|
+
background: none;
|
|
43
|
+
border: 0;
|
|
44
|
+
outline: 0;
|
|
45
|
+
|
|
46
|
+
&[data-starting-style], &[data-ending-style] {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
transform: scale(var(--lightbox-scale, .82));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.LTYCWG_frame {
|
|
53
|
+
width: fit-content;
|
|
54
|
+
max-width: min(var(--lightbox-width, 80vw), 100%);
|
|
55
|
+
height: min(var(--lightbox-height, 80dvh), 100%);
|
|
56
|
+
max-height: min(var(--lightbox-height, 80dvh), 100%);
|
|
57
|
+
animation: LTYCWG_lightbox-image-enter var(--lightbox-image-enter-duration, .24s) ease;
|
|
58
|
+
place-items: center;
|
|
59
|
+
display: grid;
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.LTYCWG_closeButton {
|
|
64
|
+
--close-button-size: var(--lightbox-close-size, 2rem);
|
|
65
|
+
--close-button-radius: var(--lightbox-close-radius, var(--radius-sm));
|
|
66
|
+
--close-button-icon-size: var(--lightbox-close-icon-size, .875rem);
|
|
67
|
+
--close-button-color: var(--lightbox-close-color, var(--color-foreground));
|
|
68
|
+
--close-button-color-hover: var(--lightbox-close-color-hover, var(--color-foreground));
|
|
69
|
+
--close-button-bg: var(--lightbox-close-bg, var(--color-background));
|
|
70
|
+
--close-button-bg-hover: var(--lightbox-close-bg-hover, var(--color-muted));
|
|
71
|
+
--close-button-focus-ring-color: var(--lightbox-focus-ring-color, var(--color-ring));
|
|
72
|
+
top: var(--lightbox-close-offset-top, var(--spacing-4));
|
|
73
|
+
right: var(--lightbox-close-offset-right, var(--spacing-4));
|
|
74
|
+
z-index: 1;
|
|
75
|
+
opacity: 1;
|
|
76
|
+
transition: opacity var(--lightbox-backdrop-transition, var(--transition-default));
|
|
77
|
+
border: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
position: fixed;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.LTYCWG_viewport[data-starting-style] > .LTYCWG_closeButton, .LTYCWG_viewport[data-ending-style] > .LTYCWG_closeButton {
|
|
83
|
+
opacity: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.LTYCWG_frame img, .LTYCWG_frame picture > img {
|
|
87
|
+
width: auto;
|
|
88
|
+
height: auto;
|
|
89
|
+
max-width: min(var(--lightbox-image-max-width, 80vw), 100%);
|
|
90
|
+
max-height: min(var(--lightbox-image-max-height, 80dvh), 100%);
|
|
91
|
+
object-fit: contain;
|
|
92
|
+
border-radius: var(--lightbox-image-radius, var(--radius-md));
|
|
93
|
+
box-shadow: var(--lightbox-image-shadow, var(--shadow-lg));
|
|
94
|
+
user-select: none;
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.LTYCWG_contentClose {
|
|
99
|
+
cursor: zoom-out;
|
|
100
|
+
display: contents;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes LTYCWG_lightbox-image-enter {
|
|
104
|
+
from {
|
|
105
|
+
opacity: .35;
|
|
106
|
+
transform: scale(var(--lightbox-image-enter-scale, .9));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
to {
|
|
110
|
+
opacity: 1;
|
|
111
|
+
transform: scale(1);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -1,31 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
declare function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { ComponentProps, RefObject } from "react";
|
|
2
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Lightbox/Lightbox.d.ts
|
|
5
|
+
declare const createLightboxHandle: typeof Dialog.createHandle;
|
|
6
|
+
declare function Lightbox<Payload = unknown>(props: Dialog.Root.Props<Payload>): import("react").JSX.Element;
|
|
7
|
+
declare function LightboxTrigger({
|
|
8
|
+
className,
|
|
9
|
+
render,
|
|
10
|
+
...props
|
|
11
|
+
}: Dialog.Trigger.Props): import("react").JSX.Element;
|
|
12
|
+
declare function LightboxPortal({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: Dialog.Portal.Props): import("react").JSX.Element;
|
|
16
|
+
declare function LightboxBackdrop({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: Dialog.Backdrop.Props): import("react").JSX.Element;
|
|
20
|
+
declare function LightboxViewport({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: Dialog.Viewport.Props): import("react").JSX.Element;
|
|
24
|
+
declare function LightboxPopup({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: Dialog.Popup.Props): import("react").JSX.Element;
|
|
28
|
+
declare function LightboxClose({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: Dialog.Close.Props): import("react").JSX.Element;
|
|
32
|
+
declare function LightboxCloseButton({
|
|
33
|
+
className,
|
|
34
|
+
children,
|
|
35
|
+
'aria-label': ariaLabel,
|
|
36
|
+
render,
|
|
37
|
+
...props
|
|
38
|
+
}: Dialog.Close.Props): import("react").JSX.Element;
|
|
39
|
+
declare function LightboxFrame({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: ComponentProps<'div'>): import("react").JSX.Element;
|
|
43
|
+
declare function LightboxImage({
|
|
44
|
+
src,
|
|
45
|
+
fullSrc,
|
|
46
|
+
alt,
|
|
47
|
+
className,
|
|
48
|
+
onClick,
|
|
49
|
+
...props
|
|
50
|
+
}: Omit<ComponentProps<'img'>, 'src'> & {
|
|
51
|
+
src: string;
|
|
52
|
+
fullSrc?: string;
|
|
16
53
|
}): import("react").JSX.Element;
|
|
17
|
-
declare function LightboxContent({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
54
|
+
declare function LightboxContent({
|
|
55
|
+
className,
|
|
56
|
+
showCloseButton,
|
|
57
|
+
closeOnContentClick,
|
|
58
|
+
closeLabel,
|
|
59
|
+
children,
|
|
60
|
+
...props
|
|
61
|
+
}: Dialog.Popup.Props & {
|
|
62
|
+
showCloseButton?: boolean;
|
|
63
|
+
closeLabel?: string;
|
|
64
|
+
closeOnContentClick?: boolean;
|
|
21
65
|
}): import("react").JSX.Element;
|
|
22
|
-
declare function LightboxGallery({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
66
|
+
declare function LightboxGallery({
|
|
67
|
+
selector,
|
|
68
|
+
rootRef,
|
|
69
|
+
rootSelector,
|
|
70
|
+
className,
|
|
71
|
+
closeLabel,
|
|
72
|
+
showCloseButton,
|
|
73
|
+
closeOnContentClick
|
|
74
|
+
}: {
|
|
75
|
+
selector?: string;
|
|
76
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
77
|
+
rootSelector?: string;
|
|
78
|
+
className?: Dialog.Popup.Props['className'];
|
|
79
|
+
closeLabel?: string;
|
|
80
|
+
showCloseButton?: boolean;
|
|
81
|
+
closeOnContentClick?: boolean;
|
|
30
82
|
}): import("react").JSX.Element;
|
|
31
|
-
|
|
83
|
+
//#endregion
|
|
84
|
+
export { Lightbox, LightboxBackdrop, LightboxClose, LightboxCloseButton, LightboxContent, LightboxFrame, LightboxGallery, LightboxImage, LightboxPopup, LightboxPortal, LightboxTrigger, LightboxViewport, createLightboxHandle };
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { mergeClassName } from "../../utils/mergeClassName.js";
|
|
2
|
+
import { CloseButton } from "../CloseButton/CloseButton.js";
|
|
3
|
+
import Lightbox_module_default from "./Lightbox.module.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
7
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
8
|
+
//#region src/components/Lightbox/Lightbox.tsx
|
|
9
|
+
const DEFAULT_CLOSE_LABEL = "Close image";
|
|
10
|
+
const createLightboxHandle = Dialog.createHandle;
|
|
11
|
+
const LightboxImageContext = createContext(null);
|
|
12
|
+
const LightboxSetImageContext = createContext(null);
|
|
13
|
+
const isSameImage = (currentImage, nextImage) => {
|
|
14
|
+
return currentImage?.src === nextImage.src && currentImage?.fullSrc === nextImage.fullSrc && currentImage?.alt === nextImage.alt;
|
|
15
|
+
};
|
|
16
|
+
const getGalleryRoot = (rootRef, rootSelector) => {
|
|
17
|
+
return rootRef?.current ?? (rootSelector ? document.querySelector(rootSelector) : null);
|
|
18
|
+
};
|
|
19
|
+
const getGalleryImage = (target, selector) => {
|
|
20
|
+
if (!(target instanceof Element)) return null;
|
|
21
|
+
const matchedNode = target.closest(selector);
|
|
22
|
+
if (!matchedNode) return null;
|
|
23
|
+
const imageNode = matchedNode instanceof HTMLImageElement ? matchedNode : matchedNode.querySelector("img");
|
|
24
|
+
if (!(imageNode instanceof HTMLImageElement)) return null;
|
|
25
|
+
const source = imageNode.dataset.lightboxSrc ?? imageNode.currentSrc ?? imageNode.src;
|
|
26
|
+
if (!source) return null;
|
|
27
|
+
return {
|
|
28
|
+
src: source,
|
|
29
|
+
alt: imageNode.alt
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
function Lightbox(props) {
|
|
33
|
+
const [image, setImage] = useState(null);
|
|
34
|
+
return /* @__PURE__ */ jsx(LightboxSetImageContext.Provider, {
|
|
35
|
+
value: setImage,
|
|
36
|
+
children: /* @__PURE__ */ jsx(LightboxImageContext.Provider, {
|
|
37
|
+
value: image,
|
|
38
|
+
children: /* @__PURE__ */ jsx(Dialog.Root, { ...props })
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function LightboxTrigger({ className, render, ...props }) {
|
|
43
|
+
const triggerClassName = render ? className : mergeClassName(className, Lightbox_module_default.trigger);
|
|
44
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
45
|
+
"data-slot": "lightbox-trigger",
|
|
46
|
+
className: triggerClassName,
|
|
47
|
+
render,
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function LightboxPortal({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
53
|
+
"data-slot": "lightbox-portal",
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function LightboxBackdrop({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
60
|
+
"data-slot": "lightbox-backdrop",
|
|
61
|
+
className: mergeClassName(className, Lightbox_module_default.backdrop),
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function LightboxViewport({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
67
|
+
"data-slot": "lightbox-viewport",
|
|
68
|
+
className: mergeClassName(className, Lightbox_module_default.viewport),
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function LightboxPopup({ className, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
74
|
+
"data-slot": "lightbox-popup",
|
|
75
|
+
className: mergeClassName(className, Lightbox_module_default.popup),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function LightboxClose({ className, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
81
|
+
"data-slot": "lightbox-close",
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function LightboxCloseButton({ className, children, "aria-label": ariaLabel = DEFAULT_CLOSE_LABEL, render, ...props }) {
|
|
87
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
88
|
+
"data-slot": "lightbox-close-button",
|
|
89
|
+
render: render ?? /* @__PURE__ */ jsx(CloseButton, {
|
|
90
|
+
"aria-label": ariaLabel,
|
|
91
|
+
children
|
|
92
|
+
}),
|
|
93
|
+
className: mergeClassName(className, Lightbox_module_default.closeButton),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function LightboxFrame({ className, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsx("div", {
|
|
99
|
+
"data-slot": "lightbox-frame",
|
|
100
|
+
className: clsx(Lightbox_module_default.frame, className),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function LightboxImage({ src, fullSrc, alt, className, onClick, ...props }) {
|
|
105
|
+
const setImage = useContext(LightboxSetImageContext);
|
|
106
|
+
const image = {
|
|
107
|
+
src,
|
|
108
|
+
fullSrc,
|
|
109
|
+
alt
|
|
110
|
+
};
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
setImage?.(image);
|
|
113
|
+
return () => {
|
|
114
|
+
setImage?.((currentImage) => isSameImage(currentImage, image) ? null : currentImage);
|
|
115
|
+
};
|
|
116
|
+
}, [
|
|
117
|
+
alt,
|
|
118
|
+
fullSrc,
|
|
119
|
+
setImage,
|
|
120
|
+
src
|
|
121
|
+
]);
|
|
122
|
+
return /* @__PURE__ */ jsx(LightboxTrigger, {
|
|
123
|
+
nativeButton: false,
|
|
124
|
+
render: /* @__PURE__ */ jsx("img", {
|
|
125
|
+
"data-slot": "lightbox-image",
|
|
126
|
+
src,
|
|
127
|
+
alt,
|
|
128
|
+
className: clsx(Lightbox_module_default.trigger, className),
|
|
129
|
+
"data-lightbox-src": fullSrc,
|
|
130
|
+
onClick: (event) => {
|
|
131
|
+
onClick?.(event);
|
|
132
|
+
if (!event.defaultPrevented) setImage?.(image);
|
|
133
|
+
},
|
|
134
|
+
...props
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function LightboxContent({ className, showCloseButton = true, closeOnContentClick = true, closeLabel = DEFAULT_CLOSE_LABEL, children, ...props }) {
|
|
139
|
+
const image = useContext(LightboxImageContext);
|
|
140
|
+
const contentChildren = children ?? (image ? /* @__PURE__ */ jsx("img", {
|
|
141
|
+
"data-slot": "lightbox-content-image",
|
|
142
|
+
src: image.fullSrc ?? image.src,
|
|
143
|
+
alt: image.alt ?? ""
|
|
144
|
+
}) : null);
|
|
145
|
+
const content = closeOnContentClick ? /* @__PURE__ */ jsx(LightboxClose, {
|
|
146
|
+
className: Lightbox_module_default.contentClose,
|
|
147
|
+
nativeButton: false,
|
|
148
|
+
render: /* @__PURE__ */ jsx("div", {}),
|
|
149
|
+
children: contentChildren
|
|
150
|
+
}) : contentChildren;
|
|
151
|
+
return /* @__PURE__ */ jsxs(LightboxPortal, { children: [/* @__PURE__ */ jsx(LightboxBackdrop, {}), /* @__PURE__ */ jsxs(LightboxViewport, { children: [showCloseButton ? /* @__PURE__ */ jsx(LightboxCloseButton, { "aria-label": closeLabel }) : null, /* @__PURE__ */ jsx(LightboxPopup, {
|
|
152
|
+
className,
|
|
153
|
+
...props,
|
|
154
|
+
children: /* @__PURE__ */ jsx(LightboxFrame, { children: content })
|
|
155
|
+
})] })] });
|
|
156
|
+
}
|
|
157
|
+
function LightboxGallery({ selector = "img", rootRef, rootSelector, className, closeLabel, showCloseButton, closeOnContentClick }) {
|
|
158
|
+
const [open, setOpen] = useState(false);
|
|
159
|
+
const [image, setImage] = useState(null);
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
const rootNode = getGalleryRoot(rootRef, rootSelector);
|
|
162
|
+
if (!rootNode) return;
|
|
163
|
+
const handleOpen = (target) => {
|
|
164
|
+
const nextImage = getGalleryImage(target, selector);
|
|
165
|
+
if (!nextImage) return false;
|
|
166
|
+
setImage(nextImage);
|
|
167
|
+
setOpen(true);
|
|
168
|
+
return true;
|
|
169
|
+
};
|
|
170
|
+
const handleClick = (event) => {
|
|
171
|
+
handleOpen(event.target);
|
|
172
|
+
};
|
|
173
|
+
const handleKeyDown = (event) => {
|
|
174
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.key !== "Enter" && event.key !== " ") return;
|
|
175
|
+
if (handleOpen(event.target)) event.preventDefault();
|
|
176
|
+
};
|
|
177
|
+
rootNode.addEventListener("click", handleClick);
|
|
178
|
+
rootNode.addEventListener("keydown", handleKeyDown);
|
|
179
|
+
return () => {
|
|
180
|
+
rootNode.removeEventListener("click", handleClick);
|
|
181
|
+
rootNode.removeEventListener("keydown", handleKeyDown);
|
|
182
|
+
};
|
|
183
|
+
}, [
|
|
184
|
+
rootRef,
|
|
185
|
+
rootSelector,
|
|
186
|
+
selector
|
|
187
|
+
]);
|
|
188
|
+
return /* @__PURE__ */ jsx(Lightbox, {
|
|
189
|
+
open,
|
|
190
|
+
onOpenChange: setOpen,
|
|
191
|
+
onOpenChangeComplete: (nextOpen) => {
|
|
192
|
+
if (!nextOpen) setImage(null);
|
|
193
|
+
},
|
|
194
|
+
children: /* @__PURE__ */ jsx(LightboxContent, {
|
|
195
|
+
className,
|
|
196
|
+
closeLabel,
|
|
197
|
+
showCloseButton,
|
|
198
|
+
closeOnContentClick,
|
|
199
|
+
children: image ? /* @__PURE__ */ jsx("img", {
|
|
200
|
+
"data-slot": "lightbox-content-image",
|
|
201
|
+
src: image.src,
|
|
202
|
+
alt: image.alt ?? ""
|
|
203
|
+
}) : null
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { Lightbox, LightboxBackdrop, LightboxClose, LightboxCloseButton, LightboxContent, LightboxFrame, LightboxGallery, LightboxImage, LightboxPopup, LightboxPortal, LightboxTrigger, LightboxViewport, createLightboxHandle };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './Lightbox.css';
|
|
2
|
+
//#region src/components/Lightbox/Lightbox.module.css
|
|
3
|
+
var Lightbox_module_default = {
|
|
4
|
+
"backdrop": "LTYCWG_backdrop",
|
|
5
|
+
"closeButton": "LTYCWG_closeButton",
|
|
6
|
+
"contentClose": "LTYCWG_contentClose",
|
|
7
|
+
"frame": "LTYCWG_frame",
|
|
8
|
+
"lightbox-image-enter": "LTYCWG_lightbox-image-enter",
|
|
9
|
+
"popup": "LTYCWG_popup",
|
|
10
|
+
"trigger": "LTYCWG_trigger",
|
|
11
|
+
"viewport": "LTYCWG_viewport"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.default = Lightbox_module_default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './Lightbox.css';
|
|
2
|
+
//#region src/components/Lightbox/Lightbox.module.css
|
|
3
|
+
var Lightbox_module_default = {
|
|
4
|
+
"backdrop": "LTYCWG_backdrop",
|
|
5
|
+
"closeButton": "LTYCWG_closeButton",
|
|
6
|
+
"contentClose": "LTYCWG_contentClose",
|
|
7
|
+
"frame": "LTYCWG_frame",
|
|
8
|
+
"lightbox-image-enter": "LTYCWG_lightbox-image-enter",
|
|
9
|
+
"popup": "LTYCWG_popup",
|
|
10
|
+
"trigger": "LTYCWG_trigger",
|
|
11
|
+
"viewport": "LTYCWG_viewport"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Lightbox_module_default as default };
|