@lumx/react 3.20.1-alpha.1 → 3.20.1-alpha.11
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/01bc8fcf.js +114 -0
- package/_internal/01bc8fcf.js.map +1 -0
- package/_internal/0361b7fb.js +15 -0
- package/_internal/0361b7fb.js.map +1 -0
- package/_internal/077b7bef.js +29 -0
- package/_internal/077b7bef.js.map +1 -0
- package/_internal/07e0bd90.js +147 -0
- package/_internal/07e0bd90.js.map +1 -0
- package/_internal/0a31e895.js +304 -0
- package/_internal/0a31e895.js.map +1 -0
- package/_internal/0b9c76cb.js +6 -0
- package/_internal/0b9c76cb.js.map +1 -0
- package/_internal/0f4b35b2.js +76 -0
- package/_internal/0f4b35b2.js.map +1 -0
- package/_internal/18334f0d.js +140 -0
- package/_internal/18334f0d.js.map +1 -0
- package/_internal/1921f348.js +72 -0
- package/_internal/1921f348.js.map +1 -0
- package/_internal/1aaa0341.js +645 -0
- package/_internal/1aaa0341.js.map +1 -0
- package/_internal/1ce667fb.js +790 -0
- package/_internal/1ce667fb.js.map +1 -0
- package/_internal/1e4b7ad5.js +60 -0
- package/_internal/1e4b7ad5.js.map +1 -0
- package/_internal/1eab656b.js +75 -0
- package/_internal/1eab656b.js.map +1 -0
- package/_internal/21aeb1c7.js +19 -0
- package/_internal/21aeb1c7.js.map +1 -0
- package/_internal/21cf275f.js +158 -0
- package/_internal/21cf275f.js.map +1 -0
- package/_internal/230173a8.js +13 -0
- package/_internal/230173a8.js.map +1 -0
- package/_internal/2368cb68.js +297 -0
- package/_internal/2368cb68.js.map +1 -0
- package/_internal/286fc728.js +2 -0
- package/_internal/286fc728.js.map +1 -0
- package/_internal/2938a251.js +147 -0
- package/_internal/2938a251.js.map +1 -0
- package/_internal/2a3d237c.js +12 -0
- package/_internal/2a3d237c.js.map +1 -0
- package/_internal/2c7942af.js +108 -0
- package/_internal/2c7942af.js.map +1 -0
- package/_internal/2d6bde7d.js +209 -0
- package/_internal/2d6bde7d.js.map +1 -0
- package/_internal/30f4c83c.js +59 -0
- package/_internal/30f4c83c.js.map +1 -0
- package/_internal/3181f000.js +14 -0
- package/_internal/3181f000.js.map +1 -0
- package/_internal/32698205.js +107 -0
- package/_internal/32698205.js.map +1 -0
- package/_internal/3646abc3.js +346 -0
- package/_internal/3646abc3.js.map +1 -0
- package/_internal/3683d267.js +52 -0
- package/_internal/3683d267.js.map +1 -0
- package/_internal/36bd7352.js +219 -0
- package/_internal/36bd7352.js.map +1 -0
- package/_internal/38b3ecf3.js +133 -0
- package/_internal/38b3ecf3.js.map +1 -0
- package/_internal/3a1facc0.js +18 -0
- package/_internal/3a1facc0.js.map +1 -0
- package/_internal/3f3de25e.js +112 -0
- package/_internal/3f3de25e.js.map +1 -0
- package/_internal/407735b4.js +2155 -0
- package/_internal/407735b4.js.map +1 -0
- package/_internal/43262bfe.js +48 -0
- package/_internal/43262bfe.js.map +1 -0
- package/_internal/432c85a7.js +50 -0
- package/_internal/432c85a7.js.map +1 -0
- package/_internal/49bbeed3.js +6 -0
- package/_internal/49bbeed3.js.map +1 -0
- package/_internal/4c5a7b63.js +53 -0
- package/_internal/4c5a7b63.js.map +1 -0
- package/_internal/4ceaf17c.js +75 -0
- package/_internal/4ceaf17c.js.map +1 -0
- package/_internal/4d92e13b.js +97 -0
- package/_internal/4d92e13b.js.map +1 -0
- package/{src/utils/partitionMulti.ts → _internal/4daccdd5.js} +5 -9
- package/_internal/4daccdd5.js.map +1 -0
- package/_internal/4e1dde79.js +104 -0
- package/_internal/4e1dde79.js.map +1 -0
- package/_internal/5ba8fae8.js +120 -0
- package/_internal/5ba8fae8.js.map +1 -0
- package/_internal/60923026.js +36 -0
- package/_internal/60923026.js.map +1 -0
- package/_internal/60f8e509.js +745 -0
- package/_internal/60f8e509.js.map +1 -0
- package/_internal/64046d7a.js +57 -0
- package/_internal/64046d7a.js.map +1 -0
- package/_internal/70cf341b.js +117 -0
- package/_internal/70cf341b.js.map +1 -0
- package/_internal/714809cc.js +312 -0
- package/_internal/714809cc.js.map +1 -0
- package/_internal/72407886.js +430 -0
- package/_internal/72407886.js.map +1 -0
- package/_internal/742d4906.js +148 -0
- package/_internal/742d4906.js.map +1 -0
- package/_internal/77eb8ef3.js +149 -0
- package/_internal/77eb8ef3.js.map +1 -0
- package/_internal/78df9309.js +20 -0
- package/_internal/78df9309.js.map +1 -0
- package/_internal/7b214f74.js +70 -0
- package/_internal/7b214f74.js.map +1 -0
- package/_internal/7b221b05.js +9 -0
- package/_internal/7b221b05.js.map +1 -0
- package/_internal/7c4f4643.js +20 -0
- package/_internal/7c4f4643.js.map +1 -0
- package/_internal/7daf0f24.js +77 -0
- package/_internal/7daf0f24.js.map +1 -0
- package/_internal/803945f7.js +65 -0
- package/_internal/803945f7.js.map +1 -0
- package/_internal/80e5c950.js +80 -0
- package/_internal/80e5c950.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/85d992d2.js +678 -0
- package/_internal/85d992d2.js.map +1 -0
- package/_internal/87bada02.js +262 -0
- package/_internal/87bada02.js.map +1 -0
- package/_internal/881714a1.js +187 -0
- package/_internal/881714a1.js.map +1 -0
- package/_internal/88ec77c2.js +130 -0
- package/_internal/88ec77c2.js.map +1 -0
- package/_internal/8fcceef3.js +120 -0
- package/_internal/8fcceef3.js.map +1 -0
- package/_internal/9210e2f3.js +61 -0
- package/_internal/9210e2f3.js.map +1 -0
- package/_internal/9452daf7.js +103 -0
- package/_internal/9452daf7.js.map +1 -0
- package/_internal/95a2e851.js +42 -0
- package/_internal/95a2e851.js.map +1 -0
- package/_internal/9cf0d217.js +147 -0
- package/_internal/9cf0d217.js.map +1 -0
- package/_internal/9cfa3e10.js +108 -0
- package/_internal/9cfa3e10.js.map +1 -0
- package/_internal/9d8130ae.js +301 -0
- package/_internal/9d8130ae.js.map +1 -0
- package/_internal/a67f26a8.js +98 -0
- package/_internal/a67f26a8.js.map +1 -0
- package/_internal/aa8c5d9b.js +50 -0
- package/_internal/aa8c5d9b.js.map +1 -0
- package/_internal/aafcf80e.js +312 -0
- package/_internal/aafcf80e.js.map +1 -0
- package/_internal/ac3bc511.js +2 -0
- package/_internal/ac3bc511.js.map +1 -0
- package/_internal/b3bfbe72.js +24 -0
- package/_internal/b3bfbe72.js.map +1 -0
- package/_internal/b925072d.js +91 -0
- package/_internal/b925072d.js.map +1 -0
- package/_internal/baa0a23b.js +95 -0
- package/_internal/baa0a23b.js.map +1 -0
- package/_internal/bba7d4c4.js +225 -0
- package/_internal/bba7d4c4.js.map +1 -0
- package/_internal/bc4cb4c0.js +86 -0
- package/_internal/bc4cb4c0.js.map +1 -0
- package/_internal/bcce6ceb.js +93 -0
- package/_internal/bcce6ceb.js.map +1 -0
- package/_internal/bdd41804.js +157 -0
- package/_internal/bdd41804.js.map +1 -0
- package/_internal/c43d098b.js +42 -0
- package/_internal/c43d098b.js.map +1 -0
- package/_internal/cb036703.js +113 -0
- package/_internal/cb036703.js.map +1 -0
- package/_internal/cc995526.js +2 -0
- package/_internal/cc995526.js.map +1 -0
- package/_internal/cdc3efab.js +173 -0
- package/_internal/cdc3efab.js.map +1 -0
- package/_internal/d0dd1815.js +10 -0
- package/_internal/d0dd1815.js.map +1 -0
- package/_internal/d3321a86.js +290 -0
- package/_internal/d3321a86.js.map +1 -0
- package/_internal/d66c4375.js +62 -0
- package/_internal/d66c4375.js.map +1 -0
- package/_internal/d6b3a3c0.js +317 -0
- package/_internal/d6b3a3c0.js.map +1 -0
- package/_internal/dd0a245d.js +142 -0
- package/_internal/dd0a245d.js.map +1 -0
- package/_internal/de24f857.js +4 -0
- package/_internal/de24f857.js.map +1 -0
- package/_internal/e2122a37.js +3 -0
- package/_internal/e2122a37.js.map +1 -0
- package/_internal/e2440593.js +148 -0
- package/_internal/e2440593.js.map +1 -0
- package/_internal/e4613195.js +59 -0
- package/_internal/e4613195.js.map +1 -0
- package/_internal/e53b5a39.js +407 -0
- package/_internal/e53b5a39.js.map +1 -0
- package/_internal/e566d502.js +54 -0
- package/_internal/e566d502.js.map +1 -0
- package/_internal/e806b848.js +9 -0
- package/_internal/e806b848.js.map +1 -0
- package/_internal/eaf6c45a.js +4 -0
- package/_internal/eaf6c45a.js.map +1 -0
- package/_internal/ee64ab0d.js +149 -0
- package/_internal/ee64ab0d.js.map +1 -0
- package/_internal/ef5d1aac.js +4 -0
- package/_internal/ef5d1aac.js.map +1 -0
- package/_internal/f0d7d6ea.js +30 -0
- package/_internal/f0d7d6ea.js.map +1 -0
- package/_internal/f57d4eb8.js +53 -0
- package/_internal/f57d4eb8.js.map +1 -0
- package/_internal/fc47f2da.js +72 -0
- package/_internal/fc47f2da.js.map +1 -0
- package/index.d.ts +36 -36
- package/index.js +65 -14480
- package/index.js.map +1 -1
- package/package.json +10 -13
- package/utils/index.d.ts +7 -7
- 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 -35
- 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 -101
- 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 -63
- 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 -121
- package/src/components/avatar/Avatar.test.tsx +0 -34
- package/src/components/avatar/Avatar.tsx +0 -114
- package/src/components/avatar/index.ts +0 -1
- package/src/components/badge/Badge.stories.tsx +0 -70
- package/src/components/badge/Badge.test.tsx +0 -47
- package/src/components/badge/Badge.tsx +0 -58
- package/src/components/badge/BadgeWrapper.stories.tsx +0 -76
- package/src/components/badge/BadgeWrapper.test.tsx +0 -49
- package/src/components/badge/BadgeWrapper.tsx +0 -37
- package/src/components/badge/index.ts +0 -2
- package/src/components/button/Button.stories.tsx +0 -356
- package/src/components/button/Button.test.tsx +0 -127
- package/src/components/button/Button.tsx +0 -103
- package/src/components/button/ButtonGroup.stories.tsx +0 -54
- package/src/components/button/ButtonGroup.test.tsx +0 -43
- package/src/components/button/ButtonGroup.tsx +0 -52
- package/src/components/button/ButtonRoot.tsx +0 -193
- package/src/components/button/IconButton.stories.tsx +0 -52
- package/src/components/button/IconButton.test.tsx +0 -68
- package/src/components/button/IconButton.tsx +0 -93
- 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 -156
- package/src/components/checkbox/Checkbox.tsx +0 -164
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/chip/Chip.stories.tsx +0 -166
- 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 -49
- package/src/components/chip/ChipGroup.test.tsx +0 -39
- 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 -92
- package/src/components/comment-block/CommentBlock.test.tsx +0 -29
- 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 -36
- package/src/components/date-picker/DatePicker.tsx +0 -52
- package/src/components/date-picker/DatePickerControlled.test.tsx +0 -93
- 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 -72
- 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 -99
- package/src/components/dialog/Dialog.tsx +0 -288
- package/src/components/dialog/index.ts +0 -1
- package/src/components/divider/Divider.test.tsx +0 -53
- package/src/components/divider/Divider.tsx +0 -52
- package/src/components/divider/index.ts +0 -1
- package/src/components/drag-handle/DragHandle.test.tsx +0 -38
- package/src/components/drag-handle/DragHandle.tsx +0 -53
- 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 -186
- 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 -64
- package/src/components/flag/Flag.tsx +0 -54
- package/src/components/flag/index.ts +0 -1
- package/src/components/flex-box/FlexBox.stories.tsx +0 -158
- package/src/components/flex-box/FlexBox.test.tsx +0 -25
- 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 -85
- package/src/components/grid/GridItem.tsx +0 -57
- package/src/components/grid/index.ts +0 -2
- package/src/components/grid-column/GridColumn.stories.tsx +0 -46
- package/src/components/grid-column/GridColumn.test.jsx +0 -58
- 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 -70
- package/src/components/heading/Heading.test.tsx +0 -84
- package/src/components/heading/Heading.tsx +0 -67
- 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 -47
- package/src/components/icon/Icon.test.tsx +0 -44
- package/src/components/icon/Icon.tsx +0 -24
- package/src/components/icon/index.ts +0 -1
- package/src/components/image-block/ImageBlock.stories.tsx +0 -119
- package/src/components/image-block/ImageBlock.test.tsx +0 -59
- 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 -161
- package/src/components/image-lightbox/ImageLightbox.test.tsx +0 -252
- 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 -50
- package/src/components/image-lightbox/useImageLightbox.tsx +0 -141
- package/src/components/inline-list/InlineList.stories.tsx +0 -78
- package/src/components/inline-list/InlineList.test.tsx +0 -54
- 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 -57
- 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 -47
- package/src/components/input-label/InputLabel.test.tsx +0 -61
- 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 -55
- package/src/components/lightbox/Lightbox.tsx +0 -180
- package/src/components/lightbox/index.ts +0 -1
- package/src/components/link/Link.stories.tsx +0 -196
- package/src/components/link/Link.test.tsx +0 -127
- package/src/components/link/Link.tsx +0 -119
- 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 -107
- package/src/components/link-preview/LinkPreview.tsx +0 -160
- 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 -20
- 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 -24
- package/src/components/list/ListDivider.tsx +0 -37
- package/src/components/list/ListItem.stories.tsx +0 -66
- package/src/components/list/ListItem.test.tsx +0 -95
- 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 -23
- 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 -77
- 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 -79
- package/src/components/mosaic/Mosaic.tsx +0 -98
- package/src/components/mosaic/index.ts +0 -1
- package/src/components/navigation/Navigation.stories.tsx +0 -236
- package/src/components/navigation/Navigation.test.tsx +0 -67
- package/src/components/navigation/Navigation.tsx +0 -81
- package/src/components/navigation/NavigationItem.test.tsx +0 -37
- package/src/components/navigation/NavigationItem.tsx +0 -86
- package/src/components/navigation/NavigationSection.test.tsx +0 -139
- package/src/components/navigation/NavigationSection.tsx +0 -107
- package/src/components/navigation/context.tsx +0 -7
- package/src/components/navigation/index.ts +0 -1
- package/src/components/notification/Notification.test.tsx +0 -95
- 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 -64
- 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 -140
- package/src/components/popover-dialog/PopoverDialog.tsx +0 -76
- package/src/components/popover-dialog/index.tsx +0 -1
- package/src/components/post-block/PostBlock.test.tsx +0 -29
- 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 -70
- package/src/components/progress/ProgressCircular.stories.tsx +0 -44
- package/src/components/progress/ProgressCircular.test.tsx +0 -48
- package/src/components/progress/ProgressCircular.tsx +0 -84
- package/src/components/progress/ProgressLinear.stories.tsx +0 -12
- package/src/components/progress/ProgressLinear.test.tsx +0 -32
- package/src/components/progress/ProgressLinear.tsx +0 -52
- 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 -44
- package/src/components/progress-tracker/ProgressTracker.tsx +0 -87
- package/src/components/progress-tracker/ProgressTrackerProvider.test.tsx +0 -67
- package/src/components/progress-tracker/ProgressTrackerProvider.tsx +0 -67
- package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +0 -38
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +0 -159
- package/src/components/progress-tracker/ProgressTrackerStepPanel.test.tsx +0 -36
- package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +0 -69
- 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 -145
- 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 -31
- 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 -200
- 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 -215
- 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 -39
- 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 -138
- package/src/components/side-navigation/SideNavigationItem.tsx +0 -170
- 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 -29
- package/src/components/skeleton/SkeletonCircle.tsx +0 -54
- package/src/components/skeleton/SkeletonRectangle.stories.tsx +0 -82
- package/src/components/skeleton/SkeletonRectangle.test.tsx +0 -29
- package/src/components/skeleton/SkeletonRectangle.tsx +0 -90
- package/src/components/skeleton/SkeletonTypography.stories.tsx +0 -21
- package/src/components/skeleton/SkeletonTypography.test.tsx +0 -29
- 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 -31
- 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 -180
- package/src/components/slideshow/Slideshow.test.tsx +0 -37
- package/src/components/slideshow/Slideshow.tsx +0 -173
- package/src/components/slideshow/SlideshowControls.stories.tsx +0 -102
- package/src/components/slideshow/SlideshowControls.tsx +0 -243
- package/src/components/slideshow/SlideshowItem.tsx +0 -46
- 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 -146
- package/src/components/switch/Switch.tsx +0 -145
- package/src/components/switch/index.ts +0 -1
- package/src/components/table/Table.test.tsx +0 -31
- package/src/components/table/Table.tsx +0 -61
- package/src/components/table/TableBody.test.tsx +0 -32
- package/src/components/table/TableBody.tsx +0 -44
- package/src/components/table/TableCell.test.tsx +0 -74
- package/src/components/table/TableCell.tsx +0 -132
- package/src/components/table/TableHeader.test.tsx +0 -32
- package/src/components/table/TableHeader.tsx +0 -50
- package/src/components/table/TableRow.test.tsx +0 -42
- package/src/components/table/TableRow.tsx +0 -73
- package/src/components/table/index.ts +0 -5
- package/src/components/tabs/Tab.test.tsx +0 -52
- package/src/components/tabs/Tab.tsx +0 -133
- package/src/components/tabs/TabList.test.tsx +0 -51
- package/src/components/tabs/TabList.tsx +0 -94
- package/src/components/tabs/TabPanel.test.tsx +0 -39
- package/src/components/tabs/TabPanel.tsx +0 -69
- package/src/components/tabs/TabProvider.test.tsx +0 -163
- 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 -94
- package/src/components/text/Text.tsx +0 -141
- 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 -299
- 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 -66
- 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 -117
- package/src/components/tooltip/Tooltip.test.tsx +0 -411
- 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 -148
- 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 -135
- package/src/components/user-block/UserBlock.test.tsx +0 -108
- 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 -23
- 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 -13
- 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 -8
- package/src/stories/decorators/withCombinations.tsx +0 -132
- package/src/stories/decorators/withNestedProps.tsx +0 -23
- package/src/stories/decorators/withResizableBox.tsx +0 -21
- package/src/stories/decorators/withThemedBackground.tsx +0 -18
- package/src/stories/decorators/withValueOnChange.tsx +0 -18
- package/src/stories/decorators/withWrapper.tsx +0 -21
- 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 -13
- 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 -11
- 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 -5
- 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 -32
- package/src/utils/Portal/Portal.tsx +0 -33
- package/src/utils/Portal/PortalProvider.stories.jsx +0 -23
- package/src/utils/Portal/PortalProvider.test.tsx +0 -73
- 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 -94
- 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/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/renderButtonOrLink.tsx +0 -16
- 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 -8
- package/src/utils/type/MaybeElementOrRef.ts +0 -6
- package/src/utils/type/index.ts +0 -8
- 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,157 @@
|
|
|
1
|
+
import { m as getRootClassName, n as forwardRef, b as Theme, j as ColorPalette, l as classNames, _ as _extends, d as Emphasis } from './d3321a86.js';
|
|
2
|
+
import React__default, { Children, useRef } from 'react';
|
|
3
|
+
import isEmpty from 'lodash/isEmpty';
|
|
4
|
+
import { i as isComponent } from './78df9309.js';
|
|
5
|
+
import { h as handleBasicClasses } from './4ceaf17c.js';
|
|
6
|
+
import { p as partitionMulti } from './4daccdd5.js';
|
|
7
|
+
import { u as useTheme } from './3181f000.js';
|
|
8
|
+
import { I as IS_BROWSER } from './b3bfbe72.js';
|
|
9
|
+
import { m as mdiChevronUp, a as mdiChevronDown } from './0b9c76cb.js';
|
|
10
|
+
import { DragHandle } from './f57d4eb8.js';
|
|
11
|
+
import { I as IconButton } from './7b214f74.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Defines the props of the component.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Component display name.
|
|
19
|
+
*/
|
|
20
|
+
const COMPONENT_NAME = 'ExpansionPanel';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Component default class name and class prefix.
|
|
24
|
+
*/
|
|
25
|
+
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Component default props.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_PROPS = {
|
|
31
|
+
closeMode: 'unmount'
|
|
32
|
+
};
|
|
33
|
+
const isDragHandle = isComponent(DragHandle);
|
|
34
|
+
const isHeader = isComponent('header');
|
|
35
|
+
const isFooter = isComponent('footer');
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* ExpansionPanel component.
|
|
39
|
+
*
|
|
40
|
+
* @param props Component props.
|
|
41
|
+
* @param ref Component ref.
|
|
42
|
+
* @return React element.
|
|
43
|
+
*/
|
|
44
|
+
const ExpansionPanel = forwardRef((props, ref) => {
|
|
45
|
+
const defaultTheme = useTheme() || Theme.light;
|
|
46
|
+
const {
|
|
47
|
+
className,
|
|
48
|
+
closeMode = DEFAULT_PROPS.closeMode,
|
|
49
|
+
children: anyChildren,
|
|
50
|
+
hasBackground,
|
|
51
|
+
hasHeaderDivider,
|
|
52
|
+
isOpen,
|
|
53
|
+
label,
|
|
54
|
+
onClose,
|
|
55
|
+
onOpen,
|
|
56
|
+
onToggleOpen,
|
|
57
|
+
theme = defaultTheme,
|
|
58
|
+
toggleButtonProps,
|
|
59
|
+
...forwardedProps
|
|
60
|
+
} = props;
|
|
61
|
+
const children = Children.toArray(anyChildren);
|
|
62
|
+
|
|
63
|
+
// Partition children by types.
|
|
64
|
+
const [[dragHandle], [header], [footer], content] = partitionMulti(children, [isDragHandle, isHeader, isFooter]);
|
|
65
|
+
|
|
66
|
+
// Either take the header in children or create one with the label.
|
|
67
|
+
const headerProps = /*#__PURE__*/React__default.isValidElement(header) ? header.props : {};
|
|
68
|
+
const headerContent = !isEmpty(headerProps.children) ? headerProps.children : /*#__PURE__*/React__default.createElement("span", {
|
|
69
|
+
className: `${CLASSNAME}__label`
|
|
70
|
+
}, label);
|
|
71
|
+
const toggleOpen = event => {
|
|
72
|
+
const shouldOpen = !isOpen;
|
|
73
|
+
if (onOpen && shouldOpen) {
|
|
74
|
+
onOpen(event);
|
|
75
|
+
}
|
|
76
|
+
if (onClose && !shouldOpen) {
|
|
77
|
+
onClose(event);
|
|
78
|
+
}
|
|
79
|
+
if (onToggleOpen) {
|
|
80
|
+
onToggleOpen(shouldOpen, event);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const color = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
|
|
84
|
+
const rootClassName = classNames(className, handleBasicClasses({
|
|
85
|
+
hasBackground,
|
|
86
|
+
hasHeader: Boolean(!isEmpty(headerProps.children)),
|
|
87
|
+
hasHeaderDivider,
|
|
88
|
+
isClose: !isOpen,
|
|
89
|
+
isDraggable: Boolean(dragHandle),
|
|
90
|
+
isOpen,
|
|
91
|
+
prefix: CLASSNAME,
|
|
92
|
+
theme
|
|
93
|
+
}));
|
|
94
|
+
const wrapperRef = useRef(null);
|
|
95
|
+
|
|
96
|
+
// Children stay visible while the open/close transition is running
|
|
97
|
+
const [isChildrenVisible, setChildrenVisible] = React__default.useState(isOpen);
|
|
98
|
+
const isOpenRef = React__default.useRef(isOpen);
|
|
99
|
+
React__default.useEffect(() => {
|
|
100
|
+
if (isOpen || closeMode === 'hide') {
|
|
101
|
+
setChildrenVisible(true);
|
|
102
|
+
} else if (!IS_BROWSER) {
|
|
103
|
+
// Outside a browser we can't wait for the transition
|
|
104
|
+
setChildrenVisible(false);
|
|
105
|
+
}
|
|
106
|
+
isOpenRef.current = isOpen;
|
|
107
|
+
}, [closeMode, isOpen]);
|
|
108
|
+
|
|
109
|
+
// Change children's visibility on the transition end
|
|
110
|
+
React__default.useEffect(() => {
|
|
111
|
+
const {
|
|
112
|
+
current: wrapper
|
|
113
|
+
} = wrapperRef;
|
|
114
|
+
if (!IS_BROWSER || !wrapper) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const onTransitionEnd = () => {
|
|
118
|
+
setChildrenVisible(isOpenRef.current || closeMode === 'hide');
|
|
119
|
+
};
|
|
120
|
+
wrapper.addEventListener('transitionend', onTransitionEnd);
|
|
121
|
+
return () => wrapper.removeEventListener('transitionend', onTransitionEnd);
|
|
122
|
+
}, [closeMode]);
|
|
123
|
+
return /*#__PURE__*/React__default.createElement("section", _extends({
|
|
124
|
+
ref: ref
|
|
125
|
+
}, forwardedProps, {
|
|
126
|
+
className: rootClassName
|
|
127
|
+
}), /*#__PURE__*/React__default.createElement("header", {
|
|
128
|
+
className: `${CLASSNAME}__header`,
|
|
129
|
+
onClick: toggleOpen
|
|
130
|
+
}, dragHandle && /*#__PURE__*/React__default.createElement("div", {
|
|
131
|
+
className: `${CLASSNAME}__header-drag`
|
|
132
|
+
}, dragHandle), /*#__PURE__*/React__default.createElement("div", _extends({}, headerProps, {
|
|
133
|
+
className: `${CLASSNAME}__header-content`
|
|
134
|
+
}), headerContent), /*#__PURE__*/React__default.createElement("div", {
|
|
135
|
+
className: `${CLASSNAME}__header-toggle`
|
|
136
|
+
}, /*#__PURE__*/React__default.createElement(IconButton, _extends({}, toggleButtonProps, {
|
|
137
|
+
color: color,
|
|
138
|
+
emphasis: Emphasis.low,
|
|
139
|
+
icon: isOpen ? mdiChevronUp : mdiChevronDown,
|
|
140
|
+
"aria-expanded": isOpen || 'false'
|
|
141
|
+
})))), /*#__PURE__*/React__default.createElement("div", {
|
|
142
|
+
className: `${CLASSNAME}__wrapper`,
|
|
143
|
+
ref: wrapperRef
|
|
144
|
+
}, (isOpen || isChildrenVisible) && /*#__PURE__*/React__default.createElement("div", {
|
|
145
|
+
className: `${CLASSNAME}__container`
|
|
146
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
147
|
+
className: `${CLASSNAME}__content`
|
|
148
|
+
}, content), footer && /*#__PURE__*/React__default.createElement("div", {
|
|
149
|
+
className: `${CLASSNAME}__footer`
|
|
150
|
+
}, footer))));
|
|
151
|
+
});
|
|
152
|
+
ExpansionPanel.displayName = COMPONENT_NAME;
|
|
153
|
+
ExpansionPanel.className = CLASSNAME;
|
|
154
|
+
ExpansionPanel.defaultProps = DEFAULT_PROPS;
|
|
155
|
+
|
|
156
|
+
export { ExpansionPanel };
|
|
157
|
+
//# sourceMappingURL=bdd41804.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bdd41804.js","sources":["../../src/components/expansion-panel/ExpansionPanel.tsx"],"sourcesContent":["import React, { Children, PropsWithChildren, ReactNode, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { mdiChevronDown, mdiChevronUp } from '@lumx/icons';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport { ColorPalette, DragHandle, Emphasis, IconButton, IconButtonProps, Theme } from '@lumx/react';\nimport { GenericProps, HasCloseMode, HasTheme, isComponent } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { partitionMulti } from '@lumx/react/utils/partitionMulti';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\nimport { IS_BROWSER } from '@lumx/react/constants';\n\n/**\n * Defines the props of the component.\n */\nexport interface ExpansionPanelProps extends GenericProps, HasCloseMode, HasTheme {\n /** Whether the expansion panel has a background. */\n hasBackground?: boolean;\n /** Whether the header has a divider. */\n hasHeaderDivider?: boolean;\n /** Whether the component is open or not. */\n isOpen?: boolean;\n /** Label text (overwritten if a `<header>` is provided in the children). */\n label?: string;\n /** On open callback. */\n onOpen?: (event: React.MouseEvent) => void;\n /** On close callback. */\n onClose?: (event: React.MouseEvent) => void;\n /** Props to pass to the toggle button (minus those already set by the ExpansionPanel props). */\n toggleButtonProps: Pick<IconButtonProps, 'label'> &\n Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;\n /** On toggle open or close callback. */\n onToggleOpen?(shouldOpen: boolean, event: React.MouseEvent): void;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ExpansionPanel';\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<ExpansionPanelProps> = {\n closeMode: 'unmount',\n};\n\nconst isDragHandle = isComponent(DragHandle);\nconst isHeader = isComponent('header');\nconst isFooter = isComponent('footer');\n\n/**\n * ExpansionPanel component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ExpansionPanel = forwardRef<ExpansionPanelProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n className,\n closeMode = DEFAULT_PROPS.closeMode,\n children: anyChildren,\n hasBackground,\n hasHeaderDivider,\n isOpen,\n label,\n onClose,\n onOpen,\n onToggleOpen,\n theme = defaultTheme,\n toggleButtonProps,\n ...forwardedProps\n } = props;\n\n const children: ReactNode[] = Children.toArray(anyChildren);\n\n // Partition children by types.\n const [[dragHandle], [header], [footer], content] = partitionMulti(children, [isDragHandle, isHeader, isFooter]);\n\n // Either take the header in children or create one with the label.\n const headerProps: PropsWithChildren<any> = React.isValidElement(header) ? header.props : {};\n const headerContent = !isEmpty(headerProps.children) ? (\n headerProps.children\n ) : (\n <span className={`${CLASSNAME}__label`}>{label}</span>\n );\n\n const toggleOpen = (event: React.MouseEvent) => {\n const shouldOpen = !isOpen;\n\n if (onOpen && shouldOpen) {\n onOpen(event);\n }\n if (onClose && !shouldOpen) {\n onClose(event);\n }\n if (onToggleOpen) {\n onToggleOpen(shouldOpen, event);\n }\n };\n\n const color = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;\n\n const rootClassName = classNames(\n className,\n handleBasicClasses({\n hasBackground,\n hasHeader: Boolean(!isEmpty(headerProps.children)),\n hasHeaderDivider,\n isClose: !isOpen,\n isDraggable: Boolean(dragHandle),\n isOpen,\n prefix: CLASSNAME,\n theme,\n }),\n );\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n // Children stay visible while the open/close transition is running\n const [isChildrenVisible, setChildrenVisible] = React.useState(isOpen);\n\n const isOpenRef = React.useRef(isOpen);\n React.useEffect(() => {\n if (isOpen || closeMode === 'hide') {\n setChildrenVisible(true);\n } else if (!IS_BROWSER) {\n // Outside a browser we can't wait for the transition\n setChildrenVisible(false);\n }\n isOpenRef.current = isOpen;\n }, [closeMode, isOpen]);\n\n // Change children's visibility on the transition end\n React.useEffect(() => {\n const { current: wrapper } = wrapperRef;\n if (!IS_BROWSER || !wrapper) {\n return undefined;\n }\n const onTransitionEnd = () => {\n setChildrenVisible(isOpenRef.current || closeMode === 'hide');\n };\n wrapper.addEventListener('transitionend', onTransitionEnd);\n return () => wrapper.removeEventListener('transitionend', onTransitionEnd);\n }, [closeMode]);\n\n return (\n <section ref={ref} {...forwardedProps} className={rootClassName}>\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}\n <header className={`${CLASSNAME}__header`} onClick={toggleOpen}>\n {dragHandle && <div className={`${CLASSNAME}__header-drag`}>{dragHandle}</div>}\n\n <div {...headerProps} className={`${CLASSNAME}__header-content`}>\n {headerContent}\n </div>\n\n <div className={`${CLASSNAME}__header-toggle`}>\n <IconButton\n {...toggleButtonProps}\n color={color}\n emphasis={Emphasis.low}\n icon={isOpen ? mdiChevronUp : mdiChevronDown}\n aria-expanded={isOpen || 'false'}\n />\n </div>\n </header>\n\n <div className={`${CLASSNAME}__wrapper`} ref={wrapperRef}>\n {(isOpen || isChildrenVisible) && (\n <div className={`${CLASSNAME}__container`}>\n <div className={`${CLASSNAME}__content`}>{content}</div>\n\n {footer && <div className={`${CLASSNAME}__footer`}>{footer}</div>}\n </div>\n )}\n </div>\n </section>\n );\n});\nExpansionPanel.displayName = COMPONENT_NAME;\nExpansionPanel.className = CLASSNAME;\nExpansionPanel.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","closeMode","isDragHandle","isComponent","DragHandle","isHeader","isFooter","ExpansionPanel","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","className","children","anyChildren","hasBackground","hasHeaderDivider","isOpen","label","onClose","onOpen","onToggleOpen","theme","toggleButtonProps","forwardedProps","Children","toArray","dragHandle","header","footer","content","partitionMulti","headerProps","React","isValidElement","headerContent","isEmpty","createElement","toggleOpen","event","shouldOpen","color","dark","ColorPalette","rootClassName","classNames","handleBasicClasses","hasHeader","Boolean","isClose","isDraggable","prefix","wrapperRef","useRef","isChildrenVisible","setChildrenVisible","useState","isOpenRef","useEffect","IS_BROWSER","current","wrapper","undefined","onTransitionEnd","addEventListener","removeEventListener","_extends","onClick","IconButton","emphasis","Emphasis","low","icon","mdiChevronUp","mdiChevronDown","displayName","defaultProps"],"mappings":";;;;;;;;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AAA;GACxBsC,eAAAA,cAAA,CAAAI,aAAA,CAAA,KAAA,EAAA;IAAKzB,SAAS,EAAE,GAAGjB,SAAS,CAAA,SAAA,CAAA;AAAY,GAAA,EAAEmC,OAAa,CAAC,EAEvDD,MAAM,iBAAII,cAAA,CAAAI,aAAA,CAAA,KAAA,EAAA;IAAKzB,SAAS,EAAE,GAAGjB,SAAS,CAAA,QAAA,CAAA;AAAW,GAAA,EAAEkC,MAAY,CAC/D,CAER,CACA,CAAC,CAAA;AAElB,CAAC,EAAC;AACFzB,cAAc,CAACuE,WAAW,GAAGjF,cAAc,CAAA;AAC3CU,cAAc,CAACQ,SAAS,GAAGjB,SAAS,CAAA;AACpCS,cAAc,CAACwE,YAAY,GAAG/E,aAAa;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Portal initializing function.
|
|
6
|
+
* If it does not provide a container, the Portal children will render in classic React tree and not in a portal.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const PortalContext = /*#__PURE__*/React__default.createContext(() => ({
|
|
10
|
+
container: document.body
|
|
11
|
+
}));
|
|
12
|
+
/**
|
|
13
|
+
* Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)
|
|
14
|
+
*/
|
|
15
|
+
const PortalProvider = PortalContext.Provider;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Render children in a portal outside the current DOM position
|
|
19
|
+
* (defaults to `document.body` but can be customized with the PortalContextProvider)
|
|
20
|
+
*/
|
|
21
|
+
const Portal = ({
|
|
22
|
+
children,
|
|
23
|
+
enabled = true
|
|
24
|
+
}) => {
|
|
25
|
+
const init = React__default.useContext(PortalContext);
|
|
26
|
+
const context = React__default.useMemo(() => {
|
|
27
|
+
return enabled ? init() : null;
|
|
28
|
+
},
|
|
29
|
+
// Only update on 'enabled'
|
|
30
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
+
[enabled]);
|
|
32
|
+
React__default.useLayoutEffect(() => {
|
|
33
|
+
return context?.teardown;
|
|
34
|
+
}, [context?.teardown, enabled]);
|
|
35
|
+
if (!context?.container) {
|
|
36
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children);
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/createPortal(children, context.container);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { Portal as P, PortalProvider as a };
|
|
42
|
+
//# sourceMappingURL=c43d098b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"c43d098b.js","sources":["../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx"],"sourcesContent":["import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n"],"names":["PortalContext","React","createContext","container","document","body","PortalProvider","Provider","Portal","children","enabled","init","useContext","context","useMemo","useLayoutEffect","teardown","createElement","Fragment","createPortal"],"mappings":";;;AAIA;AACA;AACA;AACA;;AAMO,MAAMA,aAAa,gBAAGC,cAAK,CAACC,aAAa,CAAa,OAAO;EAAEC,SAAS,EAAEC,QAAQ,CAACC,IAAAA;AAAK,CAAC,CAAC,CAAC,CAAA;AAOlG;AACA;AACA;AACaC,MAAAA,cAA6C,GAAGN,aAAa,CAACO;;ACd3E;AACA;AACA;AACA;AACO,MAAMC,MAA6B,GAAGA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA,OAAO,GAAG,IAAA;AAAK,CAAC,KAAK;AAC3E,EAAA,MAAMC,IAAI,GAAGV,cAAK,CAACW,UAAU,CAACZ,aAAa,CAAC,CAAA;AAC5C,EAAA,MAAMa,OAAO,GAAGZ,cAAK,CAACa,OAAO,CACzB,MAAM;AACF,IAAA,OAAOJ,OAAO,GAAGC,IAAI,EAAE,GAAG,IAAI,CAAA;GACjC;AACD;AACA;EACA,CAACD,OAAO,CACZ,CAAC,CAAA;EAEDT,cAAK,CAACc,eAAe,CAAC,MAAM;IACxB,OAAOF,OAAO,EAAEG,QAAQ,CAAA;GAC3B,EAAE,CAACH,OAAO,EAAEG,QAAQ,EAAEN,OAAO,CAAC,CAAC,CAAA;AAEhC,EAAA,IAAI,CAACG,OAAO,EAAEV,SAAS,EAAE;IACrB,oBAAOF,cAAA,CAAAgB,aAAA,CAAAhB,cAAA,CAAAiB,QAAA,EAAGT,IAAAA,EAAAA,QAAW,CAAC,CAAA;AAC1B,GAAA;AACA,EAAA,oBAAOU,YAAY,CAACV,QAAQ,EAAEI,OAAO,CAACV,SAAS,CAAC,CAAA;AACpD;;;;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { m as getRootClassName, c as Size, O as Orientation, n as forwardRef, _ as _extends, l as classNames } from './d3321a86.js';
|
|
2
|
+
import React__default, { Children } from 'react';
|
|
3
|
+
import isEmpty from 'lodash/isEmpty';
|
|
4
|
+
import noop from 'lodash/noop';
|
|
5
|
+
import { i as isComponentType } from './e806b848.js';
|
|
6
|
+
import { p as partitionMulti } from './4daccdd5.js';
|
|
7
|
+
import { FlexBox } from './64046d7a.js';
|
|
8
|
+
import pick from 'lodash/pick';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Component display name.
|
|
12
|
+
*/
|
|
13
|
+
const COMPONENT_NAME = 'GenericBlock';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Component default class name and class prefix.
|
|
17
|
+
*/
|
|
18
|
+
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Component default props.
|
|
22
|
+
*/
|
|
23
|
+
const DEFAULT_PROPS = {
|
|
24
|
+
gap: Size.big,
|
|
25
|
+
orientation: Orientation.horizontal
|
|
26
|
+
};
|
|
27
|
+
const Figure = noop.bind({});
|
|
28
|
+
const isFigure = isComponentType(Figure);
|
|
29
|
+
const Content = noop.bind({});
|
|
30
|
+
const isContent = isComponentType(Content);
|
|
31
|
+
const Actions = noop.bind({});
|
|
32
|
+
const isActions = isComponentType(Actions);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The GenericBlock is a layout component made of 3 sections that can be
|
|
36
|
+
* displayed either horizontally of vertically with the same gap between each section.
|
|
37
|
+
*
|
|
38
|
+
* The sections are:
|
|
39
|
+
* - `Figure` => A visual element to display before the main content.
|
|
40
|
+
* - `Content` => The main content displayed
|
|
41
|
+
* - `Actions` => One or more actions to set after the element.
|
|
42
|
+
*
|
|
43
|
+
* @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076
|
|
44
|
+
*/
|
|
45
|
+
const BaseGenericBlock = forwardRef((props, ref) => {
|
|
46
|
+
const {
|
|
47
|
+
className,
|
|
48
|
+
figure,
|
|
49
|
+
figureProps,
|
|
50
|
+
children,
|
|
51
|
+
actions,
|
|
52
|
+
actionsProps,
|
|
53
|
+
gap = DEFAULT_PROPS.gap,
|
|
54
|
+
orientation = DEFAULT_PROPS.orientation,
|
|
55
|
+
contentProps,
|
|
56
|
+
...forwardedProps
|
|
57
|
+
} = props;
|
|
58
|
+
const sections = React__default.useMemo(() => {
|
|
59
|
+
// Split children by section type
|
|
60
|
+
const [[figureChild], [contentChild], [actionsChild], ...otherChildren] = partitionMulti(Children.toArray(children), [isFigure, isContent, isActions]);
|
|
61
|
+
return {
|
|
62
|
+
figureChild,
|
|
63
|
+
figureChildProps: figureChild?.props,
|
|
64
|
+
contentChild,
|
|
65
|
+
contentChildProps: contentChild?.props,
|
|
66
|
+
actionsChild,
|
|
67
|
+
actionsChildProps: actionsChild?.props,
|
|
68
|
+
otherChildren: otherChildren.filter(child => !isEmpty(child))
|
|
69
|
+
};
|
|
70
|
+
}, [children]);
|
|
71
|
+
return /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
72
|
+
ref: ref,
|
|
73
|
+
className: classNames(className, CLASSNAME),
|
|
74
|
+
gap: gap,
|
|
75
|
+
orientation: orientation
|
|
76
|
+
}, forwardedProps), (figure || sections.figureChildProps?.children) && /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
77
|
+
ref: sections.figureChild?.ref,
|
|
78
|
+
vAlign: forwardedProps.vAlign,
|
|
79
|
+
hAlign: forwardedProps.hAlign
|
|
80
|
+
}, figureProps, sections.figureChildProps, {
|
|
81
|
+
className: classNames(figureProps?.className, sections.figureChildProps?.className, `${CLASSNAME}__figure`)
|
|
82
|
+
}), figure, sections.figureChildProps?.children), (sections.contentChildProps?.children || sections.otherChildren.length > 0) && /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
83
|
+
ref: sections.contentChild?.ref,
|
|
84
|
+
orientation: Orientation.vertical,
|
|
85
|
+
fillSpace: true,
|
|
86
|
+
vAlign: forwardedProps.vAlign,
|
|
87
|
+
hAlign: forwardedProps.hAlign
|
|
88
|
+
}, contentProps, sections.contentChildProps, {
|
|
89
|
+
className: classNames(contentProps?.className, sections.contentChildProps?.className, `${CLASSNAME}__content`)
|
|
90
|
+
}), sections.contentChildProps?.children, sections.otherChildren), (actions || sections.actionsChildProps?.children) && /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
91
|
+
ref: sections.actionsChild?.ref,
|
|
92
|
+
vAlign: forwardedProps.vAlign,
|
|
93
|
+
hAlign: forwardedProps.hAlign
|
|
94
|
+
}, actionsProps, sections.actionsChildProps, {
|
|
95
|
+
className: classNames(actionsProps?.className, sections.actionsChildProps?.className, `${CLASSNAME}__actions`)
|
|
96
|
+
}), actions, sections.actionsChildProps?.children));
|
|
97
|
+
});
|
|
98
|
+
BaseGenericBlock.displayName = COMPONENT_NAME;
|
|
99
|
+
BaseGenericBlock.className = CLASSNAME;
|
|
100
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS;
|
|
101
|
+
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
102
|
+
Figure,
|
|
103
|
+
Content,
|
|
104
|
+
Actions
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Accepted gap sizes for the generic block.
|
|
109
|
+
*/
|
|
110
|
+
const GenericBlockGapSize = pick(Size, ['tiny', 'regular', 'medium', 'big', 'huge']);
|
|
111
|
+
|
|
112
|
+
export { GenericBlock, GenericBlockGapSize };
|
|
113
|
+
//# sourceMappingURL=cb036703.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cb036703.js","sources":["../../src/components/generic-block/GenericBlock.tsx","../../src/components/generic-block/constants.ts"],"sourcesContent":["import React, { Children, ReactElement, ReactNode } from 'react';\n\nimport classNames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\nimport noop from 'lodash/noop';\n\nimport { Comp, isComponentType } from '@lumx/react/utils/type';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { partitionMulti } from '@lumx/react/utils/partitionMulti';\nimport { Orientation, Size, FlexBox, FlexBoxProps } from '@lumx/react';\nimport { GenericBlockGapSize } from '@lumx/react/components/generic-block/constants';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport interface GenericBlockProps extends FlexBoxProps {\n /**\n * Component to use as visual element.\n */\n figure?: ReactNode;\n /**\n * Actions to set after the main content.\n */\n actions?: ReactNode;\n /**\n * Main content to display or sections components\n * ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})\n */\n children: ReactNode;\n /**\n * Orientation of the 3 sections\n */\n orientation?: FlexBoxProps['orientation'];\n /**\n * Horizontal alignment.\n */\n hAlign?: FlexBoxProps['hAlign'];\n /**\n * Vertical alignment.\n */\n vAlign?: FlexBoxProps['vAlign'];\n /**\n * The props to forward to the content.\n * By default, the content will have the same alignment as wrapper.\n */\n contentProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the actions element.\n */\n actionsProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the figure element.\n */\n figureProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * Gap space between sections.\n */\n gap?: GenericBlockGapSize;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GenericBlock';\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<GenericBlockProps> = {\n gap: Size.big,\n orientation: Orientation.horizontal,\n};\n\ntype BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;\n\ninterface GenericBlockSectionProps extends FlexBoxProps {\n /**\n * Gap space between items.\n */\n gap?: GenericBlockGapSize;\n}\n\ninterface GenericBlock extends BaseGenericBlock {\n /**\n * Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"figure\" section of the block (instead of using `figure` and `figureProps` props).\n */\n Figure: Comp<GenericBlockSectionProps>;\n /**\n * Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"content\" section of the block (instead of using `content` and `contentProps` props).\n */\n Content: Comp<GenericBlockSectionProps>;\n /**\n * Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"actions\" section of the block (instead of using `actions` and `actionsProps` props).\n */\n Actions: Comp<GenericBlockSectionProps>;\n}\n\nconst Figure = noop.bind({}) as Comp<FlexBoxProps>;\nconst isFigure = isComponentType(Figure);\n\nconst Content = noop.bind({}) as Comp<FlexBoxProps>;\nconst isContent = isComponentType(Content);\n\nconst Actions = noop.bind({}) as Comp<FlexBoxProps>;\nconst isActions = isComponentType(Actions);\n\n/**\n * The GenericBlock is a layout component made of 3 sections that can be\n * displayed either horizontally of vertically with the same gap between each section.\n *\n * The sections are:\n * - `Figure` => A visual element to display before the main content.\n * - `Content` => The main content displayed\n * - `Actions` => One or more actions to set after the element.\n *\n * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076\n */\nconst BaseGenericBlock: BaseGenericBlock = forwardRef((props, ref) => {\n const {\n className,\n figure,\n figureProps,\n children,\n actions,\n actionsProps,\n gap = DEFAULT_PROPS.gap,\n orientation = DEFAULT_PROPS.orientation,\n contentProps,\n ...forwardedProps\n } = props;\n\n const sections = React.useMemo(() => {\n // Split children by section type\n const [[figureChild], [contentChild], [actionsChild], ...otherChildren] = partitionMulti(\n Children.toArray(children),\n [isFigure, isContent, isActions],\n );\n return {\n figureChild,\n figureChildProps: (figureChild as ReactElement)?.props,\n contentChild,\n contentChildProps: (contentChild as ReactElement)?.props,\n actionsChild,\n actionsChildProps: (actionsChild as ReactElement)?.props,\n otherChildren: otherChildren.filter((child) => !isEmpty(child)),\n };\n }, [children]);\n\n return (\n <FlexBox\n ref={ref}\n className={classNames(className, CLASSNAME)}\n gap={gap}\n orientation={orientation}\n {...forwardedProps}\n >\n {(figure || sections.figureChildProps?.children) && (\n <FlexBox\n ref={(sections.figureChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...figureProps}\n {...sections.figureChildProps}\n className={classNames(\n figureProps?.className,\n sections.figureChildProps?.className,\n `${CLASSNAME}__figure`,\n )}\n >\n {figure}\n {sections.figureChildProps?.children}\n </FlexBox>\n )}\n\n {(sections.contentChildProps?.children || sections.otherChildren.length > 0) && (\n <FlexBox\n ref={(sections.contentChild as any)?.ref}\n orientation={Orientation.vertical}\n fillSpace\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...contentProps}\n {...sections.contentChildProps}\n className={classNames(\n contentProps?.className,\n sections.contentChildProps?.className,\n `${CLASSNAME}__content`,\n )}\n >\n {sections.contentChildProps?.children}\n {sections.otherChildren}\n </FlexBox>\n )}\n\n {(actions || sections.actionsChildProps?.children) && (\n <FlexBox\n ref={(sections.actionsChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...actionsProps}\n {...sections.actionsChildProps}\n className={classNames(\n actionsProps?.className,\n sections.actionsChildProps?.className,\n `${CLASSNAME}__actions`,\n )}\n >\n {actions}\n {sections.actionsChildProps?.children}\n </FlexBox>\n )}\n </FlexBox>\n );\n});\nBaseGenericBlock.displayName = COMPONENT_NAME;\nBaseGenericBlock.className = CLASSNAME;\nBaseGenericBlock.defaultProps = DEFAULT_PROPS;\n\nexport const GenericBlock: GenericBlock = Object.assign(BaseGenericBlock, { Figure, Content, Actions });\n","import pick from 'lodash/pick';\nimport { Size } from '@lumx/react';\nimport { ValueOf } from '@lumx/react/utils/type';\n\n/**\n * Accepted gap sizes for the generic block.\n */\nexport const GenericBlockGapSize = pick(Size, ['tiny', 'regular', 'medium', 'big', 'huge']);\nexport type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","gap","Size","big","orientation","Orientation","horizontal","Figure","noop","bind","isFigure","isComponentType","Content","isContent","Actions","isActions","BaseGenericBlock","forwardRef","props","ref","className","figure","figureProps","children","actions","actionsProps","contentProps","forwardedProps","sections","React","useMemo","figureChild","contentChild","actionsChild","otherChildren","partitionMulti","Children","toArray","figureChildProps","contentChildProps","actionsChildProps","filter","child","isEmpty","createElement","FlexBox","_extends","classNames","vAlign","hAlign","length","vertical","fillSpace","displayName","defaultProps","GenericBlock","Object","assign","GenericBlockGapSize","pick"],"mappings":";;;;;;;;;AA0DA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,cAAc,CAAA;;AAErC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAyC,GAAG;EAC9CC,GAAG,EAAEC,IAAI,CAACC,GAAG;EACbC,WAAW,EAAEC,WAAW,CAACC,UAAAA;AAC7B,CAAC,CAAA;AA6BD,MAAMC,MAAM,GAAGC,IAAI,CAACC,IAAI,CAAC,EAAE,CAAuB,CAAA;AAClD,MAAMC,QAAQ,GAAGC,eAAe,CAACJ,MAAM,CAAC,CAAA;AAExC,MAAMK,OAAO,GAAGJ,IAAI,CAACC,IAAI,CAAC,EAAE,CAAuB,CAAA;AACnD,MAAMI,SAAS,GAAGF,eAAe,CAACC,OAAO,CAAC,CAAA;AAE1C,MAAME,OAAO,GAAGN,IAAI,CAACC,IAAI,CAAC,EAAE,CAAuB,CAAA;AACnD,MAAMM,SAAS,GAAGJ,eAAe,CAACG,OAAO,CAAC,CAAA;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,gBAAkC,GAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAClE,MAAM;IACFC,SAAS;IACTC,MAAM;IACNC,WAAW;IACXC,QAAQ;IACRC,OAAO;IACPC,YAAY;IACZxB,GAAG,GAAGD,aAAa,CAACC,GAAG;IACvBG,WAAW,GAAG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CAACqB,MAAO;IAC9BC,MAAM,EAAEtB,cAAc,CAACsB,MAAAA;AAAO,GAAA,EAC1BxB,YAAY,EACZG,QAAQ,CAACY,iBAAiB,EAAA;AAC9BpB,IAAAA,SAAS,EAAE2B,UAAU,CACjBtB,YAAY,EAAEL,SAAS,EACvBQ,QAAQ,CAACY,iBAAiB,EAAEpB,SAAS,EACrC,CAAA,EAAGtB,SAAS,CAChB,SAAA,CAAA,CAAA;GAEC0B,CAAAA,EAAAA,OAAO,EACPI,QAAQ,CAACY,iBAAiB,EAAEjB,QACxB,CAER,CAAC,CAAA;AAElB,CAAC,CAAC,CAAA;AACFP,gBAAgB,CAACqC,WAAW,GAAGxD,cAAc,CAAA;AAC7CmB,gBAAgB,CAACI,SAAS,GAAGtB,SAAS,CAAA;AACtCkB,gBAAgB,CAACsC,YAAY,GAAGtD,aAAa,CAAA;AAEtC,MAAMuD,YAA0B,GAAGC,MAAM,CAACC,MAAM,CAACzC,gBAAgB,EAAE;EAAET,MAAM;EAAEK,OAAO;AAAEE,EAAAA,OAAAA;AAAQ,CAAC;;AC5NtG;AACA;AACA;MACa4C,mBAAmB,GAAGC,IAAI,CAACzD,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cc995526.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { m as getRootClassName, n as forwardRef, b as Theme, _ as _extends, l as classNames } from './d3321a86.js';
|
|
2
|
+
import { h as handleBasicClasses } from './4ceaf17c.js';
|
|
3
|
+
import { u as useTheme } from './3181f000.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Defines the props of the component.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const DEFAULT_PROPS$2 = {};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Component display name.
|
|
13
|
+
*/
|
|
14
|
+
const COMPONENT_NAME$2 = 'SkeletonCircle';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Component default class name and class prefix.
|
|
18
|
+
*/
|
|
19
|
+
const CLASSNAME$2 = getRootClassName(COMPONENT_NAME$2);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* SkeletonCircle component.
|
|
23
|
+
*
|
|
24
|
+
* @param props Component props.
|
|
25
|
+
* @param ref Component ref.
|
|
26
|
+
* @return React element.
|
|
27
|
+
*/
|
|
28
|
+
const SkeletonCircle = forwardRef((props, ref) => {
|
|
29
|
+
const defaultTheme = useTheme() || Theme.light;
|
|
30
|
+
const {
|
|
31
|
+
className,
|
|
32
|
+
size,
|
|
33
|
+
color,
|
|
34
|
+
theme = defaultTheme,
|
|
35
|
+
...forwardedProps
|
|
36
|
+
} = props;
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
38
|
+
ref: ref
|
|
39
|
+
}, forwardedProps, {
|
|
40
|
+
className: classNames(className, handleBasicClasses({
|
|
41
|
+
prefix: CLASSNAME$2,
|
|
42
|
+
size,
|
|
43
|
+
color,
|
|
44
|
+
theme
|
|
45
|
+
}))
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
48
|
+
SkeletonCircle.displayName = COMPONENT_NAME$2;
|
|
49
|
+
SkeletonCircle.defaultProps = DEFAULT_PROPS$2;
|
|
50
|
+
SkeletonCircle.className = CLASSNAME$2;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Skeleton variants.
|
|
54
|
+
*/
|
|
55
|
+
const SkeletonRectangleVariant = {
|
|
56
|
+
squared: 'squared',
|
|
57
|
+
rounded: 'rounded',
|
|
58
|
+
pill: 'pill'
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Defines the props of the component.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
const DEFAULT_PROPS$1 = {
|
|
66
|
+
variant: SkeletonRectangleVariant.squared
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Component display name.
|
|
71
|
+
*/
|
|
72
|
+
const COMPONENT_NAME$1 = 'SkeletonRectangle';
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Component default class name and class prefix.
|
|
76
|
+
*/
|
|
77
|
+
const CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* SkeletonRectangle component.
|
|
81
|
+
*
|
|
82
|
+
* @param props Component props.
|
|
83
|
+
* @param ref Component ref.
|
|
84
|
+
* @return React element.
|
|
85
|
+
*/
|
|
86
|
+
const SkeletonRectangle = forwardRef((props, ref) => {
|
|
87
|
+
const defaultTheme = useTheme() || Theme.light;
|
|
88
|
+
const {
|
|
89
|
+
aspectRatio,
|
|
90
|
+
className,
|
|
91
|
+
height,
|
|
92
|
+
theme = defaultTheme,
|
|
93
|
+
variant = DEFAULT_PROPS$1.variant,
|
|
94
|
+
width,
|
|
95
|
+
color,
|
|
96
|
+
...forwardedProps
|
|
97
|
+
} = props;
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
99
|
+
ref: ref
|
|
100
|
+
}, forwardedProps, {
|
|
101
|
+
className: classNames(className, handleBasicClasses({
|
|
102
|
+
prefix: CLASSNAME$1,
|
|
103
|
+
aspectRatio,
|
|
104
|
+
height: aspectRatio ? undefined : height,
|
|
105
|
+
theme,
|
|
106
|
+
variant,
|
|
107
|
+
width,
|
|
108
|
+
color
|
|
109
|
+
}))
|
|
110
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: `${CLASSNAME$1}__inner`
|
|
112
|
+
}));
|
|
113
|
+
});
|
|
114
|
+
SkeletonRectangle.displayName = COMPONENT_NAME$1;
|
|
115
|
+
SkeletonRectangle.className = CLASSNAME$1;
|
|
116
|
+
SkeletonRectangle.defaultProps = DEFAULT_PROPS$1;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Defines the props of the component.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
const DEFAULT_PROPS = {};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Component display name.
|
|
126
|
+
*/
|
|
127
|
+
const COMPONENT_NAME = 'SkeletonTypography';
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Component default class name and class prefix.
|
|
131
|
+
*/
|
|
132
|
+
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* SkeletonTypography component.
|
|
136
|
+
*
|
|
137
|
+
* @param props Component props.
|
|
138
|
+
* @param ref Component ref.
|
|
139
|
+
* @return React element.
|
|
140
|
+
*/
|
|
141
|
+
const SkeletonTypography = forwardRef((props, ref) => {
|
|
142
|
+
const defaultTheme = useTheme() || Theme.light;
|
|
143
|
+
const {
|
|
144
|
+
className,
|
|
145
|
+
theme = defaultTheme,
|
|
146
|
+
typography,
|
|
147
|
+
width,
|
|
148
|
+
color,
|
|
149
|
+
...forwardedProps
|
|
150
|
+
} = props;
|
|
151
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
152
|
+
ref: ref
|
|
153
|
+
}, forwardedProps, {
|
|
154
|
+
className: classNames(className, handleBasicClasses({
|
|
155
|
+
prefix: CLASSNAME,
|
|
156
|
+
theme,
|
|
157
|
+
typography,
|
|
158
|
+
color
|
|
159
|
+
})),
|
|
160
|
+
style: {
|
|
161
|
+
...forwardedProps.style,
|
|
162
|
+
width
|
|
163
|
+
}
|
|
164
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
165
|
+
className: `${CLASSNAME}__inner`
|
|
166
|
+
}));
|
|
167
|
+
});
|
|
168
|
+
SkeletonTypography.displayName = COMPONENT_NAME;
|
|
169
|
+
SkeletonTypography.defaultProps = DEFAULT_PROPS;
|
|
170
|
+
SkeletonTypography.className = CLASSNAME;
|
|
171
|
+
|
|
172
|
+
export { SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography };
|
|
173
|
+
//# sourceMappingURL=cdc3efab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdc3efab.js","sources":["../../src/components/skeleton/SkeletonCircle.tsx","../../src/components/skeleton/SkeletonRectangle.tsx","../../src/components/skeleton/SkeletonTypography.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { GlobalSize, Theme, ColorPalette } from '@lumx/react';\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\n/**\n * Defines the props of the component.\n */\nexport interface SkeletonCircleProps extends GenericProps, HasTheme {\n /** Size variant. */\n size: GlobalSize;\n /** The color of the skeleton. */\n color?: ColorPalette;\n}\n\nconst DEFAULT_PROPS: Partial<SkeletonCircleProps> = {};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'SkeletonCircle';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * SkeletonCircle component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const SkeletonCircle = forwardRef<SkeletonCircleProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const { className, size, color, theme = defaultTheme, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, size, color, theme }))}\n />\n );\n});\nSkeletonCircle.displayName = COMPONENT_NAME;\nSkeletonCircle.defaultProps = DEFAULT_PROPS;\nSkeletonCircle.className = CLASSNAME;\n","import classNames from 'classnames';\n\nimport { AspectRatio, GlobalSize, Theme, ColorPalette } from '@lumx/react';\nimport { GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\n/**\n * Skeleton variants.\n */\nexport const SkeletonRectangleVariant = { squared: 'squared', rounded: 'rounded', pill: 'pill' } as const;\nexport type SkeletonRectangleVariant = ValueOf<typeof SkeletonRectangleVariant>;\n\n/**\n * Defines the props of the component.\n */\nexport interface SkeletonRectangleProps extends GenericProps, HasTheme {\n /** Aspect ratio (use with width and not height). */\n aspectRatio?: Extract<AspectRatio, 'square' | 'horizontal' | 'vertical' | 'wide'>;\n /** Height size. */\n height?: GlobalSize;\n /** Border variant. */\n variant?: SkeletonRectangleVariant;\n /** Width size. */\n width?: GlobalSize;\n /** The color of the skeleton. */\n color?: ColorPalette;\n}\n\nconst DEFAULT_PROPS: Partial<SkeletonRectangleProps> = {\n variant: SkeletonRectangleVariant.squared,\n};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'SkeletonRectangle';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * SkeletonRectangle component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const SkeletonRectangle = forwardRef<SkeletonRectangleProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n aspectRatio,\n className,\n height,\n theme = defaultTheme,\n variant = DEFAULT_PROPS.variant,\n width,\n color,\n ...forwardedProps\n } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n aspectRatio,\n height: aspectRatio ? undefined : height,\n theme,\n variant,\n width,\n color,\n }),\n )}\n >\n <div className={`${CLASSNAME}__inner`} />\n </div>\n );\n});\nSkeletonRectangle.displayName = COMPONENT_NAME;\nSkeletonRectangle.className = CLASSNAME;\nSkeletonRectangle.defaultProps = DEFAULT_PROPS;\n","import { CSSProperties } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Theme, TypographyInterface, ColorPalette } from '@lumx/react';\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\n/**\n * Defines the props of the component.\n */\nexport interface SkeletonTypographyProps extends GenericProps, HasTheme {\n /** Typography variant. */\n typography: TypographyInterface;\n /** Width CSS property. */\n width?: CSSProperties['width'];\n /** The color of the skeleton. */\n color?: ColorPalette;\n}\n\nconst DEFAULT_PROPS: Partial<SkeletonTypographyProps> = {};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'SkeletonTypography';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * SkeletonTypography component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const SkeletonTypography = forwardRef<SkeletonTypographyProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const { className, theme = defaultTheme, typography, width, color, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, theme, typography, color }))}\n style={{ ...forwardedProps.style, width }}\n >\n <div className={`${CLASSNAME}__inner`} />\n </div>\n );\n});\nSkeletonTypography.displayName = COMPONENT_NAME;\nSkeletonTypography.defaultProps = DEFAULT_PROPS;\nSkeletonTypography.className = CLASSNAME;\n"],"names":["DEFAULT_PROPS","COMPONENT_NAME","CLASSNAME","getRootClassName","SkeletonCircle","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","className","size","color","theme","forwardedProps","React","createElement","_extends","classNames","handleBasicClasses","prefix","displayName","defaultProps","SkeletonRectangleVariant","squared","rounded","pill","variant","SkeletonRectangle","aspectRatio","height","width","undefined","Ske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,CAAA;AAC/CmC,kBAAkB,CAACvB,SAAS,GAAGV,SAAS;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the classname associated to the given typography.
|
|
3
|
+
* For example, for `Typography.title` it returns `lumx-typography-title`
|
|
4
|
+
*/
|
|
5
|
+
const getTypographyClassName = typography => {
|
|
6
|
+
return `lumx-typography-${typography}`;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { getTypographyClassName as g };
|
|
10
|
+
//# sourceMappingURL=d0dd1815.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d0dd1815.js","sources":["../../../lumx-core/src/js/utils/className/getTypographyClassName.ts"],"sourcesContent":["import { Typography } from '../../constants';\n\n/**\n * Returns the classname associated to the given typography.\n * For example, for `Typography.title` it returns `lumx-typography-title`\n */\nexport const getTypographyClassName = (typography: Typography) => {\n return `lumx-typography-${typography}`;\n};\n"],"names":["getTypographyClassName","typography"],"mappings":"AAEA;AACA;AACA;AACA;AACaA,MAAAA,sBAAsB,GAAIC,UAAsB,IAAK;EAC9D,OAAO,CAAA,gBAAA,EAAmBA,UAAU,CAAE,CAAA,CAAA;AAC1C;;;;"}
|