@lumx/react 3.0.2 → 3.0.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm/_internal/_rollupPluginBabelHelpers.js → _internal/ClickAwayProvider.js} +107 -2
- package/_internal/ClickAwayProvider.js.map +1 -0
- package/_internal/types.d.ts +271 -0
- package/index.d.ts +2686 -0
- package/index.js +12533 -0
- package/index.js.map +1 -0
- package/package.json +7 -6
- package/src/components/alert-dialog/AlertDialog.tsx +2 -1
- package/src/components/autocomplete/Autocomplete.tsx +2 -2
- package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -1
- package/src/components/avatar/Avatar.tsx +2 -1
- package/src/components/badge/Badge.test.tsx +1 -1
- package/src/components/badge/Badge.tsx +2 -1
- package/src/components/button/Button.test.tsx +1 -1
- package/src/components/button/Button.tsx +2 -1
- package/src/components/button/ButtonGroup.tsx +2 -1
- package/src/components/button/ButtonRoot.test.tsx +1 -1
- package/src/components/button/ButtonRoot.tsx +2 -1
- package/src/components/button/IconButton.tsx +2 -1
- package/src/components/checkbox/Checkbox.test.tsx +1 -1
- package/src/components/checkbox/Checkbox.tsx +2 -1
- package/src/components/chip/Chip.test.tsx +1 -1
- package/src/components/chip/Chip.tsx +3 -1
- package/src/components/chip/ChipGroup.tsx +2 -1
- package/src/components/comment-block/CommentBlock.tsx +2 -1
- package/src/components/date-picker/DatePicker.tsx +1 -1
- package/src/components/date-picker/DatePickerControlled.tsx +1 -1
- package/src/components/date-picker/DatePickerField.tsx +1 -1
- package/src/components/date-picker/constants.ts +1 -1
- package/src/components/date-picker/types.ts +1 -1
- package/src/components/dialog/Dialog.tsx +4 -8
- package/src/components/divider/Divider.test.tsx +1 -1
- package/src/components/divider/Divider.tsx +3 -2
- package/src/components/drag-handle/DragHandle.tsx +2 -1
- package/src/components/dropdown/Dropdown.tsx +2 -1
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +1 -1
- package/src/components/expansion-panel/ExpansionPanel.tsx +3 -10
- package/src/components/flag/Flag.test.tsx +1 -1
- package/src/components/flag/Flag.tsx +2 -1
- package/src/components/flex-box/FlexBox.stories.tsx +8 -0
- package/src/components/flex-box/FlexBox.tsx +7 -3
- package/src/components/flex-box/__snapshots__/FlexBox.test.tsx.snap +16 -0
- package/src/components/generic-block/GenericBlock.stories.jsx +23 -1
- package/src/components/generic-block/GenericBlock.tsx +18 -4
- package/src/components/generic-block/constants.ts +9 -0
- package/src/components/generic-block/index.ts +1 -0
- package/src/components/grid/Grid.tsx +2 -1
- package/src/components/grid/GridItem.tsx +2 -1
- package/src/components/heading/Heading.tsx +2 -1
- package/src/components/heading/HeadingLevelProvider.tsx +1 -1
- package/src/components/heading/context.tsx +1 -1
- package/src/components/icon/Icon.test.tsx +1 -1
- package/src/components/icon/Icon.tsx +2 -1
- package/src/components/image-block/ImageBlock.tsx +2 -1
- package/src/components/index.ts +1 -1
- package/src/components/inline-list/InlineList.stories.tsx +40 -0
- package/src/components/inline-list/InlineList.test.tsx +41 -0
- package/src/components/inline-list/InlineList.tsx +80 -0
- package/src/components/inline-list/index.ts +1 -0
- package/src/components/input-helper/InputHelper.tsx +2 -1
- package/src/components/input-label/InputLabel.tsx +2 -1
- package/src/components/lightbox/Lightbox.tsx +2 -1
- package/src/components/link/Link.tsx +2 -1
- package/src/components/link-preview/LinkPreview.test.tsx +1 -1
- package/src/components/link-preview/LinkPreview.tsx +2 -1
- package/src/components/list/List.tsx +2 -1
- package/src/components/list/ListDivider.tsx +2 -1
- package/src/components/list/ListItem.tsx +3 -8
- package/src/components/list/ListSubheader.tsx +2 -1
- package/src/components/list/useInteractiveList.tsx +1 -1
- package/src/components/message/Message.test.tsx +1 -1
- package/src/components/message/Message.tsx +2 -1
- package/src/components/mosaic/Mosaic.tsx +2 -1
- package/src/components/notification/Notification.tsx +2 -1
- package/src/components/popover/Popover.tsx +2 -1
- package/src/components/post-block/PostBlock.tsx +2 -1
- package/src/components/progress/Progress.tsx +2 -1
- package/src/components/progress-tracker/ProgressTracker.tsx +2 -1
- package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +1 -1
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +2 -1
- package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +2 -1
- package/src/components/radio-button/RadioButton.test.tsx +1 -1
- package/src/components/radio-button/RadioButton.tsx +2 -1
- package/src/components/radio-button/RadioGroup.tsx +2 -1
- package/src/components/select/Select.test.tsx +1 -1
- package/src/components/select/Select.tsx +2 -1
- package/src/components/select/SelectMultiple.test.tsx +1 -1
- package/src/components/select/SelectMultiple.tsx +2 -1
- package/src/components/select/WithSelectContext.tsx +1 -1
- package/src/components/select/constants.ts +1 -1
- package/src/components/side-navigation/SideNavigation.tsx +2 -1
- package/src/components/side-navigation/SideNavigationItem.test.tsx +1 -1
- package/src/components/side-navigation/SideNavigationItem.tsx +3 -9
- package/src/components/skeleton/SkeletonCircle.tsx +2 -1
- package/src/components/skeleton/SkeletonRectangle.tsx +2 -1
- package/src/components/skeleton/SkeletonTypography.tsx +2 -1
- package/src/components/slider/Slider.tsx +2 -1
- package/src/components/slideshow/Slides.tsx +2 -1
- package/src/components/slideshow/Slideshow.tsx +1 -1
- package/src/components/slideshow/SlideshowControls.tsx +2 -1
- package/src/components/slideshow/SlideshowItem.tsx +2 -1
- package/src/components/slideshow/SlideshowItemGroup.tsx +2 -1
- package/src/components/switch/Switch.test.tsx +1 -1
- package/src/components/switch/Switch.tsx +2 -1
- package/src/components/table/Table.tsx +2 -1
- package/src/components/table/TableBody.tsx +2 -1
- package/src/components/table/TableCell.tsx +3 -1
- package/src/components/table/TableHeader.tsx +2 -1
- package/src/components/table/TableRow.tsx +2 -1
- package/src/components/tabs/Tab.test.tsx +1 -1
- package/src/components/tabs/Tab.tsx +2 -1
- package/src/components/tabs/TabList.test.tsx +1 -1
- package/src/components/tabs/TabList.tsx +2 -1
- package/src/components/tabs/TabPanel.tsx +2 -1
- package/src/components/text/{Text.stories.tsx → Text.stories.jsx} +23 -28
- package/src/components/text/Text.test.tsx +15 -1
- package/src/components/text/Text.tsx +38 -12
- package/src/components/text-field/TextField.test.tsx +1 -1
- package/src/components/text-field/TextField.tsx +2 -1
- package/src/components/thumbnail/Thumbnail.tsx +2 -1
- package/src/components/thumbnail/types.ts +1 -1
- package/src/components/toolbar/Toolbar.tsx +2 -1
- package/src/components/tooltip/Tooltip.tsx +2 -1
- package/src/components/tooltip/useTooltipOpen.tsx +1 -1
- package/src/components/uploader/Uploader.test.tsx +1 -1
- package/src/components/uploader/Uploader.tsx +2 -1
- package/src/components/user-block/UserBlock.tsx +2 -1
- package/src/hooks/useCallbackOnEscape.ts +2 -1
- package/src/hooks/useClickAway.tsx +1 -1
- package/src/hooks/useDisableBodyScroll.ts +1 -1
- package/src/hooks/useFocusTrap.ts +1 -1
- package/src/hooks/useInterval.tsx +1 -1
- package/src/hooks/useOnResize.ts +1 -1
- package/src/index.ts +5 -0
- package/src/stories/generated/GenericBlock/Demos.stories.tsx +3 -1
- package/src/stories/generated/Heading/Demos.stories.tsx +6 -0
- package/src/stories/withResizableBox.tsx +18 -0
- package/src/testing/utils/commonTestsSuite.ts +1 -1
- package/src/utils/{getRootClassName.ts → className.ts} +19 -0
- package/src/utils/event.ts +1 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/type.ts +3 -0
- package/src/utils/utils.test.ts +1 -1
- package/types.d.ts +68 -11
- package/utils/index.d.ts +29 -0
- package/utils/index.js +2 -0
- package/utils/index.js.map +1 -0
- package/esm/_internal/AlertDialog.js +0 -141
- package/esm/_internal/AlertDialog.js.map +0 -1
- package/esm/_internal/AutocompleteMultiple.js +0 -257
- package/esm/_internal/AutocompleteMultiple.js.map +0 -1
- package/esm/_internal/Avatar2.js +0 -82
- package/esm/_internal/Avatar2.js.map +0 -1
- package/esm/_internal/Badge2.js +0 -54
- package/esm/_internal/Badge2.js.map +0 -1
- package/esm/_internal/Button2.js +0 -84
- package/esm/_internal/Button2.js.map +0 -1
- package/esm/_internal/ButtonGroup.js +0 -51
- package/esm/_internal/ButtonGroup.js.map +0 -1
- package/esm/_internal/ButtonRoot.js +0 -135
- package/esm/_internal/ButtonRoot.js.map +0 -1
- package/esm/_internal/Checkbox2.js +0 -116
- package/esm/_internal/Checkbox2.js.map +0 -1
- package/esm/_internal/Chip2.js +0 -118
- package/esm/_internal/Chip2.js.map +0 -1
- package/esm/_internal/ChipGroup.js +0 -122
- package/esm/_internal/ChipGroup.js.map +0 -1
- package/esm/_internal/ClickAwayProvider.js +0 -217
- package/esm/_internal/ClickAwayProvider.js.map +0 -1
- package/esm/_internal/CommentBlock.js +0 -124
- package/esm/_internal/CommentBlock.js.map +0 -1
- package/esm/_internal/DatePickerField.js +0 -347
- package/esm/_internal/DatePickerField.js.map +0 -1
- package/esm/_internal/Dialog2.js +0 -274
- package/esm/_internal/Dialog2.js.map +0 -1
- package/esm/_internal/Divider2.js +0 -53
- package/esm/_internal/Divider2.js.map +0 -1
- package/esm/_internal/DragHandle.js +0 -50
- package/esm/_internal/DragHandle.js.map +0 -1
- package/esm/_internal/Dropdown2.js +0 -157
- package/esm/_internal/Dropdown2.js.map +0 -1
- package/esm/_internal/ExpansionPanel.js +0 -156
- package/esm/_internal/ExpansionPanel.js.map +0 -1
- package/esm/_internal/Flag2.js +0 -48
- package/esm/_internal/Flag2.js.map +0 -1
- package/esm/_internal/FlexBox.js +0 -55
- package/esm/_internal/FlexBox.js.map +0 -1
- package/esm/_internal/GenericBlock.js +0 -125
- package/esm/_internal/GenericBlock.js.map +0 -1
- package/esm/_internal/GridItem.js +0 -96
- package/esm/_internal/GridItem.js.map +0 -1
- package/esm/_internal/HeadingLevelProvider.js +0 -112
- package/esm/_internal/HeadingLevelProvider.js.map +0 -1
- package/esm/_internal/Icon2.js +0 -120
- package/esm/_internal/Icon2.js.map +0 -1
- package/esm/_internal/IconButton.js +0 -74
- package/esm/_internal/IconButton.js.map +0 -1
- package/esm/_internal/ImageBlock.js +0 -101
- package/esm/_internal/ImageBlock.js.map +0 -1
- package/esm/_internal/InputHelper.js +0 -72
- package/esm/_internal/InputHelper.js.map +0 -1
- package/esm/_internal/InputLabel.js +0 -58
- package/esm/_internal/InputLabel.js.map +0 -1
- package/esm/_internal/Lightbox2.js +0 -123
- package/esm/_internal/Lightbox2.js.map +0 -1
- package/esm/_internal/Link2.js +0 -122
- package/esm/_internal/Link2.js.map +0 -1
- package/esm/_internal/LinkPreview.js +0 -105
- package/esm/_internal/LinkPreview.js.map +0 -1
- package/esm/_internal/List2.js +0 -799
- package/esm/_internal/List2.js.map +0 -1
- package/esm/_internal/ListSubheader.js +0 -79
- package/esm/_internal/ListSubheader.js.map +0 -1
- package/esm/_internal/Message2.js +0 -78
- package/esm/_internal/Message2.js.map +0 -1
- package/esm/_internal/Mosaic2.js +0 -89
- package/esm/_internal/Mosaic2.js.map +0 -1
- package/esm/_internal/Notification2.js +0 -133
- package/esm/_internal/Notification2.js.map +0 -1
- package/esm/_internal/Popover2.js +0 -2473
- package/esm/_internal/Popover2.js.map +0 -1
- package/esm/_internal/PostBlock.js +0 -96
- package/esm/_internal/PostBlock.js.map +0 -1
- package/esm/_internal/Progress2.js +0 -81
- package/esm/_internal/Progress2.js.map +0 -1
- package/esm/_internal/ProgressTrackerStepPanel.js +0 -313
- package/esm/_internal/ProgressTrackerStepPanel.js.map +0 -1
- package/esm/_internal/RadioGroup.js +0 -147
- package/esm/_internal/RadioGroup.js.map +0 -1
- package/esm/_internal/SelectMultiple.js +0 -424
- package/esm/_internal/SelectMultiple.js.map +0 -1
- package/esm/_internal/SideNavigationItem.js +0 -151
- package/esm/_internal/SideNavigationItem.js.map +0 -1
- package/esm/_internal/SkeletonTypography.js +0 -168
- package/esm/_internal/SkeletonTypography.js.map +0 -1
- package/esm/_internal/Slider2.js +0 -327
- package/esm/_internal/Slider2.js.map +0 -1
- package/esm/_internal/Slides.js +0 -864
- package/esm/_internal/Slides.js.map +0 -1
- package/esm/_internal/Switch2.js +0 -116
- package/esm/_internal/Switch2.js.map +0 -1
- package/esm/_internal/TabPanel.js +0 -280
- package/esm/_internal/TabPanel.js.map +0 -1
- package/esm/_internal/TableRow.js +0 -291
- package/esm/_internal/TableRow.js.map +0 -1
- package/esm/_internal/Text2.js +0 -63
- package/esm/_internal/Text2.js.map +0 -1
- package/esm/_internal/TextField.js +0 -322
- package/esm/_internal/TextField.js.map +0 -1
- package/esm/_internal/Thumbnail2.js +0 -301
- package/esm/_internal/Thumbnail2.js.map +0 -1
- package/esm/_internal/Toolbar2.js +0 -60
- package/esm/_internal/Toolbar2.js.map +0 -1
- package/esm/_internal/Tooltip2.js +0 -282
- package/esm/_internal/Tooltip2.js.map +0 -1
- package/esm/_internal/Uploader2.js +0 -84
- package/esm/_internal/Uploader2.js.map +0 -1
- package/esm/_internal/UserBlock.js +0 -132
- package/esm/_internal/UserBlock.js.map +0 -1
- package/esm/_internal/_rollupPluginBabelHelpers.js.map +0 -1
- package/esm/_internal/alert-dialog.js +0 -34
- package/esm/_internal/alert-dialog.js.map +0 -1
- package/esm/_internal/autocomplete.js +0 -32
- package/esm/_internal/autocomplete.js.map +0 -1
- package/esm/_internal/avatar.js +0 -13
- package/esm/_internal/avatar.js.map +0 -1
- package/esm/_internal/badge.js +0 -10
- package/esm/_internal/badge.js.map +0 -1
- package/esm/_internal/button.js +0 -25
- package/esm/_internal/button.js.map +0 -1
- package/esm/_internal/checkbox.js +0 -14
- package/esm/_internal/checkbox.js.map +0 -1
- package/esm/_internal/chip.js +0 -12
- package/esm/_internal/chip.js.map +0 -1
- package/esm/_internal/comment-block.js +0 -24
- package/esm/_internal/comment-block.js.map +0 -1
- package/esm/_internal/components.js +0 -156
- package/esm/_internal/components.js.map +0 -1
- package/esm/_internal/constants.js +0 -13
- package/esm/_internal/constants.js.map +0 -1
- package/esm/_internal/date-picker.js +0 -32
- package/esm/_internal/date-picker.js.map +0 -1
- package/esm/_internal/dialog.js +0 -27
- package/esm/_internal/dialog.js.map +0 -1
- package/esm/_internal/divider.js +0 -10
- package/esm/_internal/divider.js.map +0 -1
- package/esm/_internal/drag-handle.js +0 -11
- package/esm/_internal/drag-handle.js.map +0 -1
- package/esm/_internal/dropdown.js +0 -21
- package/esm/_internal/dropdown.js.map +0 -1
- package/esm/_internal/expansion-panel.js +0 -32
- package/esm/_internal/expansion-panel.js.map +0 -1
- package/esm/_internal/flag.js +0 -11
- package/esm/_internal/flag.js.map +0 -1
- package/esm/_internal/flex-box.js +0 -11
- package/esm/_internal/flex-box.js.map +0 -1
- package/esm/_internal/generic-block.js +0 -20
- package/esm/_internal/generic-block.js.map +0 -1
- package/esm/_internal/getRootClassName.js +0 -346
- package/esm/_internal/getRootClassName.js.map +0 -1
- package/esm/_internal/grid.js +0 -10
- package/esm/_internal/grid.js.map +0 -1
- package/esm/_internal/heading.js +0 -11
- package/esm/_internal/heading.js.map +0 -1
- package/esm/_internal/icon.js +0 -10
- package/esm/_internal/icon.js.map +0 -1
- package/esm/_internal/image-block.js +0 -14
- package/esm/_internal/image-block.js.map +0 -1
- package/esm/_internal/input-helper.js +0 -10
- package/esm/_internal/input-helper.js.map +0 -1
- package/esm/_internal/input-label.js +0 -10
- package/esm/_internal/input-label.js.map +0 -1
- package/esm/_internal/lightbox.js +0 -27
- package/esm/_internal/lightbox.js.map +0 -1
- package/esm/_internal/link-preview.js +0 -15
- package/esm/_internal/link-preview.js.map +0 -1
- package/esm/_internal/link.js +0 -12
- package/esm/_internal/link.js.map +0 -1
- package/esm/_internal/list.js +0 -15
- package/esm/_internal/list.js.map +0 -1
- package/esm/_internal/mergeRefs.js +0 -25
- package/esm/_internal/mergeRefs.js.map +0 -1
- package/esm/_internal/message.js +0 -11
- package/esm/_internal/message.js.map +0 -1
- package/esm/_internal/mosaic.js +0 -14
- package/esm/_internal/mosaic.js.map +0 -1
- package/esm/_internal/notification.js +0 -18
- package/esm/_internal/notification.js.map +0 -1
- package/esm/_internal/partitionMulti.js +0 -27
- package/esm/_internal/partitionMulti.js.map +0 -1
- package/esm/_internal/popover.js +0 -15
- package/esm/_internal/popover.js.map +0 -1
- package/esm/_internal/post-block.js +0 -15
- package/esm/_internal/post-block.js.map +0 -1
- package/esm/_internal/progress-tracker.js +0 -17
- package/esm/_internal/progress-tracker.js.map +0 -1
- package/esm/_internal/progress.js +0 -10
- package/esm/_internal/progress.js.map +0 -1
- package/esm/_internal/radio-button.js +0 -13
- package/esm/_internal/radio-button.js.map +0 -1
- package/esm/_internal/renderLink.js +0 -25
- package/esm/_internal/renderLink.js.map +0 -1
- package/esm/_internal/select.js +0 -31
- package/esm/_internal/select.js.map +0 -1
- package/esm/_internal/side-navigation.js +0 -25
- package/esm/_internal/side-navigation.js.map +0 -1
- package/esm/_internal/skeleton.js +0 -10
- package/esm/_internal/skeleton.js.map +0 -1
- package/esm/_internal/slider.js +0 -13
- package/esm/_internal/slider.js.map +0 -1
- package/esm/_internal/slideshow.js +0 -29
- package/esm/_internal/slideshow.js.map +0 -1
- package/esm/_internal/state.js +0 -145
- package/esm/_internal/state.js.map +0 -1
- package/esm/_internal/switch.js +0 -13
- package/esm/_internal/switch.js.map +0 -1
- package/esm/_internal/table.js +0 -12
- package/esm/_internal/table.js.map +0 -1
- package/esm/_internal/tabs.js +0 -15
- package/esm/_internal/tabs.js.map +0 -1
- package/esm/_internal/text-field.js +0 -26
- package/esm/_internal/text-field.js.map +0 -1
- package/esm/_internal/text.js +0 -10
- package/esm/_internal/text.js.map +0 -1
- package/esm/_internal/thumbnail.js +0 -13
- package/esm/_internal/thumbnail.js.map +0 -1
- package/esm/_internal/toolbar.js +0 -9
- package/esm/_internal/toolbar.js.map +0 -1
- package/esm/_internal/tooltip.js +0 -18
- package/esm/_internal/tooltip.js.map +0 -1
- package/esm/_internal/type.js +0 -40
- package/esm/_internal/type.js.map +0 -1
- package/esm/_internal/types.js +0 -23
- package/esm/_internal/types.js.map +0 -1
- package/esm/_internal/uploader.js +0 -11
- package/esm/_internal/uploader.js.map +0 -1
- package/esm/_internal/useDelayedVisibility.js +0 -47
- package/esm/_internal/useDelayedVisibility.js.map +0 -1
- package/esm/_internal/useDisableBodyScroll.js +0 -220
- package/esm/_internal/useDisableBodyScroll.js.map +0 -1
- package/esm/_internal/useFocusTrap.js +0 -86
- package/esm/_internal/useFocusTrap.js.map +0 -1
- package/esm/_internal/useRovingTabIndex.js +0 -87
- package/esm/_internal/useRovingTabIndex.js.map +0 -1
- package/esm/_internal/user-block.js +0 -17
- package/esm/_internal/user-block.js.map +0 -1
- package/esm/index.js +0 -95
- package/esm/index.js.map +0 -1
- package/esm/index2.js +0 -16
- package/esm/index2.js.map +0 -1
- package/src/utils/index.tsx +0 -7
package/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@juggle/resize-observer": "^3.2.0",
|
|
10
|
-
"@lumx/core": "^3.0.
|
|
11
|
-
"@lumx/icons": "^3.0.
|
|
10
|
+
"@lumx/core": "^3.0.3-alpha.1",
|
|
11
|
+
"@lumx/icons": "^3.0.3-alpha.1",
|
|
12
12
|
"@popperjs/core": "^2.5.4",
|
|
13
13
|
"body-scroll-lock": "^3.1.5",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"rollup-plugin-babel": "^4.4.0",
|
|
67
67
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
68
68
|
"rollup-plugin-copy": "^3.3.0",
|
|
69
|
+
"rollup-plugin-dts": "^4.2.2",
|
|
69
70
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
70
71
|
"rollup-plugin-ts-paths-resolve": "^1.3.0",
|
|
71
72
|
"rollup-plugin-typescript-paths": "^1.2.2",
|
|
@@ -97,8 +98,8 @@
|
|
|
97
98
|
"React"
|
|
98
99
|
],
|
|
99
100
|
"license": "MIT",
|
|
100
|
-
"module": "
|
|
101
|
-
"main": "
|
|
101
|
+
"module": "index.js",
|
|
102
|
+
"main": "index.js",
|
|
102
103
|
"types": "types.d.ts",
|
|
103
104
|
"name": "@lumx/react",
|
|
104
105
|
"publishConfig": {
|
|
@@ -119,6 +120,6 @@
|
|
|
119
120
|
"build:storybook": "cd storybook && ./build"
|
|
120
121
|
},
|
|
121
122
|
"sideEffects": false,
|
|
122
|
-
"version": "3.0.
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"version": "3.0.3-alpha.1",
|
|
124
|
+
"gitHead": "8bbdcaeec0b5b6556fdac9bdf81a56ef47c77bcc"
|
|
124
125
|
}
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
|
|
18
18
|
import { mdiAlert, mdiAlertCircle, mdiCheckCircle, mdiInformation } from '@lumx/icons/';
|
|
19
19
|
import { uid } from 'uid';
|
|
20
|
-
import { Comp
|
|
20
|
+
import { Comp } from '@lumx/react/utils/type';
|
|
21
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
21
22
|
|
|
22
23
|
export interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
23
24
|
/** Message variant. */
|
|
@@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { Dropdown, IconButtonProps, Offset, Placement, TextField, TextFieldProps } from '@lumx/react';
|
|
6
6
|
|
|
7
|
-
import { Comp, GenericProps,
|
|
8
|
-
|
|
7
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
8
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
9
9
|
import { useFocus } from '@lumx/react/hooks/useFocus';
|
|
10
10
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
11
11
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { mdiClose } from '@lumx/icons';
|
|
2
2
|
import { Autocomplete, AutocompleteProps, Chip, HorizontalAlignment, Icon, Size } from '@lumx/react';
|
|
3
3
|
|
|
4
|
-
import { Comp
|
|
4
|
+
import { Comp } from '@lumx/react/utils/type';
|
|
5
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
5
6
|
|
|
6
7
|
import classNames from 'classnames';
|
|
7
8
|
import React, { forwardRef, ReactNode } from 'react';
|
|
@@ -4,7 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { AspectRatio, Size, Theme, Thumbnail, ThumbnailProps } from '@lumx/react';
|
|
6
6
|
|
|
7
|
-
import { Comp, GenericProps,
|
|
7
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
8
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Avatar sizes.
|
|
@@ -4,7 +4,7 @@ import { mount, shallow } from 'enzyme';
|
|
|
4
4
|
import 'jest-enzyme';
|
|
5
5
|
|
|
6
6
|
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
7
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
7
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
8
8
|
|
|
9
9
|
import { Theme } from '@lumx/react';
|
|
10
10
|
import { Badge, BadgeProps } from './Badge';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Color, ColorPalette } from '@lumx/react';
|
|
2
|
-
import { Comp, GenericProps
|
|
2
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
3
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React, { forwardRef, ReactNode } from 'react';
|
|
5
6
|
|
|
@@ -5,7 +5,7 @@ import 'jest-enzyme';
|
|
|
5
5
|
|
|
6
6
|
import { mdiCheck, mdiChevronDown, mdiPlus } from '@lumx/icons';
|
|
7
7
|
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
8
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
8
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
9
9
|
import { Button, ButtonProps } from './Button';
|
|
10
10
|
|
|
11
11
|
const DEFAULT_PROPS = Button.defaultProps as any;
|
|
@@ -4,7 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
5
|
|
|
6
6
|
import { Emphasis, Icon, Size, Theme } from '@lumx/react';
|
|
7
|
-
import { Comp
|
|
7
|
+
import { Comp } from '@lumx/react/utils/type';
|
|
8
|
+
import { getBasicClass, getRootClassName } from '@lumx/react/utils/className';
|
|
8
9
|
import { BaseButtonProps, ButtonRoot } from './ButtonRoot';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -2,7 +2,8 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { Comp, GenericProps
|
|
5
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
6
|
+
import { getRootClassName } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Defines the props of the component
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
ButtonRoot,
|
|
13
13
|
ButtonRootProps,
|
|
14
14
|
} from '@lumx/react/components/button/ButtonRoot';
|
|
15
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
15
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
16
16
|
|
|
17
17
|
type SetupProps = Partial<ButtonRootProps>;
|
|
18
18
|
|
|
@@ -6,7 +6,8 @@ import classNames from 'classnames';
|
|
|
6
6
|
|
|
7
7
|
import { Color, ColorPalette, Emphasis, Size, Theme } from '@lumx/react';
|
|
8
8
|
import { CSS_PREFIX } from '@lumx/react/constants';
|
|
9
|
-
import { Comp, GenericProps,
|
|
9
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
10
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
10
11
|
import { renderLink } from '@lumx/react/utils/renderLink';
|
|
11
12
|
|
|
12
13
|
type HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
@@ -2,7 +2,8 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Emphasis, Icon, Size, Theme, Tooltip, TooltipProps } from '@lumx/react';
|
|
4
4
|
import { BaseButtonProps, ButtonRoot } from '@lumx/react/components/button/ButtonRoot';
|
|
5
|
-
import { Comp
|
|
5
|
+
import { Comp } from '@lumx/react/utils/type';
|
|
6
|
+
import { getRootClassName } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
export interface IconButtonProps extends BaseButtonProps {
|
|
8
9
|
/**
|
|
@@ -4,7 +4,7 @@ import { mount, shallow } from 'enzyme';
|
|
|
4
4
|
import 'jest-enzyme';
|
|
5
5
|
|
|
6
6
|
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
7
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
7
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
8
8
|
|
|
9
9
|
import { Checkbox, CheckboxProps } from './Checkbox';
|
|
10
10
|
|
|
@@ -6,7 +6,8 @@ import { uid } from 'uid';
|
|
|
6
6
|
import { mdiCheck } from '@lumx/icons';
|
|
7
7
|
|
|
8
8
|
import { Icon, InputHelper, InputLabel, Theme } from '@lumx/react';
|
|
9
|
-
import { Comp, GenericProps,
|
|
9
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
10
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Defines the props of the component.
|
|
@@ -4,7 +4,7 @@ import React, { ReactElement } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { ColorPalette, Theme } from '@lumx/react';
|
|
6
6
|
import { Wrapper } from '@lumx/react/testing/utils';
|
|
7
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
7
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
8
8
|
import { Chip, ChipProps } from './Chip';
|
|
9
9
|
|
|
10
10
|
const CLASSNAME = Chip.className as string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Color, ColorPalette, Size, Theme } from '@lumx/react';
|
|
2
2
|
import { useStopPropagation } from '@lumx/react/hooks/useStopPropagation';
|
|
3
3
|
|
|
4
|
-
import { Comp, GenericProps,
|
|
4
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
5
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
|
+
import { onEnterPressed } from '@lumx/react/utils/event';
|
|
5
7
|
|
|
6
8
|
import classNames from 'classnames';
|
|
7
9
|
|
|
@@ -3,7 +3,8 @@ import React, { forwardRef, ReactNode } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
|
|
6
|
-
import { Comp, GenericProps
|
|
6
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
7
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
7
8
|
|
|
8
9
|
import { useChipGroupNavigation } from '@lumx/react/hooks/useChipGroupNavigation';
|
|
9
10
|
|
|
@@ -3,7 +3,8 @@ import React, { Children, forwardRef, KeyboardEvent, KeyboardEventHandler, React
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Avatar, Size, Theme, Tooltip } from '@lumx/react';
|
|
6
|
-
import { Comp, GenericProps,
|
|
6
|
+
import { Comp, GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';
|
|
7
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
7
8
|
|
|
8
9
|
import isFunction from 'lodash/isFunction';
|
|
9
10
|
import { AvatarProps } from '../avatar/Avatar';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import React, { forwardRef, useState } from 'react';
|
|
3
|
-
import { Comp } from '@lumx/react/utils';
|
|
3
|
+
import { Comp } from '@lumx/react/utils/type';
|
|
4
4
|
import { CLASSNAME, COMPONENT_NAME } from './constants';
|
|
5
5
|
import { DatePickerControlled } from './DatePickerControlled';
|
|
6
6
|
import { DatePickerProps } from './types';
|
|
@@ -4,7 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { DatePickerProps, Emphasis, IconButton, Toolbar } from '@lumx/react';
|
|
5
5
|
import { mdiChevronLeft, mdiChevronRight } from '@lumx/icons';
|
|
6
6
|
import { getAnnotatedMonthCalendar, getWeekDays } from '@lumx/core/js/date-picker';
|
|
7
|
-
import { Comp } from '@lumx/react/utils';
|
|
7
|
+
import { Comp } from '@lumx/react/utils/type';
|
|
8
8
|
import { CLASSNAME } from './constants';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -6,7 +6,7 @@ import moment from 'moment';
|
|
|
6
6
|
import React, { forwardRef, SyntheticEvent, useCallback, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useFocus } from '@lumx/react/hooks/useFocus';
|
|
9
|
-
import { Comp, GenericProps } from '@lumx/react/utils';
|
|
9
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Defines the props of the component.
|
|
@@ -9,14 +9,10 @@ import { DIALOG_TRANSITION_DURATION, DOCUMENT } from '@lumx/react/constants';
|
|
|
9
9
|
import { useCallbackOnEscape } from '@lumx/react/hooks/useCallbackOnEscape';
|
|
10
10
|
import { useFocusTrap } from '@lumx/react/hooks/useFocusTrap';
|
|
11
11
|
import { useIntersectionObserver } from '@lumx/react/hooks/useIntersectionObserver';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
handleBasicClasses,
|
|
17
|
-
isComponent,
|
|
18
|
-
partitionMulti,
|
|
19
|
-
} from '@lumx/react/utils';
|
|
12
|
+
|
|
13
|
+
import { Comp, GenericProps, isComponent } from '@lumx/react/utils/type';
|
|
14
|
+
import { partitionMulti } from '@lumx/react/utils/partitionMulti';
|
|
15
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
20
16
|
import { ClickAwayProvider } from '@lumx/react/utils/ClickAwayProvider';
|
|
21
17
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
22
18
|
|
|
@@ -4,7 +4,7 @@ import { mount, shallow } from 'enzyme';
|
|
|
4
4
|
import 'jest-enzyme';
|
|
5
5
|
|
|
6
6
|
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
7
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
7
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
8
8
|
|
|
9
9
|
import { Theme } from '@lumx/react';
|
|
10
10
|
import { Divider, DividerProps } from './Divider';
|
|
@@ -3,7 +3,8 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Theme } from '@lumx/react';
|
|
6
|
-
import { Comp, GenericProps,
|
|
6
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
7
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Defines the props of the component.
|
|
@@ -23,7 +24,7 @@ const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
|
23
24
|
/**
|
|
24
25
|
* Component default props.
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
const DEFAULT_PROPS: Partial<DividerProps> = {
|
|
27
28
|
theme: Theme.light,
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -4,7 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { mdiDragVertical } from '@lumx/icons';
|
|
6
6
|
import { ColorPalette, Icon, Size, Theme } from '@lumx/react';
|
|
7
|
-
import { Comp, GenericProps,
|
|
7
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
8
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Defines the props of the component.
|
|
@@ -5,7 +5,8 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { List, ListProps } from '@lumx/react/components/list/List';
|
|
6
6
|
import { Offset, Placement, Popover, PopoverProps } from '@lumx/react/components/popover/Popover';
|
|
7
7
|
import { useInfiniteScroll } from '@lumx/react/hooks/useInfiniteScroll';
|
|
8
|
-
import { Comp, GenericProps,
|
|
8
|
+
import { Comp, GenericProps, isComponent } from '@lumx/react/utils/type';
|
|
9
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Defines the props of the component.
|
|
@@ -4,7 +4,7 @@ import { mount, shallow } from 'enzyme';
|
|
|
4
4
|
import 'jest-enzyme';
|
|
5
5
|
|
|
6
6
|
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
7
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
7
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
8
8
|
|
|
9
9
|
import { Theme } from '@lumx/react';
|
|
10
10
|
import { ExpansionPanel, ExpansionPanelProps } from './ExpansionPanel';
|
|
@@ -9,16 +9,9 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
9
9
|
import isFunction from 'lodash/isFunction';
|
|
10
10
|
|
|
11
11
|
import { ColorPalette, DragHandle, Emphasis, IconButton, IconButtonProps, Theme } from '@lumx/react';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
GenericProps,
|
|
16
|
-
getRootClassName,
|
|
17
|
-
handleBasicClasses,
|
|
18
|
-
HasTheme,
|
|
19
|
-
isComponent,
|
|
20
|
-
partitionMulti,
|
|
21
|
-
} from '@lumx/react/utils';
|
|
12
|
+
import { Callback, Comp, GenericProps, HasTheme, isComponent } from '@lumx/react/utils/type';
|
|
13
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
14
|
+
import { partitionMulti } from '@lumx/react/utils/partitionMulti';
|
|
22
15
|
|
|
23
16
|
/**
|
|
24
17
|
* Defines the props of the component.
|
|
@@ -5,7 +5,7 @@ import React, { ReactElement } from 'react';
|
|
|
5
5
|
import { ColorPalette, Theme } from '@lumx/react';
|
|
6
6
|
import { mdiAbTesting } from '@lumx/icons';
|
|
7
7
|
import { itShouldRenderStories, commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
8
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
8
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
9
9
|
|
|
10
10
|
import { Flag, FlagProps } from './Flag';
|
|
11
11
|
import * as stories from './Flag.stories';
|
|
@@ -2,7 +2,8 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { ColorPalette, Icon, Size, Theme } from '@lumx/react';
|
|
5
|
-
import { Comp, GenericProps,
|
|
5
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
6
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
export interface FlagProps extends GenericProps, HasTheme {
|
|
8
9
|
/** Color of the component. */
|
|
@@ -235,3 +235,11 @@ export const Distribution = () => (
|
|
|
235
235
|
<Button>Button 3</Button>
|
|
236
236
|
</FlexBox>
|
|
237
237
|
);
|
|
238
|
+
|
|
239
|
+
export const CustomizeElement = () => (
|
|
240
|
+
<FlexBox as="header" orientation="horizontal" gap="regular">
|
|
241
|
+
<div>Element 1</div>
|
|
242
|
+
<div>Element 2</div>
|
|
243
|
+
<div>Element 2</div>
|
|
244
|
+
</FlexBox>
|
|
245
|
+
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Alignment, Orientation } from '@lumx/react';
|
|
2
|
-
import { Comp, GenericProps
|
|
2
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
3
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import castArray from 'lodash/castArray';
|
|
5
6
|
import React, { forwardRef, ReactNode } from 'react';
|
|
@@ -15,6 +16,8 @@ export type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
|
|
|
15
16
|
* Defines the props of the component.
|
|
16
17
|
*/
|
|
17
18
|
export interface FlexBoxProps extends GenericProps {
|
|
19
|
+
/** Customize the root element. */
|
|
20
|
+
as?: React.ElementType;
|
|
18
21
|
/** Children elements. */
|
|
19
22
|
children?: ReactNode;
|
|
20
23
|
/** Whether the "content filling space" is enabled or not. */
|
|
@@ -54,6 +57,7 @@ const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
|
54
57
|
*/
|
|
55
58
|
export const FlexBox: Comp<FlexBoxProps, HTMLDivElement> = forwardRef((props, ref) => {
|
|
56
59
|
const {
|
|
60
|
+
as: Component = 'div',
|
|
57
61
|
children,
|
|
58
62
|
className,
|
|
59
63
|
fillSpace,
|
|
@@ -68,7 +72,7 @@ export const FlexBox: Comp<FlexBoxProps, HTMLDivElement> = forwardRef((props, re
|
|
|
68
72
|
} = props;
|
|
69
73
|
|
|
70
74
|
return (
|
|
71
|
-
<
|
|
75
|
+
<Component
|
|
72
76
|
ref={ref}
|
|
73
77
|
{...forwardedProps}
|
|
74
78
|
className={classNames(
|
|
@@ -87,7 +91,7 @@ export const FlexBox: Comp<FlexBoxProps, HTMLDivElement> = forwardRef((props, re
|
|
|
87
91
|
)}
|
|
88
92
|
>
|
|
89
93
|
{children}
|
|
90
|
-
</
|
|
94
|
+
</Component>
|
|
91
95
|
);
|
|
92
96
|
});
|
|
93
97
|
FlexBox.displayName = COMPONENT_NAME;
|
|
@@ -75,6 +75,22 @@ exports[`<FlexBox> Snapshots and structure should render story 'Distribution' 1`
|
|
|
75
75
|
</div>
|
|
76
76
|
`;
|
|
77
77
|
|
|
78
|
+
exports[`<FlexBox> Snapshots and structure should render story 'CustomizeElement' 1`] = `
|
|
79
|
+
<header
|
|
80
|
+
className="lumx-flex-box lumx-flex-box--orientation-horizontal lumx-flex-box--gap-regular"
|
|
81
|
+
>
|
|
82
|
+
<div>
|
|
83
|
+
Element 1
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
Element 2
|
|
87
|
+
</div>
|
|
88
|
+
<div>
|
|
89
|
+
Element 2
|
|
90
|
+
</div>
|
|
91
|
+
</header>
|
|
92
|
+
`;
|
|
93
|
+
|
|
78
94
|
exports[`<FlexBox> Snapshots and structure should render story 'Flex' 1`] = `
|
|
79
95
|
Array [
|
|
80
96
|
<div
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { IMAGES } from '@lumx/react/stories/knobs/image';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { mdiPencil } from '@lumx/icons';
|
|
3
|
-
import { GenericBlock, Button, Icon, Size } from '@lumx/react';
|
|
4
|
+
import { GenericBlock, Button, Icon, Size, Thumbnail } from '@lumx/react';
|
|
4
5
|
|
|
5
6
|
export default { title: 'LumX components/generic-block/GenericBlock' };
|
|
6
7
|
|
|
@@ -104,3 +105,24 @@ export const GapSizes = ({ theme }) =>
|
|
|
104
105
|
</GenericBlock.Actions>
|
|
105
106
|
</GenericBlock>
|
|
106
107
|
));
|
|
108
|
+
|
|
109
|
+
export const AsAFigure = () => (
|
|
110
|
+
<GenericBlock as="figure" orientation="vertical" style={{ width: '150px' }}>
|
|
111
|
+
<GenericBlock.Figure>
|
|
112
|
+
<Thumbnail alt="" image={IMAGES.portrait1s200} aspectRatio="horizontal" />
|
|
113
|
+
</GenericBlock.Figure>
|
|
114
|
+
<GenericBlock.Content as="figcaption">Rocky mountain landscape</GenericBlock.Content>
|
|
115
|
+
</GenericBlock>
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
export const AsAnArticle = () => (
|
|
119
|
+
<GenericBlock as="article" orientation="horizontal">
|
|
120
|
+
<GenericBlock.Figure>
|
|
121
|
+
<Thumbnail alt="" size="xl" image={IMAGES.portrait1s200} aspectRatio="horizontal" />
|
|
122
|
+
</GenericBlock.Figure>
|
|
123
|
+
<GenericBlock.Content>
|
|
124
|
+
<h2>Article title</h2>
|
|
125
|
+
<p>Article description...</p>
|
|
126
|
+
</GenericBlock.Content>
|
|
127
|
+
</GenericBlock>
|
|
128
|
+
);
|
|
@@ -2,8 +2,11 @@ import React, { Children, forwardRef, ReactElement, ReactNode } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
|
4
4
|
import noop from 'lodash/noop';
|
|
5
|
-
import { Comp,
|
|
5
|
+
import { Comp, isComponentType } from '@lumx/react/utils/type';
|
|
6
|
+
import { getRootClassName } from '@lumx/react/utils/className';
|
|
7
|
+
import { partitionMulti } from '@lumx/react/utils/partitionMulti';
|
|
6
8
|
import { Orientation, Size, FlexBox, FlexBoxProps } from '@lumx/react';
|
|
9
|
+
import { GenericBlockGapSize } from '@lumx/react/components/generic-block/constants';
|
|
7
10
|
|
|
8
11
|
export interface GenericBlockProps extends FlexBoxProps {
|
|
9
12
|
/**
|
|
@@ -44,6 +47,10 @@ export interface GenericBlockProps extends FlexBoxProps {
|
|
|
44
47
|
* props to forward to the figure element.
|
|
45
48
|
*/
|
|
46
49
|
figureProps?: Omit<FlexBoxProps, 'children'>;
|
|
50
|
+
/**
|
|
51
|
+
* Gap space between sections.
|
|
52
|
+
*/
|
|
53
|
+
gap?: GenericBlockGapSize;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
/**
|
|
@@ -66,22 +73,29 @@ const DEFAULT_PROPS: Partial<GenericBlockProps> = {
|
|
|
66
73
|
|
|
67
74
|
type BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;
|
|
68
75
|
|
|
76
|
+
interface GenericBlockSectionProps extends FlexBoxProps {
|
|
77
|
+
/**
|
|
78
|
+
* Gap space between items.
|
|
79
|
+
*/
|
|
80
|
+
gap?: GenericBlockGapSize;
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
interface GenericBlock extends BaseGenericBlock {
|
|
70
84
|
/**
|
|
71
85
|
* Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject
|
|
72
86
|
* the "figure" section of the block (instead of using `figure` and `figureProps` props).
|
|
73
87
|
*/
|
|
74
|
-
Figure: Comp<
|
|
88
|
+
Figure: Comp<GenericBlockSectionProps>;
|
|
75
89
|
/**
|
|
76
90
|
* Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject
|
|
77
91
|
* the "content" section of the block (instead of using `content` and `contentProps` props).
|
|
78
92
|
*/
|
|
79
|
-
Content: Comp<
|
|
93
|
+
Content: Comp<GenericBlockSectionProps>;
|
|
80
94
|
/**
|
|
81
95
|
* Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject
|
|
82
96
|
* the "actions" section of the block (instead of using `actions` and `actionsProps` props).
|
|
83
97
|
*/
|
|
84
|
-
Actions: Comp<
|
|
98
|
+
Actions: Comp<GenericBlockSectionProps>;
|
|
85
99
|
}
|
|
86
100
|
|
|
87
101
|
const Figure = noop.bind({}) as Comp<FlexBoxProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import pick from 'lodash/pick';
|
|
2
|
+
import { Size } from '@lumx/react';
|
|
3
|
+
import { ValueOf } from '@lumx/react/utils/type';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Accepted gap sizes for the generic block.
|
|
7
|
+
*/
|
|
8
|
+
export const GenericBlockGapSize = pick(Size, ['tiny', 'regular', 'medium', 'big', 'huge']);
|
|
9
|
+
export type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;
|
|
@@ -3,7 +3,8 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Alignment, Orientation, Size } from '@lumx/react';
|
|
6
|
-
import { Comp, GenericProps
|
|
6
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
7
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
7
8
|
|
|
8
9
|
type GridGutterSize = Extract<Size, 'regular' | 'big' | 'huge'>;
|
|
9
10
|
|
|
@@ -3,7 +3,8 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Alignment } from '@lumx/react';
|
|
6
|
-
import { Comp, GenericProps
|
|
6
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
7
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
7
8
|
|
|
8
9
|
type Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
9
10
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Comp,
|
|
1
|
+
import { Comp, HeadingElement } from '@lumx/react/utils/type';
|
|
2
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import React, { forwardRef } from 'react';
|
|
4
5
|
import { Text, TextProps } from '../text';
|