@lumx/react 3.10.1-alpha.2 → 3.10.1-alpha.4
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/_internal/{8d67e1e3.d.ts → index.d.ts} +1 -1
- package/_internal/index.js +99 -0
- package/_internal/index.js.map +1 -0
- package/index.d.ts +3000 -66
- package/index.js +14561 -64
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/button/Button.tsx +4 -5
- package/src/components/button/ButtonRoot.tsx +1 -3
- package/src/components/chip/Chip.tsx +7 -11
- package/src/components/date-picker/DatePickerControlled.tsx +1 -1
- package/src/components/dialog/Dialog.tsx +1 -1
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +2 -2
- package/src/components/expansion-panel/ExpansionPanel.tsx +14 -18
- package/src/components/flex-box/FlexBox.tsx +1 -1
- package/src/components/generic-block/GenericBlock.tsx +6 -7
- package/src/components/generic-block/constants.ts +9 -4
- package/src/components/grid-column/GridColumn.tsx +1 -2
- package/src/components/image-lightbox/internal/ImageSlide.tsx +2 -2
- package/src/components/image-lightbox/internal/ImageSlideshow.tsx +4 -8
- package/src/components/image-lightbox/useImageLightbox.tsx +3 -4
- package/src/components/link/Link.tsx +3 -5
- package/src/components/list/ListItem.tsx +2 -3
- package/src/components/list/useInteractiveList.tsx +1 -2
- package/src/components/mosaic/Mosaic.test.tsx +3 -3
- package/src/components/mosaic/Mosaic.tsx +2 -3
- package/src/components/navigation/Navigation.tsx +42 -37
- package/src/components/navigation/NavigationSection.tsx +76 -79
- package/src/components/notification/Notification.tsx +1 -5
- package/src/components/popover/usePopoverStyle.tsx +3 -1
- package/src/components/popover/useRestoreFocusOnClose.tsx +1 -1
- package/src/components/popover-dialog/PopoverDialog.test.tsx +1 -1
- package/src/components/post-block/PostBlock.tsx +4 -8
- package/src/components/progress-tracker/ProgressTracker.stories.tsx +11 -11
- package/src/components/select/Select.stories.tsx +14 -5
- package/src/components/select/Select.test.tsx +2 -2
- package/src/components/select/Select.tsx +1 -2
- package/src/components/select/SelectMultiple.stories.tsx +12 -10
- package/src/components/side-navigation/SideNavigationItem.tsx +1 -1
- package/src/components/slideshow/Slides.tsx +1 -1
- package/src/components/slideshow/SlideshowControls.tsx +1 -1
- package/src/components/slideshow/useSlideFocusManagement.tsx +1 -1
- package/src/components/switch/Switch.tsx +1 -2
- package/src/components/tabs/Tabs.stories.tsx +3 -4
- package/src/components/text-field/TextField.test.tsx +4 -4
- package/src/components/text-field/TextField.tsx +2 -3
- package/src/components/tooltip/Tooltip.test.tsx +2 -2
- package/src/components/tooltip/useTooltipOpen.tsx +3 -3
- package/src/components/user-block/UserBlock.tsx +7 -9
- package/src/hooks/useCallbackOnEscape.ts +1 -1
- package/src/hooks/useClickAway.tsx +1 -2
- package/src/hooks/useFocusTrap.ts +1 -1
- package/src/hooks/useInterval.tsx +1 -4
- package/src/hooks/useKeyboardListNavigation.tsx +2 -4
- package/src/hooks/useSizeOnWindowResize.ts +14 -10
- package/src/hooks/useStopPropagation.ts +1 -2
- package/src/hooks/useTransitionVisibility.ts +2 -2
- package/src/stories/decorators/withCombinations.tsx +1 -1
- package/src/testing/utils/commonTestsSuiteRTL.tsx +2 -2
- package/src/utils/{DOM → browser/DOM}/startViewTransition.ts +3 -3
- package/src/utils/{focus → browser/focus}/getFirstAndLastFocusable.test.ts +1 -1
- package/src/utils/{focus → browser/focus}/getFocusableElements.test.ts +1 -1
- package/src/utils/{browserDoesNotSupportHover.test.js → browser/isHoverNotSupported.test.js} +5 -5
- package/src/utils/browser/isHoverNotSupported.ts +2 -0
- package/src/utils/browser/{getPrefersReducedMotion.ts → isReducedMotion.ts} +1 -1
- package/src/utils/className/getFontColorClassName.ts +9 -0
- package/src/utils/{className.ts → className/getRootClassName.ts} +1 -21
- package/src/utils/className/getTypographyClassName.ts +9 -0
- package/src/utils/className/index.ts +4 -0
- package/src/utils/collection/castArray.test.ts +15 -0
- package/src/utils/collection/castArray.ts +3 -0
- package/src/utils/collection/chunk.test.ts +15 -0
- package/src/utils/collection/chunk.ts +6 -0
- package/src/utils/collection/isEmpty.test.js +20 -0
- package/src/utils/collection/isEmpty.ts +4 -0
- package/src/utils/collection/last.ts +2 -0
- package/src/utils/collection/partitionMulti.test.ts +35 -0
- package/src/utils/{partitionMulti.ts → collection/partitionMulti.ts} +13 -12
- package/src/utils/collection/pull.test.ts +17 -0
- package/src/utils/collection/pull.ts +7 -0
- package/src/utils/collection/range.test.js +9 -0
- package/src/utils/collection/range.ts +2 -0
- package/src/utils/date/getMonthCalendar.ts +3 -4
- package/src/utils/flattenChildren.ts +2 -3
- package/src/utils/function/memoize.test.ts +36 -0
- package/src/utils/function/memoize.ts +13 -0
- package/src/utils/makeListenerTowerContext.ts +2 -2
- package/src/utils/partitionMulti.test.ts +27 -0
- package/src/utils/react/forwardRef.ts +3 -2
- package/src/utils/react/forwardRefPolymorphic.ts +1 -2
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -96
- package/utils/index.js.map +1 -1
- package/_internal/17c3ea1d.js +0 -137
- package/_internal/17c3ea1d.js.map +0 -1
- package/_internal/1da25128.js +0 -411
- package/_internal/1da25128.js.map +0 -1
- package/_internal/230173a8.js +0 -13
- package/_internal/230173a8.js.map +0 -1
- package/_internal/23bdba2d.js +0 -71
- package/_internal/23bdba2d.js.map +0 -1
- package/_internal/26926e5c.d.ts +0 -36
- package/_internal/2a3d237c.js +0 -12
- package/_internal/2a3d237c.js.map +0 -1
- package/_internal/2c5dbb03.js +0 -26
- package/_internal/2c5dbb03.js.map +0 -1
- package/_internal/2e2abe51.js +0 -2154
- package/_internal/2e2abe51.js.map +0 -1
- package/_internal/31490c59.d.ts +0 -167
- package/_internal/3181f000.js +0 -14
- package/_internal/3181f000.js.map +0 -1
- package/_internal/35f100be.d.ts +0 -104
- package/_internal/36bd7352.js +0 -219
- package/_internal/36bd7352.js.map +0 -1
- package/_internal/3a1facc0.js +0 -18
- package/_internal/3a1facc0.js.map +0 -1
- package/_internal/4c20d932.js +0 -89
- package/_internal/4c20d932.js.map +0 -1
- package/_internal/4c28d012.js +0 -305
- package/_internal/4c28d012.js.map +0 -1
- package/_internal/4cd0bf32.js +0 -160
- package/_internal/4cd0bf32.js.map +0 -1
- package/_internal/4daccdd5.js +0 -25
- package/_internal/4daccdd5.js.map +0 -1
- package/_internal/524b1d04.js +0 -64
- package/_internal/524b1d04.js.map +0 -1
- package/_internal/53c94227.js +0 -123
- package/_internal/53c94227.js.map +0 -1
- package/_internal/54d9ded5.js +0 -418
- package/_internal/54d9ded5.js.map +0 -1
- package/_internal/56aec41b.js +0 -652
- package/_internal/56aec41b.js.map +0 -1
- package/_internal/5720caf5.js +0 -124
- package/_internal/5720caf5.js.map +0 -1
- package/_internal/646f0db6.js +0 -113
- package/_internal/646f0db6.js.map +0 -1
- package/_internal/6cc8dca8.d.ts +0 -22
- package/_internal/7f022f8c.d.ts +0 -34
- package/_internal/b8f2948d.js +0 -691
- package/_internal/b8f2948d.js.map +0 -1
- package/_internal/bc28d510.js +0 -784
- package/_internal/bc28d510.js.map +0 -1
- package/_internal/c68d24e4.js +0 -145
- package/_internal/c68d24e4.js.map +0 -1
- package/_internal/c6c99f76.js +0 -105
- package/_internal/c6c99f76.js.map +0 -1
- package/_internal/cae46566.js +0 -65
- package/_internal/cae46566.js.map +0 -1
- package/_internal/components/alert-dialog/index.ts-623b1ed3.d.ts +0 -37
- package/_internal/components/alert-dialog/index.ts-f83bd6ef.js +0 -148
- package/_internal/components/alert-dialog/index.ts-f83bd6ef.js.map +0 -1
- package/_internal/components/autocomplete/index.ts-3f8f125c.js +0 -264
- package/_internal/components/autocomplete/index.ts-3f8f125c.js.map +0 -1
- package/_internal/components/autocomplete/index.ts-8d6b123f.d.ts +0 -201
- package/_internal/components/avatar/index.ts-93ee0ea9.js +0 -89
- package/_internal/components/avatar/index.ts-93ee0ea9.js.map +0 -1
- package/_internal/components/avatar/index.ts-f92852b4.d.ts +0 -43
- package/_internal/components/badge/index.ts-2d7700ef.d.ts +0 -30
- package/_internal/components/badge/index.ts-6753d67f.js +0 -88
- package/_internal/components/badge/index.ts-6753d67f.js.map +0 -1
- package/_internal/components/button/index.ts-031307ce.js +0 -51
- package/_internal/components/button/index.ts-031307ce.js.map +0 -1
- package/_internal/components/button/index.ts-b29e26a4.d.ts +0 -22
- package/_internal/components/checkbox/index.ts-a33166d7.js +0 -127
- package/_internal/components/checkbox/index.ts-a33166d7.js.map +0 -1
- package/_internal/components/checkbox/index.ts-f82358ff.d.ts +0 -38
- package/_internal/components/chip/index.ts-4a91f1a7.d.ts +0 -68
- package/_internal/components/chip/index.ts-a2b5b771.js +0 -110
- package/_internal/components/chip/index.ts-a2b5b771.js.map +0 -1
- package/_internal/components/comment-block/index.ts-58fa051a.js +0 -121
- package/_internal/components/comment-block/index.ts-58fa051a.js.map +0 -1
- package/_internal/components/comment-block/index.ts-8cfa5af0.d.ts +0 -67
- package/_internal/components/date-picker/index.ts-145262d5.js +0 -2
- package/_internal/components/date-picker/index.ts-145262d5.js.map +0 -1
- package/_internal/components/date-picker/index.ts-70a34fa7.d.ts +0 -95
- package/_internal/components/dialog/index.ts-ea044db2.js +0 -224
- package/_internal/components/dialog/index.ts-ea044db2.js.map +0 -1
- package/_internal/components/dialog/index.ts-eca28654.d.ts +0 -55
- package/_internal/components/divider/index.ts-4a56db75.js +0 -55
- package/_internal/components/divider/index.ts-4a56db75.js.map +0 -1
- package/_internal/components/divider/index.ts-b011d8ca.d.ts +0 -18
- package/_internal/components/drag-handle/index.ts-0aebf92f.js +0 -54
- package/_internal/components/drag-handle/index.ts-0aebf92f.js.map +0 -1
- package/_internal/components/drag-handle/index.ts-3ab31dd1.d.ts +0 -18
- package/_internal/components/dropdown/index.ts-2a17db51.js +0 -154
- package/_internal/components/dropdown/index.ts-2a17db51.js.map +0 -1
- package/_internal/components/dropdown/index.ts-b648a15c.d.ts +0 -87
- package/_internal/components/expansion-panel/index.ts-69f09f5b.d.ts +0 -38
- package/_internal/components/expansion-panel/index.ts-fae3762e.js +0 -143
- package/_internal/components/expansion-panel/index.ts-fae3762e.js.map +0 -1
- package/_internal/components/flag/index.ts-8dcd685b.js +0 -56
- package/_internal/components/flag/index.ts-8dcd685b.js.map +0 -1
- package/_internal/components/flag/index.ts-fda89adb.d.ts +0 -23
- package/_internal/components/flex-box/index.ts-87f2b58d.d.ts +0 -43
- package/_internal/components/flex-box/index.ts-c216e957.js +0 -60
- package/_internal/components/flex-box/index.ts-c216e957.js.map +0 -1
- package/_internal/components/generic-block/index.ts-999a62a4.js +0 -115
- package/_internal/components/generic-block/index.ts-999a62a4.js.map +0 -1
- package/_internal/components/generic-block/index.ts-cd3b0e21.d.ts +0 -106
- package/_internal/components/grid/index.ts-67e0694f.d.ts +0 -50
- package/_internal/components/grid/index.ts-fdf1b306.js +0 -113
- package/_internal/components/grid/index.ts-fdf1b306.js.map +0 -1
- package/_internal/components/grid-column/index.ts-97c61cbe.js +0 -64
- package/_internal/components/grid-column/index.ts-97c61cbe.js.map +0 -1
- package/_internal/components/grid-column/index.ts-c89e1c18.d.ts +0 -31
- package/_internal/components/heading/index.ts-0179e9a9.js +0 -112
- package/_internal/components/heading/index.ts-0179e9a9.js.map +0 -1
- package/_internal/components/heading/index.ts-587579e8.d.ts +0 -37
- package/_internal/components/icon/index.ts-740ca1de.js +0 -2
- package/_internal/components/icon/index.ts-740ca1de.js.map +0 -1
- package/_internal/components/icon/index.ts-b3fa5e15.d.ts +0 -34
- package/_internal/components/image-block/index.ts-36b3828f.d.ts +0 -49
- package/_internal/components/image-block/index.ts-ef5e2e7d.js +0 -111
- package/_internal/components/image-block/index.ts-ef5e2e7d.js.map +0 -1
- package/_internal/components/image-lightbox/index.ts-137f85a8.js +0 -765
- package/_internal/components/image-lightbox/index.ts-137f85a8.js.map +0 -1
- package/_internal/components/image-lightbox/index.ts-2cb92d18.d.ts +0 -75
- package/_internal/components/inline-list/index.ts-033dd358.js +0 -76
- package/_internal/components/inline-list/index.ts-033dd358.js.map +0 -1
- package/_internal/components/inline-list/index.ts-e1c8a3ff.d.ts +0 -34
- package/_internal/components/input-helper/index.ts-32a9ca90.d.ts +0 -22
- package/_internal/components/input-helper/index.ts-ab3a1ef5.js +0 -75
- package/_internal/components/input-helper/index.ts-ab3a1ef5.js.map +0 -1
- package/_internal/components/input-label/index.ts-86f2ea41.d.ts +0 -24
- package/_internal/components/input-label/index.ts-d6ca5569.js +0 -60
- package/_internal/components/input-label/index.ts-d6ca5569.js.map +0 -1
- package/_internal/components/lightbox/index.ts-5370e8e6.d.ts +0 -36
- package/_internal/components/lightbox/index.ts-7a16cdc7.js +0 -149
- package/_internal/components/lightbox/index.ts-7a16cdc7.js.map +0 -1
- package/_internal/components/link/index.ts-26435006.d.ts +0 -37
- package/_internal/components/link/index.ts-d04f4e53.js +0 -120
- package/_internal/components/link/index.ts-d04f4e53.js.map +0 -1
- package/_internal/components/link-preview/index.ts-e560a274.d.ts +0 -36
- package/_internal/components/link-preview/index.ts-fee89f66.js +0 -109
- package/_internal/components/link-preview/index.ts-fee89f66.js.map +0 -1
- package/_internal/components/list/index.ts-ab57902e.d.ts +0 -118
- package/_internal/components/list/index.ts-f3101625.js +0 -86
- package/_internal/components/list/index.ts-f3101625.js.map +0 -1
- package/_internal/components/message/index.ts-041cf0cb.js +0 -97
- package/_internal/components/message/index.ts-041cf0cb.js.map +0 -1
- package/_internal/components/message/index.ts-2d38e0ea.d.ts +0 -37
- package/_internal/components/mosaic/index.ts-232d5aed.d.ts +0 -23
- package/_internal/components/mosaic/index.ts-d2128cd3.js +0 -94
- package/_internal/components/mosaic/index.ts-d2128cd3.js.map +0 -1
- package/_internal/components/navigation/index.ts-6d8bea53.d.ts +0 -58
- package/_internal/components/navigation/index.ts-e8dc0a7f.js +0 -222
- package/_internal/components/navigation/index.ts-e8dc0a7f.js.map +0 -1
- package/_internal/components/notification/index.ts-235fd340.js +0 -140
- package/_internal/components/notification/index.ts-235fd340.js.map +0 -1
- package/_internal/components/notification/index.ts-bb3f03f6.d.ts +0 -34
- package/_internal/components/popover/index.ts-2f17a9b6.js +0 -3
- package/_internal/components/popover/index.ts-2f17a9b6.js.map +0 -1
- package/_internal/components/popover/index.ts-e3b4ff19.d.ts +0 -66
- package/_internal/components/post-block/index.ts-0acb9bb4.js +0 -101
- package/_internal/components/post-block/index.ts-0acb9bb4.js.map +0 -1
- package/_internal/components/post-block/index.ts-9b8ff90b.d.ts +0 -41
- package/_internal/components/progress/index.ts-2a713859.js +0 -189
- package/_internal/components/progress/index.ts-2a713859.js.map +0 -1
- package/_internal/components/progress/index.ts-dfdfa5fb.d.ts +0 -60
- package/_internal/components/progress-tracker/index.ts-2649f756.js +0 -312
- package/_internal/components/progress-tracker/index.ts-2649f756.js.map +0 -1
- package/_internal/components/progress-tracker/index.ts-95320f32.d.ts +0 -101
- package/_internal/components/radio-button/index.ts-5eaab4cf.d.ts +0 -54
- package/_internal/components/radio-button/index.ts-b4dfb2a0.js +0 -150
- package/_internal/components/radio-button/index.ts-b4dfb2a0.js.map +0 -1
- package/_internal/components/select/index.ts-a65e3507.d.ts +0 -91
- package/_internal/components/select/index.ts-e8fad28b.js +0 -257
- package/_internal/components/select/index.ts-e8fad28b.js.map +0 -1
- package/_internal/components/side-navigation/index.ts-3f5f3785.d.ts +0 -60
- package/_internal/components/side-navigation/index.ts-c9a5fc3e.js +0 -184
- package/_internal/components/side-navigation/index.ts-c9a5fc3e.js.map +0 -1
- package/_internal/components/skeleton/index.ts-a7daefac.d.ts +0 -75
- package/_internal/components/skeleton/index.ts-ffc995af.js +0 -179
- package/_internal/components/skeleton/index.ts-ffc995af.js.map +0 -1
- package/_internal/components/slider/index.ts-24a0d598.d.ts +0 -52
- package/_internal/components/slider/index.ts-72aadf4c.js +0 -308
- package/_internal/components/slider/index.ts-72aadf4c.js.map +0 -1
- package/_internal/components/slideshow/index.ts-c99f2892.js +0 -151
- package/_internal/components/slideshow/index.ts-c99f2892.js.map +0 -1
- package/_internal/components/slideshow/index.ts-e49462c6.d.ts +0 -25
- package/_internal/components/switch/index.ts-207ba52b.d.ts +0 -34
- package/_internal/components/switch/index.ts-542e6eaf.js +0 -115
- package/_internal/components/switch/index.ts-542e6eaf.js.map +0 -1
- package/_internal/components/table/index.ts-905ce390.js +0 -310
- package/_internal/components/table/index.ts-905ce390.js.map +0 -1
- package/_internal/components/table/index.ts-c4f39b2d.d.ts +0 -108
- package/_internal/components/tabs/index.ts-713119f4.js +0 -289
- package/_internal/components/tabs/index.ts-713119f4.js.map +0 -1
- package/_internal/components/tabs/index.ts-dbfc48d9.d.ts +0 -106
- package/_internal/components/text/index.ts-6afbe8cd.js +0 -2
- package/_internal/components/text/index.ts-6afbe8cd.js.map +0 -1
- package/_internal/components/text/index.ts-8a812048.d.ts +0 -53
- package/_internal/components/text-field/index.ts-92e6b3b3.d.ts +0 -77
- package/_internal/components/text-field/index.ts-c3be8563.js +0 -341
- package/_internal/components/text-field/index.ts-c3be8563.js.map +0 -1
- package/_internal/components/thumbnail/index.ts-16d7b403.js +0 -40
- package/_internal/components/thumbnail/index.ts-16d7b403.js.map +0 -1
- package/_internal/components/thumbnail/index.ts-1b6c0b48.d.ts +0 -8
- package/_internal/components/toolbar/index.ts-813b902e.js +0 -63
- package/_internal/components/toolbar/index.ts-813b902e.js.map +0 -1
- package/_internal/components/toolbar/index.ts-9f5129d1.d.ts +0 -24
- package/_internal/components/tooltip/index.ts-905c847c.js +0 -322
- package/_internal/components/tooltip/index.ts-905c847c.js.map +0 -1
- package/_internal/components/tooltip/index.ts-c6931e9e.d.ts +0 -35
- package/_internal/components/uploader/index.ts-31f21c2a.js +0 -132
- package/_internal/components/uploader/index.ts-31f21c2a.js.map +0 -1
- package/_internal/components/uploader/index.ts-c3ccba98.d.ts +0 -51
- package/_internal/components/user-block/index.ts-18c58e19.d.ts +0 -50
- package/_internal/components/user-block/index.ts-d43e5f3c.js +0 -136
- package/_internal/components/user-block/index.ts-d43e5f3c.js.map +0 -1
- package/_internal/dc3e28c8.d.ts +0 -38
- package/_internal/f39a1ba4.js +0 -73
- package/_internal/f39a1ba4.js.map +0 -1
- package/_internal/f3e77e3e.js +0 -22
- package/_internal/f3e77e3e.js.map +0 -1
- package/_internal/f502ab30.js +0 -78
- package/_internal/f502ab30.js.map +0 -1
- package/_internal/f52adbae.js +0 -36
- package/_internal/f52adbae.js.map +0 -1
- package/_internal/f57e1239.js +0 -205
- package/_internal/f57e1239.js.map +0 -1
- package/_internal/f5ff1aa4.d.ts +0 -47
- package/_internal/fb975afe.js +0 -52
- package/_internal/fb975afe.js.map +0 -1
- package/src/utils/browserDoesNotSupportHover.ts +0 -2
- package/src/utils/isInternetExplorer.ts +0 -15
- package/src/utils/userHasReducedMotion.ts +0 -7
- package/src/utils/utils.test.ts +0 -48
- /package/src/utils/{DOM → browser/DOM}/findImage.tsx +0 -0
- /package/src/utils/{event.ts → browser/event.ts} +0 -0
- /package/src/utils/{focus → browser/focus}/constants.ts +0 -0
- /package/src/utils/{focus → browser/focus}/getFirstAndLastFocusable.ts +0 -0
- /package/src/utils/{focus → browser/focus}/getFocusableElements.ts +0 -0
- /package/src/utils/{isFocusVisible.ts → browser/isFocusVisible.ts} +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { h as getRootClassName, i as forwardRef, j as _objectWithoutProperties, _ as _extends, g as classNames, O as Orientation } from '../../1da25128.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import castArray from 'lodash/castArray';
|
|
4
|
-
import { h as handleBasicClasses } from '../../f57e1239.js';
|
|
5
|
-
|
|
6
|
-
const _excluded = ["as", "children", "className", "fillSpace", "gap", "hAlign", "marginAuto", "noShrink", "orientation", "vAlign", "wrap"];
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Defines the props of the component.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Component display name.
|
|
14
|
-
*/
|
|
15
|
-
const COMPONENT_NAME = 'FlexBox';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Component default class name and class prefix.
|
|
19
|
-
*/
|
|
20
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* FlexBox component.
|
|
24
|
-
*
|
|
25
|
-
* @param props Component props.
|
|
26
|
-
* @param ref Component ref.
|
|
27
|
-
* @return React element.
|
|
28
|
-
*/
|
|
29
|
-
const FlexBox = forwardRef((props, ref) => {
|
|
30
|
-
const {
|
|
31
|
-
as: Component = 'div',
|
|
32
|
-
children,
|
|
33
|
-
className,
|
|
34
|
-
fillSpace,
|
|
35
|
-
gap,
|
|
36
|
-
hAlign,
|
|
37
|
-
marginAuto,
|
|
38
|
-
noShrink,
|
|
39
|
-
orientation,
|
|
40
|
-
vAlign,
|
|
41
|
-
wrap
|
|
42
|
-
} = props,
|
|
43
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
44
|
-
return /*#__PURE__*/React__default.createElement(Component, _extends({
|
|
45
|
-
ref: ref
|
|
46
|
-
}, forwardedProps, {
|
|
47
|
-
className: classNames(className, handleBasicClasses({
|
|
48
|
-
prefix: CLASSNAME,
|
|
49
|
-
orientation: orientation !== null && orientation !== void 0 ? orientation : wrap || hAlign || vAlign ? Orientation.horizontal : null,
|
|
50
|
-
vAlign,
|
|
51
|
-
hAlign,
|
|
52
|
-
gap
|
|
53
|
-
}), wrap && `${CLASSNAME}--wrap`, fillSpace && `${CLASSNAME}--fill-space`, noShrink && `${CLASSNAME}--no-shrink`, marginAuto && castArray(marginAuto).map(align => `${CLASSNAME}--margin-auto-${align}`))
|
|
54
|
-
}), children);
|
|
55
|
-
});
|
|
56
|
-
FlexBox.displayName = COMPONENT_NAME;
|
|
57
|
-
FlexBox.className = CLASSNAME;
|
|
58
|
-
|
|
59
|
-
export { FlexBox };
|
|
60
|
-
//# sourceMappingURL=index.ts-c216e957.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.ts-c216e957.js","sources":["../../../../src/components/flex-box/FlexBox.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\n\nimport classNames from 'classnames';\nimport castArray from 'lodash/castArray';\n\nimport { Alignment, Orientation } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\nimport { HorizontalAlignment, Size, VerticalAlignment } from '..';\n\nexport type MarginAutoAlignment = Extract<Alignment, 'top' | 'bottom' | 'right' | 'left'>;\nexport type GapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;\ntype SpaceAlignment = Extract<Alignment, 'space-between' | 'space-evenly' | 'space-around'>;\nexport type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;\nexport type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;\n\n/**\n * Defines the props of the component.\n */\nexport interface FlexBoxProps extends GenericProps {\n /** Customize the root element. */\n as?: React.ElementType;\n /** Children elements. */\n children?: ReactNode;\n /** Whether the \"content filling space\" is enabled or not. */\n fillSpace?: boolean;\n /** Gap space between flexbox items. */\n gap?: GapSize;\n /** Flex horizontal alignment. */\n hAlign?: FlexVerticalAlignment;\n /** Whether the \"auto margin\" is enabled all around or not. */\n marginAuto?: MarginAutoAlignment | MarginAutoAlignment[];\n /** Whether the \"content shrink\" is disabled or not. */\n noShrink?: boolean;\n /** Flex direction. */\n orientation?: Orientation;\n /** Flex vertical alignment. */\n vAlign?: FlexHorizontalAlignment;\n /** Whether the \"flex wrap\" is enabled or not. */\n wrap?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'FlexBox';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * FlexBox component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const FlexBox = forwardRef<FlexBoxProps, HTMLDivElement>((props, ref) => {\n const {\n as: Component = 'div',\n children,\n className,\n fillSpace,\n gap,\n hAlign,\n marginAuto,\n noShrink,\n orientation,\n vAlign,\n wrap,\n ...forwardedProps\n } = props;\n\n return (\n <Component\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n orientation: orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null),\n vAlign,\n hAlign,\n gap,\n }),\n wrap && `${CLASSNAME}--wrap`,\n fillSpace && `${CLASSNAME}--fill-space`,\n noShrink && `${CLASSNAME}--no-shrink`,\n marginAuto && castArray(marginAuto).map((align) => `${CLASSNAME}--margin-auto-${align}`),\n )}\n >\n {children}\n </Component>\n );\n});\nFlexBox.displayName = COMPONENT_NAME;\nFlexBox.className = CLASSNAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","FlexBox","forwardRef","props","ref","as","Component","children","className","fillSpace","gap","hAlign","marginAuto","noShrink","orientation","vAlign","wrap","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","_extends","classNames","handleBasicClasses","prefix","Orientation","horizontal","castArray","map","align","displayName"],"mappings":";;;;;;;AAiBA;AACA;AACA;;AAwBA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,SAAS,CAAA;;AAEhC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,OAAO,GAAGC,UAAU,CAA+B,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5E,MAAM;MACFC,EAAE,EAAEC,SAAS,GAAG,KAAK;MACrBC,QAAQ;MACRC,SAAS;MACTC,SAAS;MACTC,GAAG;MACHC,MAAM;MACNC,UAAU;MACVC,QAAQ;MACRC,WAAW;MACXC,MAAM;AACNC,MAAAA,IAAAA;AAEJ,KAAC,GAAGb,KAAK;AADFc,IAAAA,cAAc,GAAAC,wBAAA,CACjBf,KAAK,EAAAgB,SAAA,CAAA,CAAA;AAET,EAAA,oBACIC,cAAA,CAAAC,aAAA,CAACf,SAAS,EAAAgB,QAAA,CAAA;AACNlB,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA,EACLa,cAAc,EAAA;AAClBT,IAAAA,SAAS,EAAEe,UAAU,CACjBf,SAAS,EACTgB,kBAAkB,CAAC;AACfC,MAAAA,MAAM,EAAE1B,SAAS;AACjBe,MAAAA,WAAW,EAAEA,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,KAAA,CAAA,GAAXA,WAAW,GAAKE,IAAI,IAAIL,MAAM,IAAII,MAAM,GAAGW,WAAW,CAACC,UAAU,GAAG,IAAK;MACtFZ,MAAM;MACNJ,MAAM;AACND,MAAAA,GAAAA;AACJ,KAAC,CAAC,EACFM,IAAI,IAAK,CAAA,EAAEjB,SAAU,CAAO,MAAA,CAAA,EAC5BU,SAAS,IAAK,GAAEV,SAAU,CAAA,YAAA,CAAa,EACvCc,QAAQ,IAAK,CAAEd,EAAAA,SAAU,CAAY,WAAA,CAAA,EACrCa,UAAU,IAAIgB,SAAS,CAAChB,UAAU,CAAC,CAACiB,GAAG,CAAEC,KAAK,IAAM,CAAE/B,EAAAA,SAAU,CAAgB+B,cAAAA,EAAAA,KAAM,EAAC,CAC3F,CAAA;AAAE,GAAA,CAAA,EAEDvB,QACM,CAAC,CAAA;AAEpB,CAAC,EAAC;AACFN,OAAO,CAAC8B,WAAW,GAAGjC,cAAc,CAAA;AACpCG,OAAO,CAACO,SAAS,GAAGT,SAAS;;;;"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { h as getRootClassName, S as Size, O as Orientation, i as forwardRef, j as _objectWithoutProperties, _ as _extends, g as classNames } from '../../1da25128.js';
|
|
2
|
-
import React__default, { Children } from 'react';
|
|
3
|
-
import isEmpty from 'lodash/isEmpty';
|
|
4
|
-
import noop from 'lodash/noop';
|
|
5
|
-
import { a as isComponentType } from '../../f39a1ba4.js';
|
|
6
|
-
import { p as partitionMulti } from '../../4daccdd5.js';
|
|
7
|
-
import { FlexBox } from '../flex-box/index.ts-c216e957.js';
|
|
8
|
-
import pick from 'lodash/pick';
|
|
9
|
-
|
|
10
|
-
const _excluded = ["className", "figure", "figureProps", "children", "actions", "actionsProps", "gap", "orientation", "contentProps"];
|
|
11
|
-
/**
|
|
12
|
-
* Component display name.
|
|
13
|
-
*/
|
|
14
|
-
const COMPONENT_NAME = 'GenericBlock';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Component default class name and class prefix.
|
|
18
|
-
*/
|
|
19
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Component default props.
|
|
23
|
-
*/
|
|
24
|
-
const DEFAULT_PROPS = {
|
|
25
|
-
gap: Size.big,
|
|
26
|
-
orientation: Orientation.horizontal
|
|
27
|
-
};
|
|
28
|
-
const Figure = noop.bind({});
|
|
29
|
-
const isFigure = isComponentType(Figure);
|
|
30
|
-
const Content = noop.bind({});
|
|
31
|
-
const isContent = isComponentType(Content);
|
|
32
|
-
const Actions = noop.bind({});
|
|
33
|
-
const isActions = isComponentType(Actions);
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The GenericBlock is a layout component made of 3 sections that can be
|
|
37
|
-
* displayed either horizontally of vertically with the same gap between each section.
|
|
38
|
-
*
|
|
39
|
-
* The sections are:
|
|
40
|
-
* - `Figure` => A visual element to display before the main content.
|
|
41
|
-
* - `Content` => The main content displayed
|
|
42
|
-
* - `Actions` => One or more actions to set after the element.
|
|
43
|
-
*
|
|
44
|
-
* @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076
|
|
45
|
-
*/
|
|
46
|
-
const BaseGenericBlock = forwardRef((props, ref) => {
|
|
47
|
-
var _sections$figureChild, _sections$figureChild2, _sections$figureChild3, _sections$figureChild4, _sections$contentChil, _sections$contentChil2, _sections$contentChil3, _sections$contentChil4, _sections$actionsChil, _sections$actionsChil2, _sections$actionsChil3, _sections$actionsChil4;
|
|
48
|
-
const {
|
|
49
|
-
className,
|
|
50
|
-
figure,
|
|
51
|
-
figureProps,
|
|
52
|
-
children,
|
|
53
|
-
actions,
|
|
54
|
-
actionsProps,
|
|
55
|
-
gap,
|
|
56
|
-
orientation,
|
|
57
|
-
contentProps
|
|
58
|
-
} = props,
|
|
59
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
60
|
-
const sections = React__default.useMemo(() => {
|
|
61
|
-
// Split children by section type
|
|
62
|
-
const [[figureChild], [contentChild], [actionsChild], ...otherChildren] = partitionMulti(Children.toArray(children), [isFigure, isContent, isActions]);
|
|
63
|
-
return {
|
|
64
|
-
figureChild,
|
|
65
|
-
figureChildProps: figureChild === null || figureChild === void 0 ? void 0 : figureChild.props,
|
|
66
|
-
contentChild,
|
|
67
|
-
contentChildProps: contentChild === null || contentChild === void 0 ? void 0 : contentChild.props,
|
|
68
|
-
actionsChild,
|
|
69
|
-
actionsChildProps: actionsChild === null || actionsChild === void 0 ? void 0 : actionsChild.props,
|
|
70
|
-
otherChildren: otherChildren.filter(child => !isEmpty(child))
|
|
71
|
-
};
|
|
72
|
-
}, [children]);
|
|
73
|
-
return /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
74
|
-
ref: ref,
|
|
75
|
-
className: classNames(className, CLASSNAME),
|
|
76
|
-
gap: gap,
|
|
77
|
-
orientation: orientation
|
|
78
|
-
}, forwardedProps), (figure || ((_sections$figureChild = sections.figureChildProps) === null || _sections$figureChild === void 0 ? void 0 : _sections$figureChild.children)) && /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
79
|
-
ref: (_sections$figureChild2 = sections.figureChild) === null || _sections$figureChild2 === void 0 ? void 0 : _sections$figureChild2.ref,
|
|
80
|
-
vAlign: forwardedProps.vAlign,
|
|
81
|
-
hAlign: forwardedProps.hAlign
|
|
82
|
-
}, figureProps, sections.figureChildProps, {
|
|
83
|
-
className: classNames(figureProps === null || figureProps === void 0 ? void 0 : figureProps.className, (_sections$figureChild3 = sections.figureChildProps) === null || _sections$figureChild3 === void 0 ? void 0 : _sections$figureChild3.className, `${CLASSNAME}__figure`)
|
|
84
|
-
}), figure, (_sections$figureChild4 = sections.figureChildProps) === null || _sections$figureChild4 === void 0 ? void 0 : _sections$figureChild4.children), (((_sections$contentChil = sections.contentChildProps) === null || _sections$contentChil === void 0 ? void 0 : _sections$contentChil.children) || sections.otherChildren.length > 0) && /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
85
|
-
ref: (_sections$contentChil2 = sections.contentChild) === null || _sections$contentChil2 === void 0 ? void 0 : _sections$contentChil2.ref,
|
|
86
|
-
orientation: Orientation.vertical,
|
|
87
|
-
fillSpace: true,
|
|
88
|
-
vAlign: forwardedProps.vAlign,
|
|
89
|
-
hAlign: forwardedProps.hAlign
|
|
90
|
-
}, contentProps, sections.contentChildProps, {
|
|
91
|
-
className: classNames(contentProps === null || contentProps === void 0 ? void 0 : contentProps.className, (_sections$contentChil3 = sections.contentChildProps) === null || _sections$contentChil3 === void 0 ? void 0 : _sections$contentChil3.className, `${CLASSNAME}__content`)
|
|
92
|
-
}), (_sections$contentChil4 = sections.contentChildProps) === null || _sections$contentChil4 === void 0 ? void 0 : _sections$contentChil4.children, sections.otherChildren), (actions || ((_sections$actionsChil = sections.actionsChildProps) === null || _sections$actionsChil === void 0 ? void 0 : _sections$actionsChil.children)) && /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
93
|
-
ref: (_sections$actionsChil2 = sections.actionsChild) === null || _sections$actionsChil2 === void 0 ? void 0 : _sections$actionsChil2.ref,
|
|
94
|
-
vAlign: forwardedProps.vAlign,
|
|
95
|
-
hAlign: forwardedProps.hAlign
|
|
96
|
-
}, actionsProps, sections.actionsChildProps, {
|
|
97
|
-
className: classNames(actionsProps === null || actionsProps === void 0 ? void 0 : actionsProps.className, (_sections$actionsChil3 = sections.actionsChildProps) === null || _sections$actionsChil3 === void 0 ? void 0 : _sections$actionsChil3.className, `${CLASSNAME}__actions`)
|
|
98
|
-
}), actions, (_sections$actionsChil4 = sections.actionsChildProps) === null || _sections$actionsChil4 === void 0 ? void 0 : _sections$actionsChil4.children));
|
|
99
|
-
});
|
|
100
|
-
BaseGenericBlock.displayName = COMPONENT_NAME;
|
|
101
|
-
BaseGenericBlock.className = CLASSNAME;
|
|
102
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS;
|
|
103
|
-
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
104
|
-
Figure,
|
|
105
|
-
Content,
|
|
106
|
-
Actions
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Accepted gap sizes for the generic block.
|
|
111
|
-
*/
|
|
112
|
-
const GenericBlockGapSize = pick(Size, ['tiny', 'regular', 'medium', 'big', 'huge']);
|
|
113
|
-
|
|
114
|
-
export { GenericBlock, GenericBlockGapSize };
|
|
115
|
-
//# sourceMappingURL=index.ts-999a62a4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.ts-999a62a4.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/react/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,\n 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","_sections$figureChild","_sections$figureChild2","_sections$figureChild3","_sections$figureChild4","_sections$contentChil","_sections$contentChil2","_sections$contentChil3","_sections$contentChil4","_sections$actionsChil","_sections$actionsChil2","_sections$actionsChil3","_sections$actionsChil4","className","figure","figureProps","children","actions","actionsProps","contentProps","forwardedProps","_objectWithoutProperties","_excluded","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;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,CAAA;EAClE,MAAM;MACFC,SAAS;MACTC,MAAM;MACNC,WAAW;MACXC,QAAQ;MACRC,OAAO;MACPC,YAAY;MACZpC,GAAG;MACHG,WAAW;AACXkC,MAAAA,YAAAA;AAEJ,KAAC,GAAGpB,KAA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+0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { V as ValueOf, C as Comp } from '../../8d67e1e3.js';
|
|
3
|
-
import { FlexBoxProps } from '../flex-box/index.ts-87f2b58d.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Accepted gap sizes for the generic block.
|
|
7
|
-
*/
|
|
8
|
-
declare const GenericBlockGapSize: Pick<{
|
|
9
|
-
readonly xxs: "xxs";
|
|
10
|
-
readonly xs: "xs";
|
|
11
|
-
readonly s: "s";
|
|
12
|
-
readonly m: "m";
|
|
13
|
-
readonly l: "l";
|
|
14
|
-
readonly xl: "xl";
|
|
15
|
-
readonly xxl: "xxl";
|
|
16
|
-
readonly tiny: "tiny";
|
|
17
|
-
readonly regular: "regular";
|
|
18
|
-
readonly medium: "medium";
|
|
19
|
-
readonly big: "big";
|
|
20
|
-
readonly huge: "huge";
|
|
21
|
-
}, "big" | "tiny" | "regular" | "medium" | "huge">;
|
|
22
|
-
type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;
|
|
23
|
-
|
|
24
|
-
interface GenericBlockProps extends FlexBoxProps {
|
|
25
|
-
/**
|
|
26
|
-
* Component to use as visual element.
|
|
27
|
-
*/
|
|
28
|
-
figure?: ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
* Actions to set after the main content.
|
|
31
|
-
*/
|
|
32
|
-
actions?: ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Main content to display or sections components
|
|
35
|
-
* ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})
|
|
36
|
-
*/
|
|
37
|
-
children: ReactNode;
|
|
38
|
-
/**
|
|
39
|
-
* Orientation of the 3 sections
|
|
40
|
-
*/
|
|
41
|
-
orientation?: FlexBoxProps['orientation'];
|
|
42
|
-
/**
|
|
43
|
-
* Horizontal alignment.
|
|
44
|
-
*/
|
|
45
|
-
hAlign?: FlexBoxProps['hAlign'];
|
|
46
|
-
/**
|
|
47
|
-
* Vertical alignment.
|
|
48
|
-
*/
|
|
49
|
-
vAlign?: FlexBoxProps['vAlign'];
|
|
50
|
-
/**
|
|
51
|
-
* The props to forward to the content.
|
|
52
|
-
* By default, the content will have the same alignment as wrapper.
|
|
53
|
-
*/
|
|
54
|
-
contentProps?: Omit<FlexBoxProps, 'children'>;
|
|
55
|
-
/**
|
|
56
|
-
* props to forward to the actions element.
|
|
57
|
-
*/
|
|
58
|
-
actionsProps?: Omit<FlexBoxProps, 'children'>;
|
|
59
|
-
/**
|
|
60
|
-
* props to forward to the figure element.
|
|
61
|
-
*/
|
|
62
|
-
figureProps?: Omit<FlexBoxProps, 'children'>;
|
|
63
|
-
/**
|
|
64
|
-
* Gap space between sections.
|
|
65
|
-
*/
|
|
66
|
-
gap?: GenericBlockGapSize;
|
|
67
|
-
}
|
|
68
|
-
interface GenericBlockSectionProps extends FlexBoxProps {
|
|
69
|
-
/**
|
|
70
|
-
* Gap space between items.
|
|
71
|
-
*/
|
|
72
|
-
gap?: GenericBlockGapSize;
|
|
73
|
-
}
|
|
74
|
-
type BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;
|
|
75
|
-
/**
|
|
76
|
-
* The GenericBlock is a layout component made of 3 sections that can be
|
|
77
|
-
* displayed either horizontally of vertically with the same gap between each section.
|
|
78
|
-
*
|
|
79
|
-
* The sections are:
|
|
80
|
-
* - `Figure` => A visual element to display before the main content.
|
|
81
|
-
* - `Content` => The main content displayed
|
|
82
|
-
* - `Actions` => One or more actions to set after the element.
|
|
83
|
-
*
|
|
84
|
-
* @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076
|
|
85
|
-
*/
|
|
86
|
-
declare const BaseGenericBlock: BaseGenericBlock;
|
|
87
|
-
interface GenericBlock extends BaseGenericBlock {
|
|
88
|
-
/**
|
|
89
|
-
* Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject
|
|
90
|
-
* the "figure" section of the block (instead of using `figure` and `figureProps` props).
|
|
91
|
-
*/
|
|
92
|
-
Figure: Comp<GenericBlockSectionProps>;
|
|
93
|
-
/**
|
|
94
|
-
* Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject
|
|
95
|
-
* the "content" section of the block (instead of using `content` and `contentProps` props).
|
|
96
|
-
*/
|
|
97
|
-
Content: Comp<GenericBlockSectionProps>;
|
|
98
|
-
/**
|
|
99
|
-
* Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject
|
|
100
|
-
* the "actions" section of the block (instead of using `actions` and `actionsProps` props).
|
|
101
|
-
*/
|
|
102
|
-
Actions: Comp<GenericBlockSectionProps>;
|
|
103
|
-
}
|
|
104
|
-
declare const GenericBlock: GenericBlock;
|
|
105
|
-
|
|
106
|
-
export { GenericBlock, GenericBlockGapSize, type GenericBlockProps };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { G as GenericProps, O as Orientation, A as Alignment, C as Comp, S as Size } from '../../8d67e1e3.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
|
|
4
|
-
type GridGutterSize = Extract<Size, 'regular' | 'big' | 'huge'>;
|
|
5
|
-
/**
|
|
6
|
-
* Defines the props of the component.
|
|
7
|
-
*/
|
|
8
|
-
interface GridProps extends GenericProps {
|
|
9
|
-
/** Orientation. */
|
|
10
|
-
orientation?: Orientation;
|
|
11
|
-
/** Whether the children are wrapped or not. */
|
|
12
|
-
wrap?: string;
|
|
13
|
-
/** Vertical alignment. */
|
|
14
|
-
vAlign?: Alignment;
|
|
15
|
-
/** Horizontal alignment. */
|
|
16
|
-
hAlign?: Alignment;
|
|
17
|
-
/** Gutter size. */
|
|
18
|
-
gutter?: GridGutterSize;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Grid component.
|
|
22
|
-
*
|
|
23
|
-
* @param props Component props.
|
|
24
|
-
* @param ref Component ref.
|
|
25
|
-
* @return React element.
|
|
26
|
-
*/
|
|
27
|
-
declare const Grid: Comp<GridProps, HTMLDivElement>;
|
|
28
|
-
|
|
29
|
-
type Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
30
|
-
/**
|
|
31
|
-
* Defines the props of the component.
|
|
32
|
-
*/
|
|
33
|
-
interface GridItemProps extends GenericProps {
|
|
34
|
-
/** Alignment. */
|
|
35
|
-
align?: Alignment;
|
|
36
|
-
/** Order. */
|
|
37
|
-
order?: Columns;
|
|
38
|
-
/** Width. */
|
|
39
|
-
width?: Columns;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* GridItem component.
|
|
43
|
-
*
|
|
44
|
-
* @param props Component props.
|
|
45
|
-
* @param ref Component ref.
|
|
46
|
-
* @return React element.
|
|
47
|
-
*/
|
|
48
|
-
declare const GridItem: Comp<GridItemProps, HTMLDivElement>;
|
|
49
|
-
|
|
50
|
-
export { Grid, GridItem, type GridItemProps, type GridProps };
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { h as getRootClassName, O as Orientation, i as forwardRef, j as _objectWithoutProperties, _ as _extends, g as classNames } from '../../1da25128.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import { h as handleBasicClasses } from '../../f57e1239.js';
|
|
4
|
-
|
|
5
|
-
const _excluded$1 = ["children", "className", "gutter", "hAlign", "orientation", "vAlign", "wrap"];
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Defines the props of the component.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Component display name.
|
|
13
|
-
*/
|
|
14
|
-
const COMPONENT_NAME$1 = 'Grid';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Component default class name and class prefix.
|
|
18
|
-
*/
|
|
19
|
-
const CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Component default props.
|
|
23
|
-
*/
|
|
24
|
-
const DEFAULT_PROPS = {
|
|
25
|
-
orientation: Orientation.horizontal,
|
|
26
|
-
wrap: 'nowrap'
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Grid component.
|
|
31
|
-
*
|
|
32
|
-
* @param props Component props.
|
|
33
|
-
* @param ref Component ref.
|
|
34
|
-
* @return React element.
|
|
35
|
-
*/
|
|
36
|
-
const Grid = forwardRef((props, ref) => {
|
|
37
|
-
const {
|
|
38
|
-
children,
|
|
39
|
-
className,
|
|
40
|
-
gutter,
|
|
41
|
-
hAlign,
|
|
42
|
-
orientation,
|
|
43
|
-
vAlign,
|
|
44
|
-
wrap
|
|
45
|
-
} = props,
|
|
46
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
47
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
48
|
-
ref: ref
|
|
49
|
-
}, forwardedProps, {
|
|
50
|
-
className: classNames(className, `${CLASSNAME$1}-container`, {
|
|
51
|
-
[`${CLASSNAME$1}--h-align-${hAlign}`]: hAlign
|
|
52
|
-
}, {
|
|
53
|
-
[`${CLASSNAME$1}--v-align-${vAlign}`]: vAlign
|
|
54
|
-
}, handleBasicClasses({
|
|
55
|
-
prefix: CLASSNAME$1,
|
|
56
|
-
orientation,
|
|
57
|
-
wrap,
|
|
58
|
-
gutter
|
|
59
|
-
}))
|
|
60
|
-
}), children);
|
|
61
|
-
});
|
|
62
|
-
Grid.displayName = COMPONENT_NAME$1;
|
|
63
|
-
Grid.className = CLASSNAME$1;
|
|
64
|
-
Grid.defaultProps = DEFAULT_PROPS;
|
|
65
|
-
|
|
66
|
-
const _excluded = ["children", "className", "width", "align", "order"];
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Defines the props of the component.
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Component display name.
|
|
74
|
-
*/
|
|
75
|
-
const COMPONENT_NAME = 'GridItem';
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Component default class name and class prefix.
|
|
79
|
-
*/
|
|
80
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* GridItem component.
|
|
84
|
-
*
|
|
85
|
-
* @param props Component props.
|
|
86
|
-
* @param ref Component ref.
|
|
87
|
-
* @return React element.
|
|
88
|
-
*/
|
|
89
|
-
const GridItem = forwardRef((props, ref) => {
|
|
90
|
-
const {
|
|
91
|
-
children,
|
|
92
|
-
className,
|
|
93
|
-
width,
|
|
94
|
-
align,
|
|
95
|
-
order
|
|
96
|
-
} = props,
|
|
97
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
98
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
99
|
-
ref: ref
|
|
100
|
-
}, forwardedProps, {
|
|
101
|
-
className: classNames(className, handleBasicClasses({
|
|
102
|
-
prefix: CLASSNAME,
|
|
103
|
-
width,
|
|
104
|
-
order,
|
|
105
|
-
align
|
|
106
|
-
}))
|
|
107
|
-
}), children);
|
|
108
|
-
});
|
|
109
|
-
GridItem.displayName = COMPONENT_NAME;
|
|
110
|
-
GridItem.className = CLASSNAME;
|
|
111
|
-
|
|
112
|
-
export { Grid, GridItem };
|
|
113
|
-
//# sourceMappingURL=index.ts-fdf1b306.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.ts-fdf1b306.js","sources":["../../../../src/components/grid/Grid.tsx","../../../../src/components/grid/GridItem.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { Alignment, Orientation, Size } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\ntype GridGutterSize = Extract<Size, 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface GridProps extends GenericProps {\n /** Orientation. */\n orientation?: Orientation;\n /** Whether the children are wrapped or not. */\n wrap?: string;\n /** Vertical alignment. */\n vAlign?: Alignment;\n /** Horizontal alignment. */\n hAlign?: Alignment;\n /** Gutter size. */\n gutter?: GridGutterSize;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Grid';\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<GridProps> = {\n orientation: Orientation.horizontal,\n wrap: 'nowrap',\n};\n\n/**\n * Grid component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Grid = forwardRef<GridProps, HTMLDivElement>((props, ref) => {\n const { children, className, gutter, hAlign, orientation, vAlign, wrap, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n `${CLASSNAME}-container`,\n { [`${CLASSNAME}--h-align-${hAlign}`]: hAlign },\n { [`${CLASSNAME}--v-align-${vAlign}`]: vAlign },\n handleBasicClasses({ prefix: CLASSNAME, orientation, wrap, gutter }),\n )}\n >\n {children}\n </div>\n );\n});\nGrid.displayName = COMPONENT_NAME;\nGrid.className = CLASSNAME;\nGrid.defaultProps = DEFAULT_PROPS;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { Alignment } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\ntype Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';\n\n/**\n * Defines the props of the component.\n */\nexport interface GridItemProps extends GenericProps {\n /** Alignment. */\n align?: Alignment;\n /** Order. */\n order?: Columns;\n /** Width. */\n width?: Columns;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GridItem';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * GridItem component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const GridItem = forwardRef<GridItemProps, HTMLDivElement>((props, ref) => {\n const { children, className, width, align, order, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, width, order, align }))}\n >\n {children}\n </div>\n );\n});\nGridItem.displayName = COMPONENT_NAME;\nGridItem.className = CLASSNAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","orientation","Orientation","horizontal","wrap","Grid","forwardRef","props","ref","children","className","gutter","hAlign","vAlign","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","_extends","classNames","handleBasicClasses","prefix","displayName","defaultProps","GridItem","width","align","order"],"mappings":";;;;;;AAWA;AACA;AACA;;AAcA;AACA;AACA;AACA,MAAMA,gBAAc,GAAG,MAAM,CAAA;;AAE7B;AACA;AACA;AACA,MAAMC,WAAS,GAAGC,gBAAgB,CAACF,gBAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAiC,GAAG;EACtCC,WAAW,EAAEC,WAAW,CAACC,UAAU;AACnCC,EAAAA,IAAI,EAAE,QAAA;AACV,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,IAAI,GAAGC,UAAU,CAA4B,CAACC,KAAK,EAAEC,GAAG,KAAK;EACtE,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,MAAM;MAAEC,MAAM;MAAEX,WAAW;MAAEY,MAAM;AAAET,MAAAA,IAAAA;AAAwB,KAAC,GAAGG,KAAK;AAAxBO,IAAAA,cAAc,GAAAC,wBAAA,CAAKR,KAAK,EAAAS,WAAA,CAAA,CAAA;AAEnG,EAAA,oBACIC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,CAAA;AACIX,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA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S,EAAEU,UAAU,CAACV,SAAS,EAAEW,kBAAkB,CAAC;AAAEC,MAAAA,MAAM,EAAExB,SAAS;MAAE4B,KAAK;MAAEE,KAAK;AAAED,MAAAA,KAAAA;AAAM,KAAC,CAAC,CAAA;AAAE,GAAA,CAAA,EAEhGlB,QACA,CAAC,CAAA;AAEd,CAAC,EAAC;AACFgB,QAAQ,CAACF,WAAW,GAAG1B,cAAc,CAAA;AACrC4B,QAAQ,CAACf,SAAS,GAAGZ,SAAS;;;;"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { h as getRootClassName, i as forwardRef, j as _objectWithoutProperties, _ as _extends, g as classNames, k as _objectSpread2 } from '../../1da25128.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import isInteger from 'lodash/isInteger';
|
|
4
|
-
import { h as handleBasicClasses } from '../../f57e1239.js';
|
|
5
|
-
|
|
6
|
-
const _excluded = ["as", "gap", "maxColumns", "itemMinWidth", "children", "className", "style"];
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Defines the props of the component.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Component display name.
|
|
14
|
-
*/
|
|
15
|
-
const COMPONENT_NAME = 'GridColumn';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Component default class name and class prefix.
|
|
19
|
-
*/
|
|
20
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Component default props.
|
|
24
|
-
*/
|
|
25
|
-
const DEFAULT_PROPS = {};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The GridColumn is a layout component that can display children in a grid
|
|
29
|
-
* with custom display properties. It also comes with a responsive design,
|
|
30
|
-
* with a number of column that reduce when there is not enough space for each item.
|
|
31
|
-
*
|
|
32
|
-
* @param props Component props.
|
|
33
|
-
* @param ref Component ref.
|
|
34
|
-
* @return React element.
|
|
35
|
-
*/
|
|
36
|
-
const GridColumn = forwardRef((props, ref) => {
|
|
37
|
-
const {
|
|
38
|
-
as: Component = 'div',
|
|
39
|
-
gap,
|
|
40
|
-
maxColumns,
|
|
41
|
-
itemMinWidth,
|
|
42
|
-
children,
|
|
43
|
-
className,
|
|
44
|
-
style = {}
|
|
45
|
-
} = props,
|
|
46
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
47
|
-
return /*#__PURE__*/React__default.createElement(Component, _extends({}, forwardedProps, {
|
|
48
|
-
ref: ref,
|
|
49
|
-
className: classNames(className, handleBasicClasses({
|
|
50
|
-
prefix: CLASSNAME
|
|
51
|
-
})),
|
|
52
|
-
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
53
|
-
['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
54
|
-
['--lumx-grid-column-columns']: maxColumns,
|
|
55
|
-
['--lumx-grid-column-gap']: gap && `var(--lumx-spacing-unit-${gap})`
|
|
56
|
-
})
|
|
57
|
-
}), children);
|
|
58
|
-
});
|
|
59
|
-
GridColumn.displayName = COMPONENT_NAME;
|
|
60
|
-
GridColumn.className = CLASSNAME;
|
|
61
|
-
GridColumn.defaultProps = DEFAULT_PROPS;
|
|
62
|
-
|
|
63
|
-
export { GridColumn };
|
|
64
|
-
//# sourceMappingURL=index.ts-97c61cbe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.ts-97c61cbe.js","sources":["../../../../src/components/grid-column/GridColumn.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\n\nimport isInteger from 'lodash/isInteger';\nimport classNames from 'classnames';\n\nimport { Size } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport type GridColumnGapSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface GridColumnProps extends GenericProps {\n /** Customize the root element. */\n as?: React.ElementType;\n /** Children elements. */\n children?: ReactNode;\n /** Space between columns and rows. */\n gap?: GridColumnGapSize;\n /** Ideal number of columns. */\n maxColumns?: number;\n /** Minimum width for each item, reduce the number of column if there is not enough space. */\n itemMinWidth?: number;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GridColumn';\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<GridColumnProps> = {};\n\n/**\n * The GridColumn is a layout component that can display children in a grid\n * with custom display properties. It also comes with a responsive design,\n * with a number of column that reduce when there is not enough space for each item.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const GridColumn = forwardRef<GridColumnProps>((props, ref): ReactElement => {\n const {\n as: Component = 'div',\n gap,\n maxColumns,\n itemMinWidth,\n children,\n className,\n style = {},\n ...forwardedProps\n } = props;\n\n return (\n <Component\n {...forwardedProps}\n ref={ref as React.Ref<any>}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n }),\n )}\n style={{\n ...style,\n ['--lumx-grid-column-item-min-width' as any]: isInteger(itemMinWidth) && `${itemMinWidth}px`,\n ['--lumx-grid-column-columns' as any]: maxColumns,\n ['--lumx-grid-column-gap' as any]: gap && `var(--lumx-spacing-unit-${gap})`,\n }}\n >\n {children}\n </Component>\n );\n});\nGridColumn.displayName = COMPONENT_NAME;\nGridColumn.className = CLASSNAME;\nGridColumn.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","GridColumn","forwardRef","props","ref","as","Component","gap","maxColumns","itemMinWidth","children","className","style","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","_extends","classNames","handleBasicClasses","prefix","_objectSpread","isInteger","displayName","defaultProps"],"mappings":";;;;;;;AAYA;AACA;AAC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AS,CAAA;AAChCG,UAAU,CAACwB,YAAY,GAAGzB,aAAa;;;;"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { S as Size, G as GenericProps, C as Comp } from '../../8d67e1e3.js';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
type GridColumnGapSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
5
|
-
/**
|
|
6
|
-
* Defines the props of the component.
|
|
7
|
-
*/
|
|
8
|
-
interface GridColumnProps extends GenericProps {
|
|
9
|
-
/** Customize the root element. */
|
|
10
|
-
as?: React.ElementType;
|
|
11
|
-
/** Children elements. */
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
/** Space between columns and rows. */
|
|
14
|
-
gap?: GridColumnGapSize;
|
|
15
|
-
/** Ideal number of columns. */
|
|
16
|
-
maxColumns?: number;
|
|
17
|
-
/** Minimum width for each item, reduce the number of column if there is not enough space. */
|
|
18
|
-
itemMinWidth?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The GridColumn is a layout component that can display children in a grid
|
|
22
|
-
* with custom display properties. It also comes with a responsive design,
|
|
23
|
-
* with a number of column that reduce when there is not enough space for each item.
|
|
24
|
-
*
|
|
25
|
-
* @param props Component props.
|
|
26
|
-
* @param ref Component ref.
|
|
27
|
-
* @return React element.
|
|
28
|
-
*/
|
|
29
|
-
declare const GridColumn: Comp<GridColumnProps, HTMLElement>;
|
|
30
|
-
|
|
31
|
-
export { GridColumn, type GridColumnGapSize, type GridColumnProps };
|