@moduix/react 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +252 -0
- package/dist/components/accordion/Accordion.css +190 -0
- package/dist/components/accordion/Accordion.d.ts +13 -0
- package/dist/components/accordion/Accordion.js +67 -0
- package/dist/components/accordion/Accordion.module.js +15 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/alert/Alert.css +108 -0
- package/dist/components/alert/Alert.d.ts +14 -0
- package/dist/components/alert/Alert.js +69 -0
- package/dist/components/alert/Alert.module.js +11 -0
- package/dist/components/angle-slider/AngleSlider.css +192 -0
- package/dist/components/angle-slider/AngleSlider.d.ts +16 -0
- package/dist/components/angle-slider/AngleSlider.js +92 -0
- package/dist/components/angle-slider/AngleSlider.module.js +13 -0
- package/dist/components/angle-slider/index.d.ts +2 -0
- package/dist/components/aspect-ratio/AspectRatio.css +14 -0
- package/dist/components/aspect-ratio/AspectRatio.d.ts +10 -0
- package/dist/components/aspect-ratio/AspectRatio.js +24 -0
- package/dist/components/aspect-ratio/AspectRatio.module.js +5 -0
- package/dist/components/avatar/Avatar.css +75 -0
- package/dist/components/avatar/Avatar.d.ts +19 -0
- package/dist/components/avatar/Avatar.js +49 -0
- package/dist/components/avatar/Avatar.module.js +9 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/badge/Badge.css +66 -0
- package/dist/components/badge/Badge.d.ts +11 -0
- package/dist/components/badge/Badge.js +35 -0
- package/dist/components/badge/Badge.module.js +8 -0
- package/dist/components/bleed/Bleed.css +51 -0
- package/dist/components/bleed/Bleed.d.ts +12 -0
- package/dist/components/bleed/Bleed.js +22 -0
- package/dist/components/bleed/Bleed.module.js +5 -0
- package/dist/components/breadcrumbs/Breadcrumbs.css +90 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +12 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +95 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.js +13 -0
- package/dist/components/button/Button.css +193 -0
- package/dist/components/button/Button.d.ts +14 -0
- package/dist/components/button/Button.js +28 -0
- package/dist/components/button/Button.module.js +5 -0
- package/dist/components/card/Card.css +148 -0
- package/dist/components/card/Card.d.ts +19 -0
- package/dist/components/card/Card.js +101 -0
- package/dist/components/card/Card.module.js +14 -0
- package/dist/components/carousel/Carousel.css +198 -0
- package/dist/components/carousel/Carousel.d.ts +19 -0
- package/dist/components/carousel/Carousel.js +128 -0
- package/dist/components/carousel/Carousel.module.js +18 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/checkbox/Checkbox.css +135 -0
- package/dist/components/checkbox/Checkbox.d.ts +22 -0
- package/dist/components/checkbox/Checkbox.js +84 -0
- package/dist/components/checkbox/Checkbox.module.js +12 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/clipboard/Clipboard.css +145 -0
- package/dist/components/clipboard/Clipboard.d.ts +15 -0
- package/dist/components/clipboard/Clipboard.js +96 -0
- package/dist/components/clipboard/Clipboard.module.js +14 -0
- package/dist/components/clipboard/index.d.ts +2 -0
- package/dist/components/close-button/CloseButton.css +49 -0
- package/dist/components/close-button/CloseButton.d.ts +6 -0
- package/dist/components/close-button/CloseButton.js +39 -0
- package/dist/components/close-button/CloseButton.module.js +5 -0
- package/dist/components/collapsible/Collapsible.css +138 -0
- package/dist/components/collapsible/Collapsible.d.ts +12 -0
- package/dist/components/collapsible/Collapsible.js +59 -0
- package/dist/components/collapsible/Collapsible.module.js +12 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/color-picker/ColorPicker.css +433 -0
- package/dist/components/color-picker/ColorPicker.d.ts +39 -0
- package/dist/components/color-picker/ColorPicker.js +275 -0
- package/dist/components/color-picker/ColorPicker.module.js +33 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/combobox/Combobox.css +315 -0
- package/dist/components/combobox/Combobox.d.ts +24 -0
- package/dist/components/combobox/Combobox.js +169 -0
- package/dist/components/combobox/Combobox.module.js +23 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/command-palette/CommandPalette.css +492 -0
- package/dist/components/command-palette/CommandPalette.d.ts +71 -0
- package/dist/components/command-palette/CommandPalette.js +383 -0
- package/dist/components/command-palette/CommandPalette.module.js +43 -0
- package/dist/components/command-palette/index.d.ts +2 -0
- package/dist/components/container/Container.css +45 -0
- package/dist/components/container/Container.d.ts +14 -0
- package/dist/components/container/Container.js +22 -0
- package/dist/components/container/Container.module.js +5 -0
- package/dist/components/date-input/DateInput.css +104 -0
- package/dist/components/date-input/DateInput.d.ts +22 -0
- package/dist/components/date-input/DateInput.js +83 -0
- package/dist/components/date-input/DateInput.module.js +12 -0
- package/dist/components/date-input/index.d.ts +2 -0
- package/dist/components/date-picker/DatePicker.css +420 -0
- package/dist/components/date-picker/DatePicker.d.ts +39 -0
- package/dist/components/date-picker/DatePicker.js +284 -0
- package/dist/components/date-picker/DatePicker.module.js +29 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/dialog/Dialog.css +221 -0
- package/dist/components/dialog/Dialog.d.ts +46 -0
- package/dist/components/dialog/Dialog.js +133 -0
- package/dist/components/dialog/Dialog.module.js +21 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/drawer/Drawer.css +482 -0
- package/dist/components/drawer/Drawer.d.ts +56 -0
- package/dist/components/drawer/Drawer.js +188 -0
- package/dist/components/drawer/Drawer.module.js +32 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/editable/Editable.css +171 -0
- package/dist/components/editable/Editable.d.ts +17 -0
- package/dist/components/editable/Editable.js +106 -0
- package/dist/components/editable/Editable.module.js +13 -0
- package/dist/components/editable/index.d.ts +2 -0
- package/dist/components/empty/Empty.css +78 -0
- package/dist/components/empty/Empty.d.ts +11 -0
- package/dist/components/empty/Empty.js +77 -0
- package/dist/components/empty/Empty.module.js +12 -0
- package/dist/components/field/Field.css +113 -0
- package/dist/components/field/Field.d.ts +25 -0
- package/dist/components/field/Field.js +104 -0
- package/dist/components/field/Field.module.js +15 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/fieldset/Fieldset.css +52 -0
- package/dist/components/fieldset/Fieldset.d.ts +12 -0
- package/dist/components/fieldset/Fieldset.js +56 -0
- package/dist/components/fieldset/Fieldset.module.js +10 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.css +290 -0
- package/dist/components/file-upload/FileUpload.d.ts +28 -0
- package/dist/components/file-upload/FileUpload.js +149 -0
- package/dist/components/file-upload/FileUpload.module.js +19 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/floating-panel/FloatingPanel.css +319 -0
- package/dist/components/floating-panel/FloatingPanel.d.ts +45 -0
- package/dist/components/floating-panel/FloatingPanel.js +194 -0
- package/dist/components/floating-panel/FloatingPanel.module.js +20 -0
- package/dist/components/floating-panel/index.d.ts +2 -0
- package/dist/components/heading/Heading.css +58 -0
- package/dist/components/heading/Heading.d.ts +17 -0
- package/dist/components/heading/Heading.js +32 -0
- package/dist/components/heading/Heading.module.js +5 -0
- package/dist/components/highlight/Highlight.css +15 -0
- package/dist/components/highlight/Highlight.d.ts +13 -0
- package/dist/components/highlight/Highlight.js +18 -0
- package/dist/components/highlight/Highlight.module.js +5 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/hover-card/HoverCard.css +107 -0
- package/dist/components/hover-card/HoverCard.d.ts +28 -0
- package/dist/components/hover-card/HoverCard.js +81 -0
- package/dist/components/hover-card/HoverCard.module.js +13 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/image-cropper/ImageCropper.css +147 -0
- package/dist/components/image-cropper/ImageCropper.d.ts +15 -0
- package/dist/components/image-cropper/ImageCropper.js +75 -0
- package/dist/components/image-cropper/ImageCropper.module.js +12 -0
- package/dist/components/image-cropper/index.d.ts +2 -0
- package/dist/components/input/Input.css +83 -0
- package/dist/components/input/Input.d.ts +15 -0
- package/dist/components/input/Input.js +22 -0
- package/dist/components/input/Input.module.js +5 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input-group/InputGroup.css +158 -0
- package/dist/components/input-group/InputGroup.d.ts +25 -0
- package/dist/components/input-group/InputGroup.js +76 -0
- package/dist/components/input-group/InputGroup.module.js +11 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/kbd/Kbd.css +45 -0
- package/dist/components/kbd/Kbd.d.ts +7 -0
- package/dist/components/kbd/Kbd.js +33 -0
- package/dist/components/kbd/Kbd.module.js +8 -0
- package/dist/components/lightbox/Lightbox.css +242 -0
- package/dist/components/lightbox/Lightbox.d.ts +71 -0
- package/dist/components/lightbox/Lightbox.js +219 -0
- package/dist/components/lightbox/Lightbox.module.js +22 -0
- package/dist/components/lightbox/index.d.ts +2 -0
- package/dist/components/list/List.css +118 -0
- package/dist/components/list/List.d.ts +24 -0
- package/dist/components/list/List.js +48 -0
- package/dist/components/list/List.module.js +5 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/listbox/Listbox.css +255 -0
- package/dist/components/listbox/Listbox.d.ts +35 -0
- package/dist/components/listbox/Listbox.js +145 -0
- package/dist/components/listbox/Listbox.module.js +20 -0
- package/dist/components/listbox/index.d.ts +2 -0
- package/dist/components/marquee/Marquee.css +114 -0
- package/dist/components/marquee/Marquee.d.ts +13 -0
- package/dist/components/marquee/Marquee.js +65 -0
- package/dist/components/marquee/Marquee.module.js +13 -0
- package/dist/components/marquee/index.d.ts +2 -0
- package/dist/components/menu/Menu.css +371 -0
- package/dist/components/menu/Menu.d.ts +83 -0
- package/dist/components/menu/Menu.js +240 -0
- package/dist/components/menu/Menu.module.js +33 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/native-select/NativeSelect.css +104 -0
- package/dist/components/native-select/NativeSelect.d.ts +8 -0
- package/dist/components/native-select/NativeSelect.js +32 -0
- package/dist/components/native-select/NativeSelect.module.js +9 -0
- package/dist/components/native-select/index.d.ts +2 -0
- package/dist/components/number-input/NumberInput.css +162 -0
- package/dist/components/number-input/NumberInput.d.ts +16 -0
- package/dist/components/number-input/NumberInput.js +95 -0
- package/dist/components/number-input/NumberInput.module.js +14 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/pagination/Pagination.css +99 -0
- package/dist/components/pagination/Pagination.d.ts +16 -0
- package/dist/components/pagination/Pagination.js +101 -0
- package/dist/components/pagination/Pagination.module.js +12 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/password-input/PasswordInput.css +155 -0
- package/dist/components/password-input/PasswordInput.d.ts +14 -0
- package/dist/components/password-input/PasswordInput.js +77 -0
- package/dist/components/password-input/PasswordInput.module.js +12 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/pin-input/PinInput.css +96 -0
- package/dist/components/pin-input/PinInput.d.ts +23 -0
- package/dist/components/pin-input/PinInput.js +85 -0
- package/dist/components/pin-input/PinInput.module.js +11 -0
- package/dist/components/pin-input/index.d.ts +2 -0
- package/dist/components/popover/Popover.css +162 -0
- package/dist/components/popover/Popover.d.ts +50 -0
- package/dist/components/popover/Popover.js +167 -0
- package/dist/components/popover/Popover.module.js +20 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/progress-circular/ProgressCircular.css +68 -0
- package/dist/components/progress-circular/ProgressCircular.d.ts +15 -0
- package/dist/components/progress-circular/ProgressCircular.js +83 -0
- package/dist/components/progress-circular/ProgressCircular.module.js +14 -0
- package/dist/components/progress-circular/index.d.ts +2 -0
- package/dist/components/progress-linear/ProgressLinear.css +106 -0
- package/dist/components/progress-linear/ProgressLinear.d.ts +14 -0
- package/dist/components/progress-linear/ProgressLinear.js +74 -0
- package/dist/components/progress-linear/ProgressLinear.module.js +14 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/qr-code/QrCode.css +100 -0
- package/dist/components/qr-code/QrCode.d.ts +13 -0
- package/dist/components/qr-code/QrCode.js +65 -0
- package/dist/components/qr-code/QrCode.module.js +11 -0
- package/dist/components/qr-code/index.d.ts +2 -0
- package/dist/components/radio-group/RadioGroup.css +147 -0
- package/dist/components/radio-group/RadioGroup.d.ts +20 -0
- package/dist/components/radio-group/RadioGroup.js +83 -0
- package/dist/components/radio-group/RadioGroup.module.js +12 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/rating-group/RatingGroup.css +133 -0
- package/dist/components/rating-group/RatingGroup.d.ts +23 -0
- package/dist/components/rating-group/RatingGroup.js +86 -0
- package/dist/components/rating-group/RatingGroup.module.js +13 -0
- package/dist/components/rating-group/index.d.ts +2 -0
- package/dist/components/scroll-area/ScrollArea.css +162 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +21 -0
- package/dist/components/scroll-area/ScrollArea.js +76 -0
- package/dist/components/scroll-area/ScrollArea.module.js +12 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/segment-group/SegmentGroup.css +120 -0
- package/dist/components/segment-group/SegmentGroup.d.ts +15 -0
- package/dist/components/segment-group/SegmentGroup.js +83 -0
- package/dist/components/segment-group/SegmentGroup.module.js +12 -0
- package/dist/components/segment-group/index.d.ts +2 -0
- package/dist/components/select/Select.css +351 -0
- package/dist/components/select/Select.d.ts +48 -0
- package/dist/components/select/Select.js +210 -0
- package/dist/components/select/Select.module.js +27 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/separator/Separator.css +45 -0
- package/dist/components/separator/Separator.d.ts +14 -0
- package/dist/components/separator/Separator.js +27 -0
- package/dist/components/separator/Separator.module.js +5 -0
- package/dist/components/sidebar/Sidebar.css +341 -0
- package/dist/components/sidebar/Sidebar.d.ts +48 -0
- package/dist/components/sidebar/Sidebar.js +279 -0
- package/dist/components/sidebar/Sidebar.module.js +23 -0
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/signature-pad/SignaturePad.css +123 -0
- package/dist/components/signature-pad/SignaturePad.d.ts +15 -0
- package/dist/components/signature-pad/SignaturePad.js +82 -0
- package/dist/components/signature-pad/SignaturePad.module.js +12 -0
- package/dist/components/signature-pad/index.d.ts +2 -0
- package/dist/components/simple-grid/SimpleGrid.d.ts +18 -0
- package/dist/components/simple-grid/SimpleGrid.js +32 -0
- package/dist/components/skeleton/Skeleton.css +29 -0
- package/dist/components/skeleton/Skeleton.d.ts +20 -0
- package/dist/components/skeleton/Skeleton.js +32 -0
- package/dist/components/skeleton/Skeleton.module.js +5 -0
- package/dist/components/slider/Slider.css +167 -0
- package/dist/components/slider/Slider.d.ts +19 -0
- package/dist/components/slider/Slider.js +119 -0
- package/dist/components/slider/Slider.module.js +16 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/spinner/Spinner.css +60 -0
- package/dist/components/spinner/Spinner.d.ts +12 -0
- package/dist/components/spinner/Spinner.js +40 -0
- package/dist/components/spinner/Spinner.module.js +9 -0
- package/dist/components/split-button/SplitButton.css +51 -0
- package/dist/components/split-button/SplitButton.d.ts +36 -0
- package/dist/components/split-button/SplitButton.js +93 -0
- package/dist/components/split-button/SplitButton.module.js +9 -0
- package/dist/components/split-button/index.d.ts +2 -0
- package/dist/components/splitter/Splitter.css +170 -0
- package/dist/components/splitter/Splitter.d.ts +12 -0
- package/dist/components/splitter/Splitter.js +68 -0
- package/dist/components/splitter/Splitter.module.js +10 -0
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/stack/Stack.css +13 -0
- package/dist/components/stack/Stack.d.ts +31 -0
- package/dist/components/stack/Stack.js +36 -0
- package/dist/components/stack/Stack.module.js +5 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/steps/Steps.css +283 -0
- package/dist/components/steps/Steps.d.ts +19 -0
- package/dist/components/steps/Steps.js +122 -0
- package/dist/components/steps/Steps.module.js +17 -0
- package/dist/components/steps/index.d.ts +2 -0
- package/dist/components/switch/Switch.css +130 -0
- package/dist/components/switch/Switch.d.ts +21 -0
- package/dist/components/switch/Switch.js +67 -0
- package/dist/components/switch/Switch.module.js +10 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/table/Table.css +162 -0
- package/dist/components/table/Table.d.ts +41 -0
- package/dist/components/table/Table.js +173 -0
- package/dist/components/table/Table.module.js +18 -0
- package/dist/components/tabs/Tabs.css +186 -0
- package/dist/components/tabs/Tabs.d.ts +20 -0
- package/dist/components/tabs/Tabs.js +67 -0
- package/dist/components/tabs/Tabs.module.js +11 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tag/Tag.css +128 -0
- package/dist/components/tag/Tag.d.ts +18 -0
- package/dist/components/tag/Tag.js +87 -0
- package/dist/components/tag/Tag.module.js +11 -0
- package/dist/components/tags-input/TagsInput.css +248 -0
- package/dist/components/tags-input/TagsInput.d.ts +20 -0
- package/dist/components/tags-input/TagsInput.js +139 -0
- package/dist/components/tags-input/TagsInput.module.js +16 -0
- package/dist/components/tags-input/index.d.ts +2 -0
- package/dist/components/text/Text.css +87 -0
- package/dist/components/text/Text.d.ts +27 -0
- package/dist/components/text/Text.js +43 -0
- package/dist/components/text/Text.module.js +5 -0
- package/dist/components/textarea/Textarea.css +55 -0
- package/dist/components/textarea/Textarea.d.ts +6 -0
- package/dist/components/textarea/Textarea.js +21 -0
- package/dist/components/textarea/Textarea.module.js +5 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/timer/Timer.css +95 -0
- package/dist/components/timer/Timer.d.ts +14 -0
- package/dist/components/timer/Timer.js +74 -0
- package/dist/components/timer/Timer.module.js +12 -0
- package/dist/components/timer/index.d.ts +2 -0
- package/dist/components/toast/Toast.css +154 -0
- package/dist/components/toast/Toast.d.ts +17 -0
- package/dist/components/toast/Toast.js +92 -0
- package/dist/components/toast/Toast.module.js +12 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toggle/Toggle.css +167 -0
- package/dist/components/toggle/Toggle.d.ts +16 -0
- package/dist/components/toggle/Toggle.js +31 -0
- package/dist/components/toggle/Toggle.module.js +8 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle-group/ToggleGroup.css +42 -0
- package/dist/components/toggle-group/ToggleGroup.d.ts +25 -0
- package/dist/components/toggle-group/ToggleGroup.js +62 -0
- package/dist/components/toggle-group/ToggleGroup.module.js +8 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.css +125 -0
- package/dist/components/tooltip/Tooltip.d.ts +28 -0
- package/dist/components/tooltip/Tooltip.js +75 -0
- package/dist/components/tooltip/Tooltip.module.js +13 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tour/Tour.css +286 -0
- package/dist/components/tour/Tour.d.ts +30 -0
- package/dist/components/tour/Tour.js +149 -0
- package/dist/components/tour/Tour.module.js +23 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tree-view/TreeView.css +261 -0
- package/dist/components/tree-view/TreeView.d.ts +32 -0
- package/dist/components/tree-view/TreeView.js +171 -0
- package/dist/components/tree-view/TreeView.module.js +26 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +83 -0
- package/dist/lib/moduix/icons/ui/Icons.d.ts +51 -0
- package/dist/lib/moduix/icons/ui/Icons.js +759 -0
- package/dist/lib/moduix/icons/ui/index.d.ts +2 -0
- package/dist/lib/moduix/normalizeClassName.js +4 -0
- package/dist/lib/moduix/overlayPortal.d.ts +9 -0
- package/dist/lib/moduix/overlayPortal.js +21 -0
- package/dist/lib/moduix/styles/reset.css +175 -0
- package/dist/lib/moduix/styles/style.css +288 -0
- package/dist/reset.d.ts +1 -0
- package/dist/reset.js +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
@layer ui.components {
|
|
2
|
+
.Jmwb8W_trigger {
|
|
3
|
+
cursor: zoom-in;
|
|
4
|
+
|
|
5
|
+
&:focus-visible {
|
|
6
|
+
outline: var(--lightbox-trigger-focus-ring-width, var(--border-width-md)) solid
|
|
7
|
+
var(--lightbox-trigger-focus-ring-color, var(--color-ring));
|
|
8
|
+
outline-offset: var(--lightbox-trigger-focus-ring-offset, 2px);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.Jmwb8W_backdrop {
|
|
13
|
+
z-index: calc(var(--z-backdrop) + var(--layer-index, 0));
|
|
14
|
+
background-color: var(--lightbox-backdrop-bg, var(--backdrop-bg, var(--color-overlay)));
|
|
15
|
+
min-height: 100dvh;
|
|
16
|
+
backdrop-filter: var(--backdrop-filter, blur(var(--lightbox-backdrop-blur, 4px)));
|
|
17
|
+
position: fixed;
|
|
18
|
+
inset: 0;
|
|
19
|
+
|
|
20
|
+
&[data-state="open"] {
|
|
21
|
+
animation: Jmwb8W_lightbox-backdrop-in var(--lightbox-backdrop-transition, var(--transition-default));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&[data-state="closed"] {
|
|
25
|
+
animation: Jmwb8W_lightbox-backdrop-out
|
|
26
|
+
var(--lightbox-backdrop-transition, var(--transition-default));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.Jmwb8W_positioner {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
z-index: calc(var(--z-modal) + var(--layer-index, 0));
|
|
33
|
+
overscroll-behavior: contain;
|
|
34
|
+
padding: var(--lightbox-positioner-padding, var(--spacing-4));
|
|
35
|
+
place-items: center;
|
|
36
|
+
display: grid;
|
|
37
|
+
position: fixed;
|
|
38
|
+
inset: 0;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.Jmwb8W_content {
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
gap: var(--lightbox-content-gap, var(--spacing-3));
|
|
45
|
+
width: fit-content;
|
|
46
|
+
max-width: min(var(--lightbox-content-max-width, 80vw), calc(100vw - var(--spacing-8)));
|
|
47
|
+
max-height: min(var(--lightbox-content-max-height, 80dvh), calc(100dvh - var(--spacing-8)));
|
|
48
|
+
background: none;
|
|
49
|
+
border: 0;
|
|
50
|
+
outline: 0;
|
|
51
|
+
display: grid;
|
|
52
|
+
position: relative;
|
|
53
|
+
|
|
54
|
+
&[data-state="open"] {
|
|
55
|
+
animation: Jmwb8W_lightbox-content-in var(--lightbox-transition, .22s ease);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&[data-state="closed"] {
|
|
59
|
+
animation: Jmwb8W_lightbox-content-out var(--lightbox-transition, .22s ease);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.Jmwb8W_title {
|
|
64
|
+
color: var(--lightbox-title-color, var(--color-foreground));
|
|
65
|
+
font-size: var(--lightbox-title-font-size, var(--text-md));
|
|
66
|
+
font-weight: var(--lightbox-title-font-weight, var(--weight-semibold));
|
|
67
|
+
line-height: var(--lightbox-title-line-height, var(--line-height-text-md));
|
|
68
|
+
margin: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.Jmwb8W_description {
|
|
72
|
+
color: var(--lightbox-description-color, var(--color-muted-foreground));
|
|
73
|
+
font-size: var(--lightbox-description-font-size, var(--text-sm));
|
|
74
|
+
line-height: var(--lightbox-description-line-height, var(--line-height-text-sm));
|
|
75
|
+
margin: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.Jmwb8W_header {
|
|
79
|
+
gap: var(--lightbox-header-gap, var(--spacing-1));
|
|
80
|
+
display: grid;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.Jmwb8W_body {
|
|
84
|
+
gap: var(--lightbox-body-gap, var(--spacing-3));
|
|
85
|
+
display: grid;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.Jmwb8W_footer {
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: var(--lightbox-footer-justify, flex-end);
|
|
91
|
+
gap: var(--lightbox-footer-gap, var(--spacing-2));
|
|
92
|
+
color: var(--lightbox-footer-color, var(--color-muted-foreground));
|
|
93
|
+
font-size: var(--lightbox-footer-font-size, var(--text-sm));
|
|
94
|
+
line-height: var(--lightbox-footer-line-height, var(--line-height-text-sm));
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.Jmwb8W_image {
|
|
99
|
+
max-width: min(var(--lightbox-media-max-width, 80vw), 100%);
|
|
100
|
+
max-height: min(var(--lightbox-media-max-height, 80dvh), 100%);
|
|
101
|
+
object-fit: contain;
|
|
102
|
+
border-radius: var(--lightbox-media-radius, var(--radius-md));
|
|
103
|
+
box-shadow: var(--lightbox-media-shadow, var(--shadow-lg));
|
|
104
|
+
user-select: none;
|
|
105
|
+
display: block;
|
|
106
|
+
|
|
107
|
+
&[data-close-on-click] {
|
|
108
|
+
cursor: zoom-out;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.Jmwb8W_gallery {
|
|
113
|
+
--carousel-gap: var(--lightbox-gallery-gap, var(--spacing-4));
|
|
114
|
+
width: auto;
|
|
115
|
+
max-width: min(var(--lightbox-gallery-max-width, 72rem),
|
|
116
|
+
calc(100vw - var(--lightbox-positioner-padding, var(--spacing-4)) * 2));
|
|
117
|
+
justify-self: center;
|
|
118
|
+
|
|
119
|
+
& [data-slot="carousel-control"] {
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
& [data-slot="carousel-item-group"] {
|
|
124
|
+
aspect-ratio: var(--lightbox-gallery-aspect-ratio, 16 / 10);
|
|
125
|
+
max-height: min(var(--lightbox-gallery-track-max-height, 68dvh),
|
|
126
|
+
var(--lightbox-media-max-height, 80dvh));
|
|
127
|
+
background: var(--lightbox-gallery-track-bg, color-mix(in oklab, black 88%, var(--color-background) 12%));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
& [data-slot="carousel-item"] {
|
|
131
|
+
place-items: center;
|
|
132
|
+
height: 100%;
|
|
133
|
+
display: grid;
|
|
134
|
+
|
|
135
|
+
& img, & video {
|
|
136
|
+
object-fit: contain;
|
|
137
|
+
border-radius: var(--lightbox-media-radius, var(--radius-md));
|
|
138
|
+
user-select: none;
|
|
139
|
+
width: 100%;
|
|
140
|
+
height: 100%;
|
|
141
|
+
display: block;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
& [data-slot="carousel-indicator-group"] {
|
|
146
|
+
flex-wrap: wrap;
|
|
147
|
+
width: fit-content;
|
|
148
|
+
max-width: 100%;
|
|
149
|
+
margin-inline: auto;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
& [data-slot="carousel-indicator"]:has(img) {
|
|
153
|
+
width: var(--lightbox-gallery-thumbnail-width, 5rem);
|
|
154
|
+
height: var(--lightbox-gallery-thumbnail-height, 3rem);
|
|
155
|
+
border: var(--border-width-sm) solid transparent;
|
|
156
|
+
border-radius: var(--lightbox-gallery-thumbnail-radius, var(--radius-md));
|
|
157
|
+
opacity: var(--lightbox-gallery-thumbnail-opacity, .65);
|
|
158
|
+
transition: border-color var(--transition-fast),
|
|
159
|
+
opacity var(--transition-fast),
|
|
160
|
+
transform var(--transition-fast);
|
|
161
|
+
background: none;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
|
|
164
|
+
&:hover {
|
|
165
|
+
opacity: var(--lightbox-gallery-thumbnail-opacity-hover, .9);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&[data-current] {
|
|
169
|
+
width: var(--lightbox-gallery-thumbnail-width, 5rem);
|
|
170
|
+
border-color: var(--lightbox-gallery-thumbnail-border-color, var(--color-primary));
|
|
171
|
+
opacity: 1;
|
|
172
|
+
background: none;
|
|
173
|
+
transform: translateY(-1px);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
& img {
|
|
177
|
+
object-fit: cover;
|
|
178
|
+
width: 100%;
|
|
179
|
+
height: 100%;
|
|
180
|
+
display: block;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.Jmwb8W_closeIcon {
|
|
186
|
+
--close-button-size: var(--lightbox-close-icon-size, 2rem);
|
|
187
|
+
--close-button-radius: var(--lightbox-close-icon-radius, var(--radius-sm));
|
|
188
|
+
--close-button-icon-size: var(--lightbox-close-icon-glyph-size, .875rem);
|
|
189
|
+
--close-button-color: var(--lightbox-close-icon-color, var(--color-foreground));
|
|
190
|
+
--close-button-color-hover: var(--lightbox-close-icon-color-hover, var(--color-foreground));
|
|
191
|
+
--close-button-bg: var(--lightbox-close-icon-bg, var(--color-background));
|
|
192
|
+
--close-button-bg-hover: var(--lightbox-close-icon-bg-hover, var(--color-muted));
|
|
193
|
+
--close-button-focus-ring-color: var(--lightbox-close-icon-focus-ring-color, var(--color-ring));
|
|
194
|
+
z-index: calc(var(--z-modal) + var(--layer-index, 0) + 1);
|
|
195
|
+
opacity: 0;
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
visibility: hidden;
|
|
198
|
+
border: 0;
|
|
199
|
+
padding: 0;
|
|
200
|
+
position: fixed;
|
|
201
|
+
inset-block-start: var(--lightbox-close-icon-inset-block-start, var(--spacing-4));
|
|
202
|
+
inset-inline-end: var(--lightbox-close-icon-inset-inline-end, var(--spacing-4));
|
|
203
|
+
|
|
204
|
+
&[data-state="open"] {
|
|
205
|
+
opacity: 1;
|
|
206
|
+
pointer-events: auto;
|
|
207
|
+
visibility: visible;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@keyframes Jmwb8W_lightbox-backdrop-in {
|
|
212
|
+
from {
|
|
213
|
+
opacity: var(--lightbox-backdrop-starting-opacity, 0);
|
|
214
|
+
backdrop-filter: var(--lightbox-backdrop-starting-blur, none);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@keyframes Jmwb8W_lightbox-backdrop-out {
|
|
219
|
+
to {
|
|
220
|
+
opacity: var(--lightbox-backdrop-ending-opacity, 0);
|
|
221
|
+
backdrop-filter: var(--lightbox-backdrop-ending-blur, none);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@keyframes Jmwb8W_lightbox-content-in {
|
|
226
|
+
from {
|
|
227
|
+
opacity: var(--lightbox-content-starting-opacity, 0);
|
|
228
|
+
translate: var(--lightbox-content-starting-translate-x, 0)
|
|
229
|
+
var(--lightbox-content-starting-translate-y, 0);
|
|
230
|
+
scale: var(--lightbox-content-starting-scale, .82);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@keyframes Jmwb8W_lightbox-content-out {
|
|
235
|
+
to {
|
|
236
|
+
opacity: var(--lightbox-content-ending-opacity, 0);
|
|
237
|
+
translate: var(--lightbox-content-ending-translate-x, 0)
|
|
238
|
+
var(--lightbox-content-ending-translate-y, 0);
|
|
239
|
+
scale: var(--lightbox-content-ending-scale, .82);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { OverlayPortalProps } from "../../lib/moduix/overlayPortal.js";
|
|
2
|
+
import { ComponentProps, RefObject } from "react";
|
|
3
|
+
import { Dialog } from "@ark-ui/react/dialog";
|
|
4
|
+
|
|
5
|
+
//#region src/components/lightbox/Lightbox.d.ts
|
|
6
|
+
type LightboxImageSelectDetails = {
|
|
7
|
+
alt?: string;
|
|
8
|
+
element: HTMLImageElement;
|
|
9
|
+
src: string;
|
|
10
|
+
};
|
|
11
|
+
type LightboxImageProps = ComponentProps<'img'> & {
|
|
12
|
+
closeOnClick?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type LightboxRootProps = ComponentProps<typeof Dialog.Root> & OverlayPortalProps;
|
|
15
|
+
type LightboxRootProviderProps = ComponentProps<typeof Dialog.RootProvider> & OverlayPortalProps;
|
|
16
|
+
type LightboxBindProps = {
|
|
17
|
+
onImageSelect: (details: LightboxImageSelectDetails) => void;
|
|
18
|
+
selector?: string;
|
|
19
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
20
|
+
rootSelector?: string;
|
|
21
|
+
};
|
|
22
|
+
declare function LightboxRoot({
|
|
23
|
+
portalled,
|
|
24
|
+
portalRef,
|
|
25
|
+
...props
|
|
26
|
+
}: LightboxRootProps): import("react").JSX.Element;
|
|
27
|
+
declare function LightboxRootProvider({
|
|
28
|
+
portalled,
|
|
29
|
+
portalRef,
|
|
30
|
+
...props
|
|
31
|
+
}: LightboxRootProviderProps): import("react").JSX.Element;
|
|
32
|
+
declare const LightboxImage: import("react").ForwardRefExoticComponent<Omit<LightboxImageProps, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
33
|
+
declare const LightboxGallery: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare function LightboxHeader({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: ComponentProps<'div'>): import("react").JSX.Element;
|
|
38
|
+
declare function LightboxBody({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: ComponentProps<'div'>): import("react").JSX.Element;
|
|
42
|
+
declare function LightboxFooter({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: ComponentProps<'div'>): import("react").JSX.Element;
|
|
46
|
+
declare function LightboxBind({
|
|
47
|
+
onImageSelect,
|
|
48
|
+
selector,
|
|
49
|
+
rootRef,
|
|
50
|
+
rootSelector
|
|
51
|
+
}: LightboxBindProps): null;
|
|
52
|
+
declare const Lightbox: typeof LightboxRoot & {
|
|
53
|
+
Root: typeof LightboxRoot;
|
|
54
|
+
RootProvider: typeof LightboxRootProvider;
|
|
55
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<Dialog.TriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
56
|
+
Backdrop: import("react").ForwardRefExoticComponent<Omit<Dialog.BackdropProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
+
Positioner: import("react").ForwardRefExoticComponent<Omit<Dialog.PositionerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
|
+
Content: import("react").ForwardRefExoticComponent<Omit<Dialog.ContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
Title: import("react").ForwardRefExoticComponent<Omit<Dialog.TitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
60
|
+
Description: import("react").ForwardRefExoticComponent<Omit<Dialog.DescriptionProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
61
|
+
CloseTrigger: import("react").ForwardRefExoticComponent<Omit<Dialog.CloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
CloseIcon: import("react").ForwardRefExoticComponent<Omit<Omit<Dialog.CloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "asChild">, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
63
|
+
Header: typeof LightboxHeader;
|
|
64
|
+
Body: typeof LightboxBody;
|
|
65
|
+
Footer: typeof LightboxFooter;
|
|
66
|
+
Image: import("react").ForwardRefExoticComponent<Omit<LightboxImageProps, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
67
|
+
Gallery: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
Bind: typeof LightboxBind;
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { Lightbox, LightboxBind, type LightboxBindProps, LightboxGallery, LightboxImage, type LightboxImageSelectDetails };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { normalizeClassName } from "../../lib/moduix/normalizeClassName.js";
|
|
2
|
+
import { CloseButton } from "../close-button/CloseButton.js";
|
|
3
|
+
import { OverlayPortal, OverlayPortalProvider } from "../../lib/moduix/overlayPortal.js";
|
|
4
|
+
import Lightbox_module_default from "./Lightbox.module.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { forwardRef, useEffect } from "react";
|
|
8
|
+
import { Dialog, useDialogContext } from "@ark-ui/react/dialog";
|
|
9
|
+
//#region src/components/lightbox/Lightbox.tsx
|
|
10
|
+
const DEFAULT_CLOSE_LABEL = "Close image";
|
|
11
|
+
const preloadedImageSources = /* @__PURE__ */ new Set();
|
|
12
|
+
function preloadImage(src) {
|
|
13
|
+
if (!src || typeof Image === "undefined" || preloadedImageSources.has(src)) return;
|
|
14
|
+
preloadedImageSources.add(src);
|
|
15
|
+
const image = new Image();
|
|
16
|
+
image.src = src;
|
|
17
|
+
}
|
|
18
|
+
function resolveImage(target, selector, rootNode) {
|
|
19
|
+
if (!(target instanceof Element)) return null;
|
|
20
|
+
const matchedNode = target.closest(selector);
|
|
21
|
+
if (!matchedNode || !rootNode.contains(matchedNode)) return null;
|
|
22
|
+
const imageNode = matchedNode instanceof HTMLImageElement ? matchedNode : matchedNode.querySelector("img");
|
|
23
|
+
if (!(imageNode instanceof HTMLImageElement)) return null;
|
|
24
|
+
const src = imageNode.dataset.lightboxSrc ?? imageNode.currentSrc ?? imageNode.src;
|
|
25
|
+
if (!src) return null;
|
|
26
|
+
return {
|
|
27
|
+
src,
|
|
28
|
+
alt: imageNode.alt || void 0,
|
|
29
|
+
element: imageNode
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function LightboxRoot({ portalled, portalRef, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(OverlayPortalProvider, {
|
|
34
|
+
portalled,
|
|
35
|
+
portalRef,
|
|
36
|
+
children: /* @__PURE__ */ jsx(Dialog.Root, { ...props })
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function LightboxRootProvider({ portalled, portalRef, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(OverlayPortalProvider, {
|
|
41
|
+
portalled,
|
|
42
|
+
portalRef,
|
|
43
|
+
children: /* @__PURE__ */ jsx(Dialog.RootProvider, { ...props })
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const LightboxTrigger = forwardRef(function LightboxTrigger({ className, ...props }, ref) {
|
|
47
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
48
|
+
ref,
|
|
49
|
+
"data-slot": "lightbox-trigger",
|
|
50
|
+
className: clsx(Lightbox_module_default.trigger, normalizeClassName(className)),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const LightboxBackdrop = forwardRef(function LightboxBackdrop({ className, ...props }, ref) {
|
|
55
|
+
return /* @__PURE__ */ jsx(OverlayPortal, { children: /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
56
|
+
ref,
|
|
57
|
+
"data-slot": "lightbox-backdrop",
|
|
58
|
+
className: clsx(Lightbox_module_default.backdrop, normalizeClassName(className)),
|
|
59
|
+
...props
|
|
60
|
+
}) });
|
|
61
|
+
});
|
|
62
|
+
const LightboxPositioner = forwardRef(function LightboxPositioner({ className, ...props }, ref) {
|
|
63
|
+
return /* @__PURE__ */ jsx(OverlayPortal, { children: /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
64
|
+
ref,
|
|
65
|
+
"data-slot": "lightbox-positioner",
|
|
66
|
+
className: clsx(Lightbox_module_default.positioner, normalizeClassName(className)),
|
|
67
|
+
...props
|
|
68
|
+
}) });
|
|
69
|
+
});
|
|
70
|
+
const LightboxContent = forwardRef(function LightboxContent({ className, ...props }, ref) {
|
|
71
|
+
return /* @__PURE__ */ jsx(Dialog.Content, {
|
|
72
|
+
ref,
|
|
73
|
+
"data-slot": "lightbox-content",
|
|
74
|
+
className: clsx(Lightbox_module_default.content, normalizeClassName(className)),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
const LightboxTitle = forwardRef(function LightboxTitle({ className, ...props }, ref) {
|
|
79
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
80
|
+
ref,
|
|
81
|
+
"data-slot": "lightbox-title",
|
|
82
|
+
className: clsx(Lightbox_module_default.title, normalizeClassName(className)),
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
const LightboxDescription = forwardRef(function LightboxDescription({ className, ...props }, ref) {
|
|
87
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
88
|
+
ref,
|
|
89
|
+
"data-slot": "lightbox-description",
|
|
90
|
+
className: clsx(Lightbox_module_default.description, normalizeClassName(className)),
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
const LightboxCloseTrigger = forwardRef(function LightboxCloseTrigger({ className, ...props }, ref) {
|
|
95
|
+
return /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
96
|
+
ref,
|
|
97
|
+
"data-slot": "lightbox-close-trigger",
|
|
98
|
+
className: normalizeClassName(className),
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
const LightboxCloseIcon = forwardRef(function LightboxCloseIcon({ className, children, "aria-label": ariaLabel = DEFAULT_CLOSE_LABEL, ...props }, ref) {
|
|
103
|
+
const dialog = useDialogContext();
|
|
104
|
+
return /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
105
|
+
asChild: true,
|
|
106
|
+
...props,
|
|
107
|
+
children: /* @__PURE__ */ jsx(CloseButton.Root, {
|
|
108
|
+
ref,
|
|
109
|
+
"data-slot": "lightbox-close-icon",
|
|
110
|
+
"data-state": dialog.open ? "open" : "closed",
|
|
111
|
+
"aria-label": ariaLabel,
|
|
112
|
+
className: clsx(Lightbox_module_default.closeIcon, normalizeClassName(className)),
|
|
113
|
+
children
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
const LightboxImage = forwardRef(function LightboxImage({ className, closeOnClick = false, onClick, ...props }, ref) {
|
|
118
|
+
const dialog = useDialogContext();
|
|
119
|
+
const handleClick = (event) => {
|
|
120
|
+
onClick?.(event);
|
|
121
|
+
if (closeOnClick && !event.defaultPrevented) dialog.setOpen(false);
|
|
122
|
+
};
|
|
123
|
+
return /* @__PURE__ */ jsx("img", {
|
|
124
|
+
ref,
|
|
125
|
+
"data-slot": "lightbox-image",
|
|
126
|
+
"data-close-on-click": closeOnClick ? "" : void 0,
|
|
127
|
+
className: clsx(Lightbox_module_default.image, normalizeClassName(className)),
|
|
128
|
+
onClick: handleClick,
|
|
129
|
+
...props
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
const LightboxGallery = forwardRef(function LightboxGallery({ className, ...props }, ref) {
|
|
133
|
+
return /* @__PURE__ */ jsx("div", {
|
|
134
|
+
ref,
|
|
135
|
+
"data-slot": "lightbox-gallery",
|
|
136
|
+
className: clsx(Lightbox_module_default.gallery, normalizeClassName(className)),
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
function LightboxHeader({ className, ...props }) {
|
|
141
|
+
return /* @__PURE__ */ jsx("div", {
|
|
142
|
+
"data-slot": "lightbox-header",
|
|
143
|
+
className: clsx(Lightbox_module_default.header, className),
|
|
144
|
+
...props
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function LightboxBody({ className, ...props }) {
|
|
148
|
+
return /* @__PURE__ */ jsx("div", {
|
|
149
|
+
"data-slot": "lightbox-body",
|
|
150
|
+
className: clsx(Lightbox_module_default.body, className),
|
|
151
|
+
...props
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function LightboxFooter({ className, ...props }) {
|
|
155
|
+
return /* @__PURE__ */ jsx("div", {
|
|
156
|
+
"data-slot": "lightbox-footer",
|
|
157
|
+
className: clsx(Lightbox_module_default.footer, className),
|
|
158
|
+
...props
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function LightboxBind({ onImageSelect, selector = "img", rootRef, rootSelector }) {
|
|
162
|
+
const { setOpen } = useDialogContext();
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
const rootNode = rootRef?.current ?? (rootSelector ? document.querySelector(rootSelector) : null);
|
|
165
|
+
if (!rootNode) return;
|
|
166
|
+
const handleClick = (event) => {
|
|
167
|
+
const nextImage = resolveImage(event.target, selector, rootNode);
|
|
168
|
+
if (!nextImage) return;
|
|
169
|
+
onImageSelect(nextImage);
|
|
170
|
+
setOpen(true);
|
|
171
|
+
};
|
|
172
|
+
const preloadFromTarget = (target) => {
|
|
173
|
+
const nextImage = resolveImage(target, selector, rootNode);
|
|
174
|
+
if (!nextImage) return;
|
|
175
|
+
preloadImage(nextImage.src);
|
|
176
|
+
};
|
|
177
|
+
const handlePointerEnter = (event) => {
|
|
178
|
+
preloadFromTarget(event.target);
|
|
179
|
+
};
|
|
180
|
+
const handleFocusIn = (event) => {
|
|
181
|
+
preloadFromTarget(event.target);
|
|
182
|
+
};
|
|
183
|
+
rootNode.addEventListener("click", handleClick);
|
|
184
|
+
rootNode.addEventListener("pointerenter", handlePointerEnter, true);
|
|
185
|
+
rootNode.addEventListener("focusin", handleFocusIn);
|
|
186
|
+
return () => {
|
|
187
|
+
rootNode.removeEventListener("click", handleClick);
|
|
188
|
+
rootNode.removeEventListener("pointerenter", handlePointerEnter, true);
|
|
189
|
+
rootNode.removeEventListener("focusin", handleFocusIn);
|
|
190
|
+
};
|
|
191
|
+
}, [
|
|
192
|
+
onImageSelect,
|
|
193
|
+
rootRef,
|
|
194
|
+
rootSelector,
|
|
195
|
+
selector,
|
|
196
|
+
setOpen
|
|
197
|
+
]);
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const Lightbox = Object.assign(LightboxRoot, {
|
|
201
|
+
Root: LightboxRoot,
|
|
202
|
+
RootProvider: LightboxRootProvider,
|
|
203
|
+
Trigger: LightboxTrigger,
|
|
204
|
+
Backdrop: LightboxBackdrop,
|
|
205
|
+
Positioner: LightboxPositioner,
|
|
206
|
+
Content: LightboxContent,
|
|
207
|
+
Title: LightboxTitle,
|
|
208
|
+
Description: LightboxDescription,
|
|
209
|
+
CloseTrigger: LightboxCloseTrigger,
|
|
210
|
+
CloseIcon: LightboxCloseIcon,
|
|
211
|
+
Header: LightboxHeader,
|
|
212
|
+
Body: LightboxBody,
|
|
213
|
+
Footer: LightboxFooter,
|
|
214
|
+
Image: LightboxImage,
|
|
215
|
+
Gallery: LightboxGallery,
|
|
216
|
+
Bind: LightboxBind
|
|
217
|
+
});
|
|
218
|
+
//#endregion
|
|
219
|
+
export { Lightbox, LightboxBind, LightboxGallery, LightboxImage };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './Lightbox.css';
|
|
2
|
+
//#region src/components/lightbox/Lightbox.module.css
|
|
3
|
+
var Lightbox_module_default = {
|
|
4
|
+
"backdrop": "Jmwb8W_backdrop",
|
|
5
|
+
"body": "Jmwb8W_body",
|
|
6
|
+
"closeIcon": "Jmwb8W_closeIcon",
|
|
7
|
+
"content": "Jmwb8W_content",
|
|
8
|
+
"description": "Jmwb8W_description",
|
|
9
|
+
"footer": "Jmwb8W_footer",
|
|
10
|
+
"gallery": "Jmwb8W_gallery",
|
|
11
|
+
"header": "Jmwb8W_header",
|
|
12
|
+
"image": "Jmwb8W_image",
|
|
13
|
+
"lightbox-backdrop-in": "Jmwb8W_lightbox-backdrop-in",
|
|
14
|
+
"lightbox-backdrop-out": "Jmwb8W_lightbox-backdrop-out",
|
|
15
|
+
"lightbox-content-in": "Jmwb8W_lightbox-content-in",
|
|
16
|
+
"lightbox-content-out": "Jmwb8W_lightbox-content-out",
|
|
17
|
+
"positioner": "Jmwb8W_positioner",
|
|
18
|
+
"title": "Jmwb8W_title",
|
|
19
|
+
"trigger": "Jmwb8W_trigger"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Lightbox_module_default as default };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@layer ui.components {
|
|
2
|
+
.tX0ceq_root[data-scope="list"][data-part="root"] {
|
|
3
|
+
--_list-color: var(--list-color, var(--list-default-color, var(--color-foreground)));
|
|
4
|
+
--_list-font-size: var(--list-font-size, var(--list-font-size-md, var(--text-md)));
|
|
5
|
+
--_list-gap: var(--list-gap, var(--list-gap-sm, var(--spacing-2)));
|
|
6
|
+
--_list-line-height: var(--list-line-height, var(--list-line-height-md, var(--line-height-text-md)));
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
color: var(--_list-color);
|
|
9
|
+
font-family: var(--list-font-family, inherit);
|
|
10
|
+
font-size: var(--_list-font-size);
|
|
11
|
+
font-weight: var(--list-font-weight, var(--weight-regular));
|
|
12
|
+
line-height: var(--_list-line-height);
|
|
13
|
+
letter-spacing: var(--list-letter-spacing, 0);
|
|
14
|
+
overflow-wrap: break-word;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
list-style-position: outside;
|
|
18
|
+
|
|
19
|
+
&[data-gap="xs"] {
|
|
20
|
+
--_list-gap: var(--list-gap, var(--list-gap-xs, var(--spacing-1)));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-gap="sm"] {
|
|
24
|
+
--_list-gap: var(--list-gap, var(--list-gap-sm, var(--spacing-2)));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[data-gap="md"] {
|
|
28
|
+
--_list-gap: var(--list-gap, var(--list-gap-md, var(--spacing-3)));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&[data-gap="lg"] {
|
|
32
|
+
--_list-gap: var(--list-gap, var(--list-gap-lg, var(--spacing-4)));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[data-gap="xl"] {
|
|
36
|
+
--_list-gap: var(--list-gap, var(--list-gap-xl, var(--spacing-5)));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-gap="2xl"] {
|
|
40
|
+
--_list-gap: var(--list-gap, var(--list-gap-2xl, var(--spacing-6)));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
& > li + li {
|
|
44
|
+
margin-block-start: var(--_list-gap);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
& > li::marker {
|
|
48
|
+
color: var(--list-marker-color, currentColor);
|
|
49
|
+
font-weight: var(--list-marker-font-weight, inherit);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&[data-marker="none"] {
|
|
53
|
+
padding-inline-start: 0;
|
|
54
|
+
list-style: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:is(ul, ol)[data-marker="auto"], &[data-marker="disc"], &[data-marker="decimal"] {
|
|
58
|
+
padding-inline-start: var(--list-padding-x, var(--spacing-5));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:is(ul)[data-marker="auto"], &[data-marker="disc"] {
|
|
62
|
+
list-style-type: disc;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:is(ol)[data-marker="auto"] {
|
|
66
|
+
list-style-type: revert;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:is(ul)[data-marker="decimal"], &:is(ol)[data-marker="decimal"] {
|
|
70
|
+
list-style-type: decimal;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&[data-size="xs"] {
|
|
74
|
+
--_list-font-size: var(--list-font-size, var(--list-font-size-xs, var(--text-xs)));
|
|
75
|
+
--_list-line-height: var(--list-line-height, var(--list-line-height-xs, var(--line-height-text-xs)));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-size="sm"] {
|
|
79
|
+
--_list-font-size: var(--list-font-size, var(--list-font-size-sm, var(--text-sm)));
|
|
80
|
+
--_list-line-height: var(--list-line-height, var(--list-line-height-sm, var(--line-height-text-sm)));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&[data-size="md"] {
|
|
84
|
+
--_list-font-size: var(--list-font-size, var(--list-font-size-md, var(--text-md)));
|
|
85
|
+
--_list-line-height: var(--list-line-height, var(--list-line-height-md, var(--line-height-text-md)));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&[data-size="lg"] {
|
|
89
|
+
--_list-font-size: var(--list-font-size, var(--list-font-size-lg, var(--text-lg)));
|
|
90
|
+
--_list-line-height: var(--list-line-height, var(--list-line-height-lg, var(--line-height-text-lg)));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&[data-size="xl"] {
|
|
94
|
+
--_list-font-size: var(--list-font-size, var(--list-font-size-xl, var(--text-xl)));
|
|
95
|
+
--_list-line-height: var(--list-line-height, var(--list-line-height-xl, var(--line-height-text-xl)));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&[data-tone="default"] {
|
|
99
|
+
--_list-color: var(--list-color, var(--list-default-color, var(--color-foreground)));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&[data-tone="muted"] {
|
|
103
|
+
--_list-color: var(--list-color, var(--list-muted-color, var(--color-muted-foreground)));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&[data-tone="subtle"] {
|
|
107
|
+
--_list-color: var(--list-color, var(--list-subtle-color, var(--color-secondary-foreground)));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&[data-tone="primary"] {
|
|
111
|
+
--_list-color: var(--list-color, var(--list-primary-color, var(--color-primary)));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&[data-tone="destructive"] {
|
|
115
|
+
--_list-color: var(--list-color, var(--list-destructive-color, var(--color-destructive)));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|