@lumx/react 3.20.1-alpha.10 → 3.20.1-alpha.12
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/CONTRIBUTING.md +1 -5
- package/README.md +0 -2
- package/_internal/0420e67b.js +119 -0
- package/_internal/0420e67b.js.map +1 -0
- package/_internal/0a490b07.js +75 -0
- package/_internal/0a490b07.js.map +1 -0
- package/_internal/0b9c76cb.js +6 -0
- package/_internal/0b9c76cb.js.map +1 -0
- package/_internal/0be1006e.js +97 -0
- package/_internal/0be1006e.js.map +1 -0
- package/_internal/0d1a078c.js +144 -0
- package/_internal/0d1a078c.js.map +1 -0
- package/_internal/15eab19b.js +75 -0
- package/_internal/15eab19b.js.map +1 -0
- package/_internal/179a84d1.js +259 -0
- package/_internal/179a84d1.js.map +1 -0
- package/_internal/193521fa.js +52 -0
- package/_internal/193521fa.js.map +1 -0
- package/_internal/1a90ea3d.js +51 -0
- package/_internal/1a90ea3d.js.map +1 -0
- package/_internal/1deba7d7.js +224 -0
- package/_internal/1deba7d7.js.map +1 -0
- package/_internal/1ea72630.js +146 -0
- package/_internal/1ea72630.js.map +1 -0
- package/_internal/21b83d16.js +137 -0
- package/_internal/21b83d16.js.map +1 -0
- package/_internal/230173a8.js +13 -0
- package/_internal/230173a8.js.map +1 -0
- package/_internal/297bed8f.js +457 -0
- package/_internal/297bed8f.js.map +1 -0
- package/_internal/2a3d237c.js +12 -0
- package/_internal/2a3d237c.js.map +1 -0
- package/_internal/2c2b6a89.js +52 -0
- package/_internal/2c2b6a89.js.map +1 -0
- package/_internal/2f1716fa.js +237 -0
- package/_internal/2f1716fa.js.map +1 -0
- package/_internal/2f6c7f84.js +103 -0
- package/_internal/2f6c7f84.js.map +1 -0
- package/_internal/3181f000.js +14 -0
- package/_internal/3181f000.js.map +1 -0
- package/_internal/329b5f12.js +55 -0
- package/_internal/329b5f12.js.map +1 -0
- package/_internal/332e9844.js +2 -0
- package/_internal/332e9844.js.map +1 -0
- package/_internal/34c59f5b.js +681 -0
- package/_internal/34c59f5b.js.map +1 -0
- package/_internal/36bd7352.js +219 -0
- package/_internal/36bd7352.js.map +1 -0
- package/_internal/370bdaed.js +61 -0
- package/_internal/370bdaed.js.map +1 -0
- package/_internal/37b007a4.js +20 -0
- package/_internal/37b007a4.js.map +1 -0
- package/_internal/3a1facc0.js +18 -0
- package/_internal/3a1facc0.js.map +1 -0
- package/_internal/3a4e4636.js +162 -0
- package/_internal/3a4e4636.js.map +1 -0
- package/_internal/3e653144.js +49 -0
- package/_internal/3e653144.js.map +1 -0
- package/_internal/3f86608e.js +45 -0
- package/_internal/3f86608e.js.map +1 -0
- package/_internal/478b5c92.js +24 -0
- package/_internal/478b5c92.js.map +1 -0
- package/_internal/4962be5b.js +121 -0
- package/_internal/4962be5b.js.map +1 -0
- package/_internal/49bbeed3.js +6 -0
- package/_internal/49bbeed3.js.map +1 -0
- package/_internal/4cd870a5.js +2155 -0
- package/_internal/4cd870a5.js.map +1 -0
- package/{src/utils/partitionMulti.ts → _internal/4daccdd5.js} +5 -9
- package/_internal/4daccdd5.js.map +1 -0
- package/_internal/501f2f9f.js +58 -0
- package/_internal/501f2f9f.js.map +1 -0
- package/_internal/5e7b90e2.js +2 -0
- package/_internal/5e7b90e2.js.map +1 -0
- package/_internal/5ec059fe.js +145 -0
- package/_internal/5ec059fe.js.map +1 -0
- package/_internal/5f8f9454.js +70 -0
- package/_internal/5f8f9454.js.map +1 -0
- package/_internal/5fe09341.js +112 -0
- package/_internal/5fe09341.js.map +1 -0
- package/_internal/628468c4.js +313 -0
- package/_internal/628468c4.js.map +1 -0
- package/_internal/6589b796.js +280 -0
- package/_internal/6589b796.js.map +1 -0
- package/_internal/65f91970.js +297 -0
- package/_internal/65f91970.js.map +1 -0
- package/_internal/66f691d3.js +74 -0
- package/_internal/66f691d3.js.map +1 -0
- package/_internal/68c10f98.js +166 -0
- package/_internal/68c10f98.js.map +1 -0
- package/_internal/690ca33e.js +109 -0
- package/_internal/690ca33e.js.map +1 -0
- package/_internal/6ca04271.js +108 -0
- package/_internal/6ca04271.js.map +1 -0
- package/_internal/6da19518.js +165 -0
- package/_internal/6da19518.js.map +1 -0
- package/_internal/7093ba23.js +95 -0
- package/_internal/7093ba23.js.map +1 -0
- package/_internal/74a4a214.js +82 -0
- package/_internal/74a4a214.js.map +1 -0
- package/_internal/76be70dd.js +42 -0
- package/_internal/76be70dd.js.map +1 -0
- package/_internal/78df9309.js +20 -0
- package/_internal/78df9309.js.map +1 -0
- package/_internal/7b221b05.js +9 -0
- package/_internal/7b221b05.js.map +1 -0
- package/_internal/7daf0f24.js +77 -0
- package/_internal/7daf0f24.js.map +1 -0
- package/_internal/7f54e947.js +758 -0
- package/_internal/7f54e947.js.map +1 -0
- package/_internal/825ac334.js +130 -0
- package/_internal/825ac334.js.map +1 -0
- package/_internal/827b804a.js +6 -0
- package/_internal/827b804a.js.map +1 -0
- package/_internal/84dfe68f.js +436 -0
- package/_internal/84dfe68f.js.map +1 -0
- package/_internal/85e3a5ca.js +145 -0
- package/_internal/85e3a5ca.js.map +1 -0
- package/_internal/86aa4aa4.js +154 -0
- package/_internal/86aa4aa4.js.map +1 -0
- package/_internal/88ec77c2.js +130 -0
- package/_internal/88ec77c2.js.map +1 -0
- package/_internal/8ab42752.js +103 -0
- package/_internal/8ab42752.js.map +1 -0
- package/_internal/95cfd814.js +70 -0
- package/_internal/95cfd814.js.map +1 -0
- package/_internal/9a4dfad0.js +326 -0
- package/_internal/9a4dfad0.js.map +1 -0
- package/_internal/9c9df5f2.js +80 -0
- package/_internal/9c9df5f2.js.map +1 -0
- package/_internal/9d1336a1.js +19 -0
- package/_internal/9d1336a1.js.map +1 -0
- package/_internal/9fdc715b.js +152 -0
- package/_internal/9fdc715b.js.map +1 -0
- package/_internal/a003602b.js +116 -0
- package/_internal/a003602b.js.map +1 -0
- package/_internal/a34639bd.js +97 -0
- package/_internal/a34639bd.js.map +1 -0
- package/_internal/a84f4981.js +122 -0
- package/_internal/a84f4981.js.map +1 -0
- package/_internal/b0a7a999.js +59 -0
- package/_internal/b0a7a999.js.map +1 -0
- package/_internal/b0b2e33d.js +359 -0
- package/_internal/b0b2e33d.js.map +1 -0
- package/_internal/b1af5979.js +653 -0
- package/_internal/b1af5979.js.map +1 -0
- package/_internal/b477da26.js +164 -0
- package/_internal/b477da26.js.map +1 -0
- package/_internal/b8667090.js +36 -0
- package/_internal/b8667090.js.map +1 -0
- package/_internal/bae266a9.js +61 -0
- package/_internal/bae266a9.js.map +1 -0
- package/_internal/be6da9b0.js +296 -0
- package/_internal/be6da9b0.js.map +1 -0
- package/_internal/c0414b89.js +101 -0
- package/_internal/c0414b89.js.map +1 -0
- package/_internal/c2388b10.js +58 -0
- package/_internal/c2388b10.js.map +1 -0
- package/_internal/c459a04d.js +148 -0
- package/_internal/c459a04d.js.map +1 -0
- package/_internal/c6ca7494.js +2 -0
- package/_internal/c6ca7494.js.map +1 -0
- package/_internal/cdddaed8.js +116 -0
- package/_internal/cdddaed8.js.map +1 -0
- package/_internal/d0dd1815.js +10 -0
- package/_internal/d0dd1815.js.map +1 -0
- package/_internal/d45e3f16.js +15 -0
- package/_internal/d45e3f16.js.map +1 -0
- package/_internal/d5f316cb.js +62 -0
- package/_internal/d5f316cb.js.map +1 -0
- package/_internal/db4fdc7b.js +310 -0
- package/_internal/db4fdc7b.js.map +1 -0
- package/_internal/dbe0cf24.js +75 -0
- package/_internal/dbe0cf24.js.map +1 -0
- package/_internal/de24f857.js +4 -0
- package/_internal/de24f857.js.map +1 -0
- package/_internal/e2afb13f.js +75 -0
- package/_internal/e2afb13f.js.map +1 -0
- package/_internal/e52f0d3f.js +94 -0
- package/_internal/e52f0d3f.js.map +1 -0
- package/_internal/e6dd117e.js +50 -0
- package/_internal/e6dd117e.js.map +1 -0
- package/_internal/e806b848.js +9 -0
- package/_internal/e806b848.js.map +1 -0
- package/_internal/ea04260d.js +29 -0
- package/_internal/ea04260d.js.map +1 -0
- package/_internal/eaa8b1d8.js +150 -0
- package/_internal/eaa8b1d8.js.map +1 -0
- package/_internal/eaf6c45a.js +4 -0
- package/_internal/eaf6c45a.js.map +1 -0
- package/_internal/edab29ce.js +308 -0
- package/_internal/edab29ce.js.map +1 -0
- package/_internal/ef5d1aac.js +4 -0
- package/_internal/ef5d1aac.js.map +1 -0
- package/_internal/f0900583.js +142 -0
- package/_internal/f0900583.js.map +1 -0
- package/_internal/f0d7d6ea.js +30 -0
- package/_internal/f0d7d6ea.js.map +1 -0
- package/_internal/f23cdf84.js +181 -0
- package/_internal/f23cdf84.js.map +1 -0
- package/_internal/f52e979e.js +3 -0
- package/_internal/f52e979e.js.map +1 -0
- package/_internal/f5508d3d.js +792 -0
- package/_internal/f5508d3d.js.map +1 -0
- package/_internal/f93fe83e.js +46 -0
- package/_internal/f93fe83e.js.map +1 -0
- package/index.d.ts +1 -2
- package/index.js +65 -14607
- package/index.js.map +1 -1
- package/package.json +3 -15
- package/utils/index.d.ts +1 -1
- package/utils/index.js +3 -1
- package/utils/index.js.map +1 -1
- package/_internal/index.js +0 -229
- package/_internal/index.js.map +0 -1
- package/src/components/alert-dialog/AlertDialog.stories.tsx +0 -127
- package/src/components/alert-dialog/AlertDialog.test.tsx +0 -34
- package/src/components/alert-dialog/AlertDialog.tsx +0 -189
- package/src/components/alert-dialog/index.ts +0 -1
- package/src/components/autocomplete/Autocomplete.stories.tsx +0 -75
- package/src/components/autocomplete/Autocomplete.test.tsx +0 -99
- package/src/components/autocomplete/Autocomplete.tsx +0 -294
- package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +0 -167
- package/src/components/autocomplete/AutocompleteMultiple.test.tsx +0 -61
- package/src/components/autocomplete/AutocompleteMultiple.tsx +0 -156
- package/src/components/autocomplete/__mockData__/index.ts +0 -39
- package/src/components/autocomplete/index.ts +0 -2
- package/src/components/avatar/Avatar.stories.tsx +0 -119
- package/src/components/avatar/Avatar.test.tsx +0 -32
- package/src/components/avatar/Avatar.tsx +0 -114
- package/src/components/avatar/index.ts +0 -1
- package/src/components/badge/Badge.stories.tsx +0 -69
- package/src/components/badge/Badge.test.tsx +0 -45
- package/src/components/badge/Badge.tsx +0 -58
- package/src/components/badge/BadgeWrapper.stories.tsx +0 -75
- package/src/components/badge/BadgeWrapper.test.tsx +0 -47
- package/src/components/badge/BadgeWrapper.tsx +0 -37
- package/src/components/badge/index.ts +0 -2
- package/src/components/button/Button.stories.tsx +0 -355
- package/src/components/button/Button.test.tsx +0 -125
- package/src/components/button/Button.tsx +0 -101
- package/src/components/button/ButtonGroup.stories.tsx +0 -52
- package/src/components/button/ButtonGroup.test.tsx +0 -41
- package/src/components/button/ButtonGroup.tsx +0 -50
- package/src/components/button/ButtonRoot.tsx +0 -163
- package/src/components/button/IconButton.stories.tsx +0 -52
- package/src/components/button/IconButton.test.tsx +0 -66
- package/src/components/button/IconButton.tsx +0 -91
- package/src/components/button/index.ts +0 -4
- package/src/components/checkbox/Checkbox.stories.tsx +0 -64
- package/src/components/checkbox/Checkbox.test.tsx +0 -154
- package/src/components/checkbox/Checkbox.tsx +0 -164
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/chip/Chip.stories.tsx +0 -164
- package/src/components/chip/Chip.test.tsx +0 -243
- package/src/components/chip/Chip.tsx +0 -168
- package/src/components/chip/ChipGroup.stories.tsx +0 -47
- package/src/components/chip/ChipGroup.test.tsx +0 -37
- package/src/components/chip/ChipGroup.tsx +0 -60
- package/src/components/chip/index.ts +0 -2
- package/src/components/comment-block/CommentBlock.stories.tsx +0 -91
- package/src/components/comment-block/CommentBlock.test.tsx +0 -28
- package/src/components/comment-block/CommentBlock.tsx +0 -172
- package/src/components/comment-block/index.ts +0 -1
- package/src/components/date-picker/DatePicker.stories.tsx +0 -118
- package/src/components/date-picker/DatePicker.test.tsx +0 -34
- package/src/components/date-picker/DatePicker.tsx +0 -52
- package/src/components/date-picker/DatePickerControlled.test.tsx +0 -91
- package/src/components/date-picker/DatePickerControlled.tsx +0 -259
- package/src/components/date-picker/DatePickerField.stories.tsx +0 -100
- package/src/components/date-picker/DatePickerField.test.tsx +0 -70
- package/src/components/date-picker/DatePickerField.tsx +0 -135
- package/src/components/date-picker/constants.ts +0 -11
- package/src/components/date-picker/index.ts +0 -4
- package/src/components/date-picker/types.ts +0 -28
- package/src/components/dialog/Dialog.stories.tsx +0 -318
- package/src/components/dialog/Dialog.test.tsx +0 -97
- package/src/components/dialog/Dialog.tsx +0 -288
- package/src/components/dialog/index.ts +0 -1
- package/src/components/divider/Divider.test.tsx +0 -51
- package/src/components/divider/Divider.tsx +0 -50
- package/src/components/divider/index.ts +0 -1
- package/src/components/drag-handle/DragHandle.test.tsx +0 -36
- package/src/components/drag-handle/DragHandle.tsx +0 -51
- package/src/components/drag-handle/index.ts +0 -1
- package/src/components/dropdown/Dropdown.stories.tsx +0 -31
- package/src/components/dropdown/Dropdown.test.tsx +0 -66
- package/src/components/dropdown/Dropdown.tsx +0 -186
- package/src/components/dropdown/index.ts +0 -1
- package/src/components/expansion-panel/ExpansionPanel.stories.tsx +0 -91
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +0 -185
- package/src/components/expansion-panel/ExpansionPanel.tsx +0 -195
- package/src/components/expansion-panel/index.ts +0 -1
- package/src/components/flag/Flag.stories.tsx +0 -48
- package/src/components/flag/Flag.test.tsx +0 -62
- package/src/components/flag/Flag.tsx +0 -52
- package/src/components/flag/index.ts +0 -1
- package/src/components/flex-box/FlexBox.stories.tsx +0 -156
- package/src/components/flex-box/FlexBox.test.tsx +0 -24
- package/src/components/flex-box/FlexBox.tsx +0 -100
- package/src/components/flex-box/index.ts +0 -1
- package/src/components/generic-block/GenericBlock.stories.jsx +0 -128
- package/src/components/generic-block/GenericBlock.test.tsx +0 -156
- package/src/components/generic-block/GenericBlock.tsx +0 -225
- package/src/components/generic-block/constants.ts +0 -9
- package/src/components/generic-block/index.ts +0 -2
- package/src/components/grid/Grid.tsx +0 -83
- package/src/components/grid/GridItem.tsx +0 -55
- package/src/components/grid/index.ts +0 -2
- package/src/components/grid-column/GridColumn.stories.tsx +0 -45
- package/src/components/grid-column/GridColumn.test.jsx +0 -56
- package/src/components/grid-column/GridColumn.tsx +0 -83
- package/src/components/grid-column/index.ts +0 -1
- package/src/components/heading/Heading.stories.tsx +0 -69
- package/src/components/heading/Heading.test.tsx +0 -82
- package/src/components/heading/Heading.tsx +0 -65
- package/src/components/heading/HeadingLevelProvider.tsx +0 -30
- package/src/components/heading/constants.ts +0 -16
- package/src/components/heading/context.tsx +0 -13
- package/src/components/heading/index.ts +0 -3
- package/src/components/heading/useHeadingLevel.tsx +0 -8
- package/src/components/icon/Icon.stories.tsx +0 -73
- package/src/components/icon/Icon.test.tsx +0 -125
- package/src/components/icon/Icon.tsx +0 -22
- package/src/components/icon/index.ts +0 -1
- package/src/components/image-block/ImageBlock.stories.tsx +0 -117
- package/src/components/image-block/ImageBlock.test.tsx +0 -58
- package/src/components/image-block/ImageBlock.tsx +0 -142
- package/src/components/image-block/ImageCaption.tsx +0 -115
- package/src/components/image-block/index.ts +0 -1
- package/src/components/image-lightbox/ImageLightbox.stories.tsx +0 -160
- package/src/components/image-lightbox/ImageLightbox.test.tsx +0 -254
- package/src/components/image-lightbox/ImageLightbox.tsx +0 -90
- package/src/components/image-lightbox/constants.ts +0 -11
- package/src/components/image-lightbox/index.ts +0 -2
- package/src/components/image-lightbox/internal/ImageSlide.tsx +0 -107
- package/src/components/image-lightbox/internal/ImageSlideshow.tsx +0 -164
- package/src/components/image-lightbox/internal/useAnimateScroll.ts +0 -55
- package/src/components/image-lightbox/internal/usePointerZoom.ts +0 -148
- package/src/components/image-lightbox/types.ts +0 -48
- package/src/components/image-lightbox/useImageLightbox.tsx +0 -141
- package/src/components/inline-list/InlineList.stories.tsx +0 -77
- package/src/components/inline-list/InlineList.test.tsx +0 -52
- package/src/components/inline-list/InlineList.tsx +0 -96
- package/src/components/inline-list/index.ts +0 -1
- package/src/components/input-helper/InputHelper.stories.tsx +0 -35
- package/src/components/input-helper/InputHelper.test.tsx +0 -55
- package/src/components/input-helper/InputHelper.tsx +0 -65
- package/src/components/input-helper/constants.ts +0 -11
- package/src/components/input-helper/index.ts +0 -1
- package/src/components/input-label/InputLabel.stories.tsx +0 -45
- package/src/components/input-label/InputLabel.test.tsx +0 -59
- package/src/components/input-label/InputLabel.tsx +0 -69
- package/src/components/input-label/index.ts +0 -1
- package/src/components/lightbox/Lightbox.stories.tsx +0 -101
- package/src/components/lightbox/Lightbox.test.tsx +0 -53
- package/src/components/lightbox/Lightbox.tsx +0 -180
- package/src/components/lightbox/index.ts +0 -1
- package/src/components/link/Link.stories.tsx +0 -195
- package/src/components/link/Link.test.tsx +0 -127
- package/src/components/link/Link.tsx +0 -106
- package/src/components/link/index.ts +0 -1
- package/src/components/link-preview/LinkPreview.stories.tsx +0 -61
- package/src/components/link-preview/LinkPreview.test.tsx +0 -105
- package/src/components/link-preview/LinkPreview.tsx +0 -158
- package/src/components/link-preview/index.ts +0 -1
- package/src/components/list/List.stories.tsx +0 -116
- package/src/components/list/List.test.tsx +0 -18
- package/src/components/list/List.tsx +0 -104
- package/src/components/list/ListDivider.stories.tsx +0 -12
- package/src/components/list/ListDivider.test.tsx +0 -22
- package/src/components/list/ListDivider.tsx +0 -35
- package/src/components/list/ListItem.stories.tsx +0 -66
- package/src/components/list/ListItem.test.tsx +0 -93
- package/src/components/list/ListItem.tsx +0 -157
- package/src/components/list/ListSubheader.stories.tsx +0 -11
- package/src/components/list/ListSubheader.test.tsx +0 -21
- package/src/components/list/ListSubheader.tsx +0 -44
- package/src/components/list/index.ts +0 -4
- package/src/components/list/useInteractiveList.tsx +0 -202
- package/src/components/message/Message.stories.tsx +0 -72
- package/src/components/message/Message.test.tsx +0 -76
- package/src/components/message/Message.tsx +0 -100
- package/src/components/message/index.ts +0 -1
- package/src/components/mosaic/Mosaic.stories.tsx +0 -89
- package/src/components/mosaic/Mosaic.test.tsx +0 -77
- package/src/components/mosaic/Mosaic.tsx +0 -98
- package/src/components/mosaic/index.ts +0 -1
- package/src/components/navigation/Navigation.stories.tsx +0 -234
- package/src/components/navigation/Navigation.test.tsx +0 -65
- package/src/components/navigation/Navigation.tsx +0 -79
- package/src/components/navigation/NavigationItem.test.tsx +0 -35
- package/src/components/navigation/NavigationItem.tsx +0 -82
- package/src/components/navigation/NavigationSection.test.tsx +0 -137
- package/src/components/navigation/NavigationSection.tsx +0 -108
- package/src/components/navigation/context.tsx +0 -7
- package/src/components/navigation/index.ts +0 -1
- package/src/components/notification/Notification.test.tsx +0 -94
- package/src/components/notification/Notification.tsx +0 -138
- package/src/components/notification/Notifications.stories.tsx +0 -92
- package/src/components/notification/constants.ts +0 -28
- package/src/components/notification/index.ts +0 -1
- package/src/components/popover/Popover.stories.tsx +0 -264
- package/src/components/popover/Popover.test.tsx +0 -62
- package/src/components/popover/Popover.tsx +0 -201
- package/src/components/popover/constants.ts +0 -62
- package/src/components/popover/index.ts +0 -3
- package/src/components/popover/usePopoverStyle.tsx +0 -184
- package/src/components/popover/useRestoreFocusOnClose.tsx +0 -47
- package/src/components/popover-dialog/PopoverDialog.stories.tsx +0 -64
- package/src/components/popover-dialog/PopoverDialog.test.tsx +0 -139
- package/src/components/popover-dialog/PopoverDialog.tsx +0 -74
- package/src/components/popover-dialog/index.tsx +0 -1
- package/src/components/post-block/PostBlock.test.tsx +0 -27
- package/src/components/post-block/PostBlock.tsx +0 -122
- package/src/components/post-block/index.ts +0 -1
- package/src/components/progress/Progress.tsx +0 -68
- package/src/components/progress/ProgressCircular.stories.tsx +0 -43
- package/src/components/progress/ProgressCircular.test.tsx +0 -46
- package/src/components/progress/ProgressCircular.tsx +0 -82
- package/src/components/progress/ProgressLinear.stories.tsx +0 -12
- package/src/components/progress/ProgressLinear.test.tsx +0 -30
- package/src/components/progress/ProgressLinear.tsx +0 -50
- package/src/components/progress/index.ts +0 -3
- package/src/components/progress-tracker/ProgressTracker.stories.tsx +0 -145
- package/src/components/progress-tracker/ProgressTracker.test.tsx +0 -42
- package/src/components/progress-tracker/ProgressTracker.tsx +0 -87
- package/src/components/progress-tracker/ProgressTrackerProvider.test.tsx +0 -65
- package/src/components/progress-tracker/ProgressTrackerProvider.tsx +0 -67
- package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +0 -36
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +0 -159
- package/src/components/progress-tracker/ProgressTrackerStepPanel.test.tsx +0 -34
- package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +0 -67
- package/src/components/progress-tracker/index.ts +0 -4
- package/src/components/radio-button/RadioButton.stories.tsx +0 -71
- package/src/components/radio-button/RadioButton.test.tsx +0 -143
- package/src/components/radio-button/RadioButton.tsx +0 -143
- package/src/components/radio-button/RadioGroup.stories.tsx +0 -39
- package/src/components/radio-button/RadioGroup.test.tsx +0 -29
- package/src/components/radio-button/RadioGroup.tsx +0 -44
- package/src/components/radio-button/index.ts +0 -2
- package/src/components/select/Select.stories.tsx +0 -385
- package/src/components/select/Select.test.tsx +0 -199
- package/src/components/select/Select.tsx +0 -199
- package/src/components/select/SelectMultiple.stories.tsx +0 -315
- package/src/components/select/SelectMultiple.test.tsx +0 -213
- package/src/components/select/SelectMultiple.tsx +0 -206
- package/src/components/select/WithSelectContext.tsx +0 -147
- package/src/components/select/constants.ts +0 -55
- package/src/components/select/index.ts +0 -2
- package/src/components/side-navigation/SideNavigation.stories.tsx +0 -191
- package/src/components/side-navigation/SideNavigation.test.tsx +0 -37
- package/src/components/side-navigation/SideNavigation.tsx +0 -52
- package/src/components/side-navigation/SideNavigationItem.stories.tsx +0 -133
- package/src/components/side-navigation/SideNavigationItem.test.tsx +0 -136
- package/src/components/side-navigation/SideNavigationItem.tsx +0 -165
- package/src/components/side-navigation/index.ts +0 -2
- package/src/components/skeleton/SkeletonCircle.stories.tsx +0 -41
- package/src/components/skeleton/SkeletonCircle.test.tsx +0 -27
- package/src/components/skeleton/SkeletonCircle.tsx +0 -52
- package/src/components/skeleton/SkeletonRectangle.stories.tsx +0 -82
- package/src/components/skeleton/SkeletonRectangle.test.tsx +0 -27
- package/src/components/skeleton/SkeletonRectangle.tsx +0 -88
- package/src/components/skeleton/SkeletonTypography.stories.tsx +0 -19
- package/src/components/skeleton/SkeletonTypography.test.tsx +0 -27
- package/src/components/skeleton/SkeletonTypography.tsx +0 -59
- package/src/components/skeleton/index.ts +0 -3
- package/src/components/slider/Slider.stories.tsx +0 -45
- package/src/components/slider/Slider.test.tsx +0 -29
- package/src/components/slider/Slider.tsx +0 -299
- package/src/components/slider/index.ts +0 -2
- package/src/components/slideshow/Slides.tsx +0 -130
- package/src/components/slideshow/Slideshow.stories.tsx +0 -179
- package/src/components/slideshow/Slideshow.test.tsx +0 -35
- package/src/components/slideshow/Slideshow.tsx +0 -173
- package/src/components/slideshow/SlideshowControls.stories.tsx +0 -100
- package/src/components/slideshow/SlideshowControls.tsx +0 -243
- package/src/components/slideshow/SlideshowItem.tsx +0 -44
- package/src/components/slideshow/SlideshowItemGroup.tsx +0 -60
- package/src/components/slideshow/constants.ts +0 -24
- package/src/components/slideshow/index.ts +0 -4
- package/src/components/slideshow/useKeyNavigate.ts +0 -28
- package/src/components/slideshow/usePaginationVisibleRange.ts +0 -37
- package/src/components/slideshow/useSlideFocusManagement.tsx +0 -92
- package/src/components/slideshow/useSwipeNavigate.ts +0 -18
- package/src/components/switch/Switch.stories.tsx +0 -49
- package/src/components/switch/Switch.test.tsx +0 -144
- package/src/components/switch/Switch.tsx +0 -145
- package/src/components/switch/index.ts +0 -1
- package/src/components/table/Table.test.tsx +0 -29
- package/src/components/table/Table.tsx +0 -59
- package/src/components/table/TableBody.test.tsx +0 -30
- package/src/components/table/TableBody.tsx +0 -42
- package/src/components/table/TableCell.test.tsx +0 -72
- package/src/components/table/TableCell.tsx +0 -130
- package/src/components/table/TableHeader.test.tsx +0 -30
- package/src/components/table/TableHeader.tsx +0 -48
- package/src/components/table/TableRow.test.tsx +0 -40
- package/src/components/table/TableRow.tsx +0 -71
- package/src/components/table/index.ts +0 -5
- package/src/components/tabs/Tab.test.tsx +0 -50
- package/src/components/tabs/Tab.tsx +0 -133
- package/src/components/tabs/TabList.test.tsx +0 -49
- package/src/components/tabs/TabList.tsx +0 -94
- package/src/components/tabs/TabPanel.test.tsx +0 -37
- package/src/components/tabs/TabPanel.tsx +0 -67
- package/src/components/tabs/TabProvider.test.tsx +0 -161
- package/src/components/tabs/TabProvider.tsx +0 -67
- package/src/components/tabs/Tabs.stories.tsx +0 -170
- package/src/components/tabs/index.ts +0 -4
- package/src/components/tabs/state.ts +0 -114
- package/src/components/tabs/test-utils.ts +0 -39
- package/src/components/text/Text.stories.tsx +0 -177
- package/src/components/text/Text.test.tsx +0 -92
- package/src/components/text/Text.tsx +0 -139
- package/src/components/text/index.ts +0 -1
- package/src/components/text-field/TextField.stories.tsx +0 -180
- package/src/components/text-field/TextField.test.tsx +0 -298
- package/src/components/text-field/TextField.tsx +0 -493
- package/src/components/text-field/index.ts +0 -1
- package/src/components/thumbnail/Thumbnail.stories.tsx +0 -448
- package/src/components/thumbnail/Thumbnail.test.tsx +0 -88
- package/src/components/thumbnail/Thumbnail.tsx +0 -248
- package/src/components/thumbnail/index.ts +0 -3
- package/src/components/thumbnail/types.ts +0 -48
- package/src/components/thumbnail/useFocusPointStyle.test.ts +0 -92
- package/src/components/thumbnail/useFocusPointStyle.tsx +0 -107
- package/src/components/thumbnail/useImageLoad.ts +0 -40
- package/src/components/toolbar/Toolbar.tsx +0 -68
- package/src/components/toolbar/index.ts +0 -1
- package/src/components/tooltip/Tooltip.stories.tsx +0 -118
- package/src/components/tooltip/Tooltip.test.tsx +0 -417
- package/src/components/tooltip/Tooltip.tsx +0 -165
- package/src/components/tooltip/constants.ts +0 -8
- package/src/components/tooltip/context.tsx +0 -17
- package/src/components/tooltip/index.ts +0 -1
- package/src/components/tooltip/useInjectTooltipRef.tsx +0 -55
- package/src/components/tooltip/useTooltipOpen.tsx +0 -143
- package/src/components/uploader/Uploader.stories.tsx +0 -109
- package/src/components/uploader/Uploader.test.tsx +0 -146
- package/src/components/uploader/Uploader.tsx +0 -177
- package/src/components/uploader/index.ts +0 -1
- package/src/components/user-block/UserBlock.stories.tsx +0 -133
- package/src/components/user-block/UserBlock.test.tsx +0 -106
- package/src/components/user-block/UserBlock.tsx +0 -193
- package/src/components/user-block/index.ts +0 -1
- package/src/constants.ts +0 -27
- package/src/hooks/useBooleanState.tsx +0 -13
- package/src/hooks/useCallbackOnEscape.ts +0 -34
- package/src/hooks/useChipGroupNavigation.tsx +0 -75
- package/src/hooks/useClickAway.tsx +0 -48
- package/src/hooks/useDisableBodyScroll.ts +0 -28
- package/src/hooks/useEventCallback.tsx +0 -17
- package/src/hooks/useFocus.tsx +0 -21
- package/src/hooks/useFocusTrap.ts +0 -93
- package/src/hooks/useFocusWithin.ts +0 -33
- package/src/hooks/useId.test.tsx +0 -22
- package/src/hooks/useId.ts +0 -15
- package/src/hooks/useImageSize.ts +0 -17
- package/src/hooks/useInfiniteScroll.tsx +0 -60
- package/src/hooks/useIntersectionObserver.tsx +0 -43
- package/src/hooks/useInterval.tsx +0 -31
- package/src/hooks/useKeyboardListNavigation.tsx +0 -204
- package/src/hooks/useListenFocus.tsx +0 -26
- package/src/hooks/useOverflowTooltipLabel.tsx +0 -32
- package/src/hooks/usePopper.ts +0 -12
- package/src/hooks/usePreviousValue.ts +0 -12
- package/src/hooks/useRovingTabIndex.tsx +0 -90
- package/src/hooks/useSizeOnWindowResize.ts +0 -30
- package/src/hooks/useSlideshowControls.ts +0 -246
- package/src/hooks/useStopPropagation.ts +0 -21
- package/src/hooks/useTransitionVisibility.ts +0 -48
- package/src/index.ts +0 -63
- package/src/stories/controls/color.ts +0 -7
- package/src/stories/controls/element.ts +0 -6
- package/src/stories/controls/focusPoint.ts +0 -1
- package/src/stories/controls/icons.ts +0 -126
- package/src/stories/controls/image.ts +0 -84
- package/src/stories/controls/selectArgType.ts +0 -8
- package/src/stories/controls/theme.ts +0 -3
- package/src/stories/controls/typography.ts +0 -5
- package/src/stories/controls/withUndefined.ts +0 -1
- package/src/stories/decorators/withChromaticForceScreenSize.tsx +0 -7
- package/src/stories/decorators/withCombinations.tsx +0 -132
- package/src/stories/decorators/withNestedProps.tsx +0 -22
- package/src/stories/decorators/withResizableBox.tsx +0 -21
- package/src/stories/decorators/withThemedBackground.tsx +0 -16
- package/src/stories/decorators/withValueOnChange.tsx +0 -18
- package/src/stories/decorators/withWrapper.tsx +0 -19
- package/src/stories/generated/Autocomplete/Demos.stories.tsx +0 -7
- package/src/stories/generated/Avatar/Demos.stories.tsx +0 -7
- package/src/stories/generated/Badge/Demos.stories.tsx +0 -9
- package/src/stories/generated/Button/Demos.stories.tsx +0 -11
- package/src/stories/generated/Checkbox/Demos.stories.tsx +0 -6
- package/src/stories/generated/Chip/Demos.stories.tsx +0 -11
- package/src/stories/generated/CommentBlock/Demos.stories.tsx +0 -8
- package/src/stories/generated/DatePicker/Demos.stories.tsx +0 -8
- package/src/stories/generated/Dialog/Demos.stories.tsx +0 -10
- package/src/stories/generated/Divider/Demos.stories.tsx +0 -6
- package/src/stories/generated/Dropdown/Demos.stories.tsx +0 -8
- package/src/stories/generated/ExpansionPanel/Demos.stories.tsx +0 -9
- package/src/stories/generated/Flag/Demos.stories.tsx +0 -6
- package/src/stories/generated/GenericBlock/Demos.stories.tsx +0 -8
- package/src/stories/generated/Heading/Demos.stories.tsx +0 -6
- package/src/stories/generated/Icon/Demos.stories.tsx +0 -8
- package/src/stories/generated/ImageBlock/Demos.stories.tsx +0 -9
- package/src/stories/generated/ImageLightbox/Demos.stories.tsx +0 -6
- package/src/stories/generated/Lightbox/Demos.stories.tsx +0 -6
- package/src/stories/generated/LinkPreview/Demos.stories.tsx +0 -7
- package/src/stories/generated/List/Demos.stories.tsx +0 -11
- package/src/stories/generated/Message/Demos.stories.tsx +0 -11
- package/src/stories/generated/Mosaic/Demos.stories.tsx +0 -10
- package/src/stories/generated/Notification/Demos.stories.tsx +0 -6
- package/src/stories/generated/Popover/Demos.stories.tsx +0 -11
- package/src/stories/generated/PopoverDialog/Demos.stories.tsx +0 -6
- package/src/stories/generated/PostBlock/Demos.stories.tsx +0 -6
- package/src/stories/generated/Progress/Demos.stories.tsx +0 -7
- package/src/stories/generated/ProgressTracker/Demos.stories.tsx +0 -9
- package/src/stories/generated/RadioButton/Demos.stories.tsx +0 -6
- package/src/stories/generated/Select/Demos.stories.tsx +0 -14
- package/src/stories/generated/SideNavigation/Demos.stories.tsx +0 -10
- package/src/stories/generated/Skeleton/Demos.stories.tsx +0 -9
- package/src/stories/generated/Slider/Demos.stories.tsx +0 -9
- package/src/stories/generated/Slideshow/Demos.stories.tsx +0 -8
- package/src/stories/generated/Switch/Demos.stories.tsx +0 -6
- package/src/stories/generated/Table/Demos.stories.tsx +0 -7
- package/src/stories/generated/Tabs/Demos.stories.tsx +0 -8
- package/src/stories/generated/TextField/Demos.stories.tsx +0 -20
- package/src/stories/generated/Thumbnail/Demos.stories.tsx +0 -12
- package/src/stories/generated/Toolbar/Demos.stories.tsx +0 -10
- package/src/stories/generated/Tooltip/Demos.stories.tsx +0 -8
- package/src/stories/generated/Uploader/Demos.stories.tsx +0 -8
- package/src/stories/generated/UserBlock/Demos.stories.tsx +0 -11
- package/src/stories/utils/CustomLink.tsx +0 -12
- package/src/stories/utils/concatPath.tsx +0 -17
- package/src/stories/utils/disableArgTypes.ts +0 -3
- package/src/stories/utils/initDemoShadowDOMPortal.ts +0 -10
- package/src/stories/utils/lorem.ts +0 -59
- package/src/stories/utils/theming.tsx +0 -166
- package/src/stories/utils/toFlattenProps.ts +0 -28
- package/src/stories/utils/withCategory.ts +0 -12
- package/src/testing/utils/ThemeSentinel.tsx +0 -10
- package/src/testing/utils/commonTestsSuiteRTL.tsx +0 -193
- package/src/testing/utils/index.ts +0 -1
- package/src/testing/utils/queries.ts +0 -19
- package/src/untypped-modules.d.ts +0 -9
- package/src/utils/ClickAwayProvider/ClickAwayProvider.stories.jsx +0 -70
- package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +0 -69
- package/src/utils/ClickAwayProvider/index.ts +0 -1
- package/src/utils/MaterialThemeSwitcher/MaterialThemeSwitcher.tsx +0 -54
- package/src/utils/MaterialThemeSwitcher/index.ts +0 -1
- package/src/utils/Portal/Portal.test.tsx +0 -31
- package/src/utils/Portal/Portal.tsx +0 -33
- package/src/utils/Portal/PortalProvider.stories.jsx +0 -22
- package/src/utils/Portal/PortalProvider.test.tsx +0 -72
- package/src/utils/Portal/PortalProvider.tsx +0 -24
- package/src/utils/Portal/index.tsx +0 -2
- package/src/utils/browser/DOM/findImage.tsx +0 -3
- package/src/utils/browser/DOM/startViewTransition.ts +0 -68
- package/src/utils/browser/focus/constants.ts +0 -7
- package/src/utils/browser/focus/getFirstAndLastFocusable.test.ts +0 -134
- package/src/utils/browser/focus/getFirstAndLastFocusable.ts +0 -21
- package/src/utils/browser/focus/getFocusableElements.test.ts +0 -151
- package/src/utils/browser/focus/getFocusableElements.ts +0 -7
- package/src/utils/browser/isFocusVisible.ts +0 -9
- package/src/utils/browser/isHoverNotSupported.test.js +0 -24
- package/src/utils/browser/isHoverNotSupported.ts +0 -2
- package/src/utils/browser/isReducedMotion.ts +0 -6
- package/src/utils/date/addMonthResetDay.test.ts +0 -13
- package/src/utils/date/addMonthResetDay.ts +0 -9
- package/src/utils/date/formatDayNumber.test.ts +0 -12
- package/src/utils/date/formatDayNumber.ts +0 -5
- package/src/utils/date/getFirstDayOfWeek.test.ts +0 -20
- package/src/utils/date/getFirstDayOfWeek.ts +0 -59
- package/src/utils/date/getMonthCalendar.test.ts +0 -127
- package/src/utils/date/getMonthCalendar.ts +0 -69
- package/src/utils/date/getWeekDays.test.ts +0 -48
- package/src/utils/date/getWeekDays.ts +0 -34
- package/src/utils/date/getYearDisplayName.test.ts +0 -20
- package/src/utils/date/getYearDisplayName.ts +0 -12
- package/src/utils/date/isDateValid.test.ts +0 -15
- package/src/utils/date/isDateValid.ts +0 -4
- package/src/utils/date/isSameDay.test.ts +0 -37
- package/src/utils/date/isSameDay.ts +0 -11
- package/src/utils/disabled/DisabledStateContext.tsx +0 -29
- package/src/utils/disabled/DisabledStateProvider.stories.tsx +0 -92
- package/src/utils/disabled/index.ts +0 -2
- package/src/utils/disabled/useDisableStateProps.test.tsx +0 -74
- package/src/utils/disabled/useDisableStateProps.tsx +0 -37
- package/src/utils/function/makeListenerTowerContext.ts +0 -32
- package/src/utils/index.ts +0 -7
- package/src/utils/locale/getCurrentLocale.ts +0 -4
- package/src/utils/locale/parseLocale.test.ts +0 -17
- package/src/utils/locale/parseLocale.ts +0 -23
- package/src/utils/locale/types.ts +0 -8
- package/src/utils/number/clamp.ts +0 -17
- package/src/utils/object/isEqual.test.ts +0 -25
- package/src/utils/object/isEqual.ts +0 -11
- package/src/utils/partitionMulti.test.ts +0 -27
- package/src/utils/react/OnBeforeUnmount.tsx +0 -20
- package/src/utils/react/RawClickable.test.tsx +0 -153
- package/src/utils/react/RawClickable.tsx +0 -65
- package/src/utils/react/flattenChildren.ts +0 -32
- package/src/utils/react/forwardRef.ts +0 -11
- package/src/utils/react/forwardRefPolymorphic.ts +0 -9
- package/src/utils/react/mergeRefs.ts +0 -33
- package/src/utils/react/renderLink.tsx +0 -17
- package/src/utils/react/skipRender.tsx +0 -18
- package/src/utils/react/unref.ts +0 -7
- package/src/utils/react/wrapChildrenIconWithSpaces.test.tsx +0 -37
- package/src/utils/react/wrapChildrenIconWithSpaces.tsx +0 -22
- package/src/utils/theme/ThemeContext.ts +0 -16
- package/src/utils/theme/invertTheme.ts +0 -4
- package/src/utils/type/Comp.ts +0 -14
- package/src/utils/type/ComponentRef.ts +0 -16
- package/src/utils/type/HasAriaDisabled.ts +0 -6
- package/src/utils/type/HasPolymorphicAs.ts +0 -6
- package/src/utils/type/HasRequiredLinkHref.ts +0 -1
- package/src/utils/type/MaybeElementOrRef.ts +0 -6
- package/src/utils/type/index.ts +0 -9
- package/src/utils/type/isComponent.ts +0 -33
- package/src/utils/type/isComponentType.ts +0 -9
- /package/_internal/{Falsy.d.ts → d95844c1.d.ts} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { l as classNames } from './6589b796.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { u as useTheme } from './3181f000.js';
|
|
4
|
+
import { FlexBox } from './329b5f12.js';
|
|
5
|
+
import { T as Text } from './0420e67b.js';
|
|
6
|
+
|
|
7
|
+
/** Internal component used to render image captions */
|
|
8
|
+
const ImageCaption = props => {
|
|
9
|
+
const defaultTheme = useTheme();
|
|
10
|
+
const {
|
|
11
|
+
baseClassName,
|
|
12
|
+
theme = defaultTheme,
|
|
13
|
+
as = 'figcaption',
|
|
14
|
+
title,
|
|
15
|
+
titleProps,
|
|
16
|
+
description,
|
|
17
|
+
descriptionProps,
|
|
18
|
+
tags,
|
|
19
|
+
captionStyle,
|
|
20
|
+
align,
|
|
21
|
+
truncate
|
|
22
|
+
} = props;
|
|
23
|
+
if (!title && !description && !tags) return null;
|
|
24
|
+
const titleColor = {
|
|
25
|
+
color: theme === 'dark' ? 'light' : 'dark'
|
|
26
|
+
};
|
|
27
|
+
const baseColor = {
|
|
28
|
+
color: theme === 'dark' ? 'light' : 'dark',
|
|
29
|
+
colorVariant: 'L2'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Display description as string or HTML
|
|
33
|
+
const descriptionContent = typeof description === 'string' ? {
|
|
34
|
+
children: description
|
|
35
|
+
} : {
|
|
36
|
+
dangerouslySetInnerHTML: description
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/jsxs(FlexBox, {
|
|
39
|
+
as: as,
|
|
40
|
+
className: classNames(baseClassName && `${baseClassName}__wrapper`),
|
|
41
|
+
style: captionStyle,
|
|
42
|
+
orientation: "vertical",
|
|
43
|
+
vAlign: align,
|
|
44
|
+
hAlign: align === 'center' ? align : undefined,
|
|
45
|
+
gap: "regular",
|
|
46
|
+
children: [(title || description) && /*#__PURE__*/jsxs(Text, {
|
|
47
|
+
as: "p",
|
|
48
|
+
className: classNames(baseClassName && `${baseClassName}__caption`),
|
|
49
|
+
truncate: truncate,
|
|
50
|
+
...baseColor,
|
|
51
|
+
children: [title && /*#__PURE__*/jsx(Text, {
|
|
52
|
+
...titleProps,
|
|
53
|
+
as: "span",
|
|
54
|
+
className: classNames(titleProps?.className, baseClassName && `${baseClassName}__title`),
|
|
55
|
+
typography: "subtitle1",
|
|
56
|
+
...titleColor,
|
|
57
|
+
children: title
|
|
58
|
+
}), ' ', description && /*#__PURE__*/jsx(Text, {
|
|
59
|
+
...descriptionProps,
|
|
60
|
+
as: "span",
|
|
61
|
+
className: classNames(descriptionProps?.className, baseClassName && `${baseClassName}__description`),
|
|
62
|
+
typography: "body1",
|
|
63
|
+
...descriptionContent
|
|
64
|
+
})]
|
|
65
|
+
}), tags && /*#__PURE__*/jsx(FlexBox, {
|
|
66
|
+
className: classNames(baseClassName && `${baseClassName}__tags`),
|
|
67
|
+
orientation: "horizontal",
|
|
68
|
+
vAlign: align,
|
|
69
|
+
children: tags
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { ImageCaption as I };
|
|
75
|
+
//# sourceMappingURL=dbe0cf24.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dbe0cf24.js","sources":["../../src/components/image-block/ImageCaption.tsx"],"sourcesContent":["import { CSSProperties, ReactNode } from 'react';\n\nimport { FlexBox, HorizontalAlignment, Text, TextProps, useTheme } from '@lumx/react';\nimport { HasPolymorphicAs, HasTheme } from '@lumx/react/utils/type';\nimport classNames from 'classnames';\n\ntype As = 'div' | 'figcaption';\n\ntype ForwardedTextProps = Omit<TextProps, 'as' | 'typography' | 'color' | 'colorVariant'>;\n\nexport type ImageCaptionMetadata = {\n /** Image title to display in the caption. */\n title?: string;\n /** Props to pass to the title. */\n titleProps?: ForwardedTextProps;\n /** Image description. Can be either a string, or sanitized html. */\n description?: string | { __html: string };\n /** Props to pass to the title. */\n descriptionProps?: ForwardedTextProps;\n /** Tag content. */\n tags?: ReactNode;\n /** Caption custom CSS style. */\n captionStyle?: CSSProperties;\n};\n\nexport type ImageCaptionProps<AS extends As = 'figcaption'> = HasTheme &\n HasPolymorphicAs<AS> &\n ImageCaptionMetadata & {\n /** Base className for sub elements */\n baseClassName?: string;\n /** Alignment. */\n align?: HorizontalAlignment;\n /** Truncate text on title & description (no line wrapping). */\n truncate?: TextProps['truncate'];\n };\n\n/** Internal component used to render image captions */\nexport const ImageCaption = <AS extends As>(props: ImageCaptionProps<AS>) => {\n const defaultTheme = useTheme();\n const {\n baseClassName,\n theme = defaultTheme,\n as = 'figcaption',\n title,\n titleProps,\n description,\n descriptionProps,\n tags,\n captionStyle,\n align,\n truncate,\n } = props;\n if (!title && !description && !tags) return null;\n\n const titleColor = { color: theme === 'dark' ? 'light' : 'dark' } as const;\n const baseColor = { color: theme === 'dark' ? 'light' : 'dark', colorVariant: 'L2' } as const;\n\n // Display description as string or HTML\n const descriptionContent =\n typeof description === 'string' ? { children: description } : { dangerouslySetInnerHTML: description };\n\n return (\n <FlexBox\n as={as}\n className={classNames(baseClassName && `${baseClassName}__wrapper`)}\n style={captionStyle}\n orientation=\"vertical\"\n vAlign={align}\n hAlign={align === 'center' ? align : undefined}\n gap=\"regular\"\n >\n {(title || description) && (\n <Text\n as=\"p\"\n className={classNames(baseClassName && `${baseClassName}__caption`)}\n truncate={truncate}\n {...baseColor}\n >\n {title && (\n <Text\n {...titleProps}\n as=\"span\"\n className={classNames(titleProps?.className, baseClassName && `${baseClassName}__title`)}\n typography=\"subtitle1\"\n {...titleColor}\n >\n {title}\n </Text>\n )}{' '}\n {description && (\n <Text\n {...descriptionProps}\n as=\"span\"\n className={classNames(\n descriptionProps?.className,\n baseClassName && `${baseClassName}__description`,\n )}\n typography=\"body1\"\n {...descriptionContent}\n />\n )}\n </Text>\n )}\n {tags && (\n <FlexBox\n className={classNames(baseClassName && `${baseClassName}__tags`)}\n orientation=\"horizontal\"\n vAlign={align}\n >\n {tags}\n </FlexBox>\n )}\n </FlexBox>\n );\n};\n"],"names":["ImageCaption","props","defaultTheme","useTheme","baseClassName","theme","as","title","titleProps","description","descriptionProps","tags","captionStyle","align","truncate","titleColor","color","baseColor","colorVariant","descriptionContent","children","dangerouslySetInnerHTML","_jsxs","FlexBox","className","classNames","style","orientation","vAlign","hAlign","undefined","gap","Text","_jsx","typography"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de24f857.js","sources":["../../../lumx-icons/dist/esm/check-circle.js"],"sourcesContent":["export const mdiCheckCircle = 'M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z';"],"names":["mdiCheckCircle"],"mappings":"AAAO,MAAMA,cAAc,GAAG;;;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { l as classNames } from './6589b796.js';
|
|
2
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
|
+
import isEmpty from 'lodash/isEmpty';
|
|
4
|
+
import kebabCase from 'lodash/kebabCase';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Get the basic CSS class for the given type.
|
|
8
|
+
*
|
|
9
|
+
* @param prefix The class name prefix for the generated CSS class.
|
|
10
|
+
* @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).
|
|
11
|
+
* @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).
|
|
12
|
+
* @return The basic CSS class.
|
|
13
|
+
*/
|
|
14
|
+
function getBasicClass({
|
|
15
|
+
prefix,
|
|
16
|
+
type,
|
|
17
|
+
value
|
|
18
|
+
}) {
|
|
19
|
+
if (isBoolean(value)) {
|
|
20
|
+
if (!value) {
|
|
21
|
+
// False value should not return a class.
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
const booleanPrefixes = ['has', 'is'];
|
|
25
|
+
if (booleanPrefixes.some(booleanPrefix => type.toString().startsWith(booleanPrefix))) {
|
|
26
|
+
return `${prefix}--${kebabCase(type)}`;
|
|
27
|
+
}
|
|
28
|
+
return `${prefix}--is-${kebabCase(type)}`;
|
|
29
|
+
}
|
|
30
|
+
return `${prefix}--${kebabCase(type)}-${value}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Enhance isEmpty method to also works with numbers.
|
|
35
|
+
*
|
|
36
|
+
* @param value The value to check.
|
|
37
|
+
* @return Whether the input value is empty or != 0.
|
|
38
|
+
*/
|
|
39
|
+
const _isEmpty = value => {
|
|
40
|
+
if (typeof value === 'number') {
|
|
41
|
+
return value === 0;
|
|
42
|
+
}
|
|
43
|
+
return isEmpty(value);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Return all basic LumX CSS classes which are available for every components.
|
|
48
|
+
*
|
|
49
|
+
* @see {@link /src/components/index.d.ts} for the possible values of each parameter.
|
|
50
|
+
*
|
|
51
|
+
* @param prefix The class name prefix for the generated CSS class.
|
|
52
|
+
* @param props All the other props you want to generate a class.
|
|
53
|
+
* The rule of thumb: the key is the name of the prop in the class, the value a string that will
|
|
54
|
+
* be used in the classname to represent the value of the given prop.
|
|
55
|
+
* @return All LumX basic CSS classes.
|
|
56
|
+
*/
|
|
57
|
+
function handleBasicClasses({
|
|
58
|
+
prefix,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
const otherClasses = {};
|
|
62
|
+
if (!isEmpty(props)) {
|
|
63
|
+
Object.keys(props).forEach(prop => {
|
|
64
|
+
otherClasses[getBasicClass({
|
|
65
|
+
prefix,
|
|
66
|
+
type: prop,
|
|
67
|
+
value: props[prop]
|
|
68
|
+
})] = isBoolean(props[prop]) ? props[prop] : !_isEmpty(props[prop]);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return classNames(prefix, otherClasses);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { getBasicClass as g, handleBasicClasses as h };
|
|
75
|
+
//# sourceMappingURL=e2afb13f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2afb13f.js","sources":["../../../lumx-core/src/js/utils/className/getBasicClass.ts","../../../lumx-core/src/js/utils/className/handleBasicClasses.ts"],"sourcesContent":["import isBoolean from 'lodash/isBoolean';\nimport kebabCase from 'lodash/kebabCase';\n\n/**\n * Get the basic CSS class for the given type.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).\n * @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).\n * @return The basic CSS class.\n */\nexport function getBasicClass({\n prefix,\n type,\n value,\n}: {\n prefix: string;\n type: string;\n value: string | number | boolean | undefined;\n}): string {\n if (isBoolean(value)) {\n if (!value) {\n // False value should not return a class.\n return '';\n }\n const booleanPrefixes = ['has', 'is'];\n\n if (booleanPrefixes.some((booleanPrefix) => type.toString().startsWith(booleanPrefix))) {\n return `${prefix}--${kebabCase(type)}`;\n }\n\n return `${prefix}--is-${kebabCase(type)}`;\n }\n\n return `${prefix}--${kebabCase(type)}-${value}`;\n}\n","import classNames from 'classnames';\n\nimport isBoolean from 'lodash/isBoolean';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { getBasicClass } from './getBasicClass';\n\n/**\n * Enhance isEmpty method to also works with numbers.\n *\n * @param value The value to check.\n * @return Whether the input value is empty or != 0.\n */\nconst _isEmpty = (value: any) => {\n if (typeof value === 'number') {\n return value === 0;\n }\n\n return isEmpty(value);\n};\n\n/**\n * Return all basic LumX CSS classes which are available for every components.\n *\n * @see {@link /src/components/index.d.ts} for the possible values of each parameter.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param props All the other props you want to generate a class.\n * The rule of thumb: the key is the name of the prop in the class, the value a string that will\n * be used in the classname to represent the value of the given prop.\n * @return All LumX basic CSS classes.\n */\nexport function handleBasicClasses({ prefix, ...props }: { prefix: string; [prop: string]: any }): string {\n const otherClasses: any = {};\n if (!isEmpty(props)) {\n Object.keys(props).forEach((prop) => {\n otherClasses[getBasicClass({ prefix, type: prop, value: props[prop] })] = isBoolean(props[prop])\n ? props[prop]\n : !_isEmpty(props[prop]);\n });\n }\n\n return classNames(prefix, otherClasses);\n}\n"],"names":["getBasicClass","prefix","type","value","isBoolean","booleanPrefixes","some","booleanPrefix","toString","startsWith","kebabCase","_isEmpty","isEmpty","handleBasicClasses","props","otherClasses","Object","keys","forEach","prop","classNames"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAC;EAC1BC,MAAM;EACNC,IAAI;AACJC,EAAAA,KAAAA;AAKJ,CAAC,EAAU;AACP,EAAA,IAAIC,SAAS,CAACD,KAAK,CAAC,EAAE;IAClB,IAAI,CAACA,KAAK,EAAE;AACR;AACA,MAAA,OAAO,EAAE,CAAA;AACb,KAAA;AACA,IAAA,MAAME,eAAe,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AAErC,IAAA,IAAIA,eAAe,CAACC,IAAI,CAAEC,aAAa,IAAKL,IAAI,CAACM,QAAQ,EAAE,CAACC,UAAU,CAACF,aAAa,CAAC,CAAC,EAAE;AACpF,MAAA,OAAO,GAAGN,MAAM,CAAA,EAAA,EAAKS,SAAS,CAACR,IAAI,CAAC,CAAE,CAAA,CAAA;AAC1C,KAAA;AAEA,IAAA,OAAO,GAAGD,MAAM,CAAA,KAAA,EAAQS,SAAS,CAACR,IAAI,CAAC,CAAE,CAAA,CAAA;AAC7C,GAAA;EAEA,OAAO,CAAA,EAAGD,MAAM,CAAKS,EAAAA,EAAAA,SAAS,CAACR,IAAI,CAAC,CAAIC,CAAAA,EAAAA,KAAK,CAAE,CAAA,CAAA;AACnD;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,QAAQ,GAAIR,KAAU,IAAK;AAC7B,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK,KAAK,CAAC,CAAA;AACtB,GAAA;EAEA,OAAOS,OAAO,CAACT,KAAK,CAAC,CAAA;AACzB,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,kBAAkBA,CAAC;EAAEZ,MAAM;EAAE,GAAGa,KAAAA;AAA+C,CAAC,EAAU;EACtG,MAAMC,YAAiB,GAAG,EAAE,CAAA;AAC5B,EAAA,IAAI,CAACH,OAAO,CAACE,KAAK,CAAC,EAAE;IACjBE,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAACI,OAAO,CAAEC,IAAI,IAAK;MACjCJ,YAAY,CAACf,aAAa,CAAC;QAAEC,MAAM;AAAEC,QAAAA,IAAI,EAAEiB,IAAI;QAAEhB,KAAK,EAAEW,KAAK,CAACK,IAAI,CAAA;OAAG,CAAC,CAAC,GAAGf,SAAS,CAACU,KAAK,CAACK,IAAI,CAAC,CAAC,GAC1FL,KAAK,CAACK,IAAI,CAAC,GACX,CAACR,QAAQ,CAACG,KAAK,CAACK,IAAI,CAAC,CAAC,CAAA;AAChC,KAAC,CAAC,CAAA;AACN,GAAA;AAEA,EAAA,OAAOC,UAAU,CAACnB,MAAM,EAAEc,YAAY,CAAC,CAAA;AAC3C;;;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { m as getRootClassName, n as forwardRef, b as Theme, l as classNames, A as Alignment, i as AspectRatio } from './6589b796.js';
|
|
3
|
+
import take from 'lodash/take';
|
|
4
|
+
import { u as useTheme } from './3181f000.js';
|
|
5
|
+
import { h as handleBasicClasses } from './e2afb13f.js';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
import { T as Thumbnail } from './628468c4.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Component display name.
|
|
11
|
+
*/
|
|
12
|
+
const COMPONENT_NAME = 'Mosaic';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Component default class name and class prefix.
|
|
16
|
+
*/
|
|
17
|
+
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Component default props.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_PROPS = {};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Mosaic component.
|
|
26
|
+
*
|
|
27
|
+
* @param props Component props.
|
|
28
|
+
* @param ref Component ref.
|
|
29
|
+
* @return React element.
|
|
30
|
+
*/
|
|
31
|
+
const Mosaic = forwardRef((props, ref) => {
|
|
32
|
+
const defaultTheme = useTheme() || Theme.light;
|
|
33
|
+
const {
|
|
34
|
+
className,
|
|
35
|
+
theme = defaultTheme,
|
|
36
|
+
thumbnails,
|
|
37
|
+
onImageClick,
|
|
38
|
+
...forwardedProps
|
|
39
|
+
} = props;
|
|
40
|
+
const handleImageClick = useMemo(() => {
|
|
41
|
+
if (!onImageClick) return undefined;
|
|
42
|
+
return (index, onClick) => event => {
|
|
43
|
+
onClick?.(event);
|
|
44
|
+
onImageClick?.(index);
|
|
45
|
+
};
|
|
46
|
+
}, [onImageClick]);
|
|
47
|
+
return /*#__PURE__*/jsx("div", {
|
|
48
|
+
ref: ref,
|
|
49
|
+
...forwardedProps,
|
|
50
|
+
className: classNames(className, handleBasicClasses({
|
|
51
|
+
prefix: CLASSNAME,
|
|
52
|
+
theme
|
|
53
|
+
}), {
|
|
54
|
+
[`${CLASSNAME}--has-1-thumbnail`]: thumbnails?.length === 1,
|
|
55
|
+
[`${CLASSNAME}--has-2-thumbnails`]: thumbnails?.length === 2,
|
|
56
|
+
[`${CLASSNAME}--has-3-thumbnails`]: thumbnails?.length === 3,
|
|
57
|
+
[`${CLASSNAME}--has-4-thumbnails`]: thumbnails?.length >= 4
|
|
58
|
+
}),
|
|
59
|
+
children: /*#__PURE__*/jsx("div", {
|
|
60
|
+
className: `${CLASSNAME}__wrapper`,
|
|
61
|
+
children: take(thumbnails, 4).map((thumbnail, index) => {
|
|
62
|
+
const {
|
|
63
|
+
image,
|
|
64
|
+
onClick,
|
|
65
|
+
align,
|
|
66
|
+
...thumbnailProps
|
|
67
|
+
} = thumbnail;
|
|
68
|
+
return /*#__PURE__*/jsxs("div", {
|
|
69
|
+
className: `${CLASSNAME}__thumbnail`,
|
|
70
|
+
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
71
|
+
...thumbnailProps,
|
|
72
|
+
align: align || Alignment.left,
|
|
73
|
+
image: image,
|
|
74
|
+
theme: theme,
|
|
75
|
+
aspectRatio: AspectRatio.free,
|
|
76
|
+
fillHeight: true,
|
|
77
|
+
onClick: handleImageClick?.(index, onClick) || onClick
|
|
78
|
+
}), thumbnails.length > 4 && index === 3 && /*#__PURE__*/jsx("div", {
|
|
79
|
+
className: `${CLASSNAME}__overlay`,
|
|
80
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
81
|
+
children: ["+", thumbnails.length - 4]
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
}, index);
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
Mosaic.displayName = COMPONENT_NAME;
|
|
90
|
+
Mosaic.className = CLASSNAME;
|
|
91
|
+
Mosaic.defaultProps = DEFAULT_PROPS;
|
|
92
|
+
|
|
93
|
+
export { Mosaic };
|
|
94
|
+
//# sourceMappingURL=e52f0d3f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e52f0d3f.js","sources":["../../src/components/mosaic/Mosaic.tsx"],"sourcesContent":["import { MouseEventHandler, useMemo } from 'react';\n\nimport classNames from 'classnames';\nimport take from 'lodash/take';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\n\nimport { Alignment, AspectRatio, Theme, Thumbnail, ThumbnailProps } from '@lumx/react';\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\n/**\n * Defines the props of the component.\n */\nexport interface MosaicProps extends GenericProps, HasTheme {\n /** Thumbnails. */\n thumbnails: ThumbnailProps[];\n /** On image click callback. */\n onImageClick?(index: number): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Mosaic';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<MosaicProps> = {};\n\n/**\n * Mosaic component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Mosaic = forwardRef<MosaicProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const { className, theme = defaultTheme, thumbnails, onImageClick, ...forwardedProps } = props;\n const handleImageClick = useMemo(() => {\n if (!onImageClick) return undefined;\n\n return (index: number, onClick?: MouseEventHandler): MouseEventHandler =>\n (event) => {\n onClick?.(event);\n onImageClick?.(index);\n };\n }, [onImageClick]);\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, theme }), {\n [`${CLASSNAME}--has-1-thumbnail`]: thumbnails?.length === 1,\n [`${CLASSNAME}--has-2-thumbnails`]: thumbnails?.length === 2,\n [`${CLASSNAME}--has-3-thumbnails`]: thumbnails?.length === 3,\n [`${CLASSNAME}--has-4-thumbnails`]: thumbnails?.length >= 4,\n })}\n >\n <div className={`${CLASSNAME}__wrapper`}>\n {take(thumbnails, 4).map((thumbnail: any, index: number) => {\n const { image, onClick, align, ...thumbnailProps } = thumbnail;\n\n return (\n <div key={index} className={`${CLASSNAME}__thumbnail`}>\n <Thumbnail\n {...thumbnailProps}\n align={align || Alignment.left}\n image={image}\n theme={theme}\n aspectRatio={AspectRatio.free}\n fillHeight\n onClick={handleImageClick?.(index, onClick) || onClick}\n />\n\n {thumbnails.length > 4 && index === 3 && (\n <div className={`${CLASSNAME}__overlay`}>\n <span>+{thumbnails.length - 4}</span>\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n});\nMosaic.displayName = COMPONENT_NAME;\nMosaic.className = CLASSNAME;\nMosaic.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","Mosaic","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","className","theme","thumbnails","onImageClick","forwardedProps","handleImageClick","useMemo","undefined","index","onClick","event","_jsx","classNames","handleBasicClasses","prefix","length","children","take","map","thumbnail","image","align","thumbnailProps","_jsxs","Thumbnail","Alignment","left","aspectRatio","AspectRatio","free","fillHeight","displayName","defaultProps"],"mappings":"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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { W as WINDOW } from './478b5c92.js';
|
|
3
|
+
|
|
4
|
+
/** Check if user prefers reduced motion */
|
|
5
|
+
function isReducedMotion() {
|
|
6
|
+
return WINDOW?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns true if the component is visible tracking the opacity transition.
|
|
11
|
+
*
|
|
12
|
+
* @param ref Element on which to listen the transition event.
|
|
13
|
+
* @param isComponentVisible Whether the component intends to be visible or not.
|
|
14
|
+
* @param onVisibilityChange Callback called when the visibility changes.
|
|
15
|
+
* @return true if the component should be rendered
|
|
16
|
+
*/
|
|
17
|
+
const useTransitionVisibility = (ref, isComponentVisible, timeout, onVisibilityChange) => {
|
|
18
|
+
const [isVisible, setVisible] = useState(isComponentVisible);
|
|
19
|
+
const previousVisibility = useRef(isVisible);
|
|
20
|
+
|
|
21
|
+
// On component visibility change.
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (isComponentVisible) {
|
|
24
|
+
setVisible(true);
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const {
|
|
28
|
+
current: element
|
|
29
|
+
} = ref;
|
|
30
|
+
|
|
31
|
+
// Transition event is not supported or the user prefers reduced motion.
|
|
32
|
+
// => Skip and set visibility to false directly.
|
|
33
|
+
if (!element || !window.TransitionEvent || isReducedMotion()) {
|
|
34
|
+
setVisible(false);
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const timer = setTimeout(() => setVisible(false), timeout);
|
|
38
|
+
return () => clearTimeout(timer);
|
|
39
|
+
}, [isComponentVisible, ref, timeout]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (onVisibilityChange && previousVisibility.current !== isVisible) {
|
|
42
|
+
onVisibilityChange(isVisible);
|
|
43
|
+
previousVisibility.current = isVisible;
|
|
44
|
+
}
|
|
45
|
+
}, [isVisible, onVisibilityChange]);
|
|
46
|
+
return isVisible || isComponentVisible;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { isReducedMotion as i, useTransitionVisibility as u };
|
|
50
|
+
//# sourceMappingURL=e6dd117e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e6dd117e.js","sources":["../../src/utils/browser/isReducedMotion.ts","../../src/hooks/useTransitionVisibility.ts"],"sourcesContent":["import { WINDOW } from '@lumx/react/constants';\n\n/** Check if user prefers reduced motion */\nexport function isReducedMotion() {\n return WINDOW?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n}\n","import { RefObject, useEffect, useRef, useState } from 'react';\nimport { isReducedMotion } from '@lumx/react/utils/browser/isReducedMotion';\n\n/**\n * Returns true if the component is visible tracking the opacity transition.\n *\n * @param ref Element on which to listen the transition event.\n * @param isComponentVisible Whether the component intends to be visible or not.\n * @param onVisibilityChange Callback called when the visibility changes.\n * @return true if the component should be rendered\n */\nexport const useTransitionVisibility = (\n ref: RefObject<HTMLElement>,\n isComponentVisible: boolean,\n timeout: number,\n onVisibilityChange?: (isVisible: boolean) => void,\n) => {\n const [isVisible, setVisible] = useState(isComponentVisible);\n const previousVisibility = useRef(isVisible);\n\n // On component visibility change.\n useEffect(() => {\n if (isComponentVisible) {\n setVisible(true);\n return undefined;\n }\n const { current: element } = ref;\n\n // Transition event is not supported or the user prefers reduced motion.\n // => Skip and set visibility to false directly.\n if (!element || !window.TransitionEvent || isReducedMotion()) {\n setVisible(false);\n return undefined;\n }\n\n const timer = setTimeout(() => setVisible(false), timeout);\n return () => clearTimeout(timer);\n }, [isComponentVisible, ref, timeout]);\n\n useEffect(() => {\n if (onVisibilityChange && previousVisibility.current !== isVisible) {\n onVisibilityChange(isVisible);\n previousVisibility.current = isVisible;\n }\n }, [isVisible, onVisibilityChange]);\n\n return isVisible || isComponentVisible;\n};\n"],"names":["isReducedMotion","WINDOW","matchMedia","matches","useTransitionVisibility","ref","isComponentVisible","timeout","onVisibilityChange","isVisible","setVisible","useState","previousVisibility","useRef","useEffect","undefined","current","element","window","TransitionEvent","timer","setTimeout","clearTimeout"],"mappings":";;;AAEA;AACO,SAASA,eAAeA,GAAG;AAC9B,EAAA,OAAOC,MAAM,EAAEC,UAAU,GAAG,kCAAkC,CAAC,CAACC,OAAO,CAAA;AAC3E;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAGA,CACnCC,GAA2B,EAC3BC,kBAA2B,EAC3BC,OAAe,EACfC,kBAAiD,KAChD;EACD,MAAM,CAACC,SAAS,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAACL,kBAAkB,CAAC,CAAA;AAC5D,EAAA,MAAMM,kBAAkB,GAAGC,MAAM,CAACJ,SAAS,CAAC,CAAA;;AAE5C;AACAK,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,IAAIR,kBAAkB,EAAE;MACpBI,UAAU,CAAC,IAAI,CAAC,CAAA;AAChB,MAAA,OAAOK,SAAS,CAAA;AACpB,KAAA;IACA,MAAM;AAAEC,MAAAA,OAAO,EAAEC,OAAAA;AAAQ,KAAC,GAAGZ,GAAG,CAAA;;AAEhC;AACA;IACA,IAAI,CAACY,OAAO,IAAI,CAACC,MAAM,CAACC,eAAe,IAAInB,eAAe,EAAE,EAAE;MAC1DU,UAAU,CAAC,KAAK,CAAC,CAAA;AACjB,MAAA,OAAOK,SAAS,CAAA;AACpB,KAAA;IAEA,MAAMK,KAAK,GAAGC,UAAU,CAAC,MAAMX,UAAU,CAAC,KAAK,CAAC,EAAEH,OAAO,CAAC,CAAA;AAC1D,IAAA,OAAO,MAAMe,YAAY,CAACF,KAAK,CAAC,CAAA;GACnC,EAAE,CAACd,kBAAkB,EAAED,GAAG,EAAEE,OAAO,CAAC,CAAC,CAAA;AAEtCO,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,IAAIN,kBAAkB,IAAII,kBAAkB,CAACI,OAAO,KAAKP,SAAS,EAAE;MAChED,kBAAkB,CAACC,SAAS,CAAC,CAAA;MAC7BG,kBAAkB,CAACI,OAAO,GAAGP,SAAS,CAAA;AAC1C,KAAA;AACJ,GAAC,EAAE,CAACA,SAAS,EAAED,kBAAkB,CAAC,CAAC,CAAA;EAEnC,OAAOC,SAAS,IAAIH,kBAAkB,CAAA;AAC1C;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Similar to `isComponent` but more precise as it's not based on the component `displayName` but on the component function reference.
|
|
5
|
+
*/
|
|
6
|
+
const isComponentType = type => node => /*#__PURE__*/React__default.isValidElement(node) && node.type === type;
|
|
7
|
+
|
|
8
|
+
export { isComponentType as i };
|
|
9
|
+
//# sourceMappingURL=e806b848.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e806b848.js","sources":["../../src/utils/type/isComponentType.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\n\n/**\n * Similar to `isComponent` but more precise as it's not based on the component `displayName` but on the component function reference.\n */\nexport const isComponentType =\n (type: ReactElement['type']) =>\n (node: ReactNode): node is ReactElement =>\n React.isValidElement(node) && node.type === type;\n"],"names":["isComponentType","type","node","React","isValidElement"],"mappings":";;AAEA;AACA;AACA;MACaA,eAAe,GACvBC,IAA0B,IAC1BC,IAAe,iBACZC,cAAK,CAACC,cAAc,CAACF,IAAI,CAAC,IAAIA,IAAI,CAACD,IAAI,KAAKA;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React__default, { useContext } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
const DisabledStateContext = /*#__PURE__*/React__default.createContext({
|
|
5
|
+
state: null
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* Disabled state provider.
|
|
9
|
+
* All nested LumX Design System components inherit this disabled state.
|
|
10
|
+
*/
|
|
11
|
+
function DisabledStateProvider({
|
|
12
|
+
children,
|
|
13
|
+
...value
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/jsx(DisabledStateContext.Provider, {
|
|
16
|
+
value: value,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get DisabledState context value
|
|
23
|
+
*/
|
|
24
|
+
function useDisabledStateContext() {
|
|
25
|
+
return useContext(DisabledStateContext);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { DisabledStateProvider as D, useDisabledStateContext as u };
|
|
29
|
+
//# sourceMappingURL=ea04260d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ea04260d.js","sources":["../../src/utils/disabled/DisabledStateContext.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\n/** Disable state */\ntype DisabledStateContextValue =\n | {\n state: 'disabled';\n }\n | { state: undefined | null };\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","children","value","_jsx","Provider","useDisabledStateContext","useContext"],"mappings":";;;AASO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE,IAAA;AAAK,CAAC,CAAC,CAAA;AAMnG;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAC;EAAEC,QAAQ;EAAE,GAAGC,KAAAA;AAAkC,CAAC,EAAE;AACtF,EAAA,oBAAOC,GAAA,CAACP,oBAAoB,CAACQ,QAAQ,EAAA;AAACF,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAgC,CAAC,CAAA;AAClG,CAAA;;AAEA;AACA;AACA;AACO,SAASI,uBAAuBA,GAA8B;EACjE,OAAOC,UAAU,CAACV,oBAAoB,CAAC,CAAA;AAC3C;;;;"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React__default, { useEffect } from 'react';
|
|
2
|
+
import { a as SlideshowControls, b as Slides, c as buildSlideShowGroupId, D as DEFAULT_OPTIONS } from './34c59f5b.js';
|
|
3
|
+
export { S as SlideshowItem } from './34c59f5b.js';
|
|
4
|
+
import { m as mergeRefs } from './f0d7d6ea.js';
|
|
5
|
+
import { u as useTheme } from './3181f000.js';
|
|
6
|
+
import { n as forwardRef, b as Theme } from './6589b796.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Hook that allows to control when there is a focus event within a given element, meaning
|
|
11
|
+
* that any element within the given target will trigger the focus in and focus out events.
|
|
12
|
+
* @param options - UseFocusWithinOptions
|
|
13
|
+
*/
|
|
14
|
+
const useFocusWithin = ({
|
|
15
|
+
element,
|
|
16
|
+
onFocusIn,
|
|
17
|
+
onFocusOut
|
|
18
|
+
}) => {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (element) {
|
|
21
|
+
element.addEventListener('focusin', onFocusIn);
|
|
22
|
+
element.addEventListener('focusout', onFocusOut);
|
|
23
|
+
}
|
|
24
|
+
return () => {
|
|
25
|
+
if (element) {
|
|
26
|
+
element.removeEventListener('focusin', onFocusIn);
|
|
27
|
+
element.removeEventListener('focusout', onFocusOut);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}, [onFocusIn, element, onFocusOut]);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Component default props.
|
|
35
|
+
*/
|
|
36
|
+
const DEFAULT_PROPS = DEFAULT_OPTIONS;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Slideshow component.
|
|
40
|
+
*
|
|
41
|
+
* @param props Component props.
|
|
42
|
+
* @param ref Component ref.
|
|
43
|
+
* @return React element.
|
|
44
|
+
*/
|
|
45
|
+
const Slideshow = forwardRef((props, ref) => {
|
|
46
|
+
const defaultTheme = useTheme() || Theme.light;
|
|
47
|
+
const {
|
|
48
|
+
activeIndex,
|
|
49
|
+
autoPlay = DEFAULT_PROPS.autoPlay,
|
|
50
|
+
children,
|
|
51
|
+
className,
|
|
52
|
+
fillHeight,
|
|
53
|
+
groupBy = DEFAULT_OPTIONS.groupBy,
|
|
54
|
+
interval = DEFAULT_PROPS.interval,
|
|
55
|
+
onChange,
|
|
56
|
+
slideshowControlsProps,
|
|
57
|
+
theme = defaultTheme,
|
|
58
|
+
id,
|
|
59
|
+
slidesId,
|
|
60
|
+
slideGroupLabel,
|
|
61
|
+
...forwardedProps
|
|
62
|
+
} = props;
|
|
63
|
+
// Number of slideshow items.
|
|
64
|
+
const itemsCount = React__default.Children.count(children);
|
|
65
|
+
const {
|
|
66
|
+
activeIndex: currentIndex,
|
|
67
|
+
slideshowId,
|
|
68
|
+
setSlideshow,
|
|
69
|
+
isAutoPlaying,
|
|
70
|
+
slideshowSlidesId,
|
|
71
|
+
slidesCount,
|
|
72
|
+
onNextClick,
|
|
73
|
+
onPaginationClick,
|
|
74
|
+
onPreviousClick,
|
|
75
|
+
slideshow,
|
|
76
|
+
stopAutoPlay,
|
|
77
|
+
startAutoPlay,
|
|
78
|
+
toggleAutoPlay,
|
|
79
|
+
toggleForcePause
|
|
80
|
+
} = SlideshowControls.useSlideshowControls({
|
|
81
|
+
activeIndex,
|
|
82
|
+
defaultActiveIndex: DEFAULT_PROPS.activeIndex,
|
|
83
|
+
autoPlay: Boolean(autoPlay),
|
|
84
|
+
itemsCount,
|
|
85
|
+
groupBy,
|
|
86
|
+
id,
|
|
87
|
+
interval,
|
|
88
|
+
onChange,
|
|
89
|
+
slidesId
|
|
90
|
+
});
|
|
91
|
+
useFocusWithin({
|
|
92
|
+
element: slideshow,
|
|
93
|
+
onFocusIn: stopAutoPlay,
|
|
94
|
+
onFocusOut: startAutoPlay
|
|
95
|
+
});
|
|
96
|
+
const showControls = slideshowControlsProps && slidesCount > 1;
|
|
97
|
+
return /*#__PURE__*/jsx(Slides, {
|
|
98
|
+
activeIndex: currentIndex,
|
|
99
|
+
id: slideshowId,
|
|
100
|
+
className: className,
|
|
101
|
+
theme: theme,
|
|
102
|
+
fillHeight: fillHeight,
|
|
103
|
+
groupBy: groupBy,
|
|
104
|
+
isAutoPlaying: isAutoPlaying,
|
|
105
|
+
autoPlay: autoPlay,
|
|
106
|
+
slidesId: slideshowSlidesId,
|
|
107
|
+
toggleAutoPlay: toggleAutoPlay,
|
|
108
|
+
ref: mergeRefs(ref, setSlideshow),
|
|
109
|
+
hasControls: showControls,
|
|
110
|
+
slideGroupLabel: slideGroupLabel,
|
|
111
|
+
afterSlides: slideshowControlsProps && slidesCount > 1 ? /*#__PURE__*/jsx("div", {
|
|
112
|
+
className: `${Slides.className}__controls`,
|
|
113
|
+
children: /*#__PURE__*/jsx(SlideshowControls, {
|
|
114
|
+
...slideshowControlsProps,
|
|
115
|
+
activeIndex: currentIndex,
|
|
116
|
+
onPaginationClick: onPaginationClick,
|
|
117
|
+
onNextClick: onNextClick,
|
|
118
|
+
onPreviousClick: onPreviousClick,
|
|
119
|
+
slidesCount: slidesCount,
|
|
120
|
+
parentRef: slideshow,
|
|
121
|
+
theme: theme,
|
|
122
|
+
isAutoPlaying: isAutoPlaying,
|
|
123
|
+
nextButtonProps: {
|
|
124
|
+
'aria-controls': slideshowSlidesId,
|
|
125
|
+
...slideshowControlsProps.nextButtonProps
|
|
126
|
+
},
|
|
127
|
+
previousButtonProps: {
|
|
128
|
+
'aria-controls': slideshowSlidesId,
|
|
129
|
+
...slideshowControlsProps.previousButtonProps
|
|
130
|
+
},
|
|
131
|
+
playButtonProps: autoPlay ? {
|
|
132
|
+
'aria-controls': slideshowSlidesId,
|
|
133
|
+
onClick: toggleForcePause,
|
|
134
|
+
...slideshowControlsProps.playButtonProps
|
|
135
|
+
} : undefined,
|
|
136
|
+
paginationItemProps: index => ({
|
|
137
|
+
'aria-controls': buildSlideShowGroupId(slideshowSlidesId, index),
|
|
138
|
+
...slideshowControlsProps.paginationItemProps?.(index)
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}) : undefined,
|
|
142
|
+
...forwardedProps,
|
|
143
|
+
children: children
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
Slideshow.displayName = 'Slideshow';
|
|
147
|
+
Slideshow.defaultProps = DEFAULT_PROPS;
|
|
148
|
+
|
|
149
|
+
export { Slides, Slideshow, SlideshowControls };
|
|
150
|
+
//# sourceMappingURL=eaa8b1d8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eaa8b1d8.js","sources":["../../src/hooks/useFocusWithin.ts","../../src/components/slideshow/Slideshow.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nexport interface UseFocusWithinOptions {\n /** element to add the focus within to */\n element: HTMLElement | null;\n /** callback to be executed on focus in */\n onFocusIn: (ev: FocusEvent) => void;\n /** callback to be executed on focus out */\n onFocusOut: (ev: FocusEvent) => void;\n}\n\n/**\n * Hook that allows to control when there is a focus event within a given element, meaning\n * that any element within the given target will trigger the focus in and focus out events.\n * @param options - UseFocusWithinOptions\n */\nexport const useFocusWithin = ({ element, onFocusIn, onFocusOut }: UseFocusWithinOptions) => {\n useEffect(() => {\n if (element) {\n element.addEventListener('focusin', onFocusIn);\n\n element.addEventListener('focusout', onFocusOut);\n }\n\n return () => {\n if (element) {\n element.removeEventListener('focusin', onFocusIn);\n\n element.removeEventListener('focusout', onFocusOut);\n }\n };\n }, [onFocusIn, element, onFocusOut]);\n};\n","import React from 'react';\n\nimport { SlideshowControls, SlideshowControlsProps, Theme, Slides, SlidesProps } from '@lumx/react';\nimport { DEFAULT_OPTIONS } from '@lumx/react/hooks/useSlideshowControls';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { useFocusWithin } from '@lumx/react/hooks/useFocusWithin';\nimport { mergeRefs } from '@lumx/react/utils/react/mergeRefs';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nimport { buildSlideShowGroupId } from './SlideshowItemGroup';\n\n/**\n * Defines the props of the component.\n */\nexport interface SlideshowProps\n extends GenericProps,\n Pick<SlidesProps, 'autoPlay' | 'slidesId' | 'id' | 'theme' | 'fillHeight' | 'groupBy' | 'slideGroupLabel'> {\n /** current slide active */\n activeIndex?: SlidesProps['activeIndex'];\n /** Interval between each slide when automatic rotation is enabled. */\n interval?: number;\n /** Props to pass to the slideshow controls (minus those already set by the Slideshow props). */\n slideshowControlsProps?: Pick<\n SlideshowControlsProps,\n 'nextButtonProps' | 'previousButtonProps' | 'paginationItemProps'\n > &\n Omit<\n SlideshowControlsProps,\n | 'activeIndex'\n | 'onPaginationClick'\n | 'onNextClick'\n | 'onPreviousClick'\n | 'slidesCount'\n | 'parentRef'\n | 'theme'\n >;\n /** Callback when slide changes */\n onChange?(index: number): void;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<SlideshowProps> = DEFAULT_OPTIONS;\n\n/**\n * Slideshow component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Slideshow = forwardRef<SlideshowProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n activeIndex,\n autoPlay = DEFAULT_PROPS.autoPlay,\n children,\n className,\n fillHeight,\n groupBy = DEFAULT_OPTIONS.groupBy,\n interval = DEFAULT_PROPS.interval,\n onChange,\n slideshowControlsProps,\n theme = defaultTheme,\n id,\n slidesId,\n slideGroupLabel,\n ...forwardedProps\n } = props;\n // Number of slideshow items.\n const itemsCount = React.Children.count(children);\n\n const {\n activeIndex: currentIndex,\n slideshowId,\n setSlideshow,\n isAutoPlaying,\n slideshowSlidesId,\n slidesCount,\n onNextClick,\n onPaginationClick,\n onPreviousClick,\n slideshow,\n stopAutoPlay,\n startAutoPlay,\n toggleAutoPlay,\n toggleForcePause,\n } = SlideshowControls.useSlideshowControls({\n activeIndex,\n defaultActiveIndex: DEFAULT_PROPS.activeIndex as number,\n autoPlay: Boolean(autoPlay),\n itemsCount,\n groupBy,\n id,\n interval,\n onChange,\n slidesId,\n });\n\n useFocusWithin({\n element: slideshow,\n onFocusIn: stopAutoPlay,\n onFocusOut: startAutoPlay,\n });\n\n const showControls = slideshowControlsProps && slidesCount > 1;\n\n return (\n <Slides\n activeIndex={currentIndex}\n id={slideshowId}\n className={className}\n theme={theme}\n fillHeight={fillHeight}\n groupBy={groupBy}\n isAutoPlaying={isAutoPlaying}\n autoPlay={autoPlay}\n slidesId={slideshowSlidesId}\n toggleAutoPlay={toggleAutoPlay}\n ref={mergeRefs(ref, setSlideshow)}\n hasControls={showControls}\n slideGroupLabel={slideGroupLabel}\n afterSlides={\n slideshowControlsProps && slidesCount > 1 ? (\n <div className={`${Slides.className}__controls`}>\n <SlideshowControls\n {...slideshowControlsProps}\n activeIndex={currentIndex}\n onPaginationClick={onPaginationClick}\n onNextClick={onNextClick}\n onPreviousClick={onPreviousClick}\n slidesCount={slidesCount}\n parentRef={slideshow}\n theme={theme}\n isAutoPlaying={isAutoPlaying}\n nextButtonProps={{\n 'aria-controls': slideshowSlidesId,\n ...slideshowControlsProps.nextButtonProps,\n }}\n previousButtonProps={{\n 'aria-controls': slideshowSlidesId,\n ...slideshowControlsProps.previousButtonProps,\n }}\n playButtonProps={\n autoPlay\n ? {\n 'aria-controls': slideshowSlidesId,\n onClick: toggleForcePause,\n ...slideshowControlsProps.playButtonProps,\n }\n : undefined\n }\n paginationItemProps={(index) => ({\n 'aria-controls': buildSlideShowGroupId(slideshowSlidesId, index),\n ...slideshowControlsProps.paginationItemProps?.(index),\n })}\n />\n </div>\n ) : undefined\n }\n {...forwardedProps}\n >\n {children}\n </Slides>\n );\n});\n\nSlideshow.displayName = 'Slideshow';\nSlideshow.defaultProps = DEFAULT_PROPS;\n"],"names":["useFocusWithin","element","onFocusIn","onFocusOut","useEffect","addEventListener","removeEventListener","DEFAULT_PROPS","DEFAULT_OPTIONS","Slideshow","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","activeIndex","autoPlay","children","className","fillHeight","groupBy","interval","onChange","slideshowControlsProps","theme","id","slidesId","slideGroupLabel","forwardedProps","itemsCount","React","Children","count","currentIndex","slideshowId","setSlideshow","isAutoPlaying","slideshowSlidesId","slidesCount","onNextClick","onPaginationClick","onPreviousClick","slideshow","stopAutoPlay","startAutoPlay","toggleAutoPlay","toggleForcePause","SlideshowControls","useSlideshowControls","defaultActiveIndex","Boolean","showControls","_jsx","Slides","mergeRefs","hasControls","afterSlides","parentRef","nextButtonProps","previousButtonProps","playButtonProps","onClick","undefined","paginationItemProps","index","buildSlideShowGroupId","displayName","defaultProps"],"mappings":";;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAGA,CAAC;EAAEC,OAAO;EAAEC,SAAS;AAAEC,EAAAA,UAAAA;AAAkC,CAAC,KAAK;AACzFC,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,IAAIH,OAAO,EAAE;AACTA,MAAAA,OAAO,CAACI,gBAAgB,CAAC,SAAS,EAAEH,SAAS,CAAC,CAAA;AAE9CD,MAAAA,OAAO,CAACI,gBAAgB,CAAC,UAAU,EAAEF,UAAU,CAAC,CAAA;AACpD,KAAA;AAEA,IAAA,OAAO,MAAM;AACT,MAAA,IAAIF,OAAO,EAAE;AACTA,QAAAA,OAAO,CAACK,mBAAmB,CAAC,SAAS,EAAEJ,SAAS,CAAC,CAAA;AAEjDD,QAAAA,OAAO,CAACK,mBAAmB,CAAC,UAAU,EAAEH,UAAU,CAAC,CAAA;AACvD,OAAA;KACH,CAAA;GACJ,EAAE,CAACD,SAAS,EAAED,OAAO,EAAEE,UAAU,CAAC,CAAC,CAAA;AACxC,CAAC;;ACWD;AACA;AACA;AACA,MAAMI,aAAsC,GAAGC,eAAe,CAAA;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,SAAS,GAAGC,UAAU,CAAiC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAChF,MAAMC,YAAY,GAAGC,QAAQ,EAAE,IAAIC,KAAK,CAACC,KAAK,CAAA;EAC9C,MAAM;IACFC,WAAW;IACXC,QAAQ,GAAGX,aAAa,CAACW,QAAQ;IACjCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,OAAO,GAAGd,eAAe,CAACc,OAAO;IACjCC,QAAQ,GAAGhB,aAAa,CAACgB,QAAQ;IACjCC,QAAQ;IACRC,sBAAsB;AACtBC,IAAAA,KAAK,GAAGb,YAAY;IACpBc,EAAE;IACFC,QAAQ;IACRC,eAAe;IACf,GAAGC,cAAAA;AACP,GAAC,GAAGnB,KAAK,CAAA;AACT;EACA,MAAMoB,UAAU,GAAGC,cAAK,CAACC,QAAQ,CAACC,KAAK,CAACf,QAAQ,CAAC,CAAA;EAEjD,MAAM;AACFF,IAAAA,WAAW,EAAEkB,YAAY;IACzBC,WAAW;IACXC,YAAY;IACZC,aAAa;IACbC,iBAAiB;IACjBC,WAAW;IACXC,WAAW;IACXC,iBAAiB;IACjBC,eAAe;IACfC,SAAS;IACTC,YAAY;IACZC,aAAa;IACbC,cAAc;AACdC,IAAAA,gBAAAA;AACJ,GAAC,GAAGC,iBAAiB,CAACC,oBAAoB,CAAC;IACvCjC,WAAW;IACXkC,kBAAkB,EAAE5C,aAAa,CAACU,WAAqB;AACvDC,IAAAA,QAAQ,EAAEkC,OAAO,CAAClC,QAAQ,CAAC;IAC3Ba,UAAU;IACVT,OAAO;IACPK,EAAE;IACFJ,QAAQ;IACRC,QAAQ;AACRI,IAAAA,QAAAA;AACJ,GAAC,CAAC,CAAA;AAEF5B,EAAAA,cAAc,CAAC;AACXC,IAAAA,OAAO,EAAE2C,SAAS;AAClB1C,IAAAA,SAAS,EAAE2C,YAAY;AACvB1C,IAAAA,UAAU,EAAE2C,aAAAA;AAChB,GAAC,CAAC,CAAA;AAEF,EAAA,MAAMO,YAAY,GAAG5B,sBAAsB,IAAIe,WAAW,GAAG,CAAC,CAAA;EAE9D,oBACIc,GAAA,CAACC,MAAM,EAAA;AACHtC,IAAAA,WAAW,EAAEkB,YAAa;AAC1BR,IAAAA,EAAE,EAAES,WAAY;AAChBhB,IAAAA,SAAS,EAAEA,SAAU;AACrBM,IAAAA,KAAK,EAAEA,KAAM;AACbL,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBgB,IAAAA,aAAa,EAAEA,aAAc;AAC7BpB,IAAAA,QAAQ,EAAEA,QAAS;AACnBU,IAAAA,QAAQ,EAAEW,iBAAkB;AAC5BQ,IAAAA,cAAc,EAAEA,cAAe;AAC/BnC,IAAAA,GAAG,EAAE4C,SAAS,CAAC5C,GAAG,EAAEyB,YAAY,CAAE;AAClCoB,IAAAA,WAAW,EAAEJ,YAAa;AAC1BxB,IAAAA,eAAe,EAAEA,eAAgB;AACjC6B,IAAAA,WAAW,EACPjC,sBAAsB,IAAIe,WAAW,GAAG,CAAC,gBACrCc,GAAA,CAAA,KAAA,EAAA;AAAKlC,MAAAA,SAAS,EAAE,CAAA,EAAGmC,MAAM,CAACnC,SAAS,CAAa,UAAA,CAAA;MAAAD,QAAA,eAC5CmC,GAAA,CAACL,iBAAiB,EAAA;AAAA,QAAA,GACVxB,sBAAsB;AAC1BR,QAAAA,WAAW,EAAEkB,YAAa;AAC1BO,QAAAA,iBAAiB,EAAEA,iBAAkB;AACrCD,QAAAA,WAAW,EAAEA,WAAY;AACzBE,QAAAA,eAAe,EAAEA,eAAgB;AACjCH,QAAAA,WAAW,EAAEA,WAAY;AACzBmB,QAAAA,SAAS,EAAEf,SAAU;AACrBlB,QAAAA,KAAK,EAAEA,KAAM;AACbY,QAAAA,aAAa,EAAEA,aAAc;AAC7BsB,QAAAA,eAAe,EAAE;AACb,UAAA,eAAe,EAAErB,iBAAiB;AAClC,UAAA,GAAGd,sBAAsB,CAACmC,eAAAA;SAC5B;AACFC,QAAAA,mBAAmB,EAAE;AACjB,UAAA,eAAe,EAAEtB,iBAAiB;AAClC,UAAA,GAAGd,sBAAsB,CAACoC,mBAAAA;SAC5B;QACFC,eAAe,EACX5C,QAAQ,GACF;AACI,UAAA,eAAe,EAAEqB,iBAAiB;AAClCwB,UAAAA,OAAO,EAAEf,gBAAgB;AACzB,UAAA,GAAGvB,sBAAsB,CAACqC,eAAAA;AAC9B,SAAC,GACDE,SACT;QACDC,mBAAmB,EAAGC,KAAK,KAAM;AAC7B,UAAA,eAAe,EAAEC,qBAAqB,CAAC5B,iBAAiB,EAAE2B,KAAK,CAAC;AAChE,UAAA,GAAGzC,sBAAsB,CAACwC,mBAAmB,GAAGC,KAAK,CAAA;SACxD,CAAA;OACJ,CAAA;KACA,CAAC,GACNF,SACP;AAAA,IAAA,GACGlC,cAAc;AAAAX,IAAAA,QAAA,EAEjBA,QAAAA;AAAQ,GACL,CAAC,CAAA;AAEjB,CAAC,EAAC;AAEFV,SAAS,CAAC2D,WAAW,GAAG,WAAW,CAAA;AACnC3D,SAAS,CAAC4D,YAAY,GAAG9D,aAAa;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eaf6c45a.js","sources":["../../../lumx-icons/dist/esm/close.js"],"sourcesContent":["export const mdiClose = 'M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';"],"names":["mdiClose"],"mappings":"AAAO,MAAMA,QAAQ,GAAG;;;;"}
|