@lumx/react 4.3.2-alpha.0 → 4.3.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/DpdvhbTO.js +159 -0
- package/_internal/DpdvhbTO.js.map +1 -0
- package/index.d.ts +195 -512
- package/index.js +970 -2125
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/utils/index.js +1289 -3
- package/utils/index.js.map +1 -1
- package/_internal/Ui3KfDoH.js +0 -1447
- package/_internal/Ui3KfDoH.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio, ColorVariant,
|
|
1
|
+
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio, ColorVariant, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
|
|
2
2
|
export * from '@lumx/core/js/constants';
|
|
3
3
|
export * from '@lumx/core/js/types';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import React__default, {
|
|
5
|
+
import React__default, { useState, useEffect, useMemo, useRef, useCallback, Children, useLayoutEffect, cloneElement, createContext, isValidElement, useContext, useReducer } from 'react';
|
|
6
6
|
import { mdiAlert } from '@lumx/icons/esm/alert';
|
|
7
7
|
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle';
|
|
8
8
|
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle';
|
|
9
9
|
import { mdiInformation } from '@lumx/icons/esm/information';
|
|
10
|
-
import uniqueId from 'lodash/uniqueId';
|
|
11
10
|
import { classNames, onEnterPressed, onEscapePressed, onButtonPressed, detectHorizontalSwipe } from '@lumx/core/js/utils';
|
|
12
11
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
13
12
|
import last from 'lodash/last';
|
|
@@ -17,7 +16,7 @@ import concat from 'lodash/concat';
|
|
|
17
16
|
import dropRight from 'lodash/dropRight';
|
|
18
17
|
import partition from 'lodash/partition';
|
|
19
18
|
import reduce from 'lodash/reduce';
|
|
20
|
-
import { u as useDisabledStateContext,
|
|
19
|
+
import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/DpdvhbTO.js';
|
|
21
20
|
import isEmpty from 'lodash/isEmpty';
|
|
22
21
|
import { getDisabledState } from '@lumx/core/js/utils/disabledState';
|
|
23
22
|
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle';
|
|
@@ -27,15 +26,13 @@ import isFunction from 'lodash/isFunction';
|
|
|
27
26
|
import { mdiImageBroken } from '@lumx/icons/esm/image-broken';
|
|
28
27
|
import { mdiCheck } from '@lumx/icons/esm/check';
|
|
29
28
|
import { mdiMinus } from '@lumx/icons/esm/minus';
|
|
30
|
-
import { visuallyHidden, bem as bem$1 } from '@lumx/core/js/utils/classNames';
|
|
31
|
-
import noop from 'lodash/noop';
|
|
32
|
-
import debounce$1 from 'lodash/debounce';
|
|
33
|
-
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down';
|
|
34
|
-
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up';
|
|
35
|
-
import castArray from 'lodash/castArray';
|
|
36
29
|
import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left';
|
|
37
30
|
import { mdiChevronRight } from '@lumx/icons/esm/chevron-right';
|
|
31
|
+
import castArray from 'lodash/castArray';
|
|
38
32
|
import { mdiDragVertical } from '@lumx/icons/esm/drag-vertical';
|
|
33
|
+
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down';
|
|
34
|
+
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up';
|
|
35
|
+
import noop from 'lodash/noop';
|
|
39
36
|
import pick from 'lodash/pick';
|
|
40
37
|
import isInteger from 'lodash/isInteger';
|
|
41
38
|
import { mdiMagnifyMinusOutline } from '@lumx/icons/esm/magnify-minus-outline';
|
|
@@ -55,16 +52,19 @@ import { mdiArrowDown } from '@lumx/icons/esm/arrow-down';
|
|
|
55
52
|
import { mdiArrowUp } from '@lumx/icons/esm/arrow-up';
|
|
56
53
|
import set from 'lodash/set';
|
|
57
54
|
|
|
55
|
+
let i = 0;
|
|
56
|
+
|
|
58
57
|
/**
|
|
59
|
-
* Generate a unique
|
|
60
|
-
* This is similar to, but much simpler than, React's `useId` hook.
|
|
58
|
+
* Generate a unique id (for use in a11y or other id based DOM linking).
|
|
61
59
|
*
|
|
62
|
-
*
|
|
60
|
+
* (Tries to emulate React 18 useId hook, to remove once we upgrade React)
|
|
63
61
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
62
|
+
function useId() {
|
|
63
|
+
return React__default.useMemo(() => {
|
|
64
|
+
i += 1;
|
|
65
|
+
return `:lumx${i}:`;
|
|
66
|
+
}, []);
|
|
67
|
+
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* React.forwardRef but re-typed to attach some custom metadata on our components.
|
|
@@ -101,15 +101,15 @@ const COMPONENT_NAME$1k = 'AlertDialog';
|
|
|
101
101
|
/**
|
|
102
102
|
* Component default class name and class prefix.
|
|
103
103
|
*/
|
|
104
|
-
const CLASSNAME$
|
|
104
|
+
const CLASSNAME$1j = 'lumx-alert-dialog';
|
|
105
105
|
const {
|
|
106
|
-
block: block$
|
|
107
|
-
} = classNames.bem(CLASSNAME$
|
|
106
|
+
block: block$14
|
|
107
|
+
} = classNames.bem(CLASSNAME$1j);
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Component default props.
|
|
111
111
|
*/
|
|
112
|
-
const DEFAULT_PROPS$
|
|
112
|
+
const DEFAULT_PROPS$1a = {
|
|
113
113
|
size: Size$1.tiny,
|
|
114
114
|
kind: Kind$1.info
|
|
115
115
|
};
|
|
@@ -130,8 +130,8 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
130
130
|
className,
|
|
131
131
|
cancelProps,
|
|
132
132
|
confirmProps,
|
|
133
|
-
kind = DEFAULT_PROPS$
|
|
134
|
-
size = DEFAULT_PROPS$
|
|
133
|
+
kind = DEFAULT_PROPS$1a.kind,
|
|
134
|
+
size = DEFAULT_PROPS$1a.size,
|
|
135
135
|
dialogProps,
|
|
136
136
|
children,
|
|
137
137
|
...forwardedProps
|
|
@@ -172,7 +172,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
172
172
|
'aria-describedby': descriptionId,
|
|
173
173
|
...dialogProps
|
|
174
174
|
},
|
|
175
|
-
className: classNames.join(className, block$
|
|
175
|
+
className: classNames.join(className, block$14({
|
|
176
176
|
[`kind-${kind}`]: Boolean(kind)
|
|
177
177
|
})),
|
|
178
178
|
...forwardedProps,
|
|
@@ -218,8 +218,8 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
218
218
|
});
|
|
219
219
|
});
|
|
220
220
|
AlertDialog.displayName = COMPONENT_NAME$1k;
|
|
221
|
-
AlertDialog.className = CLASSNAME$
|
|
222
|
-
AlertDialog.defaultProps = DEFAULT_PROPS$
|
|
221
|
+
AlertDialog.className = CLASSNAME$1j;
|
|
222
|
+
AlertDialog.defaultProps = DEFAULT_PROPS$1a;
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
225
|
* Hook focusing an element when defined and `focus` boolean `true`.
|
|
@@ -316,12 +316,12 @@ const COMPONENT_NAME$1j = 'Autocomplete';
|
|
|
316
316
|
/**
|
|
317
317
|
* Component default class name and class prefix.
|
|
318
318
|
*/
|
|
319
|
-
const CLASSNAME$
|
|
319
|
+
const CLASSNAME$1i = 'lumx-autocomplete';
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
322
|
* Component default props.
|
|
323
323
|
*/
|
|
324
|
-
const DEFAULT_PROPS$
|
|
324
|
+
const DEFAULT_PROPS$19 = {
|
|
325
325
|
anchorToInput: false,
|
|
326
326
|
closeOnClick: false,
|
|
327
327
|
closeOnClickAway: true,
|
|
@@ -343,13 +343,13 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
343
343
|
otherProps
|
|
344
344
|
} = useDisableStateProps(props);
|
|
345
345
|
const {
|
|
346
|
-
anchorToInput = DEFAULT_PROPS$
|
|
346
|
+
anchorToInput = DEFAULT_PROPS$19.anchorToInput,
|
|
347
347
|
children,
|
|
348
348
|
chips,
|
|
349
349
|
className,
|
|
350
|
-
closeOnClick = DEFAULT_PROPS$
|
|
351
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
352
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
350
|
+
closeOnClick = DEFAULT_PROPS$19.closeOnClick,
|
|
351
|
+
closeOnClickAway = DEFAULT_PROPS$19.closeOnClickAway,
|
|
352
|
+
closeOnEscape = DEFAULT_PROPS$19.closeOnEscape,
|
|
353
353
|
error,
|
|
354
354
|
fitToAnchorWidth,
|
|
355
355
|
hasError,
|
|
@@ -370,7 +370,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
370
370
|
onInfiniteScroll,
|
|
371
371
|
placeholder,
|
|
372
372
|
placement,
|
|
373
|
-
shouldFocusOnClose = DEFAULT_PROPS$
|
|
373
|
+
shouldFocusOnClose = DEFAULT_PROPS$19.shouldFocusOnClose,
|
|
374
374
|
theme = defaultTheme,
|
|
375
375
|
value,
|
|
376
376
|
textFieldProps = {},
|
|
@@ -383,7 +383,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
383
383
|
return /*#__PURE__*/jsxs("div", {
|
|
384
384
|
ref: ref,
|
|
385
385
|
...forwardedProps,
|
|
386
|
-
className: classNames.join(className, CLASSNAME$
|
|
386
|
+
className: classNames.join(className, CLASSNAME$1i),
|
|
387
387
|
children: [/*#__PURE__*/jsx(TextField, {
|
|
388
388
|
...textFieldProps,
|
|
389
389
|
chips: chips,
|
|
@@ -424,8 +424,8 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
Autocomplete.displayName = COMPONENT_NAME$1j;
|
|
427
|
-
Autocomplete.className = CLASSNAME$
|
|
428
|
-
Autocomplete.defaultProps = DEFAULT_PROPS$
|
|
427
|
+
Autocomplete.className = CLASSNAME$1i;
|
|
428
|
+
Autocomplete.defaultProps = DEFAULT_PROPS$19;
|
|
429
429
|
|
|
430
430
|
/**
|
|
431
431
|
* Component display name.
|
|
@@ -435,12 +435,12 @@ const COMPONENT_NAME$1i = 'AutocompleteMultiple';
|
|
|
435
435
|
/**
|
|
436
436
|
* Component default class name and class prefix.
|
|
437
437
|
*/
|
|
438
|
-
const CLASSNAME$
|
|
438
|
+
const CLASSNAME$1h = 'lumx-autocomplete-multiple';
|
|
439
439
|
|
|
440
440
|
/**
|
|
441
441
|
* Component default props.
|
|
442
442
|
*/
|
|
443
|
-
const DEFAULT_PROPS$
|
|
443
|
+
const DEFAULT_PROPS$18 = {
|
|
444
444
|
closeOnClickAway: true,
|
|
445
445
|
closeOnEscape: true,
|
|
446
446
|
selectedChipRender(choice, index, onClear, isDisabled) {
|
|
@@ -480,8 +480,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
480
480
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
481
481
|
chipsAlignment,
|
|
482
482
|
className,
|
|
483
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
484
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
483
|
+
closeOnClickAway = DEFAULT_PROPS$18.closeOnClickAway,
|
|
484
|
+
closeOnEscape = DEFAULT_PROPS$18.closeOnEscape,
|
|
485
485
|
fitToAnchorWidth,
|
|
486
486
|
hasError,
|
|
487
487
|
helper,
|
|
@@ -503,19 +503,19 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
503
503
|
onKeyDown,
|
|
504
504
|
placeholder,
|
|
505
505
|
placement,
|
|
506
|
-
selectedChipRender = DEFAULT_PROPS$
|
|
506
|
+
selectedChipRender = DEFAULT_PROPS$18.selectedChipRender,
|
|
507
507
|
shouldFocusOnClose,
|
|
508
508
|
theme = defaultTheme,
|
|
509
509
|
type,
|
|
510
510
|
value,
|
|
511
|
-
values = DEFAULT_PROPS$
|
|
511
|
+
values = DEFAULT_PROPS$18.values,
|
|
512
512
|
...forwardedProps
|
|
513
513
|
} = otherProps;
|
|
514
514
|
return /*#__PURE__*/jsx(Autocomplete, {
|
|
515
515
|
ref: ref,
|
|
516
516
|
...forwardedProps,
|
|
517
517
|
anchorToInput: anchorToInput,
|
|
518
|
-
className: classNames.join(className, CLASSNAME$
|
|
518
|
+
className: classNames.join(className, CLASSNAME$1h),
|
|
519
519
|
name: name,
|
|
520
520
|
value: value,
|
|
521
521
|
onChange: onChange,
|
|
@@ -549,8 +549,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
549
549
|
});
|
|
550
550
|
});
|
|
551
551
|
AutocompleteMultiple.displayName = COMPONENT_NAME$1i;
|
|
552
|
-
AutocompleteMultiple.className = CLASSNAME$
|
|
553
|
-
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$
|
|
552
|
+
AutocompleteMultiple.className = CLASSNAME$1h;
|
|
553
|
+
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$18;
|
|
554
554
|
|
|
555
555
|
/**
|
|
556
556
|
* Component display name.
|
|
@@ -560,16 +560,16 @@ const COMPONENT_NAME$1h = 'Avatar';
|
|
|
560
560
|
/**
|
|
561
561
|
* Component default class name and class prefix.
|
|
562
562
|
*/
|
|
563
|
-
const CLASSNAME$
|
|
563
|
+
const CLASSNAME$1g = 'lumx-avatar';
|
|
564
564
|
const {
|
|
565
|
-
block: block$
|
|
566
|
-
element: element$
|
|
567
|
-
} = classNames.bem(CLASSNAME$
|
|
565
|
+
block: block$13,
|
|
566
|
+
element: element$N
|
|
567
|
+
} = classNames.bem(CLASSNAME$1g);
|
|
568
568
|
|
|
569
569
|
/**
|
|
570
570
|
* Component default props.
|
|
571
571
|
*/
|
|
572
|
-
const DEFAULT_PROPS$
|
|
572
|
+
const DEFAULT_PROPS$17 = {
|
|
573
573
|
size: Size$1.m
|
|
574
574
|
};
|
|
575
575
|
|
|
@@ -592,7 +592,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
592
592
|
linkAs,
|
|
593
593
|
onClick,
|
|
594
594
|
onKeyPress,
|
|
595
|
-
size = DEFAULT_PROPS$
|
|
595
|
+
size = DEFAULT_PROPS$17.size,
|
|
596
596
|
theme = defaultTheme,
|
|
597
597
|
thumbnailProps,
|
|
598
598
|
...forwardedProps
|
|
@@ -600,14 +600,14 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
600
600
|
return /*#__PURE__*/jsxs("div", {
|
|
601
601
|
ref: ref,
|
|
602
602
|
...forwardedProps,
|
|
603
|
-
className: classNames.join(className, block$
|
|
603
|
+
className: classNames.join(className, block$13({
|
|
604
604
|
[`size-${size}`]: Boolean(size),
|
|
605
605
|
[`theme-${theme}`]: Boolean(theme)
|
|
606
606
|
})),
|
|
607
607
|
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
608
608
|
linkProps: linkProps,
|
|
609
609
|
linkAs: linkAs,
|
|
610
|
-
className: element$
|
|
610
|
+
className: element$N('thumbnail'),
|
|
611
611
|
onClick: onClick,
|
|
612
612
|
onKeyPress: onKeyPress,
|
|
613
613
|
...thumbnailProps,
|
|
@@ -617,17 +617,17 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
617
617
|
alt: alt,
|
|
618
618
|
theme: theme
|
|
619
619
|
}), actions && /*#__PURE__*/jsx("div", {
|
|
620
|
-
className: element$
|
|
620
|
+
className: element$N('actions'),
|
|
621
621
|
children: actions
|
|
622
622
|
}), badge && /*#__PURE__*/jsx("div", {
|
|
623
|
-
className: element$
|
|
623
|
+
className: element$N('badge'),
|
|
624
624
|
children: badge
|
|
625
625
|
})]
|
|
626
626
|
});
|
|
627
627
|
});
|
|
628
628
|
Avatar.displayName = COMPONENT_NAME$1h;
|
|
629
|
-
Avatar.className = CLASSNAME$
|
|
630
|
-
Avatar.defaultProps = DEFAULT_PROPS$
|
|
629
|
+
Avatar.className = CLASSNAME$1g;
|
|
630
|
+
Avatar.defaultProps = DEFAULT_PROPS$17;
|
|
631
631
|
|
|
632
632
|
/**
|
|
633
633
|
* Component display name.
|
|
@@ -637,15 +637,15 @@ const COMPONENT_NAME$1g = 'Badge';
|
|
|
637
637
|
/**
|
|
638
638
|
* Component default class name and class prefix.
|
|
639
639
|
*/
|
|
640
|
-
const CLASSNAME$
|
|
640
|
+
const CLASSNAME$1f = 'lumx-badge';
|
|
641
641
|
const {
|
|
642
|
-
block: block$
|
|
643
|
-
} = classNames.bem(CLASSNAME$
|
|
642
|
+
block: block$12
|
|
643
|
+
} = classNames.bem(CLASSNAME$1f);
|
|
644
644
|
|
|
645
645
|
/**
|
|
646
646
|
* Component default props.
|
|
647
647
|
*/
|
|
648
|
-
const DEFAULT_PROPS$
|
|
648
|
+
const DEFAULT_PROPS$16 = {
|
|
649
649
|
color: ColorPalette$1.primary
|
|
650
650
|
};
|
|
651
651
|
|
|
@@ -660,30 +660,30 @@ const Badge = forwardRef((props, ref) => {
|
|
|
660
660
|
const {
|
|
661
661
|
children,
|
|
662
662
|
className,
|
|
663
|
-
color = DEFAULT_PROPS$
|
|
663
|
+
color = DEFAULT_PROPS$16.color,
|
|
664
664
|
...forwardedProps
|
|
665
665
|
} = props;
|
|
666
666
|
return /*#__PURE__*/jsx("div", {
|
|
667
667
|
ref: ref,
|
|
668
668
|
...forwardedProps,
|
|
669
|
-
className: classNames.join(className, block$
|
|
669
|
+
className: classNames.join(className, block$12({
|
|
670
670
|
[`color-${color}`]: Boolean(color)
|
|
671
671
|
})),
|
|
672
672
|
children: children
|
|
673
673
|
});
|
|
674
674
|
});
|
|
675
675
|
Badge.displayName = COMPONENT_NAME$1g;
|
|
676
|
-
Badge.className = CLASSNAME$
|
|
677
|
-
Badge.defaultProps = DEFAULT_PROPS$
|
|
676
|
+
Badge.className = CLASSNAME$1f;
|
|
677
|
+
Badge.defaultProps = DEFAULT_PROPS$16;
|
|
678
678
|
|
|
679
679
|
/**
|
|
680
680
|
* Component default class name and class prefix.
|
|
681
681
|
*/
|
|
682
|
-
const CLASSNAME$
|
|
682
|
+
const CLASSNAME$1e = 'lumx-badge-wrapper';
|
|
683
683
|
const {
|
|
684
|
-
block: block$
|
|
685
|
-
element: element$
|
|
686
|
-
} = classNames.bem(CLASSNAME$
|
|
684
|
+
block: block$11,
|
|
685
|
+
element: element$M
|
|
686
|
+
} = classNames.bem(CLASSNAME$1e);
|
|
687
687
|
const BadgeWrapper = forwardRef((props, ref) => {
|
|
688
688
|
const {
|
|
689
689
|
badge,
|
|
@@ -694,15 +694,15 @@ const BadgeWrapper = forwardRef((props, ref) => {
|
|
|
694
694
|
return /*#__PURE__*/jsxs("div", {
|
|
695
695
|
ref: ref,
|
|
696
696
|
...forwardedProps,
|
|
697
|
-
className: classNames.join(className, block$
|
|
697
|
+
className: classNames.join(className, block$11()),
|
|
698
698
|
children: [children, badge && /*#__PURE__*/jsx("div", {
|
|
699
|
-
className: element$
|
|
699
|
+
className: element$M('badge'),
|
|
700
700
|
children: badge
|
|
701
701
|
})]
|
|
702
702
|
});
|
|
703
703
|
});
|
|
704
704
|
BadgeWrapper.displayName = 'BadgeWrapper';
|
|
705
|
-
BadgeWrapper.className = CLASSNAME$
|
|
705
|
+
BadgeWrapper.className = CLASSNAME$1e;
|
|
706
706
|
|
|
707
707
|
/**
|
|
708
708
|
* Alignments.
|
|
@@ -764,6 +764,8 @@ const ColorPalette = {
|
|
|
764
764
|
red: 'red',
|
|
765
765
|
light: 'light'};
|
|
766
766
|
|
|
767
|
+
/** ColorPalette with all possible color variant combination */
|
|
768
|
+
|
|
767
769
|
function getDefaultExportFromCjs (x) {
|
|
768
770
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
769
771
|
}
|
|
@@ -924,7 +926,7 @@ function modifier$1(baseName, modifiers) {
|
|
|
924
926
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
925
927
|
*/
|
|
926
928
|
|
|
927
|
-
function block$
|
|
929
|
+
function block$10(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
928
930
|
let modifiers;
|
|
929
931
|
let classes;
|
|
930
932
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
@@ -959,11 +961,11 @@ function block$14(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
|
959
961
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
960
962
|
*/
|
|
961
963
|
|
|
962
|
-
function element$
|
|
964
|
+
function element$L(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
963
965
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
964
|
-
return block$
|
|
966
|
+
return block$10(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
|
|
965
967
|
}
|
|
966
|
-
return block$
|
|
968
|
+
return block$10(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
|
|
967
969
|
}
|
|
968
970
|
|
|
969
971
|
/**
|
|
@@ -972,15 +974,15 @@ function element$P(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
|
|
|
972
974
|
function bem(baseName) {
|
|
973
975
|
function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
|
|
974
976
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
975
|
-
return block$
|
|
977
|
+
return block$10(baseName, modifiersOrAdditionalClasses);
|
|
976
978
|
}
|
|
977
|
-
return block$
|
|
979
|
+
return block$10(baseName, modifiersOrAdditionalClasses, additionalClasses);
|
|
978
980
|
}
|
|
979
981
|
function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
980
982
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
981
|
-
return element$
|
|
983
|
+
return element$L(baseName, elem, modifiersOrAdditionalClasses);
|
|
982
984
|
}
|
|
983
|
-
return element$
|
|
985
|
+
return element$L(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
|
|
984
986
|
}
|
|
985
987
|
return {
|
|
986
988
|
block: blockFn,
|
|
@@ -1148,15 +1150,15 @@ const COMPONENT_NAME$1e = 'Button';
|
|
|
1148
1150
|
/**
|
|
1149
1151
|
* Component default class name and class prefix.
|
|
1150
1152
|
*/
|
|
1151
|
-
const CLASSNAME$
|
|
1153
|
+
const CLASSNAME$1d = 'lumx-button';
|
|
1152
1154
|
const {
|
|
1153
1155
|
modifier
|
|
1154
|
-
} = bem(CLASSNAME$
|
|
1156
|
+
} = bem(CLASSNAME$1d);
|
|
1155
1157
|
|
|
1156
1158
|
/**
|
|
1157
1159
|
* Component default props.
|
|
1158
1160
|
*/
|
|
1159
|
-
const DEFAULT_PROPS$
|
|
1161
|
+
const DEFAULT_PROPS$15 = {
|
|
1160
1162
|
emphasis: Emphasis.high,
|
|
1161
1163
|
size: Size.m
|
|
1162
1164
|
};
|
|
@@ -1170,10 +1172,10 @@ const DEFAULT_PROPS$11 = {
|
|
|
1170
1172
|
const Button$1 = props => {
|
|
1171
1173
|
const {
|
|
1172
1174
|
className,
|
|
1173
|
-
emphasis = DEFAULT_PROPS$
|
|
1175
|
+
emphasis = DEFAULT_PROPS$15.emphasis,
|
|
1174
1176
|
leftIcon,
|
|
1175
1177
|
rightIcon,
|
|
1176
|
-
size = DEFAULT_PROPS$
|
|
1178
|
+
size = DEFAULT_PROPS$15.size,
|
|
1177
1179
|
...forwardedProps
|
|
1178
1180
|
} = props;
|
|
1179
1181
|
const buttonClassName = classnames(className, modifier({
|
|
@@ -1189,8 +1191,8 @@ const Button$1 = props => {
|
|
|
1189
1191
|
});
|
|
1190
1192
|
};
|
|
1191
1193
|
Button$1.displayName = COMPONENT_NAME$1e;
|
|
1192
|
-
Button$1.className = CLASSNAME$
|
|
1193
|
-
Button$1.defaultProps = DEFAULT_PROPS$
|
|
1194
|
+
Button$1.className = CLASSNAME$1d;
|
|
1195
|
+
Button$1.defaultProps = DEFAULT_PROPS$15;
|
|
1194
1196
|
|
|
1195
1197
|
/**
|
|
1196
1198
|
* Properties of a component to use to determine it's name.
|
|
@@ -1257,8 +1259,8 @@ const Button = forwardRef((props, ref) => {
|
|
|
1257
1259
|
});
|
|
1258
1260
|
});
|
|
1259
1261
|
Button.displayName = COMPONENT_NAME$1e;
|
|
1260
|
-
Button.className = CLASSNAME$
|
|
1261
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
1262
|
+
Button.className = CLASSNAME$1d;
|
|
1263
|
+
Button.defaultProps = DEFAULT_PROPS$15;
|
|
1262
1264
|
|
|
1263
1265
|
const COMPONENT_NAME$1d = 'Icon';
|
|
1264
1266
|
const IconClassName = 'lumx-icon';
|
|
@@ -1267,15 +1269,15 @@ const IconClassName = 'lumx-icon';
|
|
|
1267
1269
|
* Defines the props of the component.
|
|
1268
1270
|
*/
|
|
1269
1271
|
|
|
1270
|
-
const CLASSNAME$
|
|
1272
|
+
const CLASSNAME$1c = IconClassName;
|
|
1271
1273
|
const {
|
|
1272
|
-
block: block
|
|
1273
|
-
} = bem(CLASSNAME$
|
|
1274
|
+
block: block$$
|
|
1275
|
+
} = bem(CLASSNAME$1c);
|
|
1274
1276
|
|
|
1275
1277
|
/**
|
|
1276
1278
|
* Component default props.
|
|
1277
1279
|
*/
|
|
1278
|
-
const DEFAULT_PROPS$
|
|
1280
|
+
const DEFAULT_PROPS$14 = {};
|
|
1279
1281
|
|
|
1280
1282
|
/**
|
|
1281
1283
|
* Icon component.
|
|
@@ -1324,7 +1326,7 @@ const Icon$1 = props => {
|
|
|
1324
1326
|
return /*#__PURE__*/jsx("i", {
|
|
1325
1327
|
ref: ref,
|
|
1326
1328
|
...forwardedProps,
|
|
1327
|
-
className: classnames(className, block
|
|
1329
|
+
className: classnames(className, block$$({
|
|
1328
1330
|
[`color-${iconColor}`]: Boolean(iconColor),
|
|
1329
1331
|
[`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
|
|
1330
1332
|
'has-shape': hasShape,
|
|
@@ -1354,8 +1356,8 @@ const Icon$1 = props => {
|
|
|
1354
1356
|
});
|
|
1355
1357
|
};
|
|
1356
1358
|
Icon$1.displayName = COMPONENT_NAME$1d;
|
|
1357
|
-
Icon$1.className = CLASSNAME$
|
|
1358
|
-
Icon$1.defaultProps = DEFAULT_PROPS$
|
|
1359
|
+
Icon$1.className = CLASSNAME$1c;
|
|
1360
|
+
Icon$1.defaultProps = DEFAULT_PROPS$14;
|
|
1359
1361
|
|
|
1360
1362
|
/**
|
|
1361
1363
|
* Component display name.
|
|
@@ -1365,12 +1367,12 @@ const COMPONENT_NAME$1c = 'IconButton';
|
|
|
1365
1367
|
/**
|
|
1366
1368
|
* Component default class name and class prefix.
|
|
1367
1369
|
*/
|
|
1368
|
-
const CLASSNAME$
|
|
1370
|
+
const CLASSNAME$1b = 'lumx-icon-button';
|
|
1369
1371
|
|
|
1370
1372
|
/**
|
|
1371
1373
|
* Component default props.
|
|
1372
1374
|
*/
|
|
1373
|
-
const DEFAULT_PROPS
|
|
1375
|
+
const DEFAULT_PROPS$13 = {
|
|
1374
1376
|
emphasis: Emphasis.high,
|
|
1375
1377
|
size: Size.m
|
|
1376
1378
|
};
|
|
@@ -1383,11 +1385,11 @@ const DEFAULT_PROPS$$ = {
|
|
|
1383
1385
|
*/
|
|
1384
1386
|
const IconButton$1 = props => {
|
|
1385
1387
|
const {
|
|
1386
|
-
emphasis = DEFAULT_PROPS
|
|
1388
|
+
emphasis = DEFAULT_PROPS$13.emphasis,
|
|
1387
1389
|
image,
|
|
1388
1390
|
icon,
|
|
1389
1391
|
label,
|
|
1390
|
-
size = DEFAULT_PROPS
|
|
1392
|
+
size = DEFAULT_PROPS$13.size,
|
|
1391
1393
|
...forwardedProps
|
|
1392
1394
|
} = props;
|
|
1393
1395
|
const defaultChildren = image ? /*#__PURE__*/jsx("img", {
|
|
@@ -1407,8 +1409,8 @@ const IconButton$1 = props => {
|
|
|
1407
1409
|
});
|
|
1408
1410
|
};
|
|
1409
1411
|
IconButton$1.displayName = COMPONENT_NAME$1c;
|
|
1410
|
-
IconButton$1.className = CLASSNAME$
|
|
1411
|
-
IconButton$1.defaultProps = DEFAULT_PROPS
|
|
1412
|
+
IconButton$1.className = CLASSNAME$1b;
|
|
1413
|
+
IconButton$1.defaultProps = DEFAULT_PROPS$13;
|
|
1412
1414
|
|
|
1413
1415
|
/**
|
|
1414
1416
|
* IconButton component.
|
|
@@ -1444,8 +1446,8 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
1444
1446
|
});
|
|
1445
1447
|
});
|
|
1446
1448
|
IconButton.displayName = COMPONENT_NAME$1c;
|
|
1447
|
-
IconButton.className = CLASSNAME$
|
|
1448
|
-
IconButton.defaultProps = DEFAULT_PROPS
|
|
1449
|
+
IconButton.className = CLASSNAME$1b;
|
|
1450
|
+
IconButton.defaultProps = DEFAULT_PROPS$13;
|
|
1449
1451
|
|
|
1450
1452
|
/**
|
|
1451
1453
|
* Component display name.
|
|
@@ -1455,12 +1457,12 @@ const COMPONENT_NAME$1b = 'ButtonGroup';
|
|
|
1455
1457
|
/**
|
|
1456
1458
|
* Component default class name and class prefix.
|
|
1457
1459
|
*/
|
|
1458
|
-
const CLASSNAME$
|
|
1460
|
+
const CLASSNAME$1a = 'lumx-button-group';
|
|
1459
1461
|
|
|
1460
1462
|
/**
|
|
1461
1463
|
* Component default props.
|
|
1462
1464
|
*/
|
|
1463
|
-
const DEFAULT_PROPS$
|
|
1465
|
+
const DEFAULT_PROPS$12 = {};
|
|
1464
1466
|
|
|
1465
1467
|
/**
|
|
1466
1468
|
* ButtonGroup component.
|
|
@@ -1476,13 +1478,13 @@ const ButtonGroup$1 = props => {
|
|
|
1476
1478
|
} = props;
|
|
1477
1479
|
return /*#__PURE__*/jsx("div", {
|
|
1478
1480
|
...forwardedProps,
|
|
1479
|
-
className: classnames(className, CLASSNAME$
|
|
1481
|
+
className: classnames(className, CLASSNAME$1a),
|
|
1480
1482
|
children: children
|
|
1481
1483
|
});
|
|
1482
1484
|
};
|
|
1483
1485
|
ButtonGroup$1.displayName = COMPONENT_NAME$1b;
|
|
1484
|
-
ButtonGroup$1.className = CLASSNAME$
|
|
1485
|
-
ButtonGroup$1.defaultProps = DEFAULT_PROPS$
|
|
1486
|
+
ButtonGroup$1.className = CLASSNAME$1a;
|
|
1487
|
+
ButtonGroup$1.defaultProps = DEFAULT_PROPS$12;
|
|
1486
1488
|
|
|
1487
1489
|
/**
|
|
1488
1490
|
* ButtonGroup component.
|
|
@@ -1498,16 +1500,16 @@ const ButtonGroup = forwardRef((props, ref) => {
|
|
|
1498
1500
|
});
|
|
1499
1501
|
});
|
|
1500
1502
|
ButtonGroup.displayName = COMPONENT_NAME$1b;
|
|
1501
|
-
ButtonGroup.className = CLASSNAME$
|
|
1502
|
-
ButtonGroup.defaultProps = DEFAULT_PROPS$
|
|
1503
|
+
ButtonGroup.className = CLASSNAME$1a;
|
|
1504
|
+
ButtonGroup.defaultProps = DEFAULT_PROPS$12;
|
|
1503
1505
|
|
|
1504
1506
|
const COMPONENT_NAME$1a = 'InputLabel';
|
|
1505
1507
|
const InputLabelClassName = 'lumx-input-label';
|
|
1506
|
-
const CLASSNAME$
|
|
1508
|
+
const CLASSNAME$19 = InputLabelClassName;
|
|
1507
1509
|
const {
|
|
1508
|
-
block: block$
|
|
1509
|
-
} = bem(CLASSNAME$
|
|
1510
|
-
const DEFAULT_PROPS$
|
|
1510
|
+
block: block$_
|
|
1511
|
+
} = bem(CLASSNAME$19);
|
|
1512
|
+
const DEFAULT_PROPS$11 = {};
|
|
1511
1513
|
|
|
1512
1514
|
/**
|
|
1513
1515
|
* InputLabel component.
|
|
@@ -1527,7 +1529,7 @@ function InputLabel$1(props) {
|
|
|
1527
1529
|
ref: ref,
|
|
1528
1530
|
...forwardedProps,
|
|
1529
1531
|
htmlFor: htmlFor,
|
|
1530
|
-
className: classnames(className, block$
|
|
1532
|
+
className: classnames(className, block$_({
|
|
1531
1533
|
'is-required': isRequired,
|
|
1532
1534
|
[`theme-${theme}`]: Boolean(theme),
|
|
1533
1535
|
'has-custom-typography': Boolean(typography$1)
|
|
@@ -1536,8 +1538,8 @@ function InputLabel$1(props) {
|
|
|
1536
1538
|
});
|
|
1537
1539
|
}
|
|
1538
1540
|
InputLabel$1.displayName = COMPONENT_NAME$1a;
|
|
1539
|
-
InputLabel$1.className = CLASSNAME$
|
|
1540
|
-
InputLabel$1.defaultProps = DEFAULT_PROPS$
|
|
1541
|
+
InputLabel$1.className = CLASSNAME$19;
|
|
1542
|
+
InputLabel$1.defaultProps = DEFAULT_PROPS$11;
|
|
1541
1543
|
|
|
1542
1544
|
const INPUT_HELPER_CONFIGURATION = {
|
|
1543
1545
|
[Kind.error]: {
|
|
@@ -1558,15 +1560,15 @@ const InputHelperClassName = 'lumx-input-helper';
|
|
|
1558
1560
|
* Defines the props of the component.
|
|
1559
1561
|
*/
|
|
1560
1562
|
|
|
1561
|
-
const CLASSNAME$
|
|
1563
|
+
const CLASSNAME$18 = InputHelperClassName;
|
|
1562
1564
|
const {
|
|
1563
|
-
block: block$
|
|
1564
|
-
} = bem(CLASSNAME$
|
|
1565
|
+
block: block$Z
|
|
1566
|
+
} = bem(CLASSNAME$18);
|
|
1565
1567
|
|
|
1566
1568
|
/**
|
|
1567
1569
|
* Component default props.
|
|
1568
1570
|
*/
|
|
1569
|
-
const DEFAULT_PROPS$
|
|
1571
|
+
const DEFAULT_PROPS$10 = {
|
|
1570
1572
|
kind: Kind.info
|
|
1571
1573
|
};
|
|
1572
1574
|
|
|
@@ -1577,7 +1579,7 @@ function InputHelper$1(props) {
|
|
|
1577
1579
|
const {
|
|
1578
1580
|
children,
|
|
1579
1581
|
className,
|
|
1580
|
-
kind = DEFAULT_PROPS$
|
|
1582
|
+
kind = DEFAULT_PROPS$10.kind,
|
|
1581
1583
|
theme,
|
|
1582
1584
|
ref,
|
|
1583
1585
|
...forwardedProps
|
|
@@ -1588,7 +1590,7 @@ function InputHelper$1(props) {
|
|
|
1588
1590
|
return /*#__PURE__*/jsx("p", {
|
|
1589
1591
|
ref: ref,
|
|
1590
1592
|
...forwardedProps,
|
|
1591
|
-
className: classnames(className, block$
|
|
1593
|
+
className: classnames(className, block$Z({
|
|
1592
1594
|
[`color-${color}`]: Boolean(color),
|
|
1593
1595
|
[`theme-${theme}`]: Boolean(theme)
|
|
1594
1596
|
})),
|
|
@@ -1596,8 +1598,8 @@ function InputHelper$1(props) {
|
|
|
1596
1598
|
});
|
|
1597
1599
|
}
|
|
1598
1600
|
InputHelper$1.displayName = COMPONENT_NAME$19;
|
|
1599
|
-
InputHelper$1.className = CLASSNAME$
|
|
1600
|
-
InputHelper$1.defaultProps = DEFAULT_PROPS$
|
|
1601
|
+
InputHelper$1.className = CLASSNAME$18;
|
|
1602
|
+
InputHelper$1.defaultProps = DEFAULT_PROPS$10;
|
|
1601
1603
|
|
|
1602
1604
|
const INTERMEDIATE_STATE = 'intermediate';
|
|
1603
1605
|
|
|
@@ -1613,11 +1615,11 @@ const COMPONENT_NAME$18 = 'Checkbox';
|
|
|
1613
1615
|
/**
|
|
1614
1616
|
* Component default class name and class prefix.
|
|
1615
1617
|
*/
|
|
1616
|
-
const CLASSNAME$
|
|
1618
|
+
const CLASSNAME$17 = 'lumx-checkbox';
|
|
1617
1619
|
const {
|
|
1618
|
-
block: block$
|
|
1619
|
-
element: element$
|
|
1620
|
-
} = bem(CLASSNAME$
|
|
1620
|
+
block: block$Y,
|
|
1621
|
+
element: element$K
|
|
1622
|
+
} = bem(CLASSNAME$17);
|
|
1621
1623
|
|
|
1622
1624
|
/**
|
|
1623
1625
|
* Checkbox component.
|
|
@@ -1653,7 +1655,7 @@ const Checkbox$1 = props => {
|
|
|
1653
1655
|
return /*#__PURE__*/jsxs("div", {
|
|
1654
1656
|
ref: ref,
|
|
1655
1657
|
...forwardedProps,
|
|
1656
|
-
className: classnames(className, block$
|
|
1658
|
+
className: classnames(className, block$Y({
|
|
1657
1659
|
// Whether state is intermediate class name will "-checked"
|
|
1658
1660
|
'is-checked': intermediateState ? true : isChecked,
|
|
1659
1661
|
'is-disabled': isDisabled,
|
|
@@ -1661,12 +1663,12 @@ const Checkbox$1 = props => {
|
|
|
1661
1663
|
[`theme-${theme}`]: Boolean(theme)
|
|
1662
1664
|
})),
|
|
1663
1665
|
children: [/*#__PURE__*/jsxs("div", {
|
|
1664
|
-
className: element$
|
|
1666
|
+
className: element$K('input-wrapper'),
|
|
1665
1667
|
children: [/*#__PURE__*/jsx("input", {
|
|
1666
1668
|
ref: inputRef,
|
|
1667
1669
|
type: "checkbox",
|
|
1668
1670
|
id: inputId,
|
|
1669
|
-
className: element$
|
|
1671
|
+
className: element$K('input-native'),
|
|
1670
1672
|
name: name,
|
|
1671
1673
|
value: value,
|
|
1672
1674
|
checked: isChecked,
|
|
@@ -1678,26 +1680,26 @@ const Checkbox$1 = props => {
|
|
|
1678
1680
|
} : {}),
|
|
1679
1681
|
...inputProps
|
|
1680
1682
|
}), /*#__PURE__*/jsxs("div", {
|
|
1681
|
-
className: element$
|
|
1683
|
+
className: element$K('input-placeholder'),
|
|
1682
1684
|
children: [/*#__PURE__*/jsx("div", {
|
|
1683
|
-
className: element$
|
|
1685
|
+
className: element$K('input-background')
|
|
1684
1686
|
}), /*#__PURE__*/jsx("div", {
|
|
1685
|
-
className: element$
|
|
1687
|
+
className: element$K('input-indicator'),
|
|
1686
1688
|
children: Icon$1({
|
|
1687
1689
|
icon: intermediateState ? mdiMinus : mdiCheck
|
|
1688
1690
|
})
|
|
1689
1691
|
})]
|
|
1690
1692
|
})]
|
|
1691
1693
|
}), /*#__PURE__*/jsxs("div", {
|
|
1692
|
-
className: element$
|
|
1694
|
+
className: element$K('content'),
|
|
1693
1695
|
children: [label && InputLabel$1({
|
|
1694
1696
|
htmlFor: inputId,
|
|
1695
|
-
className: element$
|
|
1697
|
+
className: element$K('label'),
|
|
1696
1698
|
theme,
|
|
1697
1699
|
children: label
|
|
1698
1700
|
}), helper && InputHelper$1({
|
|
1699
1701
|
id: `${inputId}-helper`,
|
|
1700
|
-
className: element$
|
|
1702
|
+
className: element$K('helper'),
|
|
1701
1703
|
theme,
|
|
1702
1704
|
children: helper
|
|
1703
1705
|
})]
|
|
@@ -1712,7 +1714,7 @@ const Checkbox$1 = props => {
|
|
|
1712
1714
|
/**
|
|
1713
1715
|
* Component default props.
|
|
1714
1716
|
*/
|
|
1715
|
-
const DEFAULT_PROPS
|
|
1717
|
+
const DEFAULT_PROPS$$ = {};
|
|
1716
1718
|
|
|
1717
1719
|
/**
|
|
1718
1720
|
* Checkbox component.
|
|
@@ -1773,8 +1775,8 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1773
1775
|
});
|
|
1774
1776
|
});
|
|
1775
1777
|
Checkbox.displayName = COMPONENT_NAME$18;
|
|
1776
|
-
Checkbox.className = CLASSNAME$
|
|
1777
|
-
Checkbox.defaultProps = DEFAULT_PROPS
|
|
1778
|
+
Checkbox.className = CLASSNAME$17;
|
|
1779
|
+
Checkbox.defaultProps = DEFAULT_PROPS$$;
|
|
1778
1780
|
|
|
1779
1781
|
/**
|
|
1780
1782
|
* Wrap mouse event handler to stop event propagation.
|
|
@@ -1800,16 +1802,16 @@ const COMPONENT_NAME$17 = 'Chip';
|
|
|
1800
1802
|
/**
|
|
1801
1803
|
* Component default class name and class prefix.
|
|
1802
1804
|
*/
|
|
1803
|
-
const CLASSNAME$
|
|
1805
|
+
const CLASSNAME$16 = 'lumx-chip';
|
|
1804
1806
|
const {
|
|
1805
|
-
block: block
|
|
1806
|
-
element: element$
|
|
1807
|
-
} = classNames.bem(CLASSNAME$
|
|
1807
|
+
block: block$X,
|
|
1808
|
+
element: element$J
|
|
1809
|
+
} = classNames.bem(CLASSNAME$16);
|
|
1808
1810
|
|
|
1809
1811
|
/**
|
|
1810
1812
|
* Component default props.
|
|
1811
1813
|
*/
|
|
1812
|
-
const DEFAULT_PROPS$
|
|
1814
|
+
const DEFAULT_PROPS$_ = {
|
|
1813
1815
|
size: Size$1.m
|
|
1814
1816
|
};
|
|
1815
1817
|
|
|
@@ -1839,7 +1841,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1839
1841
|
onAfterClick,
|
|
1840
1842
|
onBeforeClick,
|
|
1841
1843
|
onClick,
|
|
1842
|
-
size = DEFAULT_PROPS$
|
|
1844
|
+
size = DEFAULT_PROPS$_.size,
|
|
1843
1845
|
theme = defaultTheme,
|
|
1844
1846
|
href,
|
|
1845
1847
|
onKeyDown,
|
|
@@ -1870,7 +1872,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1870
1872
|
...forwardedProps,
|
|
1871
1873
|
href: !disabledStateProps.disabled ? href : undefined,
|
|
1872
1874
|
ref: ref,
|
|
1873
|
-
className: classNames.join(className, block
|
|
1875
|
+
className: classNames.join(className, block$X({
|
|
1874
1876
|
'is-clickable': isClickable,
|
|
1875
1877
|
[`color-${chipColor}`]: Boolean(chipColor),
|
|
1876
1878
|
'is-disabled': isAnyDisabled,
|
|
@@ -1888,19 +1890,19 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1888
1890
|
/*#__PURE__*/
|
|
1889
1891
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1890
1892
|
jsx("div", {
|
|
1891
|
-
className: element$
|
|
1893
|
+
className: element$J('before', {
|
|
1892
1894
|
'is-clickable': hasBeforeClick
|
|
1893
1895
|
}),
|
|
1894
1896
|
onClick: handleOnBeforeClick,
|
|
1895
1897
|
children: before
|
|
1896
1898
|
}), /*#__PURE__*/jsx("div", {
|
|
1897
|
-
className: element$
|
|
1899
|
+
className: element$J('label'),
|
|
1898
1900
|
children: children
|
|
1899
1901
|
}), after &&
|
|
1900
1902
|
/*#__PURE__*/
|
|
1901
1903
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1902
1904
|
jsx("div", {
|
|
1903
|
-
className: element$
|
|
1905
|
+
className: element$J('after', {
|
|
1904
1906
|
'is-clickable': hasAfterClick
|
|
1905
1907
|
}),
|
|
1906
1908
|
onClick: handleOnAfterClick,
|
|
@@ -1910,8 +1912,8 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1910
1912
|
);
|
|
1911
1913
|
});
|
|
1912
1914
|
Chip.displayName = COMPONENT_NAME$17;
|
|
1913
|
-
Chip.className = CLASSNAME$
|
|
1914
|
-
Chip.defaultProps = DEFAULT_PROPS$
|
|
1915
|
+
Chip.className = CLASSNAME$16;
|
|
1916
|
+
Chip.defaultProps = DEFAULT_PROPS$_;
|
|
1915
1917
|
|
|
1916
1918
|
const INITIAL_STATE_ACTIVE_CHIP = -1;
|
|
1917
1919
|
|
|
@@ -1967,7 +1969,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
|
|
|
1967
1969
|
/**
|
|
1968
1970
|
* Component default props.
|
|
1969
1971
|
*/
|
|
1970
|
-
const DEFAULT_PROPS$
|
|
1972
|
+
const DEFAULT_PROPS$Z = {};
|
|
1971
1973
|
|
|
1972
1974
|
/**
|
|
1973
1975
|
* Component display name.
|
|
@@ -1977,7 +1979,7 @@ const COMPONENT_NAME$16 = 'ChipGroup';
|
|
|
1977
1979
|
/**
|
|
1978
1980
|
* Component default class name and class prefix.
|
|
1979
1981
|
*/
|
|
1980
|
-
const CLASSNAME$
|
|
1982
|
+
const CLASSNAME$15 = 'lumx-chip-group';
|
|
1981
1983
|
|
|
1982
1984
|
/**
|
|
1983
1985
|
* ChipGroup component.
|
|
@@ -1996,13 +1998,13 @@ const InternalChipGroup = forwardRef((props, ref) => {
|
|
|
1996
1998
|
return /*#__PURE__*/jsx("div", {
|
|
1997
1999
|
ref: ref,
|
|
1998
2000
|
...forwardedProps,
|
|
1999
|
-
className: classNames.join(className, CLASSNAME$
|
|
2001
|
+
className: classNames.join(className, CLASSNAME$15),
|
|
2000
2002
|
children: children
|
|
2001
2003
|
});
|
|
2002
2004
|
});
|
|
2003
2005
|
InternalChipGroup.displayName = COMPONENT_NAME$16;
|
|
2004
|
-
InternalChipGroup.className = CLASSNAME$
|
|
2005
|
-
InternalChipGroup.defaultProps = DEFAULT_PROPS$
|
|
2006
|
+
InternalChipGroup.className = CLASSNAME$15;
|
|
2007
|
+
InternalChipGroup.defaultProps = DEFAULT_PROPS$Z;
|
|
2006
2008
|
const ChipGroup = Object.assign(InternalChipGroup, {
|
|
2007
2009
|
useChipGroupNavigation
|
|
2008
2010
|
});
|
|
@@ -2092,11 +2094,11 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
|
|
|
2092
2094
|
/**
|
|
2093
2095
|
* Component default class name and class prefix.
|
|
2094
2096
|
*/
|
|
2095
|
-
const CLASSNAME$
|
|
2097
|
+
const CLASSNAME$14 = 'lumx-selection-chip-group';
|
|
2096
2098
|
const {
|
|
2097
|
-
block: block$
|
|
2098
|
-
element: element$
|
|
2099
|
-
} = classNames.bem(CLASSNAME$
|
|
2099
|
+
block: block$W,
|
|
2100
|
+
element: element$I
|
|
2101
|
+
} = classNames.bem(CLASSNAME$14);
|
|
2100
2102
|
|
|
2101
2103
|
/**
|
|
2102
2104
|
* SelectionChipGroup component.
|
|
@@ -2126,7 +2128,7 @@ const SelectionChipGroup = ({
|
|
|
2126
2128
|
return /*#__PURE__*/jsx(ChipGroup, {
|
|
2127
2129
|
role: "group",
|
|
2128
2130
|
"aria-label": label,
|
|
2129
|
-
className: block$
|
|
2131
|
+
className: block$W(),
|
|
2130
2132
|
...forwardedProps,
|
|
2131
2133
|
children: value?.map((v, index) => {
|
|
2132
2134
|
const name = getWithSelector(getOptionName, v);
|
|
@@ -2170,7 +2172,7 @@ const SelectionChipGroup = ({
|
|
|
2170
2172
|
after: /*#__PURE__*/jsx(Icon, {
|
|
2171
2173
|
icon: mdiClose
|
|
2172
2174
|
}),
|
|
2173
|
-
className: element$
|
|
2175
|
+
className: element$I('chip', [props?.className]),
|
|
2174
2176
|
size: "s",
|
|
2175
2177
|
ref: ref,
|
|
2176
2178
|
onClick: onClick,
|
|
@@ -2185,1711 +2187,190 @@ const SelectionChipGroup = ({
|
|
|
2185
2187
|
});
|
|
2186
2188
|
};
|
|
2187
2189
|
|
|
2188
|
-
/**
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
current: null
|
|
2195
|
-
}
|
|
2196
|
-
});
|
|
2197
|
-
/** Provider to store the required refs for the Combobox */
|
|
2198
|
-
const ComboboxRefsProvider = ({
|
|
2199
|
-
triggerRef,
|
|
2200
|
-
anchorRef,
|
|
2201
|
-
children
|
|
2202
|
-
}) => {
|
|
2203
|
-
const value = useMemo(() => ({
|
|
2204
|
-
triggerRef,
|
|
2205
|
-
anchorRef
|
|
2206
|
-
}), [triggerRef, anchorRef]);
|
|
2207
|
-
return /*#__PURE__*/jsx(ComboboxRefsContext.Provider, {
|
|
2208
|
-
value: value,
|
|
2209
|
-
children: children
|
|
2210
|
-
});
|
|
2211
|
-
};
|
|
2212
|
-
|
|
2213
|
-
/** Retrieves the combobox elements references from context */
|
|
2214
|
-
const useComboboxRefs = () => {
|
|
2215
|
-
const refs = useContext(ComboboxRefsContext);
|
|
2216
|
-
if (!refs) {
|
|
2217
|
-
throw new Error('The useComboboxRefs hook must be called within a ComboboxRefsProvider');
|
|
2218
|
-
}
|
|
2219
|
-
return refs;
|
|
2190
|
+
/**
|
|
2191
|
+
* Comment block variants.
|
|
2192
|
+
*/
|
|
2193
|
+
const CommentBlockVariant = {
|
|
2194
|
+
indented: 'indented',
|
|
2195
|
+
linear: 'linear'
|
|
2220
2196
|
};
|
|
2221
2197
|
|
|
2222
|
-
/**
|
|
2223
|
-
|
|
2198
|
+
/**
|
|
2199
|
+
* Defines the props of the component.
|
|
2200
|
+
*/
|
|
2224
2201
|
|
|
2225
|
-
/**
|
|
2226
|
-
|
|
2202
|
+
/**
|
|
2203
|
+
* Component display name.
|
|
2204
|
+
*/
|
|
2205
|
+
const COMPONENT_NAME$15 = 'CommentBlock';
|
|
2227
2206
|
|
|
2228
|
-
/**
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2207
|
+
/**
|
|
2208
|
+
* Component default class name and class prefix.
|
|
2209
|
+
*/
|
|
2210
|
+
const CLASSNAME$13 = 'lumx-comment-block';
|
|
2211
|
+
const {
|
|
2212
|
+
block: block$V,
|
|
2213
|
+
element: element$H
|
|
2214
|
+
} = classNames.bem(CLASSNAME$13);
|
|
2232
2215
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
isOpen: false,
|
|
2239
|
-
inputValue: '',
|
|
2240
|
-
showAll: true,
|
|
2241
|
-
options: {},
|
|
2242
|
-
type: 'listbox',
|
|
2243
|
-
optionsLength: 0
|
|
2216
|
+
/**
|
|
2217
|
+
* Component default props.
|
|
2218
|
+
*/
|
|
2219
|
+
const DEFAULT_PROPS$Y = {
|
|
2220
|
+
variant: CommentBlockVariant.indented
|
|
2244
2221
|
};
|
|
2245
2222
|
|
|
2246
|
-
/**
|
|
2247
|
-
|
|
2223
|
+
/**
|
|
2224
|
+
* CommentBlock component.
|
|
2225
|
+
*
|
|
2226
|
+
* @param props Component props.
|
|
2227
|
+
* @param ref Component ref.
|
|
2228
|
+
* @return React element.
|
|
2229
|
+
*/
|
|
2230
|
+
const CommentBlock = forwardRef((props, ref) => {
|
|
2231
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
2248
2232
|
const {
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2233
|
+
actions,
|
|
2234
|
+
avatarProps,
|
|
2235
|
+
children,
|
|
2236
|
+
className,
|
|
2237
|
+
date,
|
|
2238
|
+
fullDate,
|
|
2239
|
+
hasActions,
|
|
2240
|
+
headerActions,
|
|
2241
|
+
isOpen,
|
|
2242
|
+
isRelevant,
|
|
2243
|
+
name,
|
|
2244
|
+
onClick,
|
|
2245
|
+
onMouseEnter,
|
|
2246
|
+
onMouseLeave,
|
|
2247
|
+
text,
|
|
2248
|
+
theme = defaultTheme,
|
|
2249
|
+
variant = DEFAULT_PROPS$Y.variant,
|
|
2250
|
+
...forwardedProps
|
|
2251
|
+
} = props;
|
|
2252
|
+
const hasChildren = Children.count(children) > 0;
|
|
2253
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2254
|
+
ref: ref,
|
|
2255
|
+
className: classNames.join(className, block$V({
|
|
2256
|
+
'has-children': hasChildren && isOpen,
|
|
2257
|
+
'has-indented-children': hasChildren && variant === CommentBlockVariant.indented,
|
|
2258
|
+
'has-linear-children': hasChildren && variant === CommentBlockVariant.linear,
|
|
2259
|
+
'is-relevant': isRelevant,
|
|
2260
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
2261
|
+
})),
|
|
2262
|
+
...forwardedProps,
|
|
2263
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
2264
|
+
className: element$H('wrapper'),
|
|
2265
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
2266
|
+
className: element$H('avatar'),
|
|
2267
|
+
children: /*#__PURE__*/jsx(Avatar, {
|
|
2268
|
+
...avatarProps,
|
|
2269
|
+
size: Size$1.m,
|
|
2270
|
+
onClick: onClick
|
|
2271
|
+
})
|
|
2272
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
2273
|
+
className: element$H('container'),
|
|
2274
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
2275
|
+
className: element$H('content'),
|
|
2276
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
2277
|
+
className: element$H('meta'),
|
|
2278
|
+
children: [name &&
|
|
2279
|
+
/*#__PURE__*/
|
|
2280
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2281
|
+
jsx("span", {
|
|
2282
|
+
className: element$H('name'),
|
|
2283
|
+
onClick: onClick,
|
|
2284
|
+
onMouseEnter: onMouseEnter,
|
|
2285
|
+
onMouseLeave: onMouseLeave,
|
|
2286
|
+
children: name
|
|
2287
|
+
}), headerActions && /*#__PURE__*/jsx("span", {
|
|
2288
|
+
className: element$H('header-actions'),
|
|
2289
|
+
children: headerActions
|
|
2290
|
+
})]
|
|
2291
|
+
}), /*#__PURE__*/jsx("div", {
|
|
2292
|
+
className: element$H('text'),
|
|
2293
|
+
children: text
|
|
2294
|
+
}), date && (fullDate ? /*#__PURE__*/jsx(Tooltip, {
|
|
2295
|
+
label: fullDate,
|
|
2296
|
+
placement: "top",
|
|
2297
|
+
children: /*#__PURE__*/jsx("span", {
|
|
2298
|
+
className: element$H('date'),
|
|
2299
|
+
children: date
|
|
2300
|
+
})
|
|
2301
|
+
}) : /*#__PURE__*/jsx("span", {
|
|
2302
|
+
className: element$H('date'),
|
|
2303
|
+
children: date
|
|
2304
|
+
}))]
|
|
2305
|
+
}), hasActions && /*#__PURE__*/jsx("div", {
|
|
2306
|
+
className: element$H('actions'),
|
|
2307
|
+
children: actions
|
|
2308
|
+
})]
|
|
2309
|
+
})]
|
|
2310
|
+
}), hasChildren && isOpen && /*#__PURE__*/jsx("div", {
|
|
2311
|
+
className: element$H('children'),
|
|
2312
|
+
children: children
|
|
2313
|
+
})]
|
|
2314
|
+
});
|
|
2315
|
+
});
|
|
2316
|
+
CommentBlock.displayName = COMPONENT_NAME$15;
|
|
2317
|
+
CommentBlock.className = CLASSNAME$13;
|
|
2318
|
+
CommentBlock.defaultProps = DEFAULT_PROPS$Y;
|
|
2258
2319
|
|
|
2259
|
-
/**
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2320
|
+
/**
|
|
2321
|
+
* Add a number of months from a date while resetting the day to prevent month length mismatches.
|
|
2322
|
+
*/
|
|
2323
|
+
function addMonthResetDay(date, monthOffset) {
|
|
2324
|
+
const newDate = new Date(date.getTime());
|
|
2325
|
+
newDate.setDate(1);
|
|
2326
|
+
newDate.setMonth(date.getMonth() + monthOffset);
|
|
2327
|
+
return newDate;
|
|
2328
|
+
}
|
|
2267
2329
|
|
|
2268
|
-
/**
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
inputValue: action.payload,
|
|
2273
|
-
// When the user is changing the value, show only values that are related to the input value.
|
|
2274
|
-
showAll: false,
|
|
2275
|
-
isOpen: true
|
|
2276
|
-
};
|
|
2277
|
-
};
|
|
2330
|
+
/**
|
|
2331
|
+
* Check if given date is valid.
|
|
2332
|
+
*/
|
|
2333
|
+
const isDateValid = date => date instanceof Date && !Number.isNaN(date.getTime());
|
|
2278
2334
|
|
|
2279
|
-
/**
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
option
|
|
2284
|
-
} = action.payload;
|
|
2285
|
-
const {
|
|
2286
|
-
options
|
|
2287
|
-
} = state;
|
|
2288
|
-
if (options[id]) {
|
|
2289
|
-
// Option already exists, return state unchanged
|
|
2290
|
-
return state;
|
|
2291
|
-
}
|
|
2292
|
-
const newOptions = {
|
|
2293
|
-
...options,
|
|
2294
|
-
[id]: option
|
|
2295
|
-
};
|
|
2296
|
-
let newType = state.type;
|
|
2297
|
-
if (isComboboxAction(option)) {
|
|
2298
|
-
newType = 'grid';
|
|
2299
|
-
}
|
|
2300
|
-
let newOptionsLength = state.optionsLength;
|
|
2301
|
-
if (isComboboxValue(option)) {
|
|
2302
|
-
newOptionsLength += 1;
|
|
2303
|
-
}
|
|
2304
|
-
return {
|
|
2305
|
-
...state,
|
|
2306
|
-
options: newOptions,
|
|
2307
|
-
type: newType,
|
|
2308
|
-
optionsLength: newOptionsLength
|
|
2309
|
-
};
|
|
2310
|
-
};
|
|
2335
|
+
/**
|
|
2336
|
+
* Component display name.
|
|
2337
|
+
*/
|
|
2338
|
+
const COMPONENT_NAME$14 = 'DatePicker';
|
|
2311
2339
|
|
|
2312
|
-
/**
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
} = action.payload;
|
|
2317
|
-
const {
|
|
2318
|
-
options
|
|
2319
|
-
} = state;
|
|
2320
|
-
const option = options[id];
|
|
2321
|
-
if (!options[id]) {
|
|
2322
|
-
// Option doesn't exist, return state unchanged
|
|
2323
|
-
return state;
|
|
2324
|
-
}
|
|
2325
|
-
const newOptions = {
|
|
2326
|
-
...options
|
|
2327
|
-
};
|
|
2328
|
-
delete newOptions[id];
|
|
2329
|
-
let newOptionsLength = state.optionsLength;
|
|
2330
|
-
if (isComboboxValue(option)) {
|
|
2331
|
-
newOptionsLength -= 1;
|
|
2332
|
-
}
|
|
2333
|
-
return {
|
|
2334
|
-
...state,
|
|
2335
|
-
options: newOptions,
|
|
2336
|
-
optionsLength: newOptionsLength
|
|
2337
|
-
};
|
|
2338
|
-
};
|
|
2340
|
+
/**
|
|
2341
|
+
* Component default class name and class prefix.
|
|
2342
|
+
*/
|
|
2343
|
+
const CLASSNAME$12 = 'lumx-date-picker';
|
|
2339
2344
|
|
|
2340
|
-
/**
|
|
2341
|
-
const
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
};
|
|
2353
|
-
|
|
2354
|
-
/** Dispatch for the combobox component */
|
|
2355
|
-
|
|
2356
|
-
/** Context for the Combobox component */
|
|
2357
|
-
const ComboboxContext = /*#__PURE__*/React__default.createContext({
|
|
2358
|
-
...initialState,
|
|
2359
|
-
openOnFocus: false,
|
|
2360
|
-
openOnClick: false,
|
|
2361
|
-
selectionType: 'single',
|
|
2362
|
-
optionsLength: 0,
|
|
2363
|
-
onSelect: noop,
|
|
2364
|
-
onInputChange: noop,
|
|
2365
|
-
onOpen: noop,
|
|
2366
|
-
dispatch: noop,
|
|
2367
|
-
translations: {
|
|
2368
|
-
clearLabel: '',
|
|
2369
|
-
tryReloadLabel: '',
|
|
2370
|
-
showSuggestionsLabel: '',
|
|
2371
|
-
noResultsForInputLabel: input => input || '',
|
|
2372
|
-
loadingLabel: '',
|
|
2373
|
-
serviceUnavailableLabel: '',
|
|
2374
|
-
nbOptionsLabel: options => `${options}`
|
|
2345
|
+
/** Get first day of week for locale from the browser API */
|
|
2346
|
+
const getFromBrowser = locale => {
|
|
2347
|
+
try {
|
|
2348
|
+
const localeMetadata = new Intl.Locale(locale.code);
|
|
2349
|
+
const {
|
|
2350
|
+
firstDay
|
|
2351
|
+
} = localeMetadata.getWeekInfo?.() || localeMetadata.weekInfo;
|
|
2352
|
+
// Sunday is represented as `0` in Date.getDay()
|
|
2353
|
+
if (firstDay === 7) return 0;
|
|
2354
|
+
return firstDay;
|
|
2355
|
+
} catch (e) {
|
|
2356
|
+
return undefined;
|
|
2375
2357
|
}
|
|
2376
|
-
}
|
|
2358
|
+
};
|
|
2377
2359
|
|
|
2378
|
-
/**
|
|
2379
|
-
const
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
onOpen,
|
|
2393
|
-
dispatch,
|
|
2394
|
-
inputValue,
|
|
2395
|
-
...contextValues
|
|
2396
|
-
} = comboboxContext;
|
|
2397
|
-
const {
|
|
2398
|
-
triggerRef
|
|
2399
|
-
} = useComboboxRefs();
|
|
2400
|
-
|
|
2401
|
-
/** Action triggered when the listBox is closed without selecting any option */
|
|
2402
|
-
const handleClose = React__default.useCallback(() => {
|
|
2403
|
-
dispatch({
|
|
2404
|
-
type: 'CLOSE_COMBOBOX'
|
|
2405
|
-
});
|
|
2406
|
-
// Reset visual focus
|
|
2407
|
-
movingFocusDispatch({
|
|
2408
|
-
type: 'RESET_SELECTED_TAB_STOP'
|
|
2409
|
-
});
|
|
2410
|
-
}, [dispatch, movingFocusDispatch]);
|
|
2411
|
-
|
|
2412
|
-
// Handle callbacks on options mounted
|
|
2413
|
-
const [optionsMountedCallbacks, setOptionsMountedCallback] = React__default.useState();
|
|
2414
|
-
React__default.useEffect(() => {
|
|
2415
|
-
if (comboboxContext.optionsLength > 0 && optionsMountedCallbacks?.length) {
|
|
2416
|
-
const optionsArray = Object.values(comboboxContext.options);
|
|
2417
|
-
// Execute callbacks
|
|
2418
|
-
for (const callback of optionsMountedCallbacks) {
|
|
2419
|
-
callback(optionsArray);
|
|
2420
|
-
}
|
|
2421
|
-
setOptionsMountedCallback(undefined);
|
|
2422
|
-
}
|
|
2423
|
-
}, [comboboxContext.options, comboboxContext.optionsLength, optionsMountedCallbacks]);
|
|
2424
|
-
|
|
2425
|
-
/** Callback for when an option is selected */
|
|
2426
|
-
const handleSelected = React__default.useCallback((option, source) => {
|
|
2427
|
-
if (option?.isDisabled) {
|
|
2428
|
-
return;
|
|
2429
|
-
}
|
|
2430
|
-
if (isComboboxValue(option)) {
|
|
2431
|
-
/**
|
|
2432
|
-
* We only close the list if the selection type is single.
|
|
2433
|
-
* If it is multiple, we want to allow the user to continue
|
|
2434
|
-
* selecting multiple options.
|
|
2435
|
-
*/
|
|
2436
|
-
if (comboboxContext.selectionType !== 'multiple') {
|
|
2437
|
-
handleClose();
|
|
2438
|
-
}
|
|
2439
|
-
/** Call parent onSelect callback */
|
|
2440
|
-
if (onSelect) {
|
|
2441
|
-
onSelect(option);
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
/** If the option itself has a custom action, also call it */
|
|
2446
|
-
if (option?.onSelect) {
|
|
2447
|
-
option.onSelect(option, source);
|
|
2448
|
-
}
|
|
2449
|
-
|
|
2450
|
-
/** Reset focus on input */
|
|
2451
|
-
if (triggerRef?.current) {
|
|
2452
|
-
triggerRef.current?.focus();
|
|
2453
|
-
}
|
|
2454
|
-
}, [comboboxContext.selectionType, handleClose, onSelect, triggerRef]);
|
|
2455
|
-
|
|
2456
|
-
/** Callback for when the input must be updated */
|
|
2457
|
-
const handleInputChange = React__default.useCallback((value, ...args) => {
|
|
2458
|
-
// Update the local state
|
|
2459
|
-
dispatch({
|
|
2460
|
-
type: 'SET_INPUT_VALUE',
|
|
2461
|
-
payload: value
|
|
2462
|
-
});
|
|
2463
|
-
// If a callback if given, call it with the value
|
|
2464
|
-
if (onInputChange) {
|
|
2465
|
-
onInputChange(value, ...args);
|
|
2466
|
-
}
|
|
2467
|
-
// Reset visual focus
|
|
2468
|
-
movingFocusDispatch({
|
|
2469
|
-
type: 'RESET_SELECTED_TAB_STOP'
|
|
2470
|
-
});
|
|
2471
|
-
}, [dispatch, movingFocusDispatch, onInputChange]);
|
|
2472
|
-
|
|
2473
|
-
/**
|
|
2474
|
-
* Open the popover
|
|
2475
|
-
*
|
|
2476
|
-
* @returns a promise with the updated context once all options are mounted
|
|
2477
|
-
*/
|
|
2478
|
-
const handleOpen = React__default.useCallback(params => {
|
|
2479
|
-
/** update the local state */
|
|
2480
|
-
dispatch({
|
|
2481
|
-
type: 'OPEN_COMBOBOX',
|
|
2482
|
-
payload: params
|
|
2483
|
-
});
|
|
2484
|
-
/** If a parent callback was given, trigger it with state information */
|
|
2485
|
-
if (onOpen) {
|
|
2486
|
-
onOpen({
|
|
2487
|
-
currentValue: inputValue,
|
|
2488
|
-
manual: Boolean(params?.manual)
|
|
2489
|
-
});
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
// Promise resolving options on mount
|
|
2493
|
-
return new Promise(resolve => {
|
|
2494
|
-
// Append to the list of callback on options mounted
|
|
2495
|
-
setOptionsMountedCallback((callbacks = []) => {
|
|
2496
|
-
callbacks.push(resolve);
|
|
2497
|
-
return callbacks;
|
|
2498
|
-
});
|
|
2499
|
-
});
|
|
2500
|
-
}, [dispatch, inputValue, onOpen]);
|
|
2501
|
-
return React__default.useMemo(() => ({
|
|
2502
|
-
handleClose,
|
|
2503
|
-
handleOpen,
|
|
2504
|
-
handleInputChange,
|
|
2505
|
-
handleSelected,
|
|
2506
|
-
dispatch,
|
|
2507
|
-
inputValue,
|
|
2508
|
-
...contextValues
|
|
2509
|
-
}), [contextValues, dispatch, handleClose, handleInputChange, handleOpen, handleSelected, inputValue]);
|
|
2510
|
-
};
|
|
2511
|
-
|
|
2512
|
-
/**
|
|
2513
|
-
* Provide props for the semantic and behaviors the combobox trigger.
|
|
2514
|
-
*
|
|
2515
|
-
*
|
|
2516
|
-
*/
|
|
2517
|
-
function useComboboxTrigger({
|
|
2518
|
-
context,
|
|
2519
|
-
refs,
|
|
2520
|
-
onBlur,
|
|
2521
|
-
onFocus,
|
|
2522
|
-
onKeyDown
|
|
2523
|
-
}) {
|
|
2524
|
-
const {
|
|
2525
|
-
comboboxId,
|
|
2526
|
-
listboxId,
|
|
2527
|
-
isOpen,
|
|
2528
|
-
options,
|
|
2529
|
-
optionsLength,
|
|
2530
|
-
selectedIds,
|
|
2531
|
-
openOnFocus,
|
|
2532
|
-
handleClose,
|
|
2533
|
-
handleOpen,
|
|
2534
|
-
handleSelected,
|
|
2535
|
-
showEmptyState = false,
|
|
2536
|
-
showErrorState = false,
|
|
2537
|
-
status
|
|
2538
|
-
} = context;
|
|
2539
|
-
const highlightedId = useVirtualFocusParent(refs.triggerRef);
|
|
2540
|
-
const {
|
|
2541
|
-
dispatch: movingFocusDispatch
|
|
2542
|
-
} = React__default.useContext(MovingFocusContext);
|
|
2543
|
-
const isErrorStateDisplayed = showErrorState && isOpen && status === 'error';
|
|
2544
|
-
const isEmptyStateDisplayed = showEmptyState && isOpen && status === 'idle' && optionsLength === 0;
|
|
2545
|
-
const showPopover = isOpen && optionsLength > 0 || isEmptyStateDisplayed || isErrorStateDisplayed;
|
|
2546
|
-
|
|
2547
|
-
/**
|
|
2548
|
-
* A debounce close to use to leave time for the
|
|
2549
|
-
* listbox to process things before closing.
|
|
2550
|
-
* This can be useful when clicking an option to leave time for the
|
|
2551
|
-
* event to be processed before closing the popover.
|
|
2552
|
-
*/
|
|
2553
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2554
|
-
const debouncedClose = React__default.useCallback(debounce$1(handleClose, 200), []);
|
|
2555
|
-
|
|
2556
|
-
/** Cleanup any ongoing cleanup */
|
|
2557
|
-
React__default.useEffect(() => {
|
|
2558
|
-
return () => {
|
|
2559
|
-
if (debouncedClose?.cancel) {
|
|
2560
|
-
debouncedClose.cancel();
|
|
2561
|
-
}
|
|
2562
|
-
};
|
|
2563
|
-
}, [debouncedClose]);
|
|
2564
|
-
const handleBlur = React__default.useCallback(event => {
|
|
2565
|
-
debouncedClose();
|
|
2566
|
-
if (onBlur) {
|
|
2567
|
-
onBlur(event);
|
|
2568
|
-
}
|
|
2569
|
-
}, [debouncedClose, onBlur]);
|
|
2570
|
-
|
|
2571
|
-
/** Actions triggered when the input field is focused */
|
|
2572
|
-
const handleFocus = event => {
|
|
2573
|
-
// If the field is refocused in the process of closing, cancel close
|
|
2574
|
-
if (debouncedClose?.cancel) {
|
|
2575
|
-
debouncedClose.cancel();
|
|
2576
|
-
}
|
|
2577
|
-
if (onFocus) {
|
|
2578
|
-
onFocus(event);
|
|
2579
|
-
}
|
|
2580
|
-
/**
|
|
2581
|
-
* Only set the open on focus if the combobox isn't already opened.
|
|
2582
|
-
* This avoids the popover re-opening when an option is selected and the
|
|
2583
|
-
* field is refocused
|
|
2584
|
-
*/
|
|
2585
|
-
if (openOnFocus && !showPopover) {
|
|
2586
|
-
handleOpen({
|
|
2587
|
-
manual: true
|
|
2588
|
-
});
|
|
2589
|
-
}
|
|
2590
|
-
};
|
|
2591
|
-
const handleClick = () => {
|
|
2592
|
-
handleOpen({
|
|
2593
|
-
manual: true
|
|
2594
|
-
});
|
|
2595
|
-
};
|
|
2596
|
-
|
|
2597
|
-
/**
|
|
2598
|
-
* Keyboard shortcut management following the WAI APG pattern
|
|
2599
|
-
* https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/#kbd_label
|
|
2600
|
-
*/
|
|
2601
|
-
const handleKeyDown = React__default.useCallback(async event => {
|
|
2602
|
-
const {
|
|
2603
|
-
key,
|
|
2604
|
-
altKey
|
|
2605
|
-
} = event;
|
|
2606
|
-
|
|
2607
|
-
/**
|
|
2608
|
-
* On Enter key
|
|
2609
|
-
* * Select option that is currently highlighted, if any
|
|
2610
|
-
* * Close suggestions, event if none is highlighted
|
|
2611
|
-
*/
|
|
2612
|
-
if (event.key === 'Enter') {
|
|
2613
|
-
if (!showPopover) {
|
|
2614
|
-
return;
|
|
2615
|
-
}
|
|
2616
|
-
if (highlightedId) {
|
|
2617
|
-
// prevent any potential form submission
|
|
2618
|
-
event.preventDefault();
|
|
2619
|
-
const option = options[highlightedId];
|
|
2620
|
-
handleSelected(option, 'keyboard');
|
|
2621
|
-
} else {
|
|
2622
|
-
handleClose();
|
|
2623
|
-
}
|
|
2624
|
-
return;
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
/**
|
|
2628
|
-
* On arrow up/down
|
|
2629
|
-
* * If popover is already opened, do nothing
|
|
2630
|
-
* * If alt key pressed, show the listbox without focusing an option
|
|
2631
|
-
* * If arrow Up is pressed, select last option
|
|
2632
|
-
* * If arrow Down is pressed, select first option
|
|
2633
|
-
* */
|
|
2634
|
-
if (key === 'ArrowDown' || key === 'ArrowUp') {
|
|
2635
|
-
if (showPopover) {
|
|
2636
|
-
return;
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
/** Open the listbox */
|
|
2640
|
-
const listBoxOptions = await handleOpen({
|
|
2641
|
-
manual: true
|
|
2642
|
-
});
|
|
2643
|
-
if (!listBoxOptions) {
|
|
2644
|
-
return;
|
|
2645
|
-
}
|
|
2646
|
-
|
|
2647
|
-
/**
|
|
2648
|
-
* If alt key is pressed, only open without changing visual focus
|
|
2649
|
-
* as per WAI Guidelines
|
|
2650
|
-
*/
|
|
2651
|
-
if (!altKey) {
|
|
2652
|
-
/** If a selected id is set, set it as current tabstop */
|
|
2653
|
-
if (selectedIds?.length) {
|
|
2654
|
-
movingFocusDispatch({
|
|
2655
|
-
type: 'SELECT_TAB_STOP',
|
|
2656
|
-
payload: {
|
|
2657
|
-
id: selectedIds?.[0],
|
|
2658
|
-
type: 'keyboard'
|
|
2659
|
-
}
|
|
2660
|
-
});
|
|
2661
|
-
} else {
|
|
2662
|
-
/** Focus either the first or last item depending on the keyboard arrow pressed */
|
|
2663
|
-
movingFocusDispatch({
|
|
2664
|
-
type: 'KEY_NAV',
|
|
2665
|
-
payload: {
|
|
2666
|
-
ctrlKey: false,
|
|
2667
|
-
key: key === 'ArrowUp' ? 'End' : 'Home'
|
|
2668
|
-
}
|
|
2669
|
-
});
|
|
2670
|
-
}
|
|
2671
|
-
}
|
|
2672
|
-
return;
|
|
2673
|
-
}
|
|
2674
|
-
|
|
2675
|
-
// Forward event
|
|
2676
|
-
onKeyDown?.(event);
|
|
2677
|
-
}, [onKeyDown, showPopover, highlightedId, options, handleSelected, handleClose, handleOpen, selectedIds, movingFocusDispatch]);
|
|
2678
|
-
return {
|
|
2679
|
-
id: comboboxId,
|
|
2680
|
-
role: 'combobox',
|
|
2681
|
-
'aria-activedescendant': showPopover && highlightedId ? highlightedId : '',
|
|
2682
|
-
'aria-controls': listboxId,
|
|
2683
|
-
'aria-owns': listboxId,
|
|
2684
|
-
'aria-expanded': showPopover,
|
|
2685
|
-
onFocus: handleFocus,
|
|
2686
|
-
onBlur: handleBlur,
|
|
2687
|
-
onClick: handleClick,
|
|
2688
|
-
onKeyDown: handleKeyDown
|
|
2689
|
-
};
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
/** Is printable character key press */
|
|
2693
|
-
const isTypeEvent = ({
|
|
2694
|
-
key,
|
|
2695
|
-
altKey,
|
|
2696
|
-
ctrlKey,
|
|
2697
|
-
metaKey
|
|
2698
|
-
}) => key.length === 1 && key !== ' ' && !altKey && !ctrlKey && !metaKey;
|
|
2699
|
-
|
|
2700
|
-
/**
|
|
2701
|
-
* Provide props for the semantic and behaviors the combobox button trigger
|
|
2702
|
-
*
|
|
2703
|
-
* Overrides the useComboboxTrigger() props & behavior to add a jump to option
|
|
2704
|
-
* on printable character key down.
|
|
2705
|
-
*/
|
|
2706
|
-
function useComboboxButton(args) {
|
|
2707
|
-
const {
|
|
2708
|
-
context: {
|
|
2709
|
-
handleOpen
|
|
2710
|
-
},
|
|
2711
|
-
onKeyDown: parentOnKeyDown
|
|
2712
|
-
} = args;
|
|
2713
|
-
const {
|
|
2714
|
-
dispatch: movingFocusDispatch,
|
|
2715
|
-
state: {
|
|
2716
|
-
selectedId: highlightedId
|
|
2717
|
-
}
|
|
2718
|
-
} = React__default.useContext(MovingFocusContext);
|
|
2719
|
-
const searchValueRef = React__default.useRef('');
|
|
2720
|
-
const searchTimeoutRef = React__default.useRef();
|
|
2721
|
-
const onKeyDown = React__default.useMemo(() => {
|
|
2722
|
-
function clearSearchTimeout() {
|
|
2723
|
-
const searchTimeout = searchTimeoutRef.current;
|
|
2724
|
-
if (!searchTimeout) {
|
|
2725
|
-
return;
|
|
2726
|
-
}
|
|
2727
|
-
clearTimeout(searchTimeout);
|
|
2728
|
-
searchTimeoutRef.current = undefined;
|
|
2729
|
-
}
|
|
2730
|
-
function clearSearch() {
|
|
2731
|
-
searchValueRef.current = '';
|
|
2732
|
-
clearSearchTimeout();
|
|
2733
|
-
}
|
|
2734
|
-
return async event => {
|
|
2735
|
-
if (!isTypeEvent(event)) {
|
|
2736
|
-
// Forward key down event
|
|
2737
|
-
parentOnKeyDown?.(event);
|
|
2738
|
-
return undefined;
|
|
2739
|
-
}
|
|
2740
|
-
event.stopPropagation();
|
|
2741
|
-
|
|
2742
|
-
// Clear current search timeout
|
|
2743
|
-
clearSearchTimeout();
|
|
2744
|
-
|
|
2745
|
-
// Open combobox and wait for options to mount
|
|
2746
|
-
const options = await handleOpen({
|
|
2747
|
-
manual: false
|
|
2748
|
-
});
|
|
2749
|
-
const optionArray = options && Object.values(options);
|
|
2750
|
-
if (!optionArray?.length) {
|
|
2751
|
-
return undefined;
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
|
-
// Append key to current search
|
|
2755
|
-
searchValueRef.current += event.key.toLowerCase();
|
|
2756
|
-
const searchValue = searchValueRef.current;
|
|
2757
|
-
|
|
2758
|
-
// Clear search after 500ms
|
|
2759
|
-
searchTimeoutRef.current = setTimeout(clearSearch, 500);
|
|
2760
|
-
|
|
2761
|
-
// Search is containing all the same letters (ex: aaaa)
|
|
2762
|
-
const allTheSameLetters = searchValue.split('').every(letter => letter === searchValue[0]);
|
|
2763
|
-
|
|
2764
|
-
// start from currently selected option
|
|
2765
|
-
let startIndex = optionArray.findIndex(option => option.generatedId === highlightedId);
|
|
2766
|
-
if (startIndex === -1) {
|
|
2767
|
-
startIndex = 0;
|
|
2768
|
-
}
|
|
2769
|
-
let index = startIndex;
|
|
2770
|
-
do {
|
|
2771
|
-
// Increment index and loop around to 0 if we get over the array length
|
|
2772
|
-
index = (index + 1) % optionArray.length;
|
|
2773
|
-
const option = optionArray[index];
|
|
2774
|
-
// Search by text value or fallback on id.
|
|
2775
|
-
const optionText = isComboboxValue(option) ? option?.textValue || option?.id : null;
|
|
2776
|
-
if (isComboboxValue(option) && optionText) {
|
|
2777
|
-
const optionTextValue = optionText.toLowerCase();
|
|
2778
|
-
|
|
2779
|
-
// Search on first letter if search is all the same letters
|
|
2780
|
-
const searchText = allTheSameLetters ? searchValue[0] : searchValue;
|
|
2781
|
-
|
|
2782
|
-
// Option text value starts with searched text
|
|
2783
|
-
if (optionTextValue.startsWith(searchText)) {
|
|
2784
|
-
movingFocusDispatch({
|
|
2785
|
-
type: 'SELECT_TAB_STOP',
|
|
2786
|
-
payload: {
|
|
2787
|
-
id: option.generatedId,
|
|
2788
|
-
type: 'keyboard'
|
|
2789
|
-
}
|
|
2790
|
-
});
|
|
2791
|
-
break;
|
|
2792
|
-
}
|
|
2793
|
-
}
|
|
2794
|
-
} while (index !== startIndex);
|
|
2795
|
-
return clearSearchTimeout;
|
|
2796
|
-
};
|
|
2797
|
-
}, [handleOpen, parentOnKeyDown, highlightedId, movingFocusDispatch]);
|
|
2798
|
-
return useComboboxTrigger({
|
|
2799
|
-
...args,
|
|
2800
|
-
onKeyDown
|
|
2801
|
-
});
|
|
2802
|
-
}
|
|
2803
|
-
|
|
2804
|
-
/**
|
|
2805
|
-
* Combobox button trigger.
|
|
2806
|
-
*
|
|
2807
|
-
* @family Combobox
|
|
2808
|
-
*/
|
|
2809
|
-
const ComboboxButton = forwardRef((props, ref) => {
|
|
2810
|
-
const {
|
|
2811
|
-
as,
|
|
2812
|
-
label,
|
|
2813
|
-
onFocus,
|
|
2814
|
-
onBlur,
|
|
2815
|
-
labelDisplayMode = 'show-selection',
|
|
2816
|
-
...forwardedProps
|
|
2817
|
-
} = props;
|
|
2818
|
-
const refs = useComboboxRefs();
|
|
2819
|
-
const context = useCombobox();
|
|
2820
|
-
const buttonProps = useComboboxButton({
|
|
2821
|
-
context,
|
|
2822
|
-
refs,
|
|
2823
|
-
onBlur,
|
|
2824
|
-
onFocus
|
|
2825
|
-
});
|
|
2826
|
-
const Element = as || Button;
|
|
2827
|
-
const showSelection = labelDisplayMode === 'show-selection';
|
|
2828
|
-
const tooltipOnly = labelDisplayMode === 'show-tooltip';
|
|
2829
|
-
const selectionLabel = showSelection && context.selectedIds?.length && context.inputValue;
|
|
2830
|
-
let content = null;
|
|
2831
|
-
if (!tooltipOnly) {
|
|
2832
|
-
// Display selection label or label
|
|
2833
|
-
content = selectionLabel || label;
|
|
2834
|
-
}
|
|
2835
|
-
const hideTooltip =
|
|
2836
|
-
// Hide tooltip if the displayed label and tooltip label are the same
|
|
2837
|
-
label === content ||
|
|
2838
|
-
// Hide tooltip when the combobox is open
|
|
2839
|
-
context.isOpen;
|
|
2840
|
-
const mergedRefs = useMergeRefs(ref, refs.triggerRef, refs.anchorRef);
|
|
2841
|
-
return /*#__PURE__*/jsx(Tooltip, {
|
|
2842
|
-
className: hideTooltip ? visuallyHidden() : undefined,
|
|
2843
|
-
label: label,
|
|
2844
|
-
closeMode: "hide",
|
|
2845
|
-
ariaLinkMode: "aria-labelledby",
|
|
2846
|
-
children: /*#__PURE__*/jsx(Element, {
|
|
2847
|
-
ref: mergedRefs,
|
|
2848
|
-
...forwardedProps,
|
|
2849
|
-
...buttonProps,
|
|
2850
|
-
children: content
|
|
2851
|
-
})
|
|
2852
|
-
});
|
|
2853
|
-
});
|
|
2854
|
-
|
|
2855
|
-
/**
|
|
2856
|
-
* Provide props for the semantic and behaviors the combobox input trigger
|
|
2857
|
-
*
|
|
2858
|
-
* Overrides the useComboboxTrigger() props & behavior to prevent open on click
|
|
2859
|
-
* if `openOnFocus` is not enabled.
|
|
2860
|
-
*/
|
|
2861
|
-
function useComboboxInput({
|
|
2862
|
-
onKeyDown: propsOnKeyDown,
|
|
2863
|
-
...args
|
|
2864
|
-
}) {
|
|
2865
|
-
const triggerProps = useComboboxTrigger(args);
|
|
2866
|
-
const {
|
|
2867
|
-
onClick,
|
|
2868
|
-
onKeyDown,
|
|
2869
|
-
'aria-expanded': showPopover
|
|
2870
|
-
} = triggerProps;
|
|
2871
|
-
const handleClick = () => {
|
|
2872
|
-
if (!args.context.openOnFocus && !args.context.openOnClick) {
|
|
2873
|
-
// Skip if input should not opening on focus nor click
|
|
2874
|
-
return;
|
|
2875
|
-
}
|
|
2876
|
-
onClick();
|
|
2877
|
-
};
|
|
2878
|
-
const handleKeyDown = evt => {
|
|
2879
|
-
if (evt.key === 'Escape') {
|
|
2880
|
-
// Reset field if closed
|
|
2881
|
-
if (!showPopover) {
|
|
2882
|
-
args.context.handleInputChange('');
|
|
2883
|
-
}
|
|
2884
|
-
return;
|
|
2885
|
-
}
|
|
2886
|
-
onKeyDown(evt);
|
|
2887
|
-
if (propsOnKeyDown) {
|
|
2888
|
-
propsOnKeyDown(evt);
|
|
2889
|
-
}
|
|
2890
|
-
};
|
|
2891
|
-
return {
|
|
2892
|
-
...triggerProps,
|
|
2893
|
-
onClick: handleClick,
|
|
2894
|
-
onKeyDown: handleKeyDown
|
|
2895
|
-
};
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
|
-
/**
|
|
2899
|
-
* Combobox input trigger.
|
|
2900
|
-
*
|
|
2901
|
-
* @family Combobox
|
|
2902
|
-
*/
|
|
2903
|
-
const ComboboxInput = ({
|
|
2904
|
-
hideToggle,
|
|
2905
|
-
inputRef,
|
|
2906
|
-
textFieldRef,
|
|
2907
|
-
afterElement,
|
|
2908
|
-
onFocus,
|
|
2909
|
-
onBlur,
|
|
2910
|
-
onKeyDown,
|
|
2911
|
-
clearButtonProps,
|
|
2912
|
-
hasClearButton,
|
|
2913
|
-
theme,
|
|
2914
|
-
...textFieldProps
|
|
2915
|
-
}) => {
|
|
2916
|
-
const refs = useComboboxRefs();
|
|
2917
|
-
const context = useCombobox();
|
|
2918
|
-
const inputProps = useComboboxInput({
|
|
2919
|
-
refs,
|
|
2920
|
-
context,
|
|
2921
|
-
onBlur,
|
|
2922
|
-
onFocus,
|
|
2923
|
-
onKeyDown
|
|
2924
|
-
});
|
|
2925
|
-
const {
|
|
2926
|
-
listboxId,
|
|
2927
|
-
isOpen,
|
|
2928
|
-
handleOpen,
|
|
2929
|
-
handleClose,
|
|
2930
|
-
inputValue,
|
|
2931
|
-
handleInputChange
|
|
2932
|
-
} = context;
|
|
2933
|
-
|
|
2934
|
-
/** Callback for when the toggle button is trigged */
|
|
2935
|
-
const handleManualToggle = () => {
|
|
2936
|
-
if (isOpen) {
|
|
2937
|
-
handleClose();
|
|
2938
|
-
} else {
|
|
2939
|
-
handleOpen({
|
|
2940
|
-
manual: true
|
|
2941
|
-
});
|
|
2942
|
-
}
|
|
2943
|
-
refs.triggerRef?.current?.focus();
|
|
2944
|
-
};
|
|
2945
|
-
return /*#__PURE__*/jsx(TextField
|
|
2946
|
-
// Disable native autocomplete
|
|
2947
|
-
, {
|
|
2948
|
-
autoComplete: "off",
|
|
2949
|
-
...textFieldProps,
|
|
2950
|
-
inputRef: mergeRefs(refs.triggerRef, inputRef),
|
|
2951
|
-
textFieldRef: mergeRefs(refs.anchorRef, textFieldRef)
|
|
2952
|
-
// Combobox props
|
|
2953
|
-
,
|
|
2954
|
-
...inputProps,
|
|
2955
|
-
theme: theme,
|
|
2956
|
-
value: inputValue,
|
|
2957
|
-
onClear: () => handleInputChange(''),
|
|
2958
|
-
onChange: handleInputChange,
|
|
2959
|
-
clearButtonProps: hasClearButton ? {
|
|
2960
|
-
...clearButtonProps,
|
|
2961
|
-
label: context.translations.clearLabel
|
|
2962
|
-
} : undefined,
|
|
2963
|
-
afterElement: (!hideToggle || afterElement) && /*#__PURE__*/jsxs(Fragment, {
|
|
2964
|
-
children: [afterElement, !hideToggle && /*#__PURE__*/jsx(IconButton, {
|
|
2965
|
-
theme: theme,
|
|
2966
|
-
onClick: handleManualToggle,
|
|
2967
|
-
label: context.translations.showSuggestionsLabel,
|
|
2968
|
-
emphasis: Emphasis$1.low,
|
|
2969
|
-
size: Size$1.s,
|
|
2970
|
-
icon: inputProps['aria-expanded'] ? mdiChevronUp : mdiChevronDown,
|
|
2971
|
-
type: "button",
|
|
2972
|
-
tabIndex: -1,
|
|
2973
|
-
"aria-expanded": inputProps['aria-expanded'],
|
|
2974
|
-
"aria-haspopup": "listbox",
|
|
2975
|
-
"aria-controls": listboxId
|
|
2976
|
-
})]
|
|
2977
|
-
})
|
|
2978
|
-
});
|
|
2979
|
-
};
|
|
2980
|
-
|
|
2981
|
-
const ComboboxOptionContext = /*#__PURE__*/createContext({});
|
|
2982
|
-
/** Context Provider to store the current combobox option id. */
|
|
2983
|
-
const ComboboxOptionContextProvider = ({
|
|
2984
|
-
optionId,
|
|
2985
|
-
isKeyboardHighlighted,
|
|
2986
|
-
children
|
|
2987
|
-
}) => {
|
|
2988
|
-
const value = React__default.useMemo(() => ({
|
|
2989
|
-
optionId,
|
|
2990
|
-
isKeyboardHighlighted
|
|
2991
|
-
}), [optionId, isKeyboardHighlighted]);
|
|
2992
|
-
return /*#__PURE__*/jsx(ComboboxOptionContext.Provider, {
|
|
2993
|
-
value: value,
|
|
2994
|
-
children: children
|
|
2995
|
-
});
|
|
2996
|
-
};
|
|
2997
|
-
|
|
2998
|
-
/** Retrieve the current combobox section id */
|
|
2999
|
-
const useComboboxSectionId = () => {
|
|
3000
|
-
return useContext(SectionContext);
|
|
3001
|
-
};
|
|
3002
|
-
|
|
3003
|
-
/**
|
|
3004
|
-
* Register the given option to the context
|
|
3005
|
-
*/
|
|
3006
|
-
const useRegisterOption = (registerId, option, shouldRegister) => {
|
|
3007
|
-
const {
|
|
3008
|
-
dispatch
|
|
3009
|
-
} = useCombobox();
|
|
3010
|
-
|
|
3011
|
-
/** Register the given options */
|
|
3012
|
-
React__default.useEffect(() => {
|
|
3013
|
-
if (option && shouldRegister) {
|
|
3014
|
-
dispatch({
|
|
3015
|
-
type: 'ADD_OPTION',
|
|
3016
|
-
payload: {
|
|
3017
|
-
id: registerId,
|
|
3018
|
-
option
|
|
3019
|
-
}
|
|
3020
|
-
});
|
|
3021
|
-
}
|
|
3022
|
-
|
|
3023
|
-
// Unregister ids if/when the component unmounts or if option changes
|
|
3024
|
-
return () => {
|
|
3025
|
-
if (option) {
|
|
3026
|
-
dispatch({
|
|
3027
|
-
type: 'REMOVE_OPTION',
|
|
3028
|
-
payload: {
|
|
3029
|
-
id: registerId
|
|
3030
|
-
}
|
|
3031
|
-
});
|
|
3032
|
-
}
|
|
3033
|
-
};
|
|
3034
|
-
}, [dispatch, option, registerId, shouldRegister]);
|
|
3035
|
-
};
|
|
3036
|
-
|
|
3037
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3038
|
-
const CLASSNAME$16 = 'lumx-combobox-option';
|
|
3039
|
-
const LUMX_CLASSNAME = 'lumx-list-item';
|
|
3040
|
-
const {
|
|
3041
|
-
block: block$Z,
|
|
3042
|
-
element: element$L
|
|
3043
|
-
} = classNames.bem(CLASSNAME$16);
|
|
3044
|
-
const lumxListItem = classNames.bem(LUMX_CLASSNAME);
|
|
3045
|
-
|
|
3046
|
-
/**
|
|
3047
|
-
* Content of the option.
|
|
3048
|
-
* This should only be rendered if the option is shown.
|
|
3049
|
-
*/
|
|
3050
|
-
const OptionContent = forwardRef((props, ref) => {
|
|
3051
|
-
const {
|
|
3052
|
-
id,
|
|
3053
|
-
onSelect,
|
|
3054
|
-
isSelected,
|
|
3055
|
-
isDisabled,
|
|
3056
|
-
children,
|
|
3057
|
-
className,
|
|
3058
|
-
before,
|
|
3059
|
-
after,
|
|
3060
|
-
as,
|
|
3061
|
-
size = Size$1.tiny,
|
|
3062
|
-
comboboxType,
|
|
3063
|
-
tooltipProps,
|
|
3064
|
-
description,
|
|
3065
|
-
'aria-hidden': ariaHidden,
|
|
3066
|
-
autofocus,
|
|
3067
|
-
...forwardedProps
|
|
3068
|
-
} = props;
|
|
3069
|
-
const itemRef = React__default.useRef(null);
|
|
3070
|
-
const {
|
|
3071
|
-
state
|
|
3072
|
-
} = React__default.useContext(MovingFocusContext);
|
|
3073
|
-
const {
|
|
3074
|
-
selectedIds
|
|
3075
|
-
} = useCombobox();
|
|
3076
|
-
const hasSelection = selectedIds !== undefined;
|
|
3077
|
-
const isHighlighted = useVirtualFocus(id, itemRef, false, comboboxType === 'grid' ? id : undefined, autofocus);
|
|
3078
|
-
const Element = as || 'span';
|
|
3079
|
-
const ariaSelected = isSelected ? 'true' : 'false';
|
|
3080
|
-
const ariaDescriptionId = description ? `${id}-description` : undefined;
|
|
3081
|
-
const isKeyboardHighlighted = state.isUsingKeyboard && isHighlighted;
|
|
3082
|
-
|
|
3083
|
-
/**
|
|
3084
|
-
* The DS `ListItem` component has a lot of behavior / default props we do not want here.
|
|
3085
|
-
* Notably the before/after items are within the interactive element, which we do not want.
|
|
3086
|
-
* So we use a native li tag.
|
|
3087
|
-
*/
|
|
3088
|
-
return /*#__PURE__*/jsx("li", {
|
|
3089
|
-
className: block$Z(undefined, [className ?? '', lumxListItem.block({
|
|
3090
|
-
[`size-${size}`]: !!size
|
|
3091
|
-
})]),
|
|
3092
|
-
role: "presentation",
|
|
3093
|
-
ref: itemRef,
|
|
3094
|
-
"aria-hidden": ariaHidden,
|
|
3095
|
-
style: {
|
|
3096
|
-
display: ariaHidden ? 'none' : undefined
|
|
3097
|
-
},
|
|
3098
|
-
...forwardedProps,
|
|
3099
|
-
children: /*#__PURE__*/jsxs(GenericBlock, {
|
|
3100
|
-
as: "div",
|
|
3101
|
-
role: comboboxType === 'grid' ? 'row' : 'presentation',
|
|
3102
|
-
className: element$L('content', {
|
|
3103
|
-
// Not using the lumx list item disabled style as it blocks pointer events
|
|
3104
|
-
'is-disabled': !!isDisabled
|
|
3105
|
-
},
|
|
3106
|
-
// TODO: migrate away from using lumx-list-item styles https://lumapps.atlassian.net/browse/DSW-288
|
|
3107
|
-
[lumxListItem.element('link', {
|
|
3108
|
-
'is-selected': Boolean(isSelected),
|
|
3109
|
-
'is-highlighted': Boolean(isHighlighted)
|
|
3110
|
-
})]),
|
|
3111
|
-
"data-focus-visible-added": isKeyboardHighlighted ? 'true' : undefined,
|
|
3112
|
-
children: [before && /*#__PURE__*/jsx(GenericBlock.Figure, {
|
|
3113
|
-
as: "span",
|
|
3114
|
-
role: "presentation",
|
|
3115
|
-
className: element$L('before', undefined, [lumxListItem.element('before')]),
|
|
3116
|
-
children: before
|
|
3117
|
-
}), /*#__PURE__*/jsxs(GenericBlock.Content, {
|
|
3118
|
-
as: "span",
|
|
3119
|
-
role: "presentation",
|
|
3120
|
-
className: lumxListItem.element('content'),
|
|
3121
|
-
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
3122
|
-
forceOpen: isKeyboardHighlighted,
|
|
3123
|
-
closeMode: "hide",
|
|
3124
|
-
...tooltipProps,
|
|
3125
|
-
children: /*#__PURE__*/jsx(Element, {
|
|
3126
|
-
id: id,
|
|
3127
|
-
className: element$L('trigger'),
|
|
3128
|
-
role: comboboxType === 'grid' ? 'gridcell' : 'option',
|
|
3129
|
-
"aria-selected": hasSelection ? ariaSelected : undefined,
|
|
3130
|
-
"aria-disabled": isDisabled,
|
|
3131
|
-
"aria-describedby": ariaDescriptionId,
|
|
3132
|
-
onClick: onSelect
|
|
3133
|
-
// Prevent mouse down to avoid blur before the click is activated
|
|
3134
|
-
,
|
|
3135
|
-
onMouseDown: event => event.preventDefault(),
|
|
3136
|
-
ref: ref,
|
|
3137
|
-
...forwardedProps,
|
|
3138
|
-
children: children
|
|
3139
|
-
})
|
|
3140
|
-
}), description && /*#__PURE__*/jsx(Text, {
|
|
3141
|
-
as: "span",
|
|
3142
|
-
id: ariaDescriptionId,
|
|
3143
|
-
role: "presentation",
|
|
3144
|
-
className: element$L('description'),
|
|
3145
|
-
typography: "caption",
|
|
3146
|
-
color: "dark",
|
|
3147
|
-
colorVariant: "L2",
|
|
3148
|
-
children: description
|
|
3149
|
-
})]
|
|
3150
|
-
}), after && /*#__PURE__*/jsx(GenericBlock.Actions, {
|
|
3151
|
-
as: "span",
|
|
3152
|
-
role: "presentation",
|
|
3153
|
-
className: element$L('after', undefined, [lumxListItem.element('after')]),
|
|
3154
|
-
children: /*#__PURE__*/jsx(ComboboxOptionContextProvider, {
|
|
3155
|
-
optionId: id,
|
|
3156
|
-
isKeyboardHighlighted: isKeyboardHighlighted,
|
|
3157
|
-
children: after
|
|
3158
|
-
})
|
|
3159
|
-
})]
|
|
3160
|
-
})
|
|
3161
|
-
});
|
|
3162
|
-
});
|
|
3163
|
-
|
|
3164
|
-
/**
|
|
3165
|
-
* Props for ComboboxOption with additional generic properties.
|
|
3166
|
-
*/
|
|
3167
|
-
|
|
3168
|
-
/**
|
|
3169
|
-
* Option to set within a combobox list.
|
|
3170
|
-
*
|
|
3171
|
-
* @family Combobox
|
|
3172
|
-
* @param ComboboxOptionProps
|
|
3173
|
-
* @returns ComboboxOption
|
|
3174
|
-
*/
|
|
3175
|
-
const ComboboxOption = forwardRef((props, ref) => {
|
|
3176
|
-
const {
|
|
3177
|
-
children,
|
|
3178
|
-
id,
|
|
3179
|
-
textValue,
|
|
3180
|
-
data,
|
|
3181
|
-
filterFromInput = true,
|
|
3182
|
-
onSelect: onOptionSelect,
|
|
3183
|
-
isDisabled,
|
|
3184
|
-
as = 'span',
|
|
3185
|
-
...optionProps
|
|
3186
|
-
} = props;
|
|
3187
|
-
|
|
3188
|
-
// Get the id of the current group, if any.
|
|
3189
|
-
const section = useComboboxSectionId();
|
|
3190
|
-
const {
|
|
3191
|
-
comboboxId,
|
|
3192
|
-
selectedIds,
|
|
3193
|
-
showAll,
|
|
3194
|
-
inputValue,
|
|
3195
|
-
handleSelected,
|
|
3196
|
-
type
|
|
3197
|
-
} = useCombobox();
|
|
3198
|
-
// Generate a unique id for this option.
|
|
3199
|
-
const generatedId = generateOptionId(comboboxId, id);
|
|
3200
|
-
const isSelected = selectedIds?.includes(generatedId);
|
|
3201
|
-
|
|
3202
|
-
// If no text value is set and the direct child is a simple string, use it as value.
|
|
3203
|
-
const isStringChild = typeof children === 'string' || typeof children === 'number';
|
|
3204
|
-
const value = children && !textValue && isStringChild ? children.toString() : textValue;
|
|
3205
|
-
const showOption = !filterFromInput || showAll || value?.toString()?.toLowerCase().includes(inputValue?.toLowerCase());
|
|
3206
|
-
const registeredOption = React__default.useMemo(() => ({
|
|
3207
|
-
id,
|
|
3208
|
-
generatedId,
|
|
3209
|
-
textValue: value,
|
|
3210
|
-
data,
|
|
3211
|
-
filter: filterFromInput,
|
|
3212
|
-
isDisabled: isDisabled || !showOption,
|
|
3213
|
-
sectionId: section.sectionId,
|
|
3214
|
-
onSelect: onOptionSelect
|
|
3215
|
-
}), [data, filterFromInput, generatedId, section.sectionId, id, isDisabled, onOptionSelect, showOption, value]);
|
|
3216
|
-
|
|
3217
|
-
// Register the option
|
|
3218
|
-
useRegisterOption(generatedId, registeredOption, showOption);
|
|
3219
|
-
const handleSelect = React__default.useCallback(() => handleSelected(registeredOption, 'click'), [handleSelected, registeredOption]);
|
|
3220
|
-
if (!id || !showOption) {
|
|
3221
|
-
return null;
|
|
3222
|
-
}
|
|
3223
|
-
return /*#__PURE__*/jsx(OptionContent, {
|
|
3224
|
-
id: generatedId,
|
|
3225
|
-
onSelect: handleSelect,
|
|
3226
|
-
isSelected: isSelected,
|
|
3227
|
-
isDisabled: isDisabled,
|
|
3228
|
-
as: as,
|
|
3229
|
-
ref: ref,
|
|
3230
|
-
comboboxType: type,
|
|
3231
|
-
"aria-hidden": section.isLoading,
|
|
3232
|
-
...optionProps,
|
|
3233
|
-
children: children || textValue
|
|
3234
|
-
});
|
|
3235
|
-
});
|
|
3236
|
-
|
|
3237
|
-
// Default widths the skeletons must have
|
|
3238
|
-
const defaultWidths = [REAL_SIZE_FOR_LUMX_SIZE.xxl, REAL_SIZE_FOR_LUMX_SIZE.xl, REAL_SIZE_FOR_LUMX_SIZE.l];
|
|
3239
|
-
const {
|
|
3240
|
-
block: block$Y,
|
|
3241
|
-
element: element$K
|
|
3242
|
-
} = classNames.bem(CLASSNAME$16);
|
|
3243
|
-
|
|
3244
|
-
/**
|
|
3245
|
-
* Skeleton for a combobox option.
|
|
3246
|
-
* A typography skeleton is rendered by default but can be overridden by passing children.
|
|
3247
|
-
*/
|
|
3248
|
-
const ComboboxOptionSkeleton = ({
|
|
3249
|
-
className,
|
|
3250
|
-
index,
|
|
3251
|
-
before,
|
|
3252
|
-
after,
|
|
3253
|
-
size = Size$1.tiny,
|
|
3254
|
-
children
|
|
3255
|
-
}) => {
|
|
3256
|
-
const renderedChildren = typeof children === 'function' ? children({
|
|
3257
|
-
index
|
|
3258
|
-
}) : children;
|
|
3259
|
-
const content = renderedChildren || /*#__PURE__*/jsx(SkeletonTypography, {
|
|
3260
|
-
typography: "body1",
|
|
3261
|
-
width: index !== undefined && defaultWidths[index] ? defaultWidths[index] : REAL_SIZE_FOR_LUMX_SIZE.xl
|
|
3262
|
-
});
|
|
3263
|
-
return /*#__PURE__*/jsxs("li", {
|
|
3264
|
-
role: "presentation",
|
|
3265
|
-
className: block$Y({
|
|
3266
|
-
skeleton: true
|
|
3267
|
-
}, ['lumx-list-item', `lumx-list-item--size-${size}`, className]),
|
|
3268
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
3269
|
-
role: "presentation",
|
|
3270
|
-
className: element$K('content', ['lumx-list-item__wrapper']),
|
|
3271
|
-
children: [before && /*#__PURE__*/jsx(Text, {
|
|
3272
|
-
as: "span",
|
|
3273
|
-
role: "presentation",
|
|
3274
|
-
className: element$K('before', ['lumx-list-item__before']),
|
|
3275
|
-
children: before
|
|
3276
|
-
}), content]
|
|
3277
|
-
}), after && /*#__PURE__*/jsx("div", {
|
|
3278
|
-
role: "presentation",
|
|
3279
|
-
className: element$K('after', ['lumx-list-item__after']),
|
|
3280
|
-
children: after
|
|
3281
|
-
})]
|
|
3282
|
-
});
|
|
3283
|
-
};
|
|
3284
|
-
|
|
3285
|
-
/** Default skeleton for the options list of the combobox */
|
|
3286
|
-
const ComboboxListSkeleton = ({
|
|
3287
|
-
isLoadingMore,
|
|
3288
|
-
children
|
|
3289
|
-
}) => /*#__PURE__*/jsx(Fragment, {
|
|
3290
|
-
children: Array.from({
|
|
3291
|
-
length: isLoadingMore ? 1 : 3
|
|
3292
|
-
}).map((_, index) => {
|
|
3293
|
-
const renderedChildren = typeof children === 'function' ? children({
|
|
3294
|
-
index
|
|
3295
|
-
}) : children || /*#__PURE__*/jsx(ComboboxOptionSkeleton, {
|
|
3296
|
-
index: index
|
|
3297
|
-
});
|
|
3298
|
-
return (
|
|
3299
|
-
/*#__PURE__*/
|
|
3300
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
3301
|
-
jsx(React__default.Fragment, {
|
|
3302
|
-
children: renderedChildren
|
|
3303
|
-
}, index)
|
|
3304
|
-
);
|
|
3305
|
-
})
|
|
3306
|
-
});
|
|
3307
|
-
|
|
3308
|
-
/** The states in which the full loading must be displayed */
|
|
3309
|
-
const FULL_LOADING_STATES = ['loading', 'debouncing', 'filtering'];
|
|
3310
|
-
const CLASSNAME$15 = 'lumx-combobox-listbox';
|
|
3311
|
-
const {
|
|
3312
|
-
block: block$X,
|
|
3313
|
-
element: element$J
|
|
3314
|
-
} = bem$1(CLASSNAME$15);
|
|
3315
|
-
|
|
3316
|
-
/**
|
|
3317
|
-
* The listbox containing the combobox's options.
|
|
3318
|
-
*
|
|
3319
|
-
* @family Combobox
|
|
3320
|
-
* @param ComboboxListBoxProps
|
|
3321
|
-
* @returns ComboboxListBox
|
|
3322
|
-
*/
|
|
3323
|
-
const ComboboxListBox = ({
|
|
3324
|
-
children,
|
|
3325
|
-
renderItemSkeleton,
|
|
3326
|
-
label,
|
|
3327
|
-
popoverProps,
|
|
3328
|
-
footer,
|
|
3329
|
-
listRef,
|
|
3330
|
-
...forwardedProps
|
|
3331
|
-
}) => {
|
|
3332
|
-
const {
|
|
3333
|
-
status,
|
|
3334
|
-
listboxId,
|
|
3335
|
-
isOpen,
|
|
3336
|
-
optionsLength,
|
|
3337
|
-
handleClose: contextHandleClose,
|
|
3338
|
-
type,
|
|
3339
|
-
inputValue,
|
|
3340
|
-
showEmptyState,
|
|
3341
|
-
showErrorState,
|
|
3342
|
-
translations
|
|
3343
|
-
} = useCombobox();
|
|
3344
|
-
const {
|
|
3345
|
-
anchorRef
|
|
3346
|
-
} = useComboboxRefs();
|
|
3347
|
-
const {
|
|
3348
|
-
onClose,
|
|
3349
|
-
...otherPopoverProps
|
|
3350
|
-
} = popoverProps || {};
|
|
3351
|
-
const {
|
|
3352
|
-
style,
|
|
3353
|
-
className,
|
|
3354
|
-
...listProps
|
|
3355
|
-
} = forwardedProps;
|
|
3356
|
-
// The states to show a full skeleton instead of the options
|
|
3357
|
-
const showFullLoading = FULL_LOADING_STATES.includes(status);
|
|
3358
|
-
const isErrorStateDisplayed = showErrorState && isOpen && status === 'error';
|
|
3359
|
-
const isEmptyStateDisplayed = showEmptyState && isOpen && status === 'idle' && optionsLength === 0;
|
|
3360
|
-
|
|
3361
|
-
/**
|
|
3362
|
-
* The conditions in which we want to show the content of the popover
|
|
3363
|
-
* * The parent asked for the popover to be opened
|
|
3364
|
-
* * There is at least one option to displayed OR a skeleton
|
|
3365
|
-
*/
|
|
3366
|
-
const showPopover = isOpen && (optionsLength > 0 || showFullLoading) || isEmptyStateDisplayed || isErrorStateDisplayed;
|
|
3367
|
-
const handleClose = () => {
|
|
3368
|
-
if (isOpen) {
|
|
3369
|
-
contextHandleClose?.();
|
|
3370
|
-
onClose?.();
|
|
3371
|
-
}
|
|
3372
|
-
};
|
|
3373
|
-
const emptyMessage = translations.noResultsForInputLabel(inputValue);
|
|
3374
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
3375
|
-
children: [/*#__PURE__*/jsxs(Text, {
|
|
3376
|
-
as: "p",
|
|
3377
|
-
className: visuallyHidden(),
|
|
3378
|
-
role: "log",
|
|
3379
|
-
"aria-live": "assertive",
|
|
3380
|
-
children: [isOpen && !showFullLoading && !isEmptyStateDisplayed && !isErrorStateDisplayed && translations.nbOptionsLabel(optionsLength), isErrorStateDisplayed && `${translations.serviceUnavailableLabel} ${translations.tryReloadLabel}`, showFullLoading && translations.loadingLabel, isEmptyStateDisplayed && emptyMessage]
|
|
3381
|
-
}), /*#__PURE__*/jsx(Popover, {
|
|
3382
|
-
role: "none",
|
|
3383
|
-
onClose: handleClose,
|
|
3384
|
-
anchorRef: anchorRef,
|
|
3385
|
-
fitToAnchorWidth: true,
|
|
3386
|
-
fitWithinViewportHeight: true,
|
|
3387
|
-
closeOnEscape: true,
|
|
3388
|
-
closeOnClickAway: true,
|
|
3389
|
-
placement: Placement.BOTTOM,
|
|
3390
|
-
isOpen: isOpen,
|
|
3391
|
-
...otherPopoverProps,
|
|
3392
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
3393
|
-
style: {
|
|
3394
|
-
...style,
|
|
3395
|
-
overflowY: 'auto',
|
|
3396
|
-
display: showPopover ? 'flex' : 'none',
|
|
3397
|
-
flexDirection: 'column'
|
|
3398
|
-
},
|
|
3399
|
-
children: [/*#__PURE__*/jsxs("ul", {
|
|
3400
|
-
ref: listRef,
|
|
3401
|
-
id: listboxId,
|
|
3402
|
-
role: type,
|
|
3403
|
-
"aria-label": label,
|
|
3404
|
-
className: block$X([className, 'lumx-list lumx-list--item-padding-big']),
|
|
3405
|
-
style: {
|
|
3406
|
-
flex: 1,
|
|
3407
|
-
overflowY: 'auto'
|
|
3408
|
-
},
|
|
3409
|
-
...listProps,
|
|
3410
|
-
children: [!showFullLoading && children, [...FULL_LOADING_STATES, 'loadingMore'].includes(status) && /*#__PURE__*/jsx(ComboboxListSkeleton, {
|
|
3411
|
-
isLoadingMore: status === 'loadingMore',
|
|
3412
|
-
children: renderItemSkeleton
|
|
3413
|
-
})]
|
|
3414
|
-
}), footer, (isEmptyStateDisplayed || isErrorStateDisplayed) && /*#__PURE__*/jsx(GenericBlock, {
|
|
3415
|
-
className: element$J('state'),
|
|
3416
|
-
orientation: "vertical",
|
|
3417
|
-
vAlign: "center",
|
|
3418
|
-
children: /*#__PURE__*/jsxs(GenericBlock.Content, {
|
|
3419
|
-
children: [inputValue && isEmptyStateDisplayed && /*#__PURE__*/jsx(Text, {
|
|
3420
|
-
as: "p",
|
|
3421
|
-
typography: "body1",
|
|
3422
|
-
color: "dark",
|
|
3423
|
-
colorVariant: "L2",
|
|
3424
|
-
dangerouslySetInnerHTML: {
|
|
3425
|
-
__html: translations.noResultsForInputLabel(inputValue)
|
|
3426
|
-
}
|
|
3427
|
-
}), !inputValue && isEmptyStateDisplayed && /*#__PURE__*/jsx(Text, {
|
|
3428
|
-
as: "p",
|
|
3429
|
-
typography: "body1",
|
|
3430
|
-
color: "dark",
|
|
3431
|
-
colorVariant: "L2",
|
|
3432
|
-
children: translations.noResultsForInputLabel()
|
|
3433
|
-
}), isErrorStateDisplayed && /*#__PURE__*/jsxs(Fragment, {
|
|
3434
|
-
children: [/*#__PURE__*/jsx(Heading, {
|
|
3435
|
-
as: "h2",
|
|
3436
|
-
typography: "subtitle2",
|
|
3437
|
-
children: translations.serviceUnavailableLabel
|
|
3438
|
-
}), /*#__PURE__*/jsx(Text, {
|
|
3439
|
-
as: "p",
|
|
3440
|
-
typography: "body1",
|
|
3441
|
-
color: "dark",
|
|
3442
|
-
colorVariant: "L2",
|
|
3443
|
-
children: translations.tryReloadLabel
|
|
3444
|
-
})]
|
|
3445
|
-
})]
|
|
3446
|
-
})
|
|
3447
|
-
})]
|
|
3448
|
-
})
|
|
3449
|
-
})]
|
|
3450
|
-
});
|
|
3451
|
-
};
|
|
3452
|
-
|
|
3453
|
-
const CLASSNAME$14 = 'lumx-combobox-section';
|
|
3454
|
-
const {
|
|
3455
|
-
block: block$W,
|
|
3456
|
-
element: element$I
|
|
3457
|
-
} = classNames.bem(CLASSNAME$14);
|
|
3458
|
-
|
|
3459
|
-
/**
|
|
3460
|
-
* Content of the ComboboxSection.
|
|
3461
|
-
*/
|
|
3462
|
-
const ComboboxSectionContent = ({
|
|
3463
|
-
className,
|
|
3464
|
-
title,
|
|
3465
|
-
children,
|
|
3466
|
-
isLoading,
|
|
3467
|
-
renderItemSkeleton
|
|
3468
|
-
}) => {
|
|
3469
|
-
const {
|
|
3470
|
-
options
|
|
3471
|
-
} = useCombobox();
|
|
3472
|
-
const {
|
|
3473
|
-
sectionId
|
|
3474
|
-
} = useComboboxSectionId();
|
|
3475
|
-
const hasRegisteredChildren = Boolean(Object.values(options).find(option => isComboboxValue(option) && option.sectionId === sectionId));
|
|
3476
|
-
const titleId = title && `${sectionId}-title`;
|
|
3477
|
-
if (!children && !isLoading) {
|
|
3478
|
-
return null;
|
|
3479
|
-
}
|
|
3480
|
-
const isHidden = !hasRegisteredChildren && !isLoading;
|
|
3481
|
-
return /*#__PURE__*/jsxs("li", {
|
|
3482
|
-
className: block$W([className]),
|
|
3483
|
-
role: !isHidden ? 'none' : undefined,
|
|
3484
|
-
"aria-hidden": isHidden,
|
|
3485
|
-
style: {
|
|
3486
|
-
display: isHidden ? 'none' : undefined
|
|
3487
|
-
},
|
|
3488
|
-
children: [title && /*#__PURE__*/jsx(Text, {
|
|
3489
|
-
as: "span",
|
|
3490
|
-
className: element$I('header', [ListSubheader.className]),
|
|
3491
|
-
"aria-hidden": "true",
|
|
3492
|
-
id: titleId,
|
|
3493
|
-
children: title
|
|
3494
|
-
}), /*#__PURE__*/jsxs("ul", {
|
|
3495
|
-
className: element$I('content'),
|
|
3496
|
-
role: "group",
|
|
3497
|
-
"aria-labelledby": titleId,
|
|
3498
|
-
children: [children, isLoading && /*#__PURE__*/jsx(ComboboxListSkeleton, {
|
|
3499
|
-
children: renderItemSkeleton
|
|
3500
|
-
})]
|
|
3501
|
-
})]
|
|
3502
|
-
});
|
|
3503
|
-
};
|
|
3504
|
-
|
|
3505
|
-
/**
|
|
3506
|
-
* Section for options of a Combobox.
|
|
3507
|
-
*
|
|
3508
|
-
* @family Combobox
|
|
3509
|
-
* @param ComboboxSectionProps
|
|
3510
|
-
* @returns ComboboxSection
|
|
3511
|
-
*/
|
|
3512
|
-
const ComboboxSection = ({
|
|
3513
|
-
children,
|
|
3514
|
-
...props
|
|
3515
|
-
}) => {
|
|
3516
|
-
const sectionId = useId();
|
|
3517
|
-
const value = React__default.useMemo(() => ({
|
|
3518
|
-
sectionId,
|
|
3519
|
-
isLoading: props.isLoading
|
|
3520
|
-
}), [sectionId, props.isLoading]);
|
|
3521
|
-
return /*#__PURE__*/jsx(SectionContext.Provider, {
|
|
3522
|
-
value: value,
|
|
3523
|
-
children: /*#__PURE__*/jsx(ComboboxSectionContent, {
|
|
3524
|
-
...props,
|
|
3525
|
-
children: children
|
|
3526
|
-
})
|
|
3527
|
-
});
|
|
3528
|
-
};
|
|
3529
|
-
|
|
3530
|
-
/** Context provider for the combobox. */
|
|
3531
|
-
const ComboboxProvider = ({
|
|
3532
|
-
children,
|
|
3533
|
-
value
|
|
3534
|
-
}) => {
|
|
3535
|
-
return /*#__PURE__*/jsx(ComboboxContext.Provider, {
|
|
3536
|
-
value: value,
|
|
3537
|
-
children: /*#__PURE__*/jsx(MovingFocusProvider, {
|
|
3538
|
-
options: {
|
|
3539
|
-
direction: value.type === 'grid' ? 'both' : 'vertical',
|
|
3540
|
-
firstFocusDirection: value.type === 'grid' ? 'vertical' : undefined,
|
|
3541
|
-
loopAround: {
|
|
3542
|
-
row: 'next-loop',
|
|
3543
|
-
col: 'inside'
|
|
3544
|
-
},
|
|
3545
|
-
gridJumpToShortcutDirection: 'vertical',
|
|
3546
|
-
defaultSelectedId: value.selectedIds?.[0],
|
|
3547
|
-
listKey: value.inputValue
|
|
3548
|
-
},
|
|
3549
|
-
children: children
|
|
3550
|
-
})
|
|
3551
|
-
});
|
|
3552
|
-
};
|
|
3553
|
-
|
|
3554
|
-
const Combobox$1 = ({
|
|
3555
|
-
id: htmlId,
|
|
3556
|
-
inputValue,
|
|
3557
|
-
defaultInputValue,
|
|
3558
|
-
autoFilter = true,
|
|
3559
|
-
openOnClick,
|
|
3560
|
-
openOnFocus,
|
|
3561
|
-
status,
|
|
3562
|
-
showEmptyState = !autoFilter,
|
|
3563
|
-
showErrorState = !!status,
|
|
3564
|
-
selectedIds,
|
|
3565
|
-
onInputChange,
|
|
3566
|
-
onSelect,
|
|
3567
|
-
onOpen,
|
|
3568
|
-
children,
|
|
3569
|
-
selectionType,
|
|
3570
|
-
translations
|
|
3571
|
-
}) => {
|
|
3572
|
-
const textFieldRef = useRef(null);
|
|
3573
|
-
const triggerRef = useRef(null);
|
|
3574
|
-
|
|
3575
|
-
// Generate a unique id for the combobox that will be used for every child components.
|
|
3576
|
-
const generatedId = useId('combobox');
|
|
3577
|
-
const comboboxId = htmlId || generatedId;
|
|
3578
|
-
const listboxId = `${comboboxId}-popover`;
|
|
3579
|
-
|
|
3580
|
-
/** Generate the selected option id from the given selected id. */
|
|
3581
|
-
const currentSelectedIds = selectedIds?.map(selectedId => generateOptionId(comboboxId, selectedId.toString()));
|
|
3582
|
-
|
|
3583
|
-
/** Generate the state */
|
|
3584
|
-
const [state, dispatch] = useReducer(reducer$1, initialState, defaultState => ({
|
|
3585
|
-
...defaultState,
|
|
3586
|
-
comboboxId,
|
|
3587
|
-
listboxId,
|
|
3588
|
-
// a default input value can be set if needed
|
|
3589
|
-
inputValue: defaultInputValue || defaultState.inputValue
|
|
3590
|
-
}));
|
|
3591
|
-
|
|
3592
|
-
/**
|
|
3593
|
-
* Return the current input value.
|
|
3594
|
-
*/
|
|
3595
|
-
const currentInputValue = useMemo(() => {
|
|
3596
|
-
// If the component is controlled and a value is already set by the parent, use this value
|
|
3597
|
-
if (inputValue !== null && inputValue !== undefined) {
|
|
3598
|
-
return inputValue;
|
|
3599
|
-
}
|
|
3600
|
-
|
|
3601
|
-
// Then use the local value
|
|
3602
|
-
if (state.inputValue) {
|
|
3603
|
-
return state.inputValue;
|
|
3604
|
-
}
|
|
3605
|
-
|
|
3606
|
-
// In all other cases, return an empty string.
|
|
3607
|
-
return '';
|
|
3608
|
-
}, [inputValue, state.inputValue]);
|
|
3609
|
-
|
|
3610
|
-
/** Return a memoized state */
|
|
3611
|
-
const synchedState = useMemo(() => {
|
|
3612
|
-
return {
|
|
3613
|
-
...state,
|
|
3614
|
-
showAll: !autoFilter || state.showAll,
|
|
3615
|
-
inputValue: currentInputValue,
|
|
3616
|
-
status: status || state.status,
|
|
3617
|
-
listboxId
|
|
3618
|
-
};
|
|
3619
|
-
}, [currentInputValue, listboxId, autoFilter, state, status]);
|
|
3620
|
-
|
|
3621
|
-
/** Props to set in the context */
|
|
3622
|
-
const comboboxProviderValue = useMemo(() => ({
|
|
3623
|
-
...synchedState,
|
|
3624
|
-
openOnFocus,
|
|
3625
|
-
openOnClick,
|
|
3626
|
-
onInputChange,
|
|
3627
|
-
onOpen,
|
|
3628
|
-
onSelect,
|
|
3629
|
-
dispatch,
|
|
3630
|
-
selectionType,
|
|
3631
|
-
selectedIds: currentSelectedIds,
|
|
3632
|
-
showEmptyState,
|
|
3633
|
-
showErrorState,
|
|
3634
|
-
translations
|
|
3635
|
-
}), [synchedState, openOnFocus, openOnClick, onInputChange, onOpen, onSelect, selectionType, currentSelectedIds, showEmptyState, showErrorState, translations]);
|
|
3636
|
-
return /*#__PURE__*/jsx(ComboboxRefsProvider, {
|
|
3637
|
-
triggerRef: triggerRef,
|
|
3638
|
-
anchorRef: textFieldRef,
|
|
3639
|
-
children: /*#__PURE__*/jsx(ComboboxProvider, {
|
|
3640
|
-
value: comboboxProviderValue,
|
|
3641
|
-
children: children
|
|
3642
|
-
})
|
|
3643
|
-
});
|
|
3644
|
-
};
|
|
3645
|
-
|
|
3646
|
-
const SUB_COMPONENTS = {
|
|
3647
|
-
/**
|
|
3648
|
-
* Option to set within a combobox list.
|
|
3649
|
-
*
|
|
3650
|
-
* @family Combobox
|
|
3651
|
-
* @param ComboboxOptionProps
|
|
3652
|
-
* @returns ComboboxOption
|
|
3653
|
-
*/
|
|
3654
|
-
Option: ComboboxOption,
|
|
3655
|
-
/**
|
|
3656
|
-
* Skeleton for a combobox option.
|
|
3657
|
-
* A typography skeleton is rendered by default but can be overridden by passing children.
|
|
3658
|
-
*/
|
|
3659
|
-
OptionSkeleton: ComboboxOptionSkeleton,
|
|
3660
|
-
/**
|
|
3661
|
-
* Section for options of a Combobox.
|
|
3662
|
-
*
|
|
3663
|
-
* @family Combobox
|
|
3664
|
-
* @param ComboboxSectionProps
|
|
3665
|
-
* @returns ComboboxSection
|
|
3666
|
-
*/
|
|
3667
|
-
Section: ComboboxSection,
|
|
3668
|
-
/**
|
|
3669
|
-
* Combobox input trigger.
|
|
3670
|
-
*
|
|
3671
|
-
* @family Combobox
|
|
3672
|
-
*/
|
|
3673
|
-
Input: ComboboxInput,
|
|
3674
|
-
/**
|
|
3675
|
-
* The listbox containing the combobox's options.
|
|
3676
|
-
*
|
|
3677
|
-
* @family Combobox
|
|
3678
|
-
* @param ComboboxListBoxProps
|
|
3679
|
-
* @returns ComboboxListBox
|
|
3680
|
-
*/
|
|
3681
|
-
List: ComboboxListBox,
|
|
3682
|
-
/**
|
|
3683
|
-
* Combobox button trigger.
|
|
3684
|
-
*
|
|
3685
|
-
* @family Combobox
|
|
3686
|
-
*/
|
|
3687
|
-
Button: ComboboxButton
|
|
3688
|
-
};
|
|
3689
|
-
|
|
3690
|
-
/**
|
|
3691
|
-
*
|
|
3692
|
-
* A Combobox is a combination of two components:
|
|
3693
|
-
* * An input to enter the user's value
|
|
3694
|
-
* * A popover with a list of suggestions to fill the value.
|
|
3695
|
-
*
|
|
3696
|
-
* These two components are included via the Combobox.Input and Combobox.ListBox components.
|
|
3697
|
-
*
|
|
3698
|
-
* In its simplest implementation the component will automatically filter the given options
|
|
3699
|
-
* from the value of the input and fill the input with the textValue of the selected option.
|
|
3700
|
-
*
|
|
3701
|
-
* Props are available for more complex implementations.
|
|
3702
|
-
*
|
|
3703
|
-
* @family Combobox
|
|
3704
|
-
* @param ComboboxProps
|
|
3705
|
-
* @returns Combobox
|
|
3706
|
-
*/
|
|
3707
|
-
const Combobox = Object.assign(Combobox$1, SUB_COMPONENTS);
|
|
3708
|
-
|
|
3709
|
-
/**
|
|
3710
|
-
* Comment block variants.
|
|
3711
|
-
*/
|
|
3712
|
-
const CommentBlockVariant = {
|
|
3713
|
-
indented: 'indented',
|
|
3714
|
-
linear: 'linear'
|
|
3715
|
-
};
|
|
3716
|
-
|
|
3717
|
-
/**
|
|
3718
|
-
* Defines the props of the component.
|
|
3719
|
-
*/
|
|
3720
|
-
|
|
3721
|
-
/**
|
|
3722
|
-
* Component display name.
|
|
3723
|
-
*/
|
|
3724
|
-
const COMPONENT_NAME$15 = 'CommentBlock';
|
|
3725
|
-
|
|
3726
|
-
/**
|
|
3727
|
-
* Component default class name and class prefix.
|
|
3728
|
-
*/
|
|
3729
|
-
const CLASSNAME$13 = 'lumx-comment-block';
|
|
3730
|
-
const {
|
|
3731
|
-
block: block$V,
|
|
3732
|
-
element: element$H
|
|
3733
|
-
} = classNames.bem(CLASSNAME$13);
|
|
3734
|
-
|
|
3735
|
-
/**
|
|
3736
|
-
* Component default props.
|
|
3737
|
-
*/
|
|
3738
|
-
const DEFAULT_PROPS$U = {
|
|
3739
|
-
variant: CommentBlockVariant.indented
|
|
3740
|
-
};
|
|
3741
|
-
|
|
3742
|
-
/**
|
|
3743
|
-
* CommentBlock component.
|
|
3744
|
-
*
|
|
3745
|
-
* @param props Component props.
|
|
3746
|
-
* @param ref Component ref.
|
|
3747
|
-
* @return React element.
|
|
3748
|
-
*/
|
|
3749
|
-
const CommentBlock = forwardRef((props, ref) => {
|
|
3750
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
3751
|
-
const {
|
|
3752
|
-
actions,
|
|
3753
|
-
avatarProps,
|
|
3754
|
-
children,
|
|
3755
|
-
className,
|
|
3756
|
-
date,
|
|
3757
|
-
fullDate,
|
|
3758
|
-
hasActions,
|
|
3759
|
-
headerActions,
|
|
3760
|
-
isOpen,
|
|
3761
|
-
isRelevant,
|
|
3762
|
-
name,
|
|
3763
|
-
onClick,
|
|
3764
|
-
onMouseEnter,
|
|
3765
|
-
onMouseLeave,
|
|
3766
|
-
text,
|
|
3767
|
-
theme = defaultTheme,
|
|
3768
|
-
variant = DEFAULT_PROPS$U.variant,
|
|
3769
|
-
...forwardedProps
|
|
3770
|
-
} = props;
|
|
3771
|
-
const hasChildren = Children.count(children) > 0;
|
|
3772
|
-
return /*#__PURE__*/jsxs("div", {
|
|
3773
|
-
ref: ref,
|
|
3774
|
-
className: classNames.join(className, block$V({
|
|
3775
|
-
'has-children': hasChildren && isOpen,
|
|
3776
|
-
'has-indented-children': hasChildren && variant === CommentBlockVariant.indented,
|
|
3777
|
-
'has-linear-children': hasChildren && variant === CommentBlockVariant.linear,
|
|
3778
|
-
'is-relevant': isRelevant,
|
|
3779
|
-
[`theme-${theme}`]: Boolean(theme)
|
|
3780
|
-
})),
|
|
3781
|
-
...forwardedProps,
|
|
3782
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
3783
|
-
className: element$H('wrapper'),
|
|
3784
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
3785
|
-
className: element$H('avatar'),
|
|
3786
|
-
children: /*#__PURE__*/jsx(Avatar, {
|
|
3787
|
-
...avatarProps,
|
|
3788
|
-
size: Size$1.m,
|
|
3789
|
-
onClick: onClick
|
|
3790
|
-
})
|
|
3791
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
3792
|
-
className: element$H('container'),
|
|
3793
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
3794
|
-
className: element$H('content'),
|
|
3795
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
3796
|
-
className: element$H('meta'),
|
|
3797
|
-
children: [name &&
|
|
3798
|
-
/*#__PURE__*/
|
|
3799
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
3800
|
-
jsx("span", {
|
|
3801
|
-
className: element$H('name'),
|
|
3802
|
-
onClick: onClick,
|
|
3803
|
-
onMouseEnter: onMouseEnter,
|
|
3804
|
-
onMouseLeave: onMouseLeave,
|
|
3805
|
-
children: name
|
|
3806
|
-
}), headerActions && /*#__PURE__*/jsx("span", {
|
|
3807
|
-
className: element$H('header-actions'),
|
|
3808
|
-
children: headerActions
|
|
3809
|
-
})]
|
|
3810
|
-
}), /*#__PURE__*/jsx("div", {
|
|
3811
|
-
className: element$H('text'),
|
|
3812
|
-
children: text
|
|
3813
|
-
}), date && (fullDate ? /*#__PURE__*/jsx(Tooltip, {
|
|
3814
|
-
label: fullDate,
|
|
3815
|
-
placement: "top",
|
|
3816
|
-
children: /*#__PURE__*/jsx("span", {
|
|
3817
|
-
className: element$H('date'),
|
|
3818
|
-
children: date
|
|
3819
|
-
})
|
|
3820
|
-
}) : /*#__PURE__*/jsx("span", {
|
|
3821
|
-
className: element$H('date'),
|
|
3822
|
-
children: date
|
|
3823
|
-
}))]
|
|
3824
|
-
}), hasActions && /*#__PURE__*/jsx("div", {
|
|
3825
|
-
className: element$H('actions'),
|
|
3826
|
-
children: actions
|
|
3827
|
-
})]
|
|
3828
|
-
})]
|
|
3829
|
-
}), hasChildren && isOpen && /*#__PURE__*/jsx("div", {
|
|
3830
|
-
className: element$H('children'),
|
|
3831
|
-
children: children
|
|
3832
|
-
})]
|
|
3833
|
-
});
|
|
3834
|
-
});
|
|
3835
|
-
CommentBlock.displayName = COMPONENT_NAME$15;
|
|
3836
|
-
CommentBlock.className = CLASSNAME$13;
|
|
3837
|
-
CommentBlock.defaultProps = DEFAULT_PROPS$U;
|
|
3838
|
-
|
|
3839
|
-
/**
|
|
3840
|
-
* Add a number of months from a date while resetting the day to prevent month length mismatches.
|
|
3841
|
-
*/
|
|
3842
|
-
function addMonthResetDay(date, monthOffset) {
|
|
3843
|
-
const newDate = new Date(date.getTime());
|
|
3844
|
-
newDate.setDate(1);
|
|
3845
|
-
newDate.setMonth(date.getMonth() + monthOffset);
|
|
3846
|
-
return newDate;
|
|
3847
|
-
}
|
|
3848
|
-
|
|
3849
|
-
/**
|
|
3850
|
-
* Check if given date is valid.
|
|
3851
|
-
*/
|
|
3852
|
-
const isDateValid = date => date instanceof Date && !Number.isNaN(date.getTime());
|
|
3853
|
-
|
|
3854
|
-
/**
|
|
3855
|
-
* Component display name.
|
|
3856
|
-
*/
|
|
3857
|
-
const COMPONENT_NAME$14 = 'DatePicker';
|
|
3858
|
-
|
|
3859
|
-
/**
|
|
3860
|
-
* Component default class name and class prefix.
|
|
3861
|
-
*/
|
|
3862
|
-
const CLASSNAME$12 = 'lumx-date-picker';
|
|
3863
|
-
|
|
3864
|
-
/** Get first day of week for locale from the browser API */
|
|
3865
|
-
const getFromBrowser = locale => {
|
|
3866
|
-
try {
|
|
3867
|
-
const localeMetadata = new Intl.Locale(locale.code);
|
|
3868
|
-
const {
|
|
3869
|
-
firstDay
|
|
3870
|
-
} = localeMetadata.getWeekInfo?.() || localeMetadata.weekInfo;
|
|
3871
|
-
// Sunday is represented as `0` in Date.getDay()
|
|
3872
|
-
if (firstDay === 7) return 0;
|
|
3873
|
-
return firstDay;
|
|
3874
|
-
} catch (e) {
|
|
3875
|
-
return undefined;
|
|
3876
|
-
}
|
|
3877
|
-
};
|
|
3878
|
-
|
|
3879
|
-
/** List first day for each locale (could be removed when all browser implement Locale weekInfo) */
|
|
3880
|
-
const FIRST_DAY_FOR_LOCALES = [{
|
|
3881
|
-
// Locales with Sunday as the first day of the week
|
|
3882
|
-
localeRX: /^(af|ar-(dz|eg|sa)|bn|cy|en-(ca|us|za)|fr-ca|gd|he|hi|ja|km|ko|pt-br|te|th|ug|zh-hk)$/i,
|
|
3883
|
-
firstDay: 0
|
|
3884
|
-
}, {
|
|
3885
|
-
// Locales with Monday as the first day of the week
|
|
3886
|
-
localeRX: /^(ar-(ma|tn)|az|be|bg|bs|ca|cs|da|de|el|en-(au|gb|ie|in|nz)|eo|es|et|eu|fi|fr|fy|gl|gu|hr|ht|hu|hy|id|is|it|ka|kk|kn|lb|lt|lv|mk|mn|ms|mt|nb|nl|nn|oc|pl|pt|ro|ru|sk|sl|sq|sr|sv|ta|tr|uk|uz|vi|zh-(cn|tw))$/i,
|
|
3887
|
-
firstDay: 1
|
|
3888
|
-
}, {
|
|
3889
|
-
// Locales with Saturday as the first day of the week
|
|
3890
|
-
localeRX: /^(ar|fa-ir)$/i,
|
|
3891
|
-
firstDay: 6
|
|
3892
|
-
}];
|
|
2360
|
+
/** List first day for each locale (could be removed when all browser implement Locale weekInfo) */
|
|
2361
|
+
const FIRST_DAY_FOR_LOCALES = [{
|
|
2362
|
+
// Locales with Sunday as the first day of the week
|
|
2363
|
+
localeRX: /^(af|ar-(dz|eg|sa)|bn|cy|en-(ca|us|za)|fr-ca|gd|he|hi|ja|km|ko|pt-br|te|th|ug|zh-hk)$/i,
|
|
2364
|
+
firstDay: 0
|
|
2365
|
+
}, {
|
|
2366
|
+
// Locales with Monday as the first day of the week
|
|
2367
|
+
localeRX: /^(ar-(ma|tn)|az|be|bg|bs|ca|cs|da|de|el|en-(au|gb|ie|in|nz)|eo|es|et|eu|fi|fr|fy|gl|gu|hr|ht|hu|hy|id|is|it|ka|kk|kn|lb|lt|lv|mk|mn|ms|mt|nb|nl|nn|oc|pl|pt|ro|ru|sk|sl|sq|sr|sv|ta|tr|uk|uz|vi|zh-(cn|tw))$/i,
|
|
2368
|
+
firstDay: 1
|
|
2369
|
+
}, {
|
|
2370
|
+
// Locales with Saturday as the first day of the week
|
|
2371
|
+
localeRX: /^(ar|fa-ir)$/i,
|
|
2372
|
+
firstDay: 6
|
|
2373
|
+
}];
|
|
3893
2374
|
|
|
3894
2375
|
/** Find first day of week for locale from the constant */
|
|
3895
2376
|
const getFromConstant = (locale, searchBy = 'code') => {
|
|
@@ -4939,7 +3420,7 @@ const {
|
|
|
4939
3420
|
/**
|
|
4940
3421
|
* Component default props.
|
|
4941
3422
|
*/
|
|
4942
|
-
const DEFAULT_PROPS$
|
|
3423
|
+
const DEFAULT_PROPS$X = {
|
|
4943
3424
|
size: Size$1.big,
|
|
4944
3425
|
disableBodyScroll: true
|
|
4945
3426
|
};
|
|
@@ -4970,11 +3451,11 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
4970
3451
|
parentElement,
|
|
4971
3452
|
contentRef,
|
|
4972
3453
|
preventAutoClose,
|
|
4973
|
-
size = DEFAULT_PROPS$
|
|
3454
|
+
size = DEFAULT_PROPS$X.size,
|
|
4974
3455
|
zIndex,
|
|
4975
3456
|
dialogProps,
|
|
4976
3457
|
onVisibilityChange,
|
|
4977
|
-
disableBodyScroll = DEFAULT_PROPS$
|
|
3458
|
+
disableBodyScroll = DEFAULT_PROPS$X.disableBodyScroll,
|
|
4978
3459
|
preventCloseOnClick,
|
|
4979
3460
|
preventCloseOnEscape,
|
|
4980
3461
|
...forwardedProps
|
|
@@ -5114,7 +3595,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
5114
3595
|
});
|
|
5115
3596
|
Dialog.displayName = COMPONENT_NAME$11;
|
|
5116
3597
|
Dialog.className = CLASSNAME$11;
|
|
5117
|
-
Dialog.defaultProps = DEFAULT_PROPS$
|
|
3598
|
+
Dialog.defaultProps = DEFAULT_PROPS$X;
|
|
5118
3599
|
|
|
5119
3600
|
/**
|
|
5120
3601
|
* Component display name.
|
|
@@ -5127,12 +3608,38 @@ const COMPONENT_NAME$10 = 'Divider';
|
|
|
5127
3608
|
const CLASSNAME$10 = 'lumx-divider';
|
|
5128
3609
|
const {
|
|
5129
3610
|
block: block$T
|
|
5130
|
-
} =
|
|
3611
|
+
} = bem(CLASSNAME$10);
|
|
3612
|
+
|
|
3613
|
+
/**
|
|
3614
|
+
* Divider component.
|
|
3615
|
+
*
|
|
3616
|
+
* @param props Component props.
|
|
3617
|
+
* @return JSX element.
|
|
3618
|
+
*/
|
|
3619
|
+
const Divider$1 = props => {
|
|
3620
|
+
const {
|
|
3621
|
+
className,
|
|
3622
|
+
theme,
|
|
3623
|
+
ref,
|
|
3624
|
+
...forwardedProps
|
|
3625
|
+
} = props;
|
|
3626
|
+
return /*#__PURE__*/jsx("hr", {
|
|
3627
|
+
ref: ref,
|
|
3628
|
+
...forwardedProps,
|
|
3629
|
+
className: classnames(className, block$T({
|
|
3630
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
3631
|
+
}))
|
|
3632
|
+
});
|
|
3633
|
+
};
|
|
3634
|
+
|
|
3635
|
+
/**
|
|
3636
|
+
* Defines the props of the component.
|
|
3637
|
+
*/
|
|
5131
3638
|
|
|
5132
3639
|
/**
|
|
5133
3640
|
* Component default props.
|
|
5134
3641
|
*/
|
|
5135
|
-
const DEFAULT_PROPS$
|
|
3642
|
+
const DEFAULT_PROPS$W = {};
|
|
5136
3643
|
|
|
5137
3644
|
/**
|
|
5138
3645
|
* Divider component.
|
|
@@ -5144,21 +3651,18 @@ const DEFAULT_PROPS$S = {};
|
|
|
5144
3651
|
const Divider = forwardRef((props, ref) => {
|
|
5145
3652
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
5146
3653
|
const {
|
|
5147
|
-
className,
|
|
5148
3654
|
theme = defaultTheme,
|
|
5149
|
-
...
|
|
3655
|
+
...otherProps
|
|
5150
3656
|
} = props;
|
|
5151
|
-
return
|
|
5152
|
-
ref
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
[`theme-${theme}`]: Boolean(theme)
|
|
5156
|
-
}))
|
|
3657
|
+
return Divider$1({
|
|
3658
|
+
ref,
|
|
3659
|
+
theme,
|
|
3660
|
+
...otherProps
|
|
5157
3661
|
});
|
|
5158
3662
|
});
|
|
5159
3663
|
Divider.displayName = COMPONENT_NAME$10;
|
|
5160
3664
|
Divider.className = CLASSNAME$10;
|
|
5161
|
-
Divider.defaultProps = DEFAULT_PROPS$
|
|
3665
|
+
Divider.defaultProps = DEFAULT_PROPS$W;
|
|
5162
3666
|
|
|
5163
3667
|
/**
|
|
5164
3668
|
* Component display name.
|
|
@@ -5383,7 +3887,7 @@ const {
|
|
|
5383
3887
|
/**
|
|
5384
3888
|
* Component default props.
|
|
5385
3889
|
*/
|
|
5386
|
-
const DEFAULT_PROPS$
|
|
3890
|
+
const DEFAULT_PROPS$V = {
|
|
5387
3891
|
tabIndex: -1
|
|
5388
3892
|
};
|
|
5389
3893
|
|
|
@@ -5402,7 +3906,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
5402
3906
|
isClickable,
|
|
5403
3907
|
itemPadding,
|
|
5404
3908
|
onListItemSelected,
|
|
5405
|
-
tabIndex = DEFAULT_PROPS$
|
|
3909
|
+
tabIndex = DEFAULT_PROPS$V.tabIndex,
|
|
5406
3910
|
...forwardedProps
|
|
5407
3911
|
} = props;
|
|
5408
3912
|
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
@@ -5418,7 +3922,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
5418
3922
|
});
|
|
5419
3923
|
InternalList.displayName = COMPONENT_NAME$_;
|
|
5420
3924
|
InternalList.className = CLASSNAME$_;
|
|
5421
|
-
InternalList.defaultProps = DEFAULT_PROPS$
|
|
3925
|
+
InternalList.defaultProps = DEFAULT_PROPS$V;
|
|
5422
3926
|
const List = Object.assign(InternalList, {
|
|
5423
3927
|
useKeyboardListNavigation
|
|
5424
3928
|
});
|
|
@@ -7863,7 +6367,7 @@ const {
|
|
|
7863
6367
|
/**
|
|
7864
6368
|
* Component default props.
|
|
7865
6369
|
*/
|
|
7866
|
-
const DEFAULT_PROPS$
|
|
6370
|
+
const DEFAULT_PROPS$U = {
|
|
7867
6371
|
elevation: 3,
|
|
7868
6372
|
placement: Placement.AUTO,
|
|
7869
6373
|
focusAnchorOnClose: true,
|
|
@@ -7880,24 +6384,24 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
7880
6384
|
className,
|
|
7881
6385
|
closeOnClickAway,
|
|
7882
6386
|
closeOnEscape,
|
|
7883
|
-
elevation = DEFAULT_PROPS$
|
|
6387
|
+
elevation = DEFAULT_PROPS$U.elevation,
|
|
7884
6388
|
focusElement,
|
|
7885
6389
|
hasArrow,
|
|
7886
6390
|
isOpen,
|
|
7887
6391
|
onClose,
|
|
7888
6392
|
parentElement,
|
|
7889
|
-
usePortal = DEFAULT_PROPS$
|
|
7890
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
6393
|
+
usePortal = DEFAULT_PROPS$U.usePortal,
|
|
6394
|
+
focusAnchorOnClose = DEFAULT_PROPS$U.focusAnchorOnClose,
|
|
7891
6395
|
withFocusTrap,
|
|
7892
6396
|
boundaryRef,
|
|
7893
6397
|
fitToAnchorWidth,
|
|
7894
6398
|
fitWithinViewportHeight,
|
|
7895
6399
|
focusTrapZoneElement,
|
|
7896
6400
|
offset,
|
|
7897
|
-
placement = DEFAULT_PROPS$
|
|
6401
|
+
placement = DEFAULT_PROPS$U.placement,
|
|
7898
6402
|
style,
|
|
7899
6403
|
theme,
|
|
7900
|
-
zIndex = DEFAULT_PROPS$
|
|
6404
|
+
zIndex = DEFAULT_PROPS$U.zIndex,
|
|
7901
6405
|
...forwardedProps
|
|
7902
6406
|
} = props;
|
|
7903
6407
|
const popoverRef = useRef(null);
|
|
@@ -7983,7 +6487,7 @@ const Popover = skipRender(
|
|
|
7983
6487
|
() => Boolean(DOCUMENT), _InnerPopover);
|
|
7984
6488
|
Popover.displayName = COMPONENT_NAME$Z;
|
|
7985
6489
|
Popover.className = CLASSNAME$Z;
|
|
7986
|
-
Popover.defaultProps = DEFAULT_PROPS$
|
|
6490
|
+
Popover.defaultProps = DEFAULT_PROPS$U;
|
|
7987
6491
|
|
|
7988
6492
|
// The error margin in px we want to have for triggering infinite scroll
|
|
7989
6493
|
const SCROLL_TRIGGER_MARGIN = 5;
|
|
@@ -8043,7 +6547,7 @@ const {
|
|
|
8043
6547
|
/**
|
|
8044
6548
|
* Component default props.
|
|
8045
6549
|
*/
|
|
8046
|
-
const DEFAULT_PROPS$
|
|
6550
|
+
const DEFAULT_PROPS$T = {
|
|
8047
6551
|
closeOnClick: true,
|
|
8048
6552
|
closeOnClickAway: true,
|
|
8049
6553
|
closeOnEscape: true,
|
|
@@ -8066,18 +6570,18 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
8066
6570
|
anchorRef,
|
|
8067
6571
|
children,
|
|
8068
6572
|
className,
|
|
8069
|
-
closeOnClick = DEFAULT_PROPS$
|
|
8070
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
8071
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
8072
|
-
fitToAnchorWidth = DEFAULT_PROPS$
|
|
8073
|
-
fitWithinViewportHeight = DEFAULT_PROPS$
|
|
6573
|
+
closeOnClick = DEFAULT_PROPS$T.closeOnClick,
|
|
6574
|
+
closeOnClickAway = DEFAULT_PROPS$T.closeOnClickAway,
|
|
6575
|
+
closeOnEscape = DEFAULT_PROPS$T.closeOnEscape,
|
|
6576
|
+
fitToAnchorWidth = DEFAULT_PROPS$T.fitToAnchorWidth,
|
|
6577
|
+
fitWithinViewportHeight = DEFAULT_PROPS$T.fitWithinViewportHeight,
|
|
8074
6578
|
isOpen,
|
|
8075
6579
|
offset,
|
|
8076
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
6580
|
+
focusAnchorOnClose = DEFAULT_PROPS$T.focusAnchorOnClose,
|
|
8077
6581
|
onClose,
|
|
8078
6582
|
onInfiniteScroll,
|
|
8079
|
-
placement = DEFAULT_PROPS$
|
|
8080
|
-
shouldFocusOnOpen = DEFAULT_PROPS$
|
|
6583
|
+
placement = DEFAULT_PROPS$T.placement,
|
|
6584
|
+
shouldFocusOnOpen = DEFAULT_PROPS$T.shouldFocusOnOpen,
|
|
8081
6585
|
zIndex,
|
|
8082
6586
|
...forwardedProps
|
|
8083
6587
|
} = props;
|
|
@@ -8123,7 +6627,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
8123
6627
|
});
|
|
8124
6628
|
Dropdown.displayName = COMPONENT_NAME$Y;
|
|
8125
6629
|
Dropdown.className = CLASSNAME$Y;
|
|
8126
|
-
Dropdown.defaultProps = DEFAULT_PROPS$
|
|
6630
|
+
Dropdown.defaultProps = DEFAULT_PROPS$T;
|
|
8127
6631
|
|
|
8128
6632
|
/**
|
|
8129
6633
|
* Component display name.
|
|
@@ -8142,7 +6646,7 @@ const {
|
|
|
8142
6646
|
/**
|
|
8143
6647
|
* Component default props.
|
|
8144
6648
|
*/
|
|
8145
|
-
const DEFAULT_PROPS$
|
|
6649
|
+
const DEFAULT_PROPS$S = {
|
|
8146
6650
|
closeMode: 'unmount'
|
|
8147
6651
|
};
|
|
8148
6652
|
const isDragHandle = isComponent(DragHandle);
|
|
@@ -8160,7 +6664,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
8160
6664
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
8161
6665
|
const {
|
|
8162
6666
|
className,
|
|
8163
|
-
closeMode = DEFAULT_PROPS$
|
|
6667
|
+
closeMode = DEFAULT_PROPS$S.closeMode,
|
|
8164
6668
|
children: anyChildren,
|
|
8165
6669
|
hasBackground,
|
|
8166
6670
|
hasHeaderDivider,
|
|
@@ -8277,11 +6781,11 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
8277
6781
|
});
|
|
8278
6782
|
ExpansionPanel.displayName = COMPONENT_NAME$X;
|
|
8279
6783
|
ExpansionPanel.className = CLASSNAME$X;
|
|
8280
|
-
ExpansionPanel.defaultProps = DEFAULT_PROPS$
|
|
6784
|
+
ExpansionPanel.defaultProps = DEFAULT_PROPS$S;
|
|
8281
6785
|
|
|
8282
6786
|
const COMPONENT_NAME$W = 'Flag';
|
|
8283
6787
|
const CLASSNAME$W = 'lumx-flag';
|
|
8284
|
-
const DEFAULT_PROPS$
|
|
6788
|
+
const DEFAULT_PROPS$R = {};
|
|
8285
6789
|
const {
|
|
8286
6790
|
block: block$N,
|
|
8287
6791
|
element: element$B
|
|
@@ -8345,7 +6849,7 @@ const Flag = forwardRef((props, ref) => {
|
|
|
8345
6849
|
});
|
|
8346
6850
|
Flag.displayName = COMPONENT_NAME$W;
|
|
8347
6851
|
Flag.className = CLASSNAME$W;
|
|
8348
|
-
Flag.defaultProps = DEFAULT_PROPS$
|
|
6852
|
+
Flag.defaultProps = DEFAULT_PROPS$R;
|
|
8349
6853
|
|
|
8350
6854
|
/**
|
|
8351
6855
|
* Defines the props of the component.
|
|
@@ -8438,7 +6942,7 @@ const {
|
|
|
8438
6942
|
/**
|
|
8439
6943
|
* Component default props.
|
|
8440
6944
|
*/
|
|
8441
|
-
const DEFAULT_PROPS$
|
|
6945
|
+
const DEFAULT_PROPS$Q = {
|
|
8442
6946
|
gap: Size$1.big,
|
|
8443
6947
|
orientation: Orientation$1.horizontal
|
|
8444
6948
|
};
|
|
@@ -8468,8 +6972,8 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
8468
6972
|
children,
|
|
8469
6973
|
actions,
|
|
8470
6974
|
actionsProps,
|
|
8471
|
-
gap = DEFAULT_PROPS$
|
|
8472
|
-
orientation = DEFAULT_PROPS$
|
|
6975
|
+
gap = DEFAULT_PROPS$Q.gap,
|
|
6976
|
+
orientation = DEFAULT_PROPS$Q.orientation,
|
|
8473
6977
|
contentProps,
|
|
8474
6978
|
...forwardedProps
|
|
8475
6979
|
} = props;
|
|
@@ -8523,7 +7027,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
8523
7027
|
});
|
|
8524
7028
|
BaseGenericBlock.displayName = COMPONENT_NAME$U;
|
|
8525
7029
|
BaseGenericBlock.className = CLASSNAME$U;
|
|
8526
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS$
|
|
7030
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS$Q;
|
|
8527
7031
|
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
8528
7032
|
Figure,
|
|
8529
7033
|
Content,
|
|
@@ -8571,7 +7075,7 @@ const CLASSNAME$T = 'lumx-heading';
|
|
|
8571
7075
|
/**
|
|
8572
7076
|
* Component default props.
|
|
8573
7077
|
*/
|
|
8574
|
-
const DEFAULT_PROPS$
|
|
7078
|
+
const DEFAULT_PROPS$P = {};
|
|
8575
7079
|
|
|
8576
7080
|
/**
|
|
8577
7081
|
* Get Heading component common props
|
|
@@ -8672,7 +7176,7 @@ const {
|
|
|
8672
7176
|
/**
|
|
8673
7177
|
* Component default props.
|
|
8674
7178
|
*/
|
|
8675
|
-
const DEFAULT_PROPS$
|
|
7179
|
+
const DEFAULT_PROPS$O = {};
|
|
8676
7180
|
|
|
8677
7181
|
/**
|
|
8678
7182
|
* Text component common props
|
|
@@ -8759,7 +7263,7 @@ const Text = forwardRef((props, ref) => {
|
|
|
8759
7263
|
});
|
|
8760
7264
|
Text.displayName = COMPONENT_NAME$S;
|
|
8761
7265
|
Text.className = CLASSNAME$S;
|
|
8762
|
-
Text.defaultProps = DEFAULT_PROPS$
|
|
7266
|
+
Text.defaultProps = DEFAULT_PROPS$O;
|
|
8763
7267
|
|
|
8764
7268
|
const HeadingLevelContext = /*#__PURE__*/createContext(defaultContext);
|
|
8765
7269
|
|
|
@@ -8796,7 +7300,7 @@ const Heading = forwardRef((props, ref) => {
|
|
|
8796
7300
|
});
|
|
8797
7301
|
Heading.displayName = COMPONENT_NAME$T;
|
|
8798
7302
|
Heading.className = CLASSNAME$T;
|
|
8799
|
-
Heading.defaultProps = DEFAULT_PROPS$
|
|
7303
|
+
Heading.defaultProps = DEFAULT_PROPS$P;
|
|
8800
7304
|
|
|
8801
7305
|
/**
|
|
8802
7306
|
* Computes the next heading level based on the optional prop level or the parent context level.
|
|
@@ -8847,7 +7351,7 @@ const {
|
|
|
8847
7351
|
/**
|
|
8848
7352
|
* Component default props.
|
|
8849
7353
|
*/
|
|
8850
|
-
const DEFAULT_PROPS$
|
|
7354
|
+
const DEFAULT_PROPS$N = {
|
|
8851
7355
|
orientation: Orientation$1.horizontal,
|
|
8852
7356
|
wrap: 'nowrap'
|
|
8853
7357
|
};
|
|
@@ -8865,9 +7369,9 @@ const Grid = forwardRef((props, ref) => {
|
|
|
8865
7369
|
className,
|
|
8866
7370
|
gutter,
|
|
8867
7371
|
hAlign,
|
|
8868
|
-
orientation = DEFAULT_PROPS$
|
|
7372
|
+
orientation = DEFAULT_PROPS$N.orientation,
|
|
8869
7373
|
vAlign,
|
|
8870
|
-
wrap = DEFAULT_PROPS$
|
|
7374
|
+
wrap = DEFAULT_PROPS$N.wrap,
|
|
8871
7375
|
...forwardedProps
|
|
8872
7376
|
} = props;
|
|
8873
7377
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -8885,7 +7389,7 @@ const Grid = forwardRef((props, ref) => {
|
|
|
8885
7389
|
});
|
|
8886
7390
|
Grid.displayName = COMPONENT_NAME$R;
|
|
8887
7391
|
Grid.className = CLASSNAME$R;
|
|
8888
|
-
Grid.defaultProps = DEFAULT_PROPS$
|
|
7392
|
+
Grid.defaultProps = DEFAULT_PROPS$N;
|
|
8889
7393
|
|
|
8890
7394
|
/**
|
|
8891
7395
|
* Component display name.
|
|
@@ -8943,7 +7447,7 @@ const CLASSNAME$P = 'lumx-grid-column';
|
|
|
8943
7447
|
/**
|
|
8944
7448
|
* Component default props.
|
|
8945
7449
|
*/
|
|
8946
|
-
const DEFAULT_PROPS$
|
|
7450
|
+
const DEFAULT_PROPS$M = {};
|
|
8947
7451
|
|
|
8948
7452
|
/**
|
|
8949
7453
|
* The GridColumn is a layout component that can display children in a grid
|
|
@@ -8980,7 +7484,7 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
8980
7484
|
});
|
|
8981
7485
|
GridColumn.displayName = COMPONENT_NAME$P;
|
|
8982
7486
|
GridColumn.className = CLASSNAME$P;
|
|
8983
|
-
GridColumn.defaultProps = DEFAULT_PROPS$
|
|
7487
|
+
GridColumn.defaultProps = DEFAULT_PROPS$M;
|
|
8984
7488
|
|
|
8985
7489
|
/**
|
|
8986
7490
|
* Icon component.
|
|
@@ -9098,7 +7602,7 @@ const {
|
|
|
9098
7602
|
/**
|
|
9099
7603
|
* Component default props.
|
|
9100
7604
|
*/
|
|
9101
|
-
const DEFAULT_PROPS$
|
|
7605
|
+
const DEFAULT_PROPS$L = {
|
|
9102
7606
|
captionPosition: ImageBlockCaptionPosition.below,
|
|
9103
7607
|
align: Alignment.left
|
|
9104
7608
|
};
|
|
@@ -9114,9 +7618,9 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
9114
7618
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
9115
7619
|
const {
|
|
9116
7620
|
actions,
|
|
9117
|
-
align = DEFAULT_PROPS$
|
|
7621
|
+
align = DEFAULT_PROPS$L.align,
|
|
9118
7622
|
alt,
|
|
9119
|
-
captionPosition = DEFAULT_PROPS$
|
|
7623
|
+
captionPosition = DEFAULT_PROPS$L.captionPosition,
|
|
9120
7624
|
captionStyle,
|
|
9121
7625
|
className,
|
|
9122
7626
|
description,
|
|
@@ -9170,7 +7674,7 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
9170
7674
|
});
|
|
9171
7675
|
ImageBlock.displayName = COMPONENT_NAME$O;
|
|
9172
7676
|
ImageBlock.className = CLASSNAME$O;
|
|
9173
|
-
ImageBlock.defaultProps = DEFAULT_PROPS$
|
|
7677
|
+
ImageBlock.defaultProps = DEFAULT_PROPS$L;
|
|
9174
7678
|
|
|
9175
7679
|
/**
|
|
9176
7680
|
* Component display name.
|
|
@@ -9930,7 +8434,7 @@ const {
|
|
|
9930
8434
|
/**
|
|
9931
8435
|
* Component default props.
|
|
9932
8436
|
*/
|
|
9933
|
-
const DEFAULT_PROPS$
|
|
8437
|
+
const DEFAULT_PROPS$K = {};
|
|
9934
8438
|
|
|
9935
8439
|
/**
|
|
9936
8440
|
* InlineList component.
|
|
@@ -9983,7 +8487,7 @@ const InlineList = forwardRef((props, ref) => {
|
|
|
9983
8487
|
});
|
|
9984
8488
|
InlineList.displayName = COMPONENT_NAME$M;
|
|
9985
8489
|
InlineList.className = CLASSNAME$M;
|
|
9986
|
-
InlineList.defaultProps = DEFAULT_PROPS$
|
|
8490
|
+
InlineList.defaultProps = DEFAULT_PROPS$K;
|
|
9987
8491
|
|
|
9988
8492
|
/**
|
|
9989
8493
|
* InputHelper component.
|
|
@@ -10155,25 +8659,11 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
10155
8659
|
})
|
|
10156
8660
|
})
|
|
10157
8661
|
})]
|
|
10158
|
-
})
|
|
10159
|
-
});
|
|
10160
|
-
});
|
|
10161
|
-
Lightbox.displayName = COMPONENT_NAME$L;
|
|
10162
|
-
Lightbox.className = CLASSNAME$L;
|
|
10163
|
-
|
|
10164
|
-
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
10165
|
-
const forwardRefPolymorphic = React__default.forwardRef;
|
|
10166
|
-
|
|
10167
|
-
/**
|
|
10168
|
-
* Render clickable element (link, button or custom element)
|
|
10169
|
-
* (also does some basic disabled state handling)
|
|
10170
|
-
*/
|
|
10171
|
-
const RawClickable = forwardRefPolymorphic((props, ref) => {
|
|
10172
|
-
return RawClickable$1({
|
|
10173
|
-
ref,
|
|
10174
|
-
...props
|
|
8662
|
+
})
|
|
10175
8663
|
});
|
|
10176
8664
|
});
|
|
8665
|
+
Lightbox.displayName = COMPONENT_NAME$L;
|
|
8666
|
+
Lightbox.className = CLASSNAME$L;
|
|
10177
8667
|
|
|
10178
8668
|
/**
|
|
10179
8669
|
* Component display name.
|
|
@@ -10187,7 +8677,101 @@ const CLASSNAME$K = 'lumx-link';
|
|
|
10187
8677
|
const {
|
|
10188
8678
|
block: block$E,
|
|
10189
8679
|
element: element$u
|
|
10190
|
-
} =
|
|
8680
|
+
} = bem(CLASSNAME$K);
|
|
8681
|
+
|
|
8682
|
+
/**
|
|
8683
|
+
* Link component (Core UI).
|
|
8684
|
+
*
|
|
8685
|
+
* @param props Component props.
|
|
8686
|
+
* @return JSX element.
|
|
8687
|
+
*/
|
|
8688
|
+
const Link$1 = props => {
|
|
8689
|
+
const {
|
|
8690
|
+
label,
|
|
8691
|
+
className,
|
|
8692
|
+
color: propColor,
|
|
8693
|
+
colorVariant: propColorVariant,
|
|
8694
|
+
leftIcon,
|
|
8695
|
+
rightIcon,
|
|
8696
|
+
typography: typography$1,
|
|
8697
|
+
as,
|
|
8698
|
+
ref,
|
|
8699
|
+
isDisabled,
|
|
8700
|
+
theme,
|
|
8701
|
+
href,
|
|
8702
|
+
target,
|
|
8703
|
+
onClick,
|
|
8704
|
+
...forwardedProps
|
|
8705
|
+
} = props;
|
|
8706
|
+
const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
|
|
8707
|
+
|
|
8708
|
+
// Determine element type
|
|
8709
|
+
const ElementType = as || (href ? 'a' : 'button');
|
|
8710
|
+
|
|
8711
|
+
// Build disabled props
|
|
8712
|
+
const disabledProps = {};
|
|
8713
|
+
if (isDisabled) {
|
|
8714
|
+
if (ElementType === 'button' || !href && !as) {
|
|
8715
|
+
disabledProps.disabled = true;
|
|
8716
|
+
} else {
|
|
8717
|
+
disabledProps['aria-disabled'] = true;
|
|
8718
|
+
disabledProps.tabIndex = -1;
|
|
8719
|
+
}
|
|
8720
|
+
}
|
|
8721
|
+
|
|
8722
|
+
// Build class name
|
|
8723
|
+
const combinedClassName = classnames(className, block$E({
|
|
8724
|
+
[`color-${color}`]: Boolean(color),
|
|
8725
|
+
[`color-variant-${colorVariant}`]: Boolean(colorVariant),
|
|
8726
|
+
'has-typography': !!typography$1
|
|
8727
|
+
}), typography$1 && typography(typography$1));
|
|
8728
|
+
|
|
8729
|
+
// Build content with proper spacing for icons
|
|
8730
|
+
const content = /*#__PURE__*/jsxs(Fragment, {
|
|
8731
|
+
children: [leftIcon && /*#__PURE__*/jsxs(Fragment, {
|
|
8732
|
+
children: [" ", Icon$1({
|
|
8733
|
+
icon: leftIcon,
|
|
8734
|
+
className: element$u('left-icon')
|
|
8735
|
+
}), " "]
|
|
8736
|
+
}), label && /*#__PURE__*/jsx("span", {
|
|
8737
|
+
className: element$u('content'),
|
|
8738
|
+
children: label
|
|
8739
|
+
}), rightIcon && /*#__PURE__*/jsxs(Fragment, {
|
|
8740
|
+
children: [" ", Icon$1({
|
|
8741
|
+
icon: rightIcon,
|
|
8742
|
+
className: element$u('right-icon')
|
|
8743
|
+
}), " "]
|
|
8744
|
+
})]
|
|
8745
|
+
});
|
|
8746
|
+
|
|
8747
|
+
// Build element props
|
|
8748
|
+
const elementProps = {
|
|
8749
|
+
ref,
|
|
8750
|
+
className: combinedClassName,
|
|
8751
|
+
onClick: isDisabled ? undefined : onClick,
|
|
8752
|
+
...forwardedProps,
|
|
8753
|
+
...disabledProps
|
|
8754
|
+
};
|
|
8755
|
+
if (href) {
|
|
8756
|
+
elementProps.href = href;
|
|
8757
|
+
}
|
|
8758
|
+
if (target) {
|
|
8759
|
+
elementProps.target = target;
|
|
8760
|
+
}
|
|
8761
|
+
return /*#__PURE__*/jsx(ElementType, {
|
|
8762
|
+
...elementProps,
|
|
8763
|
+
children: content
|
|
8764
|
+
});
|
|
8765
|
+
};
|
|
8766
|
+
|
|
8767
|
+
/**
|
|
8768
|
+
* Defines the props of the component.
|
|
8769
|
+
*/
|
|
8770
|
+
|
|
8771
|
+
/**
|
|
8772
|
+
* Component default props.
|
|
8773
|
+
*/
|
|
8774
|
+
const DEFAULT_PROPS$J = {};
|
|
10191
8775
|
|
|
10192
8776
|
/**
|
|
10193
8777
|
* Link component.
|
|
@@ -10198,47 +8782,42 @@ const {
|
|
|
10198
8782
|
*/
|
|
10199
8783
|
const Link = forwardRef((props, ref) => {
|
|
10200
8784
|
const {
|
|
8785
|
+
isAnyDisabled,
|
|
10201
8786
|
disabledStateProps,
|
|
10202
8787
|
otherProps
|
|
10203
8788
|
} = useDisableStateProps(props);
|
|
10204
8789
|
const {
|
|
10205
8790
|
children,
|
|
10206
8791
|
className,
|
|
10207
|
-
color
|
|
10208
|
-
colorVariant
|
|
8792
|
+
color,
|
|
8793
|
+
colorVariant,
|
|
10209
8794
|
leftIcon,
|
|
10210
8795
|
rightIcon,
|
|
10211
8796
|
typography,
|
|
10212
8797
|
linkAs,
|
|
10213
8798
|
...forwardedProps
|
|
10214
8799
|
} = otherProps;
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
8800
|
+
|
|
8801
|
+
// Wrap children with spaces if they contain icons
|
|
8802
|
+
const label = wrapChildrenIconWithSpaces(children);
|
|
8803
|
+
return Link$1({
|
|
8804
|
+
ref,
|
|
8805
|
+
label,
|
|
8806
|
+
className,
|
|
8807
|
+
color,
|
|
8808
|
+
colorVariant,
|
|
8809
|
+
leftIcon,
|
|
8810
|
+
rightIcon,
|
|
8811
|
+
typography,
|
|
8812
|
+
as: linkAs,
|
|
10219
8813
|
...forwardedProps,
|
|
10220
8814
|
...disabledStateProps,
|
|
10221
|
-
|
|
10222
|
-
[`color-${color}`]: Boolean(color),
|
|
10223
|
-
[`color-variant-${colorVariant}`]: Boolean(colorVariant),
|
|
10224
|
-
'has-typography': !!typography
|
|
10225
|
-
}), typography && classNames.typography(typography)),
|
|
10226
|
-
children: wrapChildrenIconWithSpaces(/*#__PURE__*/jsxs(Fragment, {
|
|
10227
|
-
children: [leftIcon && /*#__PURE__*/jsx(Icon, {
|
|
10228
|
-
icon: leftIcon,
|
|
10229
|
-
className: element$u('left-icon')
|
|
10230
|
-
}), children && /*#__PURE__*/jsx("span", {
|
|
10231
|
-
className: element$u('content'),
|
|
10232
|
-
children: children
|
|
10233
|
-
}), rightIcon && /*#__PURE__*/jsx(Icon, {
|
|
10234
|
-
icon: rightIcon,
|
|
10235
|
-
className: element$u('right-icon')
|
|
10236
|
-
})]
|
|
10237
|
-
}))
|
|
8815
|
+
isDisabled: isAnyDisabled
|
|
10238
8816
|
});
|
|
10239
8817
|
});
|
|
10240
8818
|
Link.displayName = COMPONENT_NAME$K;
|
|
10241
8819
|
Link.className = CLASSNAME$K;
|
|
8820
|
+
Link.defaultProps = DEFAULT_PROPS$J;
|
|
10242
8821
|
|
|
10243
8822
|
/**
|
|
10244
8823
|
* Component display name.
|
|
@@ -10257,7 +8836,7 @@ const {
|
|
|
10257
8836
|
/**
|
|
10258
8837
|
* Component default props.
|
|
10259
8838
|
*/
|
|
10260
|
-
const DEFAULT_PROPS$
|
|
8839
|
+
const DEFAULT_PROPS$I = {
|
|
10261
8840
|
size: Size$1.regular,
|
|
10262
8841
|
titleHeading: 'h2'
|
|
10263
8842
|
};
|
|
@@ -10277,11 +8856,11 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
10277
8856
|
link,
|
|
10278
8857
|
linkAs,
|
|
10279
8858
|
linkProps,
|
|
10280
|
-
size = DEFAULT_PROPS$
|
|
8859
|
+
size = DEFAULT_PROPS$I.size,
|
|
10281
8860
|
theme = defaultTheme,
|
|
10282
8861
|
thumbnailProps,
|
|
10283
8862
|
title,
|
|
10284
|
-
titleHeading = DEFAULT_PROPS$
|
|
8863
|
+
titleHeading = DEFAULT_PROPS$I.titleHeading,
|
|
10285
8864
|
...forwardedProps
|
|
10286
8865
|
} = props;
|
|
10287
8866
|
// Use title heading as title wrapper (see DEFAULT_PROPS for the default value).
|
|
@@ -10349,7 +8928,7 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
10349
8928
|
});
|
|
10350
8929
|
LinkPreview.displayName = COMPONENT_NAME$J;
|
|
10351
8930
|
LinkPreview.className = CLASSNAME$J;
|
|
10352
|
-
LinkPreview.defaultProps = DEFAULT_PROPS$
|
|
8931
|
+
LinkPreview.defaultProps = DEFAULT_PROPS$I;
|
|
10353
8932
|
|
|
10354
8933
|
/**
|
|
10355
8934
|
* Render link with default <a> HTML component or a custom one provided by `linkAs`.
|
|
@@ -10382,7 +8961,7 @@ const {
|
|
|
10382
8961
|
/**
|
|
10383
8962
|
* Component default props.
|
|
10384
8963
|
*/
|
|
10385
|
-
const DEFAULT_PROPS$
|
|
8964
|
+
const DEFAULT_PROPS$H = {
|
|
10386
8965
|
size: Size$1.regular
|
|
10387
8966
|
};
|
|
10388
8967
|
|
|
@@ -10421,7 +9000,7 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
10421
9000
|
linkProps = {},
|
|
10422
9001
|
linkRef,
|
|
10423
9002
|
onItemSelected,
|
|
10424
|
-
size = DEFAULT_PROPS$
|
|
9003
|
+
size = DEFAULT_PROPS$H.size,
|
|
10425
9004
|
...forwardedProps
|
|
10426
9005
|
} = otherProps;
|
|
10427
9006
|
const role = linkAs || linkProps.href ? 'link' : 'button';
|
|
@@ -10478,7 +9057,7 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
10478
9057
|
});
|
|
10479
9058
|
ListItem.displayName = COMPONENT_NAME$I;
|
|
10480
9059
|
ListItem.className = CLASSNAME$I;
|
|
10481
|
-
ListItem.defaultProps = DEFAULT_PROPS$
|
|
9060
|
+
ListItem.defaultProps = DEFAULT_PROPS$H;
|
|
10482
9061
|
|
|
10483
9062
|
/**
|
|
10484
9063
|
* Component display name.
|
|
@@ -10666,7 +9245,7 @@ const {
|
|
|
10666
9245
|
/**
|
|
10667
9246
|
* Component default props.
|
|
10668
9247
|
*/
|
|
10669
|
-
const DEFAULT_PROPS$
|
|
9248
|
+
const DEFAULT_PROPS$G = {};
|
|
10670
9249
|
|
|
10671
9250
|
/**
|
|
10672
9251
|
* Mosaic component.
|
|
@@ -10733,7 +9312,21 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
10733
9312
|
});
|
|
10734
9313
|
Mosaic.displayName = COMPONENT_NAME$E;
|
|
10735
9314
|
Mosaic.className = CLASSNAME$E;
|
|
10736
|
-
Mosaic.defaultProps = DEFAULT_PROPS$
|
|
9315
|
+
Mosaic.defaultProps = DEFAULT_PROPS$G;
|
|
9316
|
+
|
|
9317
|
+
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
9318
|
+
const forwardRefPolymorphic = React__default.forwardRef;
|
|
9319
|
+
|
|
9320
|
+
/**
|
|
9321
|
+
* Render clickable element (link, button or custom element)
|
|
9322
|
+
* (also does some basic disabled state handling)
|
|
9323
|
+
*/
|
|
9324
|
+
const RawClickable = forwardRefPolymorphic((props, ref) => {
|
|
9325
|
+
return RawClickable$1({
|
|
9326
|
+
ref,
|
|
9327
|
+
...props
|
|
9328
|
+
});
|
|
9329
|
+
});
|
|
10737
9330
|
|
|
10738
9331
|
const NavigationContext = /*#__PURE__*/createContext({
|
|
10739
9332
|
orientation: Orientation$1.vertical
|
|
@@ -10922,7 +9515,7 @@ const {
|
|
|
10922
9515
|
/**
|
|
10923
9516
|
* Component default props
|
|
10924
9517
|
*/
|
|
10925
|
-
const DEFAULT_PROPS$
|
|
9518
|
+
const DEFAULT_PROPS$F = {
|
|
10926
9519
|
orientation: Orientation$1.vertical
|
|
10927
9520
|
};
|
|
10928
9521
|
const Navigation = forwardRef((props, ref) => {
|
|
@@ -10931,7 +9524,7 @@ const Navigation = forwardRef((props, ref) => {
|
|
|
10931
9524
|
children,
|
|
10932
9525
|
className,
|
|
10933
9526
|
theme = defaultTheme,
|
|
10934
|
-
orientation = DEFAULT_PROPS$
|
|
9527
|
+
orientation = DEFAULT_PROPS$F.orientation,
|
|
10935
9528
|
...forwardedProps
|
|
10936
9529
|
} = props;
|
|
10937
9530
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
@@ -10957,7 +9550,7 @@ const Navigation = forwardRef((props, ref) => {
|
|
|
10957
9550
|
});
|
|
10958
9551
|
Navigation.displayName = COMPONENT_NAME$C;
|
|
10959
9552
|
Navigation.className = CLASSNAME$C;
|
|
10960
|
-
Navigation.defaultProps = DEFAULT_PROPS$
|
|
9553
|
+
Navigation.defaultProps = DEFAULT_PROPS$F;
|
|
10961
9554
|
|
|
10962
9555
|
// Sub components
|
|
10963
9556
|
Navigation.Section = NavigationSection;
|
|
@@ -11002,7 +9595,7 @@ const {
|
|
|
11002
9595
|
/**
|
|
11003
9596
|
* Component default props.
|
|
11004
9597
|
*/
|
|
11005
|
-
const DEFAULT_PROPS$
|
|
9598
|
+
const DEFAULT_PROPS$E = {
|
|
11006
9599
|
zIndex: 9999,
|
|
11007
9600
|
usePortal: true
|
|
11008
9601
|
};
|
|
@@ -11026,8 +9619,8 @@ const Notification = forwardRef((props, ref) => {
|
|
|
11026
9619
|
onClick,
|
|
11027
9620
|
theme = defaultTheme,
|
|
11028
9621
|
type,
|
|
11029
|
-
zIndex = DEFAULT_PROPS$
|
|
11030
|
-
usePortal = DEFAULT_PROPS$
|
|
9622
|
+
zIndex = DEFAULT_PROPS$E.zIndex,
|
|
9623
|
+
usePortal = DEFAULT_PROPS$E.usePortal,
|
|
11031
9624
|
style,
|
|
11032
9625
|
...forwardedProps
|
|
11033
9626
|
} = props;
|
|
@@ -11092,7 +9685,7 @@ const Notification = forwardRef((props, ref) => {
|
|
|
11092
9685
|
});
|
|
11093
9686
|
Notification.displayName = COMPONENT_NAME$B;
|
|
11094
9687
|
Notification.className = CLASSNAME$B;
|
|
11095
|
-
Notification.defaultProps = DEFAULT_PROPS$
|
|
9688
|
+
Notification.defaultProps = DEFAULT_PROPS$E;
|
|
11096
9689
|
|
|
11097
9690
|
/**
|
|
11098
9691
|
* Component display name.
|
|
@@ -11107,7 +9700,7 @@ const CLASSNAME$A = 'lumx-popover-dialog';
|
|
|
11107
9700
|
/**
|
|
11108
9701
|
* Component default props.
|
|
11109
9702
|
*/
|
|
11110
|
-
const DEFAULT_PROPS$
|
|
9703
|
+
const DEFAULT_PROPS$D = {};
|
|
11111
9704
|
|
|
11112
9705
|
/**
|
|
11113
9706
|
* PopoverDialog component.
|
|
@@ -11150,7 +9743,7 @@ const PopoverDialog = forwardRef((props, ref) => {
|
|
|
11150
9743
|
});
|
|
11151
9744
|
PopoverDialog.displayName = COMPONENT_NAME$A;
|
|
11152
9745
|
PopoverDialog.className = CLASSNAME$A;
|
|
11153
|
-
PopoverDialog.defaultProps = DEFAULT_PROPS$
|
|
9746
|
+
PopoverDialog.defaultProps = DEFAULT_PROPS$D;
|
|
11154
9747
|
|
|
11155
9748
|
/**
|
|
11156
9749
|
* Component display name.
|
|
@@ -11169,7 +9762,7 @@ const {
|
|
|
11169
9762
|
/**
|
|
11170
9763
|
* Component default props.
|
|
11171
9764
|
*/
|
|
11172
|
-
const DEFAULT_PROPS$
|
|
9765
|
+
const DEFAULT_PROPS$C = {
|
|
11173
9766
|
orientation: Orientation$1.horizontal
|
|
11174
9767
|
};
|
|
11175
9768
|
|
|
@@ -11189,7 +9782,7 @@ const PostBlock = forwardRef((props, ref) => {
|
|
|
11189
9782
|
className,
|
|
11190
9783
|
meta,
|
|
11191
9784
|
onClick,
|
|
11192
|
-
orientation = DEFAULT_PROPS$
|
|
9785
|
+
orientation = DEFAULT_PROPS$C.orientation,
|
|
11193
9786
|
tags,
|
|
11194
9787
|
text,
|
|
11195
9788
|
theme = defaultTheme,
|
|
@@ -11251,7 +9844,7 @@ const PostBlock = forwardRef((props, ref) => {
|
|
|
11251
9844
|
});
|
|
11252
9845
|
PostBlock.displayName = COMPONENT_NAME$z;
|
|
11253
9846
|
PostBlock.className = CLASSNAME$z;
|
|
11254
|
-
PostBlock.defaultProps = DEFAULT_PROPS$
|
|
9847
|
+
PostBlock.defaultProps = DEFAULT_PROPS$C;
|
|
11255
9848
|
|
|
11256
9849
|
/**
|
|
11257
9850
|
* Component display name.
|
|
@@ -11270,7 +9863,7 @@ const {
|
|
|
11270
9863
|
/**
|
|
11271
9864
|
* Component default props.
|
|
11272
9865
|
*/
|
|
11273
|
-
const DEFAULT_PROPS$
|
|
9866
|
+
const DEFAULT_PROPS$B = {};
|
|
11274
9867
|
|
|
11275
9868
|
/**
|
|
11276
9869
|
* ProgressLinear component.
|
|
@@ -11301,7 +9894,7 @@ const ProgressLinear = forwardRef((props, ref) => {
|
|
|
11301
9894
|
});
|
|
11302
9895
|
ProgressLinear.displayName = COMPONENT_NAME$y;
|
|
11303
9896
|
ProgressLinear.className = CLASSNAME$y;
|
|
11304
|
-
ProgressLinear.defaultProps = DEFAULT_PROPS$
|
|
9897
|
+
ProgressLinear.defaultProps = DEFAULT_PROPS$B;
|
|
11305
9898
|
|
|
11306
9899
|
/**
|
|
11307
9900
|
* Component display name.
|
|
@@ -11320,7 +9913,7 @@ const {
|
|
|
11320
9913
|
/**
|
|
11321
9914
|
* Component default props.
|
|
11322
9915
|
*/
|
|
11323
|
-
const DEFAULT_PROPS$
|
|
9916
|
+
const DEFAULT_PROPS$A = {
|
|
11324
9917
|
size: Size$1.m,
|
|
11325
9918
|
display: 'block'
|
|
11326
9919
|
};
|
|
@@ -11337,8 +9930,8 @@ const ProgressCircular = forwardRef((props, ref) => {
|
|
|
11337
9930
|
const {
|
|
11338
9931
|
className,
|
|
11339
9932
|
theme = defaultTheme,
|
|
11340
|
-
size = DEFAULT_PROPS$
|
|
11341
|
-
display = DEFAULT_PROPS$
|
|
9933
|
+
size = DEFAULT_PROPS$A.size,
|
|
9934
|
+
display = DEFAULT_PROPS$A.display,
|
|
11342
9935
|
...forwardedProps
|
|
11343
9936
|
} = props;
|
|
11344
9937
|
const Element = display === 'block' ? 'div' : 'span';
|
|
@@ -11370,7 +9963,7 @@ const ProgressCircular = forwardRef((props, ref) => {
|
|
|
11370
9963
|
});
|
|
11371
9964
|
ProgressCircular.displayName = COMPONENT_NAME$x;
|
|
11372
9965
|
ProgressCircular.className = CLASSNAME$x;
|
|
11373
|
-
ProgressCircular.defaultProps = DEFAULT_PROPS$
|
|
9966
|
+
ProgressCircular.defaultProps = DEFAULT_PROPS$A;
|
|
11374
9967
|
|
|
11375
9968
|
const ProgressVariant = {
|
|
11376
9969
|
linear: 'linear',
|
|
@@ -11397,7 +9990,7 @@ const {
|
|
|
11397
9990
|
/**
|
|
11398
9991
|
* Component default props.
|
|
11399
9992
|
*/
|
|
11400
|
-
const DEFAULT_PROPS$
|
|
9993
|
+
const DEFAULT_PROPS$z = {
|
|
11401
9994
|
variant: ProgressVariant.circular
|
|
11402
9995
|
};
|
|
11403
9996
|
|
|
@@ -11414,7 +10007,7 @@ const Progress = forwardRef((props, ref) => {
|
|
|
11414
10007
|
const {
|
|
11415
10008
|
className,
|
|
11416
10009
|
theme = defaultTheme,
|
|
11417
|
-
variant = DEFAULT_PROPS$
|
|
10010
|
+
variant = DEFAULT_PROPS$z.variant,
|
|
11418
10011
|
...forwardedProps
|
|
11419
10012
|
} = props;
|
|
11420
10013
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -11433,7 +10026,7 @@ const Progress = forwardRef((props, ref) => {
|
|
|
11433
10026
|
});
|
|
11434
10027
|
Progress.displayName = COMPONENT_NAME$w;
|
|
11435
10028
|
Progress.className = CLASSNAME$w;
|
|
11436
|
-
Progress.defaultProps = DEFAULT_PROPS$
|
|
10029
|
+
Progress.defaultProps = DEFAULT_PROPS$z;
|
|
11437
10030
|
|
|
11438
10031
|
const INIT_STATE = {
|
|
11439
10032
|
isLazy: true,
|
|
@@ -11560,7 +10153,7 @@ const useTabProviderContextState = () => {
|
|
|
11560
10153
|
return context?.[0];
|
|
11561
10154
|
};
|
|
11562
10155
|
|
|
11563
|
-
const DEFAULT_PROPS$
|
|
10156
|
+
const DEFAULT_PROPS$y = {
|
|
11564
10157
|
isLazy: INIT_STATE.isLazy,
|
|
11565
10158
|
shouldActivateOnFocus: INIT_STATE.shouldActivateOnFocus
|
|
11566
10159
|
};
|
|
@@ -11589,7 +10182,7 @@ const ProgressTrackerProvider = props => {
|
|
|
11589
10182
|
dispatch({
|
|
11590
10183
|
type: 'update',
|
|
11591
10184
|
payload: {
|
|
11592
|
-
...DEFAULT_PROPS$
|
|
10185
|
+
...DEFAULT_PROPS$y,
|
|
11593
10186
|
...propState,
|
|
11594
10187
|
activeTabIndex: propState.activeStepIndex || INIT_STATE.activeTabIndex
|
|
11595
10188
|
}
|
|
@@ -11612,7 +10205,7 @@ const ProgressTrackerProvider = props => {
|
|
|
11612
10205
|
children: children
|
|
11613
10206
|
});
|
|
11614
10207
|
};
|
|
11615
|
-
ProgressTrackerProvider.defaultProps = DEFAULT_PROPS$
|
|
10208
|
+
ProgressTrackerProvider.defaultProps = DEFAULT_PROPS$y;
|
|
11616
10209
|
|
|
11617
10210
|
const useRovingTabIndex = ({
|
|
11618
10211
|
parentRef,
|
|
@@ -11704,7 +10297,7 @@ const {
|
|
|
11704
10297
|
/**
|
|
11705
10298
|
* Component default props.
|
|
11706
10299
|
*/
|
|
11707
|
-
const DEFAULT_PROPS$
|
|
10300
|
+
const DEFAULT_PROPS$x = {};
|
|
11708
10301
|
|
|
11709
10302
|
/**
|
|
11710
10303
|
* ProgressTracker component.
|
|
@@ -11760,7 +10353,7 @@ const ProgressTracker = forwardRef((props, ref) => {
|
|
|
11760
10353
|
});
|
|
11761
10354
|
ProgressTracker.displayName = COMPONENT_NAME$v;
|
|
11762
10355
|
ProgressTracker.className = CLASSNAME$v;
|
|
11763
|
-
ProgressTracker.defaultProps = DEFAULT_PROPS$
|
|
10356
|
+
ProgressTracker.defaultProps = DEFAULT_PROPS$x;
|
|
11764
10357
|
|
|
11765
10358
|
/**
|
|
11766
10359
|
* Component display name.
|
|
@@ -11779,7 +10372,7 @@ const {
|
|
|
11779
10372
|
/**
|
|
11780
10373
|
* Component default props.
|
|
11781
10374
|
*/
|
|
11782
|
-
const DEFAULT_PROPS$
|
|
10375
|
+
const DEFAULT_PROPS$w = {};
|
|
11783
10376
|
|
|
11784
10377
|
/**
|
|
11785
10378
|
* ProgressTrackerStep component.
|
|
@@ -11874,7 +10467,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
|
|
|
11874
10467
|
});
|
|
11875
10468
|
ProgressTrackerStep.displayName = COMPONENT_NAME$u;
|
|
11876
10469
|
ProgressTrackerStep.className = CLASSNAME$u;
|
|
11877
|
-
ProgressTrackerStep.defaultProps = DEFAULT_PROPS$
|
|
10470
|
+
ProgressTrackerStep.defaultProps = DEFAULT_PROPS$w;
|
|
11878
10471
|
|
|
11879
10472
|
/**
|
|
11880
10473
|
* Component display name.
|
|
@@ -11892,7 +10485,7 @@ const {
|
|
|
11892
10485
|
/**
|
|
11893
10486
|
* Component default props.
|
|
11894
10487
|
*/
|
|
11895
|
-
const DEFAULT_PROPS$
|
|
10488
|
+
const DEFAULT_PROPS$v = {};
|
|
11896
10489
|
|
|
11897
10490
|
/**
|
|
11898
10491
|
* ProgressTrackerStepPanel component.
|
|
@@ -11928,7 +10521,7 @@ const ProgressTrackerStepPanel = forwardRef((props, ref) => {
|
|
|
11928
10521
|
});
|
|
11929
10522
|
ProgressTrackerStepPanel.displayName = COMPONENT_NAME$t;
|
|
11930
10523
|
ProgressTrackerStepPanel.className = CLASSNAME$t;
|
|
11931
|
-
ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$
|
|
10524
|
+
ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$v;
|
|
11932
10525
|
|
|
11933
10526
|
/**
|
|
11934
10527
|
* Component display name.
|
|
@@ -11942,27 +10535,15 @@ const CLASSNAME$s = 'lumx-radio-button';
|
|
|
11942
10535
|
const {
|
|
11943
10536
|
block: block$p,
|
|
11944
10537
|
element: element$h
|
|
11945
|
-
} =
|
|
11946
|
-
|
|
11947
|
-
/**
|
|
11948
|
-
* Component default props.
|
|
11949
|
-
*/
|
|
11950
|
-
const DEFAULT_PROPS$r = {};
|
|
10538
|
+
} = bem(CLASSNAME$s);
|
|
11951
10539
|
|
|
11952
10540
|
/**
|
|
11953
10541
|
* RadioButton component.
|
|
11954
10542
|
*
|
|
11955
10543
|
* @param props Component props.
|
|
11956
|
-
* @
|
|
11957
|
-
* @return React element.
|
|
10544
|
+
* @return JSX element.
|
|
11958
10545
|
*/
|
|
11959
|
-
const RadioButton =
|
|
11960
|
-
const {
|
|
11961
|
-
isAnyDisabled,
|
|
11962
|
-
disabledStateProps,
|
|
11963
|
-
otherProps
|
|
11964
|
-
} = useDisableStateProps(props);
|
|
11965
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
10546
|
+
const RadioButton$1 = props => {
|
|
11966
10547
|
const {
|
|
11967
10548
|
checked,
|
|
11968
10549
|
className,
|
|
@@ -11972,14 +10553,15 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
11972
10553
|
isChecked = checked,
|
|
11973
10554
|
label,
|
|
11974
10555
|
name,
|
|
10556
|
+
ref,
|
|
11975
10557
|
onChange,
|
|
11976
|
-
theme
|
|
10558
|
+
theme,
|
|
11977
10559
|
value,
|
|
11978
|
-
inputProps,
|
|
10560
|
+
inputProps = {},
|
|
10561
|
+
isDisabled,
|
|
10562
|
+
inputId,
|
|
11979
10563
|
...forwardedProps
|
|
11980
|
-
} =
|
|
11981
|
-
const generatedInputId = useId();
|
|
11982
|
-
const inputId = id || generatedInputId;
|
|
10564
|
+
} = props;
|
|
11983
10565
|
const handleChange = event => {
|
|
11984
10566
|
if (onChange) {
|
|
11985
10567
|
onChange(value, name, event);
|
|
@@ -11988,9 +10570,9 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
11988
10570
|
return /*#__PURE__*/jsxs("div", {
|
|
11989
10571
|
ref: ref,
|
|
11990
10572
|
...forwardedProps,
|
|
11991
|
-
className:
|
|
10573
|
+
className: classnames(className, block$p({
|
|
11992
10574
|
'is-checked': isChecked,
|
|
11993
|
-
'is-disabled':
|
|
10575
|
+
'is-disabled': isDisabled,
|
|
11994
10576
|
'is-unchecked': !isChecked,
|
|
11995
10577
|
[`theme-${theme}`]: Boolean(theme)
|
|
11996
10578
|
})),
|
|
@@ -11999,15 +10581,16 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
11999
10581
|
children: [/*#__PURE__*/jsx("input", {
|
|
12000
10582
|
ref: inputRef,
|
|
12001
10583
|
className: element$h('input-native'),
|
|
12002
|
-
...disabledStateProps,
|
|
12003
10584
|
id: inputId,
|
|
12004
10585
|
type: "radio",
|
|
12005
10586
|
name: name,
|
|
12006
10587
|
value: value,
|
|
12007
10588
|
checked: isChecked,
|
|
12008
10589
|
onChange: handleChange,
|
|
12009
|
-
readOnly: inputProps?.readOnly || isAnyDisabled,
|
|
12010
10590
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
10591
|
+
...(inputProps?.readOnly ? {
|
|
10592
|
+
readOnly: inputProps.readOnly
|
|
10593
|
+
} : {}),
|
|
12011
10594
|
...inputProps
|
|
12012
10595
|
}), /*#__PURE__*/jsxs("div", {
|
|
12013
10596
|
className: element$h('input-placeholder'),
|
|
@@ -12019,23 +10602,85 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
12019
10602
|
})]
|
|
12020
10603
|
}), /*#__PURE__*/jsxs("div", {
|
|
12021
10604
|
className: element$h('content'),
|
|
12022
|
-
children: [label &&
|
|
10605
|
+
children: [label && InputLabel$1({
|
|
12023
10606
|
htmlFor: inputId,
|
|
12024
|
-
theme: theme,
|
|
12025
10607
|
className: element$h('label'),
|
|
10608
|
+
theme,
|
|
12026
10609
|
children: label
|
|
12027
|
-
}), helper &&
|
|
10610
|
+
}), helper && InputHelper$1({
|
|
12028
10611
|
id: `${inputId}-helper`,
|
|
12029
|
-
theme: theme,
|
|
12030
10612
|
className: element$h('helper'),
|
|
10613
|
+
theme,
|
|
12031
10614
|
children: helper
|
|
12032
10615
|
})]
|
|
12033
10616
|
})]
|
|
12034
10617
|
});
|
|
10618
|
+
};
|
|
10619
|
+
|
|
10620
|
+
/**
|
|
10621
|
+
* Defines the props of the component.
|
|
10622
|
+
*/
|
|
10623
|
+
|
|
10624
|
+
/**
|
|
10625
|
+
* Component default props.
|
|
10626
|
+
*/
|
|
10627
|
+
const DEFAULT_PROPS$u = {};
|
|
10628
|
+
|
|
10629
|
+
/**
|
|
10630
|
+
* RadioButton component.
|
|
10631
|
+
*
|
|
10632
|
+
* @param props Component props.
|
|
10633
|
+
* @param ref Component ref.
|
|
10634
|
+
* @return React element.
|
|
10635
|
+
*/
|
|
10636
|
+
const RadioButton = forwardRef((props, ref) => {
|
|
10637
|
+
const {
|
|
10638
|
+
isAnyDisabled,
|
|
10639
|
+
disabledStateProps,
|
|
10640
|
+
otherProps
|
|
10641
|
+
} = useDisableStateProps(props);
|
|
10642
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
10643
|
+
const {
|
|
10644
|
+
checked,
|
|
10645
|
+
className,
|
|
10646
|
+
helper,
|
|
10647
|
+
id,
|
|
10648
|
+
inputRef,
|
|
10649
|
+
isChecked = checked,
|
|
10650
|
+
label,
|
|
10651
|
+
name,
|
|
10652
|
+
onChange,
|
|
10653
|
+
theme = defaultTheme,
|
|
10654
|
+
value,
|
|
10655
|
+
inputProps = {},
|
|
10656
|
+
...forwardedProps
|
|
10657
|
+
} = otherProps;
|
|
10658
|
+
const generatedInputId = useId();
|
|
10659
|
+
const inputId = id || generatedInputId;
|
|
10660
|
+
return RadioButton$1({
|
|
10661
|
+
ref,
|
|
10662
|
+
className,
|
|
10663
|
+
helper,
|
|
10664
|
+
inputRef,
|
|
10665
|
+
isChecked,
|
|
10666
|
+
label,
|
|
10667
|
+
name,
|
|
10668
|
+
onChange,
|
|
10669
|
+
theme,
|
|
10670
|
+
value,
|
|
10671
|
+
inputProps: {
|
|
10672
|
+
...inputProps,
|
|
10673
|
+
...disabledStateProps,
|
|
10674
|
+
readOnly: inputProps.readOnly || disabledStateProps['aria-disabled']
|
|
10675
|
+
},
|
|
10676
|
+
...forwardedProps,
|
|
10677
|
+
isDisabled: isAnyDisabled,
|
|
10678
|
+
inputId
|
|
10679
|
+
});
|
|
12035
10680
|
});
|
|
12036
10681
|
RadioButton.displayName = COMPONENT_NAME$s;
|
|
12037
10682
|
RadioButton.className = CLASSNAME$s;
|
|
12038
|
-
RadioButton.defaultProps = DEFAULT_PROPS$
|
|
10683
|
+
RadioButton.defaultProps = DEFAULT_PROPS$u;
|
|
12039
10684
|
|
|
12040
10685
|
/**
|
|
12041
10686
|
* Component display name.
|
|
@@ -12047,25 +10692,58 @@ const COMPONENT_NAME$r = 'RadioGroup';
|
|
|
12047
10692
|
*/
|
|
12048
10693
|
const CLASSNAME$r = 'lumx-radio-group';
|
|
12049
10694
|
|
|
10695
|
+
/**
|
|
10696
|
+
* Component default props.
|
|
10697
|
+
*/
|
|
10698
|
+
const DEFAULT_PROPS$t = {};
|
|
10699
|
+
|
|
12050
10700
|
/**
|
|
12051
10701
|
* RadioGroup component.
|
|
12052
10702
|
*
|
|
12053
10703
|
* @param props Component props.
|
|
12054
|
-
* @
|
|
12055
|
-
* @return React element.
|
|
10704
|
+
* @return JSX element.
|
|
12056
10705
|
*/
|
|
12057
|
-
const RadioGroup =
|
|
10706
|
+
const RadioGroup$1 = props => {
|
|
12058
10707
|
const {
|
|
12059
10708
|
children,
|
|
12060
10709
|
className,
|
|
10710
|
+
ref,
|
|
12061
10711
|
...forwardedProps
|
|
12062
10712
|
} = props;
|
|
12063
10713
|
return /*#__PURE__*/jsx("div", {
|
|
12064
10714
|
ref: ref,
|
|
12065
10715
|
...forwardedProps,
|
|
12066
|
-
className:
|
|
10716
|
+
className: classnames(className, CLASSNAME$r),
|
|
12067
10717
|
children: children
|
|
12068
10718
|
});
|
|
10719
|
+
};
|
|
10720
|
+
RadioGroup$1.displayName = COMPONENT_NAME$r;
|
|
10721
|
+
RadioGroup$1.className = CLASSNAME$r;
|
|
10722
|
+
RadioGroup$1.defaultProps = DEFAULT_PROPS$t;
|
|
10723
|
+
|
|
10724
|
+
/**
|
|
10725
|
+
* Defines the props of the component.
|
|
10726
|
+
*/
|
|
10727
|
+
|
|
10728
|
+
/**
|
|
10729
|
+
* RadioGroup component.
|
|
10730
|
+
*
|
|
10731
|
+
* @param props Component props.
|
|
10732
|
+
* @param ref Component ref.
|
|
10733
|
+
* @return React element.
|
|
10734
|
+
*/
|
|
10735
|
+
const RadioGroup = forwardRef((props, ref) => {
|
|
10736
|
+
const {
|
|
10737
|
+
children,
|
|
10738
|
+
className,
|
|
10739
|
+
...forwardedProps
|
|
10740
|
+
} = props;
|
|
10741
|
+
return RadioGroup$1({
|
|
10742
|
+
ref,
|
|
10743
|
+
className,
|
|
10744
|
+
children,
|
|
10745
|
+
...forwardedProps
|
|
10746
|
+
});
|
|
12069
10747
|
});
|
|
12070
10748
|
RadioGroup.displayName = COMPONENT_NAME$r;
|
|
12071
10749
|
RadioGroup.className = CLASSNAME$r;
|
|
@@ -12225,7 +10903,7 @@ const {
|
|
|
12225
10903
|
} = classNames.bem(CLASSNAME$p);
|
|
12226
10904
|
|
|
12227
10905
|
/** The default value of props. */
|
|
12228
|
-
const DEFAULT_PROPS$
|
|
10906
|
+
const DEFAULT_PROPS$s = {
|
|
12229
10907
|
selectedValueRender: choice => choice,
|
|
12230
10908
|
variant: SelectVariant.input
|
|
12231
10909
|
};
|
|
@@ -12348,7 +11026,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
12348
11026
|
const isEmpty$1 = isEmpty(props.value);
|
|
12349
11027
|
const hasInputClear = props.onClear && props.clearButtonProps && !isEmpty$1;
|
|
12350
11028
|
return WithSelectContext(SelectField, {
|
|
12351
|
-
...DEFAULT_PROPS$
|
|
11029
|
+
...DEFAULT_PROPS$s,
|
|
12352
11030
|
...props,
|
|
12353
11031
|
className: classNames.join(props.className, block$n({
|
|
12354
11032
|
'has-input-clear': hasInputClear,
|
|
@@ -12360,7 +11038,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
12360
11038
|
});
|
|
12361
11039
|
Select.displayName = COMPONENT_NAME$q;
|
|
12362
11040
|
Select.className = CLASSNAME$p;
|
|
12363
|
-
Select.defaultProps = DEFAULT_PROPS$
|
|
11041
|
+
Select.defaultProps = DEFAULT_PROPS$s;
|
|
12364
11042
|
Select.className = CLASSNAME$p;
|
|
12365
11043
|
|
|
12366
11044
|
/** The display name of the component. */
|
|
@@ -12374,7 +11052,7 @@ const {
|
|
|
12374
11052
|
} = classNames.bem(CLASSNAME$o);
|
|
12375
11053
|
|
|
12376
11054
|
/** The default value of props. */
|
|
12377
|
-
const DEFAULT_PROPS$
|
|
11055
|
+
const DEFAULT_PROPS$r = {
|
|
12378
11056
|
selectedChipRender(choice, index, onClear, isDisabled, theme) {
|
|
12379
11057
|
const onClick = event => onClear && onClear(event, choice);
|
|
12380
11058
|
return /*#__PURE__*/jsx(Chip, {
|
|
@@ -12500,7 +11178,7 @@ const SelectMultipleField = props => {
|
|
|
12500
11178
|
*/
|
|
12501
11179
|
const SelectMultiple = forwardRef((props, ref) => {
|
|
12502
11180
|
return WithSelectContext(SelectMultipleField, {
|
|
12503
|
-
...DEFAULT_PROPS$
|
|
11181
|
+
...DEFAULT_PROPS$r,
|
|
12504
11182
|
...props,
|
|
12505
11183
|
className: classNames.join(props.className, block$m({
|
|
12506
11184
|
'has-multiple': !props.isEmpty
|
|
@@ -12511,7 +11189,7 @@ const SelectMultiple = forwardRef((props, ref) => {
|
|
|
12511
11189
|
});
|
|
12512
11190
|
SelectMultiple.displayName = COMPONENT_NAME$p;
|
|
12513
11191
|
SelectMultiple.className = CLASSNAME$o;
|
|
12514
|
-
SelectMultiple.defaultProps = DEFAULT_PROPS$
|
|
11192
|
+
SelectMultiple.defaultProps = DEFAULT_PROPS$r;
|
|
12515
11193
|
|
|
12516
11194
|
/**
|
|
12517
11195
|
* Component display name.
|
|
@@ -12566,7 +11244,7 @@ const {
|
|
|
12566
11244
|
/**
|
|
12567
11245
|
* Component default props.
|
|
12568
11246
|
*/
|
|
12569
|
-
const DEFAULT_PROPS$
|
|
11247
|
+
const DEFAULT_PROPS$q = {
|
|
12570
11248
|
emphasis: Emphasis$1.high,
|
|
12571
11249
|
closeMode: 'unmount'
|
|
12572
11250
|
};
|
|
@@ -12582,7 +11260,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
12582
11260
|
const {
|
|
12583
11261
|
children,
|
|
12584
11262
|
className,
|
|
12585
|
-
emphasis = DEFAULT_PROPS$
|
|
11263
|
+
emphasis = DEFAULT_PROPS$q.emphasis,
|
|
12586
11264
|
icon,
|
|
12587
11265
|
isOpen,
|
|
12588
11266
|
isSelected,
|
|
@@ -12592,7 +11270,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
12592
11270
|
onActionClick,
|
|
12593
11271
|
onClick,
|
|
12594
11272
|
toggleButtonProps,
|
|
12595
|
-
closeMode = DEFAULT_PROPS$
|
|
11273
|
+
closeMode = DEFAULT_PROPS$q.closeMode,
|
|
12596
11274
|
...forwardedProps
|
|
12597
11275
|
} = props;
|
|
12598
11276
|
const content = children && Children.toArray(children).filter(isComponent(SideNavigationItem));
|
|
@@ -12663,9 +11341,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
12663
11341
|
});
|
|
12664
11342
|
SideNavigationItem.displayName = COMPONENT_NAME$n;
|
|
12665
11343
|
SideNavigationItem.className = CLASSNAME$m;
|
|
12666
|
-
SideNavigationItem.defaultProps = DEFAULT_PROPS$
|
|
12667
|
-
|
|
12668
|
-
const DEFAULT_PROPS$n = {};
|
|
11344
|
+
SideNavigationItem.defaultProps = DEFAULT_PROPS$q;
|
|
12669
11345
|
|
|
12670
11346
|
/**
|
|
12671
11347
|
* Component display name.
|
|
@@ -12678,38 +11354,37 @@ const COMPONENT_NAME$m = 'SkeletonCircle';
|
|
|
12678
11354
|
const CLASSNAME$l = 'lumx-skeleton-circle';
|
|
12679
11355
|
const {
|
|
12680
11356
|
block: block$k
|
|
12681
|
-
} =
|
|
11357
|
+
} = bem(CLASSNAME$l);
|
|
12682
11358
|
|
|
12683
11359
|
/**
|
|
12684
11360
|
* SkeletonCircle component.
|
|
12685
11361
|
*
|
|
12686
11362
|
* @param props Component props.
|
|
12687
|
-
* @
|
|
12688
|
-
* @return React element.
|
|
11363
|
+
* @return JSX element.
|
|
12689
11364
|
*/
|
|
12690
|
-
const SkeletonCircle =
|
|
12691
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
11365
|
+
const SkeletonCircle$1 = props => {
|
|
12692
11366
|
const {
|
|
12693
11367
|
className,
|
|
12694
11368
|
size,
|
|
12695
11369
|
color,
|
|
12696
|
-
theme
|
|
11370
|
+
theme,
|
|
11371
|
+
ref,
|
|
12697
11372
|
...forwardedProps
|
|
12698
11373
|
} = props;
|
|
12699
11374
|
return /*#__PURE__*/jsx("div", {
|
|
12700
11375
|
ref: ref,
|
|
12701
11376
|
...forwardedProps,
|
|
12702
|
-
className:
|
|
11377
|
+
className: classnames(className, block$k({
|
|
12703
11378
|
[`size-${size}`]: Boolean(size),
|
|
12704
11379
|
[`color-${color}`]: Boolean(color),
|
|
12705
11380
|
[`theme-${theme}`]: Boolean(theme)
|
|
12706
11381
|
}))
|
|
12707
11382
|
});
|
|
12708
|
-
}
|
|
12709
|
-
SkeletonCircle.displayName = COMPONENT_NAME$m;
|
|
12710
|
-
SkeletonCircle.defaultProps = DEFAULT_PROPS$n;
|
|
12711
|
-
SkeletonCircle.className = CLASSNAME$l;
|
|
11383
|
+
};
|
|
12712
11384
|
|
|
11385
|
+
/**
|
|
11386
|
+
* Skeleton variants.
|
|
11387
|
+
*/
|
|
12713
11388
|
const SkeletonRectangleVariant = {
|
|
12714
11389
|
squared: 'squared',
|
|
12715
11390
|
rounded: 'rounded',
|
|
@@ -12720,10 +11395,6 @@ const SkeletonRectangleVariant = {
|
|
|
12720
11395
|
* Defines the props of the component.
|
|
12721
11396
|
*/
|
|
12722
11397
|
|
|
12723
|
-
const DEFAULT_PROPS$m = {
|
|
12724
|
-
variant: SkeletonRectangleVariant.squared
|
|
12725
|
-
};
|
|
12726
|
-
|
|
12727
11398
|
/**
|
|
12728
11399
|
* Component display name.
|
|
12729
11400
|
*/
|
|
@@ -12736,31 +11407,37 @@ const CLASSNAME$k = 'lumx-skeleton-rectangle';
|
|
|
12736
11407
|
const {
|
|
12737
11408
|
block: block$j,
|
|
12738
11409
|
element: element$c
|
|
12739
|
-
} =
|
|
11410
|
+
} = bem(CLASSNAME$k);
|
|
11411
|
+
|
|
11412
|
+
/**
|
|
11413
|
+
* Component default props.
|
|
11414
|
+
*/
|
|
11415
|
+
const DEFAULT_PROPS$p = {
|
|
11416
|
+
variant: SkeletonRectangleVariant.squared
|
|
11417
|
+
};
|
|
12740
11418
|
|
|
12741
11419
|
/**
|
|
12742
11420
|
* SkeletonRectangle component.
|
|
12743
11421
|
*
|
|
12744
11422
|
* @param props Component props.
|
|
12745
|
-
* @
|
|
12746
|
-
* @return React element.
|
|
11423
|
+
* @return JSX element.
|
|
12747
11424
|
*/
|
|
12748
|
-
const SkeletonRectangle =
|
|
12749
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
11425
|
+
const SkeletonRectangle$1 = props => {
|
|
12750
11426
|
const {
|
|
12751
11427
|
aspectRatio,
|
|
12752
11428
|
className,
|
|
12753
11429
|
height,
|
|
12754
|
-
theme
|
|
12755
|
-
variant = DEFAULT_PROPS$
|
|
11430
|
+
theme,
|
|
11431
|
+
variant = DEFAULT_PROPS$p.variant,
|
|
12756
11432
|
width,
|
|
12757
11433
|
color,
|
|
11434
|
+
ref,
|
|
12758
11435
|
...forwardedProps
|
|
12759
11436
|
} = props;
|
|
12760
11437
|
return /*#__PURE__*/jsx("div", {
|
|
12761
11438
|
ref: ref,
|
|
12762
11439
|
...forwardedProps,
|
|
12763
|
-
className:
|
|
11440
|
+
className: classnames(className, block$j({
|
|
12764
11441
|
[`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
|
|
12765
11442
|
[`height-${height}`]: Boolean(aspectRatio ? undefined : height),
|
|
12766
11443
|
[`theme-${theme}`]: Boolean(theme),
|
|
@@ -12772,12 +11449,7 @@ const SkeletonRectangle = forwardRef((props, ref) => {
|
|
|
12772
11449
|
className: element$c('inner')
|
|
12773
11450
|
})
|
|
12774
11451
|
});
|
|
12775
|
-
}
|
|
12776
|
-
SkeletonRectangle.displayName = COMPONENT_NAME$l;
|
|
12777
|
-
SkeletonRectangle.className = CLASSNAME$k;
|
|
12778
|
-
SkeletonRectangle.defaultProps = DEFAULT_PROPS$m;
|
|
12779
|
-
|
|
12780
|
-
const DEFAULT_PROPS$l = {};
|
|
11452
|
+
};
|
|
12781
11453
|
|
|
12782
11454
|
/**
|
|
12783
11455
|
* Component display name.
|
|
@@ -12791,29 +11463,28 @@ const CLASSNAME$j = 'lumx-skeleton-typography';
|
|
|
12791
11463
|
const {
|
|
12792
11464
|
block: block$i,
|
|
12793
11465
|
element: element$b
|
|
12794
|
-
} =
|
|
11466
|
+
} = bem(CLASSNAME$j);
|
|
12795
11467
|
|
|
12796
11468
|
/**
|
|
12797
11469
|
* SkeletonTypography component.
|
|
12798
11470
|
*
|
|
12799
11471
|
* @param props Component props.
|
|
12800
|
-
* @
|
|
12801
|
-
* @return React element.
|
|
11472
|
+
* @return JSX element.
|
|
12802
11473
|
*/
|
|
12803
|
-
const SkeletonTypography =
|
|
12804
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
11474
|
+
const SkeletonTypography$1 = props => {
|
|
12805
11475
|
const {
|
|
12806
11476
|
className,
|
|
12807
|
-
theme
|
|
11477
|
+
theme,
|
|
12808
11478
|
typography,
|
|
12809
11479
|
width,
|
|
12810
11480
|
color,
|
|
11481
|
+
ref,
|
|
12811
11482
|
...forwardedProps
|
|
12812
11483
|
} = props;
|
|
12813
11484
|
return /*#__PURE__*/jsx("div", {
|
|
12814
11485
|
ref: ref,
|
|
12815
11486
|
...forwardedProps,
|
|
12816
|
-
className:
|
|
11487
|
+
className: classnames(className, block$i({
|
|
12817
11488
|
[`theme-${theme}`]: Boolean(theme),
|
|
12818
11489
|
[`typography-${typography}`]: Boolean(typography),
|
|
12819
11490
|
[`color-${color}`]: Boolean(color)
|
|
@@ -12826,9 +11497,119 @@ const SkeletonTypography = forwardRef((props, ref) => {
|
|
|
12826
11497
|
className: element$b('inner')
|
|
12827
11498
|
})
|
|
12828
11499
|
});
|
|
11500
|
+
};
|
|
11501
|
+
|
|
11502
|
+
/**
|
|
11503
|
+
* Defines the props of the component.
|
|
11504
|
+
*/
|
|
11505
|
+
|
|
11506
|
+
const DEFAULT_PROPS$o = {};
|
|
11507
|
+
|
|
11508
|
+
/**
|
|
11509
|
+
* SkeletonCircle component.
|
|
11510
|
+
*
|
|
11511
|
+
* @param props Component props.
|
|
11512
|
+
* @param ref Component ref.
|
|
11513
|
+
* @return React element.
|
|
11514
|
+
*/
|
|
11515
|
+
const SkeletonCircle = forwardRef((props, ref) => {
|
|
11516
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
11517
|
+
const {
|
|
11518
|
+
className,
|
|
11519
|
+
size,
|
|
11520
|
+
color,
|
|
11521
|
+
theme = defaultTheme,
|
|
11522
|
+
...forwardedProps
|
|
11523
|
+
} = props;
|
|
11524
|
+
return SkeletonCircle$1({
|
|
11525
|
+
ref,
|
|
11526
|
+
className,
|
|
11527
|
+
size,
|
|
11528
|
+
color,
|
|
11529
|
+
theme,
|
|
11530
|
+
...forwardedProps
|
|
11531
|
+
});
|
|
11532
|
+
});
|
|
11533
|
+
SkeletonCircle.displayName = COMPONENT_NAME$m;
|
|
11534
|
+
SkeletonCircle.defaultProps = DEFAULT_PROPS$o;
|
|
11535
|
+
SkeletonCircle.className = CLASSNAME$l;
|
|
11536
|
+
|
|
11537
|
+
/**
|
|
11538
|
+
* Defines the props of the component.
|
|
11539
|
+
*/
|
|
11540
|
+
|
|
11541
|
+
const DEFAULT_PROPS$n = DEFAULT_PROPS$p;
|
|
11542
|
+
|
|
11543
|
+
/**
|
|
11544
|
+
* SkeletonRectangle component.
|
|
11545
|
+
*
|
|
11546
|
+
* @param props Component props.
|
|
11547
|
+
* @param ref Component ref.
|
|
11548
|
+
* @return React element.
|
|
11549
|
+
*/
|
|
11550
|
+
const SkeletonRectangle = forwardRef((props, ref) => {
|
|
11551
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
11552
|
+
const {
|
|
11553
|
+
aspectRatio,
|
|
11554
|
+
className,
|
|
11555
|
+
height,
|
|
11556
|
+
theme = defaultTheme,
|
|
11557
|
+
variant = DEFAULT_PROPS$n.variant,
|
|
11558
|
+
width,
|
|
11559
|
+
color,
|
|
11560
|
+
...forwardedProps
|
|
11561
|
+
} = props;
|
|
11562
|
+
return SkeletonRectangle$1({
|
|
11563
|
+
ref,
|
|
11564
|
+
aspectRatio,
|
|
11565
|
+
className,
|
|
11566
|
+
height,
|
|
11567
|
+
theme,
|
|
11568
|
+
variant,
|
|
11569
|
+
width,
|
|
11570
|
+
color,
|
|
11571
|
+
...forwardedProps
|
|
11572
|
+
});
|
|
11573
|
+
});
|
|
11574
|
+
SkeletonRectangle.displayName = COMPONENT_NAME$l;
|
|
11575
|
+
SkeletonRectangle.className = CLASSNAME$k;
|
|
11576
|
+
SkeletonRectangle.defaultProps = DEFAULT_PROPS$n;
|
|
11577
|
+
|
|
11578
|
+
/**
|
|
11579
|
+
* Defines the props of the component.
|
|
11580
|
+
*/
|
|
11581
|
+
|
|
11582
|
+
const DEFAULT_PROPS$m = {};
|
|
11583
|
+
|
|
11584
|
+
/**
|
|
11585
|
+
* SkeletonTypography component.
|
|
11586
|
+
*
|
|
11587
|
+
* @param props Component props.
|
|
11588
|
+
* @param ref Component ref.
|
|
11589
|
+
* @return React element.
|
|
11590
|
+
*/
|
|
11591
|
+
const SkeletonTypography = forwardRef((props, ref) => {
|
|
11592
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
11593
|
+
const {
|
|
11594
|
+
className,
|
|
11595
|
+
theme = defaultTheme,
|
|
11596
|
+
typography,
|
|
11597
|
+
width,
|
|
11598
|
+
color,
|
|
11599
|
+
...forwardedProps
|
|
11600
|
+
} = props;
|
|
11601
|
+
return SkeletonTypography$1({
|
|
11602
|
+
ref,
|
|
11603
|
+
className,
|
|
11604
|
+
theme,
|
|
11605
|
+
typography,
|
|
11606
|
+
width,
|
|
11607
|
+
color,
|
|
11608
|
+
...forwardedProps
|
|
11609
|
+
});
|
|
12829
11610
|
});
|
|
12830
11611
|
SkeletonTypography.displayName = COMPONENT_NAME$k;
|
|
12831
|
-
SkeletonTypography.defaultProps = DEFAULT_PROPS$
|
|
11612
|
+
SkeletonTypography.defaultProps = DEFAULT_PROPS$m;
|
|
12832
11613
|
SkeletonTypography.className = CLASSNAME$j;
|
|
12833
11614
|
|
|
12834
11615
|
const useEnhancedEffect = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
|
|
@@ -12883,7 +11664,7 @@ const {
|
|
|
12883
11664
|
/**
|
|
12884
11665
|
* Component default props.
|
|
12885
11666
|
*/
|
|
12886
|
-
const DEFAULT_PROPS$
|
|
11667
|
+
const DEFAULT_PROPS$l = {
|
|
12887
11668
|
precision: 0,
|
|
12888
11669
|
steps: 0
|
|
12889
11670
|
};
|
|
@@ -12934,8 +11715,8 @@ const Slider = forwardRef((props, ref) => {
|
|
|
12934
11715
|
name,
|
|
12935
11716
|
onChange,
|
|
12936
11717
|
onMouseDown,
|
|
12937
|
-
precision = DEFAULT_PROPS$
|
|
12938
|
-
steps = DEFAULT_PROPS$
|
|
11718
|
+
precision = DEFAULT_PROPS$l.precision,
|
|
11719
|
+
steps = DEFAULT_PROPS$l.steps,
|
|
12939
11720
|
theme = defaultTheme,
|
|
12940
11721
|
value,
|
|
12941
11722
|
...forwardedProps
|
|
@@ -13138,7 +11919,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
13138
11919
|
});
|
|
13139
11920
|
Slider.displayName = COMPONENT_NAME$j;
|
|
13140
11921
|
Slider.className = CLASSNAME$i;
|
|
13141
|
-
Slider.defaultProps = DEFAULT_PROPS$
|
|
11922
|
+
Slider.defaultProps = DEFAULT_PROPS$l;
|
|
13142
11923
|
|
|
13143
11924
|
/**
|
|
13144
11925
|
* Making setInterval Declarative with React Hooks.
|
|
@@ -13516,7 +12297,7 @@ SlideshowItemGroup.className = CLASSNAME$h;
|
|
|
13516
12297
|
/**
|
|
13517
12298
|
* Component default props.
|
|
13518
12299
|
*/
|
|
13519
|
-
const DEFAULT_PROPS$
|
|
12300
|
+
const DEFAULT_PROPS$k = {
|
|
13520
12301
|
...DEFAULT_OPTIONS,
|
|
13521
12302
|
slideMode: SlideMode.transformTranslate
|
|
13522
12303
|
};
|
|
@@ -13532,19 +12313,19 @@ const Slideshow = forwardRef((props, ref) => {
|
|
|
13532
12313
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
13533
12314
|
const {
|
|
13534
12315
|
activeIndex,
|
|
13535
|
-
autoPlay = DEFAULT_PROPS$
|
|
12316
|
+
autoPlay = DEFAULT_PROPS$k.autoPlay,
|
|
13536
12317
|
children,
|
|
13537
12318
|
className,
|
|
13538
12319
|
fillHeight,
|
|
13539
12320
|
groupBy = DEFAULT_OPTIONS.groupBy,
|
|
13540
|
-
interval = DEFAULT_PROPS$
|
|
12321
|
+
interval = DEFAULT_PROPS$k.interval,
|
|
13541
12322
|
onChange,
|
|
13542
12323
|
slideshowControlsProps,
|
|
13543
12324
|
theme = defaultTheme,
|
|
13544
12325
|
id,
|
|
13545
12326
|
slidesId,
|
|
13546
12327
|
slideGroupLabel,
|
|
13547
|
-
slideMode = DEFAULT_PROPS$
|
|
12328
|
+
slideMode = DEFAULT_PROPS$k.slideMode,
|
|
13548
12329
|
...forwardedProps
|
|
13549
12330
|
} = props;
|
|
13550
12331
|
// Number of slideshow items.
|
|
@@ -13566,7 +12347,7 @@ const Slideshow = forwardRef((props, ref) => {
|
|
|
13566
12347
|
toggleForcePause
|
|
13567
12348
|
} = SlideshowControls.useSlideshowControls({
|
|
13568
12349
|
activeIndex,
|
|
13569
|
-
defaultActiveIndex: DEFAULT_PROPS$
|
|
12350
|
+
defaultActiveIndex: DEFAULT_PROPS$k.activeIndex,
|
|
13570
12351
|
autoPlay: Boolean(autoPlay),
|
|
13571
12352
|
itemsCount,
|
|
13572
12353
|
groupBy,
|
|
@@ -13636,7 +12417,7 @@ const Slideshow = forwardRef((props, ref) => {
|
|
|
13636
12417
|
});
|
|
13637
12418
|
});
|
|
13638
12419
|
Slideshow.displayName = 'Slideshow';
|
|
13639
|
-
Slideshow.defaultProps = DEFAULT_PROPS$
|
|
12420
|
+
Slideshow.defaultProps = DEFAULT_PROPS$k;
|
|
13640
12421
|
|
|
13641
12422
|
/**
|
|
13642
12423
|
* Component display name.
|
|
@@ -13745,7 +12526,7 @@ const {
|
|
|
13745
12526
|
/**
|
|
13746
12527
|
* Component default props.
|
|
13747
12528
|
*/
|
|
13748
|
-
const DEFAULT_PROPS$
|
|
12529
|
+
const DEFAULT_PROPS$j = {
|
|
13749
12530
|
activeIndex: 0
|
|
13750
12531
|
};
|
|
13751
12532
|
|
|
@@ -13759,7 +12540,7 @@ const DEFAULT_PROPS$i = {
|
|
|
13759
12540
|
const InternalSlideshowControls = forwardRef((props, ref) => {
|
|
13760
12541
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
13761
12542
|
const {
|
|
13762
|
-
activeIndex = DEFAULT_PROPS$
|
|
12543
|
+
activeIndex = DEFAULT_PROPS$j.activeIndex,
|
|
13763
12544
|
className,
|
|
13764
12545
|
nextButtonProps,
|
|
13765
12546
|
onNextClick,
|
|
@@ -13874,7 +12655,7 @@ const InternalSlideshowControls = forwardRef((props, ref) => {
|
|
|
13874
12655
|
});
|
|
13875
12656
|
InternalSlideshowControls.displayName = COMPONENT_NAME$g;
|
|
13876
12657
|
InternalSlideshowControls.className = CLASSNAME$f;
|
|
13877
|
-
InternalSlideshowControls.defaultProps = DEFAULT_PROPS$
|
|
12658
|
+
InternalSlideshowControls.defaultProps = DEFAULT_PROPS$j;
|
|
13878
12659
|
const SlideshowControls = Object.assign(InternalSlideshowControls, {
|
|
13879
12660
|
useSlideshowControls,
|
|
13880
12661
|
useSlideshowControlsDefaultOptions: DEFAULT_OPTIONS
|
|
@@ -14006,7 +12787,7 @@ const {
|
|
|
14006
12787
|
/**
|
|
14007
12788
|
* Component default props.
|
|
14008
12789
|
*/
|
|
14009
|
-
const DEFAULT_PROPS$
|
|
12790
|
+
const DEFAULT_PROPS$i = {
|
|
14010
12791
|
slideMode: SlideMode.transformTranslate
|
|
14011
12792
|
};
|
|
14012
12793
|
|
|
@@ -14033,7 +12814,7 @@ const Slides = forwardRef((props, ref) => {
|
|
|
14033
12814
|
afterSlides,
|
|
14034
12815
|
hasControls,
|
|
14035
12816
|
slideGroupLabel,
|
|
14036
|
-
slideMode = DEFAULT_PROPS$
|
|
12817
|
+
slideMode = DEFAULT_PROPS$i.slideMode,
|
|
14037
12818
|
onChange,
|
|
14038
12819
|
...forwardedProps
|
|
14039
12820
|
} = props;
|
|
@@ -14115,46 +12896,41 @@ const CLASSNAME$d = 'lumx-switch';
|
|
|
14115
12896
|
const {
|
|
14116
12897
|
block: block$e,
|
|
14117
12898
|
element: element$7
|
|
14118
|
-
} =
|
|
12899
|
+
} = bem(CLASSNAME$d);
|
|
14119
12900
|
|
|
14120
12901
|
/**
|
|
14121
12902
|
* Component default props.
|
|
14122
12903
|
*/
|
|
14123
|
-
const DEFAULT_PROPS$
|
|
14124
|
-
position:
|
|
12904
|
+
const DEFAULT_PROPS$h = {
|
|
12905
|
+
position: 'left'
|
|
14125
12906
|
};
|
|
14126
12907
|
|
|
14127
12908
|
/**
|
|
14128
12909
|
* Switch component.
|
|
14129
12910
|
*
|
|
14130
12911
|
* @param props Component props.
|
|
14131
|
-
* @
|
|
14132
|
-
* @return React element.
|
|
12912
|
+
* @return JSX element.
|
|
14133
12913
|
*/
|
|
14134
|
-
const Switch =
|
|
14135
|
-
const {
|
|
14136
|
-
isAnyDisabled,
|
|
14137
|
-
disabledStateProps,
|
|
14138
|
-
otherProps
|
|
14139
|
-
} = useDisableStateProps(props);
|
|
14140
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
12914
|
+
const Switch$1 = props => {
|
|
14141
12915
|
const {
|
|
14142
12916
|
checked,
|
|
14143
|
-
children,
|
|
14144
12917
|
className,
|
|
14145
12918
|
helper,
|
|
14146
12919
|
id,
|
|
12920
|
+
inputRef,
|
|
14147
12921
|
isChecked = checked,
|
|
12922
|
+
label,
|
|
14148
12923
|
name,
|
|
12924
|
+
ref,
|
|
14149
12925
|
onChange,
|
|
14150
|
-
|
|
14151
|
-
theme = defaultTheme,
|
|
12926
|
+
theme,
|
|
14152
12927
|
value,
|
|
14153
12928
|
inputProps = {},
|
|
12929
|
+
isDisabled,
|
|
12930
|
+
inputId,
|
|
12931
|
+
position = DEFAULT_PROPS$h.position,
|
|
14154
12932
|
...forwardedProps
|
|
14155
|
-
} =
|
|
14156
|
-
const generatedInputId = useId();
|
|
14157
|
-
const inputId = id || generatedInputId;
|
|
12933
|
+
} = props;
|
|
14158
12934
|
const handleChange = event => {
|
|
14159
12935
|
if (onChange) {
|
|
14160
12936
|
onChange(!isChecked, value, name, event);
|
|
@@ -14163,28 +12939,30 @@ const Switch = forwardRef((props, ref) => {
|
|
|
14163
12939
|
return /*#__PURE__*/jsxs("div", {
|
|
14164
12940
|
ref: ref,
|
|
14165
12941
|
...forwardedProps,
|
|
14166
|
-
className:
|
|
12942
|
+
className: classnames(className, block$e({
|
|
14167
12943
|
'is-checked': isChecked,
|
|
14168
|
-
'is-disabled':
|
|
12944
|
+
'is-disabled': isDisabled,
|
|
12945
|
+
'is-unchecked': !isChecked,
|
|
14169
12946
|
[`position-${position}`]: Boolean(position),
|
|
14170
|
-
[`theme-${theme}`]: Boolean(theme)
|
|
14171
|
-
'is-unchecked': !isChecked
|
|
12947
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
14172
12948
|
})),
|
|
14173
12949
|
children: [/*#__PURE__*/jsxs("div", {
|
|
14174
12950
|
className: element$7('input-wrapper'),
|
|
14175
12951
|
children: [/*#__PURE__*/jsx("input", {
|
|
12952
|
+
ref: inputRef,
|
|
14176
12953
|
type: "checkbox",
|
|
14177
12954
|
role: "switch",
|
|
14178
12955
|
id: inputId,
|
|
14179
12956
|
className: element$7('input-native'),
|
|
14180
12957
|
name: name,
|
|
14181
12958
|
value: value,
|
|
14182
|
-
|
|
14183
|
-
readOnly: inputProps.readOnly || isAnyDisabled,
|
|
14184
|
-
checked: isChecked,
|
|
14185
|
-
"aria-checked": Boolean(isChecked),
|
|
12959
|
+
checked: Boolean(isChecked),
|
|
14186
12960
|
onChange: handleChange,
|
|
14187
12961
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
12962
|
+
"aria-checked": Boolean(isChecked),
|
|
12963
|
+
...(inputProps?.readOnly ? {
|
|
12964
|
+
readOnly: inputProps.readOnly
|
|
12965
|
+
} : {}),
|
|
14188
12966
|
...inputProps
|
|
14189
12967
|
}), /*#__PURE__*/jsxs("div", {
|
|
14190
12968
|
className: element$7('input-placeholder'),
|
|
@@ -14194,21 +12972,88 @@ const Switch = forwardRef((props, ref) => {
|
|
|
14194
12972
|
className: element$7('input-indicator')
|
|
14195
12973
|
})]
|
|
14196
12974
|
})]
|
|
14197
|
-
}),
|
|
12975
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
14198
12976
|
className: element$7('content'),
|
|
14199
|
-
children: [
|
|
12977
|
+
children: [label && InputLabel$1({
|
|
14200
12978
|
htmlFor: inputId,
|
|
14201
|
-
theme: theme,
|
|
14202
12979
|
className: element$7('label'),
|
|
14203
|
-
|
|
14204
|
-
|
|
12980
|
+
theme,
|
|
12981
|
+
children: label
|
|
12982
|
+
}), helper && InputHelper$1({
|
|
14205
12983
|
id: `${inputId}-helper`,
|
|
14206
|
-
theme: theme,
|
|
14207
12984
|
className: element$7('helper'),
|
|
12985
|
+
theme,
|
|
14208
12986
|
children: helper
|
|
14209
12987
|
})]
|
|
14210
12988
|
})]
|
|
14211
12989
|
});
|
|
12990
|
+
};
|
|
12991
|
+
|
|
12992
|
+
/**
|
|
12993
|
+
* Defines the props of the component.
|
|
12994
|
+
*/
|
|
12995
|
+
|
|
12996
|
+
/**
|
|
12997
|
+
* Component default props.
|
|
12998
|
+
*/
|
|
12999
|
+
const DEFAULT_PROPS$g = {
|
|
13000
|
+
position: Alignment.left
|
|
13001
|
+
};
|
|
13002
|
+
|
|
13003
|
+
/**
|
|
13004
|
+
* Switch component.
|
|
13005
|
+
*
|
|
13006
|
+
* @param props Component props.
|
|
13007
|
+
* @param ref Component ref.
|
|
13008
|
+
* @return React element.
|
|
13009
|
+
*/
|
|
13010
|
+
const Switch = forwardRef((props, ref) => {
|
|
13011
|
+
const {
|
|
13012
|
+
isAnyDisabled,
|
|
13013
|
+
disabledStateProps,
|
|
13014
|
+
otherProps
|
|
13015
|
+
} = useDisableStateProps(props);
|
|
13016
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
13017
|
+
const {
|
|
13018
|
+
checked,
|
|
13019
|
+
children,
|
|
13020
|
+
className,
|
|
13021
|
+
helper,
|
|
13022
|
+
id,
|
|
13023
|
+
inputRef,
|
|
13024
|
+
isChecked = checked,
|
|
13025
|
+
name,
|
|
13026
|
+
onChange,
|
|
13027
|
+
position = DEFAULT_PROPS$g.position,
|
|
13028
|
+
theme = defaultTheme,
|
|
13029
|
+
value,
|
|
13030
|
+
inputProps = {},
|
|
13031
|
+
...forwardedProps
|
|
13032
|
+
} = otherProps;
|
|
13033
|
+
const localInputRef = React__default.useRef(null);
|
|
13034
|
+
const generatedInputId = useId();
|
|
13035
|
+
const inputId = id || generatedInputId;
|
|
13036
|
+
return Switch$1({
|
|
13037
|
+
ref,
|
|
13038
|
+
className,
|
|
13039
|
+
helper,
|
|
13040
|
+
inputRef: useMergeRefs(inputRef, localInputRef),
|
|
13041
|
+
isChecked,
|
|
13042
|
+
label: children,
|
|
13043
|
+
name,
|
|
13044
|
+
onChange,
|
|
13045
|
+
position,
|
|
13046
|
+
theme,
|
|
13047
|
+
value,
|
|
13048
|
+
inputProps: {
|
|
13049
|
+
...inputProps,
|
|
13050
|
+
...disabledStateProps,
|
|
13051
|
+
readOnly: inputProps.readOnly || isAnyDisabled
|
|
13052
|
+
},
|
|
13053
|
+
...forwardedProps,
|
|
13054
|
+
isDisabled: isAnyDisabled,
|
|
13055
|
+
inputId
|
|
13056
|
+
});
|
|
14212
13057
|
});
|
|
14213
13058
|
Switch.displayName = COMPONENT_NAME$e;
|
|
14214
13059
|
Switch.className = CLASSNAME$d;
|
|
@@ -16163,5 +15008,5 @@ UserBlock.displayName = COMPONENT_NAME;
|
|
|
16163
15008
|
UserBlock.className = CLASSNAME;
|
|
16164
15009
|
UserBlock.defaultProps = DEFAULT_PROPS;
|
|
16165
15010
|
|
|
16166
|
-
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$
|
|
15011
|
+
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$1d as CLASSNAME, COMPONENT_NAME$1e as COMPONENT_NAME, Checkbox, Chip, ChipGroup, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$15 as DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectMultiple, SelectMultipleField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
|
|
16167
15012
|
//# sourceMappingURL=index.js.map
|