@lumx/react 4.3.2-alpha.19 → 4.3.2-alpha.20
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 +23 -445
- package/index.js +256 -926
- package/index.js.map +1 -1
- package/package.json +13 -3
- package/utils/index.d.ts +6 -1
- package/utils/index.js +1219 -5
- package/utils/index.js.map +1 -1
- package/_internal/CzTdCnO5.js +0 -1375
- package/_internal/CzTdCnO5.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio as AspectRatio$1, ColorVariant,
|
|
1
|
+
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio as AspectRatio$1, 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, { useState, useEffect, useMemo, useRef, useCallback,
|
|
6
|
-
import { mdiAlert } from '@lumx/icons/esm/alert';
|
|
7
|
-
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle';
|
|
8
|
-
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle';
|
|
9
|
-
import { mdiInformation } from '@lumx/icons/esm/information';
|
|
5
|
+
import React__default, { useState, useEffect, useMemo, useRef, useCallback, Children, useLayoutEffect, cloneElement, createContext, isValidElement, useContext, useReducer } from 'react';
|
|
6
|
+
import { mdiAlert } from '@lumx/icons/esm/alert.js';
|
|
7
|
+
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle.js';
|
|
8
|
+
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle.js';
|
|
9
|
+
import { mdiInformation } from '@lumx/icons/esm/information.js';
|
|
10
10
|
import { classNames, onEnterPressed, onEscapePressed, onButtonPressed, detectHorizontalSwipe } from '@lumx/core/js/utils';
|
|
11
11
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
12
|
-
import last from 'lodash/last';
|
|
13
|
-
import pull from 'lodash/pull';
|
|
14
|
-
import get from 'lodash/get';
|
|
15
|
-
import concat from 'lodash/concat';
|
|
16
|
-
import dropRight from 'lodash/dropRight';
|
|
17
|
-
import partition from 'lodash/partition';
|
|
18
|
-
import reduce from 'lodash/reduce';
|
|
19
|
-
import { u as useDisabledStateContext,
|
|
20
|
-
import isEmpty from 'lodash/isEmpty';
|
|
12
|
+
import last from 'lodash/last.js';
|
|
13
|
+
import pull from 'lodash/pull.js';
|
|
14
|
+
import get from 'lodash/get.js';
|
|
15
|
+
import concat from 'lodash/concat.js';
|
|
16
|
+
import dropRight from 'lodash/dropRight.js';
|
|
17
|
+
import partition from 'lodash/partition.js';
|
|
18
|
+
import reduce from 'lodash/reduce.js';
|
|
19
|
+
import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/DpdvhbTO.js';
|
|
20
|
+
import isEmpty from 'lodash/isEmpty.js';
|
|
21
21
|
import { getDisabledState } from '@lumx/core/js/utils/disabledState';
|
|
22
|
-
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle';
|
|
23
|
-
import memoize from 'lodash/memoize';
|
|
24
|
-
import { mdiClose } from '@lumx/icons/esm/close';
|
|
25
|
-
import isFunction from 'lodash/isFunction';
|
|
26
|
-
import { mdiImageBroken } from '@lumx/icons/esm/image-broken';
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import { mdiPauseCircleOutline } from '@lumx/icons/esm/pause-circle-outline';
|
|
46
|
-
import chunk from 'lodash/chunk';
|
|
22
|
+
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle.js';
|
|
23
|
+
import memoize from 'lodash/memoize.js';
|
|
24
|
+
import { mdiClose } from '@lumx/icons/esm/close.js';
|
|
25
|
+
import isFunction from 'lodash/isFunction.js';
|
|
26
|
+
import { mdiImageBroken } from '@lumx/icons/esm/image-broken.js';
|
|
27
|
+
import { mdiCheck } from '@lumx/icons/esm/check.js';
|
|
28
|
+
import { mdiMinus } from '@lumx/icons/esm/minus.js';
|
|
29
|
+
import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left.js';
|
|
30
|
+
import { mdiChevronRight } from '@lumx/icons/esm/chevron-right.js';
|
|
31
|
+
import castArray from 'lodash/castArray.js';
|
|
32
|
+
import { mdiDragVertical } from '@lumx/icons/esm/drag-vertical.js';
|
|
33
|
+
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down.js';
|
|
34
|
+
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up.js';
|
|
35
|
+
import noop from 'lodash/noop.js';
|
|
36
|
+
import pick from 'lodash/pick.js';
|
|
37
|
+
import isInteger from 'lodash/isInteger.js';
|
|
38
|
+
import { mdiMagnifyMinusOutline } from '@lumx/icons/esm/magnify-minus-outline.js';
|
|
39
|
+
import { mdiMagnifyPlusOutline } from '@lumx/icons/esm/magnify-plus-outline.js';
|
|
40
|
+
import throttle from 'lodash/throttle.js';
|
|
41
|
+
import range from 'lodash/range.js';
|
|
42
|
+
import { mdiPlayCircleOutline } from '@lumx/icons/esm/play-circle-outline.js';
|
|
43
|
+
import { mdiPauseCircleOutline } from '@lumx/icons/esm/pause-circle-outline.js';
|
|
44
|
+
import chunk from 'lodash/chunk.js';
|
|
47
45
|
import ReactDOM from 'react-dom';
|
|
48
|
-
import take from 'lodash/take';
|
|
49
|
-
import { mdiRadioboxBlank } from '@lumx/icons/esm/radiobox-blank';
|
|
50
|
-
import { mdiRadioboxMarked } from '@lumx/icons/esm/radiobox-marked';
|
|
51
|
-
import { mdiMenuDown } from '@lumx/icons/esm/menu-down';
|
|
52
|
-
import { getWithSelector } from '@lumx/core/js/utils/selectors
|
|
53
|
-
import { mdiArrowDown } from '@lumx/icons/esm/arrow-down';
|
|
54
|
-
import { mdiArrowUp } from '@lumx/icons/esm/arrow-up';
|
|
55
|
-
import set from 'lodash/set';
|
|
46
|
+
import take from 'lodash/take.js';
|
|
47
|
+
import { mdiRadioboxBlank } from '@lumx/icons/esm/radiobox-blank.js';
|
|
48
|
+
import { mdiRadioboxMarked } from '@lumx/icons/esm/radiobox-marked.js';
|
|
49
|
+
import { mdiMenuDown } from '@lumx/icons/esm/menu-down.js';
|
|
50
|
+
import { getWithSelector } from '@lumx/core/js/utils/selectors';
|
|
51
|
+
import { mdiArrowDown } from '@lumx/icons/esm/arrow-down.js';
|
|
52
|
+
import { mdiArrowUp } from '@lumx/icons/esm/arrow-up.js';
|
|
53
|
+
import set from 'lodash/set.js';
|
|
56
54
|
|
|
57
55
|
let i = 0;
|
|
58
56
|
|
|
@@ -103,15 +101,15 @@ const COMPONENT_NAME$1l = 'AlertDialog';
|
|
|
103
101
|
/**
|
|
104
102
|
* Component default class name and class prefix.
|
|
105
103
|
*/
|
|
106
|
-
const CLASSNAME$
|
|
104
|
+
const CLASSNAME$1j = 'lumx-alert-dialog';
|
|
107
105
|
const {
|
|
108
|
-
block: block$
|
|
109
|
-
} = classNames.bem(CLASSNAME$
|
|
106
|
+
block: block$14
|
|
107
|
+
} = classNames.bem(CLASSNAME$1j);
|
|
110
108
|
|
|
111
109
|
/**
|
|
112
110
|
* Component default props.
|
|
113
111
|
*/
|
|
114
|
-
const DEFAULT_PROPS$
|
|
112
|
+
const DEFAULT_PROPS$1a = {
|
|
115
113
|
size: Size$1.tiny,
|
|
116
114
|
kind: Kind$1.info
|
|
117
115
|
};
|
|
@@ -132,8 +130,8 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
132
130
|
className,
|
|
133
131
|
cancelProps,
|
|
134
132
|
confirmProps,
|
|
135
|
-
kind = DEFAULT_PROPS$
|
|
136
|
-
size = DEFAULT_PROPS$
|
|
133
|
+
kind = DEFAULT_PROPS$1a.kind,
|
|
134
|
+
size = DEFAULT_PROPS$1a.size,
|
|
137
135
|
dialogProps,
|
|
138
136
|
children,
|
|
139
137
|
...forwardedProps
|
|
@@ -174,7 +172,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
174
172
|
'aria-describedby': descriptionId,
|
|
175
173
|
...dialogProps
|
|
176
174
|
},
|
|
177
|
-
className: classNames.join(className, block$
|
|
175
|
+
className: classNames.join(className, block$14({
|
|
178
176
|
[`kind-${kind}`]: Boolean(kind)
|
|
179
177
|
})),
|
|
180
178
|
...forwardedProps,
|
|
@@ -220,8 +218,8 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
220
218
|
});
|
|
221
219
|
});
|
|
222
220
|
AlertDialog.displayName = COMPONENT_NAME$1l;
|
|
223
|
-
AlertDialog.className = CLASSNAME$
|
|
224
|
-
AlertDialog.defaultProps = DEFAULT_PROPS$
|
|
221
|
+
AlertDialog.className = CLASSNAME$1j;
|
|
222
|
+
AlertDialog.defaultProps = DEFAULT_PROPS$1a;
|
|
225
223
|
|
|
226
224
|
/**
|
|
227
225
|
* Hook focusing an element when defined and `focus` boolean `true`.
|
|
@@ -318,12 +316,12 @@ const COMPONENT_NAME$1k = 'Autocomplete';
|
|
|
318
316
|
/**
|
|
319
317
|
* Component default class name and class prefix.
|
|
320
318
|
*/
|
|
321
|
-
const CLASSNAME$
|
|
319
|
+
const CLASSNAME$1i = 'lumx-autocomplete';
|
|
322
320
|
|
|
323
321
|
/**
|
|
324
322
|
* Component default props.
|
|
325
323
|
*/
|
|
326
|
-
const DEFAULT_PROPS$
|
|
324
|
+
const DEFAULT_PROPS$19 = {
|
|
327
325
|
anchorToInput: false,
|
|
328
326
|
closeOnClick: false,
|
|
329
327
|
closeOnClickAway: true,
|
|
@@ -345,13 +343,13 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
345
343
|
otherProps
|
|
346
344
|
} = useDisableStateProps(props);
|
|
347
345
|
const {
|
|
348
|
-
anchorToInput = DEFAULT_PROPS$
|
|
346
|
+
anchorToInput = DEFAULT_PROPS$19.anchorToInput,
|
|
349
347
|
children,
|
|
350
348
|
chips,
|
|
351
349
|
className,
|
|
352
|
-
closeOnClick = DEFAULT_PROPS$
|
|
353
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
354
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
350
|
+
closeOnClick = DEFAULT_PROPS$19.closeOnClick,
|
|
351
|
+
closeOnClickAway = DEFAULT_PROPS$19.closeOnClickAway,
|
|
352
|
+
closeOnEscape = DEFAULT_PROPS$19.closeOnEscape,
|
|
355
353
|
error,
|
|
356
354
|
fitToAnchorWidth,
|
|
357
355
|
hasError,
|
|
@@ -372,7 +370,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
372
370
|
onInfiniteScroll,
|
|
373
371
|
placeholder,
|
|
374
372
|
placement,
|
|
375
|
-
shouldFocusOnClose = DEFAULT_PROPS$
|
|
373
|
+
shouldFocusOnClose = DEFAULT_PROPS$19.shouldFocusOnClose,
|
|
376
374
|
theme = defaultTheme,
|
|
377
375
|
value,
|
|
378
376
|
textFieldProps = {},
|
|
@@ -385,7 +383,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
385
383
|
return /*#__PURE__*/jsxs("div", {
|
|
386
384
|
ref: ref,
|
|
387
385
|
...forwardedProps,
|
|
388
|
-
className: classNames.join(className, CLASSNAME$
|
|
386
|
+
className: classNames.join(className, CLASSNAME$1i),
|
|
389
387
|
children: [/*#__PURE__*/jsx(TextField, {
|
|
390
388
|
...textFieldProps,
|
|
391
389
|
chips: chips,
|
|
@@ -426,8 +424,8 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
426
424
|
});
|
|
427
425
|
});
|
|
428
426
|
Autocomplete.displayName = COMPONENT_NAME$1k;
|
|
429
|
-
Autocomplete.className = CLASSNAME$
|
|
430
|
-
Autocomplete.defaultProps = DEFAULT_PROPS$
|
|
427
|
+
Autocomplete.className = CLASSNAME$1i;
|
|
428
|
+
Autocomplete.defaultProps = DEFAULT_PROPS$19;
|
|
431
429
|
|
|
432
430
|
/**
|
|
433
431
|
* Component display name.
|
|
@@ -437,12 +435,12 @@ const COMPONENT_NAME$1j = 'AutocompleteMultiple';
|
|
|
437
435
|
/**
|
|
438
436
|
* Component default class name and class prefix.
|
|
439
437
|
*/
|
|
440
|
-
const CLASSNAME$
|
|
438
|
+
const CLASSNAME$1h = 'lumx-autocomplete-multiple';
|
|
441
439
|
|
|
442
440
|
/**
|
|
443
441
|
* Component default props.
|
|
444
442
|
*/
|
|
445
|
-
const DEFAULT_PROPS$
|
|
443
|
+
const DEFAULT_PROPS$18 = {
|
|
446
444
|
closeOnClickAway: true,
|
|
447
445
|
closeOnEscape: true,
|
|
448
446
|
selectedChipRender(choice, index, onClear, isDisabled) {
|
|
@@ -482,8 +480,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
482
480
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
483
481
|
chipsAlignment,
|
|
484
482
|
className,
|
|
485
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
486
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
483
|
+
closeOnClickAway = DEFAULT_PROPS$18.closeOnClickAway,
|
|
484
|
+
closeOnEscape = DEFAULT_PROPS$18.closeOnEscape,
|
|
487
485
|
fitToAnchorWidth,
|
|
488
486
|
hasError,
|
|
489
487
|
helper,
|
|
@@ -505,19 +503,19 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
505
503
|
onKeyDown,
|
|
506
504
|
placeholder,
|
|
507
505
|
placement,
|
|
508
|
-
selectedChipRender = DEFAULT_PROPS$
|
|
506
|
+
selectedChipRender = DEFAULT_PROPS$18.selectedChipRender,
|
|
509
507
|
shouldFocusOnClose,
|
|
510
508
|
theme = defaultTheme,
|
|
511
509
|
type,
|
|
512
510
|
value,
|
|
513
|
-
values = DEFAULT_PROPS$
|
|
511
|
+
values = DEFAULT_PROPS$18.values,
|
|
514
512
|
...forwardedProps
|
|
515
513
|
} = otherProps;
|
|
516
514
|
return /*#__PURE__*/jsx(Autocomplete, {
|
|
517
515
|
ref: ref,
|
|
518
516
|
...forwardedProps,
|
|
519
517
|
anchorToInput: anchorToInput,
|
|
520
|
-
className: classNames.join(className, CLASSNAME$
|
|
518
|
+
className: classNames.join(className, CLASSNAME$1h),
|
|
521
519
|
name: name,
|
|
522
520
|
value: value,
|
|
523
521
|
onChange: onChange,
|
|
@@ -551,8 +549,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
551
549
|
});
|
|
552
550
|
});
|
|
553
551
|
AutocompleteMultiple.displayName = COMPONENT_NAME$1j;
|
|
554
|
-
AutocompleteMultiple.className = CLASSNAME$
|
|
555
|
-
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$
|
|
552
|
+
AutocompleteMultiple.className = CLASSNAME$1h;
|
|
553
|
+
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$18;
|
|
556
554
|
|
|
557
555
|
/**
|
|
558
556
|
* Component display name.
|
|
@@ -562,16 +560,16 @@ const COMPONENT_NAME$1i = 'Avatar';
|
|
|
562
560
|
/**
|
|
563
561
|
* Component default class name and class prefix.
|
|
564
562
|
*/
|
|
565
|
-
const CLASSNAME$
|
|
563
|
+
const CLASSNAME$1g = 'lumx-avatar';
|
|
566
564
|
const {
|
|
567
|
-
block: block$
|
|
568
|
-
element: element$
|
|
569
|
-
} = classNames.bem(CLASSNAME$
|
|
565
|
+
block: block$13,
|
|
566
|
+
element: element$N
|
|
567
|
+
} = classNames.bem(CLASSNAME$1g);
|
|
570
568
|
|
|
571
569
|
/**
|
|
572
570
|
* Component default props.
|
|
573
571
|
*/
|
|
574
|
-
const DEFAULT_PROPS$
|
|
572
|
+
const DEFAULT_PROPS$17 = {
|
|
575
573
|
size: Size$1.m
|
|
576
574
|
};
|
|
577
575
|
|
|
@@ -594,7 +592,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
594
592
|
linkAs,
|
|
595
593
|
onClick,
|
|
596
594
|
onKeyPress,
|
|
597
|
-
size = DEFAULT_PROPS$
|
|
595
|
+
size = DEFAULT_PROPS$17.size,
|
|
598
596
|
theme = defaultTheme,
|
|
599
597
|
thumbnailProps,
|
|
600
598
|
...forwardedProps
|
|
@@ -602,14 +600,14 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
602
600
|
return /*#__PURE__*/jsxs("div", {
|
|
603
601
|
ref: ref,
|
|
604
602
|
...forwardedProps,
|
|
605
|
-
className: classNames.join(className, block$
|
|
603
|
+
className: classNames.join(className, block$13({
|
|
606
604
|
[`size-${size}`]: Boolean(size),
|
|
607
605
|
[`theme-${theme}`]: Boolean(theme)
|
|
608
606
|
})),
|
|
609
607
|
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
610
608
|
linkProps: linkProps,
|
|
611
609
|
linkAs: linkAs,
|
|
612
|
-
className: element$
|
|
610
|
+
className: element$N('thumbnail'),
|
|
613
611
|
onClick: onClick,
|
|
614
612
|
onKeyPress: onKeyPress,
|
|
615
613
|
...thumbnailProps,
|
|
@@ -619,17 +617,17 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
619
617
|
alt: alt,
|
|
620
618
|
theme: theme
|
|
621
619
|
}), actions && /*#__PURE__*/jsx("div", {
|
|
622
|
-
className: element$
|
|
620
|
+
className: element$N('actions'),
|
|
623
621
|
children: actions
|
|
624
622
|
}), badge && /*#__PURE__*/jsx("div", {
|
|
625
|
-
className: element$
|
|
623
|
+
className: element$N('badge'),
|
|
626
624
|
children: badge
|
|
627
625
|
})]
|
|
628
626
|
});
|
|
629
627
|
});
|
|
630
628
|
Avatar.displayName = COMPONENT_NAME$1i;
|
|
631
|
-
Avatar.className = CLASSNAME$
|
|
632
|
-
Avatar.defaultProps = DEFAULT_PROPS$
|
|
629
|
+
Avatar.className = CLASSNAME$1g;
|
|
630
|
+
Avatar.defaultProps = DEFAULT_PROPS$17;
|
|
633
631
|
|
|
634
632
|
/**
|
|
635
633
|
* Alignments.
|
|
@@ -697,6 +695,8 @@ const ColorPalette = {
|
|
|
697
695
|
red: 'red',
|
|
698
696
|
light: 'light'};
|
|
699
697
|
|
|
698
|
+
/** ColorPalette with all possible color variant combination */
|
|
699
|
+
|
|
700
700
|
function getDefaultExportFromCjs (x) {
|
|
701
701
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
702
702
|
}
|
|
@@ -857,7 +857,7 @@ function modifier$1(baseName, modifiers) {
|
|
|
857
857
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
858
858
|
*/
|
|
859
859
|
|
|
860
|
-
function block$
|
|
860
|
+
function block$12(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
861
861
|
let modifiers;
|
|
862
862
|
let classes;
|
|
863
863
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
@@ -892,11 +892,11 @@ function block$15(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
|
892
892
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
893
893
|
*/
|
|
894
894
|
|
|
895
|
-
function element$
|
|
895
|
+
function element$M(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
896
896
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
897
|
-
return block$
|
|
897
|
+
return block$12(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
|
|
898
898
|
}
|
|
899
|
-
return block$
|
|
899
|
+
return block$12(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
|
|
900
900
|
}
|
|
901
901
|
|
|
902
902
|
/**
|
|
@@ -905,15 +905,15 @@ function element$P(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
|
|
|
905
905
|
function bem(baseName) {
|
|
906
906
|
function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
|
|
907
907
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
908
|
-
return block$
|
|
908
|
+
return block$12(baseName, modifiersOrAdditionalClasses);
|
|
909
909
|
}
|
|
910
|
-
return block$
|
|
910
|
+
return block$12(baseName, modifiersOrAdditionalClasses, additionalClasses);
|
|
911
911
|
}
|
|
912
912
|
function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
913
913
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
914
|
-
return element$
|
|
914
|
+
return element$M(baseName, elem, modifiersOrAdditionalClasses);
|
|
915
915
|
}
|
|
916
|
-
return element$
|
|
916
|
+
return element$M(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
|
|
917
917
|
}
|
|
918
918
|
return {
|
|
919
919
|
block: blockFn,
|
|
@@ -930,15 +930,15 @@ const COMPONENT_NAME$1h = 'Badge';
|
|
|
930
930
|
/**
|
|
931
931
|
* Component default class name and class prefix.
|
|
932
932
|
*/
|
|
933
|
-
const CLASSNAME$
|
|
933
|
+
const CLASSNAME$1f = 'lumx-badge';
|
|
934
934
|
const {
|
|
935
|
-
block: block$
|
|
936
|
-
} = bem(CLASSNAME$
|
|
935
|
+
block: block$11
|
|
936
|
+
} = bem(CLASSNAME$1f);
|
|
937
937
|
|
|
938
938
|
/**
|
|
939
939
|
* Component default props.
|
|
940
940
|
*/
|
|
941
|
-
const DEFAULT_PROPS$
|
|
941
|
+
const DEFAULT_PROPS$16 = {
|
|
942
942
|
color: ColorPalette.primary
|
|
943
943
|
};
|
|
944
944
|
|
|
@@ -952,22 +952,22 @@ const Badge$1 = props => {
|
|
|
952
952
|
const {
|
|
953
953
|
children,
|
|
954
954
|
className,
|
|
955
|
-
color = DEFAULT_PROPS$
|
|
955
|
+
color = DEFAULT_PROPS$16.color,
|
|
956
956
|
ref,
|
|
957
957
|
...forwardedProps
|
|
958
958
|
} = props;
|
|
959
959
|
return /*#__PURE__*/jsx("div", {
|
|
960
960
|
ref: ref,
|
|
961
961
|
...forwardedProps,
|
|
962
|
-
className: classnames(className, block$
|
|
962
|
+
className: classnames(className, block$11({
|
|
963
963
|
[`color-${color}`]: Boolean(color)
|
|
964
964
|
})),
|
|
965
965
|
children: children
|
|
966
966
|
});
|
|
967
967
|
};
|
|
968
968
|
Badge$1.displayName = COMPONENT_NAME$1h;
|
|
969
|
-
Badge$1.className = CLASSNAME$
|
|
970
|
-
Badge$1.defaultProps = DEFAULT_PROPS$
|
|
969
|
+
Badge$1.className = CLASSNAME$1f;
|
|
970
|
+
Badge$1.defaultProps = DEFAULT_PROPS$16;
|
|
971
971
|
|
|
972
972
|
/**
|
|
973
973
|
* Defines the props of the component.
|
|
@@ -991,11 +991,11 @@ Badge.className = Badge$1.className;
|
|
|
991
991
|
Badge.defaultProps = Badge$1.defaultProps;
|
|
992
992
|
|
|
993
993
|
const COMPONENT_NAME$1g = 'BadgeWrapper';
|
|
994
|
-
const CLASSNAME$
|
|
994
|
+
const CLASSNAME$1e = 'lumx-badge-wrapper';
|
|
995
995
|
const {
|
|
996
|
-
block: block$
|
|
997
|
-
element: element$
|
|
998
|
-
} = bem(CLASSNAME$
|
|
996
|
+
block: block$10,
|
|
997
|
+
element: element$L
|
|
998
|
+
} = bem(CLASSNAME$1e);
|
|
999
999
|
const BadgeWrapper$1 = props => {
|
|
1000
1000
|
const {
|
|
1001
1001
|
badge,
|
|
@@ -1007,9 +1007,9 @@ const BadgeWrapper$1 = props => {
|
|
|
1007
1007
|
return /*#__PURE__*/jsxs("div", {
|
|
1008
1008
|
ref: ref,
|
|
1009
1009
|
...forwardedProps,
|
|
1010
|
-
className: classnames(className, block$
|
|
1010
|
+
className: classnames(className, block$10()),
|
|
1011
1011
|
children: [children, badge && /*#__PURE__*/jsx("div", {
|
|
1012
|
-
className: element$
|
|
1012
|
+
className: element$L('badge'),
|
|
1013
1013
|
children: badge
|
|
1014
1014
|
})]
|
|
1015
1015
|
});
|
|
@@ -1022,7 +1022,7 @@ const BadgeWrapper = forwardRef((props, ref) => {
|
|
|
1022
1022
|
});
|
|
1023
1023
|
});
|
|
1024
1024
|
BadgeWrapper.displayName = COMPONENT_NAME$1g;
|
|
1025
|
-
BadgeWrapper.className = CLASSNAME$
|
|
1025
|
+
BadgeWrapper.className = CLASSNAME$1e;
|
|
1026
1026
|
|
|
1027
1027
|
/**
|
|
1028
1028
|
* Render clickable element (link, button or custom element)
|
|
@@ -1183,15 +1183,15 @@ const COMPONENT_NAME$1e = 'Button';
|
|
|
1183
1183
|
/**
|
|
1184
1184
|
* Component default class name and class prefix.
|
|
1185
1185
|
*/
|
|
1186
|
-
const CLASSNAME$
|
|
1186
|
+
const CLASSNAME$1d = 'lumx-button';
|
|
1187
1187
|
const {
|
|
1188
1188
|
modifier
|
|
1189
|
-
} = bem(CLASSNAME$
|
|
1189
|
+
} = bem(CLASSNAME$1d);
|
|
1190
1190
|
|
|
1191
1191
|
/**
|
|
1192
1192
|
* Component default props.
|
|
1193
1193
|
*/
|
|
1194
|
-
const DEFAULT_PROPS$
|
|
1194
|
+
const DEFAULT_PROPS$15 = {
|
|
1195
1195
|
emphasis: Emphasis.high,
|
|
1196
1196
|
size: Size.m
|
|
1197
1197
|
};
|
|
@@ -1205,10 +1205,10 @@ const DEFAULT_PROPS$16 = {
|
|
|
1205
1205
|
const Button$1 = props => {
|
|
1206
1206
|
const {
|
|
1207
1207
|
className,
|
|
1208
|
-
emphasis = DEFAULT_PROPS$
|
|
1208
|
+
emphasis = DEFAULT_PROPS$15.emphasis,
|
|
1209
1209
|
leftIcon,
|
|
1210
1210
|
rightIcon,
|
|
1211
|
-
size = DEFAULT_PROPS$
|
|
1211
|
+
size = DEFAULT_PROPS$15.size,
|
|
1212
1212
|
...forwardedProps
|
|
1213
1213
|
} = props;
|
|
1214
1214
|
const buttonClassName = classnames(className, modifier({
|
|
@@ -1224,8 +1224,8 @@ const Button$1 = props => {
|
|
|
1224
1224
|
});
|
|
1225
1225
|
};
|
|
1226
1226
|
Button$1.displayName = COMPONENT_NAME$1e;
|
|
1227
|
-
Button$1.className = CLASSNAME$
|
|
1228
|
-
Button$1.defaultProps = DEFAULT_PROPS$
|
|
1227
|
+
Button$1.className = CLASSNAME$1d;
|
|
1228
|
+
Button$1.defaultProps = DEFAULT_PROPS$15;
|
|
1229
1229
|
|
|
1230
1230
|
/**
|
|
1231
1231
|
* Properties of a component to use to determine it's name.
|
|
@@ -1292,8 +1292,8 @@ const Button = forwardRef((props, ref) => {
|
|
|
1292
1292
|
});
|
|
1293
1293
|
});
|
|
1294
1294
|
Button.displayName = COMPONENT_NAME$1e;
|
|
1295
|
-
Button.className = CLASSNAME$
|
|
1296
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
1295
|
+
Button.className = CLASSNAME$1d;
|
|
1296
|
+
Button.defaultProps = DEFAULT_PROPS$15;
|
|
1297
1297
|
|
|
1298
1298
|
const COMPONENT_NAME$1d = 'Icon';
|
|
1299
1299
|
const IconClassName = 'lumx-icon';
|
|
@@ -1302,15 +1302,15 @@ const IconClassName = 'lumx-icon';
|
|
|
1302
1302
|
* Defines the props of the component.
|
|
1303
1303
|
*/
|
|
1304
1304
|
|
|
1305
|
-
const CLASSNAME$
|
|
1305
|
+
const CLASSNAME$1c = IconClassName;
|
|
1306
1306
|
const {
|
|
1307
|
-
block: block
|
|
1308
|
-
} = bem(CLASSNAME$
|
|
1307
|
+
block: block$$
|
|
1308
|
+
} = bem(CLASSNAME$1c);
|
|
1309
1309
|
|
|
1310
1310
|
/**
|
|
1311
1311
|
* Component default props.
|
|
1312
1312
|
*/
|
|
1313
|
-
const DEFAULT_PROPS$
|
|
1313
|
+
const DEFAULT_PROPS$14 = {};
|
|
1314
1314
|
|
|
1315
1315
|
/**
|
|
1316
1316
|
* Icon component.
|
|
@@ -1359,7 +1359,7 @@ const Icon$1 = props => {
|
|
|
1359
1359
|
return /*#__PURE__*/jsx("i", {
|
|
1360
1360
|
ref: ref,
|
|
1361
1361
|
...forwardedProps,
|
|
1362
|
-
className: classnames(className, block
|
|
1362
|
+
className: classnames(className, block$$({
|
|
1363
1363
|
[`color-${iconColor}`]: Boolean(iconColor),
|
|
1364
1364
|
[`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
|
|
1365
1365
|
'has-shape': hasShape,
|
|
@@ -1389,8 +1389,8 @@ const Icon$1 = props => {
|
|
|
1389
1389
|
});
|
|
1390
1390
|
};
|
|
1391
1391
|
Icon$1.displayName = COMPONENT_NAME$1d;
|
|
1392
|
-
Icon$1.className = CLASSNAME$
|
|
1393
|
-
Icon$1.defaultProps = DEFAULT_PROPS$
|
|
1392
|
+
Icon$1.className = CLASSNAME$1c;
|
|
1393
|
+
Icon$1.defaultProps = DEFAULT_PROPS$14;
|
|
1394
1394
|
|
|
1395
1395
|
/**
|
|
1396
1396
|
* Component display name.
|
|
@@ -1400,12 +1400,12 @@ const COMPONENT_NAME$1c = 'IconButton';
|
|
|
1400
1400
|
/**
|
|
1401
1401
|
* Component default class name and class prefix.
|
|
1402
1402
|
*/
|
|
1403
|
-
const CLASSNAME$
|
|
1403
|
+
const CLASSNAME$1b = 'lumx-icon-button';
|
|
1404
1404
|
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Component default props.
|
|
1407
1407
|
*/
|
|
1408
|
-
const DEFAULT_PROPS$
|
|
1408
|
+
const DEFAULT_PROPS$13 = {
|
|
1409
1409
|
emphasis: Emphasis.high,
|
|
1410
1410
|
size: Size.m
|
|
1411
1411
|
};
|
|
@@ -1418,11 +1418,11 @@ const DEFAULT_PROPS$14 = {
|
|
|
1418
1418
|
*/
|
|
1419
1419
|
const IconButton$1 = props => {
|
|
1420
1420
|
const {
|
|
1421
|
-
emphasis = DEFAULT_PROPS$
|
|
1421
|
+
emphasis = DEFAULT_PROPS$13.emphasis,
|
|
1422
1422
|
image,
|
|
1423
1423
|
icon,
|
|
1424
1424
|
label,
|
|
1425
|
-
size = DEFAULT_PROPS$
|
|
1425
|
+
size = DEFAULT_PROPS$13.size,
|
|
1426
1426
|
...forwardedProps
|
|
1427
1427
|
} = props;
|
|
1428
1428
|
const defaultChildren = image ? /*#__PURE__*/jsx("img", {
|
|
@@ -1442,8 +1442,8 @@ const IconButton$1 = props => {
|
|
|
1442
1442
|
});
|
|
1443
1443
|
};
|
|
1444
1444
|
IconButton$1.displayName = COMPONENT_NAME$1c;
|
|
1445
|
-
IconButton$1.className = CLASSNAME$
|
|
1446
|
-
IconButton$1.defaultProps = DEFAULT_PROPS$
|
|
1445
|
+
IconButton$1.className = CLASSNAME$1b;
|
|
1446
|
+
IconButton$1.defaultProps = DEFAULT_PROPS$13;
|
|
1447
1447
|
|
|
1448
1448
|
/**
|
|
1449
1449
|
* IconButton component.
|
|
@@ -1479,8 +1479,8 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
1479
1479
|
});
|
|
1480
1480
|
});
|
|
1481
1481
|
IconButton.displayName = COMPONENT_NAME$1c;
|
|
1482
|
-
IconButton.className = CLASSNAME$
|
|
1483
|
-
IconButton.defaultProps = DEFAULT_PROPS$
|
|
1482
|
+
IconButton.className = CLASSNAME$1b;
|
|
1483
|
+
IconButton.defaultProps = DEFAULT_PROPS$13;
|
|
1484
1484
|
|
|
1485
1485
|
/**
|
|
1486
1486
|
* Component display name.
|
|
@@ -1490,12 +1490,12 @@ const COMPONENT_NAME$1b = 'ButtonGroup';
|
|
|
1490
1490
|
/**
|
|
1491
1491
|
* Component default class name and class prefix.
|
|
1492
1492
|
*/
|
|
1493
|
-
const CLASSNAME$
|
|
1493
|
+
const CLASSNAME$1a = 'lumx-button-group';
|
|
1494
1494
|
|
|
1495
1495
|
/**
|
|
1496
1496
|
* Component default props.
|
|
1497
1497
|
*/
|
|
1498
|
-
const DEFAULT_PROPS$
|
|
1498
|
+
const DEFAULT_PROPS$12 = {};
|
|
1499
1499
|
|
|
1500
1500
|
/**
|
|
1501
1501
|
* ButtonGroup component.
|
|
@@ -1511,13 +1511,13 @@ const ButtonGroup$1 = props => {
|
|
|
1511
1511
|
} = props;
|
|
1512
1512
|
return /*#__PURE__*/jsx("div", {
|
|
1513
1513
|
...forwardedProps,
|
|
1514
|
-
className: classnames(className, CLASSNAME$
|
|
1514
|
+
className: classnames(className, CLASSNAME$1a),
|
|
1515
1515
|
children: children
|
|
1516
1516
|
});
|
|
1517
1517
|
};
|
|
1518
1518
|
ButtonGroup$1.displayName = COMPONENT_NAME$1b;
|
|
1519
|
-
ButtonGroup$1.className = CLASSNAME$
|
|
1520
|
-
ButtonGroup$1.defaultProps = DEFAULT_PROPS$
|
|
1519
|
+
ButtonGroup$1.className = CLASSNAME$1a;
|
|
1520
|
+
ButtonGroup$1.defaultProps = DEFAULT_PROPS$12;
|
|
1521
1521
|
|
|
1522
1522
|
/**
|
|
1523
1523
|
* ButtonGroup component.
|
|
@@ -1533,16 +1533,16 @@ const ButtonGroup = forwardRef((props, ref) => {
|
|
|
1533
1533
|
});
|
|
1534
1534
|
});
|
|
1535
1535
|
ButtonGroup.displayName = COMPONENT_NAME$1b;
|
|
1536
|
-
ButtonGroup.className = CLASSNAME$
|
|
1537
|
-
ButtonGroup.defaultProps = DEFAULT_PROPS$
|
|
1536
|
+
ButtonGroup.className = CLASSNAME$1a;
|
|
1537
|
+
ButtonGroup.defaultProps = DEFAULT_PROPS$12;
|
|
1538
1538
|
|
|
1539
1539
|
const COMPONENT_NAME$1a = 'InputLabel';
|
|
1540
1540
|
const InputLabelClassName = 'lumx-input-label';
|
|
1541
|
-
const CLASSNAME$
|
|
1541
|
+
const CLASSNAME$19 = InputLabelClassName;
|
|
1542
1542
|
const {
|
|
1543
|
-
block: block$
|
|
1544
|
-
} = bem(CLASSNAME$
|
|
1545
|
-
const DEFAULT_PROPS$
|
|
1543
|
+
block: block$_
|
|
1544
|
+
} = bem(CLASSNAME$19);
|
|
1545
|
+
const DEFAULT_PROPS$11 = {};
|
|
1546
1546
|
|
|
1547
1547
|
/**
|
|
1548
1548
|
* InputLabel component.
|
|
@@ -1562,7 +1562,7 @@ function InputLabel$1(props) {
|
|
|
1562
1562
|
ref: ref,
|
|
1563
1563
|
...forwardedProps,
|
|
1564
1564
|
htmlFor: htmlFor,
|
|
1565
|
-
className: classnames(className, block$
|
|
1565
|
+
className: classnames(className, block$_({
|
|
1566
1566
|
'is-required': isRequired,
|
|
1567
1567
|
[`theme-${theme}`]: Boolean(theme),
|
|
1568
1568
|
'has-custom-typography': Boolean(typography$1)
|
|
@@ -1571,8 +1571,8 @@ function InputLabel$1(props) {
|
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
1573
|
InputLabel$1.displayName = COMPONENT_NAME$1a;
|
|
1574
|
-
InputLabel$1.className = CLASSNAME$
|
|
1575
|
-
InputLabel$1.defaultProps = DEFAULT_PROPS$
|
|
1574
|
+
InputLabel$1.className = CLASSNAME$19;
|
|
1575
|
+
InputLabel$1.defaultProps = DEFAULT_PROPS$11;
|
|
1576
1576
|
|
|
1577
1577
|
const INPUT_HELPER_CONFIGURATION = {
|
|
1578
1578
|
[Kind.error]: {
|
|
@@ -1593,15 +1593,15 @@ const InputHelperClassName = 'lumx-input-helper';
|
|
|
1593
1593
|
* Defines the props of the component.
|
|
1594
1594
|
*/
|
|
1595
1595
|
|
|
1596
|
-
const CLASSNAME$
|
|
1596
|
+
const CLASSNAME$18 = InputHelperClassName;
|
|
1597
1597
|
const {
|
|
1598
|
-
block: block$
|
|
1599
|
-
} = bem(CLASSNAME$
|
|
1598
|
+
block: block$Z
|
|
1599
|
+
} = bem(CLASSNAME$18);
|
|
1600
1600
|
|
|
1601
1601
|
/**
|
|
1602
1602
|
* Component default props.
|
|
1603
1603
|
*/
|
|
1604
|
-
const DEFAULT_PROPS$
|
|
1604
|
+
const DEFAULT_PROPS$10 = {
|
|
1605
1605
|
kind: Kind.info
|
|
1606
1606
|
};
|
|
1607
1607
|
|
|
@@ -1612,7 +1612,7 @@ function InputHelper$1(props) {
|
|
|
1612
1612
|
const {
|
|
1613
1613
|
children,
|
|
1614
1614
|
className,
|
|
1615
|
-
kind = DEFAULT_PROPS$
|
|
1615
|
+
kind = DEFAULT_PROPS$10.kind,
|
|
1616
1616
|
theme,
|
|
1617
1617
|
ref,
|
|
1618
1618
|
...forwardedProps
|
|
@@ -1623,7 +1623,7 @@ function InputHelper$1(props) {
|
|
|
1623
1623
|
return /*#__PURE__*/jsx("p", {
|
|
1624
1624
|
ref: ref,
|
|
1625
1625
|
...forwardedProps,
|
|
1626
|
-
className: classnames(className, block$
|
|
1626
|
+
className: classnames(className, block$Z({
|
|
1627
1627
|
[`color-${color}`]: Boolean(color),
|
|
1628
1628
|
[`theme-${theme}`]: Boolean(theme)
|
|
1629
1629
|
})),
|
|
@@ -1631,8 +1631,8 @@ function InputHelper$1(props) {
|
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
1633
|
InputHelper$1.displayName = COMPONENT_NAME$19;
|
|
1634
|
-
InputHelper$1.className = CLASSNAME$
|
|
1635
|
-
InputHelper$1.defaultProps = DEFAULT_PROPS$
|
|
1634
|
+
InputHelper$1.className = CLASSNAME$18;
|
|
1635
|
+
InputHelper$1.defaultProps = DEFAULT_PROPS$10;
|
|
1636
1636
|
|
|
1637
1637
|
const INTERMEDIATE_STATE = 'intermediate';
|
|
1638
1638
|
|
|
@@ -1648,11 +1648,11 @@ const COMPONENT_NAME$18 = 'Checkbox';
|
|
|
1648
1648
|
/**
|
|
1649
1649
|
* Component default class name and class prefix.
|
|
1650
1650
|
*/
|
|
1651
|
-
const CLASSNAME$
|
|
1651
|
+
const CLASSNAME$17 = 'lumx-checkbox';
|
|
1652
1652
|
const {
|
|
1653
|
-
block: block
|
|
1654
|
-
element: element$
|
|
1655
|
-
} = bem(CLASSNAME$
|
|
1653
|
+
block: block$Y,
|
|
1654
|
+
element: element$K
|
|
1655
|
+
} = bem(CLASSNAME$17);
|
|
1656
1656
|
|
|
1657
1657
|
/**
|
|
1658
1658
|
* Checkbox component.
|
|
@@ -1688,7 +1688,7 @@ const Checkbox$1 = props => {
|
|
|
1688
1688
|
return /*#__PURE__*/jsxs("div", {
|
|
1689
1689
|
ref: ref,
|
|
1690
1690
|
...forwardedProps,
|
|
1691
|
-
className: classnames(className, block
|
|
1691
|
+
className: classnames(className, block$Y({
|
|
1692
1692
|
// Whether state is intermediate class name will "-checked"
|
|
1693
1693
|
'is-checked': intermediateState ? true : isChecked,
|
|
1694
1694
|
'is-disabled': isDisabled,
|
|
@@ -1696,12 +1696,12 @@ const Checkbox$1 = props => {
|
|
|
1696
1696
|
[`theme-${theme}`]: Boolean(theme)
|
|
1697
1697
|
})),
|
|
1698
1698
|
children: [/*#__PURE__*/jsxs("div", {
|
|
1699
|
-
className: element$
|
|
1699
|
+
className: element$K('input-wrapper'),
|
|
1700
1700
|
children: [/*#__PURE__*/jsx("input", {
|
|
1701
1701
|
ref: inputRef,
|
|
1702
1702
|
type: "checkbox",
|
|
1703
1703
|
id: inputId,
|
|
1704
|
-
className: element$
|
|
1704
|
+
className: element$K('input-native'),
|
|
1705
1705
|
name: name,
|
|
1706
1706
|
value: value,
|
|
1707
1707
|
checked: isChecked,
|
|
@@ -1713,26 +1713,26 @@ const Checkbox$1 = props => {
|
|
|
1713
1713
|
} : {}),
|
|
1714
1714
|
...inputProps
|
|
1715
1715
|
}), /*#__PURE__*/jsxs("div", {
|
|
1716
|
-
className: element$
|
|
1716
|
+
className: element$K('input-placeholder'),
|
|
1717
1717
|
children: [/*#__PURE__*/jsx("div", {
|
|
1718
|
-
className: element$
|
|
1718
|
+
className: element$K('input-background')
|
|
1719
1719
|
}), /*#__PURE__*/jsx("div", {
|
|
1720
|
-
className: element$
|
|
1720
|
+
className: element$K('input-indicator'),
|
|
1721
1721
|
children: Icon$1({
|
|
1722
1722
|
icon: intermediateState ? mdiMinus : mdiCheck
|
|
1723
1723
|
})
|
|
1724
1724
|
})]
|
|
1725
1725
|
})]
|
|
1726
1726
|
}), /*#__PURE__*/jsxs("div", {
|
|
1727
|
-
className: element$
|
|
1727
|
+
className: element$K('content'),
|
|
1728
1728
|
children: [label && InputLabel$1({
|
|
1729
1729
|
htmlFor: inputId,
|
|
1730
|
-
className: element$
|
|
1730
|
+
className: element$K('label'),
|
|
1731
1731
|
theme,
|
|
1732
1732
|
children: label
|
|
1733
1733
|
}), helper && InputHelper$1({
|
|
1734
1734
|
id: `${inputId}-helper`,
|
|
1735
|
-
className: element$
|
|
1735
|
+
className: element$K('helper'),
|
|
1736
1736
|
theme,
|
|
1737
1737
|
children: helper
|
|
1738
1738
|
})]
|
|
@@ -1747,7 +1747,7 @@ const Checkbox$1 = props => {
|
|
|
1747
1747
|
/**
|
|
1748
1748
|
* Component default props.
|
|
1749
1749
|
*/
|
|
1750
|
-
const DEFAULT_PROPS
|
|
1750
|
+
const DEFAULT_PROPS$$ = {};
|
|
1751
1751
|
|
|
1752
1752
|
/**
|
|
1753
1753
|
* Checkbox component.
|
|
@@ -1808,8 +1808,8 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1808
1808
|
});
|
|
1809
1809
|
});
|
|
1810
1810
|
Checkbox.displayName = COMPONENT_NAME$18;
|
|
1811
|
-
Checkbox.className = CLASSNAME$
|
|
1812
|
-
Checkbox.defaultProps = DEFAULT_PROPS
|
|
1811
|
+
Checkbox.className = CLASSNAME$17;
|
|
1812
|
+
Checkbox.defaultProps = DEFAULT_PROPS$$;
|
|
1813
1813
|
|
|
1814
1814
|
/**
|
|
1815
1815
|
* Wrap mouse event handler to stop event propagation.
|
|
@@ -1835,16 +1835,16 @@ const COMPONENT_NAME$17 = 'Chip';
|
|
|
1835
1835
|
/**
|
|
1836
1836
|
* Component default class name and class prefix.
|
|
1837
1837
|
*/
|
|
1838
|
-
const CLASSNAME$
|
|
1838
|
+
const CLASSNAME$16 = 'lumx-chip';
|
|
1839
1839
|
const {
|
|
1840
|
-
block: block$
|
|
1841
|
-
element: element$
|
|
1842
|
-
} = classNames.bem(CLASSNAME$
|
|
1840
|
+
block: block$X,
|
|
1841
|
+
element: element$J
|
|
1842
|
+
} = classNames.bem(CLASSNAME$16);
|
|
1843
1843
|
|
|
1844
1844
|
/**
|
|
1845
1845
|
* Component default props.
|
|
1846
1846
|
*/
|
|
1847
|
-
const DEFAULT_PROPS
|
|
1847
|
+
const DEFAULT_PROPS$_ = {
|
|
1848
1848
|
size: Size$1.m
|
|
1849
1849
|
};
|
|
1850
1850
|
|
|
@@ -1874,7 +1874,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1874
1874
|
onAfterClick,
|
|
1875
1875
|
onBeforeClick,
|
|
1876
1876
|
onClick,
|
|
1877
|
-
size = DEFAULT_PROPS
|
|
1877
|
+
size = DEFAULT_PROPS$_.size,
|
|
1878
1878
|
theme = defaultTheme,
|
|
1879
1879
|
href,
|
|
1880
1880
|
onKeyDown,
|
|
@@ -1905,7 +1905,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1905
1905
|
...forwardedProps,
|
|
1906
1906
|
href: !disabledStateProps.disabled ? href : undefined,
|
|
1907
1907
|
ref: ref,
|
|
1908
|
-
className: classNames.join(className, block$
|
|
1908
|
+
className: classNames.join(className, block$X({
|
|
1909
1909
|
'is-clickable': isClickable,
|
|
1910
1910
|
[`color-${chipColor}`]: Boolean(chipColor),
|
|
1911
1911
|
'is-disabled': isAnyDisabled,
|
|
@@ -1923,19 +1923,19 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1923
1923
|
/*#__PURE__*/
|
|
1924
1924
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1925
1925
|
jsx("div", {
|
|
1926
|
-
className: element$
|
|
1926
|
+
className: element$J('before', {
|
|
1927
1927
|
'is-clickable': hasBeforeClick
|
|
1928
1928
|
}),
|
|
1929
1929
|
onClick: handleOnBeforeClick,
|
|
1930
1930
|
children: before
|
|
1931
1931
|
}), /*#__PURE__*/jsx("div", {
|
|
1932
|
-
className: element$
|
|
1932
|
+
className: element$J('label'),
|
|
1933
1933
|
children: children
|
|
1934
1934
|
}), after &&
|
|
1935
1935
|
/*#__PURE__*/
|
|
1936
1936
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1937
1937
|
jsx("div", {
|
|
1938
|
-
className: element$
|
|
1938
|
+
className: element$J('after', {
|
|
1939
1939
|
'is-clickable': hasAfterClick
|
|
1940
1940
|
}),
|
|
1941
1941
|
onClick: handleOnAfterClick,
|
|
@@ -1945,8 +1945,8 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1945
1945
|
);
|
|
1946
1946
|
});
|
|
1947
1947
|
Chip.displayName = COMPONENT_NAME$17;
|
|
1948
|
-
Chip.className = CLASSNAME$
|
|
1949
|
-
Chip.defaultProps = DEFAULT_PROPS
|
|
1948
|
+
Chip.className = CLASSNAME$16;
|
|
1949
|
+
Chip.defaultProps = DEFAULT_PROPS$_;
|
|
1950
1950
|
|
|
1951
1951
|
const INITIAL_STATE_ACTIVE_CHIP = -1;
|
|
1952
1952
|
|
|
@@ -2002,7 +2002,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
|
|
|
2002
2002
|
/**
|
|
2003
2003
|
* Component default props.
|
|
2004
2004
|
*/
|
|
2005
|
-
const DEFAULT_PROPS$
|
|
2005
|
+
const DEFAULT_PROPS$Z = {};
|
|
2006
2006
|
|
|
2007
2007
|
/**
|
|
2008
2008
|
* Component display name.
|
|
@@ -2012,7 +2012,7 @@ const COMPONENT_NAME$16 = 'ChipGroup';
|
|
|
2012
2012
|
/**
|
|
2013
2013
|
* Component default class name and class prefix.
|
|
2014
2014
|
*/
|
|
2015
|
-
const CLASSNAME$
|
|
2015
|
+
const CLASSNAME$15 = 'lumx-chip-group';
|
|
2016
2016
|
|
|
2017
2017
|
/**
|
|
2018
2018
|
* ChipGroup component.
|
|
@@ -2031,13 +2031,13 @@ const InternalChipGroup = forwardRef((props, ref) => {
|
|
|
2031
2031
|
return /*#__PURE__*/jsx("div", {
|
|
2032
2032
|
ref: ref,
|
|
2033
2033
|
...forwardedProps,
|
|
2034
|
-
className: classNames.join(className, CLASSNAME$
|
|
2034
|
+
className: classNames.join(className, CLASSNAME$15),
|
|
2035
2035
|
children: children
|
|
2036
2036
|
});
|
|
2037
2037
|
});
|
|
2038
2038
|
InternalChipGroup.displayName = COMPONENT_NAME$16;
|
|
2039
|
-
InternalChipGroup.className = CLASSNAME$
|
|
2040
|
-
InternalChipGroup.defaultProps = DEFAULT_PROPS$
|
|
2039
|
+
InternalChipGroup.className = CLASSNAME$15;
|
|
2040
|
+
InternalChipGroup.defaultProps = DEFAULT_PROPS$Z;
|
|
2041
2041
|
const ChipGroup = Object.assign(InternalChipGroup, {
|
|
2042
2042
|
useChipGroupNavigation
|
|
2043
2043
|
});
|
|
@@ -2127,11 +2127,11 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
|
|
|
2127
2127
|
/**
|
|
2128
2128
|
* Component default class name and class prefix.
|
|
2129
2129
|
*/
|
|
2130
|
-
const CLASSNAME$
|
|
2130
|
+
const CLASSNAME$14 = 'lumx-selection-chip-group';
|
|
2131
2131
|
const {
|
|
2132
|
-
block: block$
|
|
2133
|
-
element: element$
|
|
2134
|
-
} = classNames.bem(CLASSNAME$
|
|
2132
|
+
block: block$W,
|
|
2133
|
+
element: element$I
|
|
2134
|
+
} = classNames.bem(CLASSNAME$14);
|
|
2135
2135
|
|
|
2136
2136
|
/**
|
|
2137
2137
|
* SelectionChipGroup component.
|
|
@@ -2161,7 +2161,7 @@ const SelectionChipGroup = ({
|
|
|
2161
2161
|
return /*#__PURE__*/jsx(ChipGroup, {
|
|
2162
2162
|
role: "group",
|
|
2163
2163
|
"aria-label": label,
|
|
2164
|
-
className: block$
|
|
2164
|
+
className: block$W(),
|
|
2165
2165
|
...forwardedProps,
|
|
2166
2166
|
children: value?.map((v, index) => {
|
|
2167
2167
|
const name = getWithSelector(getOptionName, v);
|
|
@@ -2205,7 +2205,7 @@ const SelectionChipGroup = ({
|
|
|
2205
2205
|
after: /*#__PURE__*/jsx(Icon, {
|
|
2206
2206
|
icon: mdiClose
|
|
2207
2207
|
}),
|
|
2208
|
-
className: element$
|
|
2208
|
+
className: element$I('chip', [props?.className]),
|
|
2209
2209
|
size: "s",
|
|
2210
2210
|
ref: ref,
|
|
2211
2211
|
onClick: onClick,
|
|
@@ -2220,654 +2220,6 @@ const SelectionChipGroup = ({
|
|
|
2220
2220
|
});
|
|
2221
2221
|
};
|
|
2222
2222
|
|
|
2223
|
-
const ComboboxOptionContext = /*#__PURE__*/createContext({});
|
|
2224
|
-
/** Context Provider to store the current combobox option id. */
|
|
2225
|
-
const ComboboxOptionContextProvider = ({
|
|
2226
|
-
optionId,
|
|
2227
|
-
isKeyboardHighlighted,
|
|
2228
|
-
children
|
|
2229
|
-
}) => {
|
|
2230
|
-
const value = React__default.useMemo(() => ({
|
|
2231
|
-
optionId,
|
|
2232
|
-
isKeyboardHighlighted
|
|
2233
|
-
}), [optionId, isKeyboardHighlighted]);
|
|
2234
|
-
return /*#__PURE__*/jsx(ComboboxOptionContext.Provider, {
|
|
2235
|
-
value: value,
|
|
2236
|
-
children: children
|
|
2237
|
-
});
|
|
2238
|
-
};
|
|
2239
|
-
|
|
2240
|
-
/**
|
|
2241
|
-
* Retrieve the current combobox option id.
|
|
2242
|
-
* Must be used within a ComboboxOptionIdProvider
|
|
2243
|
-
*/
|
|
2244
|
-
const useComboboxOptionContext = () => {
|
|
2245
|
-
const comboboxOption = useContext(ComboboxOptionContext);
|
|
2246
|
-
if (!comboboxOption?.optionId) {
|
|
2247
|
-
throw new Error('This hook must be used within a ComboboxOptionIdProvider');
|
|
2248
|
-
}
|
|
2249
|
-
return comboboxOption;
|
|
2250
|
-
};
|
|
2251
|
-
|
|
2252
|
-
/** Generate the combobox option id from the combobox id and the given id */
|
|
2253
|
-
const generateOptionId = (comboboxId, optionId) => `${comboboxId}-option-${optionId}`;
|
|
2254
|
-
|
|
2255
|
-
/** Verifies that the combobox registered option is an action */
|
|
2256
|
-
const isComboboxAction = option => Boolean(option?.isAction);
|
|
2257
|
-
|
|
2258
|
-
/** Verifies that the combobox registered option is the option's value */
|
|
2259
|
-
const isComboboxValue = option => {
|
|
2260
|
-
return !isComboboxAction(option);
|
|
2261
|
-
};
|
|
2262
|
-
|
|
2263
|
-
const comboboxId = `combobox-${uniqueId()}`;
|
|
2264
|
-
const initialState = {
|
|
2265
|
-
comboboxId,
|
|
2266
|
-
listboxId: `${comboboxId}-popover`,
|
|
2267
|
-
status: 'idle',
|
|
2268
|
-
isOpen: false,
|
|
2269
|
-
inputValue: '',
|
|
2270
|
-
showAll: true,
|
|
2271
|
-
options: {},
|
|
2272
|
-
type: 'listbox',
|
|
2273
|
-
optionsLength: 0
|
|
2274
|
-
};
|
|
2275
|
-
|
|
2276
|
-
/** Dispatch for the combobox component */
|
|
2277
|
-
|
|
2278
|
-
/** Context for the Combobox component */
|
|
2279
|
-
const ComboboxContext = /*#__PURE__*/React__default.createContext({
|
|
2280
|
-
...initialState,
|
|
2281
|
-
openOnFocus: false,
|
|
2282
|
-
openOnClick: false,
|
|
2283
|
-
selectionType: 'single',
|
|
2284
|
-
optionsLength: 0,
|
|
2285
|
-
onSelect: noop,
|
|
2286
|
-
onInputChange: noop,
|
|
2287
|
-
onOpen: noop,
|
|
2288
|
-
dispatch: noop,
|
|
2289
|
-
translations: {
|
|
2290
|
-
clearLabel: '',
|
|
2291
|
-
tryReloadLabel: '',
|
|
2292
|
-
showSuggestionsLabel: '',
|
|
2293
|
-
noResultsForInputLabel: input => input || '',
|
|
2294
|
-
loadingLabel: '',
|
|
2295
|
-
serviceUnavailableLabel: '',
|
|
2296
|
-
nbOptionsLabel: options => `${options}`
|
|
2297
|
-
}
|
|
2298
|
-
});
|
|
2299
|
-
|
|
2300
|
-
/** Context for a combobox section to store its unique id */
|
|
2301
|
-
const SectionContext = /*#__PURE__*/React__default.createContext({
|
|
2302
|
-
sectionId: ''
|
|
2303
|
-
});
|
|
2304
|
-
|
|
2305
|
-
/** Context to store the refs of the combobox elements */
|
|
2306
|
-
const ComboboxRefsContext = /*#__PURE__*/createContext({
|
|
2307
|
-
triggerRef: {
|
|
2308
|
-
current: null
|
|
2309
|
-
},
|
|
2310
|
-
anchorRef: {
|
|
2311
|
-
current: null
|
|
2312
|
-
}
|
|
2313
|
-
});
|
|
2314
|
-
|
|
2315
|
-
/** Retrieves the combobox elements references from context */
|
|
2316
|
-
const useComboboxRefs = () => {
|
|
2317
|
-
const refs = useContext(ComboboxRefsContext);
|
|
2318
|
-
if (!refs) {
|
|
2319
|
-
throw new Error('The useComboboxRefs hook must be called within a ComboboxRefsProvider');
|
|
2320
|
-
}
|
|
2321
|
-
return refs;
|
|
2322
|
-
};
|
|
2323
|
-
|
|
2324
|
-
/** Retrieve the current combobox state and actions */
|
|
2325
|
-
const useCombobox = () => {
|
|
2326
|
-
const comboboxContext = React__default.useContext(ComboboxContext);
|
|
2327
|
-
const {
|
|
2328
|
-
dispatch: movingFocusDispatch
|
|
2329
|
-
} = React__default.useContext(MovingFocusContext);
|
|
2330
|
-
const {
|
|
2331
|
-
onSelect,
|
|
2332
|
-
onInputChange,
|
|
2333
|
-
onOpen,
|
|
2334
|
-
dispatch,
|
|
2335
|
-
inputValue,
|
|
2336
|
-
...contextValues
|
|
2337
|
-
} = comboboxContext;
|
|
2338
|
-
const {
|
|
2339
|
-
triggerRef
|
|
2340
|
-
} = useComboboxRefs();
|
|
2341
|
-
|
|
2342
|
-
/** Action triggered when the listBox is closed without selecting any option */
|
|
2343
|
-
const handleClose = React__default.useCallback(() => {
|
|
2344
|
-
dispatch({
|
|
2345
|
-
type: 'CLOSE_COMBOBOX'
|
|
2346
|
-
});
|
|
2347
|
-
// Reset visual focus
|
|
2348
|
-
movingFocusDispatch({
|
|
2349
|
-
type: 'RESET_SELECTED_TAB_STOP'
|
|
2350
|
-
});
|
|
2351
|
-
}, [dispatch, movingFocusDispatch]);
|
|
2352
|
-
|
|
2353
|
-
// Handle callbacks on options mounted
|
|
2354
|
-
const [optionsMountedCallbacks, setOptionsMountedCallback] = React__default.useState();
|
|
2355
|
-
React__default.useEffect(() => {
|
|
2356
|
-
if (comboboxContext.optionsLength > 0 && optionsMountedCallbacks?.length) {
|
|
2357
|
-
const optionsArray = Object.values(comboboxContext.options);
|
|
2358
|
-
// Execute callbacks
|
|
2359
|
-
for (const callback of optionsMountedCallbacks) {
|
|
2360
|
-
callback(optionsArray);
|
|
2361
|
-
}
|
|
2362
|
-
setOptionsMountedCallback(undefined);
|
|
2363
|
-
}
|
|
2364
|
-
}, [comboboxContext.options, comboboxContext.optionsLength, optionsMountedCallbacks]);
|
|
2365
|
-
|
|
2366
|
-
/** Callback for when an option is selected */
|
|
2367
|
-
const handleSelected = React__default.useCallback((option, source) => {
|
|
2368
|
-
if (option?.isDisabled) {
|
|
2369
|
-
return;
|
|
2370
|
-
}
|
|
2371
|
-
if (isComboboxValue(option)) {
|
|
2372
|
-
/**
|
|
2373
|
-
* We only close the list if the selection type is single.
|
|
2374
|
-
* If it is multiple, we want to allow the user to continue
|
|
2375
|
-
* selecting multiple options.
|
|
2376
|
-
*/
|
|
2377
|
-
if (comboboxContext.selectionType !== 'multiple') {
|
|
2378
|
-
handleClose();
|
|
2379
|
-
}
|
|
2380
|
-
/** Call parent onSelect callback */
|
|
2381
|
-
if (onSelect) {
|
|
2382
|
-
onSelect(option);
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
/** If the option itself has a custom action, also call it */
|
|
2387
|
-
if (option?.onSelect) {
|
|
2388
|
-
option.onSelect(option, source);
|
|
2389
|
-
}
|
|
2390
|
-
|
|
2391
|
-
/** Reset focus on input */
|
|
2392
|
-
if (triggerRef?.current) {
|
|
2393
|
-
triggerRef.current?.focus();
|
|
2394
|
-
}
|
|
2395
|
-
}, [comboboxContext.selectionType, handleClose, onSelect, triggerRef]);
|
|
2396
|
-
|
|
2397
|
-
/** Callback for when the input must be updated */
|
|
2398
|
-
const handleInputChange = React__default.useCallback((value, ...args) => {
|
|
2399
|
-
// Update the local state
|
|
2400
|
-
dispatch({
|
|
2401
|
-
type: 'SET_INPUT_VALUE',
|
|
2402
|
-
payload: value
|
|
2403
|
-
});
|
|
2404
|
-
// If a callback if given, call it with the value
|
|
2405
|
-
if (onInputChange) {
|
|
2406
|
-
onInputChange(value, ...args);
|
|
2407
|
-
}
|
|
2408
|
-
// Reset visual focus
|
|
2409
|
-
movingFocusDispatch({
|
|
2410
|
-
type: 'RESET_SELECTED_TAB_STOP'
|
|
2411
|
-
});
|
|
2412
|
-
}, [dispatch, movingFocusDispatch, onInputChange]);
|
|
2413
|
-
|
|
2414
|
-
/**
|
|
2415
|
-
* Open the popover
|
|
2416
|
-
*
|
|
2417
|
-
* @returns a promise with the updated context once all options are mounted
|
|
2418
|
-
*/
|
|
2419
|
-
const handleOpen = React__default.useCallback(params => {
|
|
2420
|
-
/** update the local state */
|
|
2421
|
-
dispatch({
|
|
2422
|
-
type: 'OPEN_COMBOBOX',
|
|
2423
|
-
payload: params
|
|
2424
|
-
});
|
|
2425
|
-
/** If a parent callback was given, trigger it with state information */
|
|
2426
|
-
if (onOpen) {
|
|
2427
|
-
onOpen({
|
|
2428
|
-
currentValue: inputValue,
|
|
2429
|
-
manual: Boolean(params?.manual)
|
|
2430
|
-
});
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
|
-
// Promise resolving options on mount
|
|
2434
|
-
return new Promise(resolve => {
|
|
2435
|
-
// Append to the list of callback on options mounted
|
|
2436
|
-
setOptionsMountedCallback((callbacks = []) => {
|
|
2437
|
-
callbacks.push(resolve);
|
|
2438
|
-
return callbacks;
|
|
2439
|
-
});
|
|
2440
|
-
});
|
|
2441
|
-
}, [dispatch, inputValue, onOpen]);
|
|
2442
|
-
return React__default.useMemo(() => ({
|
|
2443
|
-
handleClose,
|
|
2444
|
-
handleOpen,
|
|
2445
|
-
handleInputChange,
|
|
2446
|
-
handleSelected,
|
|
2447
|
-
dispatch,
|
|
2448
|
-
inputValue,
|
|
2449
|
-
...contextValues
|
|
2450
|
-
}), [contextValues, dispatch, handleClose, handleInputChange, handleOpen, handleSelected, inputValue]);
|
|
2451
|
-
};
|
|
2452
|
-
|
|
2453
|
-
/** Retrieve the current combobox section id */
|
|
2454
|
-
const useComboboxSectionId = () => {
|
|
2455
|
-
return useContext(SectionContext);
|
|
2456
|
-
};
|
|
2457
|
-
|
|
2458
|
-
/**
|
|
2459
|
-
* Register the given option to the context
|
|
2460
|
-
*/
|
|
2461
|
-
const useRegisterOption = (registerId, option, shouldRegister) => {
|
|
2462
|
-
const {
|
|
2463
|
-
dispatch
|
|
2464
|
-
} = useCombobox();
|
|
2465
|
-
|
|
2466
|
-
/** Register the given options */
|
|
2467
|
-
React__default.useEffect(() => {
|
|
2468
|
-
if (option && shouldRegister) {
|
|
2469
|
-
dispatch({
|
|
2470
|
-
type: 'ADD_OPTION',
|
|
2471
|
-
payload: {
|
|
2472
|
-
id: registerId,
|
|
2473
|
-
option
|
|
2474
|
-
}
|
|
2475
|
-
});
|
|
2476
|
-
}
|
|
2477
|
-
|
|
2478
|
-
// Unregister ids if/when the component unmounts or if option changes
|
|
2479
|
-
return () => {
|
|
2480
|
-
if (option) {
|
|
2481
|
-
dispatch({
|
|
2482
|
-
type: 'REMOVE_OPTION',
|
|
2483
|
-
payload: {
|
|
2484
|
-
id: registerId
|
|
2485
|
-
}
|
|
2486
|
-
});
|
|
2487
|
-
}
|
|
2488
|
-
};
|
|
2489
|
-
}, [dispatch, option, registerId, shouldRegister]);
|
|
2490
|
-
};
|
|
2491
|
-
|
|
2492
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
2493
|
-
const COMBOBOX_OPTION_CLASSNAME = 'lumx-combobox-option';
|
|
2494
|
-
const LUMX_CLASSNAME = 'lumx-list-item';
|
|
2495
|
-
const {
|
|
2496
|
-
block: block$Y,
|
|
2497
|
-
element: element$K
|
|
2498
|
-
} = classNames.bem(COMBOBOX_OPTION_CLASSNAME);
|
|
2499
|
-
const lumxListItem = classNames.bem(LUMX_CLASSNAME);
|
|
2500
|
-
|
|
2501
|
-
/**
|
|
2502
|
-
* Content of the option.
|
|
2503
|
-
* This should only be rendered if the option is shown.
|
|
2504
|
-
*/
|
|
2505
|
-
const OptionContent = forwardRef((props, ref) => {
|
|
2506
|
-
const {
|
|
2507
|
-
id,
|
|
2508
|
-
onSelect,
|
|
2509
|
-
isSelected,
|
|
2510
|
-
isDisabled,
|
|
2511
|
-
children,
|
|
2512
|
-
className,
|
|
2513
|
-
before,
|
|
2514
|
-
after,
|
|
2515
|
-
as,
|
|
2516
|
-
size = Size$1.tiny,
|
|
2517
|
-
comboboxType,
|
|
2518
|
-
tooltipProps,
|
|
2519
|
-
description,
|
|
2520
|
-
'aria-hidden': ariaHidden,
|
|
2521
|
-
autofocus,
|
|
2522
|
-
...forwardedProps
|
|
2523
|
-
} = props;
|
|
2524
|
-
const itemRef = React__default.useRef(null);
|
|
2525
|
-
const {
|
|
2526
|
-
state
|
|
2527
|
-
} = React__default.useContext(MovingFocusContext);
|
|
2528
|
-
const {
|
|
2529
|
-
selectedIds
|
|
2530
|
-
} = useCombobox();
|
|
2531
|
-
const hasSelection = selectedIds !== undefined;
|
|
2532
|
-
const isHighlighted = useVirtualFocus(id, itemRef, false, comboboxType === 'grid' ? id : undefined, autofocus);
|
|
2533
|
-
const Element = as || 'span';
|
|
2534
|
-
const ariaSelected = isSelected ? 'true' : 'false';
|
|
2535
|
-
const ariaDescriptionId = description ? `${id}-description` : undefined;
|
|
2536
|
-
const isKeyboardHighlighted = state.isUsingKeyboard && isHighlighted;
|
|
2537
|
-
|
|
2538
|
-
/**
|
|
2539
|
-
* The DS `ListItem` component has a lot of behavior / default props we do not want here.
|
|
2540
|
-
* Notably the before/after items are within the interactive element, which we do not want.
|
|
2541
|
-
* So we use a native li tag.
|
|
2542
|
-
*/
|
|
2543
|
-
return /*#__PURE__*/jsx("li", {
|
|
2544
|
-
className: block$Y(undefined, [className ?? '', lumxListItem.block({
|
|
2545
|
-
[`size-${size}`]: !!size
|
|
2546
|
-
})]),
|
|
2547
|
-
role: "presentation",
|
|
2548
|
-
ref: itemRef,
|
|
2549
|
-
"aria-hidden": ariaHidden,
|
|
2550
|
-
style: {
|
|
2551
|
-
display: ariaHidden ? 'none' : undefined
|
|
2552
|
-
},
|
|
2553
|
-
...forwardedProps,
|
|
2554
|
-
children: /*#__PURE__*/jsxs(GenericBlock, {
|
|
2555
|
-
as: "div",
|
|
2556
|
-
role: comboboxType === 'grid' ? 'row' : 'presentation',
|
|
2557
|
-
className: element$K('content', {
|
|
2558
|
-
// Not using the lumx list item disabled style as it blocks pointer events
|
|
2559
|
-
'is-disabled': !!isDisabled
|
|
2560
|
-
},
|
|
2561
|
-
// TODO: migrate away from using lumx-list-item styles https://lumapps.atlassian.net/browse/DSW-288
|
|
2562
|
-
[lumxListItem.element('link', {
|
|
2563
|
-
'is-selected': Boolean(isSelected),
|
|
2564
|
-
'is-highlighted': Boolean(isHighlighted)
|
|
2565
|
-
})]),
|
|
2566
|
-
"data-focus-visible-added": isKeyboardHighlighted ? 'true' : undefined,
|
|
2567
|
-
children: [before && /*#__PURE__*/jsx(GenericBlock.Figure, {
|
|
2568
|
-
as: "span",
|
|
2569
|
-
role: "presentation",
|
|
2570
|
-
className: element$K('before', undefined, [lumxListItem.element('before')]),
|
|
2571
|
-
children: before
|
|
2572
|
-
}), /*#__PURE__*/jsxs(GenericBlock.Content, {
|
|
2573
|
-
as: "span",
|
|
2574
|
-
role: "presentation",
|
|
2575
|
-
className: lumxListItem.element('content'),
|
|
2576
|
-
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
2577
|
-
forceOpen: isKeyboardHighlighted,
|
|
2578
|
-
closeMode: "hide",
|
|
2579
|
-
...tooltipProps,
|
|
2580
|
-
children: /*#__PURE__*/jsx(Element, {
|
|
2581
|
-
id: id,
|
|
2582
|
-
className: element$K('trigger'),
|
|
2583
|
-
role: comboboxType === 'grid' ? 'gridcell' : 'option',
|
|
2584
|
-
"aria-selected": hasSelection ? ariaSelected : undefined,
|
|
2585
|
-
"aria-disabled": isDisabled,
|
|
2586
|
-
"aria-describedby": ariaDescriptionId,
|
|
2587
|
-
onClick: onSelect
|
|
2588
|
-
// Prevent mouse down to avoid blur before the click is activated
|
|
2589
|
-
,
|
|
2590
|
-
onMouseDown: event => event.preventDefault(),
|
|
2591
|
-
ref: ref,
|
|
2592
|
-
...forwardedProps,
|
|
2593
|
-
children: children
|
|
2594
|
-
})
|
|
2595
|
-
}), description && /*#__PURE__*/jsx(Text, {
|
|
2596
|
-
as: "span",
|
|
2597
|
-
id: ariaDescriptionId,
|
|
2598
|
-
role: "presentation",
|
|
2599
|
-
className: element$K('description'),
|
|
2600
|
-
typography: "caption",
|
|
2601
|
-
color: "dark",
|
|
2602
|
-
colorVariant: "L2",
|
|
2603
|
-
children: description
|
|
2604
|
-
})]
|
|
2605
|
-
}), after && /*#__PURE__*/jsx(GenericBlock.Actions, {
|
|
2606
|
-
as: "span",
|
|
2607
|
-
role: "presentation",
|
|
2608
|
-
className: element$K('after', undefined, [lumxListItem.element('after')]),
|
|
2609
|
-
children: /*#__PURE__*/jsx(ComboboxOptionContextProvider, {
|
|
2610
|
-
optionId: id,
|
|
2611
|
-
isKeyboardHighlighted: isKeyboardHighlighted,
|
|
2612
|
-
children: after
|
|
2613
|
-
})
|
|
2614
|
-
})]
|
|
2615
|
-
})
|
|
2616
|
-
});
|
|
2617
|
-
});
|
|
2618
|
-
|
|
2619
|
-
/**
|
|
2620
|
-
* Props for ComboboxOption with additional generic properties.
|
|
2621
|
-
*/
|
|
2622
|
-
|
|
2623
|
-
/**
|
|
2624
|
-
* Option to set within a combobox list.
|
|
2625
|
-
*
|
|
2626
|
-
* @family Combobox
|
|
2627
|
-
* @param ComboboxOptionProps
|
|
2628
|
-
* @returns ComboboxOption
|
|
2629
|
-
*/
|
|
2630
|
-
const ComboboxOption = forwardRef((props, ref) => {
|
|
2631
|
-
const {
|
|
2632
|
-
children,
|
|
2633
|
-
id,
|
|
2634
|
-
textValue,
|
|
2635
|
-
data,
|
|
2636
|
-
filterFromInput = true,
|
|
2637
|
-
onSelect: onOptionSelect,
|
|
2638
|
-
isDisabled,
|
|
2639
|
-
as = 'span',
|
|
2640
|
-
...optionProps
|
|
2641
|
-
} = props;
|
|
2642
|
-
|
|
2643
|
-
// Get the id of the current group, if any.
|
|
2644
|
-
const section = useComboboxSectionId();
|
|
2645
|
-
const {
|
|
2646
|
-
comboboxId,
|
|
2647
|
-
selectedIds,
|
|
2648
|
-
showAll,
|
|
2649
|
-
inputValue,
|
|
2650
|
-
handleSelected,
|
|
2651
|
-
type
|
|
2652
|
-
} = useCombobox();
|
|
2653
|
-
// Generate a unique id for this option.
|
|
2654
|
-
const generatedId = generateOptionId(comboboxId, id);
|
|
2655
|
-
const isSelected = selectedIds?.includes(generatedId);
|
|
2656
|
-
|
|
2657
|
-
// If no text value is set and the direct child is a simple string, use it as value.
|
|
2658
|
-
const isStringChild = typeof children === 'string' || typeof children === 'number';
|
|
2659
|
-
const value = children && !textValue && isStringChild ? children.toString() : textValue;
|
|
2660
|
-
const showOption = !filterFromInput || showAll || value?.toString()?.toLowerCase().includes(inputValue?.toLowerCase());
|
|
2661
|
-
const registeredOption = React__default.useMemo(() => ({
|
|
2662
|
-
id,
|
|
2663
|
-
generatedId,
|
|
2664
|
-
textValue: value,
|
|
2665
|
-
data,
|
|
2666
|
-
filter: filterFromInput,
|
|
2667
|
-
isDisabled: isDisabled || !showOption,
|
|
2668
|
-
sectionId: section.sectionId,
|
|
2669
|
-
onSelect: onOptionSelect
|
|
2670
|
-
}), [data, filterFromInput, generatedId, section.sectionId, id, isDisabled, onOptionSelect, showOption, value]);
|
|
2671
|
-
|
|
2672
|
-
// Register the option
|
|
2673
|
-
useRegisterOption(generatedId, registeredOption, showOption);
|
|
2674
|
-
const handleSelect = React__default.useCallback(() => handleSelected(registeredOption, 'click'), [handleSelected, registeredOption]);
|
|
2675
|
-
if (!id || !showOption) {
|
|
2676
|
-
return null;
|
|
2677
|
-
}
|
|
2678
|
-
return /*#__PURE__*/jsx(OptionContent, {
|
|
2679
|
-
id: generatedId,
|
|
2680
|
-
onSelect: handleSelect,
|
|
2681
|
-
isSelected: isSelected,
|
|
2682
|
-
isDisabled: isDisabled,
|
|
2683
|
-
as: as,
|
|
2684
|
-
ref: ref,
|
|
2685
|
-
comboboxType: type,
|
|
2686
|
-
"aria-hidden": section.isLoading,
|
|
2687
|
-
...optionProps,
|
|
2688
|
-
children: children || textValue
|
|
2689
|
-
});
|
|
2690
|
-
});
|
|
2691
|
-
|
|
2692
|
-
// Default widths the skeletons must have
|
|
2693
|
-
const defaultWidths = [REAL_SIZE_FOR_LUMX_SIZE.xxl, REAL_SIZE_FOR_LUMX_SIZE.xl, REAL_SIZE_FOR_LUMX_SIZE.l];
|
|
2694
|
-
const {
|
|
2695
|
-
block: block$X,
|
|
2696
|
-
element: element$J
|
|
2697
|
-
} = classNames.bem(COMBOBOX_OPTION_CLASSNAME);
|
|
2698
|
-
|
|
2699
|
-
/**
|
|
2700
|
-
* Skeleton for a combobox option.
|
|
2701
|
-
* A typography skeleton is rendered by default but can be overridden by passing children.
|
|
2702
|
-
*/
|
|
2703
|
-
const ComboboxOptionSkeleton = ({
|
|
2704
|
-
className,
|
|
2705
|
-
index,
|
|
2706
|
-
before,
|
|
2707
|
-
after,
|
|
2708
|
-
size = Size$1.tiny,
|
|
2709
|
-
children
|
|
2710
|
-
}) => {
|
|
2711
|
-
const renderedChildren = typeof children === 'function' ? children({
|
|
2712
|
-
index
|
|
2713
|
-
}) : children;
|
|
2714
|
-
const content = renderedChildren || /*#__PURE__*/jsx(SkeletonTypography, {
|
|
2715
|
-
typography: "body1",
|
|
2716
|
-
width: index !== undefined && defaultWidths[index] ? defaultWidths[index] : REAL_SIZE_FOR_LUMX_SIZE.xl
|
|
2717
|
-
});
|
|
2718
|
-
return /*#__PURE__*/jsxs("li", {
|
|
2719
|
-
role: "presentation",
|
|
2720
|
-
className: block$X({
|
|
2721
|
-
skeleton: true
|
|
2722
|
-
}, ['lumx-list-item', `lumx-list-item--size-${size}`, className]),
|
|
2723
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
2724
|
-
role: "presentation",
|
|
2725
|
-
className: element$J('content', ['lumx-list-item__wrapper']),
|
|
2726
|
-
children: [before && /*#__PURE__*/jsx(Text, {
|
|
2727
|
-
as: "span",
|
|
2728
|
-
role: "presentation",
|
|
2729
|
-
className: element$J('before', ['lumx-list-item__before']),
|
|
2730
|
-
children: before
|
|
2731
|
-
}), content]
|
|
2732
|
-
}), after && /*#__PURE__*/jsx("div", {
|
|
2733
|
-
role: "presentation",
|
|
2734
|
-
className: element$J('after', ['lumx-list-item__after']),
|
|
2735
|
-
children: after
|
|
2736
|
-
})]
|
|
2737
|
-
});
|
|
2738
|
-
};
|
|
2739
|
-
|
|
2740
|
-
/**
|
|
2741
|
-
* Action to set on a Combobox Option.
|
|
2742
|
-
* Allows to add an interactive element that
|
|
2743
|
-
* can be navigated to and triggered using the keyboard.
|
|
2744
|
-
*
|
|
2745
|
-
* Defaults as "button"
|
|
2746
|
-
*
|
|
2747
|
-
* @family Combobox
|
|
2748
|
-
* @param ComboboxOptionActionProps
|
|
2749
|
-
* @returns ComboboxOptionAction
|
|
2750
|
-
*/
|
|
2751
|
-
const ComboboxOptionAction = props => {
|
|
2752
|
-
const {
|
|
2753
|
-
as,
|
|
2754
|
-
isDisabled,
|
|
2755
|
-
onClick,
|
|
2756
|
-
id: originalId,
|
|
2757
|
-
...forwardedProps
|
|
2758
|
-
} = props;
|
|
2759
|
-
const {
|
|
2760
|
-
optionId
|
|
2761
|
-
} = useComboboxOptionContext();
|
|
2762
|
-
const {
|
|
2763
|
-
triggerRef
|
|
2764
|
-
} = useComboboxRefs();
|
|
2765
|
-
const itemRef = React__default.useRef(null);
|
|
2766
|
-
const generatedId = useId();
|
|
2767
|
-
const id = originalId || generatedId;
|
|
2768
|
-
const isHighlighted = useVirtualFocus(id, itemRef, isDisabled, optionId);
|
|
2769
|
-
const {
|
|
2770
|
-
state
|
|
2771
|
-
} = React__default.useContext(MovingFocusContext);
|
|
2772
|
-
const Component = as || 'button';
|
|
2773
|
-
const registeredActionOption = React__default.useMemo(() => ({
|
|
2774
|
-
id,
|
|
2775
|
-
generatedId: id,
|
|
2776
|
-
isAction: true,
|
|
2777
|
-
isDisabled,
|
|
2778
|
-
onSelect: () => {
|
|
2779
|
-
itemRef.current?.click();
|
|
2780
|
-
}
|
|
2781
|
-
}), [id, isDisabled]);
|
|
2782
|
-
|
|
2783
|
-
// Register the option
|
|
2784
|
-
useRegisterOption(id, registeredActionOption, !isDisabled);
|
|
2785
|
-
const handleActionClick = React__default.useCallback(() => {
|
|
2786
|
-
if (onClick) {
|
|
2787
|
-
onClick();
|
|
2788
|
-
}
|
|
2789
|
-
if (triggerRef?.current) {
|
|
2790
|
-
triggerRef.current?.focus();
|
|
2791
|
-
}
|
|
2792
|
-
}, [triggerRef, onClick]);
|
|
2793
|
-
return /*#__PURE__*/jsx(Component, {
|
|
2794
|
-
...forwardedProps,
|
|
2795
|
-
isDisabled: isDisabled,
|
|
2796
|
-
id: id,
|
|
2797
|
-
role: "gridcell",
|
|
2798
|
-
ref: itemRef,
|
|
2799
|
-
"data-focus-visible-added": state.isUsingKeyboard && isHighlighted ? 'true' : undefined,
|
|
2800
|
-
"aria-disabled": isDisabled,
|
|
2801
|
-
onClick: handleActionClick
|
|
2802
|
-
});
|
|
2803
|
-
};
|
|
2804
|
-
|
|
2805
|
-
const useBooleanState = defaultValue => {
|
|
2806
|
-
const [booleanValue, setBoolean] = useState(defaultValue);
|
|
2807
|
-
const setToFalse = useCallback(() => setBoolean(false), []);
|
|
2808
|
-
const setToTrue = useCallback(() => setBoolean(true), []);
|
|
2809
|
-
const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
|
|
2810
|
-
return [booleanValue, setToFalse, setToTrue, toggleBoolean];
|
|
2811
|
-
};
|
|
2812
|
-
|
|
2813
|
-
const CLASSNAME$14 = 'lumx-combobox-option-more-info';
|
|
2814
|
-
const {
|
|
2815
|
-
block: block$W,
|
|
2816
|
-
element: element$I
|
|
2817
|
-
} = classNames.bem(CLASSNAME$14);
|
|
2818
|
-
|
|
2819
|
-
/**
|
|
2820
|
-
* Display more info on the option as a popover opening on mouse hover or keyboard nav
|
|
2821
|
-
* Please consider using a simpler option description instead for better UX and a11y.
|
|
2822
|
-
*
|
|
2823
|
-
* @family Combobox
|
|
2824
|
-
*/
|
|
2825
|
-
const ComboboxOptionMoreInfo = ({
|
|
2826
|
-
buttonProps,
|
|
2827
|
-
popoverProps,
|
|
2828
|
-
onToggle,
|
|
2829
|
-
children
|
|
2830
|
-
}) => {
|
|
2831
|
-
const ref = React__default.useRef(null);
|
|
2832
|
-
const [isHovered,, onMouseLeave, onMouseEnter] = useBooleanState(false);
|
|
2833
|
-
const comboboxOption = useComboboxOptionContext();
|
|
2834
|
-
|
|
2835
|
-
// Open on mouse hover or key nav
|
|
2836
|
-
const isOpen = isHovered || comboboxOption.isKeyboardHighlighted;
|
|
2837
|
-
React__default.useEffect(() => {
|
|
2838
|
-
onToggle?.(isOpen);
|
|
2839
|
-
}, [isOpen, onToggle]);
|
|
2840
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
2841
|
-
children: [/*#__PURE__*/jsx(IconButton, {
|
|
2842
|
-
...buttonProps,
|
|
2843
|
-
ref: ref,
|
|
2844
|
-
className: block$W([buttonProps?.className]),
|
|
2845
|
-
icon: mdiInformationOutline,
|
|
2846
|
-
size: "s",
|
|
2847
|
-
emphasis: "low",
|
|
2848
|
-
onMouseEnter: onMouseEnter,
|
|
2849
|
-
onMouseLeave: onMouseLeave
|
|
2850
|
-
// Button actually plays no role here other than a target for the mouse hover
|
|
2851
|
-
// Keyboard accessibility is handled via combobox keyboard highlighting
|
|
2852
|
-
,
|
|
2853
|
-
"aria-hidden": true,
|
|
2854
|
-
label: ""
|
|
2855
|
-
}), /*#__PURE__*/jsx(Popover, {
|
|
2856
|
-
...popoverProps,
|
|
2857
|
-
className: element$I('popover', [popoverProps?.className]),
|
|
2858
|
-
anchorRef: ref,
|
|
2859
|
-
isOpen: isOpen,
|
|
2860
|
-
closeOnEscape: true,
|
|
2861
|
-
closeOnClickAway: true,
|
|
2862
|
-
placement: "bottom-start",
|
|
2863
|
-
children: children
|
|
2864
|
-
}), /*#__PURE__*/jsx(A11YLiveMessage, {
|
|
2865
|
-
hidden: true,
|
|
2866
|
-
children: isOpen ? children : undefined
|
|
2867
|
-
})]
|
|
2868
|
-
});
|
|
2869
|
-
};
|
|
2870
|
-
|
|
2871
2223
|
/**
|
|
2872
2224
|
* Comment block variants.
|
|
2873
2225
|
*/
|
|
@@ -2897,7 +2249,7 @@ const {
|
|
|
2897
2249
|
/**
|
|
2898
2250
|
* Component default props.
|
|
2899
2251
|
*/
|
|
2900
|
-
const DEFAULT_PROPS$
|
|
2252
|
+
const DEFAULT_PROPS$Y = {
|
|
2901
2253
|
variant: CommentBlockVariant.indented
|
|
2902
2254
|
};
|
|
2903
2255
|
|
|
@@ -2927,7 +2279,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
2927
2279
|
onMouseLeave,
|
|
2928
2280
|
text,
|
|
2929
2281
|
theme = defaultTheme,
|
|
2930
|
-
variant = DEFAULT_PROPS$
|
|
2282
|
+
variant = DEFAULT_PROPS$Y.variant,
|
|
2931
2283
|
...forwardedProps
|
|
2932
2284
|
} = props;
|
|
2933
2285
|
const hasChildren = Children.count(children) > 0;
|
|
@@ -2996,7 +2348,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
2996
2348
|
});
|
|
2997
2349
|
CommentBlock.displayName = COMPONENT_NAME$15;
|
|
2998
2350
|
CommentBlock.className = CLASSNAME$13;
|
|
2999
|
-
CommentBlock.defaultProps = DEFAULT_PROPS$
|
|
2351
|
+
CommentBlock.defaultProps = DEFAULT_PROPS$Y;
|
|
3000
2352
|
|
|
3001
2353
|
/**
|
|
3002
2354
|
* Add a number of months from a date while resetting the day to prevent month length mismatches.
|
|
@@ -3486,6 +2838,14 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
3486
2838
|
DatePicker.displayName = COMPONENT_NAME$14;
|
|
3487
2839
|
DatePicker.className = CLASSNAME$12;
|
|
3488
2840
|
|
|
2841
|
+
const useBooleanState = defaultValue => {
|
|
2842
|
+
const [booleanValue, setBoolean] = useState(defaultValue);
|
|
2843
|
+
const setToFalse = useCallback(() => setBoolean(false), []);
|
|
2844
|
+
const setToTrue = useCallback(() => setBoolean(true), []);
|
|
2845
|
+
const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
|
|
2846
|
+
return [booleanValue, setToFalse, setToTrue, toggleBoolean];
|
|
2847
|
+
};
|
|
2848
|
+
|
|
3489
2849
|
/**
|
|
3490
2850
|
* Component display name.
|
|
3491
2851
|
*/
|
|
@@ -4093,7 +3453,7 @@ const {
|
|
|
4093
3453
|
/**
|
|
4094
3454
|
* Component default props.
|
|
4095
3455
|
*/
|
|
4096
|
-
const DEFAULT_PROPS$
|
|
3456
|
+
const DEFAULT_PROPS$X = {
|
|
4097
3457
|
size: Size$1.big,
|
|
4098
3458
|
disableBodyScroll: true
|
|
4099
3459
|
};
|
|
@@ -4124,11 +3484,11 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
4124
3484
|
parentElement,
|
|
4125
3485
|
contentRef,
|
|
4126
3486
|
preventAutoClose,
|
|
4127
|
-
size = DEFAULT_PROPS$
|
|
3487
|
+
size = DEFAULT_PROPS$X.size,
|
|
4128
3488
|
zIndex,
|
|
4129
3489
|
dialogProps,
|
|
4130
3490
|
onVisibilityChange,
|
|
4131
|
-
disableBodyScroll = DEFAULT_PROPS$
|
|
3491
|
+
disableBodyScroll = DEFAULT_PROPS$X.disableBodyScroll,
|
|
4132
3492
|
preventCloseOnClick,
|
|
4133
3493
|
preventCloseOnEscape,
|
|
4134
3494
|
...forwardedProps
|
|
@@ -4268,7 +3628,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
4268
3628
|
});
|
|
4269
3629
|
Dialog.displayName = COMPONENT_NAME$11;
|
|
4270
3630
|
Dialog.className = CLASSNAME$11;
|
|
4271
|
-
Dialog.defaultProps = DEFAULT_PROPS$
|
|
3631
|
+
Dialog.defaultProps = DEFAULT_PROPS$X;
|
|
4272
3632
|
|
|
4273
3633
|
/**
|
|
4274
3634
|
* Component display name.
|
|
@@ -4312,7 +3672,7 @@ const Divider$1 = props => {
|
|
|
4312
3672
|
/**
|
|
4313
3673
|
* Component default props.
|
|
4314
3674
|
*/
|
|
4315
|
-
const DEFAULT_PROPS$
|
|
3675
|
+
const DEFAULT_PROPS$W = {};
|
|
4316
3676
|
|
|
4317
3677
|
/**
|
|
4318
3678
|
* Divider component.
|
|
@@ -4335,7 +3695,7 @@ const Divider = forwardRef((props, ref) => {
|
|
|
4335
3695
|
});
|
|
4336
3696
|
Divider.displayName = COMPONENT_NAME$10;
|
|
4337
3697
|
Divider.className = CLASSNAME$10;
|
|
4338
|
-
Divider.defaultProps = DEFAULT_PROPS$
|
|
3698
|
+
Divider.defaultProps = DEFAULT_PROPS$W;
|
|
4339
3699
|
|
|
4340
3700
|
/**
|
|
4341
3701
|
* Component display name.
|
|
@@ -4560,7 +3920,7 @@ const {
|
|
|
4560
3920
|
/**
|
|
4561
3921
|
* Component default props.
|
|
4562
3922
|
*/
|
|
4563
|
-
const DEFAULT_PROPS$
|
|
3923
|
+
const DEFAULT_PROPS$V = {
|
|
4564
3924
|
tabIndex: -1
|
|
4565
3925
|
};
|
|
4566
3926
|
|
|
@@ -4579,7 +3939,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
4579
3939
|
isClickable,
|
|
4580
3940
|
itemPadding,
|
|
4581
3941
|
onListItemSelected,
|
|
4582
|
-
tabIndex = DEFAULT_PROPS$
|
|
3942
|
+
tabIndex = DEFAULT_PROPS$V.tabIndex,
|
|
4583
3943
|
...forwardedProps
|
|
4584
3944
|
} = props;
|
|
4585
3945
|
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
@@ -4595,7 +3955,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
4595
3955
|
});
|
|
4596
3956
|
InternalList.displayName = COMPONENT_NAME$_;
|
|
4597
3957
|
InternalList.className = CLASSNAME$_;
|
|
4598
|
-
InternalList.defaultProps = DEFAULT_PROPS$
|
|
3958
|
+
InternalList.defaultProps = DEFAULT_PROPS$V;
|
|
4599
3959
|
const List = Object.assign(InternalList, {
|
|
4600
3960
|
useKeyboardListNavigation
|
|
4601
3961
|
});
|
|
@@ -7040,7 +6400,7 @@ const {
|
|
|
7040
6400
|
/**
|
|
7041
6401
|
* Component default props.
|
|
7042
6402
|
*/
|
|
7043
|
-
const DEFAULT_PROPS$
|
|
6403
|
+
const DEFAULT_PROPS$U = {
|
|
7044
6404
|
elevation: 3,
|
|
7045
6405
|
placement: Placement.AUTO,
|
|
7046
6406
|
focusAnchorOnClose: true,
|
|
@@ -7057,24 +6417,24 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
7057
6417
|
className,
|
|
7058
6418
|
closeOnClickAway,
|
|
7059
6419
|
closeOnEscape,
|
|
7060
|
-
elevation = DEFAULT_PROPS$
|
|
6420
|
+
elevation = DEFAULT_PROPS$U.elevation,
|
|
7061
6421
|
focusElement,
|
|
7062
6422
|
hasArrow,
|
|
7063
6423
|
isOpen,
|
|
7064
6424
|
onClose,
|
|
7065
6425
|
parentElement,
|
|
7066
|
-
usePortal = DEFAULT_PROPS$
|
|
7067
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
6426
|
+
usePortal = DEFAULT_PROPS$U.usePortal,
|
|
6427
|
+
focusAnchorOnClose = DEFAULT_PROPS$U.focusAnchorOnClose,
|
|
7068
6428
|
withFocusTrap,
|
|
7069
6429
|
boundaryRef,
|
|
7070
6430
|
fitToAnchorWidth,
|
|
7071
6431
|
fitWithinViewportHeight,
|
|
7072
6432
|
focusTrapZoneElement,
|
|
7073
6433
|
offset,
|
|
7074
|
-
placement = DEFAULT_PROPS$
|
|
6434
|
+
placement = DEFAULT_PROPS$U.placement,
|
|
7075
6435
|
style,
|
|
7076
6436
|
theme,
|
|
7077
|
-
zIndex = DEFAULT_PROPS$
|
|
6437
|
+
zIndex = DEFAULT_PROPS$U.zIndex,
|
|
7078
6438
|
...forwardedProps
|
|
7079
6439
|
} = props;
|
|
7080
6440
|
const popoverRef = useRef(null);
|
|
@@ -7160,7 +6520,7 @@ const Popover = skipRender(
|
|
|
7160
6520
|
() => Boolean(DOCUMENT), _InnerPopover);
|
|
7161
6521
|
Popover.displayName = COMPONENT_NAME$Z;
|
|
7162
6522
|
Popover.className = CLASSNAME$Z;
|
|
7163
|
-
Popover.defaultProps = DEFAULT_PROPS$
|
|
6523
|
+
Popover.defaultProps = DEFAULT_PROPS$U;
|
|
7164
6524
|
|
|
7165
6525
|
// The error margin in px we want to have for triggering infinite scroll
|
|
7166
6526
|
const SCROLL_TRIGGER_MARGIN = 5;
|
|
@@ -7220,7 +6580,7 @@ const {
|
|
|
7220
6580
|
/**
|
|
7221
6581
|
* Component default props.
|
|
7222
6582
|
*/
|
|
7223
|
-
const DEFAULT_PROPS$
|
|
6583
|
+
const DEFAULT_PROPS$T = {
|
|
7224
6584
|
closeOnClick: true,
|
|
7225
6585
|
closeOnClickAway: true,
|
|
7226
6586
|
closeOnEscape: true,
|
|
@@ -7243,18 +6603,18 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
7243
6603
|
anchorRef,
|
|
7244
6604
|
children,
|
|
7245
6605
|
className,
|
|
7246
|
-
closeOnClick = DEFAULT_PROPS$
|
|
7247
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
7248
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
7249
|
-
fitToAnchorWidth = DEFAULT_PROPS$
|
|
7250
|
-
fitWithinViewportHeight = DEFAULT_PROPS$
|
|
6606
|
+
closeOnClick = DEFAULT_PROPS$T.closeOnClick,
|
|
6607
|
+
closeOnClickAway = DEFAULT_PROPS$T.closeOnClickAway,
|
|
6608
|
+
closeOnEscape = DEFAULT_PROPS$T.closeOnEscape,
|
|
6609
|
+
fitToAnchorWidth = DEFAULT_PROPS$T.fitToAnchorWidth,
|
|
6610
|
+
fitWithinViewportHeight = DEFAULT_PROPS$T.fitWithinViewportHeight,
|
|
7251
6611
|
isOpen,
|
|
7252
6612
|
offset,
|
|
7253
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
6613
|
+
focusAnchorOnClose = DEFAULT_PROPS$T.focusAnchorOnClose,
|
|
7254
6614
|
onClose,
|
|
7255
6615
|
onInfiniteScroll,
|
|
7256
|
-
placement = DEFAULT_PROPS$
|
|
7257
|
-
shouldFocusOnOpen = DEFAULT_PROPS$
|
|
6616
|
+
placement = DEFAULT_PROPS$T.placement,
|
|
6617
|
+
shouldFocusOnOpen = DEFAULT_PROPS$T.shouldFocusOnOpen,
|
|
7258
6618
|
zIndex,
|
|
7259
6619
|
...forwardedProps
|
|
7260
6620
|
} = props;
|
|
@@ -7300,7 +6660,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
7300
6660
|
});
|
|
7301
6661
|
Dropdown.displayName = COMPONENT_NAME$Y;
|
|
7302
6662
|
Dropdown.className = CLASSNAME$Y;
|
|
7303
|
-
Dropdown.defaultProps = DEFAULT_PROPS$
|
|
6663
|
+
Dropdown.defaultProps = DEFAULT_PROPS$T;
|
|
7304
6664
|
|
|
7305
6665
|
/**
|
|
7306
6666
|
* Component display name.
|
|
@@ -7319,7 +6679,7 @@ const {
|
|
|
7319
6679
|
/**
|
|
7320
6680
|
* Component default props.
|
|
7321
6681
|
*/
|
|
7322
|
-
const DEFAULT_PROPS$
|
|
6682
|
+
const DEFAULT_PROPS$S = {
|
|
7323
6683
|
closeMode: 'unmount'
|
|
7324
6684
|
};
|
|
7325
6685
|
const isDragHandle = isComponent(DragHandle);
|
|
@@ -7337,7 +6697,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
7337
6697
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
7338
6698
|
const {
|
|
7339
6699
|
className,
|
|
7340
|
-
closeMode = DEFAULT_PROPS$
|
|
6700
|
+
closeMode = DEFAULT_PROPS$S.closeMode,
|
|
7341
6701
|
children: anyChildren,
|
|
7342
6702
|
hasBackground,
|
|
7343
6703
|
hasHeaderDivider,
|
|
@@ -7454,11 +6814,11 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
7454
6814
|
});
|
|
7455
6815
|
ExpansionPanel.displayName = COMPONENT_NAME$X;
|
|
7456
6816
|
ExpansionPanel.className = CLASSNAME$X;
|
|
7457
|
-
ExpansionPanel.defaultProps = DEFAULT_PROPS$
|
|
6817
|
+
ExpansionPanel.defaultProps = DEFAULT_PROPS$S;
|
|
7458
6818
|
|
|
7459
6819
|
const COMPONENT_NAME$W = 'Flag';
|
|
7460
6820
|
const CLASSNAME$W = 'lumx-flag';
|
|
7461
|
-
const DEFAULT_PROPS$
|
|
6821
|
+
const DEFAULT_PROPS$R = {};
|
|
7462
6822
|
const {
|
|
7463
6823
|
block: block$N,
|
|
7464
6824
|
element: element$B
|
|
@@ -7522,7 +6882,7 @@ const Flag = forwardRef((props, ref) => {
|
|
|
7522
6882
|
});
|
|
7523
6883
|
Flag.displayName = COMPONENT_NAME$W;
|
|
7524
6884
|
Flag.className = CLASSNAME$W;
|
|
7525
|
-
Flag.defaultProps = DEFAULT_PROPS$
|
|
6885
|
+
Flag.defaultProps = DEFAULT_PROPS$R;
|
|
7526
6886
|
|
|
7527
6887
|
/**
|
|
7528
6888
|
* Defines the props of the component.
|
|
@@ -7615,7 +6975,7 @@ const {
|
|
|
7615
6975
|
/**
|
|
7616
6976
|
* Component default props.
|
|
7617
6977
|
*/
|
|
7618
|
-
const DEFAULT_PROPS$
|
|
6978
|
+
const DEFAULT_PROPS$Q = {
|
|
7619
6979
|
gap: Size$1.big,
|
|
7620
6980
|
orientation: Orientation$1.horizontal
|
|
7621
6981
|
};
|
|
@@ -7645,8 +7005,8 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
7645
7005
|
children,
|
|
7646
7006
|
actions,
|
|
7647
7007
|
actionsProps,
|
|
7648
|
-
gap = DEFAULT_PROPS$
|
|
7649
|
-
orientation = DEFAULT_PROPS$
|
|
7008
|
+
gap = DEFAULT_PROPS$Q.gap,
|
|
7009
|
+
orientation = DEFAULT_PROPS$Q.orientation,
|
|
7650
7010
|
contentProps,
|
|
7651
7011
|
...forwardedProps
|
|
7652
7012
|
} = props;
|
|
@@ -7700,7 +7060,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
7700
7060
|
});
|
|
7701
7061
|
BaseGenericBlock.displayName = COMPONENT_NAME$U;
|
|
7702
7062
|
BaseGenericBlock.className = CLASSNAME$U;
|
|
7703
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS$
|
|
7063
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS$Q;
|
|
7704
7064
|
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
7705
7065
|
Figure,
|
|
7706
7066
|
Content,
|
|
@@ -7748,7 +7108,7 @@ const CLASSNAME$T = 'lumx-heading';
|
|
|
7748
7108
|
/**
|
|
7749
7109
|
* Component default props.
|
|
7750
7110
|
*/
|
|
7751
|
-
const DEFAULT_PROPS$
|
|
7111
|
+
const DEFAULT_PROPS$P = {};
|
|
7752
7112
|
|
|
7753
7113
|
/**
|
|
7754
7114
|
* Get Heading component common props
|
|
@@ -7849,7 +7209,7 @@ const {
|
|
|
7849
7209
|
/**
|
|
7850
7210
|
* Component default props.
|
|
7851
7211
|
*/
|
|
7852
|
-
const DEFAULT_PROPS$
|
|
7212
|
+
const DEFAULT_PROPS$O = {};
|
|
7853
7213
|
|
|
7854
7214
|
/**
|
|
7855
7215
|
* Text component common props
|
|
@@ -7936,7 +7296,7 @@ const Text = forwardRef((props, ref) => {
|
|
|
7936
7296
|
});
|
|
7937
7297
|
Text.displayName = COMPONENT_NAME$S;
|
|
7938
7298
|
Text.className = CLASSNAME$S;
|
|
7939
|
-
Text.defaultProps = DEFAULT_PROPS$
|
|
7299
|
+
Text.defaultProps = DEFAULT_PROPS$O;
|
|
7940
7300
|
|
|
7941
7301
|
const HeadingLevelContext = /*#__PURE__*/createContext(defaultContext);
|
|
7942
7302
|
|
|
@@ -7973,7 +7333,7 @@ const Heading = forwardRef((props, ref) => {
|
|
|
7973
7333
|
});
|
|
7974
7334
|
Heading.displayName = COMPONENT_NAME$T;
|
|
7975
7335
|
Heading.className = CLASSNAME$T;
|
|
7976
|
-
Heading.defaultProps = DEFAULT_PROPS$
|
|
7336
|
+
Heading.defaultProps = DEFAULT_PROPS$P;
|
|
7977
7337
|
|
|
7978
7338
|
/**
|
|
7979
7339
|
* Computes the next heading level based on the optional prop level or the parent context level.
|
|
@@ -8024,7 +7384,7 @@ const {
|
|
|
8024
7384
|
/**
|
|
8025
7385
|
* Component default props.
|
|
8026
7386
|
*/
|
|
8027
|
-
const DEFAULT_PROPS$
|
|
7387
|
+
const DEFAULT_PROPS$N = {
|
|
8028
7388
|
orientation: Orientation$1.horizontal,
|
|
8029
7389
|
wrap: 'nowrap'
|
|
8030
7390
|
};
|
|
@@ -8042,9 +7402,9 @@ const Grid = forwardRef((props, ref) => {
|
|
|
8042
7402
|
className,
|
|
8043
7403
|
gutter,
|
|
8044
7404
|
hAlign,
|
|
8045
|
-
orientation = DEFAULT_PROPS$
|
|
7405
|
+
orientation = DEFAULT_PROPS$N.orientation,
|
|
8046
7406
|
vAlign,
|
|
8047
|
-
wrap = DEFAULT_PROPS$
|
|
7407
|
+
wrap = DEFAULT_PROPS$N.wrap,
|
|
8048
7408
|
...forwardedProps
|
|
8049
7409
|
} = props;
|
|
8050
7410
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -8062,7 +7422,7 @@ const Grid = forwardRef((props, ref) => {
|
|
|
8062
7422
|
});
|
|
8063
7423
|
Grid.displayName = COMPONENT_NAME$R;
|
|
8064
7424
|
Grid.className = CLASSNAME$R;
|
|
8065
|
-
Grid.defaultProps = DEFAULT_PROPS$
|
|
7425
|
+
Grid.defaultProps = DEFAULT_PROPS$N;
|
|
8066
7426
|
|
|
8067
7427
|
/**
|
|
8068
7428
|
* Component display name.
|
|
@@ -8120,7 +7480,7 @@ const CLASSNAME$P = 'lumx-grid-column';
|
|
|
8120
7480
|
/**
|
|
8121
7481
|
* Component default props.
|
|
8122
7482
|
*/
|
|
8123
|
-
const DEFAULT_PROPS$
|
|
7483
|
+
const DEFAULT_PROPS$M = {};
|
|
8124
7484
|
|
|
8125
7485
|
/**
|
|
8126
7486
|
* The GridColumn is a layout component that can display children in a grid
|
|
@@ -8128,9 +7488,10 @@ const DEFAULT_PROPS$N = {};
|
|
|
8128
7488
|
* with a number of column that reduce when there is not enough space for each item.
|
|
8129
7489
|
*
|
|
8130
7490
|
* @param props Component props.
|
|
8131
|
-
* @
|
|
7491
|
+
* @param ref Component ref.
|
|
7492
|
+
* @return React element.
|
|
8132
7493
|
*/
|
|
8133
|
-
const GridColumn
|
|
7494
|
+
const GridColumn = forwardRef((props, ref) => {
|
|
8134
7495
|
const {
|
|
8135
7496
|
as: Component = 'div',
|
|
8136
7497
|
gap,
|
|
@@ -8139,13 +7500,12 @@ const GridColumn$1 = props => {
|
|
|
8139
7500
|
children,
|
|
8140
7501
|
className,
|
|
8141
7502
|
style = {},
|
|
8142
|
-
ref,
|
|
8143
7503
|
...forwardedProps
|
|
8144
7504
|
} = props;
|
|
8145
7505
|
return /*#__PURE__*/jsx(Component, {
|
|
8146
7506
|
...forwardedProps,
|
|
8147
7507
|
ref: ref,
|
|
8148
|
-
className:
|
|
7508
|
+
className: classNames.join(className, CLASSNAME$P),
|
|
8149
7509
|
style: {
|
|
8150
7510
|
...style,
|
|
8151
7511
|
['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
@@ -8154,36 +7514,6 @@ const GridColumn$1 = props => {
|
|
|
8154
7514
|
},
|
|
8155
7515
|
children: children
|
|
8156
7516
|
});
|
|
8157
|
-
};
|
|
8158
|
-
GridColumn$1.displayName = COMPONENT_NAME$P;
|
|
8159
|
-
GridColumn$1.className = CLASSNAME$P;
|
|
8160
|
-
GridColumn$1.defaultProps = DEFAULT_PROPS$N;
|
|
8161
|
-
|
|
8162
|
-
/**
|
|
8163
|
-
* Defines the props of the component.
|
|
8164
|
-
*/
|
|
8165
|
-
|
|
8166
|
-
// Re-export types for backward compatibility
|
|
8167
|
-
|
|
8168
|
-
/**
|
|
8169
|
-
* Component default props.
|
|
8170
|
-
*/
|
|
8171
|
-
const DEFAULT_PROPS$M = {};
|
|
8172
|
-
|
|
8173
|
-
/**
|
|
8174
|
-
* The GridColumn is a layout component that can display children in a grid
|
|
8175
|
-
* with custom display properties. It also comes with a responsive design,
|
|
8176
|
-
* with a number of column that reduce when there is not enough space for each item.
|
|
8177
|
-
*
|
|
8178
|
-
* @param props Component props.
|
|
8179
|
-
* @param ref Component ref.
|
|
8180
|
-
* @return React element.
|
|
8181
|
-
*/
|
|
8182
|
-
const GridColumn = forwardRef((props, ref) => {
|
|
8183
|
-
return GridColumn$1({
|
|
8184
|
-
ref,
|
|
8185
|
-
...props
|
|
8186
|
-
});
|
|
8187
7517
|
});
|
|
8188
7518
|
GridColumn.displayName = COMPONENT_NAME$P;
|
|
8189
7519
|
GridColumn.className = CLASSNAME$P;
|
|
@@ -15974,5 +15304,5 @@ UserBlock.displayName = COMPONENT_NAME;
|
|
|
15974
15304
|
UserBlock.className = CLASSNAME;
|
|
15975
15305
|
UserBlock.defaultProps = DEFAULT_PROPS;
|
|
15976
15306
|
|
|
15977
|
-
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$
|
|
15307
|
+
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 };
|
|
15978
15308
|
//# sourceMappingURL=index.js.map
|