@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
|
@@ -6,7 +6,8 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { InputHelper, InputLabel, Theme } from '@lumx/react';
|
|
7
7
|
|
|
8
8
|
import useEventCallback from '@lumx/react/hooks/useEventCallback';
|
|
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
|
import { uid } from 'uid';
|
|
12
13
|
import { clamp } from '@lumx/react/utils/clamp';
|
|
@@ -4,7 +4,8 @@ import chunk from 'lodash/chunk';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
|
|
6
6
|
import { FULL_WIDTH_PERCENT } from '@lumx/react/components/slideshow/constants';
|
|
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
|
import { buildSlideShowGroupId, SlideshowItemGroup } from './SlideshowItemGroup';
|
|
9
10
|
|
|
10
11
|
export interface SlidesProps extends GenericProps, HasTheme {
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { SlideshowControls, SlideshowControlsProps, Theme, Slides, SlidesProps } from '@lumx/react';
|
|
4
4
|
import { DEFAULT_OPTIONS } from '@lumx/react/hooks/useSlideshowControls';
|
|
5
|
-
import { Comp, GenericProps } from '@lumx/react/utils';
|
|
5
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
6
6
|
import { useFocusWithin } from '@lumx/react/hooks/useFocusWithin';
|
|
7
7
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
8
8
|
import { buildSlideShowGroupId } from './SlideshowItemGroup';
|
|
@@ -5,7 +5,8 @@ import range from 'lodash/range';
|
|
|
5
5
|
|
|
6
6
|
import { mdiChevronLeft, mdiChevronRight, mdiPlayCircleOutline, mdiPauseCircleOutline } from '@lumx/icons';
|
|
7
7
|
import { Emphasis, IconButton, IconButtonProps, Theme } from '@lumx/react';
|
|
8
|
-
import { Comp, GenericProps,
|
|
8
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
9
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
9
10
|
import { WINDOW } from '@lumx/react/constants';
|
|
10
11
|
import { useSlideshowControls, DEFAULT_OPTIONS } from '@lumx/react/hooks/useSlideshowControls';
|
|
11
12
|
import { useRovingTabIndex } from '@lumx/react/hooks/useRovingTabIndex';
|
|
@@ -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, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Defines the props of the component.
|
|
@@ -3,7 +3,8 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
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
|
import { useSlideFocusManagement } from './useSlideFocusManagement';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -7,7 +7,7 @@ import { build, oneOf } from 'test-data-bot';
|
|
|
7
7
|
import without from 'lodash/without';
|
|
8
8
|
|
|
9
9
|
import { Wrapper, commonTestsSuite } from '@lumx/react/testing/utils';
|
|
10
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
10
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
11
11
|
|
|
12
12
|
import { Theme, Alignment } from '@lumx/react';
|
|
13
13
|
import { Switch, SwitchProps } from './Switch';
|
|
@@ -7,7 +7,8 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
7
7
|
|
|
8
8
|
import { Alignment, InputHelper, InputLabel, Theme } from '@lumx/react';
|
|
9
9
|
|
|
10
|
-
import { Comp, GenericProps,
|
|
10
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
11
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Defines the props of the component.
|
|
@@ -4,7 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import { Theme } 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
|
* Defines the props of the component.
|
|
@@ -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, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Defines the props of the component.
|
|
@@ -3,7 +3,9 @@ import React, { forwardRef, useCallback } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { Icon, Size } from '@lumx/react';
|
|
6
|
-
import { Comp, GenericProps,
|
|
6
|
+
import { Comp, GenericProps, ValueOf } from '@lumx/react/utils/type';
|
|
7
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
8
|
+
import { onEnterPressed } from '@lumx/react/utils/event';
|
|
7
9
|
|
|
8
10
|
import { mdiArrowDown, mdiArrowUp } from '@lumx/icons';
|
|
9
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, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Defines the props of the component.
|
|
@@ -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, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Defines the props of the component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mdiCheck } from '@lumx/icons';
|
|
2
2
|
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
3
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
3
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
4
4
|
|
|
5
5
|
import { mount, shallow } from 'enzyme';
|
|
6
6
|
import 'jest-enzyme';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Icon, IconProps, Size } from '@lumx/react';
|
|
2
2
|
import { CSS_PREFIX } from '@lumx/react/constants';
|
|
3
|
-
import { Comp, GenericProps
|
|
3
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
4
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
4
5
|
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import React, { FocusEventHandler, forwardRef, KeyboardEventHandler, ReactNode, useCallback } from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tab, Alignment } from '@lumx/react';
|
|
2
2
|
|
|
3
3
|
import { Wrapper, commonTestsSuite } from '@lumx/react/testing/utils';
|
|
4
|
-
import { getBasicClass } from '@lumx/react/utils';
|
|
4
|
+
import { getBasicClass } from '@lumx/react/utils/className';
|
|
5
5
|
|
|
6
6
|
import { mount, shallow } from 'enzyme';
|
|
7
7
|
import 'jest-enzyme';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Alignment, Theme } from '@lumx/react';
|
|
2
2
|
import { CSS_PREFIX } from '@lumx/react/constants';
|
|
3
|
-
import { Comp, GenericProps,
|
|
3
|
+
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
4
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
4
5
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
5
6
|
|
|
6
7
|
import classNames from 'classnames';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTabProviderContext } from '@lumx/react/components/tabs/state';
|
|
2
2
|
import { CSS_PREFIX } from '@lumx/react/constants';
|
|
3
|
-
import { Comp, GenericProps
|
|
3
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
4
|
+
import { handleBasicClasses } from '@lumx/react/utils/className';
|
|
4
5
|
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import React, { forwardRef } from 'react';
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ColorPalette, ColorVariant, TypographyCustom, TypographyInterface } from '@lumx/react';
|
|
2
|
+
import { ColorPalette, ColorVariant, Icon, TypographyCustom, TypographyInterface } from '@lumx/react';
|
|
3
|
+
import { mdiEarth, mdiHeart } from '@lumx/icons';
|
|
4
|
+
import { withResizableBox } from '@lumx/react/stories/withResizableBox';
|
|
3
5
|
import { Text } from './Text';
|
|
4
6
|
|
|
5
7
|
export default { title: 'LumX components/text/Text' };
|
|
6
8
|
|
|
7
9
|
export const Default = () => <Text as="p">Some text</Text>;
|
|
8
10
|
|
|
9
|
-
const
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
width: 150,
|
|
13
|
-
height: 60,
|
|
14
|
-
border: '1px solid red',
|
|
15
|
-
resize: 'both',
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
}}
|
|
18
|
-
>
|
|
19
|
-
<Story />
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const Truncate = () => (
|
|
24
|
-
<Text as="p" truncate>
|
|
25
|
-
Some very very very long text
|
|
11
|
+
export const WithIcon = (args) => (
|
|
12
|
+
<Text as="p" {...args}>
|
|
13
|
+
Some text <Icon icon={mdiHeart} /> with icons <Icon icon={mdiEarth} />
|
|
26
14
|
</Text>
|
|
27
15
|
);
|
|
28
|
-
Truncate.decorators = [withResizableBox];
|
|
29
16
|
|
|
30
|
-
export const
|
|
31
|
-
<Text as="p"
|
|
17
|
+
export const LongText = (args) => (
|
|
18
|
+
<Text as="p" {...args}>
|
|
32
19
|
Some very very very very very very very very very long text
|
|
33
20
|
</Text>
|
|
34
21
|
);
|
|
35
|
-
|
|
22
|
+
LongText.decorators = [withResizableBox()];
|
|
23
|
+
|
|
24
|
+
export const NoWrap = LongText.bind({});
|
|
25
|
+
NoWrap.args = { noWrap: true };
|
|
26
|
+
NoWrap.decorators = [withResizableBox()];
|
|
27
|
+
|
|
28
|
+
export const Truncate = LongText.bind({});
|
|
29
|
+
Truncate.args = { truncate: true };
|
|
30
|
+
Truncate.decorators = [withResizableBox()];
|
|
31
|
+
|
|
32
|
+
export const TruncateMultiline = LongText.bind({});
|
|
33
|
+
TruncateMultiline.args = { truncate: { lines: 2 } };
|
|
34
|
+
TruncateMultiline.decorators = [withResizableBox()];
|
|
36
35
|
|
|
37
36
|
export const AllTypography = () => {
|
|
38
37
|
const typographies = [undefined, ...Object.values(TypographyInterface), ...Object.values(TypographyCustom)];
|
|
@@ -42,9 +41,7 @@ export const AllTypography = () => {
|
|
|
42
41
|
<tr key={typography}>
|
|
43
42
|
<td>{typography}</td>
|
|
44
43
|
<td>
|
|
45
|
-
<
|
|
46
|
-
Some text
|
|
47
|
-
</Text>
|
|
44
|
+
<WithIcon typography={typography} />
|
|
48
45
|
</td>
|
|
49
46
|
</tr>
|
|
50
47
|
))}
|
|
@@ -68,9 +65,7 @@ export const AllColor = () => {
|
|
|
68
65
|
<td>{color}</td>
|
|
69
66
|
{colorVariants.map((colorVariant) => (
|
|
70
67
|
<td key={colorVariant}>
|
|
71
|
-
<
|
|
72
|
-
Some text
|
|
73
|
-
</Text>
|
|
68
|
+
<WithIcon color={color} colorVariant={colorVariant} />
|
|
74
69
|
</td>
|
|
75
70
|
))}
|
|
76
71
|
</tr>
|
|
@@ -4,7 +4,9 @@ import { shallow } from 'enzyme';
|
|
|
4
4
|
import 'jest-enzyme';
|
|
5
5
|
|
|
6
6
|
import { commonTestsSuite } from '@lumx/react/testing/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { mdiEarth } from '@lumx/icons';
|
|
8
|
+
import { Icon } from '@lumx/react';
|
|
9
|
+
import { Text, TextProps } from '.';
|
|
8
10
|
|
|
9
11
|
const setup = (props: Partial<TextProps> = {}) => {
|
|
10
12
|
const wrapper = shallow(<Text as="span" {...props} />);
|
|
@@ -55,6 +57,18 @@ describe(`<${Text.displayName}>`, () => {
|
|
|
55
57
|
expect(wrapper).toHaveClassName('lumx-text--is-truncated-multiline');
|
|
56
58
|
expect(wrapper).toHaveStyle({ '--lumx-text-truncate-lines': 2 });
|
|
57
59
|
});
|
|
60
|
+
|
|
61
|
+
it('should render noWrap', () => {
|
|
62
|
+
const { wrapper } = setup({ noWrap: true });
|
|
63
|
+
expect(wrapper).toHaveDisplayName('span');
|
|
64
|
+
expect(wrapper).toHaveClassName('lumx-text--no-wrap');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should wrap icons with spaces', () => {
|
|
68
|
+
const { wrapper } = setup({ children: ['Some text', <Icon key="icon" icon={mdiEarth} />, 'with icon'] });
|
|
69
|
+
// Spaces have been inserted around the icon.
|
|
70
|
+
expect(wrapper).toHaveText('Some text with icon');
|
|
71
|
+
});
|
|
58
72
|
});
|
|
59
73
|
|
|
60
74
|
// Common tests suite.
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
1
|
+
import React, { Children, Fragment, forwardRef } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { Comp, GenericProps,
|
|
3
|
+
import { Icon, ColorPalette, ColorVariant, Typography } from '@lumx/react';
|
|
4
|
+
import { Comp, GenericProps, TextElement, isComponent } from '@lumx/react/utils/type';
|
|
5
|
+
import {
|
|
6
|
+
getFontColorClassName,
|
|
7
|
+
getRootClassName,
|
|
8
|
+
handleBasicClasses,
|
|
9
|
+
getTypographyClassName,
|
|
10
|
+
} from '@lumx/react/utils/className';
|
|
5
11
|
import classNames from 'classnames';
|
|
6
12
|
|
|
7
|
-
type TextComponents = 'span' | 'p' | HeadingElement;
|
|
8
|
-
|
|
9
13
|
/**
|
|
10
14
|
* Defines the props of the component.
|
|
11
15
|
*/
|
|
@@ -13,7 +17,7 @@ export interface TextProps extends GenericProps {
|
|
|
13
17
|
/**
|
|
14
18
|
* Color variant.
|
|
15
19
|
*/
|
|
16
|
-
color?:
|
|
20
|
+
color?: ColorPalette;
|
|
17
21
|
/**
|
|
18
22
|
* Lightened or darkened variant of the selected color.
|
|
19
23
|
*/
|
|
@@ -25,13 +29,18 @@ export interface TextProps extends GenericProps {
|
|
|
25
29
|
/**
|
|
26
30
|
* Custom component to render the text.
|
|
27
31
|
*/
|
|
28
|
-
as:
|
|
32
|
+
as: TextElement;
|
|
29
33
|
/**
|
|
30
34
|
* Control whether the text should truncate or not.
|
|
31
35
|
* Setting as `true` will make the text truncate on a single line.
|
|
32
36
|
* Setting as `{ lines: number }` will make the text truncate on a multiple lines.
|
|
33
37
|
*/
|
|
34
38
|
truncate?: boolean | { lines: number };
|
|
39
|
+
/**
|
|
40
|
+
* Prevents text to wrap on multiple lines
|
|
41
|
+
* (automatically activated when single line text truncate is activated).
|
|
42
|
+
*/
|
|
43
|
+
noWrap?: boolean;
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
/**
|
|
@@ -57,11 +66,21 @@ const DEFAULT_PROPS = {} as const;
|
|
|
57
66
|
* @return React element.
|
|
58
67
|
*/
|
|
59
68
|
export const Text: Comp<TextProps> = forwardRef((props, ref) => {
|
|
60
|
-
const {
|
|
69
|
+
const {
|
|
70
|
+
as: Component,
|
|
71
|
+
children,
|
|
72
|
+
className,
|
|
73
|
+
color,
|
|
74
|
+
colorVariant,
|
|
75
|
+
noWrap,
|
|
76
|
+
typography,
|
|
77
|
+
truncate,
|
|
78
|
+
style,
|
|
79
|
+
...forwardedProps
|
|
80
|
+
} = props;
|
|
61
81
|
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const typographyClass = typography && `lumx-typography-${typography}`;
|
|
82
|
+
const colorClass = color && getFontColorClassName(color, colorVariant);
|
|
83
|
+
const typographyClass = typography && getTypographyClassName(typography);
|
|
65
84
|
|
|
66
85
|
// Truncate mode
|
|
67
86
|
const truncateLinesStyle = typeof truncate === 'object' &&
|
|
@@ -81,11 +100,18 @@ export const Text: Comp<TextProps> = forwardRef((props, ref) => {
|
|
|
81
100
|
}),
|
|
82
101
|
typographyClass,
|
|
83
102
|
colorClass,
|
|
103
|
+
noWrap && `${CLASSNAME}--no-wrap`,
|
|
84
104
|
)}
|
|
85
105
|
style={{ ...truncateLinesStyle, ...style }}
|
|
86
106
|
{...forwardedProps}
|
|
87
107
|
>
|
|
88
|
-
{children
|
|
108
|
+
{Children.toArray(children).map((child, index) => {
|
|
109
|
+
// Force wrap spaces around icons to make sure they are never stuck against text.
|
|
110
|
+
if (isComponent(Icon)(child)) {
|
|
111
|
+
return <Fragment key={child.key || index}> {child} </Fragment>;
|
|
112
|
+
}
|
|
113
|
+
return child;
|
|
114
|
+
})}
|
|
89
115
|
</Component>
|
|
90
116
|
);
|
|
91
117
|
});
|
|
@@ -5,7 +5,7 @@ import 'jest-enzyme';
|
|
|
5
5
|
import { build } from 'test-data-bot';
|
|
6
6
|
|
|
7
7
|
import { Wrapper, commonTestsSuite } 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 { Kind } from '@lumx/react';
|
|
11
11
|
import { TextField, TextFieldProps } from './TextField';
|
|
@@ -6,7 +6,8 @@ import { uid } from 'uid';
|
|
|
6
6
|
|
|
7
7
|
import { mdiAlertCircle, mdiCheckCircle, mdiCloseCircle } from '@lumx/icons';
|
|
8
8
|
import { Emphasis, Icon, IconButton, IconButtonProps, InputHelper, InputLabel, Kind, Size, 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
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -13,7 +13,8 @@ import classNames from 'classnames';
|
|
|
13
13
|
|
|
14
14
|
import { AspectRatio, HorizontalAlignment, Icon, Size, Theme } from '@lumx/react';
|
|
15
15
|
|
|
16
|
-
import { Comp, Falsy, GenericProps,
|
|
16
|
+
import { Comp, Falsy, GenericProps, HasTheme } from '@lumx/react/utils/type';
|
|
17
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
17
18
|
|
|
18
19
|
import { mdiImageBroken } from '@lumx/icons';
|
|
19
20
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AspectRatio, Size } from '@lumx/react';
|
|
3
|
-
import { ValueOf } from '@lumx/react/utils';
|
|
3
|
+
import { ValueOf } from '@lumx/react/utils/type';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Focal point using vertical alignment, horizontal alignment or coordinates (from -1 to 1).
|
|
@@ -2,7 +2,8 @@ import React, { forwardRef, ReactNode } 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, handleBasicClasses } from '@lumx/react/utils/className';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Defines the props of the component.
|
|
@@ -10,7 +10,8 @@ import { Placement } from '@lumx/react/components/popover/Popover';
|
|
|
10
10
|
|
|
11
11
|
import { DOCUMENT } from '@lumx/react/constants';
|
|
12
12
|
|
|
13
|
-
import { Comp, GenericProps
|
|
13
|
+
import { Comp, GenericProps } from '@lumx/react/utils/type';
|
|
14
|
+
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
|
|
14
15
|
import { mergeRefs } from '@lumx/react/utils/mergeRefs';
|
|
15
16
|
|
|
16
17
|
import { useInjectTooltipRef } from './useInjectTooltipRef';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onEscapePressed } from '@lumx/react/utils';
|
|
1
|
+
import { onEscapePressed } from '@lumx/react/utils/event';
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { browserDoesNotSupportHover } from '@lumx/react/utils/browserDoesNotSupportHover';
|
|
4
4
|
import { TOOLTIP_HOVER_DELAY, TOOLTIP_LONG_PRESS_DELAY } from '@lumx/react/constants';
|
|
@@ -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 { Uploader, UploaderProps } from './Uploader';
|
|
10
10
|
|
|
@@ -3,7 +3,8 @@ import React, { forwardRef, MouseEventHandler } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
import { AspectRatio, Icon, Size, Theme } 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
|
/**
|
|
9
10
|
* Uploader variants.
|
|
@@ -4,7 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
import set from 'lodash/set';
|
|
5
5
|
|
|
6
6
|
import { Avatar, ColorPalette, Link, Orientation, 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
|
import { AvatarProps } from '../avatar/Avatar';
|
|
10
11
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DOCUMENT } from '@lumx/react/constants';
|
|
2
|
-
import { Callback
|
|
2
|
+
import { Callback } from '@lumx/react/utils/type';
|
|
3
|
+
import { onEscapePressed } from '@lumx/react/utils/event';
|
|
3
4
|
import { useEffect } from 'react';
|
|
4
5
|
import { Listener, makeListenerTowerContext } from '@lumx/react/utils/makeListenerTowerContext';
|
|
5
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
|
|
3
|
-
import { Falsy } from '@lumx/react/utils';
|
|
3
|
+
import { Falsy } from '@lumx/react/utils/type';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Disables the scroll on the body to make it only usable in the current modal element.
|
|
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { DOCUMENT } from '@lumx/react/constants';
|
|
4
4
|
import { getFirstAndLastFocusable } from '@lumx/react/utils/focus/getFirstAndLastFocusable';
|
|
5
|
-
import { Falsy } from '@lumx/react/utils';
|
|
5
|
+
import { Falsy } from '@lumx/react/utils/type';
|
|
6
6
|
import { Listener, makeListenerTowerContext } from '@lumx/react/utils/makeListenerTowerContext';
|
|
7
7
|
|
|
8
8
|
const FOCUS_TRAPS = makeListenerTowerContext();
|
package/src/hooks/useOnResize.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Callback, Falsy } from '@lumx/react/utils';
|
|
1
|
+
import { Callback, Falsy } from '@lumx/react/utils/type';
|
|
2
2
|
import { MutableRefObject, RefObject, useEffect, useRef } from 'react';
|
|
3
3
|
import { WINDOW } from '@lumx/react/constants';
|
|
4
4
|
import { ResizeObserver as Polyfill } from '@juggle/resize-observer';
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Components listed here will be exposed to NPM in '@lumx/react'.
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export * from './components';
|
|
2
6
|
export * from './components/alert-dialog';
|
|
3
7
|
export * from './components/autocomplete';
|
|
@@ -20,6 +24,7 @@ export * from './components/heading';
|
|
|
20
24
|
export * from './components/grid';
|
|
21
25
|
export * from './components/icon';
|
|
22
26
|
export * from './components/image-block';
|
|
27
|
+
export * from './components/inline-list';
|
|
23
28
|
export * from './components/input-helper';
|
|
24
29
|
export * from './components/input-label';
|
|
25
30
|
export * from './components/lightbox';
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export default { title: 'LumX components/generic-block/GenericBlock Demos' };
|
|
5
5
|
|
|
6
|
-
export { App as
|
|
6
|
+
export { App as HorizontalAlignment } from './horizontal-alignment';
|
|
7
|
+
export { App as Sizes } from './sizes';
|
|
8
|
+
export { App as VerticalAlignment } from './vertical-alignment';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/** Storybook decorator wrapping story in a resizable box */
|
|
4
|
+
// eslint-disable-next-line react/display-name
|
|
5
|
+
export const withResizableBox = ({ width = 150, height = 50 } = {}) => (Story: any) => (
|
|
6
|
+
<div
|
|
7
|
+
style={{
|
|
8
|
+
display: 'flex',
|
|
9
|
+
width,
|
|
10
|
+
height,
|
|
11
|
+
border: '1px solid red',
|
|
12
|
+
resize: 'both',
|
|
13
|
+
overflow: 'hidden',
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
@@ -4,7 +4,7 @@ import 'jest-enzyme';
|
|
|
4
4
|
import isArray from 'lodash/isArray';
|
|
5
5
|
import isEmpty from 'lodash/isEmpty';
|
|
6
6
|
|
|
7
|
-
import { GenericProps } from '@lumx/react/utils';
|
|
7
|
+
import { GenericProps } from '@lumx/react/utils/type';
|
|
8
8
|
|
|
9
9
|
export type Wrapper = ShallowWrapper | ReactWrapper;
|
|
10
10
|
|