@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
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CSS_PREFIX } from '@lumx/react/constants';
|
|
2
2
|
|
|
3
3
|
import kebabCase from 'lodash/kebabCase';
|
|
4
|
+
import { ColorPalette, ColorVariant, Typography } from '@lumx/react/components';
|
|
4
5
|
|
|
5
6
|
// See https://regex101.com/r/YjS1uI/3
|
|
6
7
|
const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
|
|
7
8
|
|
|
9
|
+
export { getBasicClass, handleBasicClasses } from '@lumx/core/js/utils';
|
|
10
|
+
|
|
8
11
|
/**
|
|
9
12
|
* Get the name of the root CSS class of a component based on its name.
|
|
10
13
|
*
|
|
@@ -23,3 +26,19 @@ export function getRootClassName(componentName: string, subComponent?: boolean):
|
|
|
23
26
|
}
|
|
24
27
|
return formattedClassName;
|
|
25
28
|
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns the classname associated to the given color and variant.
|
|
32
|
+
* For example, for 'dark' and 'L2' it returns `lumx-color-font-dark-l2`
|
|
33
|
+
*/
|
|
34
|
+
export const getFontColorClassName = (color: ColorPalette, colorVariant: ColorVariant = ColorVariant.N) => {
|
|
35
|
+
return `lumx-color-font-${color}-${colorVariant}`;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns the classname associated to the given typography.
|
|
40
|
+
* For example, for `Typography.title` it returns `lumx-typography-title`
|
|
41
|
+
*/
|
|
42
|
+
export const getTypographyClassName = (typography: Typography) => {
|
|
43
|
+
return `lumx-typography-${typography}`;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { onEnterPressed, onButtonPressed, onEscapePressed } from '@lumx/core/js/utils';
|
package/src/utils/type.ts
CHANGED
|
@@ -35,6 +35,9 @@ export type Comp<P, T = HTMLElement> = {
|
|
|
35
35
|
/** Union type of all heading elements */
|
|
36
36
|
export type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
37
37
|
|
|
38
|
+
/** Union type of all text elements */
|
|
39
|
+
export type TextElement = 'span' | 'p' | HeadingElement;
|
|
40
|
+
|
|
38
41
|
export interface HasTheme {
|
|
39
42
|
/**
|
|
40
43
|
* Theme adapting the component to light or dark background.
|
package/src/utils/utils.test.ts
CHANGED
package/types.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export declare type Comp<P, T = HTMLElement> = {
|
|
|
27
27
|
};
|
|
28
28
|
/** Union type of all heading elements */
|
|
29
29
|
export declare type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
30
|
+
/** Union type of all text elements */
|
|
31
|
+
export declare type TextElement = "span" | "p" | HeadingElement;
|
|
30
32
|
export interface HasTheme {
|
|
31
33
|
/**
|
|
32
34
|
* Theme adapting the component to light or dark background.
|
|
@@ -871,10 +873,6 @@ export declare const Dialog: Comp<DialogProps, HTMLDivElement>;
|
|
|
871
873
|
*/
|
|
872
874
|
export interface DividerProps extends GenericProps, HasTheme {
|
|
873
875
|
}
|
|
874
|
-
/**
|
|
875
|
-
* Component default props.
|
|
876
|
-
*/
|
|
877
|
-
export declare const DEFAULT_PROPS: Partial<DividerProps>;
|
|
878
876
|
/**
|
|
879
877
|
* Divider component.
|
|
880
878
|
*
|
|
@@ -1108,6 +1106,8 @@ export declare type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignme
|
|
|
1108
1106
|
* Defines the props of the component.
|
|
1109
1107
|
*/
|
|
1110
1108
|
export interface FlexBoxProps extends GenericProps {
|
|
1109
|
+
/** Customize the root element. */
|
|
1110
|
+
as?: React.ElementType;
|
|
1111
1111
|
/** Children elements. */
|
|
1112
1112
|
children?: ReactNode;
|
|
1113
1113
|
/** Whether the "content filling space" is enabled or not. */
|
|
@@ -1135,6 +1135,24 @@ export interface FlexBoxProps extends GenericProps {
|
|
|
1135
1135
|
* @return React element.
|
|
1136
1136
|
*/
|
|
1137
1137
|
export declare const FlexBox: Comp<FlexBoxProps, HTMLDivElement>;
|
|
1138
|
+
/**
|
|
1139
|
+
* Accepted gap sizes for the generic block.
|
|
1140
|
+
*/
|
|
1141
|
+
export declare const GenericBlockGapSize: Pick<{
|
|
1142
|
+
readonly xxs: "xxs";
|
|
1143
|
+
readonly xs: "xs";
|
|
1144
|
+
readonly s: "s";
|
|
1145
|
+
readonly m: "m";
|
|
1146
|
+
readonly l: "l";
|
|
1147
|
+
readonly xl: "xl";
|
|
1148
|
+
readonly xxl: "xxl";
|
|
1149
|
+
readonly tiny: "tiny";
|
|
1150
|
+
readonly regular: "regular";
|
|
1151
|
+
readonly medium: "medium";
|
|
1152
|
+
readonly big: "big";
|
|
1153
|
+
readonly huge: "huge";
|
|
1154
|
+
}, "tiny" | "regular" | "medium" | "big" | "huge">;
|
|
1155
|
+
export declare type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;
|
|
1138
1156
|
export interface GenericBlockProps extends FlexBoxProps {
|
|
1139
1157
|
/**
|
|
1140
1158
|
* Component to use as visual element.
|
|
@@ -1174,28 +1192,37 @@ export interface GenericBlockProps extends FlexBoxProps {
|
|
|
1174
1192
|
* props to forward to the figure element.
|
|
1175
1193
|
*/
|
|
1176
1194
|
figureProps?: Omit<FlexBoxProps, "children">;
|
|
1195
|
+
/**
|
|
1196
|
+
* Gap space between sections.
|
|
1197
|
+
*/
|
|
1198
|
+
gap?: GenericBlockGapSize;
|
|
1177
1199
|
}
|
|
1178
1200
|
export declare type BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;
|
|
1201
|
+
export interface GenericBlockSectionProps extends FlexBoxProps {
|
|
1202
|
+
/**
|
|
1203
|
+
* Gap space between items.
|
|
1204
|
+
*/
|
|
1205
|
+
gap?: GenericBlockGapSize;
|
|
1206
|
+
}
|
|
1179
1207
|
export interface GenericBlock extends BaseGenericBlock {
|
|
1180
1208
|
/**
|
|
1181
1209
|
* Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject
|
|
1182
1210
|
* the "figure" section of the block (instead of using `figure` and `figureProps` props).
|
|
1183
1211
|
*/
|
|
1184
|
-
Figure: Comp<
|
|
1212
|
+
Figure: Comp<GenericBlockSectionProps>;
|
|
1185
1213
|
/**
|
|
1186
1214
|
* Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject
|
|
1187
1215
|
* the "content" section of the block (instead of using `content` and `contentProps` props).
|
|
1188
1216
|
*/
|
|
1189
|
-
Content: Comp<
|
|
1217
|
+
Content: Comp<GenericBlockSectionProps>;
|
|
1190
1218
|
/**
|
|
1191
1219
|
* Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject
|
|
1192
1220
|
* the "actions" section of the block (instead of using `actions` and `actionsProps` props).
|
|
1193
1221
|
*/
|
|
1194
|
-
Actions: Comp<
|
|
1222
|
+
Actions: Comp<GenericBlockSectionProps>;
|
|
1195
1223
|
}
|
|
1196
1224
|
declare const BaseGenericBlock: BaseGenericBlock;
|
|
1197
1225
|
export declare const GenericBlock: GenericBlock;
|
|
1198
|
-
export declare type TextComponents = "span" | "p" | HeadingElement;
|
|
1199
1226
|
/**
|
|
1200
1227
|
* Defines the props of the component.
|
|
1201
1228
|
*/
|
|
@@ -1203,7 +1230,7 @@ export interface TextProps extends GenericProps {
|
|
|
1203
1230
|
/**
|
|
1204
1231
|
* Color variant.
|
|
1205
1232
|
*/
|
|
1206
|
-
color?:
|
|
1233
|
+
color?: ColorPalette;
|
|
1207
1234
|
/**
|
|
1208
1235
|
* Lightened or darkened variant of the selected color.
|
|
1209
1236
|
*/
|
|
@@ -1215,7 +1242,7 @@ export interface TextProps extends GenericProps {
|
|
|
1215
1242
|
/**
|
|
1216
1243
|
* Custom component to render the text.
|
|
1217
1244
|
*/
|
|
1218
|
-
as:
|
|
1245
|
+
as: TextElement;
|
|
1219
1246
|
/**
|
|
1220
1247
|
* Control whether the text should truncate or not.
|
|
1221
1248
|
* Setting as `true` will make the text truncate on a single line.
|
|
@@ -1224,6 +1251,11 @@ export interface TextProps extends GenericProps {
|
|
|
1224
1251
|
truncate?: boolean | {
|
|
1225
1252
|
lines: number;
|
|
1226
1253
|
};
|
|
1254
|
+
/**
|
|
1255
|
+
* Prevents text to wrap on multiple lines
|
|
1256
|
+
* (automatically activated when single line text truncate is activated).
|
|
1257
|
+
*/
|
|
1258
|
+
noWrap?: boolean;
|
|
1227
1259
|
}
|
|
1228
1260
|
/**
|
|
1229
1261
|
* Text component.
|
|
@@ -1260,7 +1292,7 @@ export interface HeadingLevelProviderProps {
|
|
|
1260
1292
|
export declare const HeadingLevelProvider: React.FC<HeadingLevelProviderProps>;
|
|
1261
1293
|
export declare const useHeadingLevel: () => {
|
|
1262
1294
|
level: number;
|
|
1263
|
-
headingElement: import("../../utils").HeadingElement;
|
|
1295
|
+
headingElement: import("../../utils/type").HeadingElement;
|
|
1264
1296
|
};
|
|
1265
1297
|
export declare type GridGutterSize = Extract<Size, "regular" | "big" | "huge">;
|
|
1266
1298
|
/**
|
|
@@ -1462,6 +1494,31 @@ export interface ImageBlockProps extends GenericProps, HasTheme {
|
|
|
1462
1494
|
* @return React element.
|
|
1463
1495
|
*/
|
|
1464
1496
|
export declare const ImageBlock: Comp<ImageBlockProps, HTMLDivElement>;
|
|
1497
|
+
/**
|
|
1498
|
+
* Defines the props of the component.
|
|
1499
|
+
*/
|
|
1500
|
+
export interface InlineListProps extends GenericProps {
|
|
1501
|
+
/**
|
|
1502
|
+
* Text color.
|
|
1503
|
+
*/
|
|
1504
|
+
color?: ColorPalette;
|
|
1505
|
+
/**
|
|
1506
|
+
* Lightened or darkened variant of the selected color.
|
|
1507
|
+
*/
|
|
1508
|
+
colorVariant?: ColorVariant;
|
|
1509
|
+
/**
|
|
1510
|
+
* Typography variant.
|
|
1511
|
+
*/
|
|
1512
|
+
typography?: Typography;
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* InlineList component.
|
|
1516
|
+
*
|
|
1517
|
+
* @param props Component props.
|
|
1518
|
+
* @param ref Component ref.
|
|
1519
|
+
* @return React element.
|
|
1520
|
+
*/
|
|
1521
|
+
export declare const InlineList: Comp<InlineListProps>;
|
|
1465
1522
|
/**
|
|
1466
1523
|
* Defines the props of the component.
|
|
1467
1524
|
*/
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { F as Falsy } from '../_internal/types.js';
|
|
3
|
+
|
|
4
|
+
interface ClickAwayParameters {
|
|
5
|
+
/**
|
|
6
|
+
* A callback function to call when the user clicks away from the elements.
|
|
7
|
+
*/
|
|
8
|
+
callback: EventListener | Falsy;
|
|
9
|
+
/**
|
|
10
|
+
* Elements considered within the click away context (clicking outside them will trigger the click away callback).
|
|
11
|
+
*/
|
|
12
|
+
childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface ClickAwayProviderProps extends ClickAwayParameters {
|
|
16
|
+
/**
|
|
17
|
+
* (Optional) Element that should be considered as part of the parent
|
|
18
|
+
*/
|
|
19
|
+
parentRef?: RefObject<HTMLElement>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure
|
|
23
|
+
* we take into account both the DOM tree and the React tree to detect click away.
|
|
24
|
+
*
|
|
25
|
+
* @return the react component.
|
|
26
|
+
*/
|
|
27
|
+
declare const ClickAwayProvider: React.FC<ClickAwayProviderProps>;
|
|
28
|
+
|
|
29
|
+
export { ClickAwayProvider };
|
package/utils/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { a as _defineProperty, b as _objectWithoutProperties, c as _extends, _ as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { Size, Emphasis, ColorPalette, Kind } from './components.js';
|
|
3
|
-
import React, { forwardRef } from 'react';
|
|
4
|
-
import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './getRootClassName.js';
|
|
5
|
-
import { I as Icon, m as mdiAlert, a as mdiInformation, b as mdiCheckCircle, c as mdiAlertCircle } from './Icon2.js';
|
|
6
|
-
import { u as uid } from '../index2.js';
|
|
7
|
-
import { a as Button } from './Button2.js';
|
|
8
|
-
import { D as Dialog } from './Dialog2.js';
|
|
9
|
-
import { T as Toolbar } from './Toolbar2.js';
|
|
10
|
-
|
|
11
|
-
var _CONFIG;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Associative map from message kind to color and icon.
|
|
15
|
-
*/
|
|
16
|
-
var CONFIG = (_CONFIG = {}, _defineProperty(_CONFIG, Kind.error, {
|
|
17
|
-
color: ColorPalette.red,
|
|
18
|
-
icon: mdiAlert
|
|
19
|
-
}), _defineProperty(_CONFIG, Kind.info, {
|
|
20
|
-
color: ColorPalette.blue,
|
|
21
|
-
icon: mdiInformation
|
|
22
|
-
}), _defineProperty(_CONFIG, Kind.success, {
|
|
23
|
-
color: ColorPalette.green,
|
|
24
|
-
icon: mdiCheckCircle
|
|
25
|
-
}), _defineProperty(_CONFIG, Kind.warning, {
|
|
26
|
-
color: ColorPalette.yellow,
|
|
27
|
-
icon: mdiAlertCircle
|
|
28
|
-
}), _CONFIG);
|
|
29
|
-
/**
|
|
30
|
-
* Component display name.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
var COMPONENT_NAME = 'AlertDialog';
|
|
34
|
-
/**
|
|
35
|
-
* Component default class name and class prefix.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
var CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
39
|
-
/**
|
|
40
|
-
* Component default props.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
var DEFAULT_PROPS = {
|
|
44
|
-
size: Size.tiny,
|
|
45
|
-
kind: Kind.info
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* AlertDialog component.
|
|
49
|
-
*
|
|
50
|
-
* An alert dialog is a modal dialog that interrupts the user's workflow to
|
|
51
|
-
* communicate an important message and acquire a response.
|
|
52
|
-
*
|
|
53
|
-
* It should not have a complex content.
|
|
54
|
-
* Children of this component should only be strings, paragraphs or links.
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
var AlertDialog = forwardRef(function (props, ref) {
|
|
58
|
-
var id = props.id,
|
|
59
|
-
title = props.title,
|
|
60
|
-
className = props.className,
|
|
61
|
-
cancelProps = props.cancelProps,
|
|
62
|
-
confirmProps = props.confirmProps,
|
|
63
|
-
kind = props.kind,
|
|
64
|
-
size = props.size,
|
|
65
|
-
dialogProps = props.dialogProps,
|
|
66
|
-
children = props.children,
|
|
67
|
-
forwardedProps = _objectWithoutProperties(props, ["id", "title", "className", "cancelProps", "confirmProps", "kind", "size", "dialogProps", "children"]);
|
|
68
|
-
|
|
69
|
-
var cancelButtonRef = React.useRef(null);
|
|
70
|
-
var confirmationButtonRef = React.useRef(null);
|
|
71
|
-
|
|
72
|
-
var _ref = CONFIG[kind] || {},
|
|
73
|
-
color = _ref.color,
|
|
74
|
-
icon = _ref.icon; // Define a unique ID to target title and description for aria attributes.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var uniqueId = React.useMemo(function () {
|
|
78
|
-
return id || uid();
|
|
79
|
-
}, [id]);
|
|
80
|
-
var titleId = "".concat(uniqueId, "-title");
|
|
81
|
-
var descriptionId = "".concat(uniqueId, "-description"); // If content is a string, set in a paragraph.
|
|
82
|
-
|
|
83
|
-
var DescriptionElement = typeof children === 'string' ? 'p' : 'div';
|
|
84
|
-
|
|
85
|
-
var confirmLabel = confirmProps.label,
|
|
86
|
-
confirmOnClick = confirmProps.onClick,
|
|
87
|
-
forwardedConfirmProps = _objectWithoutProperties(confirmProps, ["label", "onClick"]);
|
|
88
|
-
|
|
89
|
-
var _ref2 = cancelProps || {},
|
|
90
|
-
cancelLabel = _ref2.label,
|
|
91
|
-
cancelOnClick = _ref2.onClick,
|
|
92
|
-
forwardedCancelProps = _objectWithoutProperties(_ref2, ["label", "onClick"]);
|
|
93
|
-
|
|
94
|
-
return React.createElement(Dialog, _extends({
|
|
95
|
-
ref: ref,
|
|
96
|
-
focusElement: cancelProps ? cancelButtonRef : confirmationButtonRef,
|
|
97
|
-
size: size,
|
|
98
|
-
dialogProps: _objectSpread2({
|
|
99
|
-
id: uniqueId,
|
|
100
|
-
role: 'alertdialog',
|
|
101
|
-
'aria-labelledby': titleId,
|
|
102
|
-
'aria-describedby': descriptionId
|
|
103
|
-
}, dialogProps),
|
|
104
|
-
className: classnames(className, handleBasicClasses({
|
|
105
|
-
kind: kind,
|
|
106
|
-
prefix: CLASSNAME
|
|
107
|
-
}))
|
|
108
|
-
}, forwardedProps), React.createElement("header", null, React.createElement(Toolbar, {
|
|
109
|
-
className: "lumx-spacing-margin-horizontal",
|
|
110
|
-
before: React.createElement(Icon, {
|
|
111
|
-
icon: icon,
|
|
112
|
-
size: Size.s,
|
|
113
|
-
color: color
|
|
114
|
-
}),
|
|
115
|
-
label: React.createElement("h2", {
|
|
116
|
-
id: titleId,
|
|
117
|
-
className: "lumx-typography-title"
|
|
118
|
-
}, title)
|
|
119
|
-
})), children && React.createElement(DescriptionElement, {
|
|
120
|
-
id: descriptionId,
|
|
121
|
-
className: "lumx-typography-body2 lumx-spacing-padding-vertical-big lumx-spacing-padding-horizontal-huge"
|
|
122
|
-
}, children), React.createElement("footer", null, React.createElement(Toolbar, {
|
|
123
|
-
className: "lumx-spacing-margin-horizontal",
|
|
124
|
-
after: React.createElement(React.Fragment, null, cancelProps && React.createElement(Button, _extends({}, forwardedCancelProps, {
|
|
125
|
-
ref: cancelButtonRef,
|
|
126
|
-
emphasis: Emphasis.medium,
|
|
127
|
-
onClick: cancelOnClick
|
|
128
|
-
}), cancelLabel), React.createElement(Button, _extends({}, forwardedConfirmProps, {
|
|
129
|
-
ref: confirmationButtonRef,
|
|
130
|
-
color: color,
|
|
131
|
-
className: "lumx-spacing-margin-left-regular",
|
|
132
|
-
onClick: confirmOnClick
|
|
133
|
-
}), confirmLabel))
|
|
134
|
-
})));
|
|
135
|
-
});
|
|
136
|
-
AlertDialog.displayName = COMPONENT_NAME;
|
|
137
|
-
AlertDialog.className = CLASSNAME;
|
|
138
|
-
AlertDialog.defaultProps = DEFAULT_PROPS;
|
|
139
|
-
|
|
140
|
-
export { AlertDialog as A };
|
|
141
|
-
//# sourceMappingURL=AlertDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.js","sources":["../../../src/components/alert-dialog/AlertDialog.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n DialogProps,\n Dialog,\n Button,\n Emphasis,\n ColorPalette,\n Icon,\n Size,\n Kind,\n Toolbar,\n ButtonProps,\n} from '@lumx/react';\n\nimport { mdiAlert, mdiAlertCircle, mdiCheckCircle, mdiInformation } from '@lumx/icons/';\nimport { uid } from 'uid';\nimport { Comp, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\nexport interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {\n /** Message variant. */\n kind?: Kind;\n /** Dialog title. */\n title?: string;\n /** Props forwarded to the confirm button */\n confirmProps: ButtonProps & {\n onClick(): void;\n label: string;\n };\n /**\n * Props forwarded to the cancel button.\n * Will not render a cancel button if undefined.\n */\n cancelProps?: ButtonProps & {\n onClick(): void;\n label: string;\n };\n}\n\n/**\n * Associative map from message kind to color and icon.\n */\nconst CONFIG = {\n [Kind.error]: { color: ColorPalette.red, icon: mdiAlert },\n [Kind.info]: { color: ColorPalette.blue, icon: mdiInformation },\n [Kind.success]: { color: ColorPalette.green, icon: mdiCheckCircle },\n [Kind.warning]: { color: ColorPalette.yellow, icon: mdiAlertCircle },\n};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'AlertDialog';\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<DialogProps> = {\n size: Size.tiny,\n kind: Kind.info,\n};\n\n/**\n * AlertDialog component.\n *\n * An alert dialog is a modal dialog that interrupts the user's workflow to\n * communicate an important message and acquire a response.\n *\n * It should not have a complex content.\n * Children of this component should only be strings, paragraphs or links.\n */\nexport const AlertDialog: Comp<AlertDialogProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n id,\n title,\n className,\n cancelProps,\n confirmProps,\n kind,\n size,\n dialogProps,\n children,\n ...forwardedProps\n } = props;\n\n const cancelButtonRef = React.useRef(null);\n const confirmationButtonRef = React.useRef(null);\n const { color, icon } = CONFIG[kind as Kind] || {};\n\n // Define a unique ID to target title and description for aria attributes.\n const uniqueId = React.useMemo(() => id || uid(), [id]);\n const titleId = `${uniqueId}-title`;\n const descriptionId = `${uniqueId}-description`;\n\n // If content is a string, set in a paragraph.\n const DescriptionElement = typeof children === 'string' ? 'p' : 'div';\n\n const { label: confirmLabel, onClick: confirmOnClick, ...forwardedConfirmProps } = confirmProps;\n const { label: cancelLabel, onClick: cancelOnClick, ...forwardedCancelProps } = cancelProps || {};\n\n return (\n <Dialog\n ref={ref}\n focusElement={cancelProps ? cancelButtonRef : confirmationButtonRef}\n size={size}\n dialogProps={{\n id: uniqueId,\n role: 'alertdialog',\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n ...dialogProps,\n }}\n className={classNames(\n className,\n handleBasicClasses({\n kind,\n prefix: CLASSNAME,\n }),\n )}\n {...forwardedProps}\n >\n <header>\n <Toolbar\n className=\"lumx-spacing-margin-horizontal\"\n before={<Icon icon={icon} size={Size.s} color={color} />}\n label={\n <h2 id={titleId} className=\"lumx-typography-title\">\n {title}\n </h2>\n }\n />\n </header>\n\n {children && (\n <DescriptionElement\n id={descriptionId}\n className=\"lumx-typography-body2 lumx-spacing-padding-vertical-big lumx-spacing-padding-horizontal-huge\"\n >\n {children}\n </DescriptionElement>\n )}\n\n <footer>\n <Toolbar\n className=\"lumx-spacing-margin-horizontal\"\n after={\n <>\n {cancelProps && (\n <Button\n {...forwardedCancelProps}\n ref={cancelButtonRef}\n emphasis={Emphasis.medium}\n onClick={cancelOnClick}\n >\n {cancelLabel}\n </Button>\n )}\n <Button\n {...forwardedConfirmProps}\n ref={confirmationButtonRef}\n color={color}\n className=\"lumx-spacing-margin-left-regular\"\n onClick={confirmOnClick}\n >\n {confirmLabel}\n </Button>\n </>\n }\n />\n </footer>\n </Dialog>\n );\n});\n\nAlertDialog.displayName = COMPONENT_NAME;\nAlertDialog.className = CLASSNAME;\nAlertDialog.defaultProps = DEFAULT_PROPS;\n"],"names":["CONFIG","Kind","error","color","ColorPalette","red","icon","mdiAlert","info","blue","mdiInformation","success","green","mdiCheckCircle","warning","yellow","mdiAlertCircle","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","size","Size","tiny","kind","AlertDialog","forwardRef","props","ref","id","title","className","cancelProps","confirmProps","dialogProps","children","forwardedProps","cancelButtonRef","React","useRef","confirmationButtonRef","uniqueId","useMemo","uid","titleId","descriptionId","DescriptionElement","confirmLabel","label","confirmOnClick","onClick","forwardedConfirmProps","cancelLabel","cancelOnClick","forwardedCancelProps","role","classNames","handleBasicClasses","prefix","s","Emphasis","medium","displayName","defaultProps"],"mappings":";;;;;;;;;;;;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