@lumx/react 3.10.1-alpha.6 → 3.10.1-alpha.8
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/index.d.ts +86 -12
- package/index.js +299 -296
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/alert-dialog/AlertDialog.tsx +6 -3
- package/src/components/autocomplete/Autocomplete.stories.tsx +1 -2
- package/src/components/autocomplete/Autocomplete.tsx +3 -3
- package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +2 -5
- package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -2
- package/src/components/avatar/Avatar.tsx +3 -3
- package/src/components/badge/Badge.tsx +3 -3
- package/src/components/badge/BadgeWrapper.tsx +3 -2
- package/src/components/button/Button.tsx +9 -8
- package/src/components/button/ButtonGroup.tsx +9 -3
- package/src/components/button/ButtonRoot.tsx +6 -2
- package/src/components/button/IconButton.tsx +2 -2
- package/src/components/checkbox/Checkbox.tsx +4 -4
- package/src/components/chip/Chip.tsx +15 -9
- package/src/components/chip/ChipGroup.tsx +3 -2
- package/src/components/comment-block/CommentBlock.stories.tsx +4 -7
- package/src/components/comment-block/CommentBlock.tsx +3 -3
- package/src/components/date-picker/constants.ts +2 -2
- package/src/components/dialog/Dialog.tsx +9 -7
- package/src/components/divider/Divider.tsx +3 -3
- package/src/components/drag-handle/DragHandle.tsx +3 -3
- package/src/components/dropdown/Dropdown.tsx +4 -3
- package/src/components/expansion-panel/ExpansionPanel.tsx +26 -20
- package/src/components/flag/Flag.tsx +3 -3
- package/src/components/flex-box/FlexBox.tsx +4 -4
- package/src/components/generic-block/GenericBlock.tsx +10 -8
- package/src/components/generic-block/constants.ts +4 -9
- package/src/components/grid/Grid.tsx +5 -3
- package/src/components/grid/GridItem.tsx +5 -3
- package/src/components/grid-column/GridColumn.tsx +5 -3
- package/src/components/heading/Heading.tsx +7 -2
- package/src/components/icon/Icon.tsx +3 -3
- package/src/components/image-block/ImageBlock.tsx +3 -3
- package/src/components/image-lightbox/ImageLightbox.tsx +1 -1
- package/src/components/image-lightbox/constants.ts +2 -2
- package/src/components/image-lightbox/internal/ImageSlide.tsx +1 -1
- package/src/components/image-lightbox/internal/ImageSlideshow.tsx +9 -5
- package/src/components/image-lightbox/useImageLightbox.tsx +2 -1
- package/src/components/inline-list/InlineList.tsx +7 -3
- package/src/components/input-helper/InputHelper.tsx +3 -3
- package/src/components/input-label/InputLabel.tsx +3 -3
- package/src/components/lightbox/Lightbox.tsx +6 -4
- package/src/components/link/Link.tsx +11 -7
- package/src/components/link-preview/LinkPreview.tsx +3 -3
- package/src/components/list/List.tsx +4 -4
- package/src/components/list/ListDivider.tsx +3 -2
- package/src/components/list/ListItem.tsx +6 -5
- package/src/components/list/ListSubheader.tsx +3 -2
- package/src/components/list/useInteractiveList.tsx +7 -6
- package/src/components/message/Message.tsx +3 -3
- package/src/components/mosaic/Mosaic.test.tsx +3 -3
- package/src/components/mosaic/Mosaic.tsx +6 -5
- package/src/components/navigation/Navigation.stories.tsx +2 -2
- package/src/components/navigation/Navigation.tsx +3 -3
- package/src/components/navigation/NavigationItem.tsx +3 -9
- package/src/components/navigation/NavigationSection.tsx +3 -3
- package/src/components/notification/Notification.tsx +9 -5
- package/src/components/popover/Popover.stories.tsx +13 -15
- package/src/components/popover/Popover.test.tsx +6 -1
- package/src/components/popover/Popover.tsx +6 -6
- package/src/components/popover/usePopoverStyle.tsx +1 -3
- package/src/components/popover/useRestoreFocusOnClose.tsx +1 -1
- package/src/components/popover-dialog/PopoverDialog.tsx +3 -2
- package/src/components/post-block/PostBlock.tsx +11 -7
- package/src/components/progress/Progress.tsx +3 -3
- package/src/components/progress/ProgressCircular.tsx +3 -3
- package/src/components/progress/ProgressLinear.tsx +3 -3
- package/src/components/progress-tracker/ProgressTracker.stories.tsx +11 -11
- package/src/components/progress-tracker/ProgressTracker.tsx +4 -3
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +3 -3
- package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +2 -0
- package/src/components/radio-button/RadioButton.tsx +3 -3
- package/src/components/radio-button/RadioGroup.stories.tsx +1 -4
- package/src/components/radio-button/RadioGroup.tsx +3 -2
- package/src/components/select/Select.stories.tsx +19 -38
- package/src/components/select/Select.tsx +5 -5
- package/src/components/select/SelectMultiple.stories.tsx +15 -30
- package/src/components/select/SelectMultiple.tsx +3 -4
- package/src/components/select/WithSelectContext.tsx +3 -4
- package/src/components/select/constants.ts +3 -1
- package/src/components/side-navigation/SideNavigation.stories.tsx +1 -1
- package/src/components/side-navigation/SideNavigation.tsx +4 -3
- package/src/components/side-navigation/SideNavigationItem.tsx +7 -7
- package/src/components/skeleton/SkeletonCircle.tsx +3 -3
- package/src/components/skeleton/SkeletonRectangle.tsx +3 -3
- package/src/components/skeleton/SkeletonTypography.stories.tsx +7 -12
- package/src/components/skeleton/SkeletonTypography.tsx +3 -3
- package/src/components/slider/Slider.tsx +4 -4
- package/src/components/slider/index.ts +1 -1
- package/src/components/slideshow/Slides.tsx +6 -4
- package/src/components/slideshow/Slideshow.stories.tsx +1 -3
- package/src/components/slideshow/Slideshow.tsx +3 -1
- package/src/components/slideshow/SlideshowControls.stories.tsx +1 -4
- package/src/components/slideshow/SlideshowControls.tsx +4 -4
- package/src/components/slideshow/SlideshowItem.tsx +5 -2
- package/src/components/slideshow/SlideshowItemGroup.tsx +5 -3
- package/src/components/switch/Switch.test.tsx +1 -1
- package/src/components/switch/Switch.tsx +7 -4
- package/src/components/table/Table.tsx +5 -3
- package/src/components/table/TableBody.tsx +7 -3
- package/src/components/table/TableCell.tsx +5 -3
- package/src/components/table/TableHeader.tsx +7 -3
- package/src/components/table/TableRow.tsx +5 -3
- package/src/components/tabs/TabList.tsx +1 -1
- package/src/components/tabs/TabPanel.tsx +2 -0
- package/src/components/tabs/Tabs.stories.tsx +12 -11
- package/src/components/text/Text.tsx +14 -5
- package/src/components/text-field/TextField.test.tsx +2 -2
- package/src/components/text-field/TextField.tsx +8 -7
- package/src/components/thumbnail/Thumbnail.tsx +4 -4
- package/src/components/toolbar/Toolbar.tsx +3 -3
- package/src/components/tooltip/Tooltip.tsx +4 -4
- package/src/components/tooltip/context.tsx +1 -1
- package/src/components/tooltip/useInjectTooltipRef.tsx +1 -1
- package/src/components/uploader/Uploader.tsx +3 -3
- package/src/components/user-block/UserBlock.tsx +12 -10
- package/src/hooks/useCallbackOnEscape.ts +1 -1
- package/src/hooks/useClickAway.tsx +2 -1
- package/src/hooks/useFocusTrap.ts +1 -1
- package/src/hooks/useInterval.tsx +4 -1
- package/src/hooks/useKeyboardListNavigation.tsx +4 -2
- package/src/hooks/useSizeOnWindowResize.ts +10 -14
- package/src/hooks/useStopPropagation.ts +2 -1
- package/src/stories/decorators/withCombinations.tsx +1 -1
- package/src/testing/utils/commonTestsSuiteRTL.tsx +2 -2
- package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +4 -0
- package/src/utils/className/getRootClassName.test.ts +11 -0
- package/src/utils/className/getRootClassName.ts +24 -0
- package/src/utils/className/index.ts +1 -0
- package/src/utils/date/getMonthCalendar.ts +4 -3
- package/src/utils/{makeListenerTowerContext.ts → function/makeListenerTowerContext.ts} +2 -2
- package/src/utils/{collection/partitionMulti.ts → partitionMulti.ts} +12 -13
- package/src/utils/{flattenChildren.ts → react/flattenChildren.ts} +3 -2
- package/src/utils/{renderButtonOrLink.tsx → react/renderButtonOrLink.tsx} +1 -1
- package/src/utils/{skipRender.tsx → react/skipRender.tsx} +1 -1
- package/src/utils/type/index.ts +18 -18
- package/src/utils/type/isComponent.ts +33 -0
- package/utils/index.d.ts +4 -0
- package/utils/index.js +96 -1
- package/utils/index.js.map +1 -1
- package/_internal/index.js +0 -99
- package/_internal/index.js.map +0 -1
- package/src/utils/collection/castArray.test.ts +0 -15
- package/src/utils/collection/castArray.ts +0 -3
- package/src/utils/collection/chunk.test.ts +0 -15
- package/src/utils/collection/chunk.ts +0 -6
- package/src/utils/collection/isEmpty.test.js +0 -20
- package/src/utils/collection/isEmpty.ts +0 -4
- package/src/utils/collection/last.ts +0 -2
- package/src/utils/collection/partitionMulti.test.ts +0 -35
- package/src/utils/collection/pull.test.ts +0 -17
- package/src/utils/collection/pull.ts +0 -7
- package/src/utils/collection/range.test.js +0 -9
- package/src/utils/collection/range.ts +0 -2
- package/src/utils/function/memoize.test.ts +0 -36
- package/src/utils/function/memoize.ts +0 -13
- package/src/utils/type/ComponentClassName.ts +0 -7
- package/src/utils/type/KebabCase.ts +0 -6
- /package/src/utils/{clamp.ts → number/clamp.ts} +0 -0
- /package/src/utils/{OnBeforeUnmount.tsx → react/OnBeforeUnmount.tsx} +0 -0
- /package/src/utils/{mergeRefs.ts → react/mergeRefs.ts} +0 -0
- /package/src/utils/{renderLink.tsx → react/renderLink.tsx} +0 -0
package/index.js
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useState, useEffect, useMemo, useRef, Children, isValidElement, cloneElement, useLayoutEffect, useCallback, Fragment, createContext, useContext, useReducer } from 'react';
|
|
3
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
|
+
import kebabCase from 'lodash/kebabCase';
|
|
6
|
+
import noop from 'lodash/noop';
|
|
4
7
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
5
|
-
import
|
|
8
|
+
import last from 'lodash/last';
|
|
9
|
+
import pull from 'lodash/pull';
|
|
10
|
+
import get from 'lodash/get';
|
|
11
|
+
import concat from 'lodash/concat';
|
|
12
|
+
import dropRight from 'lodash/dropRight';
|
|
13
|
+
import partition from 'lodash/partition';
|
|
14
|
+
import reduce from 'lodash/reduce';
|
|
15
|
+
import { ClickAwayProvider } from './utils/index.js';
|
|
16
|
+
import memoize from 'lodash/memoize';
|
|
17
|
+
import isFunction from 'lodash/isFunction';
|
|
18
|
+
import castArray from 'lodash/castArray';
|
|
19
|
+
import pick from 'lodash/pick';
|
|
20
|
+
import isInteger from 'lodash/isInteger';
|
|
21
|
+
import throttle from 'lodash/throttle';
|
|
22
|
+
import range from 'lodash/range';
|
|
23
|
+
import chunk from 'lodash/chunk';
|
|
24
|
+
import take from 'lodash/take';
|
|
25
|
+
import isObject from 'lodash/isObject';
|
|
26
|
+
import set from 'lodash/set';
|
|
6
27
|
|
|
7
28
|
function ownKeys(e, r) {
|
|
8
29
|
var t = Object.keys(e);
|
|
@@ -316,11 +337,6 @@ const mdiAlert='M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2z';const mdiAlertCircle='M
|
|
|
316
337
|
|
|
317
338
|
const _excluded$1t = ["prefix"];
|
|
318
339
|
|
|
319
|
-
/** Transform camelCase to kebab-case */
|
|
320
|
-
function camelToKebabCase(str) {
|
|
321
|
-
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
322
|
-
}
|
|
323
|
-
|
|
324
340
|
/**
|
|
325
341
|
* Enhance isEmpty method to also works with numbers.
|
|
326
342
|
*
|
|
@@ -348,18 +364,18 @@ function getBasicClass(_ref) {
|
|
|
348
364
|
type,
|
|
349
365
|
value
|
|
350
366
|
} = _ref;
|
|
351
|
-
if (
|
|
367
|
+
if (isBoolean(value)) {
|
|
352
368
|
if (!value) {
|
|
353
369
|
// False value should not return a class.
|
|
354
370
|
return '';
|
|
355
371
|
}
|
|
356
372
|
const booleanPrefixes = ['has', 'is'];
|
|
357
373
|
if (booleanPrefixes.some(booleanPrefix => type.toString().startsWith(booleanPrefix))) {
|
|
358
|
-
return `${prefix}--${
|
|
374
|
+
return `${prefix}--${kebabCase(type)}`;
|
|
359
375
|
}
|
|
360
|
-
return `${prefix}--is-${
|
|
376
|
+
return `${prefix}--is-${kebabCase(type)}`;
|
|
361
377
|
}
|
|
362
|
-
return `${prefix}--${
|
|
378
|
+
return `${prefix}--${kebabCase(type)}-${value}`;
|
|
363
379
|
}
|
|
364
380
|
|
|
365
381
|
/**
|
|
@@ -385,7 +401,7 @@ function handleBasicClasses(_ref2) {
|
|
|
385
401
|
prefix,
|
|
386
402
|
type: prop,
|
|
387
403
|
value: props[prop]
|
|
388
|
-
})] =
|
|
404
|
+
})] = isBoolean(props[prop]) ? props[prop] : !_isEmpty(props[prop]);
|
|
389
405
|
});
|
|
390
406
|
}
|
|
391
407
|
return classNames(prefix, otherClasses);
|
|
@@ -403,8 +419,8 @@ function isPassiveEventAvailable() {
|
|
|
403
419
|
supportsPassiveOption = true;
|
|
404
420
|
}
|
|
405
421
|
});
|
|
406
|
-
window.addEventListener('testPassiveEventSupport',
|
|
407
|
-
window.removeEventListener('testPassiveEventSupport',
|
|
422
|
+
window.addEventListener('testPassiveEventSupport', noop, opts);
|
|
423
|
+
window.removeEventListener('testPassiveEventSupport', noop, opts);
|
|
408
424
|
} catch (e) {
|
|
409
425
|
// ignored
|
|
410
426
|
}
|
|
@@ -516,6 +532,58 @@ function onButtonPressed(handler) {
|
|
|
516
532
|
};
|
|
517
533
|
}
|
|
518
534
|
|
|
535
|
+
/**
|
|
536
|
+
* The prefix to use for the CSS classes.
|
|
537
|
+
*/
|
|
538
|
+
const CSS_PREFIX = 'lumx';
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Animation duration constants. Take into consideration that if you change one of these variables,
|
|
542
|
+
* you need to update their scss counterpart as well
|
|
543
|
+
*/
|
|
544
|
+
const DIALOG_TRANSITION_DURATION = 400;
|
|
545
|
+
const EXPANSION_PANEL_TRANSITION_DURATION = 400;
|
|
546
|
+
const NOTIFICATION_TRANSITION_DURATION = 200;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Delay on hover after which we open or close the tooltip.
|
|
550
|
+
* Only applies to devices supporting pointer hover.
|
|
551
|
+
*/
|
|
552
|
+
const TOOLTIP_HOVER_DELAY = {
|
|
553
|
+
open: 500,
|
|
554
|
+
close: 500
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Delay on long press after which we open or close the tooltip.
|
|
559
|
+
* Only applies to devices not supporting pointer hover.
|
|
560
|
+
*/
|
|
561
|
+
const TOOLTIP_LONG_PRESS_DELAY = {
|
|
562
|
+
open: 250,
|
|
563
|
+
close: 3000
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
// See https://regex101.com/r/YjS1uI/3
|
|
567
|
+
const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Get the name of the root CSS class of a component based on its name.
|
|
571
|
+
*
|
|
572
|
+
* @param componentName The name of the component. This name should contains the component prefix and be
|
|
573
|
+
* written in PascalCase.
|
|
574
|
+
* @param subComponent Whether the current component is a sub component, if true, define the class according
|
|
575
|
+
* to BEM standards.
|
|
576
|
+
* @return The name of the root CSS class. This classname include the CSS classname prefix and is written in
|
|
577
|
+
* lower-snake-case.
|
|
578
|
+
*/
|
|
579
|
+
function getRootClassName(componentName, subComponent) {
|
|
580
|
+
const formattedClassName = `${CSS_PREFIX}-${kebabCase(componentName)}`;
|
|
581
|
+
if (subComponent) {
|
|
582
|
+
return formattedClassName.replace(LAST_PART_CLASSNAME, '$1__$2');
|
|
583
|
+
}
|
|
584
|
+
return formattedClassName;
|
|
585
|
+
}
|
|
586
|
+
|
|
519
587
|
/**
|
|
520
588
|
* Returns the classname associated to the given typography.
|
|
521
589
|
* For example, for `Typography.title` it returns `lumx-typography-title`
|
|
@@ -580,12 +648,12 @@ const CONFIG$1 = {
|
|
|
580
648
|
/**
|
|
581
649
|
* Component display name.
|
|
582
650
|
*/
|
|
583
|
-
const COMPONENT_NAME$
|
|
651
|
+
const COMPONENT_NAME$1n = 'AlertDialog';
|
|
584
652
|
|
|
585
653
|
/**
|
|
586
654
|
* Component default class name and class prefix.
|
|
587
655
|
*/
|
|
588
|
-
const CLASSNAME$1k =
|
|
656
|
+
const CLASSNAME$1k = getRootClassName(COMPONENT_NAME$1n);
|
|
589
657
|
|
|
590
658
|
/**
|
|
591
659
|
* Component default props.
|
|
@@ -685,7 +753,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
685
753
|
}), confirmLabel))
|
|
686
754
|
})));
|
|
687
755
|
});
|
|
688
|
-
AlertDialog.displayName = COMPONENT_NAME$
|
|
756
|
+
AlertDialog.displayName = COMPONENT_NAME$1n;
|
|
689
757
|
AlertDialog.className = CLASSNAME$1k;
|
|
690
758
|
AlertDialog.defaultProps = DEFAULT_PROPS$14;
|
|
691
759
|
|
|
@@ -759,12 +827,12 @@ const _excluded$1r = ["anchorToInput", "children", "chips", "className", "closeO
|
|
|
759
827
|
/**
|
|
760
828
|
* Component display name.
|
|
761
829
|
*/
|
|
762
|
-
const COMPONENT_NAME$
|
|
830
|
+
const COMPONENT_NAME$1m = 'Autocomplete';
|
|
763
831
|
|
|
764
832
|
/**
|
|
765
833
|
* Component default class name and class prefix.
|
|
766
834
|
*/
|
|
767
|
-
const CLASSNAME$1j =
|
|
835
|
+
const CLASSNAME$1j = getRootClassName(COMPONENT_NAME$1m);
|
|
768
836
|
|
|
769
837
|
/**
|
|
770
838
|
* Component default props.
|
|
@@ -866,7 +934,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
866
934
|
theme: theme
|
|
867
935
|
}, children));
|
|
868
936
|
});
|
|
869
|
-
Autocomplete.displayName = COMPONENT_NAME$
|
|
937
|
+
Autocomplete.displayName = COMPONENT_NAME$1m;
|
|
870
938
|
Autocomplete.className = CLASSNAME$1j;
|
|
871
939
|
Autocomplete.defaultProps = DEFAULT_PROPS$13;
|
|
872
940
|
|
|
@@ -879,12 +947,12 @@ const _excluded$1q = ["anchorToInput", "children", "chipsAlignment", "className"
|
|
|
879
947
|
/**
|
|
880
948
|
* Component display name.
|
|
881
949
|
*/
|
|
882
|
-
const COMPONENT_NAME$
|
|
950
|
+
const COMPONENT_NAME$1l = 'AutocompleteMultiple';
|
|
883
951
|
|
|
884
952
|
/**
|
|
885
953
|
* Component default class name and class prefix.
|
|
886
954
|
*/
|
|
887
|
-
const CLASSNAME$1i =
|
|
955
|
+
const CLASSNAME$1i = getRootClassName(COMPONENT_NAME$1l);
|
|
888
956
|
|
|
889
957
|
/**
|
|
890
958
|
* Component default props.
|
|
@@ -993,7 +1061,7 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
993
1061
|
onInfiniteScroll: onInfiniteScroll
|
|
994
1062
|
}), children);
|
|
995
1063
|
});
|
|
996
|
-
AutocompleteMultiple.displayName = COMPONENT_NAME$
|
|
1064
|
+
AutocompleteMultiple.displayName = COMPONENT_NAME$1l;
|
|
997
1065
|
AutocompleteMultiple.className = CLASSNAME$1i;
|
|
998
1066
|
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$12;
|
|
999
1067
|
|
|
@@ -1010,12 +1078,12 @@ const _excluded$1p = ["actions", "alt", "badge", "className", "image", "linkProp
|
|
|
1010
1078
|
/**
|
|
1011
1079
|
* Component display name.
|
|
1012
1080
|
*/
|
|
1013
|
-
const COMPONENT_NAME$
|
|
1081
|
+
const COMPONENT_NAME$1k = 'Avatar';
|
|
1014
1082
|
|
|
1015
1083
|
/**
|
|
1016
1084
|
* Component default class name and class prefix.
|
|
1017
1085
|
*/
|
|
1018
|
-
const CLASSNAME$1h =
|
|
1086
|
+
const CLASSNAME$1h = getRootClassName(COMPONENT_NAME$1k);
|
|
1019
1087
|
|
|
1020
1088
|
/**
|
|
1021
1089
|
* Component default props.
|
|
@@ -1074,7 +1142,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
1074
1142
|
className: `${CLASSNAME$1h}__badge`
|
|
1075
1143
|
}, badge));
|
|
1076
1144
|
});
|
|
1077
|
-
Avatar.displayName = COMPONENT_NAME$
|
|
1145
|
+
Avatar.displayName = COMPONENT_NAME$1k;
|
|
1078
1146
|
Avatar.className = CLASSNAME$1h;
|
|
1079
1147
|
Avatar.defaultProps = DEFAULT_PROPS$11;
|
|
1080
1148
|
|
|
@@ -1087,12 +1155,12 @@ const _excluded$1o = ["children", "className", "color"];
|
|
|
1087
1155
|
/**
|
|
1088
1156
|
* Component display name.
|
|
1089
1157
|
*/
|
|
1090
|
-
const COMPONENT_NAME$
|
|
1158
|
+
const COMPONENT_NAME$1j = 'Badge';
|
|
1091
1159
|
|
|
1092
1160
|
/**
|
|
1093
1161
|
* Component default class name and class prefix.
|
|
1094
1162
|
*/
|
|
1095
|
-
const CLASSNAME$1g =
|
|
1163
|
+
const CLASSNAME$1g = getRootClassName(COMPONENT_NAME$1j);
|
|
1096
1164
|
|
|
1097
1165
|
/**
|
|
1098
1166
|
* Component default props.
|
|
@@ -1124,7 +1192,7 @@ const Badge = forwardRef((props, ref) => {
|
|
|
1124
1192
|
}))
|
|
1125
1193
|
}), children);
|
|
1126
1194
|
});
|
|
1127
|
-
Badge.displayName = COMPONENT_NAME$
|
|
1195
|
+
Badge.displayName = COMPONENT_NAME$1j;
|
|
1128
1196
|
Badge.className = CLASSNAME$1g;
|
|
1129
1197
|
Badge.defaultProps = DEFAULT_PROPS$10;
|
|
1130
1198
|
|
|
@@ -1227,8 +1295,7 @@ const useKeyboardListNavigation = function (items, ref, onListItemSelected, onLi
|
|
|
1227
1295
|
onListItemSelected(selectedItem);
|
|
1228
1296
|
resetActiveIndex();
|
|
1229
1297
|
} else if (activeItemIndex === initialIndex && onEnterPressed) {
|
|
1230
|
-
|
|
1231
|
-
const value = (_evt$target = evt.target) === null || _evt$target === void 0 ? void 0 : _evt$target.value;
|
|
1298
|
+
const value = get(evt, 'target.value');
|
|
1232
1299
|
onEnterPressed(value);
|
|
1233
1300
|
resetActiveIndex();
|
|
1234
1301
|
}
|
|
@@ -1239,8 +1306,7 @@ const useKeyboardListNavigation = function (items, ref, onListItemSelected, onLi
|
|
|
1239
1306
|
* @param evt - key pressed event
|
|
1240
1307
|
*/
|
|
1241
1308
|
const onTabKeyPressed = evt => {
|
|
1242
|
-
|
|
1243
|
-
const value = (_evt$target2 = evt.target) === null || _evt$target2 === void 0 ? void 0 : _evt$target2.value;
|
|
1309
|
+
const value = get(evt, 'target.value');
|
|
1244
1310
|
if (preventTabOnEnteredValue && value && value.length > 0) {
|
|
1245
1311
|
preventDefaultAndStopPropagation(evt);
|
|
1246
1312
|
}
|
|
@@ -1327,12 +1393,12 @@ const _excluded$1m = ["after", "before", "children", "className", "isHighlighted
|
|
|
1327
1393
|
/**
|
|
1328
1394
|
* Component display name.
|
|
1329
1395
|
*/
|
|
1330
|
-
const COMPONENT_NAME$
|
|
1396
|
+
const COMPONENT_NAME$1i = 'ListItem';
|
|
1331
1397
|
|
|
1332
1398
|
/**
|
|
1333
1399
|
* Component default class name and class prefix.
|
|
1334
1400
|
*/
|
|
1335
|
-
const CLASSNAME$1f =
|
|
1401
|
+
const CLASSNAME$1f = getRootClassName(COMPONENT_NAME$1i);
|
|
1336
1402
|
|
|
1337
1403
|
/**
|
|
1338
1404
|
* Component default props.
|
|
@@ -1350,7 +1416,7 @@ function isClickable(_ref) {
|
|
|
1350
1416
|
linkProps,
|
|
1351
1417
|
onItemSelected
|
|
1352
1418
|
} = _ref;
|
|
1353
|
-
return
|
|
1419
|
+
return !isEmpty(linkProps === null || linkProps === void 0 ? void 0 : linkProps.href) || !!onItemSelected;
|
|
1354
1420
|
}
|
|
1355
1421
|
|
|
1356
1422
|
/**
|
|
@@ -1423,10 +1489,26 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
1423
1489
|
className: `${CLASSNAME$1f}__wrapper`
|
|
1424
1490
|
}, content));
|
|
1425
1491
|
});
|
|
1426
|
-
ListItem.displayName = COMPONENT_NAME$
|
|
1492
|
+
ListItem.displayName = COMPONENT_NAME$1i;
|
|
1427
1493
|
ListItem.className = CLASSNAME$1f;
|
|
1428
1494
|
ListItem.defaultProps = DEFAULT_PROPS$$;
|
|
1429
1495
|
|
|
1496
|
+
/**
|
|
1497
|
+
* Properties of a component to use to determine it's name.
|
|
1498
|
+
* In the order of preference.
|
|
1499
|
+
*/
|
|
1500
|
+
const NAME_PROPERTIES = ['type', 'type.displayName', 'displayName', 'name', 'type.name', 'props.mdxType', '_reactInternalFiber.elementType.name'];
|
|
1501
|
+
/**
|
|
1502
|
+
* Create a predicate function that checks if a ReactNode is a react element from the given component.
|
|
1503
|
+
*
|
|
1504
|
+
* @param component React function component or the component name
|
|
1505
|
+
* @return predicate returning true if value is instance of the component
|
|
1506
|
+
*/
|
|
1507
|
+
const isComponent = component => instance => {
|
|
1508
|
+
const componentName = typeof component === 'string' ? component : component.displayName;
|
|
1509
|
+
return !!get(instance, '$$typeof') && NAME_PROPERTIES.some(nameProperty => get(instance, nameProperty) === componentName);
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1430
1512
|
/**
|
|
1431
1513
|
* Similar to `isComponent` but more precise as it's not based on the component `displayName` but on the component function reference.
|
|
1432
1514
|
*/
|
|
@@ -1694,8 +1776,8 @@ function flattenChildren(children) {
|
|
|
1694
1776
|
function recur(nodes) {
|
|
1695
1777
|
let keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
1696
1778
|
return Children.toArray(nodes).reduce((acc, node, index) => {
|
|
1697
|
-
var
|
|
1698
|
-
const nodeKeys = keys.concat((
|
|
1779
|
+
var _get;
|
|
1780
|
+
const nodeKeys = keys.concat((_get = get(node, 'key')) !== null && _get !== void 0 ? _get : index);
|
|
1699
1781
|
if (reactIs.exports.isFragment(node)) {
|
|
1700
1782
|
acc.push(...recur(node.props.children, nodeKeys));
|
|
1701
1783
|
} else if ( /*#__PURE__*/isValidElement(node)) {
|
|
@@ -1735,7 +1817,7 @@ function onKeyboardFocus(props, handler) {
|
|
|
1735
1817
|
};
|
|
1736
1818
|
}
|
|
1737
1819
|
const isNavigableItem = node => {
|
|
1738
|
-
return
|
|
1820
|
+
return isComponent('ListItem')(node) && isClickable(node.props) && !node.props.isDisabled;
|
|
1739
1821
|
};
|
|
1740
1822
|
|
|
1741
1823
|
/**
|
|
@@ -1791,7 +1873,6 @@ const useInteractiveList = options => {
|
|
|
1791
1873
|
* @param evt Key event
|
|
1792
1874
|
*/
|
|
1793
1875
|
const onArrowPressed = evt => {
|
|
1794
|
-
var _items$nextIndex;
|
|
1795
1876
|
const {
|
|
1796
1877
|
key
|
|
1797
1878
|
} = evt;
|
|
@@ -1809,7 +1890,7 @@ const useInteractiveList = options => {
|
|
|
1809
1890
|
setActiveItemIndex(nextIndex);
|
|
1810
1891
|
evt.preventDefault();
|
|
1811
1892
|
evt.stopPropagation();
|
|
1812
|
-
onListItemNavigated === null || onListItemNavigated === void 0 ? void 0 : onListItemNavigated(nextIndex, (
|
|
1893
|
+
onListItemNavigated === null || onListItemNavigated === void 0 ? void 0 : onListItemNavigated(nextIndex, get(items, [nextIndex, 'key']));
|
|
1813
1894
|
};
|
|
1814
1895
|
|
|
1815
1896
|
/**
|
|
@@ -1872,12 +1953,12 @@ const _excluded$1l = ["children", "className", "isClickable", "itemPadding", "on
|
|
|
1872
1953
|
/**
|
|
1873
1954
|
* Component display name.
|
|
1874
1955
|
*/
|
|
1875
|
-
const COMPONENT_NAME$
|
|
1956
|
+
const COMPONENT_NAME$1h = 'List';
|
|
1876
1957
|
|
|
1877
1958
|
/**
|
|
1878
1959
|
* Component default class name and class prefix.
|
|
1879
1960
|
*/
|
|
1880
|
-
const CLASSNAME$1e =
|
|
1961
|
+
const CLASSNAME$1e = getRootClassName(COMPONENT_NAME$1h);
|
|
1881
1962
|
|
|
1882
1963
|
/**
|
|
1883
1964
|
* Component default props.
|
|
@@ -1923,44 +2004,13 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
1923
2004
|
ref: mergeRefs(ref, listElementRef)
|
|
1924
2005
|
}), items);
|
|
1925
2006
|
});
|
|
1926
|
-
InternalList.displayName = COMPONENT_NAME$
|
|
2007
|
+
InternalList.displayName = COMPONENT_NAME$1h;
|
|
1927
2008
|
InternalList.className = CLASSNAME$1e;
|
|
1928
2009
|
InternalList.defaultProps = DEFAULT_PROPS$_;
|
|
1929
2010
|
const List = Object.assign(InternalList, {
|
|
1930
2011
|
useKeyboardListNavigation
|
|
1931
2012
|
});
|
|
1932
2013
|
|
|
1933
|
-
/**
|
|
1934
|
-
* The prefix to use for the CSS classes.
|
|
1935
|
-
*/
|
|
1936
|
-
const CSS_PREFIX = 'lumx';
|
|
1937
|
-
|
|
1938
|
-
/**
|
|
1939
|
-
* Animation duration constants. Take into consideration that if you change one of these variables,
|
|
1940
|
-
* you need to update their scss counterpart as well
|
|
1941
|
-
*/
|
|
1942
|
-
const DIALOG_TRANSITION_DURATION = 400;
|
|
1943
|
-
const EXPANSION_PANEL_TRANSITION_DURATION = 400;
|
|
1944
|
-
const NOTIFICATION_TRANSITION_DURATION = 200;
|
|
1945
|
-
|
|
1946
|
-
/**
|
|
1947
|
-
* Delay on hover after which we open or close the tooltip.
|
|
1948
|
-
* Only applies to devices supporting pointer hover.
|
|
1949
|
-
*/
|
|
1950
|
-
const TOOLTIP_HOVER_DELAY = {
|
|
1951
|
-
open: 500,
|
|
1952
|
-
close: 500
|
|
1953
|
-
};
|
|
1954
|
-
|
|
1955
|
-
/**
|
|
1956
|
-
* Delay on long press after which we open or close the tooltip.
|
|
1957
|
-
* Only applies to devices not supporting pointer hover.
|
|
1958
|
-
*/
|
|
1959
|
-
const TOOLTIP_LONG_PRESS_DELAY = {
|
|
1960
|
-
open: 250,
|
|
1961
|
-
close: 3000
|
|
1962
|
-
};
|
|
1963
|
-
|
|
1964
2014
|
/**
|
|
1965
2015
|
* Optional global `window` instance (not defined when running SSR).
|
|
1966
2016
|
*/
|
|
@@ -1981,17 +2031,6 @@ const IS_BROWSER = typeof navigator !== 'undefined' && !navigator.userAgent.incl
|
|
|
1981
2031
|
*/
|
|
1982
2032
|
const VISUALLY_HIDDEN = 'visually-hidden';
|
|
1983
2033
|
|
|
1984
|
-
/** Pull an element from an array (inverse of array.push) */
|
|
1985
|
-
const pull = (array, element) => {
|
|
1986
|
-
const index = array.indexOf(element);
|
|
1987
|
-
if (index > -1) {
|
|
1988
|
-
array.splice(index, 1);
|
|
1989
|
-
}
|
|
1990
|
-
};
|
|
1991
|
-
|
|
1992
|
-
/** Get last item from array */
|
|
1993
|
-
const last = array => array[array.length - 1];
|
|
1994
|
-
|
|
1995
2034
|
/**
|
|
1996
2035
|
* Keep track of listeners, only the last registered listener gets activated at any point (previously registered
|
|
1997
2036
|
* listener are disabled).
|
|
@@ -4348,21 +4387,6 @@ const useStubPopper = (_a, _p, _ref) => {
|
|
|
4348
4387
|
/** Switch hook implementation between environment */
|
|
4349
4388
|
const usePopper = IS_BROWSER ? usePopper$1 : useStubPopper;
|
|
4350
4389
|
|
|
4351
|
-
/** Memoize a function based on the serialization of its args */
|
|
4352
|
-
function memoize(fn) {
|
|
4353
|
-
const cache = new Map();
|
|
4354
|
-
return function () {
|
|
4355
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4356
|
-
args[_key] = arguments[_key];
|
|
4357
|
-
}
|
|
4358
|
-
const serializedArgs = JSON.stringify(args);
|
|
4359
|
-
if (cache.has(serializedArgs)) return cache.get(serializedArgs);
|
|
4360
|
-
const value = fn(...args);
|
|
4361
|
-
cache.set(serializedArgs, value);
|
|
4362
|
-
return value;
|
|
4363
|
-
};
|
|
4364
|
-
}
|
|
4365
|
-
|
|
4366
4390
|
/**
|
|
4367
4391
|
* Different possible placements for the popover.
|
|
4368
4392
|
*/
|
|
@@ -4588,12 +4612,12 @@ const _excluded$1k = ["anchorRef", "as", "children", "className", "closeOnClickA
|
|
|
4588
4612
|
/**
|
|
4589
4613
|
* Component display name.
|
|
4590
4614
|
*/
|
|
4591
|
-
const COMPONENT_NAME$
|
|
4615
|
+
const COMPONENT_NAME$1g = 'Popover';
|
|
4592
4616
|
|
|
4593
4617
|
/**
|
|
4594
4618
|
* Component default class name and class prefix.
|
|
4595
4619
|
*/
|
|
4596
|
-
const CLASSNAME$1d =
|
|
4620
|
+
const CLASSNAME$1d = getRootClassName(COMPONENT_NAME$1g);
|
|
4597
4621
|
|
|
4598
4622
|
/**
|
|
4599
4623
|
* Component default props.
|
|
@@ -4696,10 +4720,10 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
4696
4720
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
4697
4721
|
d: "M8 3.49C7.62 2.82 6.66 2.82 6.27 3.48L.04 14 14.04 14 8 3.49Z"
|
|
4698
4722
|
}))), /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
4699
|
-
value:
|
|
4723
|
+
value: theme
|
|
4700
4724
|
}, children))), usePortal) : null;
|
|
4701
4725
|
});
|
|
4702
|
-
_InnerPopover.displayName = COMPONENT_NAME$
|
|
4726
|
+
_InnerPopover.displayName = COMPONENT_NAME$1g;
|
|
4703
4727
|
|
|
4704
4728
|
/**
|
|
4705
4729
|
* Popover component.
|
|
@@ -4711,7 +4735,7 @@ _InnerPopover.displayName = COMPONENT_NAME$1e;
|
|
|
4711
4735
|
const Popover = skipRender(
|
|
4712
4736
|
// Skip render in SSR
|
|
4713
4737
|
() => Boolean(DOCUMENT), _InnerPopover);
|
|
4714
|
-
Popover.displayName = COMPONENT_NAME$
|
|
4738
|
+
Popover.displayName = COMPONENT_NAME$1g;
|
|
4715
4739
|
Popover.className = CLASSNAME$1d;
|
|
4716
4740
|
Popover.defaultProps = DEFAULT_PROPS$Z;
|
|
4717
4741
|
|
|
@@ -4767,12 +4791,12 @@ const _excluded$1j = ["anchorRef", "children", "className", "closeOnClick", "clo
|
|
|
4767
4791
|
/**
|
|
4768
4792
|
* Component display name.
|
|
4769
4793
|
*/
|
|
4770
|
-
const COMPONENT_NAME$
|
|
4794
|
+
const COMPONENT_NAME$1f = 'Dropdown';
|
|
4771
4795
|
|
|
4772
4796
|
/**
|
|
4773
4797
|
* Component default class name and class prefix.
|
|
4774
4798
|
*/
|
|
4775
|
-
const CLASSNAME$1c =
|
|
4799
|
+
const CLASSNAME$1c = getRootClassName(COMPONENT_NAME$1f);
|
|
4776
4800
|
|
|
4777
4801
|
/**
|
|
4778
4802
|
* Component default props.
|
|
@@ -4819,7 +4843,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
4819
4843
|
const listElement = useRef(null);
|
|
4820
4844
|
useInfiniteScroll(innerRef, onInfiniteScroll);
|
|
4821
4845
|
const popperElement = useMemo(() => {
|
|
4822
|
-
return !Array.isArray(children) &&
|
|
4846
|
+
return !Array.isArray(children) && isComponent(List)(children) ? /*#__PURE__*/cloneElement(children, _objectSpread2(_objectSpread2({}, children.props), {}, {
|
|
4823
4847
|
ref: listElement,
|
|
4824
4848
|
onClick(evt) {
|
|
4825
4849
|
var _children$props$onCli, _children$props;
|
|
@@ -4853,7 +4877,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
4853
4877
|
ref: innerRef
|
|
4854
4878
|
}, popperElement)) : null;
|
|
4855
4879
|
});
|
|
4856
|
-
Dropdown.displayName = COMPONENT_NAME$
|
|
4880
|
+
Dropdown.displayName = COMPONENT_NAME$1f;
|
|
4857
4881
|
Dropdown.className = CLASSNAME$1c;
|
|
4858
4882
|
Dropdown.defaultProps = DEFAULT_PROPS$Y;
|
|
4859
4883
|
|
|
@@ -4878,12 +4902,12 @@ const _excluded$1i = ["children", "className", "kind", "theme"];
|
|
|
4878
4902
|
/**
|
|
4879
4903
|
* Component display name.
|
|
4880
4904
|
*/
|
|
4881
|
-
const COMPONENT_NAME$
|
|
4905
|
+
const COMPONENT_NAME$1e = 'InputHelper';
|
|
4882
4906
|
|
|
4883
4907
|
/**
|
|
4884
4908
|
* Component default class name and class prefix.
|
|
4885
4909
|
*/
|
|
4886
|
-
const CLASSNAME$1b =
|
|
4910
|
+
const CLASSNAME$1b = getRootClassName(COMPONENT_NAME$1e);
|
|
4887
4911
|
|
|
4888
4912
|
/**
|
|
4889
4913
|
* Component default props.
|
|
@@ -4921,7 +4945,7 @@ const InputHelper = forwardRef((props, ref) => {
|
|
|
4921
4945
|
}))
|
|
4922
4946
|
}), children);
|
|
4923
4947
|
});
|
|
4924
|
-
InputHelper.displayName = COMPONENT_NAME$
|
|
4948
|
+
InputHelper.displayName = COMPONENT_NAME$1e;
|
|
4925
4949
|
InputHelper.className = CLASSNAME$1b;
|
|
4926
4950
|
InputHelper.defaultProps = DEFAULT_PROPS$X;
|
|
4927
4951
|
|
|
@@ -4959,8 +4983,11 @@ const SelectVariant = {
|
|
|
4959
4983
|
|
|
4960
4984
|
const _excluded$1h = ["children", "className", "focusElement", "isMultiple", "closeOnClick", "disabled", "error", "hasError", "helper", "id", "isDisabled", "isEmpty", "isOpen", "isRequired", "isValid", "label", "onClear", "onDropdownClose", "onInfiniteScroll", "onInputClick", "placeholder", "theme", "value", "variant"];
|
|
4961
4985
|
|
|
4986
|
+
/** The display name of the component. */
|
|
4987
|
+
const COMPONENT_NAME$1d = 'Select';
|
|
4988
|
+
|
|
4962
4989
|
/** The default class name and classes prefix for this component. */
|
|
4963
|
-
const CLASSNAME$1a =
|
|
4990
|
+
const CLASSNAME$1a = getRootClassName(COMPONENT_NAME$1d);
|
|
4964
4991
|
|
|
4965
4992
|
/** The default value of props. */
|
|
4966
4993
|
const DEFAULT_PROPS$W = {
|
|
@@ -5070,11 +5097,15 @@ const WithSelectContext = (SelectElement, props, ref) => {
|
|
|
5070
5097
|
};
|
|
5071
5098
|
|
|
5072
5099
|
const _excluded$1g = ["badge", "children", "className"];
|
|
5100
|
+
/**
|
|
5101
|
+
* Component display name.
|
|
5102
|
+
*/
|
|
5103
|
+
const COMPONENT_NAME$1c = 'BadgeWrapper';
|
|
5073
5104
|
|
|
5074
5105
|
/**
|
|
5075
5106
|
* Component default class name and class prefix.
|
|
5076
5107
|
*/
|
|
5077
|
-
const CLASSNAME$19 =
|
|
5108
|
+
const CLASSNAME$19 = getRootClassName(COMPONENT_NAME$1c);
|
|
5078
5109
|
const BadgeWrapper = forwardRef((props, ref) => {
|
|
5079
5110
|
const {
|
|
5080
5111
|
badge,
|
|
@@ -5196,7 +5227,7 @@ const ButtonRoot = forwardRef((props, ref) => {
|
|
|
5196
5227
|
*
|
|
5197
5228
|
* However, in any case, if the component is disabled, we returned a <button> since disabled is not compatible with <a>.
|
|
5198
5229
|
*/
|
|
5199
|
-
if ((linkAs || props.href) && !isDisabled) {
|
|
5230
|
+
if ((linkAs || !isEmpty(props.href)) && !isDisabled) {
|
|
5200
5231
|
return renderLink(_objectSpread2(_objectSpread2({
|
|
5201
5232
|
linkAs
|
|
5202
5233
|
}, forwardedProps), {}, {
|
|
@@ -5242,7 +5273,7 @@ const COMPONENT_NAME$1a = 'Button';
|
|
|
5242
5273
|
/**
|
|
5243
5274
|
* Component default class name and class prefix.
|
|
5244
5275
|
*/
|
|
5245
|
-
const CLASSNAME$18 =
|
|
5276
|
+
const CLASSNAME$18 = getRootClassName(COMPONENT_NAME$1a);
|
|
5246
5277
|
|
|
5247
5278
|
/**
|
|
5248
5279
|
* Component default props.
|
|
@@ -5274,11 +5305,11 @@ const Button = forwardRef((props, ref) => {
|
|
|
5274
5305
|
const buttonClassName = classNames(className, getBasicClass({
|
|
5275
5306
|
prefix: CLASSNAME$18,
|
|
5276
5307
|
type: 'hasLeftIcon',
|
|
5277
|
-
value:
|
|
5308
|
+
value: !isEmpty(leftIcon)
|
|
5278
5309
|
}), getBasicClass({
|
|
5279
5310
|
prefix: CLASSNAME$18,
|
|
5280
5311
|
type: 'hasRightIcon',
|
|
5281
|
-
value:
|
|
5312
|
+
value: !isEmpty(rightIcon)
|
|
5282
5313
|
}));
|
|
5283
5314
|
return /*#__PURE__*/React__default.createElement(ButtonRoot, _extends({
|
|
5284
5315
|
ref: ref
|
|
@@ -5289,9 +5320,9 @@ const Button = forwardRef((props, ref) => {
|
|
|
5289
5320
|
}, forwardedProps), {
|
|
5290
5321
|
className: buttonClassName,
|
|
5291
5322
|
variant: "button"
|
|
5292
|
-
}), leftIcon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
5323
|
+
}), leftIcon && !isEmpty(leftIcon) && /*#__PURE__*/React__default.createElement(Icon, {
|
|
5293
5324
|
icon: leftIcon
|
|
5294
|
-
}), children && (
|
|
5325
|
+
}), children && (isComponent(Text)(children) ? children : /*#__PURE__*/React__default.createElement("span", null, children)), rightIcon && !isEmpty(rightIcon) && /*#__PURE__*/React__default.createElement(Icon, {
|
|
5295
5326
|
icon: rightIcon
|
|
5296
5327
|
}));
|
|
5297
5328
|
});
|
|
@@ -5308,7 +5339,7 @@ const COMPONENT_NAME$19 = 'IconButton';
|
|
|
5308
5339
|
/**
|
|
5309
5340
|
* Component default class name and class prefix.
|
|
5310
5341
|
*/
|
|
5311
|
-
const CLASSNAME$17 =
|
|
5342
|
+
const CLASSNAME$17 = getRootClassName(COMPONENT_NAME$19);
|
|
5312
5343
|
|
|
5313
5344
|
/**
|
|
5314
5345
|
* Component default props.
|
|
@@ -5375,7 +5406,7 @@ const COMPONENT_NAME$18 = 'ButtonGroup';
|
|
|
5375
5406
|
/**
|
|
5376
5407
|
* Component default class name and class prefix.
|
|
5377
5408
|
*/
|
|
5378
|
-
const CLASSNAME$16 =
|
|
5409
|
+
const CLASSNAME$16 = getRootClassName(COMPONENT_NAME$18);
|
|
5379
5410
|
|
|
5380
5411
|
/**
|
|
5381
5412
|
* Component default props.
|
|
@@ -5424,7 +5455,7 @@ const COMPONENT_NAME$17 = 'Checkbox';
|
|
|
5424
5455
|
/**
|
|
5425
5456
|
* Component default class name and class prefix.
|
|
5426
5457
|
*/
|
|
5427
|
-
const CLASSNAME$15 =
|
|
5458
|
+
const CLASSNAME$15 = getRootClassName(COMPONENT_NAME$17);
|
|
5428
5459
|
|
|
5429
5460
|
/**
|
|
5430
5461
|
* Component default props.
|
|
@@ -5528,7 +5559,7 @@ Checkbox.defaultProps = DEFAULT_PROPS$S;
|
|
|
5528
5559
|
*/
|
|
5529
5560
|
function useStopPropagation(handler) {
|
|
5530
5561
|
return useCallback(evt => {
|
|
5531
|
-
if (!evt || !handler) {
|
|
5562
|
+
if (!evt || !isFunction(handler)) {
|
|
5532
5563
|
return;
|
|
5533
5564
|
}
|
|
5534
5565
|
handler(evt);
|
|
@@ -5554,7 +5585,7 @@ const COMPONENT_NAME$16 = 'Chip';
|
|
|
5554
5585
|
/**
|
|
5555
5586
|
* Component default class name and class prefix.
|
|
5556
5587
|
*/
|
|
5557
|
-
const CLASSNAME$14 =
|
|
5588
|
+
const CLASSNAME$14 = getRootClassName(COMPONENT_NAME$16);
|
|
5558
5589
|
|
|
5559
5590
|
/**
|
|
5560
5591
|
* Component default props.
|
|
@@ -5592,8 +5623,11 @@ const Chip = forwardRef((props, ref) => {
|
|
|
5592
5623
|
onKeyDown
|
|
5593
5624
|
} = props,
|
|
5594
5625
|
forwardedProps = _objectWithoutProperties(props, _excluded$1a);
|
|
5595
|
-
const
|
|
5596
|
-
const
|
|
5626
|
+
const hasAfterClick = isFunction(onAfterClick);
|
|
5627
|
+
const hasBeforeClick = isFunction(onBeforeClick);
|
|
5628
|
+
const hasOnClick = isFunction(onClick);
|
|
5629
|
+
const isButton = hasOnClick && !href;
|
|
5630
|
+
const isClickable = Boolean(hasOnClick) || Boolean(href) || propIsClickable;
|
|
5597
5631
|
|
|
5598
5632
|
// Adapt color to the theme.
|
|
5599
5633
|
const chipColor = color || (theme === Theme.light ? ColorPalette.dark : ColorPalette.light);
|
|
@@ -5601,7 +5635,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
5601
5635
|
const handleOnAfterClick = useStopPropagation(onAfterClick);
|
|
5602
5636
|
const handleKeyDown = evt => {
|
|
5603
5637
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(evt);
|
|
5604
|
-
if (
|
|
5638
|
+
if (hasOnClick) {
|
|
5605
5639
|
onEnterPressed(onClick)(evt);
|
|
5606
5640
|
}
|
|
5607
5641
|
};
|
|
@@ -5627,14 +5661,14 @@ const Chip = forwardRef((props, ref) => {
|
|
|
5627
5661
|
unselected: Boolean(!isSelected)
|
|
5628
5662
|
})),
|
|
5629
5663
|
"aria-disabled": isClickable && isDisabled || undefined,
|
|
5630
|
-
onClick: onClick
|
|
5664
|
+
onClick: hasOnClick ? onClick : undefined,
|
|
5631
5665
|
onKeyDown: handleKeyDown
|
|
5632
5666
|
}), before &&
|
|
5633
5667
|
/*#__PURE__*/
|
|
5634
5668
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
5635
5669
|
React__default.createElement("div", {
|
|
5636
5670
|
className: classNames(`${CLASSNAME$14}__before`, {
|
|
5637
|
-
[`${CLASSNAME$14}__before--is-clickable`]:
|
|
5671
|
+
[`${CLASSNAME$14}__before--is-clickable`]: hasBeforeClick
|
|
5638
5672
|
}),
|
|
5639
5673
|
onClick: handleOnBeforeClick
|
|
5640
5674
|
}, before), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -5644,7 +5678,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
5644
5678
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
5645
5679
|
React__default.createElement("div", {
|
|
5646
5680
|
className: classNames(`${CLASSNAME$14}__after`, {
|
|
5647
|
-
[`${CLASSNAME$14}__after--is-clickable`]:
|
|
5681
|
+
[`${CLASSNAME$14}__after--is-clickable`]: hasAfterClick
|
|
5648
5682
|
}),
|
|
5649
5683
|
onClick: handleOnAfterClick
|
|
5650
5684
|
}, after))
|
|
@@ -5725,7 +5759,7 @@ const COMPONENT_NAME$15 = 'ChipGroup';
|
|
|
5725
5759
|
/**
|
|
5726
5760
|
* Component default class name and class prefix.
|
|
5727
5761
|
*/
|
|
5728
|
-
const CLASSNAME$13 =
|
|
5762
|
+
const CLASSNAME$13 = getRootClassName(COMPONENT_NAME$15);
|
|
5729
5763
|
|
|
5730
5764
|
/**
|
|
5731
5765
|
* ChipGroup component.
|
|
@@ -5775,7 +5809,7 @@ const COMPONENT_NAME$14 = 'CommentBlock';
|
|
|
5775
5809
|
/**
|
|
5776
5810
|
* Component default class name and class prefix.
|
|
5777
5811
|
*/
|
|
5778
|
-
const CLASSNAME$12 =
|
|
5812
|
+
const CLASSNAME$12 = getRootClassName(COMPONENT_NAME$14);
|
|
5779
5813
|
|
|
5780
5814
|
/**
|
|
5781
5815
|
* Component default props.
|
|
@@ -5889,7 +5923,7 @@ const COMPONENT_NAME$13 = 'DatePicker';
|
|
|
5889
5923
|
/**
|
|
5890
5924
|
* Component default class name and class prefix.
|
|
5891
5925
|
*/
|
|
5892
|
-
const CLASSNAME$11 =
|
|
5926
|
+
const CLASSNAME$11 = getRootClassName(COMPONENT_NAME$13);
|
|
5893
5927
|
|
|
5894
5928
|
/** Get first day of week for locale from the browser API */
|
|
5895
5929
|
const getFromBrowser = locale => {
|
|
@@ -6021,7 +6055,7 @@ const getMonthCalendar = function (locale) {
|
|
|
6021
6055
|
if (iterDate.getMonth() === month) {
|
|
6022
6056
|
week[weekDayNumber] = day;
|
|
6023
6057
|
}
|
|
6024
|
-
if (weekDayNumber ===
|
|
6058
|
+
if (weekDayNumber === lastDayOfWeek.number) {
|
|
6025
6059
|
weeks.push(week);
|
|
6026
6060
|
rowCount += 1;
|
|
6027
6061
|
week = {};
|
|
@@ -6492,17 +6526,7 @@ function useIntersectionObserver(elements, options) {
|
|
|
6492
6526
|
* @return partitioned elements by the given predicates
|
|
6493
6527
|
*/
|
|
6494
6528
|
function partitionMulti(elements, predicates) {
|
|
6495
|
-
|
|
6496
|
-
const groups = predicates.map(() => []);
|
|
6497
|
-
for (const element of elements) {
|
|
6498
|
-
const index = predicates.findIndex(predicate => predicate(element));
|
|
6499
|
-
if (index !== -1) {
|
|
6500
|
-
groups[index].push(element);
|
|
6501
|
-
} else {
|
|
6502
|
-
others.push(element);
|
|
6503
|
-
}
|
|
6504
|
-
}
|
|
6505
|
-
return [...groups, others];
|
|
6529
|
+
return reduce(predicates, (partitioned, predicate) => concat(dropRight(partitioned), partition(last(partitioned), predicate)), [elements]);
|
|
6506
6530
|
}
|
|
6507
6531
|
|
|
6508
6532
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
@@ -6772,8 +6796,8 @@ const _excluded$15 = ["children", "className", "header", "focusElement", "forceF
|
|
|
6772
6796
|
* Defines the props of the component.
|
|
6773
6797
|
*/
|
|
6774
6798
|
|
|
6775
|
-
const isHeader$1 =
|
|
6776
|
-
const isFooter$1 =
|
|
6799
|
+
const isHeader$1 = isComponent('header');
|
|
6800
|
+
const isFooter$1 = isComponent('footer');
|
|
6777
6801
|
|
|
6778
6802
|
/**
|
|
6779
6803
|
* Component display name.
|
|
@@ -6783,7 +6807,7 @@ const COMPONENT_NAME$10 = 'Dialog';
|
|
|
6783
6807
|
/**
|
|
6784
6808
|
* Component default class name and class prefix.
|
|
6785
6809
|
*/
|
|
6786
|
-
const CLASSNAME$10 =
|
|
6810
|
+
const CLASSNAME$10 = getRootClassName(COMPONENT_NAME$10);
|
|
6787
6811
|
|
|
6788
6812
|
/**
|
|
6789
6813
|
* Component default props.
|
|
@@ -6956,7 +6980,7 @@ const COMPONENT_NAME$$ = 'Divider';
|
|
|
6956
6980
|
/**
|
|
6957
6981
|
* Component default class name and class prefix.
|
|
6958
6982
|
*/
|
|
6959
|
-
const CLASSNAME$$ =
|
|
6983
|
+
const CLASSNAME$$ = getRootClassName(COMPONENT_NAME$$);
|
|
6960
6984
|
|
|
6961
6985
|
/**
|
|
6962
6986
|
* Component default props.
|
|
@@ -7004,7 +7028,7 @@ const COMPONENT_NAME$_ = 'DragHandle';
|
|
|
7004
7028
|
/**
|
|
7005
7029
|
* Component default class name and class prefix.
|
|
7006
7030
|
*/
|
|
7007
|
-
const CLASSNAME$_ =
|
|
7031
|
+
const CLASSNAME$_ = getRootClassName(COMPONENT_NAME$_);
|
|
7008
7032
|
|
|
7009
7033
|
/**
|
|
7010
7034
|
* DragHandle component.
|
|
@@ -7050,15 +7074,15 @@ const COMPONENT_NAME$Z = 'ExpansionPanel';
|
|
|
7050
7074
|
/**
|
|
7051
7075
|
* Component default class name and class prefix.
|
|
7052
7076
|
*/
|
|
7053
|
-
const CLASSNAME$Z =
|
|
7077
|
+
const CLASSNAME$Z = getRootClassName(COMPONENT_NAME$Z);
|
|
7054
7078
|
|
|
7055
7079
|
/**
|
|
7056
7080
|
* Component default props.
|
|
7057
7081
|
*/
|
|
7058
7082
|
const DEFAULT_PROPS$M = {};
|
|
7059
|
-
const isDragHandle =
|
|
7060
|
-
const isHeader =
|
|
7061
|
-
const isFooter =
|
|
7083
|
+
const isDragHandle = isComponent(DragHandle);
|
|
7084
|
+
const isHeader = isComponent('header');
|
|
7085
|
+
const isFooter = isComponent('footer');
|
|
7062
7086
|
|
|
7063
7087
|
/**
|
|
7064
7088
|
* ExpansionPanel component.
|
|
@@ -7090,23 +7114,25 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
7090
7114
|
|
|
7091
7115
|
// Either take the header in children or create one with the label.
|
|
7092
7116
|
const headerProps = /*#__PURE__*/React__default.isValidElement(header) ? header.props : {};
|
|
7093
|
-
const headerContent =
|
|
7117
|
+
const headerContent = !isEmpty(headerProps.children) ? headerProps.children : /*#__PURE__*/React__default.createElement("span", {
|
|
7094
7118
|
className: `${CLASSNAME$Z}__label`
|
|
7095
7119
|
}, label);
|
|
7096
7120
|
const toggleOpen = event => {
|
|
7097
7121
|
const shouldOpen = !isOpen;
|
|
7098
|
-
if (shouldOpen) {
|
|
7099
|
-
onOpen
|
|
7122
|
+
if (isFunction(onOpen) && shouldOpen) {
|
|
7123
|
+
onOpen(event);
|
|
7124
|
+
}
|
|
7125
|
+
if (isFunction(onClose) && !shouldOpen) {
|
|
7126
|
+
onClose(event);
|
|
7100
7127
|
}
|
|
7101
|
-
if (
|
|
7102
|
-
|
|
7128
|
+
if (isFunction(onToggleOpen)) {
|
|
7129
|
+
onToggleOpen(shouldOpen, event);
|
|
7103
7130
|
}
|
|
7104
|
-
onToggleOpen === null || onToggleOpen === void 0 ? void 0 : onToggleOpen(shouldOpen, event);
|
|
7105
7131
|
};
|
|
7106
7132
|
const color = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
|
|
7107
7133
|
const rootClassName = classNames(className, handleBasicClasses({
|
|
7108
7134
|
hasBackground,
|
|
7109
|
-
hasHeader: Boolean(!isEmpty
|
|
7135
|
+
hasHeader: Boolean(!isEmpty(headerProps.children)),
|
|
7110
7136
|
hasHeaderDivider,
|
|
7111
7137
|
isClose: !isOpen,
|
|
7112
7138
|
isDraggable: Boolean(dragHandle),
|
|
@@ -7122,8 +7148,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
7122
7148
|
// Switch max height on/off to activate the CSS transition (updates when children changes).
|
|
7123
7149
|
const [maxHeight, setMaxHeight] = useState('0');
|
|
7124
7150
|
useEffect(() => {
|
|
7125
|
-
|
|
7126
|
-
const height = isOpen ? (_wrapperRef$current$o = (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.offsetHeight) !== null && _wrapperRef$current$o !== void 0 ? _wrapperRef$current$o : 0 : 0;
|
|
7151
|
+
const height = isOpen ? get(wrapperRef.current, 'offsetHeight', 0) : 0;
|
|
7127
7152
|
setMaxHeight(`${height}px`);
|
|
7128
7153
|
}, [children, isOpen]);
|
|
7129
7154
|
return /*#__PURE__*/React__default.createElement("section", _extends({
|
|
@@ -7164,7 +7189,7 @@ ExpansionPanel.defaultProps = DEFAULT_PROPS$M;
|
|
|
7164
7189
|
|
|
7165
7190
|
const _excluded$11 = ["label", "icon", "color", "className", "theme", "truncate"];
|
|
7166
7191
|
const COMPONENT_NAME$Y = 'Flag';
|
|
7167
|
-
const CLASSNAME$Y =
|
|
7192
|
+
const CLASSNAME$Y = getRootClassName(COMPONENT_NAME$Y);
|
|
7168
7193
|
const DEFAULT_PROPS$L = {};
|
|
7169
7194
|
|
|
7170
7195
|
/**
|
|
@@ -7209,9 +7234,6 @@ Flag.displayName = COMPONENT_NAME$Y;
|
|
|
7209
7234
|
Flag.className = CLASSNAME$Y;
|
|
7210
7235
|
Flag.defaultProps = DEFAULT_PROPS$L;
|
|
7211
7236
|
|
|
7212
|
-
/** Cast a value into an array if needed */
|
|
7213
|
-
const castArray = arrayOrElement => Array.isArray(arrayOrElement) ? arrayOrElement : [arrayOrElement];
|
|
7214
|
-
|
|
7215
7237
|
const _excluded$10 = ["as", "children", "className", "fillSpace", "gap", "hAlign", "marginAuto", "noShrink", "orientation", "vAlign", "wrap"];
|
|
7216
7238
|
|
|
7217
7239
|
/**
|
|
@@ -7226,7 +7248,7 @@ const COMPONENT_NAME$X = 'FlexBox';
|
|
|
7226
7248
|
/**
|
|
7227
7249
|
* Component default class name and class prefix.
|
|
7228
7250
|
*/
|
|
7229
|
-
const CLASSNAME$X =
|
|
7251
|
+
const CLASSNAME$X = getRootClassName(COMPONENT_NAME$X);
|
|
7230
7252
|
|
|
7231
7253
|
/**
|
|
7232
7254
|
* FlexBox component.
|
|
@@ -7274,7 +7296,7 @@ const COMPONENT_NAME$W = 'GenericBlock';
|
|
|
7274
7296
|
/**
|
|
7275
7297
|
* Component default class name and class prefix.
|
|
7276
7298
|
*/
|
|
7277
|
-
const CLASSNAME$W =
|
|
7299
|
+
const CLASSNAME$W = getRootClassName(COMPONENT_NAME$W);
|
|
7278
7300
|
|
|
7279
7301
|
/**
|
|
7280
7302
|
* Component default props.
|
|
@@ -7283,11 +7305,11 @@ const DEFAULT_PROPS$K = {
|
|
|
7283
7305
|
gap: Size.big,
|
|
7284
7306
|
orientation: Orientation.horizontal
|
|
7285
7307
|
};
|
|
7286
|
-
const Figure = (
|
|
7308
|
+
const Figure = noop.bind({});
|
|
7287
7309
|
const isFigure = isComponentType(Figure);
|
|
7288
|
-
const Content = (
|
|
7310
|
+
const Content = noop.bind({});
|
|
7289
7311
|
const isContent = isComponentType(Content);
|
|
7290
|
-
const Actions = (
|
|
7312
|
+
const Actions = noop.bind({});
|
|
7291
7313
|
const isActions = isComponentType(Actions);
|
|
7292
7314
|
|
|
7293
7315
|
/**
|
|
@@ -7325,8 +7347,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
7325
7347
|
contentChildProps: contentChild === null || contentChild === void 0 ? void 0 : contentChild.props,
|
|
7326
7348
|
actionsChild,
|
|
7327
7349
|
actionsChildProps: actionsChild === null || actionsChild === void 0 ? void 0 : actionsChild.props,
|
|
7328
|
-
|
|
7329
|
-
otherChildren: otherChildren.filter(child => React__default.Children.count(child) > 0)
|
|
7350
|
+
otherChildren: otherChildren.filter(child => !isEmpty(child))
|
|
7330
7351
|
};
|
|
7331
7352
|
}, [children]);
|
|
7332
7353
|
return /*#__PURE__*/React__default.createElement(FlexBox, _extends({
|
|
@@ -7368,13 +7389,7 @@ const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
|
7368
7389
|
/**
|
|
7369
7390
|
* Accepted gap sizes for the generic block.
|
|
7370
7391
|
*/
|
|
7371
|
-
const GenericBlockGapSize =
|
|
7372
|
-
tiny: Size.tiny,
|
|
7373
|
-
regular: Size.regular,
|
|
7374
|
-
medium: Size.medium,
|
|
7375
|
-
big: Size.big,
|
|
7376
|
-
huge: Size.huge
|
|
7377
|
-
};
|
|
7392
|
+
const GenericBlockGapSize = pick(Size, ['tiny', 'regular', 'medium', 'big', 'huge']);
|
|
7378
7393
|
|
|
7379
7394
|
/** Empty object */
|
|
7380
7395
|
|
|
@@ -7434,7 +7449,7 @@ const COMPONENT_NAME$V = 'Text';
|
|
|
7434
7449
|
/**
|
|
7435
7450
|
* Component default class name and class prefix.
|
|
7436
7451
|
*/
|
|
7437
|
-
const CLASSNAME$V =
|
|
7452
|
+
const CLASSNAME$V = getRootClassName(COMPONENT_NAME$V);
|
|
7438
7453
|
|
|
7439
7454
|
/**
|
|
7440
7455
|
* Component default props.
|
|
@@ -7495,7 +7510,7 @@ const Text = forwardRef((props, ref) => {
|
|
|
7495
7510
|
style: _objectSpread2(_objectSpread2(_objectSpread2({}, truncateLinesStyle), whiteSpaceStyle), style)
|
|
7496
7511
|
}, forwardedProps), children && Children.toArray(children).map((child, index) => {
|
|
7497
7512
|
// Force wrap spaces around icons to make sure they are never stuck against text.
|
|
7498
|
-
if (
|
|
7513
|
+
if (isComponent(Icon)(child)) {
|
|
7499
7514
|
return /*#__PURE__*/React__default.createElement(Fragment, {
|
|
7500
7515
|
key: child.key || index
|
|
7501
7516
|
}, " ", child, " ");
|
|
@@ -7553,7 +7568,7 @@ const COMPONENT_NAME$U = 'Heading';
|
|
|
7553
7568
|
/**
|
|
7554
7569
|
* Component default class name and class prefix.
|
|
7555
7570
|
*/
|
|
7556
|
-
const CLASSNAME$U =
|
|
7571
|
+
const CLASSNAME$U = getRootClassName(COMPONENT_NAME$U);
|
|
7557
7572
|
|
|
7558
7573
|
/**
|
|
7559
7574
|
* Component default props.
|
|
@@ -7624,7 +7639,7 @@ const COMPONENT_NAME$T = 'Grid';
|
|
|
7624
7639
|
/**
|
|
7625
7640
|
* Component default class name and class prefix.
|
|
7626
7641
|
*/
|
|
7627
|
-
const CLASSNAME$T =
|
|
7642
|
+
const CLASSNAME$T = getRootClassName(COMPONENT_NAME$T);
|
|
7628
7643
|
|
|
7629
7644
|
/**
|
|
7630
7645
|
* Component default props.
|
|
@@ -7685,7 +7700,7 @@ const COMPONENT_NAME$S = 'GridItem';
|
|
|
7685
7700
|
/**
|
|
7686
7701
|
* Component default class name and class prefix.
|
|
7687
7702
|
*/
|
|
7688
|
-
const CLASSNAME$S =
|
|
7703
|
+
const CLASSNAME$S = getRootClassName(COMPONENT_NAME$S);
|
|
7689
7704
|
|
|
7690
7705
|
/**
|
|
7691
7706
|
* GridItem component.
|
|
@@ -7731,7 +7746,7 @@ const COMPONENT_NAME$R = 'GridColumn';
|
|
|
7731
7746
|
/**
|
|
7732
7747
|
* Component default class name and class prefix.
|
|
7733
7748
|
*/
|
|
7734
|
-
const CLASSNAME$R =
|
|
7749
|
+
const CLASSNAME$R = getRootClassName(COMPONENT_NAME$R);
|
|
7735
7750
|
|
|
7736
7751
|
/**
|
|
7737
7752
|
* Component default props.
|
|
@@ -7762,7 +7777,7 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
7762
7777
|
ref: ref,
|
|
7763
7778
|
className: classNames(className, CLASSNAME$R),
|
|
7764
7779
|
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
7765
|
-
['--lumx-grid-column-item-min-width']:
|
|
7780
|
+
['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
7766
7781
|
['--lumx-grid-column-columns']: maxColumns,
|
|
7767
7782
|
['--lumx-grid-column-gap']: gap && `var(--lumx-spacing-unit-${gap})`
|
|
7768
7783
|
})
|
|
@@ -7786,7 +7801,7 @@ const COMPONENT_NAME$Q = 'Icon';
|
|
|
7786
7801
|
/**
|
|
7787
7802
|
* Component default class name and class prefix.
|
|
7788
7803
|
*/
|
|
7789
|
-
const CLASSNAME$Q =
|
|
7804
|
+
const CLASSNAME$Q = getRootClassName(COMPONENT_NAME$Q);
|
|
7790
7805
|
|
|
7791
7806
|
/**
|
|
7792
7807
|
* Component default props.
|
|
@@ -7951,7 +7966,7 @@ const COMPONENT_NAME$P = 'ImageBlock';
|
|
|
7951
7966
|
/**
|
|
7952
7967
|
* Component default class name and class prefix.
|
|
7953
7968
|
*/
|
|
7954
|
-
const CLASSNAME$P =
|
|
7969
|
+
const CLASSNAME$P = getRootClassName(COMPONENT_NAME$P);
|
|
7955
7970
|
|
|
7956
7971
|
/**
|
|
7957
7972
|
* Component default props.
|
|
@@ -8035,7 +8050,7 @@ const COMPONENT_NAME$O = 'ImageLightbox';
|
|
|
8035
8050
|
/**
|
|
8036
8051
|
* Component default class name and class prefix.
|
|
8037
8052
|
*/
|
|
8038
|
-
const CLASSNAME$O =
|
|
8053
|
+
const CLASSNAME$O = getRootClassName(COMPONENT_NAME$O);
|
|
8039
8054
|
|
|
8040
8055
|
/**
|
|
8041
8056
|
* Observe element size (only works if it's size depends on the window size).
|
|
@@ -8047,20 +8062,11 @@ const CLASSNAME$O = 'lumx-image-lightbox';
|
|
|
8047
8062
|
*/
|
|
8048
8063
|
function useSizeOnWindowResize(elementRef) {
|
|
8049
8064
|
const [size, setSize] = React__default.useState(null);
|
|
8050
|
-
const updateSize = React__default.useMemo(() => {
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
if (newSize) setSize(newSize);
|
|
8056
|
-
prevTimeout = undefined;
|
|
8057
|
-
}
|
|
8058
|
-
return () => {
|
|
8059
|
-
if (!prevTimeout) {
|
|
8060
|
-
prevTimeout = setTimeout(update, 10);
|
|
8061
|
-
}
|
|
8062
|
-
};
|
|
8063
|
-
}, [elementRef]);
|
|
8065
|
+
const updateSize = React__default.useMemo(() => throttle(() => {
|
|
8066
|
+
var _elementRef$current;
|
|
8067
|
+
const newSize = (_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.getBoundingClientRect();
|
|
8068
|
+
if (newSize) setSize(newSize);
|
|
8069
|
+
}, 10), [elementRef]);
|
|
8064
8070
|
React__default.useEffect(() => {
|
|
8065
8071
|
updateSize();
|
|
8066
8072
|
window.addEventListener('resize', updateSize);
|
|
@@ -8476,6 +8482,13 @@ const ImageSlideshow = _ref => {
|
|
|
8476
8482
|
})));
|
|
8477
8483
|
const getImgRef = React__default.useMemo(() => memoize((index, isActive) => {
|
|
8478
8484
|
return mergeRefs(images === null || images === void 0 ? void 0 : images[index].imgRef, isActive ? activeImageRef : undefined);
|
|
8485
|
+
},
|
|
8486
|
+
// memoize based on both arguments
|
|
8487
|
+
function () {
|
|
8488
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8489
|
+
args[_key] = arguments[_key];
|
|
8490
|
+
}
|
|
8491
|
+
return args.join();
|
|
8479
8492
|
}), [images, activeImageRef]);
|
|
8480
8493
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Slides, {
|
|
8481
8494
|
activeIndex: activeIndex,
|
|
@@ -8785,7 +8798,7 @@ const COMPONENT_NAME$N = 'InlineList';
|
|
|
8785
8798
|
/**
|
|
8786
8799
|
* Component default class name and class prefix.
|
|
8787
8800
|
*/
|
|
8788
|
-
const CLASSNAME$N =
|
|
8801
|
+
const CLASSNAME$N = getRootClassName(COMPONENT_NAME$N);
|
|
8789
8802
|
|
|
8790
8803
|
/**
|
|
8791
8804
|
* Component default props.
|
|
@@ -8856,7 +8869,7 @@ const COMPONENT_NAME$M = 'InputLabel';
|
|
|
8856
8869
|
/**
|
|
8857
8870
|
* Component default class name and class prefix.
|
|
8858
8871
|
*/
|
|
8859
|
-
const CLASSNAME$M =
|
|
8872
|
+
const CLASSNAME$M = getRootClassName(COMPONENT_NAME$M);
|
|
8860
8873
|
|
|
8861
8874
|
/**
|
|
8862
8875
|
* Component default props.
|
|
@@ -8909,7 +8922,7 @@ const COMPONENT_NAME$L = 'Lightbox';
|
|
|
8909
8922
|
/**
|
|
8910
8923
|
* Component default class name and class prefix.
|
|
8911
8924
|
*/
|
|
8912
|
-
const CLASSNAME$L =
|
|
8925
|
+
const CLASSNAME$L = getRootClassName(COMPONENT_NAME$L);
|
|
8913
8926
|
|
|
8914
8927
|
/**
|
|
8915
8928
|
* Lightbox component.
|
|
@@ -9042,7 +9055,7 @@ const COMPONENT_NAME$K = 'Link';
|
|
|
9042
9055
|
/**
|
|
9043
9056
|
* Component default class name and class prefix.
|
|
9044
9057
|
*/
|
|
9045
|
-
const CLASSNAME$K =
|
|
9058
|
+
const CLASSNAME$K = getRootClassName(COMPONENT_NAME$K);
|
|
9046
9059
|
const getIconSize = typography => {
|
|
9047
9060
|
switch (typography) {
|
|
9048
9061
|
case Typography.display1:
|
|
@@ -9092,7 +9105,7 @@ const Link = forwardRef((props, ref) => {
|
|
|
9092
9105
|
typography
|
|
9093
9106
|
} = props,
|
|
9094
9107
|
forwardedProps = _objectWithoutProperties(props, _excluded$O);
|
|
9095
|
-
const renderedChildren = useMemo(() => /*#__PURE__*/React__default.createElement(React__default.Fragment, null, leftIcon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
9108
|
+
const renderedChildren = useMemo(() => /*#__PURE__*/React__default.createElement(React__default.Fragment, null, leftIcon && !isEmpty(leftIcon) && /*#__PURE__*/React__default.createElement(Icon, {
|
|
9096
9109
|
icon: leftIcon,
|
|
9097
9110
|
className: `${CLASSNAME$K}__left-icon`,
|
|
9098
9111
|
size: getIconSize(typography)
|
|
@@ -9100,7 +9113,7 @@ const Link = forwardRef((props, ref) => {
|
|
|
9100
9113
|
className: classNames(`${CLASSNAME$K}__content`, {
|
|
9101
9114
|
[`lumx-typography-${typography}`]: typography
|
|
9102
9115
|
})
|
|
9103
|
-
}, children), rightIcon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
9116
|
+
}, children), rightIcon && !isEmpty(rightIcon) && /*#__PURE__*/React__default.createElement(Icon, {
|
|
9104
9117
|
icon: rightIcon,
|
|
9105
9118
|
className: `${CLASSNAME$K}__right-icon`,
|
|
9106
9119
|
size: getIconSize(typography)
|
|
@@ -9110,7 +9123,7 @@ const Link = forwardRef((props, ref) => {
|
|
|
9110
9123
|
* If there is no linkAs prop and no href, we returned a <button> instead of a <a>.
|
|
9111
9124
|
* If the component is disabled, we also returned a <button> since disabled is not compatible with <a>.
|
|
9112
9125
|
*/
|
|
9113
|
-
if (!linkAs && href || isDisabled) {
|
|
9126
|
+
if (!linkAs && isEmpty(href) || isDisabled) {
|
|
9114
9127
|
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
9115
9128
|
type: "button"
|
|
9116
9129
|
}, forwardedProps, {
|
|
@@ -9153,7 +9166,7 @@ const COMPONENT_NAME$J = 'LinkPreview';
|
|
|
9153
9166
|
/**
|
|
9154
9167
|
* Component default class name and class prefix.
|
|
9155
9168
|
*/
|
|
9156
|
-
const CLASSNAME$J =
|
|
9169
|
+
const CLASSNAME$J = getRootClassName(COMPONENT_NAME$J);
|
|
9157
9170
|
|
|
9158
9171
|
/**
|
|
9159
9172
|
* Component default props.
|
|
@@ -9253,7 +9266,7 @@ const COMPONENT_NAME$I = 'ListDivider';
|
|
|
9253
9266
|
/**
|
|
9254
9267
|
* Component default class name and class prefix.
|
|
9255
9268
|
*/
|
|
9256
|
-
const CLASSNAME$I =
|
|
9269
|
+
const CLASSNAME$I = getRootClassName(COMPONENT_NAME$I);
|
|
9257
9270
|
|
|
9258
9271
|
/**
|
|
9259
9272
|
* ListDivider component.
|
|
@@ -9290,7 +9303,7 @@ const COMPONENT_NAME$H = 'ListSubheader';
|
|
|
9290
9303
|
/**
|
|
9291
9304
|
* Component default class name and class prefix.
|
|
9292
9305
|
*/
|
|
9293
|
-
const CLASSNAME$H =
|
|
9306
|
+
const CLASSNAME$H = getRootClassName(COMPONENT_NAME$H);
|
|
9294
9307
|
|
|
9295
9308
|
/**
|
|
9296
9309
|
* ListSubheader component.
|
|
@@ -9328,7 +9341,7 @@ const COMPONENT_NAME$G = 'Message';
|
|
|
9328
9341
|
/**
|
|
9329
9342
|
* Component default class name and class prefix.
|
|
9330
9343
|
*/
|
|
9331
|
-
const CLASSNAME$G =
|
|
9344
|
+
const CLASSNAME$G = getRootClassName(COMPONENT_NAME$G);
|
|
9332
9345
|
|
|
9333
9346
|
/**
|
|
9334
9347
|
* Associative map from message kind to color and icon.
|
|
@@ -9418,7 +9431,7 @@ const COMPONENT_NAME$F = 'Mosaic';
|
|
|
9418
9431
|
/**
|
|
9419
9432
|
* Component default class name and class prefix.
|
|
9420
9433
|
*/
|
|
9421
|
-
const CLASSNAME$F =
|
|
9434
|
+
const CLASSNAME$F = getRootClassName(COMPONENT_NAME$F);
|
|
9422
9435
|
|
|
9423
9436
|
/**
|
|
9424
9437
|
* Component default props.
|
|
@@ -9462,7 +9475,7 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
9462
9475
|
})
|
|
9463
9476
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9464
9477
|
className: `${CLASSNAME$F}__wrapper`
|
|
9465
|
-
}, thumbnails
|
|
9478
|
+
}, take(thumbnails, 4).map((thumbnail, index) => {
|
|
9466
9479
|
const {
|
|
9467
9480
|
image,
|
|
9468
9481
|
onClick,
|
|
@@ -9507,7 +9520,7 @@ const COMPONENT_NAME$E = 'NavigationItem';
|
|
|
9507
9520
|
/**
|
|
9508
9521
|
* Component default class name and class prefix.
|
|
9509
9522
|
*/
|
|
9510
|
-
const CLASSNAME$E =
|
|
9523
|
+
const CLASSNAME$E = getRootClassName(COMPONENT_NAME$E);
|
|
9511
9524
|
const NavigationItem = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
9512
9525
|
const {
|
|
9513
9526
|
className,
|
|
@@ -9569,7 +9582,7 @@ const COMPONENT_NAME$D = 'NavigationSection';
|
|
|
9569
9582
|
/**
|
|
9570
9583
|
* Component default class name and class prefix.
|
|
9571
9584
|
*/
|
|
9572
|
-
const CLASSNAME$D =
|
|
9585
|
+
const CLASSNAME$D = getRootClassName(COMPONENT_NAME$D);
|
|
9573
9586
|
const NavigationSection = forwardRef((props, ref) => {
|
|
9574
9587
|
const {
|
|
9575
9588
|
children,
|
|
@@ -9650,7 +9663,7 @@ const COMPONENT_NAME$C = 'Navigation';
|
|
|
9650
9663
|
/**
|
|
9651
9664
|
* Component default class name and class prefix.
|
|
9652
9665
|
*/
|
|
9653
|
-
const CLASSNAME$C =
|
|
9666
|
+
const CLASSNAME$C = getRootClassName(COMPONENT_NAME$C);
|
|
9654
9667
|
|
|
9655
9668
|
/**
|
|
9656
9669
|
* Component default props
|
|
@@ -9728,7 +9741,7 @@ const COMPONENT_NAME$B = 'Notification';
|
|
|
9728
9741
|
/**
|
|
9729
9742
|
* Component default class name and class prefix.
|
|
9730
9743
|
*/
|
|
9731
|
-
const CLASSNAME$B =
|
|
9744
|
+
const CLASSNAME$B = getRootClassName(COMPONENT_NAME$B);
|
|
9732
9745
|
|
|
9733
9746
|
/**
|
|
9734
9747
|
* Component default props.
|
|
@@ -9774,7 +9787,9 @@ const Notification = forwardRef((props, ref) => {
|
|
|
9774
9787
|
const isVisible = useTransitionVisibility(rootRef, !!isOpen, NOTIFICATION_TRANSITION_DURATION);
|
|
9775
9788
|
const hasAction = Boolean(onActionClick) && Boolean(actionLabel);
|
|
9776
9789
|
const handleCallback = evt => {
|
|
9777
|
-
|
|
9790
|
+
if (isFunction(onActionClick)) {
|
|
9791
|
+
onActionClick();
|
|
9792
|
+
}
|
|
9778
9793
|
evt.stopPropagation();
|
|
9779
9794
|
};
|
|
9780
9795
|
if (!type || !isVisible) {
|
|
@@ -9832,7 +9847,7 @@ const COMPONENT_NAME$A = 'PopoverDialog';
|
|
|
9832
9847
|
/**
|
|
9833
9848
|
* Component default class name and class prefix.
|
|
9834
9849
|
*/
|
|
9835
|
-
const CLASSNAME$A =
|
|
9850
|
+
const CLASSNAME$A = getRootClassName(COMPONENT_NAME$A);
|
|
9836
9851
|
|
|
9837
9852
|
/**
|
|
9838
9853
|
* Component default props.
|
|
@@ -9891,7 +9906,7 @@ const COMPONENT_NAME$z = 'PostBlock';
|
|
|
9891
9906
|
/**
|
|
9892
9907
|
* Component default class name and class prefix.
|
|
9893
9908
|
*/
|
|
9894
|
-
const CLASSNAME$z =
|
|
9909
|
+
const CLASSNAME$z = getRootClassName(COMPONENT_NAME$z);
|
|
9895
9910
|
|
|
9896
9911
|
/**
|
|
9897
9912
|
* Component default props.
|
|
@@ -9924,13 +9939,6 @@ const PostBlock = forwardRef((props, ref) => {
|
|
|
9924
9939
|
title
|
|
9925
9940
|
} = props,
|
|
9926
9941
|
forwardedProps = _objectWithoutProperties(props, _excluded$D);
|
|
9927
|
-
|
|
9928
|
-
// Display text as string or HTML
|
|
9929
|
-
const textContent = typeof text === 'string' ? {
|
|
9930
|
-
children: text
|
|
9931
|
-
} : {
|
|
9932
|
-
dangerouslySetInnerHTML: text
|
|
9933
|
-
};
|
|
9934
9942
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
9935
9943
|
ref: ref,
|
|
9936
9944
|
className: classNames(className, handleBasicClasses({
|
|
@@ -9953,9 +9961,15 @@ const PostBlock = forwardRef((props, ref) => {
|
|
|
9953
9961
|
onClick: onClick
|
|
9954
9962
|
}, title), meta && /*#__PURE__*/React__default.createElement("span", {
|
|
9955
9963
|
className: `${CLASSNAME$z}__meta`
|
|
9956
|
-
}, meta),
|
|
9964
|
+
}, meta), isObject(text) && text.__html ?
|
|
9965
|
+
/*#__PURE__*/
|
|
9966
|
+
// eslint-disable-next-line react/no-danger
|
|
9967
|
+
React__default.createElement("p", {
|
|
9968
|
+
dangerouslySetInnerHTML: text,
|
|
9969
|
+
className: `${CLASSNAME$z}__text`
|
|
9970
|
+
}) : /*#__PURE__*/React__default.createElement("p", {
|
|
9957
9971
|
className: `${CLASSNAME$z}__text`
|
|
9958
|
-
},
|
|
9972
|
+
}, text), attachments && /*#__PURE__*/React__default.createElement("div", {
|
|
9959
9973
|
className: `${CLASSNAME$z}__attachments`
|
|
9960
9974
|
}, attachments), (tags || actions) && /*#__PURE__*/React__default.createElement("div", {
|
|
9961
9975
|
className: `${CLASSNAME$z}__toolbar`
|
|
@@ -9978,7 +9992,7 @@ const COMPONENT_NAME$y = 'ProgressLinear';
|
|
|
9978
9992
|
/**
|
|
9979
9993
|
* Component default class name and class prefix.
|
|
9980
9994
|
*/
|
|
9981
|
-
const CLASSNAME$y =
|
|
9995
|
+
const CLASSNAME$y = getRootClassName(COMPONENT_NAME$y);
|
|
9982
9996
|
|
|
9983
9997
|
/**
|
|
9984
9998
|
* Component default props.
|
|
@@ -10034,7 +10048,7 @@ const COMPONENT_NAME$x = 'ProgressCircular';
|
|
|
10034
10048
|
/**
|
|
10035
10049
|
* Component default class name and class prefix.
|
|
10036
10050
|
*/
|
|
10037
|
-
const CLASSNAME$x =
|
|
10051
|
+
const CLASSNAME$x = getRootClassName(COMPONENT_NAME$x);
|
|
10038
10052
|
|
|
10039
10053
|
/**
|
|
10040
10054
|
* Component default props.
|
|
@@ -10108,7 +10122,7 @@ const COMPONENT_NAME$w = 'Progress';
|
|
|
10108
10122
|
/**
|
|
10109
10123
|
* Component default class name and class prefix.
|
|
10110
10124
|
*/
|
|
10111
|
-
const CLASSNAME$w =
|
|
10125
|
+
const CLASSNAME$w = getRootClassName(COMPONENT_NAME$w);
|
|
10112
10126
|
|
|
10113
10127
|
/**
|
|
10114
10128
|
* Component default props.
|
|
@@ -10409,7 +10423,7 @@ const COMPONENT_NAME$v = 'ProgressTracker';
|
|
|
10409
10423
|
/**
|
|
10410
10424
|
* Component default class name and class prefix.
|
|
10411
10425
|
*/
|
|
10412
|
-
const CLASSNAME$v =
|
|
10426
|
+
const CLASSNAME$v = getRootClassName(COMPONENT_NAME$v);
|
|
10413
10427
|
|
|
10414
10428
|
/**
|
|
10415
10429
|
* Component default props.
|
|
@@ -10485,7 +10499,7 @@ const COMPONENT_NAME$u = 'ProgressTrackerStep';
|
|
|
10485
10499
|
/**
|
|
10486
10500
|
* Component default class name and class prefix.
|
|
10487
10501
|
*/
|
|
10488
|
-
const CLASSNAME$u =
|
|
10502
|
+
const CLASSNAME$u = getRootClassName(COMPONENT_NAME$u);
|
|
10489
10503
|
|
|
10490
10504
|
/**
|
|
10491
10505
|
* Component default props.
|
|
@@ -10654,7 +10668,7 @@ const COMPONENT_NAME$s = 'RadioButton';
|
|
|
10654
10668
|
/**
|
|
10655
10669
|
* Component default class name and class prefix.
|
|
10656
10670
|
*/
|
|
10657
|
-
const CLASSNAME$s =
|
|
10671
|
+
const CLASSNAME$s = getRootClassName(COMPONENT_NAME$s);
|
|
10658
10672
|
|
|
10659
10673
|
/**
|
|
10660
10674
|
* Component default props.
|
|
@@ -10754,7 +10768,7 @@ const COMPONENT_NAME$r = 'RadioGroup';
|
|
|
10754
10768
|
/**
|
|
10755
10769
|
* Component default class name and class prefix.
|
|
10756
10770
|
*/
|
|
10757
|
-
const CLASSNAME$r =
|
|
10771
|
+
const CLASSNAME$r = getRootClassName(COMPONENT_NAME$r);
|
|
10758
10772
|
|
|
10759
10773
|
/**
|
|
10760
10774
|
* RadioGroup component.
|
|
@@ -10784,7 +10798,7 @@ const _excluded$t = ["anchorRef", "clearButtonProps", "handleKeyboardNav", "hasE
|
|
|
10784
10798
|
const COMPONENT_NAME$q = 'Select';
|
|
10785
10799
|
|
|
10786
10800
|
/** The default class name and classes prefix for this component. */
|
|
10787
|
-
const CLASSNAME$q =
|
|
10801
|
+
const CLASSNAME$q = getRootClassName(COMPONENT_NAME$q);
|
|
10788
10802
|
|
|
10789
10803
|
/** The default value of props. */
|
|
10790
10804
|
const DEFAULT_PROPS$n = {
|
|
@@ -10882,8 +10896,8 @@ const SelectField = props => {
|
|
|
10882
10896
|
* @return React element.
|
|
10883
10897
|
*/
|
|
10884
10898
|
const Select = forwardRef((props, ref) => {
|
|
10885
|
-
const isEmpty =
|
|
10886
|
-
const hasInputClear = props.onClear && props.clearButtonProps && !isEmpty;
|
|
10899
|
+
const isEmpty$1 = isEmpty(props.value);
|
|
10900
|
+
const hasInputClear = props.onClear && props.clearButtonProps && !isEmpty$1;
|
|
10887
10901
|
return WithSelectContext(SelectField, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
10888
10902
|
className: classNames(props.className, handleBasicClasses({
|
|
10889
10903
|
hasInputClear,
|
|
@@ -10891,7 +10905,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
10891
10905
|
prefix: CLASSNAME$q
|
|
10892
10906
|
})),
|
|
10893
10907
|
hasInputClear,
|
|
10894
|
-
isEmpty
|
|
10908
|
+
isEmpty: isEmpty$1
|
|
10895
10909
|
}), ref);
|
|
10896
10910
|
});
|
|
10897
10911
|
Select.displayName = COMPONENT_NAME$q;
|
|
@@ -10907,7 +10921,7 @@ const _excluded$s = ["anchorRef", "handleKeyboardNav", "hasError", "icon", "id",
|
|
|
10907
10921
|
const COMPONENT_NAME$p = 'Select';
|
|
10908
10922
|
|
|
10909
10923
|
/** The default class name and classes prefix for this component. */
|
|
10910
|
-
const CLASSNAME$p =
|
|
10924
|
+
const CLASSNAME$p = getRootClassName(COMPONENT_NAME$p);
|
|
10911
10925
|
|
|
10912
10926
|
/** The default value of props. */
|
|
10913
10927
|
const DEFAULT_PROPS$m = {
|
|
@@ -11035,7 +11049,7 @@ const COMPONENT_NAME$o = 'SideNavigation';
|
|
|
11035
11049
|
/**
|
|
11036
11050
|
* Component default class name and class prefix.
|
|
11037
11051
|
*/
|
|
11038
|
-
const CLASSNAME$o =
|
|
11052
|
+
const CLASSNAME$o = getRootClassName(COMPONENT_NAME$o);
|
|
11039
11053
|
|
|
11040
11054
|
/**
|
|
11041
11055
|
* SideNavigation component.
|
|
@@ -11052,7 +11066,7 @@ const SideNavigation = forwardRef((props, ref) => {
|
|
|
11052
11066
|
theme = defaultTheme
|
|
11053
11067
|
} = props,
|
|
11054
11068
|
forwardedProps = _objectWithoutProperties(props, _excluded$r);
|
|
11055
|
-
const content = Children.toArray(children).filter(
|
|
11069
|
+
const content = Children.toArray(children).filter(isComponent(SideNavigationItem));
|
|
11056
11070
|
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
11057
11071
|
ref: ref
|
|
11058
11072
|
}, forwardedProps, {
|
|
@@ -11095,7 +11109,7 @@ const COMPONENT_NAME$n = 'SideNavigationItem';
|
|
|
11095
11109
|
/**
|
|
11096
11110
|
* Component default class name and class prefix.
|
|
11097
11111
|
*/
|
|
11098
|
-
const CLASSNAME$n =
|
|
11112
|
+
const CLASSNAME$n = getRootClassName(COMPONENT_NAME$n);
|
|
11099
11113
|
|
|
11100
11114
|
/**
|
|
11101
11115
|
* Component default props.
|
|
@@ -11129,8 +11143,8 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
11129
11143
|
closeMode = 'unmount'
|
|
11130
11144
|
} = props,
|
|
11131
11145
|
forwardedProps = _objectWithoutProperties(props, _excluded$p);
|
|
11132
|
-
const content = children && Children.toArray(children).filter(
|
|
11133
|
-
const hasContent = !isEmpty
|
|
11146
|
+
const content = children && Children.toArray(children).filter(isComponent(SideNavigationItem));
|
|
11147
|
+
const hasContent = !isEmpty(content);
|
|
11134
11148
|
const shouldSplitActions = Boolean(onActionClick);
|
|
11135
11149
|
const showChildren = hasContent && isOpen;
|
|
11136
11150
|
const contentId = useId();
|
|
@@ -11206,7 +11220,7 @@ const COMPONENT_NAME$m = 'SkeletonCircle';
|
|
|
11206
11220
|
/**
|
|
11207
11221
|
* Component default class name and class prefix.
|
|
11208
11222
|
*/
|
|
11209
|
-
const CLASSNAME$m =
|
|
11223
|
+
const CLASSNAME$m = getRootClassName(COMPONENT_NAME$m);
|
|
11210
11224
|
|
|
11211
11225
|
/**
|
|
11212
11226
|
* SkeletonCircle component.
|
|
@@ -11266,7 +11280,7 @@ const COMPONENT_NAME$l = 'SkeletonRectangle';
|
|
|
11266
11280
|
/**
|
|
11267
11281
|
* Component default class name and class prefix.
|
|
11268
11282
|
*/
|
|
11269
|
-
const CLASSNAME$l =
|
|
11283
|
+
const CLASSNAME$l = getRootClassName(COMPONENT_NAME$l);
|
|
11270
11284
|
|
|
11271
11285
|
/**
|
|
11272
11286
|
* SkeletonRectangle component.
|
|
@@ -11323,7 +11337,7 @@ const COMPONENT_NAME$k = 'SkeletonTypography';
|
|
|
11323
11337
|
/**
|
|
11324
11338
|
* Component default class name and class prefix.
|
|
11325
11339
|
*/
|
|
11326
|
-
const CLASSNAME$k =
|
|
11340
|
+
const CLASSNAME$k = getRootClassName(COMPONENT_NAME$k);
|
|
11327
11341
|
|
|
11328
11342
|
/**
|
|
11329
11343
|
* SkeletonTypography component.
|
|
@@ -11410,7 +11424,7 @@ const COMPONENT_NAME$j = 'Slider';
|
|
|
11410
11424
|
/**
|
|
11411
11425
|
* Component default class name and class prefix.
|
|
11412
11426
|
*/
|
|
11413
|
-
const CLASSNAME$j =
|
|
11427
|
+
const CLASSNAME$j = getRootClassName(COMPONENT_NAME$j);
|
|
11414
11428
|
|
|
11415
11429
|
/**
|
|
11416
11430
|
* Component default props.
|
|
@@ -11675,8 +11689,9 @@ function useInterval(callback, delay) {
|
|
|
11675
11689
|
useEffect(() => {
|
|
11676
11690
|
if (delay === null) return undefined;
|
|
11677
11691
|
function tick() {
|
|
11678
|
-
|
|
11679
|
-
|
|
11692
|
+
if (isFunction(savedCallback.current)) {
|
|
11693
|
+
savedCallback.current();
|
|
11694
|
+
}
|
|
11680
11695
|
}
|
|
11681
11696
|
const id = setInterval(tick, delay);
|
|
11682
11697
|
return () => clearInterval(id);
|
|
@@ -11993,7 +12008,7 @@ const COMPONENT_NAME$i = 'SlideshowItemGroup';
|
|
|
11993
12008
|
/**
|
|
11994
12009
|
* Component default class name and class prefix.
|
|
11995
12010
|
*/
|
|
11996
|
-
const CLASSNAME$i =
|
|
12011
|
+
const CLASSNAME$i = getRootClassName(COMPONENT_NAME$i);
|
|
11997
12012
|
const buildSlideShowGroupId = (slidesId, index) => `${slidesId}-slide-${index}`;
|
|
11998
12013
|
|
|
11999
12014
|
/**
|
|
@@ -12159,7 +12174,7 @@ const COMPONENT_NAME$h = 'SlideshowItem';
|
|
|
12159
12174
|
/**
|
|
12160
12175
|
* Component default class name and class prefix.
|
|
12161
12176
|
*/
|
|
12162
|
-
const CLASSNAME$h =
|
|
12177
|
+
const CLASSNAME$h = getRootClassName(COMPONENT_NAME$h);
|
|
12163
12178
|
|
|
12164
12179
|
/**
|
|
12165
12180
|
* SlideshowItem component.
|
|
@@ -12239,11 +12254,6 @@ function usePaginationVisibleRange(activeIndex, slideCount) {
|
|
|
12239
12254
|
}, [activeIndex, slideCount]);
|
|
12240
12255
|
}
|
|
12241
12256
|
|
|
12242
|
-
/** Generate a range of number starting at 0 and ending before the given number */
|
|
12243
|
-
const range = end => Array.from({
|
|
12244
|
-
length: end
|
|
12245
|
-
}, (_, i) => i);
|
|
12246
|
-
|
|
12247
12257
|
const _excluded$h = ["activeIndex", "className", "nextButtonProps", "onNextClick", "onPaginationClick", "onPreviousClick", "parentRef", "previousButtonProps", "paginationProps", "slidesCount", "theme", "isAutoPlaying", "playButtonProps", "paginationItemLabel", "paginationItemProps"],
|
|
12248
12258
|
_excluded2$1 = ["className", "label"];
|
|
12249
12259
|
|
|
@@ -12259,7 +12269,7 @@ const COMPONENT_NAME$g = 'SlideshowControls';
|
|
|
12259
12269
|
/**
|
|
12260
12270
|
* Component default class name and class prefix.
|
|
12261
12271
|
*/
|
|
12262
|
-
const CLASSNAME$g =
|
|
12272
|
+
const CLASSNAME$g = getRootClassName(COMPONENT_NAME$g);
|
|
12263
12273
|
|
|
12264
12274
|
/**
|
|
12265
12275
|
* Component default props.
|
|
@@ -12396,13 +12406,6 @@ const SlideshowControls = Object.assign(InternalSlideshowControls, {
|
|
|
12396
12406
|
useSlideshowControlsDefaultOptions: DEFAULT_OPTIONS
|
|
12397
12407
|
});
|
|
12398
12408
|
|
|
12399
|
-
/** Chunk array in slices of given size */
|
|
12400
|
-
function chunk(input, size) {
|
|
12401
|
-
return input.reduce((arr, item, idx) => {
|
|
12402
|
-
return idx % size === 0 ? [...arr, [item]] : [...arr.slice(0, -1), [...arr.slice(-1)[0], item]];
|
|
12403
|
-
}, []);
|
|
12404
|
-
}
|
|
12405
|
-
|
|
12406
12409
|
const _excluded$g = ["activeIndex", "id", "className", "theme", "fillHeight", "groupBy", "isAutoPlaying", "toggleAutoPlay", "slidesId", "children", "afterSlides", "hasControls", "slideGroupLabel"];
|
|
12407
12410
|
/**
|
|
12408
12411
|
* Component display name.
|
|
@@ -12412,7 +12415,7 @@ const COMPONENT_NAME$f = 'Slideshow';
|
|
|
12412
12415
|
/**
|
|
12413
12416
|
* Component default class name and class prefix.
|
|
12414
12417
|
*/
|
|
12415
|
-
const CLASSNAME$f =
|
|
12418
|
+
const CLASSNAME$f = getRootClassName(COMPONENT_NAME$f);
|
|
12416
12419
|
|
|
12417
12420
|
/**
|
|
12418
12421
|
* Slides component.
|
|
@@ -12498,7 +12501,7 @@ const COMPONENT_NAME$e = 'Switch';
|
|
|
12498
12501
|
/**
|
|
12499
12502
|
* Component default class name and class prefix.
|
|
12500
12503
|
*/
|
|
12501
|
-
const CLASSNAME$e =
|
|
12504
|
+
const CLASSNAME$e = getRootClassName(COMPONENT_NAME$e);
|
|
12502
12505
|
|
|
12503
12506
|
/**
|
|
12504
12507
|
* Component default props.
|
|
@@ -12578,7 +12581,7 @@ const Switch = forwardRef((props, ref) => {
|
|
|
12578
12581
|
htmlFor: inputId,
|
|
12579
12582
|
theme: theme,
|
|
12580
12583
|
className: `${CLASSNAME$e}__label`
|
|
12581
|
-
}, children), helper && /*#__PURE__*/React__default.createElement(InputHelper, {
|
|
12584
|
+
}, children), !isEmpty(helper) && /*#__PURE__*/React__default.createElement(InputHelper, {
|
|
12582
12585
|
id: `${inputId}-helper`,
|
|
12583
12586
|
theme: theme,
|
|
12584
12587
|
className: `${CLASSNAME$e}__helper`
|
|
@@ -12602,7 +12605,7 @@ const COMPONENT_NAME$d = 'Table';
|
|
|
12602
12605
|
/**
|
|
12603
12606
|
* Component default class name and class prefix.
|
|
12604
12607
|
*/
|
|
12605
|
-
const CLASSNAME$d =
|
|
12608
|
+
const CLASSNAME$d = getRootClassName(COMPONENT_NAME$d);
|
|
12606
12609
|
|
|
12607
12610
|
/**
|
|
12608
12611
|
* Component default props.
|
|
@@ -12655,7 +12658,7 @@ const COMPONENT_NAME$c = 'TableBody';
|
|
|
12655
12658
|
/**
|
|
12656
12659
|
* Component default class name and class prefix.
|
|
12657
12660
|
*/
|
|
12658
|
-
const CLASSNAME$c =
|
|
12661
|
+
const CLASSNAME$c = getRootClassName(COMPONENT_NAME$c, true);
|
|
12659
12662
|
|
|
12660
12663
|
/**
|
|
12661
12664
|
* TableBody component.
|
|
@@ -12708,7 +12711,7 @@ const COMPONENT_NAME$b = 'TableCell';
|
|
|
12708
12711
|
/**
|
|
12709
12712
|
* Component default class name and class prefix.
|
|
12710
12713
|
*/
|
|
12711
|
-
const CLASSNAME$b =
|
|
12714
|
+
const CLASSNAME$b = getRootClassName(COMPONENT_NAME$b, true);
|
|
12712
12715
|
|
|
12713
12716
|
/**
|
|
12714
12717
|
* Component default props.
|
|
@@ -12799,7 +12802,7 @@ const COMPONENT_NAME$a = 'TableHeader';
|
|
|
12799
12802
|
/**
|
|
12800
12803
|
* Component default class name and class prefix.
|
|
12801
12804
|
*/
|
|
12802
|
-
const CLASSNAME$a =
|
|
12805
|
+
const CLASSNAME$a = getRootClassName(COMPONENT_NAME$a, true);
|
|
12803
12806
|
|
|
12804
12807
|
/**
|
|
12805
12808
|
* Component default props.
|
|
@@ -12843,7 +12846,7 @@ const COMPONENT_NAME$9 = 'TableRow';
|
|
|
12843
12846
|
/**
|
|
12844
12847
|
* Component default class name and class prefix.
|
|
12845
12848
|
*/
|
|
12846
|
-
const CLASSNAME$9 =
|
|
12849
|
+
const CLASSNAME$9 = getRootClassName(COMPONENT_NAME$9, true);
|
|
12847
12850
|
|
|
12848
12851
|
/**
|
|
12849
12852
|
* Component default props.
|
|
@@ -13175,7 +13178,7 @@ const COMPONENT_NAME$5 = 'TextField';
|
|
|
13175
13178
|
/**
|
|
13176
13179
|
* Component default class name and class prefix.
|
|
13177
13180
|
*/
|
|
13178
|
-
const CLASSNAME$5 =
|
|
13181
|
+
const CLASSNAME$5 = getRootClassName(COMPONENT_NAME$5);
|
|
13179
13182
|
|
|
13180
13183
|
/**
|
|
13181
13184
|
* Default minimum number of rows in the multiline mode.
|
|
@@ -13264,7 +13267,7 @@ const renderInputNative = props => {
|
|
|
13264
13267
|
setFocus(false);
|
|
13265
13268
|
};
|
|
13266
13269
|
const handleChange = event => {
|
|
13267
|
-
onChange(event
|
|
13270
|
+
onChange(get(event, 'target.value'), name, event);
|
|
13268
13271
|
};
|
|
13269
13272
|
const Component = multiline ? 'textarea' : 'input';
|
|
13270
13273
|
const inputProps = _objectSpread2(_objectSpread2({}, forwardedProps), {}, {
|
|
@@ -13644,7 +13647,7 @@ const COMPONENT_NAME$4 = 'Thumbnail';
|
|
|
13644
13647
|
/**
|
|
13645
13648
|
* Component default class name and class prefix.
|
|
13646
13649
|
*/
|
|
13647
|
-
const CLASSNAME$4 =
|
|
13650
|
+
const CLASSNAME$4 = getRootClassName(COMPONENT_NAME$4);
|
|
13648
13651
|
|
|
13649
13652
|
/**
|
|
13650
13653
|
* Component default props.
|
|
@@ -13832,7 +13835,7 @@ const COMPONENT_NAME$3 = 'Toolbar';
|
|
|
13832
13835
|
/**
|
|
13833
13836
|
* Component default class name and class prefix.
|
|
13834
13837
|
*/
|
|
13835
|
-
const CLASSNAME$3 =
|
|
13838
|
+
const CLASSNAME$3 = getRootClassName(COMPONENT_NAME$3);
|
|
13836
13839
|
|
|
13837
13840
|
/**
|
|
13838
13841
|
* Component default props.
|
|
@@ -14079,7 +14082,7 @@ const COMPONENT_NAME$2 = 'Tooltip';
|
|
|
14079
14082
|
/**
|
|
14080
14083
|
* Component default class name and class prefix.
|
|
14081
14084
|
*/
|
|
14082
|
-
const CLASSNAME$2 =
|
|
14085
|
+
const CLASSNAME$2 = getRootClassName(COMPONENT_NAME$2);
|
|
14083
14086
|
|
|
14084
14087
|
/**
|
|
14085
14088
|
* Component default props.
|
|
@@ -14216,7 +14219,7 @@ const COMPONENT_NAME$1 = 'Uploader';
|
|
|
14216
14219
|
/**
|
|
14217
14220
|
* Component default class name and class prefix.
|
|
14218
14221
|
*/
|
|
14219
|
-
const CLASSNAME$1 =
|
|
14222
|
+
const CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
|
|
14220
14223
|
|
|
14221
14224
|
/**
|
|
14222
14225
|
* Component default props.
|
|
@@ -14325,7 +14328,7 @@ const COMPONENT_NAME = 'UserBlock';
|
|
|
14325
14328
|
/**
|
|
14326
14329
|
* Component default class name and class prefix.
|
|
14327
14330
|
*/
|
|
14328
|
-
const CLASSNAME =
|
|
14331
|
+
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
14329
14332
|
|
|
14330
14333
|
/**
|
|
14331
14334
|
* Component default props.
|
|
@@ -14372,7 +14375,7 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14372
14375
|
const isLink = Boolean((linkProps === null || linkProps === void 0 ? void 0 : linkProps.href) || linkAs);
|
|
14373
14376
|
const isClickable = !!onClick || isLink;
|
|
14374
14377
|
const nameBlock = React__default.useMemo(() => {
|
|
14375
|
-
if (
|
|
14378
|
+
if (isEmpty(name)) {
|
|
14376
14379
|
return null;
|
|
14377
14380
|
}
|
|
14378
14381
|
let NameComponent = 'span';
|
|
@@ -14387,8 +14390,12 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14387
14390
|
color: ColorPalette.dark
|
|
14388
14391
|
}));
|
|
14389
14392
|
}
|
|
14393
|
+
// Disable avatar focus since the name block is the same link / same button.
|
|
14394
|
+
if (avatarProps) {
|
|
14395
|
+
set(avatarProps, ['thumbnailProps', 'tabIndex'], -1);
|
|
14396
|
+
}
|
|
14390
14397
|
return /*#__PURE__*/React__default.createElement(NameComponent, nProps, name);
|
|
14391
|
-
}, [isClickable, linkAs, linkProps, name, nameProps, onClick]);
|
|
14398
|
+
}, [avatarProps, isClickable, linkAs, linkProps, name, nameProps, onClick]);
|
|
14392
14399
|
const fieldsBlock = fields && componentSize !== Size.s && componentSize !== Size.xs && /*#__PURE__*/React__default.createElement("div", {
|
|
14393
14400
|
className: `${CLASSNAME}__fields`
|
|
14394
14401
|
}, fields.map((field, idx) => /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -14415,11 +14422,7 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14415
14422
|
className: classNames(`${CLASSNAME}__avatar`, avatarProps.className),
|
|
14416
14423
|
size: componentSize,
|
|
14417
14424
|
onClick: onClick,
|
|
14418
|
-
theme: theme
|
|
14419
|
-
thumbnailProps: _objectSpread2(_objectSpread2({}, avatarProps === null || avatarProps === void 0 ? void 0 : avatarProps.thumbnailProps), {}, {
|
|
14420
|
-
// Disable avatar focus since the name block is the same link / same button.
|
|
14421
|
-
tabIndex: avatarProps ? -1 : undefined
|
|
14422
|
-
})
|
|
14425
|
+
theme: theme
|
|
14423
14426
|
})), (fields || name) && /*#__PURE__*/React__default.createElement("div", {
|
|
14424
14427
|
className: `${CLASSNAME}__wrapper`
|
|
14425
14428
|
}, nameBlock, fieldsBlock), shouldDisplayActions && simpleAction && /*#__PURE__*/React__default.createElement("div", {
|