@lumx/react 4.3.2-alpha.0 → 4.3.2-alpha.10
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/CONTRIBUTING.md +0 -12
- package/_internal/{Ui3KfDoH.js → BcRzrT9Y.js} +35 -2
- package/_internal/BcRzrT9Y.js.map +1 -0
- package/index.d.ts +517 -216
- package/index.js +1604 -765
- package/index.js.map +1 -1
- package/package.json +9 -4
- package/utils/index.js +3 -36
- package/utils/index.js.map +1 -1
- 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, REAL_SIZE_FOR_LUMX_SIZE, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
|
|
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, REAL_SIZE_FOR_LUMX_SIZE, 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, useContext, createContext, useReducer, Children, useLayoutEffect, cloneElement, isValidElement } 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, M as MovingFocusContext, a as useVirtualFocusParent, b as useVirtualFocus, c as MovingFocusProvider, P as Portal, C as ClickAwayProvider } from './_internal/
|
|
19
|
+
import { u as useDisabledStateContext, M as MovingFocusContext, a as useVirtualFocusParent, b as useVirtualFocus, A as A11YLiveMessage, c as MovingFocusProvider, P as Portal, C as ClickAwayProvider } from './_internal/BcRzrT9Y.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';
|
|
@@ -29,10 +28,12 @@ import { mdiCheck } from '@lumx/icons/esm/check';
|
|
|
29
28
|
import { mdiMinus } from '@lumx/icons/esm/minus';
|
|
30
29
|
import { visuallyHidden, bem as bem$1 } from '@lumx/core/js/utils/classNames';
|
|
31
30
|
import noop from 'lodash/noop';
|
|
31
|
+
import uniqueId from 'lodash/uniqueId';
|
|
32
32
|
import debounce$1 from 'lodash/debounce';
|
|
33
33
|
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down';
|
|
34
34
|
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up';
|
|
35
35
|
import castArray from 'lodash/castArray';
|
|
36
|
+
import { mdiInformationOutline } from '@lumx/icons/esm/information-outline';
|
|
36
37
|
import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left';
|
|
37
38
|
import { mdiChevronRight } from '@lumx/icons/esm/chevron-right';
|
|
38
39
|
import { mdiDragVertical } from '@lumx/icons/esm/drag-vertical';
|
|
@@ -55,16 +56,19 @@ import { mdiArrowDown } from '@lumx/icons/esm/arrow-down';
|
|
|
55
56
|
import { mdiArrowUp } from '@lumx/icons/esm/arrow-up';
|
|
56
57
|
import set from 'lodash/set';
|
|
57
58
|
|
|
59
|
+
let i = 0;
|
|
60
|
+
|
|
58
61
|
/**
|
|
59
|
-
* Generate a unique
|
|
60
|
-
* This is similar to, but much simpler than, React's `useId` hook.
|
|
62
|
+
* Generate a unique id (for use in a11y or other id based DOM linking).
|
|
61
63
|
*
|
|
62
|
-
*
|
|
64
|
+
* (Tries to emulate React 18 useId hook, to remove once we upgrade React)
|
|
63
65
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
66
|
+
function useId() {
|
|
67
|
+
return React__default.useMemo(() => {
|
|
68
|
+
i += 1;
|
|
69
|
+
return `:lumx${i}:`;
|
|
70
|
+
}, []);
|
|
71
|
+
}
|
|
68
72
|
|
|
69
73
|
/**
|
|
70
74
|
* React.forwardRef but re-typed to attach some custom metadata on our components.
|
|
@@ -96,20 +100,20 @@ const CONFIG$1 = {
|
|
|
96
100
|
/**
|
|
97
101
|
* Component display name.
|
|
98
102
|
*/
|
|
99
|
-
const COMPONENT_NAME$
|
|
103
|
+
const COMPONENT_NAME$1l = 'AlertDialog';
|
|
100
104
|
|
|
101
105
|
/**
|
|
102
106
|
* Component default class name and class prefix.
|
|
103
107
|
*/
|
|
104
|
-
const CLASSNAME$
|
|
108
|
+
const CLASSNAME$1o = 'lumx-alert-dialog';
|
|
105
109
|
const {
|
|
106
|
-
block: block$
|
|
107
|
-
} = classNames.bem(CLASSNAME$
|
|
110
|
+
block: block$19
|
|
111
|
+
} = classNames.bem(CLASSNAME$1o);
|
|
108
112
|
|
|
109
113
|
/**
|
|
110
114
|
* Component default props.
|
|
111
115
|
*/
|
|
112
|
-
const DEFAULT_PROPS$
|
|
116
|
+
const DEFAULT_PROPS$1b = {
|
|
113
117
|
size: Size$1.tiny,
|
|
114
118
|
kind: Kind$1.info
|
|
115
119
|
};
|
|
@@ -130,8 +134,8 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
130
134
|
className,
|
|
131
135
|
cancelProps,
|
|
132
136
|
confirmProps,
|
|
133
|
-
kind = DEFAULT_PROPS$
|
|
134
|
-
size = DEFAULT_PROPS$
|
|
137
|
+
kind = DEFAULT_PROPS$1b.kind,
|
|
138
|
+
size = DEFAULT_PROPS$1b.size,
|
|
135
139
|
dialogProps,
|
|
136
140
|
children,
|
|
137
141
|
...forwardedProps
|
|
@@ -172,7 +176,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
172
176
|
'aria-describedby': descriptionId,
|
|
173
177
|
...dialogProps
|
|
174
178
|
},
|
|
175
|
-
className: classNames.join(className, block$
|
|
179
|
+
className: classNames.join(className, block$19({
|
|
176
180
|
[`kind-${kind}`]: Boolean(kind)
|
|
177
181
|
})),
|
|
178
182
|
...forwardedProps,
|
|
@@ -217,9 +221,9 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
217
221
|
})]
|
|
218
222
|
});
|
|
219
223
|
});
|
|
220
|
-
AlertDialog.displayName = COMPONENT_NAME$
|
|
221
|
-
AlertDialog.className = CLASSNAME$
|
|
222
|
-
AlertDialog.defaultProps = DEFAULT_PROPS$
|
|
224
|
+
AlertDialog.displayName = COMPONENT_NAME$1l;
|
|
225
|
+
AlertDialog.className = CLASSNAME$1o;
|
|
226
|
+
AlertDialog.defaultProps = DEFAULT_PROPS$1b;
|
|
223
227
|
|
|
224
228
|
/**
|
|
225
229
|
* Hook focusing an element when defined and `focus` boolean `true`.
|
|
@@ -311,17 +315,17 @@ function useDisableStateProps(props) {
|
|
|
311
315
|
/**
|
|
312
316
|
* Component display name.
|
|
313
317
|
*/
|
|
314
|
-
const COMPONENT_NAME$
|
|
318
|
+
const COMPONENT_NAME$1k = 'Autocomplete';
|
|
315
319
|
|
|
316
320
|
/**
|
|
317
321
|
* Component default class name and class prefix.
|
|
318
322
|
*/
|
|
319
|
-
const CLASSNAME$
|
|
323
|
+
const CLASSNAME$1n = 'lumx-autocomplete';
|
|
320
324
|
|
|
321
325
|
/**
|
|
322
326
|
* Component default props.
|
|
323
327
|
*/
|
|
324
|
-
const DEFAULT_PROPS$
|
|
328
|
+
const DEFAULT_PROPS$1a = {
|
|
325
329
|
anchorToInput: false,
|
|
326
330
|
closeOnClick: false,
|
|
327
331
|
closeOnClickAway: true,
|
|
@@ -343,13 +347,13 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
343
347
|
otherProps
|
|
344
348
|
} = useDisableStateProps(props);
|
|
345
349
|
const {
|
|
346
|
-
anchorToInput = DEFAULT_PROPS$
|
|
350
|
+
anchorToInput = DEFAULT_PROPS$1a.anchorToInput,
|
|
347
351
|
children,
|
|
348
352
|
chips,
|
|
349
353
|
className,
|
|
350
|
-
closeOnClick = DEFAULT_PROPS$
|
|
351
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
352
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
354
|
+
closeOnClick = DEFAULT_PROPS$1a.closeOnClick,
|
|
355
|
+
closeOnClickAway = DEFAULT_PROPS$1a.closeOnClickAway,
|
|
356
|
+
closeOnEscape = DEFAULT_PROPS$1a.closeOnEscape,
|
|
353
357
|
error,
|
|
354
358
|
fitToAnchorWidth,
|
|
355
359
|
hasError,
|
|
@@ -370,7 +374,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
370
374
|
onInfiniteScroll,
|
|
371
375
|
placeholder,
|
|
372
376
|
placement,
|
|
373
|
-
shouldFocusOnClose = DEFAULT_PROPS$
|
|
377
|
+
shouldFocusOnClose = DEFAULT_PROPS$1a.shouldFocusOnClose,
|
|
374
378
|
theme = defaultTheme,
|
|
375
379
|
value,
|
|
376
380
|
textFieldProps = {},
|
|
@@ -383,7 +387,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
383
387
|
return /*#__PURE__*/jsxs("div", {
|
|
384
388
|
ref: ref,
|
|
385
389
|
...forwardedProps,
|
|
386
|
-
className: classNames.join(className, CLASSNAME$
|
|
390
|
+
className: classNames.join(className, CLASSNAME$1n),
|
|
387
391
|
children: [/*#__PURE__*/jsx(TextField, {
|
|
388
392
|
...textFieldProps,
|
|
389
393
|
chips: chips,
|
|
@@ -423,24 +427,24 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
423
427
|
})]
|
|
424
428
|
});
|
|
425
429
|
});
|
|
426
|
-
Autocomplete.displayName = COMPONENT_NAME$
|
|
427
|
-
Autocomplete.className = CLASSNAME$
|
|
428
|
-
Autocomplete.defaultProps = DEFAULT_PROPS$
|
|
430
|
+
Autocomplete.displayName = COMPONENT_NAME$1k;
|
|
431
|
+
Autocomplete.className = CLASSNAME$1n;
|
|
432
|
+
Autocomplete.defaultProps = DEFAULT_PROPS$1a;
|
|
429
433
|
|
|
430
434
|
/**
|
|
431
435
|
* Component display name.
|
|
432
436
|
*/
|
|
433
|
-
const COMPONENT_NAME$
|
|
437
|
+
const COMPONENT_NAME$1j = 'AutocompleteMultiple';
|
|
434
438
|
|
|
435
439
|
/**
|
|
436
440
|
* Component default class name and class prefix.
|
|
437
441
|
*/
|
|
438
|
-
const CLASSNAME$
|
|
442
|
+
const CLASSNAME$1m = 'lumx-autocomplete-multiple';
|
|
439
443
|
|
|
440
444
|
/**
|
|
441
445
|
* Component default props.
|
|
442
446
|
*/
|
|
443
|
-
const DEFAULT_PROPS$
|
|
447
|
+
const DEFAULT_PROPS$19 = {
|
|
444
448
|
closeOnClickAway: true,
|
|
445
449
|
closeOnEscape: true,
|
|
446
450
|
selectedChipRender(choice, index, onClear, isDisabled) {
|
|
@@ -480,8 +484,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
480
484
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
481
485
|
chipsAlignment,
|
|
482
486
|
className,
|
|
483
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
484
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
487
|
+
closeOnClickAway = DEFAULT_PROPS$19.closeOnClickAway,
|
|
488
|
+
closeOnEscape = DEFAULT_PROPS$19.closeOnEscape,
|
|
485
489
|
fitToAnchorWidth,
|
|
486
490
|
hasError,
|
|
487
491
|
helper,
|
|
@@ -503,19 +507,19 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
503
507
|
onKeyDown,
|
|
504
508
|
placeholder,
|
|
505
509
|
placement,
|
|
506
|
-
selectedChipRender = DEFAULT_PROPS$
|
|
510
|
+
selectedChipRender = DEFAULT_PROPS$19.selectedChipRender,
|
|
507
511
|
shouldFocusOnClose,
|
|
508
512
|
theme = defaultTheme,
|
|
509
513
|
type,
|
|
510
514
|
value,
|
|
511
|
-
values = DEFAULT_PROPS$
|
|
515
|
+
values = DEFAULT_PROPS$19.values,
|
|
512
516
|
...forwardedProps
|
|
513
517
|
} = otherProps;
|
|
514
518
|
return /*#__PURE__*/jsx(Autocomplete, {
|
|
515
519
|
ref: ref,
|
|
516
520
|
...forwardedProps,
|
|
517
521
|
anchorToInput: anchorToInput,
|
|
518
|
-
className: classNames.join(className, CLASSNAME$
|
|
522
|
+
className: classNames.join(className, CLASSNAME$1m),
|
|
519
523
|
name: name,
|
|
520
524
|
value: value,
|
|
521
525
|
onChange: onChange,
|
|
@@ -548,28 +552,28 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
548
552
|
children: children
|
|
549
553
|
});
|
|
550
554
|
});
|
|
551
|
-
AutocompleteMultiple.displayName = COMPONENT_NAME$
|
|
552
|
-
AutocompleteMultiple.className = CLASSNAME$
|
|
553
|
-
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$
|
|
555
|
+
AutocompleteMultiple.displayName = COMPONENT_NAME$1j;
|
|
556
|
+
AutocompleteMultiple.className = CLASSNAME$1m;
|
|
557
|
+
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$19;
|
|
554
558
|
|
|
555
559
|
/**
|
|
556
560
|
* Component display name.
|
|
557
561
|
*/
|
|
558
|
-
const COMPONENT_NAME$
|
|
562
|
+
const COMPONENT_NAME$1i = 'Avatar';
|
|
559
563
|
|
|
560
564
|
/**
|
|
561
565
|
* Component default class name and class prefix.
|
|
562
566
|
*/
|
|
563
|
-
const CLASSNAME$
|
|
567
|
+
const CLASSNAME$1l = 'lumx-avatar';
|
|
564
568
|
const {
|
|
565
|
-
block: block$
|
|
566
|
-
element: element$
|
|
567
|
-
} = classNames.bem(CLASSNAME$
|
|
569
|
+
block: block$18,
|
|
570
|
+
element: element$S
|
|
571
|
+
} = classNames.bem(CLASSNAME$1l);
|
|
568
572
|
|
|
569
573
|
/**
|
|
570
574
|
* Component default props.
|
|
571
575
|
*/
|
|
572
|
-
const DEFAULT_PROPS$
|
|
576
|
+
const DEFAULT_PROPS$18 = {
|
|
573
577
|
size: Size$1.m
|
|
574
578
|
};
|
|
575
579
|
|
|
@@ -592,7 +596,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
592
596
|
linkAs,
|
|
593
597
|
onClick,
|
|
594
598
|
onKeyPress,
|
|
595
|
-
size = DEFAULT_PROPS$
|
|
599
|
+
size = DEFAULT_PROPS$18.size,
|
|
596
600
|
theme = defaultTheme,
|
|
597
601
|
thumbnailProps,
|
|
598
602
|
...forwardedProps
|
|
@@ -600,109 +604,34 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
600
604
|
return /*#__PURE__*/jsxs("div", {
|
|
601
605
|
ref: ref,
|
|
602
606
|
...forwardedProps,
|
|
603
|
-
className: classNames.join(className, block$
|
|
607
|
+
className: classNames.join(className, block$18({
|
|
604
608
|
[`size-${size}`]: Boolean(size),
|
|
605
609
|
[`theme-${theme}`]: Boolean(theme)
|
|
606
610
|
})),
|
|
607
611
|
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
608
612
|
linkProps: linkProps,
|
|
609
613
|
linkAs: linkAs,
|
|
610
|
-
className: element$
|
|
614
|
+
className: element$S('thumbnail'),
|
|
611
615
|
onClick: onClick,
|
|
612
616
|
onKeyPress: onKeyPress,
|
|
613
617
|
...thumbnailProps,
|
|
614
|
-
aspectRatio: AspectRatio.square,
|
|
618
|
+
aspectRatio: AspectRatio$1.square,
|
|
615
619
|
size: size,
|
|
616
620
|
image: image,
|
|
617
621
|
alt: alt,
|
|
618
622
|
theme: theme
|
|
619
623
|
}), actions && /*#__PURE__*/jsx("div", {
|
|
620
|
-
className: element$
|
|
624
|
+
className: element$S('actions'),
|
|
621
625
|
children: actions
|
|
622
626
|
}), badge && /*#__PURE__*/jsx("div", {
|
|
623
|
-
className: element$
|
|
624
|
-
children: badge
|
|
625
|
-
})]
|
|
626
|
-
});
|
|
627
|
-
});
|
|
628
|
-
Avatar.displayName = COMPONENT_NAME$1h;
|
|
629
|
-
Avatar.className = CLASSNAME$1j;
|
|
630
|
-
Avatar.defaultProps = DEFAULT_PROPS$13;
|
|
631
|
-
|
|
632
|
-
/**
|
|
633
|
-
* Component display name.
|
|
634
|
-
*/
|
|
635
|
-
const COMPONENT_NAME$1g = 'Badge';
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* Component default class name and class prefix.
|
|
639
|
-
*/
|
|
640
|
-
const CLASSNAME$1i = 'lumx-badge';
|
|
641
|
-
const {
|
|
642
|
-
block: block$16
|
|
643
|
-
} = classNames.bem(CLASSNAME$1i);
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* Component default props.
|
|
647
|
-
*/
|
|
648
|
-
const DEFAULT_PROPS$12 = {
|
|
649
|
-
color: ColorPalette$1.primary
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* Badge component.
|
|
654
|
-
*
|
|
655
|
-
* @param props Component props.
|
|
656
|
-
* @param ref Component ref.
|
|
657
|
-
* @return React element.
|
|
658
|
-
*/
|
|
659
|
-
const Badge = forwardRef((props, ref) => {
|
|
660
|
-
const {
|
|
661
|
-
children,
|
|
662
|
-
className,
|
|
663
|
-
color = DEFAULT_PROPS$12.color,
|
|
664
|
-
...forwardedProps
|
|
665
|
-
} = props;
|
|
666
|
-
return /*#__PURE__*/jsx("div", {
|
|
667
|
-
ref: ref,
|
|
668
|
-
...forwardedProps,
|
|
669
|
-
className: classNames.join(className, block$16({
|
|
670
|
-
[`color-${color}`]: Boolean(color)
|
|
671
|
-
})),
|
|
672
|
-
children: children
|
|
673
|
-
});
|
|
674
|
-
});
|
|
675
|
-
Badge.displayName = COMPONENT_NAME$1g;
|
|
676
|
-
Badge.className = CLASSNAME$1i;
|
|
677
|
-
Badge.defaultProps = DEFAULT_PROPS$12;
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* Component default class name and class prefix.
|
|
681
|
-
*/
|
|
682
|
-
const CLASSNAME$1h = 'lumx-badge-wrapper';
|
|
683
|
-
const {
|
|
684
|
-
block: block$15,
|
|
685
|
-
element: element$Q
|
|
686
|
-
} = classNames.bem(CLASSNAME$1h);
|
|
687
|
-
const BadgeWrapper = forwardRef((props, ref) => {
|
|
688
|
-
const {
|
|
689
|
-
badge,
|
|
690
|
-
children,
|
|
691
|
-
className,
|
|
692
|
-
...forwardedProps
|
|
693
|
-
} = props;
|
|
694
|
-
return /*#__PURE__*/jsxs("div", {
|
|
695
|
-
ref: ref,
|
|
696
|
-
...forwardedProps,
|
|
697
|
-
className: classNames.join(className, block$15()),
|
|
698
|
-
children: [children, badge && /*#__PURE__*/jsx("div", {
|
|
699
|
-
className: element$Q('badge'),
|
|
627
|
+
className: element$S('badge'),
|
|
700
628
|
children: badge
|
|
701
629
|
})]
|
|
702
630
|
});
|
|
703
631
|
});
|
|
704
|
-
|
|
705
|
-
|
|
632
|
+
Avatar.displayName = COMPONENT_NAME$1i;
|
|
633
|
+
Avatar.className = CLASSNAME$1l;
|
|
634
|
+
Avatar.defaultProps = DEFAULT_PROPS$18;
|
|
706
635
|
|
|
707
636
|
/**
|
|
708
637
|
* Alignments.
|
|
@@ -743,6 +672,12 @@ const TypographyInterface = {
|
|
|
743
672
|
*/
|
|
744
673
|
const Typography = {
|
|
745
674
|
...TypographyInterface};
|
|
675
|
+
/**
|
|
676
|
+
* All available aspect ratios.
|
|
677
|
+
*/
|
|
678
|
+
const AspectRatio = {
|
|
679
|
+
/** Intrinsic content ratio. */
|
|
680
|
+
original: 'original'};
|
|
746
681
|
/**
|
|
747
682
|
* Semantic info about the purpose of the component
|
|
748
683
|
*/
|
|
@@ -924,7 +859,7 @@ function modifier$1(baseName, modifiers) {
|
|
|
924
859
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
925
860
|
*/
|
|
926
861
|
|
|
927
|
-
function block$
|
|
862
|
+
function block$17(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
928
863
|
let modifiers;
|
|
929
864
|
let classes;
|
|
930
865
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
@@ -959,11 +894,11 @@ function block$14(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
|
959
894
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
960
895
|
*/
|
|
961
896
|
|
|
962
|
-
function element$
|
|
897
|
+
function element$R(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
963
898
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
964
|
-
return block$
|
|
899
|
+
return block$17(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
|
|
965
900
|
}
|
|
966
|
-
return block$
|
|
901
|
+
return block$17(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
|
|
967
902
|
}
|
|
968
903
|
|
|
969
904
|
/**
|
|
@@ -972,15 +907,15 @@ function element$P(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
|
|
|
972
907
|
function bem(baseName) {
|
|
973
908
|
function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
|
|
974
909
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
975
|
-
return block$
|
|
910
|
+
return block$17(baseName, modifiersOrAdditionalClasses);
|
|
976
911
|
}
|
|
977
|
-
return block$
|
|
912
|
+
return block$17(baseName, modifiersOrAdditionalClasses, additionalClasses);
|
|
978
913
|
}
|
|
979
914
|
function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
980
915
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
981
|
-
return element$
|
|
916
|
+
return element$R(baseName, elem, modifiersOrAdditionalClasses);
|
|
982
917
|
}
|
|
983
|
-
return element$
|
|
918
|
+
return element$R(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
|
|
984
919
|
}
|
|
985
920
|
return {
|
|
986
921
|
block: blockFn,
|
|
@@ -989,6 +924,108 @@ function bem(baseName) {
|
|
|
989
924
|
};
|
|
990
925
|
}
|
|
991
926
|
|
|
927
|
+
/**
|
|
928
|
+
* Component display name.
|
|
929
|
+
*/
|
|
930
|
+
const COMPONENT_NAME$1h = 'Badge';
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Component default class name and class prefix.
|
|
934
|
+
*/
|
|
935
|
+
const CLASSNAME$1k = 'lumx-badge';
|
|
936
|
+
const {
|
|
937
|
+
block: block$16
|
|
938
|
+
} = bem(CLASSNAME$1k);
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Component default props.
|
|
942
|
+
*/
|
|
943
|
+
const DEFAULT_PROPS$17 = {
|
|
944
|
+
color: ColorPalette.primary
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Badge component.
|
|
949
|
+
*
|
|
950
|
+
* @param props Component props.
|
|
951
|
+
* @return JSX element.
|
|
952
|
+
*/
|
|
953
|
+
const Badge$1 = props => {
|
|
954
|
+
const {
|
|
955
|
+
children,
|
|
956
|
+
className,
|
|
957
|
+
color = DEFAULT_PROPS$17.color,
|
|
958
|
+
ref,
|
|
959
|
+
...forwardedProps
|
|
960
|
+
} = props;
|
|
961
|
+
return /*#__PURE__*/jsx("div", {
|
|
962
|
+
ref: ref,
|
|
963
|
+
...forwardedProps,
|
|
964
|
+
className: classnames(className, block$16({
|
|
965
|
+
[`color-${color}`]: Boolean(color)
|
|
966
|
+
})),
|
|
967
|
+
children: children
|
|
968
|
+
});
|
|
969
|
+
};
|
|
970
|
+
Badge$1.displayName = COMPONENT_NAME$1h;
|
|
971
|
+
Badge$1.className = CLASSNAME$1k;
|
|
972
|
+
Badge$1.defaultProps = DEFAULT_PROPS$17;
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Defines the props of the component.
|
|
976
|
+
*/
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Badge component.
|
|
980
|
+
*
|
|
981
|
+
* @param props Component props.
|
|
982
|
+
* @param ref Component ref.
|
|
983
|
+
* @return React element.
|
|
984
|
+
*/
|
|
985
|
+
const Badge = forwardRef((props, ref) => {
|
|
986
|
+
return Badge$1({
|
|
987
|
+
...props,
|
|
988
|
+
ref
|
|
989
|
+
});
|
|
990
|
+
});
|
|
991
|
+
Badge.displayName = Badge$1.displayName;
|
|
992
|
+
Badge.className = Badge$1.className;
|
|
993
|
+
Badge.defaultProps = Badge$1.defaultProps;
|
|
994
|
+
|
|
995
|
+
const COMPONENT_NAME$1g = 'BadgeWrapper';
|
|
996
|
+
const CLASSNAME$1j = 'lumx-badge-wrapper';
|
|
997
|
+
const {
|
|
998
|
+
block: block$15,
|
|
999
|
+
element: element$Q
|
|
1000
|
+
} = bem(CLASSNAME$1j);
|
|
1001
|
+
const BadgeWrapper$1 = props => {
|
|
1002
|
+
const {
|
|
1003
|
+
badge,
|
|
1004
|
+
children,
|
|
1005
|
+
className,
|
|
1006
|
+
ref,
|
|
1007
|
+
...forwardedProps
|
|
1008
|
+
} = props;
|
|
1009
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1010
|
+
ref: ref,
|
|
1011
|
+
...forwardedProps,
|
|
1012
|
+
className: classnames(className, block$15()),
|
|
1013
|
+
children: [children, badge && /*#__PURE__*/jsx("div", {
|
|
1014
|
+
className: element$Q('badge'),
|
|
1015
|
+
children: badge
|
|
1016
|
+
})]
|
|
1017
|
+
});
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
const BadgeWrapper = forwardRef((props, ref) => {
|
|
1021
|
+
return BadgeWrapper$1({
|
|
1022
|
+
...props,
|
|
1023
|
+
ref
|
|
1024
|
+
});
|
|
1025
|
+
});
|
|
1026
|
+
BadgeWrapper.displayName = COMPONENT_NAME$1g;
|
|
1027
|
+
BadgeWrapper.className = CLASSNAME$1j;
|
|
1028
|
+
|
|
992
1029
|
/**
|
|
993
1030
|
* Render clickable element (link, button or custom element)
|
|
994
1031
|
* (also does some basic disabled state handling)
|
|
@@ -1148,15 +1185,15 @@ const COMPONENT_NAME$1e = 'Button';
|
|
|
1148
1185
|
/**
|
|
1149
1186
|
* Component default class name and class prefix.
|
|
1150
1187
|
*/
|
|
1151
|
-
const CLASSNAME$
|
|
1188
|
+
const CLASSNAME$1i = 'lumx-button';
|
|
1152
1189
|
const {
|
|
1153
1190
|
modifier
|
|
1154
|
-
} = bem(CLASSNAME$
|
|
1191
|
+
} = bem(CLASSNAME$1i);
|
|
1155
1192
|
|
|
1156
1193
|
/**
|
|
1157
1194
|
* Component default props.
|
|
1158
1195
|
*/
|
|
1159
|
-
const DEFAULT_PROPS$
|
|
1196
|
+
const DEFAULT_PROPS$16 = {
|
|
1160
1197
|
emphasis: Emphasis.high,
|
|
1161
1198
|
size: Size.m
|
|
1162
1199
|
};
|
|
@@ -1170,10 +1207,10 @@ const DEFAULT_PROPS$11 = {
|
|
|
1170
1207
|
const Button$1 = props => {
|
|
1171
1208
|
const {
|
|
1172
1209
|
className,
|
|
1173
|
-
emphasis = DEFAULT_PROPS$
|
|
1210
|
+
emphasis = DEFAULT_PROPS$16.emphasis,
|
|
1174
1211
|
leftIcon,
|
|
1175
1212
|
rightIcon,
|
|
1176
|
-
size = DEFAULT_PROPS$
|
|
1213
|
+
size = DEFAULT_PROPS$16.size,
|
|
1177
1214
|
...forwardedProps
|
|
1178
1215
|
} = props;
|
|
1179
1216
|
const buttonClassName = classnames(className, modifier({
|
|
@@ -1189,8 +1226,8 @@ const Button$1 = props => {
|
|
|
1189
1226
|
});
|
|
1190
1227
|
};
|
|
1191
1228
|
Button$1.displayName = COMPONENT_NAME$1e;
|
|
1192
|
-
Button$1.className = CLASSNAME$
|
|
1193
|
-
Button$1.defaultProps = DEFAULT_PROPS$
|
|
1229
|
+
Button$1.className = CLASSNAME$1i;
|
|
1230
|
+
Button$1.defaultProps = DEFAULT_PROPS$16;
|
|
1194
1231
|
|
|
1195
1232
|
/**
|
|
1196
1233
|
* Properties of a component to use to determine it's name.
|
|
@@ -1257,8 +1294,8 @@ const Button = forwardRef((props, ref) => {
|
|
|
1257
1294
|
});
|
|
1258
1295
|
});
|
|
1259
1296
|
Button.displayName = COMPONENT_NAME$1e;
|
|
1260
|
-
Button.className = CLASSNAME$
|
|
1261
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
1297
|
+
Button.className = CLASSNAME$1i;
|
|
1298
|
+
Button.defaultProps = DEFAULT_PROPS$16;
|
|
1262
1299
|
|
|
1263
1300
|
const COMPONENT_NAME$1d = 'Icon';
|
|
1264
1301
|
const IconClassName = 'lumx-icon';
|
|
@@ -1267,15 +1304,15 @@ const IconClassName = 'lumx-icon';
|
|
|
1267
1304
|
* Defines the props of the component.
|
|
1268
1305
|
*/
|
|
1269
1306
|
|
|
1270
|
-
const CLASSNAME$
|
|
1307
|
+
const CLASSNAME$1h = IconClassName;
|
|
1271
1308
|
const {
|
|
1272
|
-
block: block$
|
|
1273
|
-
} = bem(CLASSNAME$
|
|
1309
|
+
block: block$14
|
|
1310
|
+
} = bem(CLASSNAME$1h);
|
|
1274
1311
|
|
|
1275
1312
|
/**
|
|
1276
1313
|
* Component default props.
|
|
1277
1314
|
*/
|
|
1278
|
-
const DEFAULT_PROPS$
|
|
1315
|
+
const DEFAULT_PROPS$15 = {};
|
|
1279
1316
|
|
|
1280
1317
|
/**
|
|
1281
1318
|
* Icon component.
|
|
@@ -1324,7 +1361,7 @@ const Icon$1 = props => {
|
|
|
1324
1361
|
return /*#__PURE__*/jsx("i", {
|
|
1325
1362
|
ref: ref,
|
|
1326
1363
|
...forwardedProps,
|
|
1327
|
-
className: classnames(className, block$
|
|
1364
|
+
className: classnames(className, block$14({
|
|
1328
1365
|
[`color-${iconColor}`]: Boolean(iconColor),
|
|
1329
1366
|
[`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
|
|
1330
1367
|
'has-shape': hasShape,
|
|
@@ -1354,8 +1391,8 @@ const Icon$1 = props => {
|
|
|
1354
1391
|
});
|
|
1355
1392
|
};
|
|
1356
1393
|
Icon$1.displayName = COMPONENT_NAME$1d;
|
|
1357
|
-
Icon$1.className = CLASSNAME$
|
|
1358
|
-
Icon$1.defaultProps = DEFAULT_PROPS$
|
|
1394
|
+
Icon$1.className = CLASSNAME$1h;
|
|
1395
|
+
Icon$1.defaultProps = DEFAULT_PROPS$15;
|
|
1359
1396
|
|
|
1360
1397
|
/**
|
|
1361
1398
|
* Component display name.
|
|
@@ -1365,12 +1402,12 @@ const COMPONENT_NAME$1c = 'IconButton';
|
|
|
1365
1402
|
/**
|
|
1366
1403
|
* Component default class name and class prefix.
|
|
1367
1404
|
*/
|
|
1368
|
-
const CLASSNAME$
|
|
1405
|
+
const CLASSNAME$1g = 'lumx-icon-button';
|
|
1369
1406
|
|
|
1370
1407
|
/**
|
|
1371
1408
|
* Component default props.
|
|
1372
1409
|
*/
|
|
1373
|
-
const DEFAULT_PROPS
|
|
1410
|
+
const DEFAULT_PROPS$14 = {
|
|
1374
1411
|
emphasis: Emphasis.high,
|
|
1375
1412
|
size: Size.m
|
|
1376
1413
|
};
|
|
@@ -1383,11 +1420,11 @@ const DEFAULT_PROPS$$ = {
|
|
|
1383
1420
|
*/
|
|
1384
1421
|
const IconButton$1 = props => {
|
|
1385
1422
|
const {
|
|
1386
|
-
emphasis = DEFAULT_PROPS
|
|
1423
|
+
emphasis = DEFAULT_PROPS$14.emphasis,
|
|
1387
1424
|
image,
|
|
1388
1425
|
icon,
|
|
1389
1426
|
label,
|
|
1390
|
-
size = DEFAULT_PROPS
|
|
1427
|
+
size = DEFAULT_PROPS$14.size,
|
|
1391
1428
|
...forwardedProps
|
|
1392
1429
|
} = props;
|
|
1393
1430
|
const defaultChildren = image ? /*#__PURE__*/jsx("img", {
|
|
@@ -1407,8 +1444,8 @@ const IconButton$1 = props => {
|
|
|
1407
1444
|
});
|
|
1408
1445
|
};
|
|
1409
1446
|
IconButton$1.displayName = COMPONENT_NAME$1c;
|
|
1410
|
-
IconButton$1.className = CLASSNAME$
|
|
1411
|
-
IconButton$1.defaultProps = DEFAULT_PROPS
|
|
1447
|
+
IconButton$1.className = CLASSNAME$1g;
|
|
1448
|
+
IconButton$1.defaultProps = DEFAULT_PROPS$14;
|
|
1412
1449
|
|
|
1413
1450
|
/**
|
|
1414
1451
|
* IconButton component.
|
|
@@ -1444,8 +1481,8 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
1444
1481
|
});
|
|
1445
1482
|
});
|
|
1446
1483
|
IconButton.displayName = COMPONENT_NAME$1c;
|
|
1447
|
-
IconButton.className = CLASSNAME$
|
|
1448
|
-
IconButton.defaultProps = DEFAULT_PROPS
|
|
1484
|
+
IconButton.className = CLASSNAME$1g;
|
|
1485
|
+
IconButton.defaultProps = DEFAULT_PROPS$14;
|
|
1449
1486
|
|
|
1450
1487
|
/**
|
|
1451
1488
|
* Component display name.
|
|
@@ -1455,12 +1492,12 @@ const COMPONENT_NAME$1b = 'ButtonGroup';
|
|
|
1455
1492
|
/**
|
|
1456
1493
|
* Component default class name and class prefix.
|
|
1457
1494
|
*/
|
|
1458
|
-
const CLASSNAME$
|
|
1495
|
+
const CLASSNAME$1f = 'lumx-button-group';
|
|
1459
1496
|
|
|
1460
1497
|
/**
|
|
1461
1498
|
* Component default props.
|
|
1462
1499
|
*/
|
|
1463
|
-
const DEFAULT_PROPS$
|
|
1500
|
+
const DEFAULT_PROPS$13 = {};
|
|
1464
1501
|
|
|
1465
1502
|
/**
|
|
1466
1503
|
* ButtonGroup component.
|
|
@@ -1476,13 +1513,13 @@ const ButtonGroup$1 = props => {
|
|
|
1476
1513
|
} = props;
|
|
1477
1514
|
return /*#__PURE__*/jsx("div", {
|
|
1478
1515
|
...forwardedProps,
|
|
1479
|
-
className: classnames(className, CLASSNAME$
|
|
1516
|
+
className: classnames(className, CLASSNAME$1f),
|
|
1480
1517
|
children: children
|
|
1481
1518
|
});
|
|
1482
1519
|
};
|
|
1483
1520
|
ButtonGroup$1.displayName = COMPONENT_NAME$1b;
|
|
1484
|
-
ButtonGroup$1.className = CLASSNAME$
|
|
1485
|
-
ButtonGroup$1.defaultProps = DEFAULT_PROPS$
|
|
1521
|
+
ButtonGroup$1.className = CLASSNAME$1f;
|
|
1522
|
+
ButtonGroup$1.defaultProps = DEFAULT_PROPS$13;
|
|
1486
1523
|
|
|
1487
1524
|
/**
|
|
1488
1525
|
* ButtonGroup component.
|
|
@@ -1498,16 +1535,16 @@ const ButtonGroup = forwardRef((props, ref) => {
|
|
|
1498
1535
|
});
|
|
1499
1536
|
});
|
|
1500
1537
|
ButtonGroup.displayName = COMPONENT_NAME$1b;
|
|
1501
|
-
ButtonGroup.className = CLASSNAME$
|
|
1502
|
-
ButtonGroup.defaultProps = DEFAULT_PROPS$
|
|
1538
|
+
ButtonGroup.className = CLASSNAME$1f;
|
|
1539
|
+
ButtonGroup.defaultProps = DEFAULT_PROPS$13;
|
|
1503
1540
|
|
|
1504
1541
|
const COMPONENT_NAME$1a = 'InputLabel';
|
|
1505
1542
|
const InputLabelClassName = 'lumx-input-label';
|
|
1506
|
-
const CLASSNAME$
|
|
1543
|
+
const CLASSNAME$1e = InputLabelClassName;
|
|
1507
1544
|
const {
|
|
1508
|
-
block: block$
|
|
1509
|
-
} = bem(CLASSNAME$
|
|
1510
|
-
const DEFAULT_PROPS$
|
|
1545
|
+
block: block$13
|
|
1546
|
+
} = bem(CLASSNAME$1e);
|
|
1547
|
+
const DEFAULT_PROPS$12 = {};
|
|
1511
1548
|
|
|
1512
1549
|
/**
|
|
1513
1550
|
* InputLabel component.
|
|
@@ -1527,7 +1564,7 @@ function InputLabel$1(props) {
|
|
|
1527
1564
|
ref: ref,
|
|
1528
1565
|
...forwardedProps,
|
|
1529
1566
|
htmlFor: htmlFor,
|
|
1530
|
-
className: classnames(className, block$
|
|
1567
|
+
className: classnames(className, block$13({
|
|
1531
1568
|
'is-required': isRequired,
|
|
1532
1569
|
[`theme-${theme}`]: Boolean(theme),
|
|
1533
1570
|
'has-custom-typography': Boolean(typography$1)
|
|
@@ -1536,8 +1573,8 @@ function InputLabel$1(props) {
|
|
|
1536
1573
|
});
|
|
1537
1574
|
}
|
|
1538
1575
|
InputLabel$1.displayName = COMPONENT_NAME$1a;
|
|
1539
|
-
InputLabel$1.className = CLASSNAME$
|
|
1540
|
-
InputLabel$1.defaultProps = DEFAULT_PROPS$
|
|
1576
|
+
InputLabel$1.className = CLASSNAME$1e;
|
|
1577
|
+
InputLabel$1.defaultProps = DEFAULT_PROPS$12;
|
|
1541
1578
|
|
|
1542
1579
|
const INPUT_HELPER_CONFIGURATION = {
|
|
1543
1580
|
[Kind.error]: {
|
|
@@ -1558,15 +1595,15 @@ const InputHelperClassName = 'lumx-input-helper';
|
|
|
1558
1595
|
* Defines the props of the component.
|
|
1559
1596
|
*/
|
|
1560
1597
|
|
|
1561
|
-
const CLASSNAME$
|
|
1598
|
+
const CLASSNAME$1d = InputHelperClassName;
|
|
1562
1599
|
const {
|
|
1563
|
-
block: block$
|
|
1564
|
-
} = bem(CLASSNAME$
|
|
1600
|
+
block: block$12
|
|
1601
|
+
} = bem(CLASSNAME$1d);
|
|
1565
1602
|
|
|
1566
1603
|
/**
|
|
1567
1604
|
* Component default props.
|
|
1568
1605
|
*/
|
|
1569
|
-
const DEFAULT_PROPS$
|
|
1606
|
+
const DEFAULT_PROPS$11 = {
|
|
1570
1607
|
kind: Kind.info
|
|
1571
1608
|
};
|
|
1572
1609
|
|
|
@@ -1577,7 +1614,7 @@ function InputHelper$1(props) {
|
|
|
1577
1614
|
const {
|
|
1578
1615
|
children,
|
|
1579
1616
|
className,
|
|
1580
|
-
kind = DEFAULT_PROPS$
|
|
1617
|
+
kind = DEFAULT_PROPS$11.kind,
|
|
1581
1618
|
theme,
|
|
1582
1619
|
ref,
|
|
1583
1620
|
...forwardedProps
|
|
@@ -1588,7 +1625,7 @@ function InputHelper$1(props) {
|
|
|
1588
1625
|
return /*#__PURE__*/jsx("p", {
|
|
1589
1626
|
ref: ref,
|
|
1590
1627
|
...forwardedProps,
|
|
1591
|
-
className: classnames(className, block$
|
|
1628
|
+
className: classnames(className, block$12({
|
|
1592
1629
|
[`color-${color}`]: Boolean(color),
|
|
1593
1630
|
[`theme-${theme}`]: Boolean(theme)
|
|
1594
1631
|
})),
|
|
@@ -1596,8 +1633,8 @@ function InputHelper$1(props) {
|
|
|
1596
1633
|
});
|
|
1597
1634
|
}
|
|
1598
1635
|
InputHelper$1.displayName = COMPONENT_NAME$19;
|
|
1599
|
-
InputHelper$1.className = CLASSNAME$
|
|
1600
|
-
InputHelper$1.defaultProps = DEFAULT_PROPS$
|
|
1636
|
+
InputHelper$1.className = CLASSNAME$1d;
|
|
1637
|
+
InputHelper$1.defaultProps = DEFAULT_PROPS$11;
|
|
1601
1638
|
|
|
1602
1639
|
const INTERMEDIATE_STATE = 'intermediate';
|
|
1603
1640
|
|
|
@@ -1613,11 +1650,11 @@ const COMPONENT_NAME$18 = 'Checkbox';
|
|
|
1613
1650
|
/**
|
|
1614
1651
|
* Component default class name and class prefix.
|
|
1615
1652
|
*/
|
|
1616
|
-
const CLASSNAME$
|
|
1653
|
+
const CLASSNAME$1c = 'lumx-checkbox';
|
|
1617
1654
|
const {
|
|
1618
|
-
block: block$
|
|
1619
|
-
element: element$
|
|
1620
|
-
} = bem(CLASSNAME$
|
|
1655
|
+
block: block$11,
|
|
1656
|
+
element: element$P
|
|
1657
|
+
} = bem(CLASSNAME$1c);
|
|
1621
1658
|
|
|
1622
1659
|
/**
|
|
1623
1660
|
* Checkbox component.
|
|
@@ -1653,7 +1690,7 @@ const Checkbox$1 = props => {
|
|
|
1653
1690
|
return /*#__PURE__*/jsxs("div", {
|
|
1654
1691
|
ref: ref,
|
|
1655
1692
|
...forwardedProps,
|
|
1656
|
-
className: classnames(className, block$
|
|
1693
|
+
className: classnames(className, block$11({
|
|
1657
1694
|
// Whether state is intermediate class name will "-checked"
|
|
1658
1695
|
'is-checked': intermediateState ? true : isChecked,
|
|
1659
1696
|
'is-disabled': isDisabled,
|
|
@@ -1661,12 +1698,12 @@ const Checkbox$1 = props => {
|
|
|
1661
1698
|
[`theme-${theme}`]: Boolean(theme)
|
|
1662
1699
|
})),
|
|
1663
1700
|
children: [/*#__PURE__*/jsxs("div", {
|
|
1664
|
-
className: element$
|
|
1701
|
+
className: element$P('input-wrapper'),
|
|
1665
1702
|
children: [/*#__PURE__*/jsx("input", {
|
|
1666
1703
|
ref: inputRef,
|
|
1667
1704
|
type: "checkbox",
|
|
1668
1705
|
id: inputId,
|
|
1669
|
-
className: element$
|
|
1706
|
+
className: element$P('input-native'),
|
|
1670
1707
|
name: name,
|
|
1671
1708
|
value: value,
|
|
1672
1709
|
checked: isChecked,
|
|
@@ -1678,26 +1715,26 @@ const Checkbox$1 = props => {
|
|
|
1678
1715
|
} : {}),
|
|
1679
1716
|
...inputProps
|
|
1680
1717
|
}), /*#__PURE__*/jsxs("div", {
|
|
1681
|
-
className: element$
|
|
1718
|
+
className: element$P('input-placeholder'),
|
|
1682
1719
|
children: [/*#__PURE__*/jsx("div", {
|
|
1683
|
-
className: element$
|
|
1720
|
+
className: element$P('input-background')
|
|
1684
1721
|
}), /*#__PURE__*/jsx("div", {
|
|
1685
|
-
className: element$
|
|
1722
|
+
className: element$P('input-indicator'),
|
|
1686
1723
|
children: Icon$1({
|
|
1687
1724
|
icon: intermediateState ? mdiMinus : mdiCheck
|
|
1688
1725
|
})
|
|
1689
1726
|
})]
|
|
1690
1727
|
})]
|
|
1691
1728
|
}), /*#__PURE__*/jsxs("div", {
|
|
1692
|
-
className: element$
|
|
1729
|
+
className: element$P('content'),
|
|
1693
1730
|
children: [label && InputLabel$1({
|
|
1694
1731
|
htmlFor: inputId,
|
|
1695
|
-
className: element$
|
|
1732
|
+
className: element$P('label'),
|
|
1696
1733
|
theme,
|
|
1697
1734
|
children: label
|
|
1698
1735
|
}), helper && InputHelper$1({
|
|
1699
1736
|
id: `${inputId}-helper`,
|
|
1700
|
-
className: element$
|
|
1737
|
+
className: element$P('helper'),
|
|
1701
1738
|
theme,
|
|
1702
1739
|
children: helper
|
|
1703
1740
|
})]
|
|
@@ -1712,7 +1749,7 @@ const Checkbox$1 = props => {
|
|
|
1712
1749
|
/**
|
|
1713
1750
|
* Component default props.
|
|
1714
1751
|
*/
|
|
1715
|
-
const DEFAULT_PROPS$
|
|
1752
|
+
const DEFAULT_PROPS$10 = {};
|
|
1716
1753
|
|
|
1717
1754
|
/**
|
|
1718
1755
|
* Checkbox component.
|
|
@@ -1773,8 +1810,8 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1773
1810
|
});
|
|
1774
1811
|
});
|
|
1775
1812
|
Checkbox.displayName = COMPONENT_NAME$18;
|
|
1776
|
-
Checkbox.className = CLASSNAME$
|
|
1777
|
-
Checkbox.defaultProps = DEFAULT_PROPS$
|
|
1813
|
+
Checkbox.className = CLASSNAME$1c;
|
|
1814
|
+
Checkbox.defaultProps = DEFAULT_PROPS$10;
|
|
1778
1815
|
|
|
1779
1816
|
/**
|
|
1780
1817
|
* Wrap mouse event handler to stop event propagation.
|
|
@@ -1800,16 +1837,16 @@ const COMPONENT_NAME$17 = 'Chip';
|
|
|
1800
1837
|
/**
|
|
1801
1838
|
* Component default class name and class prefix.
|
|
1802
1839
|
*/
|
|
1803
|
-
const CLASSNAME$
|
|
1840
|
+
const CLASSNAME$1b = 'lumx-chip';
|
|
1804
1841
|
const {
|
|
1805
|
-
block: block
|
|
1806
|
-
element: element$
|
|
1807
|
-
} = classNames.bem(CLASSNAME$
|
|
1842
|
+
block: block$10,
|
|
1843
|
+
element: element$O
|
|
1844
|
+
} = classNames.bem(CLASSNAME$1b);
|
|
1808
1845
|
|
|
1809
1846
|
/**
|
|
1810
1847
|
* Component default props.
|
|
1811
1848
|
*/
|
|
1812
|
-
const DEFAULT_PROPS
|
|
1849
|
+
const DEFAULT_PROPS$$ = {
|
|
1813
1850
|
size: Size$1.m
|
|
1814
1851
|
};
|
|
1815
1852
|
|
|
@@ -1839,7 +1876,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1839
1876
|
onAfterClick,
|
|
1840
1877
|
onBeforeClick,
|
|
1841
1878
|
onClick,
|
|
1842
|
-
size = DEFAULT_PROPS
|
|
1879
|
+
size = DEFAULT_PROPS$$.size,
|
|
1843
1880
|
theme = defaultTheme,
|
|
1844
1881
|
href,
|
|
1845
1882
|
onKeyDown,
|
|
@@ -1870,7 +1907,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1870
1907
|
...forwardedProps,
|
|
1871
1908
|
href: !disabledStateProps.disabled ? href : undefined,
|
|
1872
1909
|
ref: ref,
|
|
1873
|
-
className: classNames.join(className, block
|
|
1910
|
+
className: classNames.join(className, block$10({
|
|
1874
1911
|
'is-clickable': isClickable,
|
|
1875
1912
|
[`color-${chipColor}`]: Boolean(chipColor),
|
|
1876
1913
|
'is-disabled': isAnyDisabled,
|
|
@@ -1888,19 +1925,19 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1888
1925
|
/*#__PURE__*/
|
|
1889
1926
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1890
1927
|
jsx("div", {
|
|
1891
|
-
className: element$
|
|
1928
|
+
className: element$O('before', {
|
|
1892
1929
|
'is-clickable': hasBeforeClick
|
|
1893
1930
|
}),
|
|
1894
1931
|
onClick: handleOnBeforeClick,
|
|
1895
1932
|
children: before
|
|
1896
1933
|
}), /*#__PURE__*/jsx("div", {
|
|
1897
|
-
className: element$
|
|
1934
|
+
className: element$O('label'),
|
|
1898
1935
|
children: children
|
|
1899
1936
|
}), after &&
|
|
1900
1937
|
/*#__PURE__*/
|
|
1901
1938
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1902
1939
|
jsx("div", {
|
|
1903
|
-
className: element$
|
|
1940
|
+
className: element$O('after', {
|
|
1904
1941
|
'is-clickable': hasAfterClick
|
|
1905
1942
|
}),
|
|
1906
1943
|
onClick: handleOnAfterClick,
|
|
@@ -1910,8 +1947,8 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1910
1947
|
);
|
|
1911
1948
|
});
|
|
1912
1949
|
Chip.displayName = COMPONENT_NAME$17;
|
|
1913
|
-
Chip.className = CLASSNAME$
|
|
1914
|
-
Chip.defaultProps = DEFAULT_PROPS
|
|
1950
|
+
Chip.className = CLASSNAME$1b;
|
|
1951
|
+
Chip.defaultProps = DEFAULT_PROPS$$;
|
|
1915
1952
|
|
|
1916
1953
|
const INITIAL_STATE_ACTIVE_CHIP = -1;
|
|
1917
1954
|
|
|
@@ -1967,7 +2004,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
|
|
|
1967
2004
|
/**
|
|
1968
2005
|
* Component default props.
|
|
1969
2006
|
*/
|
|
1970
|
-
const DEFAULT_PROPS$
|
|
2007
|
+
const DEFAULT_PROPS$_ = {};
|
|
1971
2008
|
|
|
1972
2009
|
/**
|
|
1973
2010
|
* Component display name.
|
|
@@ -1977,7 +2014,7 @@ const COMPONENT_NAME$16 = 'ChipGroup';
|
|
|
1977
2014
|
/**
|
|
1978
2015
|
* Component default class name and class prefix.
|
|
1979
2016
|
*/
|
|
1980
|
-
const CLASSNAME$
|
|
2017
|
+
const CLASSNAME$1a = 'lumx-chip-group';
|
|
1981
2018
|
|
|
1982
2019
|
/**
|
|
1983
2020
|
* ChipGroup component.
|
|
@@ -1996,13 +2033,13 @@ const InternalChipGroup = forwardRef((props, ref) => {
|
|
|
1996
2033
|
return /*#__PURE__*/jsx("div", {
|
|
1997
2034
|
ref: ref,
|
|
1998
2035
|
...forwardedProps,
|
|
1999
|
-
className: classNames.join(className, CLASSNAME$
|
|
2036
|
+
className: classNames.join(className, CLASSNAME$1a),
|
|
2000
2037
|
children: children
|
|
2001
2038
|
});
|
|
2002
2039
|
});
|
|
2003
2040
|
InternalChipGroup.displayName = COMPONENT_NAME$16;
|
|
2004
|
-
InternalChipGroup.className = CLASSNAME$
|
|
2005
|
-
InternalChipGroup.defaultProps = DEFAULT_PROPS$
|
|
2041
|
+
InternalChipGroup.className = CLASSNAME$1a;
|
|
2042
|
+
InternalChipGroup.defaultProps = DEFAULT_PROPS$_;
|
|
2006
2043
|
const ChipGroup = Object.assign(InternalChipGroup, {
|
|
2007
2044
|
useChipGroupNavigation
|
|
2008
2045
|
});
|
|
@@ -2092,11 +2129,11 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
|
|
|
2092
2129
|
/**
|
|
2093
2130
|
* Component default class name and class prefix.
|
|
2094
2131
|
*/
|
|
2095
|
-
const CLASSNAME$
|
|
2132
|
+
const CLASSNAME$19 = 'lumx-selection-chip-group';
|
|
2096
2133
|
const {
|
|
2097
|
-
block: block
|
|
2098
|
-
element: element$
|
|
2099
|
-
} = classNames.bem(CLASSNAME$
|
|
2134
|
+
block: block$$,
|
|
2135
|
+
element: element$N
|
|
2136
|
+
} = classNames.bem(CLASSNAME$19);
|
|
2100
2137
|
|
|
2101
2138
|
/**
|
|
2102
2139
|
* SelectionChipGroup component.
|
|
@@ -2126,7 +2163,7 @@ const SelectionChipGroup = ({
|
|
|
2126
2163
|
return /*#__PURE__*/jsx(ChipGroup, {
|
|
2127
2164
|
role: "group",
|
|
2128
2165
|
"aria-label": label,
|
|
2129
|
-
className: block
|
|
2166
|
+
className: block$$(),
|
|
2130
2167
|
...forwardedProps,
|
|
2131
2168
|
children: value?.map((v, index) => {
|
|
2132
2169
|
const name = getWithSelector(getOptionName, v);
|
|
@@ -2170,7 +2207,7 @@ const SelectionChipGroup = ({
|
|
|
2170
2207
|
after: /*#__PURE__*/jsx(Icon, {
|
|
2171
2208
|
icon: mdiClose
|
|
2172
2209
|
}),
|
|
2173
|
-
className: element$
|
|
2210
|
+
className: element$N('chip', [props?.className]),
|
|
2174
2211
|
size: "s",
|
|
2175
2212
|
ref: ref,
|
|
2176
2213
|
onClick: onClick,
|
|
@@ -2852,6 +2889,16 @@ const ComboboxButton = forwardRef((props, ref) => {
|
|
|
2852
2889
|
});
|
|
2853
2890
|
});
|
|
2854
2891
|
|
|
2892
|
+
const CLASSNAME$18 = 'lumx-combobox-divider';
|
|
2893
|
+
|
|
2894
|
+
/** Combobox option divider */
|
|
2895
|
+
function ComboboxDivider() {
|
|
2896
|
+
return /*#__PURE__*/jsx(ListDivider, {
|
|
2897
|
+
className: CLASSNAME$18,
|
|
2898
|
+
role: "presentation"
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2855
2902
|
/**
|
|
2856
2903
|
* Provide props for the semantic and behaviors the combobox input trigger
|
|
2857
2904
|
*
|
|
@@ -2995,6 +3042,18 @@ const ComboboxOptionContextProvider = ({
|
|
|
2995
3042
|
});
|
|
2996
3043
|
};
|
|
2997
3044
|
|
|
3045
|
+
/**
|
|
3046
|
+
* Retrieve the current combobox option id.
|
|
3047
|
+
* Must be used within a ComboboxOptionIdProvider
|
|
3048
|
+
*/
|
|
3049
|
+
const useComboboxOptionContext = () => {
|
|
3050
|
+
const comboboxOption = useContext(ComboboxOptionContext);
|
|
3051
|
+
if (!comboboxOption?.optionId) {
|
|
3052
|
+
throw new Error('This hook must be used within a ComboboxOptionIdProvider');
|
|
3053
|
+
}
|
|
3054
|
+
return comboboxOption;
|
|
3055
|
+
};
|
|
3056
|
+
|
|
2998
3057
|
/** Retrieve the current combobox section id */
|
|
2999
3058
|
const useComboboxSectionId = () => {
|
|
3000
3059
|
return useContext(SectionContext);
|
|
@@ -3035,12 +3094,12 @@ const useRegisterOption = (registerId, option, shouldRegister) => {
|
|
|
3035
3094
|
};
|
|
3036
3095
|
|
|
3037
3096
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3038
|
-
const CLASSNAME$
|
|
3097
|
+
const CLASSNAME$17 = 'lumx-combobox-option';
|
|
3039
3098
|
const LUMX_CLASSNAME = 'lumx-list-item';
|
|
3040
3099
|
const {
|
|
3041
|
-
block: block$
|
|
3042
|
-
element: element$
|
|
3043
|
-
} = classNames.bem(CLASSNAME$
|
|
3100
|
+
block: block$_,
|
|
3101
|
+
element: element$M
|
|
3102
|
+
} = classNames.bem(CLASSNAME$17);
|
|
3044
3103
|
const lumxListItem = classNames.bem(LUMX_CLASSNAME);
|
|
3045
3104
|
|
|
3046
3105
|
/**
|
|
@@ -3086,7 +3145,7 @@ const OptionContent = forwardRef((props, ref) => {
|
|
|
3086
3145
|
* So we use a native li tag.
|
|
3087
3146
|
*/
|
|
3088
3147
|
return /*#__PURE__*/jsx("li", {
|
|
3089
|
-
className: block$
|
|
3148
|
+
className: block$_(undefined, [className ?? '', lumxListItem.block({
|
|
3090
3149
|
[`size-${size}`]: !!size
|
|
3091
3150
|
})]),
|
|
3092
3151
|
role: "presentation",
|
|
@@ -3099,7 +3158,7 @@ const OptionContent = forwardRef((props, ref) => {
|
|
|
3099
3158
|
children: /*#__PURE__*/jsxs(GenericBlock, {
|
|
3100
3159
|
as: "div",
|
|
3101
3160
|
role: comboboxType === 'grid' ? 'row' : 'presentation',
|
|
3102
|
-
className: element$
|
|
3161
|
+
className: element$M('content', {
|
|
3103
3162
|
// Not using the lumx list item disabled style as it blocks pointer events
|
|
3104
3163
|
'is-disabled': !!isDisabled
|
|
3105
3164
|
},
|
|
@@ -3112,7 +3171,7 @@ const OptionContent = forwardRef((props, ref) => {
|
|
|
3112
3171
|
children: [before && /*#__PURE__*/jsx(GenericBlock.Figure, {
|
|
3113
3172
|
as: "span",
|
|
3114
3173
|
role: "presentation",
|
|
3115
|
-
className: element$
|
|
3174
|
+
className: element$M('before', undefined, [lumxListItem.element('before')]),
|
|
3116
3175
|
children: before
|
|
3117
3176
|
}), /*#__PURE__*/jsxs(GenericBlock.Content, {
|
|
3118
3177
|
as: "span",
|
|
@@ -3124,7 +3183,7 @@ const OptionContent = forwardRef((props, ref) => {
|
|
|
3124
3183
|
...tooltipProps,
|
|
3125
3184
|
children: /*#__PURE__*/jsx(Element, {
|
|
3126
3185
|
id: id,
|
|
3127
|
-
className: element$
|
|
3186
|
+
className: element$M('trigger'),
|
|
3128
3187
|
role: comboboxType === 'grid' ? 'gridcell' : 'option',
|
|
3129
3188
|
"aria-selected": hasSelection ? ariaSelected : undefined,
|
|
3130
3189
|
"aria-disabled": isDisabled,
|
|
@@ -3141,7 +3200,7 @@ const OptionContent = forwardRef((props, ref) => {
|
|
|
3141
3200
|
as: "span",
|
|
3142
3201
|
id: ariaDescriptionId,
|
|
3143
3202
|
role: "presentation",
|
|
3144
|
-
className: element$
|
|
3203
|
+
className: element$M('description'),
|
|
3145
3204
|
typography: "caption",
|
|
3146
3205
|
color: "dark",
|
|
3147
3206
|
colorVariant: "L2",
|
|
@@ -3150,7 +3209,7 @@ const OptionContent = forwardRef((props, ref) => {
|
|
|
3150
3209
|
}), after && /*#__PURE__*/jsx(GenericBlock.Actions, {
|
|
3151
3210
|
as: "span",
|
|
3152
3211
|
role: "presentation",
|
|
3153
|
-
className: element$
|
|
3212
|
+
className: element$M('after', undefined, [lumxListItem.element('after')]),
|
|
3154
3213
|
children: /*#__PURE__*/jsx(ComboboxOptionContextProvider, {
|
|
3155
3214
|
optionId: id,
|
|
3156
3215
|
isKeyboardHighlighted: isKeyboardHighlighted,
|
|
@@ -3237,9 +3296,9 @@ const ComboboxOption = forwardRef((props, ref) => {
|
|
|
3237
3296
|
// Default widths the skeletons must have
|
|
3238
3297
|
const defaultWidths = [REAL_SIZE_FOR_LUMX_SIZE.xxl, REAL_SIZE_FOR_LUMX_SIZE.xl, REAL_SIZE_FOR_LUMX_SIZE.l];
|
|
3239
3298
|
const {
|
|
3240
|
-
block: block$
|
|
3241
|
-
element: element$
|
|
3242
|
-
} = classNames.bem(CLASSNAME$
|
|
3299
|
+
block: block$Z,
|
|
3300
|
+
element: element$L
|
|
3301
|
+
} = classNames.bem(CLASSNAME$17);
|
|
3243
3302
|
|
|
3244
3303
|
/**
|
|
3245
3304
|
* Skeleton for a combobox option.
|
|
@@ -3262,21 +3321,21 @@ const ComboboxOptionSkeleton = ({
|
|
|
3262
3321
|
});
|
|
3263
3322
|
return /*#__PURE__*/jsxs("li", {
|
|
3264
3323
|
role: "presentation",
|
|
3265
|
-
className: block$
|
|
3324
|
+
className: block$Z({
|
|
3266
3325
|
skeleton: true
|
|
3267
3326
|
}, ['lumx-list-item', `lumx-list-item--size-${size}`, className]),
|
|
3268
3327
|
children: [/*#__PURE__*/jsxs("div", {
|
|
3269
3328
|
role: "presentation",
|
|
3270
|
-
className: element$
|
|
3329
|
+
className: element$L('content', ['lumx-list-item__wrapper']),
|
|
3271
3330
|
children: [before && /*#__PURE__*/jsx(Text, {
|
|
3272
3331
|
as: "span",
|
|
3273
3332
|
role: "presentation",
|
|
3274
|
-
className: element$
|
|
3333
|
+
className: element$L('before', ['lumx-list-item__before']),
|
|
3275
3334
|
children: before
|
|
3276
3335
|
}), content]
|
|
3277
3336
|
}), after && /*#__PURE__*/jsx("div", {
|
|
3278
3337
|
role: "presentation",
|
|
3279
|
-
className: element$
|
|
3338
|
+
className: element$L('after', ['lumx-list-item__after']),
|
|
3280
3339
|
children: after
|
|
3281
3340
|
})]
|
|
3282
3341
|
});
|
|
@@ -3307,11 +3366,11 @@ const ComboboxListSkeleton = ({
|
|
|
3307
3366
|
|
|
3308
3367
|
/** The states in which the full loading must be displayed */
|
|
3309
3368
|
const FULL_LOADING_STATES = ['loading', 'debouncing', 'filtering'];
|
|
3310
|
-
const CLASSNAME$
|
|
3369
|
+
const CLASSNAME$16 = 'lumx-combobox-listbox';
|
|
3311
3370
|
const {
|
|
3312
|
-
block: block$
|
|
3313
|
-
element: element$
|
|
3314
|
-
} = bem$1(CLASSNAME$
|
|
3371
|
+
block: block$Y,
|
|
3372
|
+
element: element$K
|
|
3373
|
+
} = bem$1(CLASSNAME$16);
|
|
3315
3374
|
|
|
3316
3375
|
/**
|
|
3317
3376
|
* The listbox containing the combobox's options.
|
|
@@ -3401,7 +3460,7 @@ const ComboboxListBox = ({
|
|
|
3401
3460
|
id: listboxId,
|
|
3402
3461
|
role: type,
|
|
3403
3462
|
"aria-label": label,
|
|
3404
|
-
className: block$
|
|
3463
|
+
className: block$Y([className, 'lumx-list lumx-list--item-padding-big']),
|
|
3405
3464
|
style: {
|
|
3406
3465
|
flex: 1,
|
|
3407
3466
|
overflowY: 'auto'
|
|
@@ -3412,7 +3471,7 @@ const ComboboxListBox = ({
|
|
|
3412
3471
|
children: renderItemSkeleton
|
|
3413
3472
|
})]
|
|
3414
3473
|
}), footer, (isEmptyStateDisplayed || isErrorStateDisplayed) && /*#__PURE__*/jsx(GenericBlock, {
|
|
3415
|
-
className: element$
|
|
3474
|
+
className: element$K('state'),
|
|
3416
3475
|
orientation: "vertical",
|
|
3417
3476
|
vAlign: "center",
|
|
3418
3477
|
children: /*#__PURE__*/jsxs(GenericBlock.Content, {
|
|
@@ -3450,38 +3509,169 @@ const ComboboxListBox = ({
|
|
|
3450
3509
|
});
|
|
3451
3510
|
};
|
|
3452
3511
|
|
|
3453
|
-
const CLASSNAME$14 = 'lumx-combobox-section';
|
|
3454
|
-
const {
|
|
3455
|
-
block: block$W,
|
|
3456
|
-
element: element$I
|
|
3457
|
-
} = classNames.bem(CLASSNAME$14);
|
|
3458
|
-
|
|
3459
3512
|
/**
|
|
3460
|
-
*
|
|
3513
|
+
* Action to set on a Combobox Option.
|
|
3514
|
+
* Allows to add an interactive element that
|
|
3515
|
+
* can be navigated to and triggered using the keyboard.
|
|
3516
|
+
*
|
|
3517
|
+
* Defaults as "button"
|
|
3518
|
+
*
|
|
3519
|
+
* @family Combobox
|
|
3520
|
+
* @param ComboboxOptionActionProps
|
|
3521
|
+
* @returns ComboboxOptionAction
|
|
3461
3522
|
*/
|
|
3462
|
-
const
|
|
3463
|
-
className,
|
|
3464
|
-
title,
|
|
3465
|
-
children,
|
|
3466
|
-
isLoading,
|
|
3467
|
-
renderItemSkeleton
|
|
3468
|
-
}) => {
|
|
3523
|
+
const ComboboxOptionAction = props => {
|
|
3469
3524
|
const {
|
|
3470
|
-
|
|
3471
|
-
|
|
3525
|
+
as,
|
|
3526
|
+
isDisabled,
|
|
3527
|
+
onClick,
|
|
3528
|
+
id: originalId,
|
|
3529
|
+
...forwardedProps
|
|
3530
|
+
} = props;
|
|
3472
3531
|
const {
|
|
3473
|
-
|
|
3474
|
-
} =
|
|
3475
|
-
const
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
const
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3532
|
+
optionId
|
|
3533
|
+
} = useComboboxOptionContext();
|
|
3534
|
+
const {
|
|
3535
|
+
triggerRef
|
|
3536
|
+
} = useComboboxRefs();
|
|
3537
|
+
const itemRef = React__default.useRef(null);
|
|
3538
|
+
const generatedId = useId();
|
|
3539
|
+
const id = originalId || generatedId;
|
|
3540
|
+
const isHighlighted = useVirtualFocus(id, itemRef, isDisabled, optionId);
|
|
3541
|
+
const {
|
|
3542
|
+
state
|
|
3543
|
+
} = React__default.useContext(MovingFocusContext);
|
|
3544
|
+
const Component = as || 'button';
|
|
3545
|
+
const registeredActionOption = React__default.useMemo(() => ({
|
|
3546
|
+
id,
|
|
3547
|
+
generatedId: id,
|
|
3548
|
+
isAction: true,
|
|
3549
|
+
isDisabled,
|
|
3550
|
+
onSelect: () => {
|
|
3551
|
+
itemRef.current?.click();
|
|
3552
|
+
}
|
|
3553
|
+
}), [id, isDisabled]);
|
|
3554
|
+
|
|
3555
|
+
// Register the option
|
|
3556
|
+
useRegisterOption(id, registeredActionOption, !isDisabled);
|
|
3557
|
+
const handleActionClick = React__default.useCallback(() => {
|
|
3558
|
+
if (onClick) {
|
|
3559
|
+
onClick();
|
|
3560
|
+
}
|
|
3561
|
+
if (triggerRef?.current) {
|
|
3562
|
+
triggerRef.current?.focus();
|
|
3563
|
+
}
|
|
3564
|
+
}, [triggerRef, onClick]);
|
|
3565
|
+
return /*#__PURE__*/jsx(Component, {
|
|
3566
|
+
...forwardedProps,
|
|
3567
|
+
isDisabled: isDisabled,
|
|
3568
|
+
id: id,
|
|
3569
|
+
role: "gridcell",
|
|
3570
|
+
ref: itemRef,
|
|
3571
|
+
"data-focus-visible-added": state.isUsingKeyboard && isHighlighted ? 'true' : undefined,
|
|
3572
|
+
"aria-disabled": isDisabled,
|
|
3573
|
+
onClick: handleActionClick
|
|
3574
|
+
});
|
|
3575
|
+
};
|
|
3576
|
+
|
|
3577
|
+
const useBooleanState = defaultValue => {
|
|
3578
|
+
const [booleanValue, setBoolean] = useState(defaultValue);
|
|
3579
|
+
const setToFalse = useCallback(() => setBoolean(false), []);
|
|
3580
|
+
const setToTrue = useCallback(() => setBoolean(true), []);
|
|
3581
|
+
const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
|
|
3582
|
+
return [booleanValue, setToFalse, setToTrue, toggleBoolean];
|
|
3583
|
+
};
|
|
3584
|
+
|
|
3585
|
+
const CLASSNAME$15 = 'lumx-combobox-option-more-info';
|
|
3586
|
+
const {
|
|
3587
|
+
block: block$X,
|
|
3588
|
+
element: element$J
|
|
3589
|
+
} = classNames.bem(CLASSNAME$15);
|
|
3590
|
+
|
|
3591
|
+
/**
|
|
3592
|
+
* Display more info on the option as a popover opening on mouse hover or keyboard nav
|
|
3593
|
+
* Please consider using a simpler option description instead for better UX and a11y.
|
|
3594
|
+
*
|
|
3595
|
+
* @family Combobox
|
|
3596
|
+
*/
|
|
3597
|
+
const ComboboxOptionMoreInfo = ({
|
|
3598
|
+
buttonProps,
|
|
3599
|
+
popoverProps,
|
|
3600
|
+
onToggle,
|
|
3601
|
+
children
|
|
3602
|
+
}) => {
|
|
3603
|
+
const ref = React__default.useRef(null);
|
|
3604
|
+
const [isHovered,, onMouseLeave, onMouseEnter] = useBooleanState(false);
|
|
3605
|
+
const comboboxOption = useComboboxOptionContext();
|
|
3606
|
+
|
|
3607
|
+
// Open on mouse hover or key nav
|
|
3608
|
+
const isOpen = isHovered || comboboxOption.isKeyboardHighlighted;
|
|
3609
|
+
React__default.useEffect(() => {
|
|
3610
|
+
onToggle?.(isOpen);
|
|
3611
|
+
}, [isOpen, onToggle]);
|
|
3612
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
3613
|
+
children: [/*#__PURE__*/jsx(IconButton, {
|
|
3614
|
+
...buttonProps,
|
|
3615
|
+
ref: ref,
|
|
3616
|
+
className: block$X([buttonProps?.className]),
|
|
3617
|
+
icon: mdiInformationOutline,
|
|
3618
|
+
size: "s",
|
|
3619
|
+
emphasis: "low",
|
|
3620
|
+
onMouseEnter: onMouseEnter,
|
|
3621
|
+
onMouseLeave: onMouseLeave
|
|
3622
|
+
// Button actually plays no role here other than a target for the mouse hover
|
|
3623
|
+
// Keyboard accessibility is handled via combobox keyboard highlighting
|
|
3624
|
+
,
|
|
3625
|
+
"aria-hidden": true,
|
|
3626
|
+
label: ""
|
|
3627
|
+
}), /*#__PURE__*/jsx(Popover, {
|
|
3628
|
+
...popoverProps,
|
|
3629
|
+
className: element$J('popover', [popoverProps?.className]),
|
|
3630
|
+
anchorRef: ref,
|
|
3631
|
+
isOpen: isOpen,
|
|
3632
|
+
closeOnEscape: true,
|
|
3633
|
+
closeOnClickAway: true,
|
|
3634
|
+
placement: "bottom-start",
|
|
3635
|
+
children: children
|
|
3636
|
+
}), /*#__PURE__*/jsx(A11YLiveMessage, {
|
|
3637
|
+
hidden: true,
|
|
3638
|
+
children: isOpen ? children : undefined
|
|
3639
|
+
})]
|
|
3640
|
+
});
|
|
3641
|
+
};
|
|
3642
|
+
|
|
3643
|
+
const CLASSNAME$14 = 'lumx-combobox-section';
|
|
3644
|
+
const {
|
|
3645
|
+
block: block$W,
|
|
3646
|
+
element: element$I
|
|
3647
|
+
} = classNames.bem(CLASSNAME$14);
|
|
3648
|
+
|
|
3649
|
+
/**
|
|
3650
|
+
* Content of the ComboboxSection.
|
|
3651
|
+
*/
|
|
3652
|
+
const ComboboxSectionContent = ({
|
|
3653
|
+
className,
|
|
3654
|
+
title,
|
|
3655
|
+
children,
|
|
3656
|
+
isLoading,
|
|
3657
|
+
renderItemSkeleton
|
|
3658
|
+
}) => {
|
|
3659
|
+
const {
|
|
3660
|
+
options
|
|
3661
|
+
} = useCombobox();
|
|
3662
|
+
const {
|
|
3663
|
+
sectionId
|
|
3664
|
+
} = useComboboxSectionId();
|
|
3665
|
+
const hasRegisteredChildren = Boolean(Object.values(options).find(option => isComboboxValue(option) && option.sectionId === sectionId));
|
|
3666
|
+
const titleId = title && `${sectionId}-title`;
|
|
3667
|
+
if (!children && !isLoading) {
|
|
3668
|
+
return null;
|
|
3669
|
+
}
|
|
3670
|
+
const isHidden = !hasRegisteredChildren && !isLoading;
|
|
3671
|
+
return /*#__PURE__*/jsxs("li", {
|
|
3672
|
+
className: block$W([className]),
|
|
3673
|
+
role: !isHidden ? 'none' : undefined,
|
|
3674
|
+
"aria-hidden": isHidden,
|
|
3485
3675
|
style: {
|
|
3486
3676
|
display: isHidden ? 'none' : undefined
|
|
3487
3677
|
},
|
|
@@ -3573,7 +3763,7 @@ const Combobox$1 = ({
|
|
|
3573
3763
|
const triggerRef = useRef(null);
|
|
3574
3764
|
|
|
3575
3765
|
// Generate a unique id for the combobox that will be used for every child components.
|
|
3576
|
-
const generatedId = useId(
|
|
3766
|
+
const generatedId = useId();
|
|
3577
3767
|
const comboboxId = htmlId || generatedId;
|
|
3578
3768
|
const listboxId = `${comboboxId}-popover`;
|
|
3579
3769
|
|
|
@@ -3735,7 +3925,7 @@ const {
|
|
|
3735
3925
|
/**
|
|
3736
3926
|
* Component default props.
|
|
3737
3927
|
*/
|
|
3738
|
-
const DEFAULT_PROPS$
|
|
3928
|
+
const DEFAULT_PROPS$Z = {
|
|
3739
3929
|
variant: CommentBlockVariant.indented
|
|
3740
3930
|
};
|
|
3741
3931
|
|
|
@@ -3765,7 +3955,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
3765
3955
|
onMouseLeave,
|
|
3766
3956
|
text,
|
|
3767
3957
|
theme = defaultTheme,
|
|
3768
|
-
variant = DEFAULT_PROPS$
|
|
3958
|
+
variant = DEFAULT_PROPS$Z.variant,
|
|
3769
3959
|
...forwardedProps
|
|
3770
3960
|
} = props;
|
|
3771
3961
|
const hasChildren = Children.count(children) > 0;
|
|
@@ -3834,7 +4024,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
3834
4024
|
});
|
|
3835
4025
|
CommentBlock.displayName = COMPONENT_NAME$15;
|
|
3836
4026
|
CommentBlock.className = CLASSNAME$13;
|
|
3837
|
-
CommentBlock.defaultProps = DEFAULT_PROPS$
|
|
4027
|
+
CommentBlock.defaultProps = DEFAULT_PROPS$Z;
|
|
3838
4028
|
|
|
3839
4029
|
/**
|
|
3840
4030
|
* Add a number of months from a date while resetting the day to prevent month length mismatches.
|
|
@@ -4324,14 +4514,6 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
4324
4514
|
DatePicker.displayName = COMPONENT_NAME$14;
|
|
4325
4515
|
DatePicker.className = CLASSNAME$12;
|
|
4326
4516
|
|
|
4327
|
-
const useBooleanState = defaultValue => {
|
|
4328
|
-
const [booleanValue, setBoolean] = useState(defaultValue);
|
|
4329
|
-
const setToFalse = useCallback(() => setBoolean(false), []);
|
|
4330
|
-
const setToTrue = useCallback(() => setBoolean(true), []);
|
|
4331
|
-
const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
|
|
4332
|
-
return [booleanValue, setToFalse, setToTrue, toggleBoolean];
|
|
4333
|
-
};
|
|
4334
|
-
|
|
4335
4517
|
/**
|
|
4336
4518
|
* Component display name.
|
|
4337
4519
|
*/
|
|
@@ -4939,7 +5121,7 @@ const {
|
|
|
4939
5121
|
/**
|
|
4940
5122
|
* Component default props.
|
|
4941
5123
|
*/
|
|
4942
|
-
const DEFAULT_PROPS$
|
|
5124
|
+
const DEFAULT_PROPS$Y = {
|
|
4943
5125
|
size: Size$1.big,
|
|
4944
5126
|
disableBodyScroll: true
|
|
4945
5127
|
};
|
|
@@ -4970,11 +5152,11 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
4970
5152
|
parentElement,
|
|
4971
5153
|
contentRef,
|
|
4972
5154
|
preventAutoClose,
|
|
4973
|
-
size = DEFAULT_PROPS$
|
|
5155
|
+
size = DEFAULT_PROPS$Y.size,
|
|
4974
5156
|
zIndex,
|
|
4975
5157
|
dialogProps,
|
|
4976
5158
|
onVisibilityChange,
|
|
4977
|
-
disableBodyScroll = DEFAULT_PROPS$
|
|
5159
|
+
disableBodyScroll = DEFAULT_PROPS$Y.disableBodyScroll,
|
|
4978
5160
|
preventCloseOnClick,
|
|
4979
5161
|
preventCloseOnEscape,
|
|
4980
5162
|
...forwardedProps
|
|
@@ -5114,7 +5296,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
5114
5296
|
});
|
|
5115
5297
|
Dialog.displayName = COMPONENT_NAME$11;
|
|
5116
5298
|
Dialog.className = CLASSNAME$11;
|
|
5117
|
-
Dialog.defaultProps = DEFAULT_PROPS$
|
|
5299
|
+
Dialog.defaultProps = DEFAULT_PROPS$Y;
|
|
5118
5300
|
|
|
5119
5301
|
/**
|
|
5120
5302
|
* Component display name.
|
|
@@ -5127,12 +5309,38 @@ const COMPONENT_NAME$10 = 'Divider';
|
|
|
5127
5309
|
const CLASSNAME$10 = 'lumx-divider';
|
|
5128
5310
|
const {
|
|
5129
5311
|
block: block$T
|
|
5130
|
-
} =
|
|
5312
|
+
} = bem(CLASSNAME$10);
|
|
5313
|
+
|
|
5314
|
+
/**
|
|
5315
|
+
* Divider component.
|
|
5316
|
+
*
|
|
5317
|
+
* @param props Component props.
|
|
5318
|
+
* @return JSX element.
|
|
5319
|
+
*/
|
|
5320
|
+
const Divider$1 = props => {
|
|
5321
|
+
const {
|
|
5322
|
+
className,
|
|
5323
|
+
theme,
|
|
5324
|
+
ref,
|
|
5325
|
+
...forwardedProps
|
|
5326
|
+
} = props;
|
|
5327
|
+
return /*#__PURE__*/jsx("hr", {
|
|
5328
|
+
ref: ref,
|
|
5329
|
+
...forwardedProps,
|
|
5330
|
+
className: classnames(className, block$T({
|
|
5331
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
5332
|
+
}))
|
|
5333
|
+
});
|
|
5334
|
+
};
|
|
5335
|
+
|
|
5336
|
+
/**
|
|
5337
|
+
* Defines the props of the component.
|
|
5338
|
+
*/
|
|
5131
5339
|
|
|
5132
5340
|
/**
|
|
5133
5341
|
* Component default props.
|
|
5134
5342
|
*/
|
|
5135
|
-
const DEFAULT_PROPS$
|
|
5343
|
+
const DEFAULT_PROPS$X = {};
|
|
5136
5344
|
|
|
5137
5345
|
/**
|
|
5138
5346
|
* Divider component.
|
|
@@ -5144,21 +5352,18 @@ const DEFAULT_PROPS$S = {};
|
|
|
5144
5352
|
const Divider = forwardRef((props, ref) => {
|
|
5145
5353
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
5146
5354
|
const {
|
|
5147
|
-
className,
|
|
5148
5355
|
theme = defaultTheme,
|
|
5149
|
-
...
|
|
5356
|
+
...otherProps
|
|
5150
5357
|
} = props;
|
|
5151
|
-
return
|
|
5152
|
-
ref
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
[`theme-${theme}`]: Boolean(theme)
|
|
5156
|
-
}))
|
|
5358
|
+
return Divider$1({
|
|
5359
|
+
ref,
|
|
5360
|
+
theme,
|
|
5361
|
+
...otherProps
|
|
5157
5362
|
});
|
|
5158
5363
|
});
|
|
5159
5364
|
Divider.displayName = COMPONENT_NAME$10;
|
|
5160
5365
|
Divider.className = CLASSNAME$10;
|
|
5161
|
-
Divider.defaultProps = DEFAULT_PROPS$
|
|
5366
|
+
Divider.defaultProps = DEFAULT_PROPS$X;
|
|
5162
5367
|
|
|
5163
5368
|
/**
|
|
5164
5369
|
* Component display name.
|
|
@@ -5383,7 +5588,7 @@ const {
|
|
|
5383
5588
|
/**
|
|
5384
5589
|
* Component default props.
|
|
5385
5590
|
*/
|
|
5386
|
-
const DEFAULT_PROPS$
|
|
5591
|
+
const DEFAULT_PROPS$W = {
|
|
5387
5592
|
tabIndex: -1
|
|
5388
5593
|
};
|
|
5389
5594
|
|
|
@@ -5402,7 +5607,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
5402
5607
|
isClickable,
|
|
5403
5608
|
itemPadding,
|
|
5404
5609
|
onListItemSelected,
|
|
5405
|
-
tabIndex = DEFAULT_PROPS$
|
|
5610
|
+
tabIndex = DEFAULT_PROPS$W.tabIndex,
|
|
5406
5611
|
...forwardedProps
|
|
5407
5612
|
} = props;
|
|
5408
5613
|
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
@@ -5418,7 +5623,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
5418
5623
|
});
|
|
5419
5624
|
InternalList.displayName = COMPONENT_NAME$_;
|
|
5420
5625
|
InternalList.className = CLASSNAME$_;
|
|
5421
|
-
InternalList.defaultProps = DEFAULT_PROPS$
|
|
5626
|
+
InternalList.defaultProps = DEFAULT_PROPS$W;
|
|
5422
5627
|
const List = Object.assign(InternalList, {
|
|
5423
5628
|
useKeyboardListNavigation
|
|
5424
5629
|
});
|
|
@@ -7863,7 +8068,7 @@ const {
|
|
|
7863
8068
|
/**
|
|
7864
8069
|
* Component default props.
|
|
7865
8070
|
*/
|
|
7866
|
-
const DEFAULT_PROPS$
|
|
8071
|
+
const DEFAULT_PROPS$V = {
|
|
7867
8072
|
elevation: 3,
|
|
7868
8073
|
placement: Placement.AUTO,
|
|
7869
8074
|
focusAnchorOnClose: true,
|
|
@@ -7880,24 +8085,24 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
7880
8085
|
className,
|
|
7881
8086
|
closeOnClickAway,
|
|
7882
8087
|
closeOnEscape,
|
|
7883
|
-
elevation = DEFAULT_PROPS$
|
|
8088
|
+
elevation = DEFAULT_PROPS$V.elevation,
|
|
7884
8089
|
focusElement,
|
|
7885
8090
|
hasArrow,
|
|
7886
8091
|
isOpen,
|
|
7887
8092
|
onClose,
|
|
7888
8093
|
parentElement,
|
|
7889
|
-
usePortal = DEFAULT_PROPS$
|
|
7890
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
8094
|
+
usePortal = DEFAULT_PROPS$V.usePortal,
|
|
8095
|
+
focusAnchorOnClose = DEFAULT_PROPS$V.focusAnchorOnClose,
|
|
7891
8096
|
withFocusTrap,
|
|
7892
8097
|
boundaryRef,
|
|
7893
8098
|
fitToAnchorWidth,
|
|
7894
8099
|
fitWithinViewportHeight,
|
|
7895
8100
|
focusTrapZoneElement,
|
|
7896
8101
|
offset,
|
|
7897
|
-
placement = DEFAULT_PROPS$
|
|
8102
|
+
placement = DEFAULT_PROPS$V.placement,
|
|
7898
8103
|
style,
|
|
7899
8104
|
theme,
|
|
7900
|
-
zIndex = DEFAULT_PROPS$
|
|
8105
|
+
zIndex = DEFAULT_PROPS$V.zIndex,
|
|
7901
8106
|
...forwardedProps
|
|
7902
8107
|
} = props;
|
|
7903
8108
|
const popoverRef = useRef(null);
|
|
@@ -7983,7 +8188,7 @@ const Popover = skipRender(
|
|
|
7983
8188
|
() => Boolean(DOCUMENT), _InnerPopover);
|
|
7984
8189
|
Popover.displayName = COMPONENT_NAME$Z;
|
|
7985
8190
|
Popover.className = CLASSNAME$Z;
|
|
7986
|
-
Popover.defaultProps = DEFAULT_PROPS$
|
|
8191
|
+
Popover.defaultProps = DEFAULT_PROPS$V;
|
|
7987
8192
|
|
|
7988
8193
|
// The error margin in px we want to have for triggering infinite scroll
|
|
7989
8194
|
const SCROLL_TRIGGER_MARGIN = 5;
|
|
@@ -8043,7 +8248,7 @@ const {
|
|
|
8043
8248
|
/**
|
|
8044
8249
|
* Component default props.
|
|
8045
8250
|
*/
|
|
8046
|
-
const DEFAULT_PROPS$
|
|
8251
|
+
const DEFAULT_PROPS$U = {
|
|
8047
8252
|
closeOnClick: true,
|
|
8048
8253
|
closeOnClickAway: true,
|
|
8049
8254
|
closeOnEscape: true,
|
|
@@ -8066,18 +8271,18 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
8066
8271
|
anchorRef,
|
|
8067
8272
|
children,
|
|
8068
8273
|
className,
|
|
8069
|
-
closeOnClick = DEFAULT_PROPS$
|
|
8070
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
8071
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
8072
|
-
fitToAnchorWidth = DEFAULT_PROPS$
|
|
8073
|
-
fitWithinViewportHeight = DEFAULT_PROPS$
|
|
8274
|
+
closeOnClick = DEFAULT_PROPS$U.closeOnClick,
|
|
8275
|
+
closeOnClickAway = DEFAULT_PROPS$U.closeOnClickAway,
|
|
8276
|
+
closeOnEscape = DEFAULT_PROPS$U.closeOnEscape,
|
|
8277
|
+
fitToAnchorWidth = DEFAULT_PROPS$U.fitToAnchorWidth,
|
|
8278
|
+
fitWithinViewportHeight = DEFAULT_PROPS$U.fitWithinViewportHeight,
|
|
8074
8279
|
isOpen,
|
|
8075
8280
|
offset,
|
|
8076
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
8281
|
+
focusAnchorOnClose = DEFAULT_PROPS$U.focusAnchorOnClose,
|
|
8077
8282
|
onClose,
|
|
8078
8283
|
onInfiniteScroll,
|
|
8079
|
-
placement = DEFAULT_PROPS$
|
|
8080
|
-
shouldFocusOnOpen = DEFAULT_PROPS$
|
|
8284
|
+
placement = DEFAULT_PROPS$U.placement,
|
|
8285
|
+
shouldFocusOnOpen = DEFAULT_PROPS$U.shouldFocusOnOpen,
|
|
8081
8286
|
zIndex,
|
|
8082
8287
|
...forwardedProps
|
|
8083
8288
|
} = props;
|
|
@@ -8123,7 +8328,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
8123
8328
|
});
|
|
8124
8329
|
Dropdown.displayName = COMPONENT_NAME$Y;
|
|
8125
8330
|
Dropdown.className = CLASSNAME$Y;
|
|
8126
|
-
Dropdown.defaultProps = DEFAULT_PROPS$
|
|
8331
|
+
Dropdown.defaultProps = DEFAULT_PROPS$U;
|
|
8127
8332
|
|
|
8128
8333
|
/**
|
|
8129
8334
|
* Component display name.
|
|
@@ -8142,7 +8347,7 @@ const {
|
|
|
8142
8347
|
/**
|
|
8143
8348
|
* Component default props.
|
|
8144
8349
|
*/
|
|
8145
|
-
const DEFAULT_PROPS$
|
|
8350
|
+
const DEFAULT_PROPS$T = {
|
|
8146
8351
|
closeMode: 'unmount'
|
|
8147
8352
|
};
|
|
8148
8353
|
const isDragHandle = isComponent(DragHandle);
|
|
@@ -8160,7 +8365,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
8160
8365
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
8161
8366
|
const {
|
|
8162
8367
|
className,
|
|
8163
|
-
closeMode = DEFAULT_PROPS$
|
|
8368
|
+
closeMode = DEFAULT_PROPS$T.closeMode,
|
|
8164
8369
|
children: anyChildren,
|
|
8165
8370
|
hasBackground,
|
|
8166
8371
|
hasHeaderDivider,
|
|
@@ -8277,11 +8482,11 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
8277
8482
|
});
|
|
8278
8483
|
ExpansionPanel.displayName = COMPONENT_NAME$X;
|
|
8279
8484
|
ExpansionPanel.className = CLASSNAME$X;
|
|
8280
|
-
ExpansionPanel.defaultProps = DEFAULT_PROPS$
|
|
8485
|
+
ExpansionPanel.defaultProps = DEFAULT_PROPS$T;
|
|
8281
8486
|
|
|
8282
8487
|
const COMPONENT_NAME$W = 'Flag';
|
|
8283
8488
|
const CLASSNAME$W = 'lumx-flag';
|
|
8284
|
-
const DEFAULT_PROPS$
|
|
8489
|
+
const DEFAULT_PROPS$S = {};
|
|
8285
8490
|
const {
|
|
8286
8491
|
block: block$N,
|
|
8287
8492
|
element: element$B
|
|
@@ -8345,7 +8550,7 @@ const Flag = forwardRef((props, ref) => {
|
|
|
8345
8550
|
});
|
|
8346
8551
|
Flag.displayName = COMPONENT_NAME$W;
|
|
8347
8552
|
Flag.className = CLASSNAME$W;
|
|
8348
|
-
Flag.defaultProps = DEFAULT_PROPS$
|
|
8553
|
+
Flag.defaultProps = DEFAULT_PROPS$S;
|
|
8349
8554
|
|
|
8350
8555
|
/**
|
|
8351
8556
|
* Defines the props of the component.
|
|
@@ -8438,7 +8643,7 @@ const {
|
|
|
8438
8643
|
/**
|
|
8439
8644
|
* Component default props.
|
|
8440
8645
|
*/
|
|
8441
|
-
const DEFAULT_PROPS$
|
|
8646
|
+
const DEFAULT_PROPS$R = {
|
|
8442
8647
|
gap: Size$1.big,
|
|
8443
8648
|
orientation: Orientation$1.horizontal
|
|
8444
8649
|
};
|
|
@@ -8468,8 +8673,8 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
8468
8673
|
children,
|
|
8469
8674
|
actions,
|
|
8470
8675
|
actionsProps,
|
|
8471
|
-
gap = DEFAULT_PROPS$
|
|
8472
|
-
orientation = DEFAULT_PROPS$
|
|
8676
|
+
gap = DEFAULT_PROPS$R.gap,
|
|
8677
|
+
orientation = DEFAULT_PROPS$R.orientation,
|
|
8473
8678
|
contentProps,
|
|
8474
8679
|
...forwardedProps
|
|
8475
8680
|
} = props;
|
|
@@ -8523,7 +8728,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
8523
8728
|
});
|
|
8524
8729
|
BaseGenericBlock.displayName = COMPONENT_NAME$U;
|
|
8525
8730
|
BaseGenericBlock.className = CLASSNAME$U;
|
|
8526
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS$
|
|
8731
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS$R;
|
|
8527
8732
|
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
8528
8733
|
Figure,
|
|
8529
8734
|
Content,
|
|
@@ -8571,7 +8776,7 @@ const CLASSNAME$T = 'lumx-heading';
|
|
|
8571
8776
|
/**
|
|
8572
8777
|
* Component default props.
|
|
8573
8778
|
*/
|
|
8574
|
-
const DEFAULT_PROPS$
|
|
8779
|
+
const DEFAULT_PROPS$Q = {};
|
|
8575
8780
|
|
|
8576
8781
|
/**
|
|
8577
8782
|
* Get Heading component common props
|
|
@@ -8672,7 +8877,7 @@ const {
|
|
|
8672
8877
|
/**
|
|
8673
8878
|
* Component default props.
|
|
8674
8879
|
*/
|
|
8675
|
-
const DEFAULT_PROPS$
|
|
8880
|
+
const DEFAULT_PROPS$P = {};
|
|
8676
8881
|
|
|
8677
8882
|
/**
|
|
8678
8883
|
* Text component common props
|
|
@@ -8759,7 +8964,7 @@ const Text = forwardRef((props, ref) => {
|
|
|
8759
8964
|
});
|
|
8760
8965
|
Text.displayName = COMPONENT_NAME$S;
|
|
8761
8966
|
Text.className = CLASSNAME$S;
|
|
8762
|
-
Text.defaultProps = DEFAULT_PROPS$
|
|
8967
|
+
Text.defaultProps = DEFAULT_PROPS$P;
|
|
8763
8968
|
|
|
8764
8969
|
const HeadingLevelContext = /*#__PURE__*/createContext(defaultContext);
|
|
8765
8970
|
|
|
@@ -8796,7 +9001,7 @@ const Heading = forwardRef((props, ref) => {
|
|
|
8796
9001
|
});
|
|
8797
9002
|
Heading.displayName = COMPONENT_NAME$T;
|
|
8798
9003
|
Heading.className = CLASSNAME$T;
|
|
8799
|
-
Heading.defaultProps = DEFAULT_PROPS$
|
|
9004
|
+
Heading.defaultProps = DEFAULT_PROPS$Q;
|
|
8800
9005
|
|
|
8801
9006
|
/**
|
|
8802
9007
|
* Computes the next heading level based on the optional prop level or the parent context level.
|
|
@@ -8847,7 +9052,7 @@ const {
|
|
|
8847
9052
|
/**
|
|
8848
9053
|
* Component default props.
|
|
8849
9054
|
*/
|
|
8850
|
-
const DEFAULT_PROPS$
|
|
9055
|
+
const DEFAULT_PROPS$O = {
|
|
8851
9056
|
orientation: Orientation$1.horizontal,
|
|
8852
9057
|
wrap: 'nowrap'
|
|
8853
9058
|
};
|
|
@@ -8865,9 +9070,9 @@ const Grid = forwardRef((props, ref) => {
|
|
|
8865
9070
|
className,
|
|
8866
9071
|
gutter,
|
|
8867
9072
|
hAlign,
|
|
8868
|
-
orientation = DEFAULT_PROPS$
|
|
9073
|
+
orientation = DEFAULT_PROPS$O.orientation,
|
|
8869
9074
|
vAlign,
|
|
8870
|
-
wrap = DEFAULT_PROPS$
|
|
9075
|
+
wrap = DEFAULT_PROPS$O.wrap,
|
|
8871
9076
|
...forwardedProps
|
|
8872
9077
|
} = props;
|
|
8873
9078
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -8885,7 +9090,7 @@ const Grid = forwardRef((props, ref) => {
|
|
|
8885
9090
|
});
|
|
8886
9091
|
Grid.displayName = COMPONENT_NAME$R;
|
|
8887
9092
|
Grid.className = CLASSNAME$R;
|
|
8888
|
-
Grid.defaultProps = DEFAULT_PROPS$
|
|
9093
|
+
Grid.defaultProps = DEFAULT_PROPS$O;
|
|
8889
9094
|
|
|
8890
9095
|
/**
|
|
8891
9096
|
* Component display name.
|
|
@@ -8943,7 +9148,7 @@ const CLASSNAME$P = 'lumx-grid-column';
|
|
|
8943
9148
|
/**
|
|
8944
9149
|
* Component default props.
|
|
8945
9150
|
*/
|
|
8946
|
-
const DEFAULT_PROPS$
|
|
9151
|
+
const DEFAULT_PROPS$N = {};
|
|
8947
9152
|
|
|
8948
9153
|
/**
|
|
8949
9154
|
* The GridColumn is a layout component that can display children in a grid
|
|
@@ -8951,10 +9156,9 @@ const DEFAULT_PROPS$I = {};
|
|
|
8951
9156
|
* with a number of column that reduce when there is not enough space for each item.
|
|
8952
9157
|
*
|
|
8953
9158
|
* @param props Component props.
|
|
8954
|
-
* @
|
|
8955
|
-
* @return React element.
|
|
9159
|
+
* @return JSX element.
|
|
8956
9160
|
*/
|
|
8957
|
-
const GridColumn =
|
|
9161
|
+
const GridColumn$1 = props => {
|
|
8958
9162
|
const {
|
|
8959
9163
|
as: Component = 'div',
|
|
8960
9164
|
gap,
|
|
@@ -8963,12 +9167,13 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
8963
9167
|
children,
|
|
8964
9168
|
className,
|
|
8965
9169
|
style = {},
|
|
9170
|
+
ref,
|
|
8966
9171
|
...forwardedProps
|
|
8967
9172
|
} = props;
|
|
8968
9173
|
return /*#__PURE__*/jsx(Component, {
|
|
8969
9174
|
...forwardedProps,
|
|
8970
9175
|
ref: ref,
|
|
8971
|
-
className:
|
|
9176
|
+
className: classnames(className, CLASSNAME$P),
|
|
8972
9177
|
style: {
|
|
8973
9178
|
...style,
|
|
8974
9179
|
['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
@@ -8977,10 +9182,40 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
8977
9182
|
},
|
|
8978
9183
|
children: children
|
|
8979
9184
|
});
|
|
9185
|
+
};
|
|
9186
|
+
GridColumn$1.displayName = COMPONENT_NAME$P;
|
|
9187
|
+
GridColumn$1.className = CLASSNAME$P;
|
|
9188
|
+
GridColumn$1.defaultProps = DEFAULT_PROPS$N;
|
|
9189
|
+
|
|
9190
|
+
/**
|
|
9191
|
+
* Defines the props of the component.
|
|
9192
|
+
*/
|
|
9193
|
+
|
|
9194
|
+
// Re-export types for backward compatibility
|
|
9195
|
+
|
|
9196
|
+
/**
|
|
9197
|
+
* Component default props.
|
|
9198
|
+
*/
|
|
9199
|
+
const DEFAULT_PROPS$M = {};
|
|
9200
|
+
|
|
9201
|
+
/**
|
|
9202
|
+
* The GridColumn is a layout component that can display children in a grid
|
|
9203
|
+
* with custom display properties. It also comes with a responsive design,
|
|
9204
|
+
* with a number of column that reduce when there is not enough space for each item.
|
|
9205
|
+
*
|
|
9206
|
+
* @param props Component props.
|
|
9207
|
+
* @param ref Component ref.
|
|
9208
|
+
* @return React element.
|
|
9209
|
+
*/
|
|
9210
|
+
const GridColumn = forwardRef((props, ref) => {
|
|
9211
|
+
return GridColumn$1({
|
|
9212
|
+
ref,
|
|
9213
|
+
...props
|
|
9214
|
+
});
|
|
8980
9215
|
});
|
|
8981
9216
|
GridColumn.displayName = COMPONENT_NAME$P;
|
|
8982
9217
|
GridColumn.className = CLASSNAME$P;
|
|
8983
|
-
GridColumn.defaultProps = DEFAULT_PROPS$
|
|
9218
|
+
GridColumn.defaultProps = DEFAULT_PROPS$M;
|
|
8984
9219
|
|
|
8985
9220
|
/**
|
|
8986
9221
|
* Icon component.
|
|
@@ -9098,7 +9333,7 @@ const {
|
|
|
9098
9333
|
/**
|
|
9099
9334
|
* Component default props.
|
|
9100
9335
|
*/
|
|
9101
|
-
const DEFAULT_PROPS$
|
|
9336
|
+
const DEFAULT_PROPS$L = {
|
|
9102
9337
|
captionPosition: ImageBlockCaptionPosition.below,
|
|
9103
9338
|
align: Alignment.left
|
|
9104
9339
|
};
|
|
@@ -9114,9 +9349,9 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
9114
9349
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
9115
9350
|
const {
|
|
9116
9351
|
actions,
|
|
9117
|
-
align = DEFAULT_PROPS$
|
|
9352
|
+
align = DEFAULT_PROPS$L.align,
|
|
9118
9353
|
alt,
|
|
9119
|
-
captionPosition = DEFAULT_PROPS$
|
|
9354
|
+
captionPosition = DEFAULT_PROPS$L.captionPosition,
|
|
9120
9355
|
captionStyle,
|
|
9121
9356
|
className,
|
|
9122
9357
|
description,
|
|
@@ -9170,7 +9405,7 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
9170
9405
|
});
|
|
9171
9406
|
ImageBlock.displayName = COMPONENT_NAME$O;
|
|
9172
9407
|
ImageBlock.className = CLASSNAME$O;
|
|
9173
|
-
ImageBlock.defaultProps = DEFAULT_PROPS$
|
|
9408
|
+
ImageBlock.defaultProps = DEFAULT_PROPS$L;
|
|
9174
9409
|
|
|
9175
9410
|
/**
|
|
9176
9411
|
* Component display name.
|
|
@@ -9930,7 +10165,7 @@ const {
|
|
|
9930
10165
|
/**
|
|
9931
10166
|
* Component default props.
|
|
9932
10167
|
*/
|
|
9933
|
-
const DEFAULT_PROPS$
|
|
10168
|
+
const DEFAULT_PROPS$K = {};
|
|
9934
10169
|
|
|
9935
10170
|
/**
|
|
9936
10171
|
* InlineList component.
|
|
@@ -9983,7 +10218,7 @@ const InlineList = forwardRef((props, ref) => {
|
|
|
9983
10218
|
});
|
|
9984
10219
|
InlineList.displayName = COMPONENT_NAME$M;
|
|
9985
10220
|
InlineList.className = CLASSNAME$M;
|
|
9986
|
-
InlineList.defaultProps = DEFAULT_PROPS$
|
|
10221
|
+
InlineList.defaultProps = DEFAULT_PROPS$K;
|
|
9987
10222
|
|
|
9988
10223
|
/**
|
|
9989
10224
|
* InputHelper component.
|
|
@@ -10161,20 +10396,6 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
10161
10396
|
Lightbox.displayName = COMPONENT_NAME$L;
|
|
10162
10397
|
Lightbox.className = CLASSNAME$L;
|
|
10163
10398
|
|
|
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
|
|
10175
|
-
});
|
|
10176
|
-
});
|
|
10177
|
-
|
|
10178
10399
|
/**
|
|
10179
10400
|
* Component display name.
|
|
10180
10401
|
*/
|
|
@@ -10187,66 +10408,155 @@ const CLASSNAME$K = 'lumx-link';
|
|
|
10187
10408
|
const {
|
|
10188
10409
|
block: block$E,
|
|
10189
10410
|
element: element$u
|
|
10190
|
-
} =
|
|
10411
|
+
} = bem(CLASSNAME$K);
|
|
10191
10412
|
|
|
10192
10413
|
/**
|
|
10193
|
-
* Link component.
|
|
10414
|
+
* Link component (Core UI).
|
|
10194
10415
|
*
|
|
10195
10416
|
* @param props Component props.
|
|
10196
|
-
* @
|
|
10197
|
-
* @return React element.
|
|
10417
|
+
* @return JSX element.
|
|
10198
10418
|
*/
|
|
10199
|
-
const Link =
|
|
10200
|
-
const {
|
|
10201
|
-
disabledStateProps,
|
|
10202
|
-
otherProps
|
|
10203
|
-
} = useDisableStateProps(props);
|
|
10419
|
+
const Link$1 = props => {
|
|
10204
10420
|
const {
|
|
10205
|
-
|
|
10421
|
+
label,
|
|
10206
10422
|
className,
|
|
10207
10423
|
color: propColor,
|
|
10208
10424
|
colorVariant: propColorVariant,
|
|
10209
10425
|
leftIcon,
|
|
10210
10426
|
rightIcon,
|
|
10211
|
-
typography,
|
|
10212
|
-
|
|
10427
|
+
typography: typography$1,
|
|
10428
|
+
as,
|
|
10429
|
+
ref,
|
|
10430
|
+
isDisabled,
|
|
10431
|
+
theme,
|
|
10432
|
+
href,
|
|
10433
|
+
target,
|
|
10434
|
+
onClick,
|
|
10213
10435
|
...forwardedProps
|
|
10214
|
-
} =
|
|
10436
|
+
} = props;
|
|
10215
10437
|
const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
}
|
|
10226
|
-
|
|
10227
|
-
|
|
10438
|
+
|
|
10439
|
+
// Determine element type
|
|
10440
|
+
const ElementType = as || (href ? 'a' : 'button');
|
|
10441
|
+
|
|
10442
|
+
// Build disabled props
|
|
10443
|
+
const disabledProps = {};
|
|
10444
|
+
if (isDisabled) {
|
|
10445
|
+
if (ElementType === 'button' || !href && !as) {
|
|
10446
|
+
disabledProps.disabled = true;
|
|
10447
|
+
} else {
|
|
10448
|
+
disabledProps['aria-disabled'] = true;
|
|
10449
|
+
disabledProps.tabIndex = -1;
|
|
10450
|
+
}
|
|
10451
|
+
}
|
|
10452
|
+
|
|
10453
|
+
// Build class name
|
|
10454
|
+
const combinedClassName = classnames(className, block$E({
|
|
10455
|
+
[`color-${color}`]: Boolean(color),
|
|
10456
|
+
[`color-variant-${colorVariant}`]: Boolean(colorVariant),
|
|
10457
|
+
'has-typography': !!typography$1
|
|
10458
|
+
}), typography$1 && typography(typography$1));
|
|
10459
|
+
|
|
10460
|
+
// Build content with proper spacing for icons
|
|
10461
|
+
const content = /*#__PURE__*/jsxs(Fragment, {
|
|
10462
|
+
children: [leftIcon && /*#__PURE__*/jsxs(Fragment, {
|
|
10463
|
+
children: [" ", Icon$1({
|
|
10228
10464
|
icon: leftIcon,
|
|
10229
10465
|
className: element$u('left-icon')
|
|
10230
|
-
}),
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10466
|
+
}), " "]
|
|
10467
|
+
}), label && /*#__PURE__*/jsx("span", {
|
|
10468
|
+
className: element$u('content'),
|
|
10469
|
+
children: label
|
|
10470
|
+
}), rightIcon && /*#__PURE__*/jsxs(Fragment, {
|
|
10471
|
+
children: [" ", Icon$1({
|
|
10234
10472
|
icon: rightIcon,
|
|
10235
10473
|
className: element$u('right-icon')
|
|
10236
|
-
})]
|
|
10237
|
-
})
|
|
10474
|
+
}), " "]
|
|
10475
|
+
})]
|
|
10238
10476
|
});
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10477
|
+
|
|
10478
|
+
// Build element props
|
|
10479
|
+
const elementProps = {
|
|
10480
|
+
ref,
|
|
10481
|
+
className: combinedClassName,
|
|
10482
|
+
onClick: isDisabled ? undefined : onClick,
|
|
10483
|
+
...forwardedProps,
|
|
10484
|
+
...disabledProps
|
|
10485
|
+
};
|
|
10486
|
+
if (href) {
|
|
10487
|
+
elementProps.href = href;
|
|
10488
|
+
}
|
|
10489
|
+
if (target) {
|
|
10490
|
+
elementProps.target = target;
|
|
10491
|
+
}
|
|
10492
|
+
return /*#__PURE__*/jsx(ElementType, {
|
|
10493
|
+
...elementProps,
|
|
10494
|
+
children: content
|
|
10495
|
+
});
|
|
10496
|
+
};
|
|
10242
10497
|
|
|
10243
10498
|
/**
|
|
10244
|
-
*
|
|
10499
|
+
* Defines the props of the component.
|
|
10245
10500
|
*/
|
|
10246
|
-
const COMPONENT_NAME$J = 'LinkPreview';
|
|
10247
10501
|
|
|
10248
10502
|
/**
|
|
10249
|
-
* Component default
|
|
10503
|
+
* Component default props.
|
|
10504
|
+
*/
|
|
10505
|
+
const DEFAULT_PROPS$J = {};
|
|
10506
|
+
|
|
10507
|
+
/**
|
|
10508
|
+
* Link component.
|
|
10509
|
+
*
|
|
10510
|
+
* @param props Component props.
|
|
10511
|
+
* @param ref Component ref.
|
|
10512
|
+
* @return React element.
|
|
10513
|
+
*/
|
|
10514
|
+
const Link = forwardRef((props, ref) => {
|
|
10515
|
+
const {
|
|
10516
|
+
isAnyDisabled,
|
|
10517
|
+
disabledStateProps,
|
|
10518
|
+
otherProps
|
|
10519
|
+
} = useDisableStateProps(props);
|
|
10520
|
+
const {
|
|
10521
|
+
children,
|
|
10522
|
+
className,
|
|
10523
|
+
color,
|
|
10524
|
+
colorVariant,
|
|
10525
|
+
leftIcon,
|
|
10526
|
+
rightIcon,
|
|
10527
|
+
typography,
|
|
10528
|
+
linkAs,
|
|
10529
|
+
...forwardedProps
|
|
10530
|
+
} = otherProps;
|
|
10531
|
+
|
|
10532
|
+
// Wrap children with spaces if they contain icons
|
|
10533
|
+
const label = wrapChildrenIconWithSpaces(children);
|
|
10534
|
+
return Link$1({
|
|
10535
|
+
ref,
|
|
10536
|
+
label,
|
|
10537
|
+
className,
|
|
10538
|
+
color,
|
|
10539
|
+
colorVariant,
|
|
10540
|
+
leftIcon,
|
|
10541
|
+
rightIcon,
|
|
10542
|
+
typography,
|
|
10543
|
+
as: linkAs,
|
|
10544
|
+
...forwardedProps,
|
|
10545
|
+
...disabledStateProps,
|
|
10546
|
+
isDisabled: isAnyDisabled
|
|
10547
|
+
});
|
|
10548
|
+
});
|
|
10549
|
+
Link.displayName = COMPONENT_NAME$K;
|
|
10550
|
+
Link.className = CLASSNAME$K;
|
|
10551
|
+
Link.defaultProps = DEFAULT_PROPS$J;
|
|
10552
|
+
|
|
10553
|
+
/**
|
|
10554
|
+
* Component display name.
|
|
10555
|
+
*/
|
|
10556
|
+
const COMPONENT_NAME$J = 'LinkPreview';
|
|
10557
|
+
|
|
10558
|
+
/**
|
|
10559
|
+
* Component default class name and class prefix.
|
|
10250
10560
|
*/
|
|
10251
10561
|
const CLASSNAME$J = 'lumx-link-preview';
|
|
10252
10562
|
const {
|
|
@@ -10257,7 +10567,7 @@ const {
|
|
|
10257
10567
|
/**
|
|
10258
10568
|
* Component default props.
|
|
10259
10569
|
*/
|
|
10260
|
-
const DEFAULT_PROPS$
|
|
10570
|
+
const DEFAULT_PROPS$I = {
|
|
10261
10571
|
size: Size$1.regular,
|
|
10262
10572
|
titleHeading: 'h2'
|
|
10263
10573
|
};
|
|
@@ -10277,11 +10587,11 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
10277
10587
|
link,
|
|
10278
10588
|
linkAs,
|
|
10279
10589
|
linkProps,
|
|
10280
|
-
size = DEFAULT_PROPS$
|
|
10590
|
+
size = DEFAULT_PROPS$I.size,
|
|
10281
10591
|
theme = defaultTheme,
|
|
10282
10592
|
thumbnailProps,
|
|
10283
10593
|
title,
|
|
10284
|
-
titleHeading = DEFAULT_PROPS$
|
|
10594
|
+
titleHeading = DEFAULT_PROPS$I.titleHeading,
|
|
10285
10595
|
...forwardedProps
|
|
10286
10596
|
} = props;
|
|
10287
10597
|
// Use title heading as title wrapper (see DEFAULT_PROPS for the default value).
|
|
@@ -10308,7 +10618,7 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
10308
10618
|
// Avoid redundant links in focus order
|
|
10309
10619
|
tabIndex: -1
|
|
10310
10620
|
},
|
|
10311
|
-
aspectRatio: AspectRatio.free,
|
|
10621
|
+
aspectRatio: AspectRatio$1.free,
|
|
10312
10622
|
fillHeight: true
|
|
10313
10623
|
})
|
|
10314
10624
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -10349,7 +10659,7 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
10349
10659
|
});
|
|
10350
10660
|
LinkPreview.displayName = COMPONENT_NAME$J;
|
|
10351
10661
|
LinkPreview.className = CLASSNAME$J;
|
|
10352
|
-
LinkPreview.defaultProps = DEFAULT_PROPS$
|
|
10662
|
+
LinkPreview.defaultProps = DEFAULT_PROPS$I;
|
|
10353
10663
|
|
|
10354
10664
|
/**
|
|
10355
10665
|
* Render link with default <a> HTML component or a custom one provided by `linkAs`.
|
|
@@ -10382,7 +10692,7 @@ const {
|
|
|
10382
10692
|
/**
|
|
10383
10693
|
* Component default props.
|
|
10384
10694
|
*/
|
|
10385
|
-
const DEFAULT_PROPS$
|
|
10695
|
+
const DEFAULT_PROPS$H = {
|
|
10386
10696
|
size: Size$1.regular
|
|
10387
10697
|
};
|
|
10388
10698
|
|
|
@@ -10421,7 +10731,7 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
10421
10731
|
linkProps = {},
|
|
10422
10732
|
linkRef,
|
|
10423
10733
|
onItemSelected,
|
|
10424
|
-
size = DEFAULT_PROPS$
|
|
10734
|
+
size = DEFAULT_PROPS$H.size,
|
|
10425
10735
|
...forwardedProps
|
|
10426
10736
|
} = otherProps;
|
|
10427
10737
|
const role = linkAs || linkProps.href ? 'link' : 'button';
|
|
@@ -10478,7 +10788,7 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
10478
10788
|
});
|
|
10479
10789
|
ListItem.displayName = COMPONENT_NAME$I;
|
|
10480
10790
|
ListItem.className = CLASSNAME$I;
|
|
10481
|
-
ListItem.defaultProps = DEFAULT_PROPS$
|
|
10791
|
+
ListItem.defaultProps = DEFAULT_PROPS$H;
|
|
10482
10792
|
|
|
10483
10793
|
/**
|
|
10484
10794
|
* Component display name.
|
|
@@ -10666,7 +10976,7 @@ const {
|
|
|
10666
10976
|
/**
|
|
10667
10977
|
* Component default props.
|
|
10668
10978
|
*/
|
|
10669
|
-
const DEFAULT_PROPS$
|
|
10979
|
+
const DEFAULT_PROPS$G = {};
|
|
10670
10980
|
|
|
10671
10981
|
/**
|
|
10672
10982
|
* Mosaic component.
|
|
@@ -10717,7 +11027,7 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
10717
11027
|
align: align || Alignment.left,
|
|
10718
11028
|
image: image,
|
|
10719
11029
|
theme: theme,
|
|
10720
|
-
aspectRatio: AspectRatio.free,
|
|
11030
|
+
aspectRatio: AspectRatio$1.free,
|
|
10721
11031
|
fillHeight: true,
|
|
10722
11032
|
onClick: handleImageClick?.(index, onClick) || onClick
|
|
10723
11033
|
}), thumbnails.length > 4 && index === 3 && /*#__PURE__*/jsx("div", {
|
|
@@ -10733,7 +11043,21 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
10733
11043
|
});
|
|
10734
11044
|
Mosaic.displayName = COMPONENT_NAME$E;
|
|
10735
11045
|
Mosaic.className = CLASSNAME$E;
|
|
10736
|
-
Mosaic.defaultProps = DEFAULT_PROPS$
|
|
11046
|
+
Mosaic.defaultProps = DEFAULT_PROPS$G;
|
|
11047
|
+
|
|
11048
|
+
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
11049
|
+
const forwardRefPolymorphic = React__default.forwardRef;
|
|
11050
|
+
|
|
11051
|
+
/**
|
|
11052
|
+
* Render clickable element (link, button or custom element)
|
|
11053
|
+
* (also does some basic disabled state handling)
|
|
11054
|
+
*/
|
|
11055
|
+
const RawClickable = forwardRefPolymorphic((props, ref) => {
|
|
11056
|
+
return RawClickable$1({
|
|
11057
|
+
ref,
|
|
11058
|
+
...props
|
|
11059
|
+
});
|
|
11060
|
+
});
|
|
10737
11061
|
|
|
10738
11062
|
const NavigationContext = /*#__PURE__*/createContext({
|
|
10739
11063
|
orientation: Orientation$1.vertical
|
|
@@ -10922,7 +11246,7 @@ const {
|
|
|
10922
11246
|
/**
|
|
10923
11247
|
* Component default props
|
|
10924
11248
|
*/
|
|
10925
|
-
const DEFAULT_PROPS$
|
|
11249
|
+
const DEFAULT_PROPS$F = {
|
|
10926
11250
|
orientation: Orientation$1.vertical
|
|
10927
11251
|
};
|
|
10928
11252
|
const Navigation = forwardRef((props, ref) => {
|
|
@@ -10931,7 +11255,7 @@ const Navigation = forwardRef((props, ref) => {
|
|
|
10931
11255
|
children,
|
|
10932
11256
|
className,
|
|
10933
11257
|
theme = defaultTheme,
|
|
10934
|
-
orientation = DEFAULT_PROPS$
|
|
11258
|
+
orientation = DEFAULT_PROPS$F.orientation,
|
|
10935
11259
|
...forwardedProps
|
|
10936
11260
|
} = props;
|
|
10937
11261
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
@@ -10957,7 +11281,7 @@ const Navigation = forwardRef((props, ref) => {
|
|
|
10957
11281
|
});
|
|
10958
11282
|
Navigation.displayName = COMPONENT_NAME$C;
|
|
10959
11283
|
Navigation.className = CLASSNAME$C;
|
|
10960
|
-
Navigation.defaultProps = DEFAULT_PROPS$
|
|
11284
|
+
Navigation.defaultProps = DEFAULT_PROPS$F;
|
|
10961
11285
|
|
|
10962
11286
|
// Sub components
|
|
10963
11287
|
Navigation.Section = NavigationSection;
|
|
@@ -11002,7 +11326,7 @@ const {
|
|
|
11002
11326
|
/**
|
|
11003
11327
|
* Component default props.
|
|
11004
11328
|
*/
|
|
11005
|
-
const DEFAULT_PROPS$
|
|
11329
|
+
const DEFAULT_PROPS$E = {
|
|
11006
11330
|
zIndex: 9999,
|
|
11007
11331
|
usePortal: true
|
|
11008
11332
|
};
|
|
@@ -11026,8 +11350,8 @@ const Notification = forwardRef((props, ref) => {
|
|
|
11026
11350
|
onClick,
|
|
11027
11351
|
theme = defaultTheme,
|
|
11028
11352
|
type,
|
|
11029
|
-
zIndex = DEFAULT_PROPS$
|
|
11030
|
-
usePortal = DEFAULT_PROPS$
|
|
11353
|
+
zIndex = DEFAULT_PROPS$E.zIndex,
|
|
11354
|
+
usePortal = DEFAULT_PROPS$E.usePortal,
|
|
11031
11355
|
style,
|
|
11032
11356
|
...forwardedProps
|
|
11033
11357
|
} = props;
|
|
@@ -11092,7 +11416,7 @@ const Notification = forwardRef((props, ref) => {
|
|
|
11092
11416
|
});
|
|
11093
11417
|
Notification.displayName = COMPONENT_NAME$B;
|
|
11094
11418
|
Notification.className = CLASSNAME$B;
|
|
11095
|
-
Notification.defaultProps = DEFAULT_PROPS$
|
|
11419
|
+
Notification.defaultProps = DEFAULT_PROPS$E;
|
|
11096
11420
|
|
|
11097
11421
|
/**
|
|
11098
11422
|
* Component display name.
|
|
@@ -11107,7 +11431,7 @@ const CLASSNAME$A = 'lumx-popover-dialog';
|
|
|
11107
11431
|
/**
|
|
11108
11432
|
* Component default props.
|
|
11109
11433
|
*/
|
|
11110
|
-
const DEFAULT_PROPS$
|
|
11434
|
+
const DEFAULT_PROPS$D = {};
|
|
11111
11435
|
|
|
11112
11436
|
/**
|
|
11113
11437
|
* PopoverDialog component.
|
|
@@ -11150,7 +11474,7 @@ const PopoverDialog = forwardRef((props, ref) => {
|
|
|
11150
11474
|
});
|
|
11151
11475
|
PopoverDialog.displayName = COMPONENT_NAME$A;
|
|
11152
11476
|
PopoverDialog.className = CLASSNAME$A;
|
|
11153
|
-
PopoverDialog.defaultProps = DEFAULT_PROPS$
|
|
11477
|
+
PopoverDialog.defaultProps = DEFAULT_PROPS$D;
|
|
11154
11478
|
|
|
11155
11479
|
/**
|
|
11156
11480
|
* Component display name.
|
|
@@ -11169,7 +11493,7 @@ const {
|
|
|
11169
11493
|
/**
|
|
11170
11494
|
* Component default props.
|
|
11171
11495
|
*/
|
|
11172
|
-
const DEFAULT_PROPS$
|
|
11496
|
+
const DEFAULT_PROPS$C = {
|
|
11173
11497
|
orientation: Orientation$1.horizontal
|
|
11174
11498
|
};
|
|
11175
11499
|
|
|
@@ -11189,7 +11513,7 @@ const PostBlock = forwardRef((props, ref) => {
|
|
|
11189
11513
|
className,
|
|
11190
11514
|
meta,
|
|
11191
11515
|
onClick,
|
|
11192
|
-
orientation = DEFAULT_PROPS$
|
|
11516
|
+
orientation = DEFAULT_PROPS$C.orientation,
|
|
11193
11517
|
tags,
|
|
11194
11518
|
text,
|
|
11195
11519
|
theme = defaultTheme,
|
|
@@ -11251,7 +11575,7 @@ const PostBlock = forwardRef((props, ref) => {
|
|
|
11251
11575
|
});
|
|
11252
11576
|
PostBlock.displayName = COMPONENT_NAME$z;
|
|
11253
11577
|
PostBlock.className = CLASSNAME$z;
|
|
11254
|
-
PostBlock.defaultProps = DEFAULT_PROPS$
|
|
11578
|
+
PostBlock.defaultProps = DEFAULT_PROPS$C;
|
|
11255
11579
|
|
|
11256
11580
|
/**
|
|
11257
11581
|
* Component display name.
|
|
@@ -11270,7 +11594,7 @@ const {
|
|
|
11270
11594
|
/**
|
|
11271
11595
|
* Component default props.
|
|
11272
11596
|
*/
|
|
11273
|
-
const DEFAULT_PROPS$
|
|
11597
|
+
const DEFAULT_PROPS$B = {};
|
|
11274
11598
|
|
|
11275
11599
|
/**
|
|
11276
11600
|
* ProgressLinear component.
|
|
@@ -11301,7 +11625,7 @@ const ProgressLinear = forwardRef((props, ref) => {
|
|
|
11301
11625
|
});
|
|
11302
11626
|
ProgressLinear.displayName = COMPONENT_NAME$y;
|
|
11303
11627
|
ProgressLinear.className = CLASSNAME$y;
|
|
11304
|
-
ProgressLinear.defaultProps = DEFAULT_PROPS$
|
|
11628
|
+
ProgressLinear.defaultProps = DEFAULT_PROPS$B;
|
|
11305
11629
|
|
|
11306
11630
|
/**
|
|
11307
11631
|
* Component display name.
|
|
@@ -11320,7 +11644,7 @@ const {
|
|
|
11320
11644
|
/**
|
|
11321
11645
|
* Component default props.
|
|
11322
11646
|
*/
|
|
11323
|
-
const DEFAULT_PROPS$
|
|
11647
|
+
const DEFAULT_PROPS$A = {
|
|
11324
11648
|
size: Size$1.m,
|
|
11325
11649
|
display: 'block'
|
|
11326
11650
|
};
|
|
@@ -11337,8 +11661,8 @@ const ProgressCircular = forwardRef((props, ref) => {
|
|
|
11337
11661
|
const {
|
|
11338
11662
|
className,
|
|
11339
11663
|
theme = defaultTheme,
|
|
11340
|
-
size = DEFAULT_PROPS$
|
|
11341
|
-
display = DEFAULT_PROPS$
|
|
11664
|
+
size = DEFAULT_PROPS$A.size,
|
|
11665
|
+
display = DEFAULT_PROPS$A.display,
|
|
11342
11666
|
...forwardedProps
|
|
11343
11667
|
} = props;
|
|
11344
11668
|
const Element = display === 'block' ? 'div' : 'span';
|
|
@@ -11370,7 +11694,7 @@ const ProgressCircular = forwardRef((props, ref) => {
|
|
|
11370
11694
|
});
|
|
11371
11695
|
ProgressCircular.displayName = COMPONENT_NAME$x;
|
|
11372
11696
|
ProgressCircular.className = CLASSNAME$x;
|
|
11373
|
-
ProgressCircular.defaultProps = DEFAULT_PROPS$
|
|
11697
|
+
ProgressCircular.defaultProps = DEFAULT_PROPS$A;
|
|
11374
11698
|
|
|
11375
11699
|
const ProgressVariant = {
|
|
11376
11700
|
linear: 'linear',
|
|
@@ -11397,7 +11721,7 @@ const {
|
|
|
11397
11721
|
/**
|
|
11398
11722
|
* Component default props.
|
|
11399
11723
|
*/
|
|
11400
|
-
const DEFAULT_PROPS$
|
|
11724
|
+
const DEFAULT_PROPS$z = {
|
|
11401
11725
|
variant: ProgressVariant.circular
|
|
11402
11726
|
};
|
|
11403
11727
|
|
|
@@ -11414,7 +11738,7 @@ const Progress = forwardRef((props, ref) => {
|
|
|
11414
11738
|
const {
|
|
11415
11739
|
className,
|
|
11416
11740
|
theme = defaultTheme,
|
|
11417
|
-
variant = DEFAULT_PROPS$
|
|
11741
|
+
variant = DEFAULT_PROPS$z.variant,
|
|
11418
11742
|
...forwardedProps
|
|
11419
11743
|
} = props;
|
|
11420
11744
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -11433,7 +11757,7 @@ const Progress = forwardRef((props, ref) => {
|
|
|
11433
11757
|
});
|
|
11434
11758
|
Progress.displayName = COMPONENT_NAME$w;
|
|
11435
11759
|
Progress.className = CLASSNAME$w;
|
|
11436
|
-
Progress.defaultProps = DEFAULT_PROPS$
|
|
11760
|
+
Progress.defaultProps = DEFAULT_PROPS$z;
|
|
11437
11761
|
|
|
11438
11762
|
const INIT_STATE = {
|
|
11439
11763
|
isLazy: true,
|
|
@@ -11560,7 +11884,7 @@ const useTabProviderContextState = () => {
|
|
|
11560
11884
|
return context?.[0];
|
|
11561
11885
|
};
|
|
11562
11886
|
|
|
11563
|
-
const DEFAULT_PROPS$
|
|
11887
|
+
const DEFAULT_PROPS$y = {
|
|
11564
11888
|
isLazy: INIT_STATE.isLazy,
|
|
11565
11889
|
shouldActivateOnFocus: INIT_STATE.shouldActivateOnFocus
|
|
11566
11890
|
};
|
|
@@ -11589,7 +11913,7 @@ const ProgressTrackerProvider = props => {
|
|
|
11589
11913
|
dispatch({
|
|
11590
11914
|
type: 'update',
|
|
11591
11915
|
payload: {
|
|
11592
|
-
...DEFAULT_PROPS$
|
|
11916
|
+
...DEFAULT_PROPS$y,
|
|
11593
11917
|
...propState,
|
|
11594
11918
|
activeTabIndex: propState.activeStepIndex || INIT_STATE.activeTabIndex
|
|
11595
11919
|
}
|
|
@@ -11612,7 +11936,7 @@ const ProgressTrackerProvider = props => {
|
|
|
11612
11936
|
children: children
|
|
11613
11937
|
});
|
|
11614
11938
|
};
|
|
11615
|
-
ProgressTrackerProvider.defaultProps = DEFAULT_PROPS$
|
|
11939
|
+
ProgressTrackerProvider.defaultProps = DEFAULT_PROPS$y;
|
|
11616
11940
|
|
|
11617
11941
|
const useRovingTabIndex = ({
|
|
11618
11942
|
parentRef,
|
|
@@ -11704,7 +12028,7 @@ const {
|
|
|
11704
12028
|
/**
|
|
11705
12029
|
* Component default props.
|
|
11706
12030
|
*/
|
|
11707
|
-
const DEFAULT_PROPS$
|
|
12031
|
+
const DEFAULT_PROPS$x = {};
|
|
11708
12032
|
|
|
11709
12033
|
/**
|
|
11710
12034
|
* ProgressTracker component.
|
|
@@ -11760,7 +12084,7 @@ const ProgressTracker = forwardRef((props, ref) => {
|
|
|
11760
12084
|
});
|
|
11761
12085
|
ProgressTracker.displayName = COMPONENT_NAME$v;
|
|
11762
12086
|
ProgressTracker.className = CLASSNAME$v;
|
|
11763
|
-
ProgressTracker.defaultProps = DEFAULT_PROPS$
|
|
12087
|
+
ProgressTracker.defaultProps = DEFAULT_PROPS$x;
|
|
11764
12088
|
|
|
11765
12089
|
/**
|
|
11766
12090
|
* Component display name.
|
|
@@ -11779,7 +12103,7 @@ const {
|
|
|
11779
12103
|
/**
|
|
11780
12104
|
* Component default props.
|
|
11781
12105
|
*/
|
|
11782
|
-
const DEFAULT_PROPS$
|
|
12106
|
+
const DEFAULT_PROPS$w = {};
|
|
11783
12107
|
|
|
11784
12108
|
/**
|
|
11785
12109
|
* ProgressTrackerStep component.
|
|
@@ -11874,7 +12198,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
|
|
|
11874
12198
|
});
|
|
11875
12199
|
ProgressTrackerStep.displayName = COMPONENT_NAME$u;
|
|
11876
12200
|
ProgressTrackerStep.className = CLASSNAME$u;
|
|
11877
|
-
ProgressTrackerStep.defaultProps = DEFAULT_PROPS$
|
|
12201
|
+
ProgressTrackerStep.defaultProps = DEFAULT_PROPS$w;
|
|
11878
12202
|
|
|
11879
12203
|
/**
|
|
11880
12204
|
* Component display name.
|
|
@@ -11892,7 +12216,7 @@ const {
|
|
|
11892
12216
|
/**
|
|
11893
12217
|
* Component default props.
|
|
11894
12218
|
*/
|
|
11895
|
-
const DEFAULT_PROPS$
|
|
12219
|
+
const DEFAULT_PROPS$v = {};
|
|
11896
12220
|
|
|
11897
12221
|
/**
|
|
11898
12222
|
* ProgressTrackerStepPanel component.
|
|
@@ -11928,7 +12252,7 @@ const ProgressTrackerStepPanel = forwardRef((props, ref) => {
|
|
|
11928
12252
|
});
|
|
11929
12253
|
ProgressTrackerStepPanel.displayName = COMPONENT_NAME$t;
|
|
11930
12254
|
ProgressTrackerStepPanel.className = CLASSNAME$t;
|
|
11931
|
-
ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$
|
|
12255
|
+
ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$v;
|
|
11932
12256
|
|
|
11933
12257
|
/**
|
|
11934
12258
|
* Component display name.
|
|
@@ -11942,27 +12266,15 @@ const CLASSNAME$s = 'lumx-radio-button';
|
|
|
11942
12266
|
const {
|
|
11943
12267
|
block: block$p,
|
|
11944
12268
|
element: element$h
|
|
11945
|
-
} =
|
|
11946
|
-
|
|
11947
|
-
/**
|
|
11948
|
-
* Component default props.
|
|
11949
|
-
*/
|
|
11950
|
-
const DEFAULT_PROPS$r = {};
|
|
12269
|
+
} = bem(CLASSNAME$s);
|
|
11951
12270
|
|
|
11952
12271
|
/**
|
|
11953
12272
|
* RadioButton component.
|
|
11954
12273
|
*
|
|
11955
12274
|
* @param props Component props.
|
|
11956
|
-
* @
|
|
11957
|
-
* @return React element.
|
|
12275
|
+
* @return JSX element.
|
|
11958
12276
|
*/
|
|
11959
|
-
const RadioButton =
|
|
11960
|
-
const {
|
|
11961
|
-
isAnyDisabled,
|
|
11962
|
-
disabledStateProps,
|
|
11963
|
-
otherProps
|
|
11964
|
-
} = useDisableStateProps(props);
|
|
11965
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
12277
|
+
const RadioButton$1 = props => {
|
|
11966
12278
|
const {
|
|
11967
12279
|
checked,
|
|
11968
12280
|
className,
|
|
@@ -11972,14 +12284,15 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
11972
12284
|
isChecked = checked,
|
|
11973
12285
|
label,
|
|
11974
12286
|
name,
|
|
12287
|
+
ref,
|
|
11975
12288
|
onChange,
|
|
11976
|
-
theme
|
|
12289
|
+
theme,
|
|
11977
12290
|
value,
|
|
11978
|
-
inputProps,
|
|
12291
|
+
inputProps = {},
|
|
12292
|
+
isDisabled,
|
|
12293
|
+
inputId,
|
|
11979
12294
|
...forwardedProps
|
|
11980
|
-
} =
|
|
11981
|
-
const generatedInputId = useId();
|
|
11982
|
-
const inputId = id || generatedInputId;
|
|
12295
|
+
} = props;
|
|
11983
12296
|
const handleChange = event => {
|
|
11984
12297
|
if (onChange) {
|
|
11985
12298
|
onChange(value, name, event);
|
|
@@ -11988,9 +12301,9 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
11988
12301
|
return /*#__PURE__*/jsxs("div", {
|
|
11989
12302
|
ref: ref,
|
|
11990
12303
|
...forwardedProps,
|
|
11991
|
-
className:
|
|
12304
|
+
className: classnames(className, block$p({
|
|
11992
12305
|
'is-checked': isChecked,
|
|
11993
|
-
'is-disabled':
|
|
12306
|
+
'is-disabled': isDisabled,
|
|
11994
12307
|
'is-unchecked': !isChecked,
|
|
11995
12308
|
[`theme-${theme}`]: Boolean(theme)
|
|
11996
12309
|
})),
|
|
@@ -11999,15 +12312,16 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
11999
12312
|
children: [/*#__PURE__*/jsx("input", {
|
|
12000
12313
|
ref: inputRef,
|
|
12001
12314
|
className: element$h('input-native'),
|
|
12002
|
-
...disabledStateProps,
|
|
12003
12315
|
id: inputId,
|
|
12004
12316
|
type: "radio",
|
|
12005
12317
|
name: name,
|
|
12006
12318
|
value: value,
|
|
12007
12319
|
checked: isChecked,
|
|
12008
12320
|
onChange: handleChange,
|
|
12009
|
-
readOnly: inputProps?.readOnly || isAnyDisabled,
|
|
12010
12321
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
12322
|
+
...(inputProps?.readOnly ? {
|
|
12323
|
+
readOnly: inputProps.readOnly
|
|
12324
|
+
} : {}),
|
|
12011
12325
|
...inputProps
|
|
12012
12326
|
}), /*#__PURE__*/jsxs("div", {
|
|
12013
12327
|
className: element$h('input-placeholder'),
|
|
@@ -12019,23 +12333,85 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
12019
12333
|
})]
|
|
12020
12334
|
}), /*#__PURE__*/jsxs("div", {
|
|
12021
12335
|
className: element$h('content'),
|
|
12022
|
-
children: [label &&
|
|
12336
|
+
children: [label && InputLabel$1({
|
|
12023
12337
|
htmlFor: inputId,
|
|
12024
|
-
theme: theme,
|
|
12025
12338
|
className: element$h('label'),
|
|
12339
|
+
theme,
|
|
12026
12340
|
children: label
|
|
12027
|
-
}), helper &&
|
|
12341
|
+
}), helper && InputHelper$1({
|
|
12028
12342
|
id: `${inputId}-helper`,
|
|
12029
|
-
theme: theme,
|
|
12030
12343
|
className: element$h('helper'),
|
|
12344
|
+
theme,
|
|
12031
12345
|
children: helper
|
|
12032
12346
|
})]
|
|
12033
12347
|
})]
|
|
12034
12348
|
});
|
|
12349
|
+
};
|
|
12350
|
+
|
|
12351
|
+
/**
|
|
12352
|
+
* Defines the props of the component.
|
|
12353
|
+
*/
|
|
12354
|
+
|
|
12355
|
+
/**
|
|
12356
|
+
* Component default props.
|
|
12357
|
+
*/
|
|
12358
|
+
const DEFAULT_PROPS$u = {};
|
|
12359
|
+
|
|
12360
|
+
/**
|
|
12361
|
+
* RadioButton component.
|
|
12362
|
+
*
|
|
12363
|
+
* @param props Component props.
|
|
12364
|
+
* @param ref Component ref.
|
|
12365
|
+
* @return React element.
|
|
12366
|
+
*/
|
|
12367
|
+
const RadioButton = forwardRef((props, ref) => {
|
|
12368
|
+
const {
|
|
12369
|
+
isAnyDisabled,
|
|
12370
|
+
disabledStateProps,
|
|
12371
|
+
otherProps
|
|
12372
|
+
} = useDisableStateProps(props);
|
|
12373
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
12374
|
+
const {
|
|
12375
|
+
checked,
|
|
12376
|
+
className,
|
|
12377
|
+
helper,
|
|
12378
|
+
id,
|
|
12379
|
+
inputRef,
|
|
12380
|
+
isChecked = checked,
|
|
12381
|
+
label,
|
|
12382
|
+
name,
|
|
12383
|
+
onChange,
|
|
12384
|
+
theme = defaultTheme,
|
|
12385
|
+
value,
|
|
12386
|
+
inputProps = {},
|
|
12387
|
+
...forwardedProps
|
|
12388
|
+
} = otherProps;
|
|
12389
|
+
const generatedInputId = useId();
|
|
12390
|
+
const inputId = id || generatedInputId;
|
|
12391
|
+
return RadioButton$1({
|
|
12392
|
+
ref,
|
|
12393
|
+
className,
|
|
12394
|
+
helper,
|
|
12395
|
+
inputRef,
|
|
12396
|
+
isChecked,
|
|
12397
|
+
label,
|
|
12398
|
+
name,
|
|
12399
|
+
onChange,
|
|
12400
|
+
theme,
|
|
12401
|
+
value,
|
|
12402
|
+
inputProps: {
|
|
12403
|
+
...inputProps,
|
|
12404
|
+
...disabledStateProps,
|
|
12405
|
+
readOnly: inputProps.readOnly || disabledStateProps['aria-disabled']
|
|
12406
|
+
},
|
|
12407
|
+
...forwardedProps,
|
|
12408
|
+
isDisabled: isAnyDisabled,
|
|
12409
|
+
inputId
|
|
12410
|
+
});
|
|
12035
12411
|
});
|
|
12036
12412
|
RadioButton.displayName = COMPONENT_NAME$s;
|
|
12037
12413
|
RadioButton.className = CLASSNAME$s;
|
|
12038
|
-
RadioButton.defaultProps = DEFAULT_PROPS$
|
|
12414
|
+
RadioButton.defaultProps = DEFAULT_PROPS$u;
|
|
12039
12415
|
|
|
12040
12416
|
/**
|
|
12041
12417
|
* Component display name.
|
|
@@ -12047,25 +12423,58 @@ const COMPONENT_NAME$r = 'RadioGroup';
|
|
|
12047
12423
|
*/
|
|
12048
12424
|
const CLASSNAME$r = 'lumx-radio-group';
|
|
12049
12425
|
|
|
12426
|
+
/**
|
|
12427
|
+
* Component default props.
|
|
12428
|
+
*/
|
|
12429
|
+
const DEFAULT_PROPS$t = {};
|
|
12430
|
+
|
|
12050
12431
|
/**
|
|
12051
12432
|
* RadioGroup component.
|
|
12052
12433
|
*
|
|
12053
12434
|
* @param props Component props.
|
|
12054
|
-
* @
|
|
12055
|
-
* @return React element.
|
|
12435
|
+
* @return JSX element.
|
|
12056
12436
|
*/
|
|
12057
|
-
const RadioGroup =
|
|
12437
|
+
const RadioGroup$1 = props => {
|
|
12058
12438
|
const {
|
|
12059
12439
|
children,
|
|
12060
12440
|
className,
|
|
12441
|
+
ref,
|
|
12061
12442
|
...forwardedProps
|
|
12062
12443
|
} = props;
|
|
12063
12444
|
return /*#__PURE__*/jsx("div", {
|
|
12064
12445
|
ref: ref,
|
|
12065
12446
|
...forwardedProps,
|
|
12066
|
-
className:
|
|
12447
|
+
className: classnames(className, CLASSNAME$r),
|
|
12067
12448
|
children: children
|
|
12068
12449
|
});
|
|
12450
|
+
};
|
|
12451
|
+
RadioGroup$1.displayName = COMPONENT_NAME$r;
|
|
12452
|
+
RadioGroup$1.className = CLASSNAME$r;
|
|
12453
|
+
RadioGroup$1.defaultProps = DEFAULT_PROPS$t;
|
|
12454
|
+
|
|
12455
|
+
/**
|
|
12456
|
+
* Defines the props of the component.
|
|
12457
|
+
*/
|
|
12458
|
+
|
|
12459
|
+
/**
|
|
12460
|
+
* RadioGroup component.
|
|
12461
|
+
*
|
|
12462
|
+
* @param props Component props.
|
|
12463
|
+
* @param ref Component ref.
|
|
12464
|
+
* @return React element.
|
|
12465
|
+
*/
|
|
12466
|
+
const RadioGroup = forwardRef((props, ref) => {
|
|
12467
|
+
const {
|
|
12468
|
+
children,
|
|
12469
|
+
className,
|
|
12470
|
+
...forwardedProps
|
|
12471
|
+
} = props;
|
|
12472
|
+
return RadioGroup$1({
|
|
12473
|
+
ref,
|
|
12474
|
+
className,
|
|
12475
|
+
children,
|
|
12476
|
+
...forwardedProps
|
|
12477
|
+
});
|
|
12069
12478
|
});
|
|
12070
12479
|
RadioGroup.displayName = COMPONENT_NAME$r;
|
|
12071
12480
|
RadioGroup.className = CLASSNAME$r;
|
|
@@ -12225,7 +12634,7 @@ const {
|
|
|
12225
12634
|
} = classNames.bem(CLASSNAME$p);
|
|
12226
12635
|
|
|
12227
12636
|
/** The default value of props. */
|
|
12228
|
-
const DEFAULT_PROPS$
|
|
12637
|
+
const DEFAULT_PROPS$s = {
|
|
12229
12638
|
selectedValueRender: choice => choice,
|
|
12230
12639
|
variant: SelectVariant.input
|
|
12231
12640
|
};
|
|
@@ -12348,7 +12757,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
12348
12757
|
const isEmpty$1 = isEmpty(props.value);
|
|
12349
12758
|
const hasInputClear = props.onClear && props.clearButtonProps && !isEmpty$1;
|
|
12350
12759
|
return WithSelectContext(SelectField, {
|
|
12351
|
-
...DEFAULT_PROPS$
|
|
12760
|
+
...DEFAULT_PROPS$s,
|
|
12352
12761
|
...props,
|
|
12353
12762
|
className: classNames.join(props.className, block$n({
|
|
12354
12763
|
'has-input-clear': hasInputClear,
|
|
@@ -12360,7 +12769,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
12360
12769
|
});
|
|
12361
12770
|
Select.displayName = COMPONENT_NAME$q;
|
|
12362
12771
|
Select.className = CLASSNAME$p;
|
|
12363
|
-
Select.defaultProps = DEFAULT_PROPS$
|
|
12772
|
+
Select.defaultProps = DEFAULT_PROPS$s;
|
|
12364
12773
|
Select.className = CLASSNAME$p;
|
|
12365
12774
|
|
|
12366
12775
|
/** The display name of the component. */
|
|
@@ -12374,7 +12783,7 @@ const {
|
|
|
12374
12783
|
} = classNames.bem(CLASSNAME$o);
|
|
12375
12784
|
|
|
12376
12785
|
/** The default value of props. */
|
|
12377
|
-
const DEFAULT_PROPS$
|
|
12786
|
+
const DEFAULT_PROPS$r = {
|
|
12378
12787
|
selectedChipRender(choice, index, onClear, isDisabled, theme) {
|
|
12379
12788
|
const onClick = event => onClear && onClear(event, choice);
|
|
12380
12789
|
return /*#__PURE__*/jsx(Chip, {
|
|
@@ -12397,6 +12806,8 @@ const SelectMultipleField = props => {
|
|
|
12397
12806
|
const defaultTheme = useTheme();
|
|
12398
12807
|
const {
|
|
12399
12808
|
anchorRef,
|
|
12809
|
+
// We don't have a clear button in select multiple but it must be removed from the forwardedProps
|
|
12810
|
+
clearButtonProps,
|
|
12400
12811
|
handleKeyboardNav,
|
|
12401
12812
|
hasError,
|
|
12402
12813
|
icon,
|
|
@@ -12500,7 +12911,7 @@ const SelectMultipleField = props => {
|
|
|
12500
12911
|
*/
|
|
12501
12912
|
const SelectMultiple = forwardRef((props, ref) => {
|
|
12502
12913
|
return WithSelectContext(SelectMultipleField, {
|
|
12503
|
-
...DEFAULT_PROPS$
|
|
12914
|
+
...DEFAULT_PROPS$r,
|
|
12504
12915
|
...props,
|
|
12505
12916
|
className: classNames.join(props.className, block$m({
|
|
12506
12917
|
'has-multiple': !props.isEmpty
|
|
@@ -12511,7 +12922,7 @@ const SelectMultiple = forwardRef((props, ref) => {
|
|
|
12511
12922
|
});
|
|
12512
12923
|
SelectMultiple.displayName = COMPONENT_NAME$p;
|
|
12513
12924
|
SelectMultiple.className = CLASSNAME$o;
|
|
12514
|
-
SelectMultiple.defaultProps = DEFAULT_PROPS$
|
|
12925
|
+
SelectMultiple.defaultProps = DEFAULT_PROPS$r;
|
|
12515
12926
|
|
|
12516
12927
|
/**
|
|
12517
12928
|
* Component display name.
|
|
@@ -12566,7 +12977,7 @@ const {
|
|
|
12566
12977
|
/**
|
|
12567
12978
|
* Component default props.
|
|
12568
12979
|
*/
|
|
12569
|
-
const DEFAULT_PROPS$
|
|
12980
|
+
const DEFAULT_PROPS$q = {
|
|
12570
12981
|
emphasis: Emphasis$1.high,
|
|
12571
12982
|
closeMode: 'unmount'
|
|
12572
12983
|
};
|
|
@@ -12582,7 +12993,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
12582
12993
|
const {
|
|
12583
12994
|
children,
|
|
12584
12995
|
className,
|
|
12585
|
-
emphasis = DEFAULT_PROPS$
|
|
12996
|
+
emphasis = DEFAULT_PROPS$q.emphasis,
|
|
12586
12997
|
icon,
|
|
12587
12998
|
isOpen,
|
|
12588
12999
|
isSelected,
|
|
@@ -12592,7 +13003,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
12592
13003
|
onActionClick,
|
|
12593
13004
|
onClick,
|
|
12594
13005
|
toggleButtonProps,
|
|
12595
|
-
closeMode = DEFAULT_PROPS$
|
|
13006
|
+
closeMode = DEFAULT_PROPS$q.closeMode,
|
|
12596
13007
|
...forwardedProps
|
|
12597
13008
|
} = props;
|
|
12598
13009
|
const content = children && Children.toArray(children).filter(isComponent(SideNavigationItem));
|
|
@@ -12663,9 +13074,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
12663
13074
|
});
|
|
12664
13075
|
SideNavigationItem.displayName = COMPONENT_NAME$n;
|
|
12665
13076
|
SideNavigationItem.className = CLASSNAME$m;
|
|
12666
|
-
SideNavigationItem.defaultProps = DEFAULT_PROPS$
|
|
12667
|
-
|
|
12668
|
-
const DEFAULT_PROPS$n = {};
|
|
13077
|
+
SideNavigationItem.defaultProps = DEFAULT_PROPS$q;
|
|
12669
13078
|
|
|
12670
13079
|
/**
|
|
12671
13080
|
* Component display name.
|
|
@@ -12678,38 +13087,37 @@ const COMPONENT_NAME$m = 'SkeletonCircle';
|
|
|
12678
13087
|
const CLASSNAME$l = 'lumx-skeleton-circle';
|
|
12679
13088
|
const {
|
|
12680
13089
|
block: block$k
|
|
12681
|
-
} =
|
|
13090
|
+
} = bem(CLASSNAME$l);
|
|
12682
13091
|
|
|
12683
13092
|
/**
|
|
12684
13093
|
* SkeletonCircle component.
|
|
12685
13094
|
*
|
|
12686
13095
|
* @param props Component props.
|
|
12687
|
-
* @
|
|
12688
|
-
* @return React element.
|
|
13096
|
+
* @return JSX element.
|
|
12689
13097
|
*/
|
|
12690
|
-
const SkeletonCircle =
|
|
12691
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
13098
|
+
const SkeletonCircle$1 = props => {
|
|
12692
13099
|
const {
|
|
12693
13100
|
className,
|
|
12694
13101
|
size,
|
|
12695
13102
|
color,
|
|
12696
|
-
theme
|
|
13103
|
+
theme,
|
|
13104
|
+
ref,
|
|
12697
13105
|
...forwardedProps
|
|
12698
13106
|
} = props;
|
|
12699
13107
|
return /*#__PURE__*/jsx("div", {
|
|
12700
13108
|
ref: ref,
|
|
12701
13109
|
...forwardedProps,
|
|
12702
|
-
className:
|
|
13110
|
+
className: classnames(className, block$k({
|
|
12703
13111
|
[`size-${size}`]: Boolean(size),
|
|
12704
13112
|
[`color-${color}`]: Boolean(color),
|
|
12705
13113
|
[`theme-${theme}`]: Boolean(theme)
|
|
12706
13114
|
}))
|
|
12707
13115
|
});
|
|
12708
|
-
}
|
|
12709
|
-
SkeletonCircle.displayName = COMPONENT_NAME$m;
|
|
12710
|
-
SkeletonCircle.defaultProps = DEFAULT_PROPS$n;
|
|
12711
|
-
SkeletonCircle.className = CLASSNAME$l;
|
|
13116
|
+
};
|
|
12712
13117
|
|
|
13118
|
+
/**
|
|
13119
|
+
* Skeleton variants.
|
|
13120
|
+
*/
|
|
12713
13121
|
const SkeletonRectangleVariant = {
|
|
12714
13122
|
squared: 'squared',
|
|
12715
13123
|
rounded: 'rounded',
|
|
@@ -12720,10 +13128,6 @@ const SkeletonRectangleVariant = {
|
|
|
12720
13128
|
* Defines the props of the component.
|
|
12721
13129
|
*/
|
|
12722
13130
|
|
|
12723
|
-
const DEFAULT_PROPS$m = {
|
|
12724
|
-
variant: SkeletonRectangleVariant.squared
|
|
12725
|
-
};
|
|
12726
|
-
|
|
12727
13131
|
/**
|
|
12728
13132
|
* Component display name.
|
|
12729
13133
|
*/
|
|
@@ -12736,31 +13140,37 @@ const CLASSNAME$k = 'lumx-skeleton-rectangle';
|
|
|
12736
13140
|
const {
|
|
12737
13141
|
block: block$j,
|
|
12738
13142
|
element: element$c
|
|
12739
|
-
} =
|
|
13143
|
+
} = bem(CLASSNAME$k);
|
|
13144
|
+
|
|
13145
|
+
/**
|
|
13146
|
+
* Component default props.
|
|
13147
|
+
*/
|
|
13148
|
+
const DEFAULT_PROPS$p = {
|
|
13149
|
+
variant: SkeletonRectangleVariant.squared
|
|
13150
|
+
};
|
|
12740
13151
|
|
|
12741
13152
|
/**
|
|
12742
13153
|
* SkeletonRectangle component.
|
|
12743
13154
|
*
|
|
12744
13155
|
* @param props Component props.
|
|
12745
|
-
* @
|
|
12746
|
-
* @return React element.
|
|
13156
|
+
* @return JSX element.
|
|
12747
13157
|
*/
|
|
12748
|
-
const SkeletonRectangle =
|
|
12749
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
13158
|
+
const SkeletonRectangle$1 = props => {
|
|
12750
13159
|
const {
|
|
12751
13160
|
aspectRatio,
|
|
12752
13161
|
className,
|
|
12753
13162
|
height,
|
|
12754
|
-
theme
|
|
12755
|
-
variant = DEFAULT_PROPS$
|
|
13163
|
+
theme,
|
|
13164
|
+
variant = DEFAULT_PROPS$p.variant,
|
|
12756
13165
|
width,
|
|
12757
13166
|
color,
|
|
13167
|
+
ref,
|
|
12758
13168
|
...forwardedProps
|
|
12759
13169
|
} = props;
|
|
12760
13170
|
return /*#__PURE__*/jsx("div", {
|
|
12761
13171
|
ref: ref,
|
|
12762
13172
|
...forwardedProps,
|
|
12763
|
-
className:
|
|
13173
|
+
className: classnames(className, block$j({
|
|
12764
13174
|
[`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
|
|
12765
13175
|
[`height-${height}`]: Boolean(aspectRatio ? undefined : height),
|
|
12766
13176
|
[`theme-${theme}`]: Boolean(theme),
|
|
@@ -12772,12 +13182,7 @@ const SkeletonRectangle = forwardRef((props, ref) => {
|
|
|
12772
13182
|
className: element$c('inner')
|
|
12773
13183
|
})
|
|
12774
13184
|
});
|
|
12775
|
-
}
|
|
12776
|
-
SkeletonRectangle.displayName = COMPONENT_NAME$l;
|
|
12777
|
-
SkeletonRectangle.className = CLASSNAME$k;
|
|
12778
|
-
SkeletonRectangle.defaultProps = DEFAULT_PROPS$m;
|
|
12779
|
-
|
|
12780
|
-
const DEFAULT_PROPS$l = {};
|
|
13185
|
+
};
|
|
12781
13186
|
|
|
12782
13187
|
/**
|
|
12783
13188
|
* Component display name.
|
|
@@ -12791,29 +13196,28 @@ const CLASSNAME$j = 'lumx-skeleton-typography';
|
|
|
12791
13196
|
const {
|
|
12792
13197
|
block: block$i,
|
|
12793
13198
|
element: element$b
|
|
12794
|
-
} =
|
|
13199
|
+
} = bem(CLASSNAME$j);
|
|
12795
13200
|
|
|
12796
13201
|
/**
|
|
12797
13202
|
* SkeletonTypography component.
|
|
12798
13203
|
*
|
|
12799
13204
|
* @param props Component props.
|
|
12800
|
-
* @
|
|
12801
|
-
* @return React element.
|
|
13205
|
+
* @return JSX element.
|
|
12802
13206
|
*/
|
|
12803
|
-
const SkeletonTypography =
|
|
12804
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
13207
|
+
const SkeletonTypography$1 = props => {
|
|
12805
13208
|
const {
|
|
12806
13209
|
className,
|
|
12807
|
-
theme
|
|
13210
|
+
theme,
|
|
12808
13211
|
typography,
|
|
12809
13212
|
width,
|
|
12810
13213
|
color,
|
|
13214
|
+
ref,
|
|
12811
13215
|
...forwardedProps
|
|
12812
13216
|
} = props;
|
|
12813
13217
|
return /*#__PURE__*/jsx("div", {
|
|
12814
13218
|
ref: ref,
|
|
12815
13219
|
...forwardedProps,
|
|
12816
|
-
className:
|
|
13220
|
+
className: classnames(className, block$i({
|
|
12817
13221
|
[`theme-${theme}`]: Boolean(theme),
|
|
12818
13222
|
[`typography-${typography}`]: Boolean(typography),
|
|
12819
13223
|
[`color-${color}`]: Boolean(color)
|
|
@@ -12826,9 +13230,119 @@ const SkeletonTypography = forwardRef((props, ref) => {
|
|
|
12826
13230
|
className: element$b('inner')
|
|
12827
13231
|
})
|
|
12828
13232
|
});
|
|
13233
|
+
};
|
|
13234
|
+
|
|
13235
|
+
/**
|
|
13236
|
+
* Defines the props of the component.
|
|
13237
|
+
*/
|
|
13238
|
+
|
|
13239
|
+
const DEFAULT_PROPS$o = {};
|
|
13240
|
+
|
|
13241
|
+
/**
|
|
13242
|
+
* SkeletonCircle component.
|
|
13243
|
+
*
|
|
13244
|
+
* @param props Component props.
|
|
13245
|
+
* @param ref Component ref.
|
|
13246
|
+
* @return React element.
|
|
13247
|
+
*/
|
|
13248
|
+
const SkeletonCircle = forwardRef((props, ref) => {
|
|
13249
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
13250
|
+
const {
|
|
13251
|
+
className,
|
|
13252
|
+
size,
|
|
13253
|
+
color,
|
|
13254
|
+
theme = defaultTheme,
|
|
13255
|
+
...forwardedProps
|
|
13256
|
+
} = props;
|
|
13257
|
+
return SkeletonCircle$1({
|
|
13258
|
+
ref,
|
|
13259
|
+
className,
|
|
13260
|
+
size,
|
|
13261
|
+
color,
|
|
13262
|
+
theme,
|
|
13263
|
+
...forwardedProps
|
|
13264
|
+
});
|
|
13265
|
+
});
|
|
13266
|
+
SkeletonCircle.displayName = COMPONENT_NAME$m;
|
|
13267
|
+
SkeletonCircle.defaultProps = DEFAULT_PROPS$o;
|
|
13268
|
+
SkeletonCircle.className = CLASSNAME$l;
|
|
13269
|
+
|
|
13270
|
+
/**
|
|
13271
|
+
* Defines the props of the component.
|
|
13272
|
+
*/
|
|
13273
|
+
|
|
13274
|
+
const DEFAULT_PROPS$n = DEFAULT_PROPS$p;
|
|
13275
|
+
|
|
13276
|
+
/**
|
|
13277
|
+
* SkeletonRectangle component.
|
|
13278
|
+
*
|
|
13279
|
+
* @param props Component props.
|
|
13280
|
+
* @param ref Component ref.
|
|
13281
|
+
* @return React element.
|
|
13282
|
+
*/
|
|
13283
|
+
const SkeletonRectangle = forwardRef((props, ref) => {
|
|
13284
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
13285
|
+
const {
|
|
13286
|
+
aspectRatio,
|
|
13287
|
+
className,
|
|
13288
|
+
height,
|
|
13289
|
+
theme = defaultTheme,
|
|
13290
|
+
variant = DEFAULT_PROPS$n.variant,
|
|
13291
|
+
width,
|
|
13292
|
+
color,
|
|
13293
|
+
...forwardedProps
|
|
13294
|
+
} = props;
|
|
13295
|
+
return SkeletonRectangle$1({
|
|
13296
|
+
ref,
|
|
13297
|
+
aspectRatio,
|
|
13298
|
+
className,
|
|
13299
|
+
height,
|
|
13300
|
+
theme,
|
|
13301
|
+
variant,
|
|
13302
|
+
width,
|
|
13303
|
+
color,
|
|
13304
|
+
...forwardedProps
|
|
13305
|
+
});
|
|
13306
|
+
});
|
|
13307
|
+
SkeletonRectangle.displayName = COMPONENT_NAME$l;
|
|
13308
|
+
SkeletonRectangle.className = CLASSNAME$k;
|
|
13309
|
+
SkeletonRectangle.defaultProps = DEFAULT_PROPS$n;
|
|
13310
|
+
|
|
13311
|
+
/**
|
|
13312
|
+
* Defines the props of the component.
|
|
13313
|
+
*/
|
|
13314
|
+
|
|
13315
|
+
const DEFAULT_PROPS$m = {};
|
|
13316
|
+
|
|
13317
|
+
/**
|
|
13318
|
+
* SkeletonTypography component.
|
|
13319
|
+
*
|
|
13320
|
+
* @param props Component props.
|
|
13321
|
+
* @param ref Component ref.
|
|
13322
|
+
* @return React element.
|
|
13323
|
+
*/
|
|
13324
|
+
const SkeletonTypography = forwardRef((props, ref) => {
|
|
13325
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
13326
|
+
const {
|
|
13327
|
+
className,
|
|
13328
|
+
theme = defaultTheme,
|
|
13329
|
+
typography,
|
|
13330
|
+
width,
|
|
13331
|
+
color,
|
|
13332
|
+
...forwardedProps
|
|
13333
|
+
} = props;
|
|
13334
|
+
return SkeletonTypography$1({
|
|
13335
|
+
ref,
|
|
13336
|
+
className,
|
|
13337
|
+
theme,
|
|
13338
|
+
typography,
|
|
13339
|
+
width,
|
|
13340
|
+
color,
|
|
13341
|
+
...forwardedProps
|
|
13342
|
+
});
|
|
12829
13343
|
});
|
|
12830
13344
|
SkeletonTypography.displayName = COMPONENT_NAME$k;
|
|
12831
|
-
SkeletonTypography.defaultProps = DEFAULT_PROPS$
|
|
13345
|
+
SkeletonTypography.defaultProps = DEFAULT_PROPS$m;
|
|
12832
13346
|
SkeletonTypography.className = CLASSNAME$j;
|
|
12833
13347
|
|
|
12834
13348
|
const useEnhancedEffect = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
|
|
@@ -12883,7 +13397,7 @@ const {
|
|
|
12883
13397
|
/**
|
|
12884
13398
|
* Component default props.
|
|
12885
13399
|
*/
|
|
12886
|
-
const DEFAULT_PROPS$
|
|
13400
|
+
const DEFAULT_PROPS$l = {
|
|
12887
13401
|
precision: 0,
|
|
12888
13402
|
steps: 0
|
|
12889
13403
|
};
|
|
@@ -12934,8 +13448,8 @@ const Slider = forwardRef((props, ref) => {
|
|
|
12934
13448
|
name,
|
|
12935
13449
|
onChange,
|
|
12936
13450
|
onMouseDown,
|
|
12937
|
-
precision = DEFAULT_PROPS$
|
|
12938
|
-
steps = DEFAULT_PROPS$
|
|
13451
|
+
precision = DEFAULT_PROPS$l.precision,
|
|
13452
|
+
steps = DEFAULT_PROPS$l.steps,
|
|
12939
13453
|
theme = defaultTheme,
|
|
12940
13454
|
value,
|
|
12941
13455
|
...forwardedProps
|
|
@@ -13138,7 +13652,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
13138
13652
|
});
|
|
13139
13653
|
Slider.displayName = COMPONENT_NAME$j;
|
|
13140
13654
|
Slider.className = CLASSNAME$i;
|
|
13141
|
-
Slider.defaultProps = DEFAULT_PROPS$
|
|
13655
|
+
Slider.defaultProps = DEFAULT_PROPS$l;
|
|
13142
13656
|
|
|
13143
13657
|
/**
|
|
13144
13658
|
* Making setInterval Declarative with React Hooks.
|
|
@@ -13516,7 +14030,7 @@ SlideshowItemGroup.className = CLASSNAME$h;
|
|
|
13516
14030
|
/**
|
|
13517
14031
|
* Component default props.
|
|
13518
14032
|
*/
|
|
13519
|
-
const DEFAULT_PROPS$
|
|
14033
|
+
const DEFAULT_PROPS$k = {
|
|
13520
14034
|
...DEFAULT_OPTIONS,
|
|
13521
14035
|
slideMode: SlideMode.transformTranslate
|
|
13522
14036
|
};
|
|
@@ -13532,19 +14046,19 @@ const Slideshow = forwardRef((props, ref) => {
|
|
|
13532
14046
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
13533
14047
|
const {
|
|
13534
14048
|
activeIndex,
|
|
13535
|
-
autoPlay = DEFAULT_PROPS$
|
|
14049
|
+
autoPlay = DEFAULT_PROPS$k.autoPlay,
|
|
13536
14050
|
children,
|
|
13537
14051
|
className,
|
|
13538
14052
|
fillHeight,
|
|
13539
14053
|
groupBy = DEFAULT_OPTIONS.groupBy,
|
|
13540
|
-
interval = DEFAULT_PROPS$
|
|
14054
|
+
interval = DEFAULT_PROPS$k.interval,
|
|
13541
14055
|
onChange,
|
|
13542
14056
|
slideshowControlsProps,
|
|
13543
14057
|
theme = defaultTheme,
|
|
13544
14058
|
id,
|
|
13545
14059
|
slidesId,
|
|
13546
14060
|
slideGroupLabel,
|
|
13547
|
-
slideMode = DEFAULT_PROPS$
|
|
14061
|
+
slideMode = DEFAULT_PROPS$k.slideMode,
|
|
13548
14062
|
...forwardedProps
|
|
13549
14063
|
} = props;
|
|
13550
14064
|
// Number of slideshow items.
|
|
@@ -13566,7 +14080,7 @@ const Slideshow = forwardRef((props, ref) => {
|
|
|
13566
14080
|
toggleForcePause
|
|
13567
14081
|
} = SlideshowControls.useSlideshowControls({
|
|
13568
14082
|
activeIndex,
|
|
13569
|
-
defaultActiveIndex: DEFAULT_PROPS$
|
|
14083
|
+
defaultActiveIndex: DEFAULT_PROPS$k.activeIndex,
|
|
13570
14084
|
autoPlay: Boolean(autoPlay),
|
|
13571
14085
|
itemsCount,
|
|
13572
14086
|
groupBy,
|
|
@@ -13636,7 +14150,7 @@ const Slideshow = forwardRef((props, ref) => {
|
|
|
13636
14150
|
});
|
|
13637
14151
|
});
|
|
13638
14152
|
Slideshow.displayName = 'Slideshow';
|
|
13639
|
-
Slideshow.defaultProps = DEFAULT_PROPS$
|
|
14153
|
+
Slideshow.defaultProps = DEFAULT_PROPS$k;
|
|
13640
14154
|
|
|
13641
14155
|
/**
|
|
13642
14156
|
* Component display name.
|
|
@@ -13745,7 +14259,7 @@ const {
|
|
|
13745
14259
|
/**
|
|
13746
14260
|
* Component default props.
|
|
13747
14261
|
*/
|
|
13748
|
-
const DEFAULT_PROPS$
|
|
14262
|
+
const DEFAULT_PROPS$j = {
|
|
13749
14263
|
activeIndex: 0
|
|
13750
14264
|
};
|
|
13751
14265
|
|
|
@@ -13759,7 +14273,7 @@ const DEFAULT_PROPS$i = {
|
|
|
13759
14273
|
const InternalSlideshowControls = forwardRef((props, ref) => {
|
|
13760
14274
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
13761
14275
|
const {
|
|
13762
|
-
activeIndex = DEFAULT_PROPS$
|
|
14276
|
+
activeIndex = DEFAULT_PROPS$j.activeIndex,
|
|
13763
14277
|
className,
|
|
13764
14278
|
nextButtonProps,
|
|
13765
14279
|
onNextClick,
|
|
@@ -13874,7 +14388,7 @@ const InternalSlideshowControls = forwardRef((props, ref) => {
|
|
|
13874
14388
|
});
|
|
13875
14389
|
InternalSlideshowControls.displayName = COMPONENT_NAME$g;
|
|
13876
14390
|
InternalSlideshowControls.className = CLASSNAME$f;
|
|
13877
|
-
InternalSlideshowControls.defaultProps = DEFAULT_PROPS$
|
|
14391
|
+
InternalSlideshowControls.defaultProps = DEFAULT_PROPS$j;
|
|
13878
14392
|
const SlideshowControls = Object.assign(InternalSlideshowControls, {
|
|
13879
14393
|
useSlideshowControls,
|
|
13880
14394
|
useSlideshowControlsDefaultOptions: DEFAULT_OPTIONS
|
|
@@ -14006,7 +14520,7 @@ const {
|
|
|
14006
14520
|
/**
|
|
14007
14521
|
* Component default props.
|
|
14008
14522
|
*/
|
|
14009
|
-
const DEFAULT_PROPS$
|
|
14523
|
+
const DEFAULT_PROPS$i = {
|
|
14010
14524
|
slideMode: SlideMode.transformTranslate
|
|
14011
14525
|
};
|
|
14012
14526
|
|
|
@@ -14033,7 +14547,7 @@ const Slides = forwardRef((props, ref) => {
|
|
|
14033
14547
|
afterSlides,
|
|
14034
14548
|
hasControls,
|
|
14035
14549
|
slideGroupLabel,
|
|
14036
|
-
slideMode = DEFAULT_PROPS$
|
|
14550
|
+
slideMode = DEFAULT_PROPS$i.slideMode,
|
|
14037
14551
|
onChange,
|
|
14038
14552
|
...forwardedProps
|
|
14039
14553
|
} = props;
|
|
@@ -14115,46 +14629,41 @@ const CLASSNAME$d = 'lumx-switch';
|
|
|
14115
14629
|
const {
|
|
14116
14630
|
block: block$e,
|
|
14117
14631
|
element: element$7
|
|
14118
|
-
} =
|
|
14632
|
+
} = bem(CLASSNAME$d);
|
|
14119
14633
|
|
|
14120
14634
|
/**
|
|
14121
14635
|
* Component default props.
|
|
14122
14636
|
*/
|
|
14123
|
-
const DEFAULT_PROPS$
|
|
14124
|
-
position:
|
|
14637
|
+
const DEFAULT_PROPS$h = {
|
|
14638
|
+
position: 'left'
|
|
14125
14639
|
};
|
|
14126
14640
|
|
|
14127
14641
|
/**
|
|
14128
14642
|
* Switch component.
|
|
14129
14643
|
*
|
|
14130
14644
|
* @param props Component props.
|
|
14131
|
-
* @
|
|
14132
|
-
* @return React element.
|
|
14645
|
+
* @return JSX element.
|
|
14133
14646
|
*/
|
|
14134
|
-
const Switch =
|
|
14135
|
-
const {
|
|
14136
|
-
isAnyDisabled,
|
|
14137
|
-
disabledStateProps,
|
|
14138
|
-
otherProps
|
|
14139
|
-
} = useDisableStateProps(props);
|
|
14140
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
14647
|
+
const Switch$1 = props => {
|
|
14141
14648
|
const {
|
|
14142
14649
|
checked,
|
|
14143
|
-
children,
|
|
14144
14650
|
className,
|
|
14145
14651
|
helper,
|
|
14146
14652
|
id,
|
|
14653
|
+
inputRef,
|
|
14147
14654
|
isChecked = checked,
|
|
14655
|
+
label,
|
|
14148
14656
|
name,
|
|
14657
|
+
ref,
|
|
14149
14658
|
onChange,
|
|
14150
|
-
|
|
14151
|
-
theme = defaultTheme,
|
|
14659
|
+
theme,
|
|
14152
14660
|
value,
|
|
14153
14661
|
inputProps = {},
|
|
14662
|
+
isDisabled,
|
|
14663
|
+
inputId,
|
|
14664
|
+
position = DEFAULT_PROPS$h.position,
|
|
14154
14665
|
...forwardedProps
|
|
14155
|
-
} =
|
|
14156
|
-
const generatedInputId = useId();
|
|
14157
|
-
const inputId = id || generatedInputId;
|
|
14666
|
+
} = props;
|
|
14158
14667
|
const handleChange = event => {
|
|
14159
14668
|
if (onChange) {
|
|
14160
14669
|
onChange(!isChecked, value, name, event);
|
|
@@ -14163,28 +14672,30 @@ const Switch = forwardRef((props, ref) => {
|
|
|
14163
14672
|
return /*#__PURE__*/jsxs("div", {
|
|
14164
14673
|
ref: ref,
|
|
14165
14674
|
...forwardedProps,
|
|
14166
|
-
className:
|
|
14675
|
+
className: classnames(className, block$e({
|
|
14167
14676
|
'is-checked': isChecked,
|
|
14168
|
-
'is-disabled':
|
|
14677
|
+
'is-disabled': isDisabled,
|
|
14678
|
+
'is-unchecked': !isChecked,
|
|
14169
14679
|
[`position-${position}`]: Boolean(position),
|
|
14170
|
-
[`theme-${theme}`]: Boolean(theme)
|
|
14171
|
-
'is-unchecked': !isChecked
|
|
14680
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
14172
14681
|
})),
|
|
14173
14682
|
children: [/*#__PURE__*/jsxs("div", {
|
|
14174
14683
|
className: element$7('input-wrapper'),
|
|
14175
14684
|
children: [/*#__PURE__*/jsx("input", {
|
|
14685
|
+
ref: inputRef,
|
|
14176
14686
|
type: "checkbox",
|
|
14177
14687
|
role: "switch",
|
|
14178
14688
|
id: inputId,
|
|
14179
14689
|
className: element$7('input-native'),
|
|
14180
14690
|
name: name,
|
|
14181
14691
|
value: value,
|
|
14182
|
-
|
|
14183
|
-
readOnly: inputProps.readOnly || isAnyDisabled,
|
|
14184
|
-
checked: isChecked,
|
|
14185
|
-
"aria-checked": Boolean(isChecked),
|
|
14692
|
+
checked: Boolean(isChecked),
|
|
14186
14693
|
onChange: handleChange,
|
|
14187
14694
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
14695
|
+
"aria-checked": Boolean(isChecked),
|
|
14696
|
+
...(inputProps?.readOnly ? {
|
|
14697
|
+
readOnly: inputProps.readOnly
|
|
14698
|
+
} : {}),
|
|
14188
14699
|
...inputProps
|
|
14189
14700
|
}), /*#__PURE__*/jsxs("div", {
|
|
14190
14701
|
className: element$7('input-placeholder'),
|
|
@@ -14194,21 +14705,88 @@ const Switch = forwardRef((props, ref) => {
|
|
|
14194
14705
|
className: element$7('input-indicator')
|
|
14195
14706
|
})]
|
|
14196
14707
|
})]
|
|
14197
|
-
}),
|
|
14708
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
14198
14709
|
className: element$7('content'),
|
|
14199
|
-
children: [
|
|
14710
|
+
children: [label && InputLabel$1({
|
|
14200
14711
|
htmlFor: inputId,
|
|
14201
|
-
theme: theme,
|
|
14202
14712
|
className: element$7('label'),
|
|
14203
|
-
|
|
14204
|
-
|
|
14713
|
+
theme,
|
|
14714
|
+
children: label
|
|
14715
|
+
}), helper && InputHelper$1({
|
|
14205
14716
|
id: `${inputId}-helper`,
|
|
14206
|
-
theme: theme,
|
|
14207
14717
|
className: element$7('helper'),
|
|
14718
|
+
theme,
|
|
14208
14719
|
children: helper
|
|
14209
14720
|
})]
|
|
14210
14721
|
})]
|
|
14211
14722
|
});
|
|
14723
|
+
};
|
|
14724
|
+
|
|
14725
|
+
/**
|
|
14726
|
+
* Defines the props of the component.
|
|
14727
|
+
*/
|
|
14728
|
+
|
|
14729
|
+
/**
|
|
14730
|
+
* Component default props.
|
|
14731
|
+
*/
|
|
14732
|
+
const DEFAULT_PROPS$g = {
|
|
14733
|
+
position: Alignment.left
|
|
14734
|
+
};
|
|
14735
|
+
|
|
14736
|
+
/**
|
|
14737
|
+
* Switch component.
|
|
14738
|
+
*
|
|
14739
|
+
* @param props Component props.
|
|
14740
|
+
* @param ref Component ref.
|
|
14741
|
+
* @return React element.
|
|
14742
|
+
*/
|
|
14743
|
+
const Switch = forwardRef((props, ref) => {
|
|
14744
|
+
const {
|
|
14745
|
+
isAnyDisabled,
|
|
14746
|
+
disabledStateProps,
|
|
14747
|
+
otherProps
|
|
14748
|
+
} = useDisableStateProps(props);
|
|
14749
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
14750
|
+
const {
|
|
14751
|
+
checked,
|
|
14752
|
+
children,
|
|
14753
|
+
className,
|
|
14754
|
+
helper,
|
|
14755
|
+
id,
|
|
14756
|
+
inputRef,
|
|
14757
|
+
isChecked = checked,
|
|
14758
|
+
name,
|
|
14759
|
+
onChange,
|
|
14760
|
+
position = DEFAULT_PROPS$g.position,
|
|
14761
|
+
theme = defaultTheme,
|
|
14762
|
+
value,
|
|
14763
|
+
inputProps = {},
|
|
14764
|
+
...forwardedProps
|
|
14765
|
+
} = otherProps;
|
|
14766
|
+
const localInputRef = React__default.useRef(null);
|
|
14767
|
+
const generatedInputId = useId();
|
|
14768
|
+
const inputId = id || generatedInputId;
|
|
14769
|
+
return Switch$1({
|
|
14770
|
+
ref,
|
|
14771
|
+
className,
|
|
14772
|
+
helper,
|
|
14773
|
+
inputRef: useMergeRefs(inputRef, localInputRef),
|
|
14774
|
+
isChecked,
|
|
14775
|
+
label: children,
|
|
14776
|
+
name,
|
|
14777
|
+
onChange,
|
|
14778
|
+
position,
|
|
14779
|
+
theme,
|
|
14780
|
+
value,
|
|
14781
|
+
inputProps: {
|
|
14782
|
+
...inputProps,
|
|
14783
|
+
...disabledStateProps,
|
|
14784
|
+
readOnly: inputProps.readOnly || isAnyDisabled
|
|
14785
|
+
},
|
|
14786
|
+
...forwardedProps,
|
|
14787
|
+
isDisabled: isAnyDisabled,
|
|
14788
|
+
inputId
|
|
14789
|
+
});
|
|
14212
14790
|
});
|
|
14213
14791
|
Switch.displayName = COMPONENT_NAME$e;
|
|
14214
14792
|
Switch.className = CLASSNAME$d;
|
|
@@ -14226,7 +14804,7 @@ const CLASSNAME$c = 'lumx-table';
|
|
|
14226
14804
|
|
|
14227
14805
|
const {
|
|
14228
14806
|
block: block$d
|
|
14229
|
-
} =
|
|
14807
|
+
} = bem(CLASSNAME$c);
|
|
14230
14808
|
|
|
14231
14809
|
/**
|
|
14232
14810
|
* Defines the props of the component.
|
|
@@ -14241,29 +14819,54 @@ const DEFAULT_PROPS$f = {};
|
|
|
14241
14819
|
* Table component.
|
|
14242
14820
|
*
|
|
14243
14821
|
* @param props Component props.
|
|
14244
|
-
* @param ref Component ref.
|
|
14245
14822
|
* @return React element.
|
|
14246
14823
|
*/
|
|
14247
|
-
const Table =
|
|
14248
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
14824
|
+
const Table$1 = props => {
|
|
14249
14825
|
const {
|
|
14250
14826
|
children,
|
|
14251
14827
|
className,
|
|
14252
14828
|
hasBefore,
|
|
14253
14829
|
hasDividers,
|
|
14254
|
-
|
|
14830
|
+
ref,
|
|
14831
|
+
theme,
|
|
14255
14832
|
...forwardedProps
|
|
14256
14833
|
} = props;
|
|
14257
14834
|
return /*#__PURE__*/jsx("table", {
|
|
14258
14835
|
ref: ref,
|
|
14259
14836
|
...forwardedProps,
|
|
14260
|
-
className:
|
|
14837
|
+
className: classnames(className, block$d({
|
|
14261
14838
|
'has-before': hasBefore,
|
|
14262
14839
|
'has-dividers': hasDividers,
|
|
14263
14840
|
[`theme-${theme}`]: Boolean(theme)
|
|
14264
14841
|
})),
|
|
14265
14842
|
children: children
|
|
14266
14843
|
});
|
|
14844
|
+
};
|
|
14845
|
+
|
|
14846
|
+
/**
|
|
14847
|
+
* Defines the props of the component.
|
|
14848
|
+
*/
|
|
14849
|
+
|
|
14850
|
+
/**
|
|
14851
|
+
* Table component.
|
|
14852
|
+
*
|
|
14853
|
+
* @param props Component props.
|
|
14854
|
+
* @param ref Component ref.
|
|
14855
|
+
* @return React element.
|
|
14856
|
+
*/
|
|
14857
|
+
const Table = forwardRef((props, ref) => {
|
|
14858
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
14859
|
+
const {
|
|
14860
|
+
children,
|
|
14861
|
+
theme = defaultTheme,
|
|
14862
|
+
...otherProps
|
|
14863
|
+
} = props;
|
|
14864
|
+
return Table$1({
|
|
14865
|
+
ref,
|
|
14866
|
+
theme,
|
|
14867
|
+
children,
|
|
14868
|
+
...otherProps
|
|
14869
|
+
});
|
|
14267
14870
|
});
|
|
14268
14871
|
Table.displayName = COMPONENT_NAME$d;
|
|
14269
14872
|
Table.className = CLASSNAME$c;
|
|
@@ -14283,21 +14886,44 @@ const CLASSNAME$b = `${CLASSNAME$c}__body`;
|
|
|
14283
14886
|
* TableBody component.
|
|
14284
14887
|
*
|
|
14285
14888
|
* @param props Component props.
|
|
14286
|
-
* @param ref Component ref.
|
|
14287
14889
|
* @return React element.
|
|
14288
14890
|
*/
|
|
14289
|
-
const TableBody =
|
|
14891
|
+
const TableBody$1 = props => {
|
|
14290
14892
|
const {
|
|
14291
14893
|
children,
|
|
14292
14894
|
className,
|
|
14895
|
+
ref,
|
|
14293
14896
|
...forwardedProps
|
|
14294
14897
|
} = props;
|
|
14295
14898
|
return /*#__PURE__*/jsx("tbody", {
|
|
14296
14899
|
ref: ref,
|
|
14297
14900
|
...forwardedProps,
|
|
14298
|
-
className:
|
|
14901
|
+
className: classnames(className, CLASSNAME$b),
|
|
14299
14902
|
children: children
|
|
14300
14903
|
});
|
|
14904
|
+
};
|
|
14905
|
+
|
|
14906
|
+
/**
|
|
14907
|
+
* Defines the props of the component.
|
|
14908
|
+
*/
|
|
14909
|
+
|
|
14910
|
+
/**
|
|
14911
|
+
* TableBody component.
|
|
14912
|
+
*
|
|
14913
|
+
* @param props Component props.
|
|
14914
|
+
* @param ref Component ref.
|
|
14915
|
+
* @return React element.
|
|
14916
|
+
*/
|
|
14917
|
+
const TableBody = forwardRef((props, ref) => {
|
|
14918
|
+
const {
|
|
14919
|
+
children,
|
|
14920
|
+
...otherProps
|
|
14921
|
+
} = props;
|
|
14922
|
+
return TableBody$1({
|
|
14923
|
+
ref,
|
|
14924
|
+
children,
|
|
14925
|
+
...otherProps
|
|
14926
|
+
});
|
|
14301
14927
|
});
|
|
14302
14928
|
TableBody.displayName = COMPONENT_NAME$c;
|
|
14303
14929
|
TableBody.className = CLASSNAME$b;
|
|
@@ -14329,7 +14955,7 @@ const COMPONENT_NAME$b = 'TableCell';
|
|
|
14329
14955
|
const CLASSNAME$a = `${CLASSNAME$c}__cell`;
|
|
14330
14956
|
const {
|
|
14331
14957
|
block: block$c
|
|
14332
|
-
} =
|
|
14958
|
+
} = bem(CLASSNAME$a);
|
|
14333
14959
|
|
|
14334
14960
|
/**
|
|
14335
14961
|
* Component default props.
|
|
@@ -14342,16 +14968,16 @@ const DEFAULT_PROPS$e = {
|
|
|
14342
14968
|
* TableCell component.
|
|
14343
14969
|
*
|
|
14344
14970
|
* @param props Component props.
|
|
14345
|
-
* @param ref Component ref.
|
|
14346
14971
|
* @return React element.
|
|
14347
14972
|
*/
|
|
14348
|
-
const TableCell =
|
|
14973
|
+
const TableCell$1 = props => {
|
|
14349
14974
|
const {
|
|
14350
14975
|
children,
|
|
14351
14976
|
className,
|
|
14352
14977
|
icon,
|
|
14353
14978
|
isSortable,
|
|
14354
14979
|
onHeaderClick,
|
|
14980
|
+
ref,
|
|
14355
14981
|
sortOrder,
|
|
14356
14982
|
variant = DEFAULT_PROPS$e.variant,
|
|
14357
14983
|
...forwardedProps
|
|
@@ -14375,7 +15001,7 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
14375
15001
|
children: [variant === TableCellVariant.head && /*#__PURE__*/jsx("th", {
|
|
14376
15002
|
ref: ref,
|
|
14377
15003
|
...forwardedProps,
|
|
14378
|
-
className:
|
|
15004
|
+
className: classnames(className, block$c({
|
|
14379
15005
|
'is-sortable': isSortable,
|
|
14380
15006
|
'is-sorted': isSortable && !!sortOrder,
|
|
14381
15007
|
head: true
|
|
@@ -14384,26 +15010,27 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
14384
15010
|
children: /*#__PURE__*/jsxs(Wrapper, {
|
|
14385
15011
|
className: `${CLASSNAME$a}-wrapper`,
|
|
14386
15012
|
...wrapperProps,
|
|
14387
|
-
children: [icon && !isSortable &&
|
|
15013
|
+
children: [icon && !isSortable && Icon$1({
|
|
14388
15014
|
className: `${CLASSNAME$a}-icon`,
|
|
14389
|
-
icon
|
|
14390
|
-
size: Size
|
|
14391
|
-
}), isSortable && sortOrder === ThOrder.asc &&
|
|
15015
|
+
icon,
|
|
15016
|
+
size: Size.xxs
|
|
15017
|
+
}), isSortable && sortOrder === ThOrder.asc && Icon$1({
|
|
14392
15018
|
className: `${CLASSNAME$a}-icon`,
|
|
14393
15019
|
icon: mdiArrowUp,
|
|
14394
|
-
size: Size
|
|
14395
|
-
}), isSortable && sortOrder === ThOrder.desc &&
|
|
15020
|
+
size: Size.xxs
|
|
15021
|
+
}), isSortable && sortOrder === ThOrder.desc && Icon$1({
|
|
14396
15022
|
className: `${CLASSNAME$a}-icon`,
|
|
14397
15023
|
icon: mdiArrowDown,
|
|
14398
|
-
size: Size
|
|
15024
|
+
size: Size.xxs
|
|
14399
15025
|
}), /*#__PURE__*/jsx("div", {
|
|
14400
15026
|
className: `${CLASSNAME$a}-content`,
|
|
14401
15027
|
children: children
|
|
14402
15028
|
})]
|
|
14403
15029
|
})
|
|
14404
15030
|
}), variant === TableCellVariant.body && /*#__PURE__*/jsx("td", {
|
|
15031
|
+
ref: ref,
|
|
14405
15032
|
...forwardedProps,
|
|
14406
|
-
className:
|
|
15033
|
+
className: classnames(className, block$c({
|
|
14407
15034
|
body: true
|
|
14408
15035
|
})),
|
|
14409
15036
|
children: /*#__PURE__*/jsx("div", {
|
|
@@ -14412,6 +15039,29 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
14412
15039
|
})
|
|
14413
15040
|
})]
|
|
14414
15041
|
});
|
|
15042
|
+
};
|
|
15043
|
+
|
|
15044
|
+
/**
|
|
15045
|
+
* Defines the props of the component.
|
|
15046
|
+
*/
|
|
15047
|
+
|
|
15048
|
+
/**
|
|
15049
|
+
* TableCell component.
|
|
15050
|
+
*
|
|
15051
|
+
* @param props Component props.
|
|
15052
|
+
* @param ref Component ref.
|
|
15053
|
+
* @return React element.
|
|
15054
|
+
*/
|
|
15055
|
+
const TableCell = forwardRef((props, ref) => {
|
|
15056
|
+
const {
|
|
15057
|
+
children,
|
|
15058
|
+
...otherProps
|
|
15059
|
+
} = props;
|
|
15060
|
+
return TableCell$1({
|
|
15061
|
+
ref,
|
|
15062
|
+
children,
|
|
15063
|
+
...otherProps
|
|
15064
|
+
});
|
|
14415
15065
|
});
|
|
14416
15066
|
TableCell.displayName = COMPONENT_NAME$b;
|
|
14417
15067
|
TableCell.className = CLASSNAME$a;
|
|
@@ -14436,21 +15086,44 @@ const DEFAULT_PROPS$d = {};
|
|
|
14436
15086
|
* TableHeader component.
|
|
14437
15087
|
*
|
|
14438
15088
|
* @param props Component props.
|
|
14439
|
-
* @param ref Component ref.
|
|
14440
15089
|
* @return React element.
|
|
14441
15090
|
*/
|
|
14442
|
-
const TableHeader =
|
|
15091
|
+
const TableHeader$1 = props => {
|
|
14443
15092
|
const {
|
|
14444
15093
|
children,
|
|
14445
15094
|
className,
|
|
15095
|
+
ref,
|
|
14446
15096
|
...forwardedProps
|
|
14447
15097
|
} = props;
|
|
14448
15098
|
return /*#__PURE__*/jsx("thead", {
|
|
14449
15099
|
ref: ref,
|
|
14450
15100
|
...forwardedProps,
|
|
14451
|
-
className:
|
|
15101
|
+
className: classnames(className, CLASSNAME$9),
|
|
14452
15102
|
children: children
|
|
14453
15103
|
});
|
|
15104
|
+
};
|
|
15105
|
+
|
|
15106
|
+
/**
|
|
15107
|
+
* Defines the props of the component.
|
|
15108
|
+
*/
|
|
15109
|
+
|
|
15110
|
+
/**
|
|
15111
|
+
* TableHeader component.
|
|
15112
|
+
*
|
|
15113
|
+
* @param props Component props.
|
|
15114
|
+
* @param ref Component ref.
|
|
15115
|
+
* @return React element.
|
|
15116
|
+
*/
|
|
15117
|
+
const TableHeader = forwardRef((props, ref) => {
|
|
15118
|
+
const {
|
|
15119
|
+
children,
|
|
15120
|
+
...otherProps
|
|
15121
|
+
} = props;
|
|
15122
|
+
return TableHeader$1({
|
|
15123
|
+
ref,
|
|
15124
|
+
children,
|
|
15125
|
+
...otherProps
|
|
15126
|
+
});
|
|
14454
15127
|
});
|
|
14455
15128
|
TableHeader.displayName = COMPONENT_NAME$a;
|
|
14456
15129
|
TableHeader.className = CLASSNAME$9;
|
|
@@ -14467,7 +15140,7 @@ const COMPONENT_NAME$9 = 'TableRow';
|
|
|
14467
15140
|
const CLASSNAME$8 = `${CLASSNAME$c}__row`;
|
|
14468
15141
|
const {
|
|
14469
15142
|
block: block$b
|
|
14470
|
-
} =
|
|
15143
|
+
} = bem(CLASSNAME$8);
|
|
14471
15144
|
|
|
14472
15145
|
/**
|
|
14473
15146
|
* Component default props.
|
|
@@ -14478,34 +15151,69 @@ const DEFAULT_PROPS$c = {};
|
|
|
14478
15151
|
* TableRow component.
|
|
14479
15152
|
*
|
|
14480
15153
|
* @param props Component props.
|
|
14481
|
-
* @param ref Component ref.
|
|
14482
15154
|
* @return React element.
|
|
14483
15155
|
*/
|
|
14484
|
-
const TableRow =
|
|
14485
|
-
const {
|
|
14486
|
-
isAnyDisabled,
|
|
14487
|
-
disabledStateProps,
|
|
14488
|
-
otherProps
|
|
14489
|
-
} = useDisableStateProps(props);
|
|
15156
|
+
const TableRow$1 = props => {
|
|
14490
15157
|
const {
|
|
14491
15158
|
children,
|
|
14492
15159
|
className,
|
|
14493
15160
|
isClickable,
|
|
14494
15161
|
isSelected,
|
|
15162
|
+
ref,
|
|
15163
|
+
tabIndex,
|
|
15164
|
+
'aria-disabled': ariaDisabled,
|
|
14495
15165
|
...forwardedProps
|
|
14496
|
-
} =
|
|
15166
|
+
} = props;
|
|
15167
|
+
const isDisabled = Boolean(ariaDisabled);
|
|
15168
|
+
|
|
15169
|
+
// Use object spread for tabIndex to ensure cross-framework compatibility (Vue JSX expects lowercase 'tabindex')
|
|
15170
|
+
const tabIndexProps = tabIndex !== undefined ? {
|
|
15171
|
+
tabIndex
|
|
15172
|
+
} : {};
|
|
14497
15173
|
return /*#__PURE__*/jsx("tr", {
|
|
14498
15174
|
ref: ref,
|
|
14499
|
-
|
|
15175
|
+
"aria-disabled": ariaDisabled,
|
|
15176
|
+
...tabIndexProps,
|
|
14500
15177
|
...forwardedProps,
|
|
14501
|
-
className:
|
|
14502
|
-
'is-clickable': isClickable && !
|
|
14503
|
-
'is-disabled':
|
|
14504
|
-
'is-selected': isSelected && !
|
|
15178
|
+
className: classnames(className, block$b({
|
|
15179
|
+
'is-clickable': isClickable && !isDisabled,
|
|
15180
|
+
'is-disabled': isDisabled,
|
|
15181
|
+
'is-selected': isSelected && !isDisabled
|
|
14505
15182
|
})),
|
|
14506
|
-
"aria-disabled": isAnyDisabled,
|
|
14507
15183
|
children: children
|
|
14508
15184
|
});
|
|
15185
|
+
};
|
|
15186
|
+
|
|
15187
|
+
/**
|
|
15188
|
+
* Defines the props of the component.
|
|
15189
|
+
*/
|
|
15190
|
+
|
|
15191
|
+
/**
|
|
15192
|
+
* TableRow component.
|
|
15193
|
+
*
|
|
15194
|
+
* @param props Component props.
|
|
15195
|
+
* @param ref Component ref.
|
|
15196
|
+
* @return React element.
|
|
15197
|
+
*/
|
|
15198
|
+
const TableRow = forwardRef((props, ref) => {
|
|
15199
|
+
const {
|
|
15200
|
+
isAnyDisabled,
|
|
15201
|
+
otherProps
|
|
15202
|
+
} = useDisableStateProps(props);
|
|
15203
|
+
const {
|
|
15204
|
+
children,
|
|
15205
|
+
isClickable,
|
|
15206
|
+
'aria-disabled': _ariaDisabled,
|
|
15207
|
+
...forwardedProps
|
|
15208
|
+
} = otherProps;
|
|
15209
|
+
return TableRow$1({
|
|
15210
|
+
ref,
|
|
15211
|
+
children,
|
|
15212
|
+
isClickable,
|
|
15213
|
+
tabIndex: isClickable && !isAnyDisabled ? 0 : -1,
|
|
15214
|
+
'aria-disabled': isAnyDisabled,
|
|
15215
|
+
...forwardedProps
|
|
15216
|
+
});
|
|
14509
15217
|
});
|
|
14510
15218
|
TableRow.displayName = COMPONENT_NAME$9;
|
|
14511
15219
|
TableRow.className = CLASSNAME$8;
|
|
@@ -15170,7 +15878,14 @@ TextField.displayName = COMPONENT_NAME$5;
|
|
|
15170
15878
|
TextField.className = CLASSNAME$5;
|
|
15171
15879
|
TextField.defaultProps = DEFAULT_PROPS$5;
|
|
15172
15880
|
|
|
15173
|
-
|
|
15881
|
+
/**
|
|
15882
|
+
* Determines the loading state of an HTML image element.
|
|
15883
|
+
*
|
|
15884
|
+
* @param img - The HTML image element to check
|
|
15885
|
+
* @param event - Optional event (load or error) that triggered the state check
|
|
15886
|
+
* @returns The current loading state: 'hasError', 'isLoading', or 'isLoaded'
|
|
15887
|
+
*/
|
|
15888
|
+
function getImageLoadingState(img, event) {
|
|
15174
15889
|
// Error event occurred or image has no source.
|
|
15175
15890
|
if (event?.type === 'error' || img?.complete && !img.getAttribute('src')) {
|
|
15176
15891
|
return 'hasError';
|
|
@@ -15182,30 +15897,58 @@ function getState(img, event) {
|
|
|
15182
15897
|
// Else loaded.
|
|
15183
15898
|
return 'isLoaded';
|
|
15184
15899
|
}
|
|
15185
|
-
function useImageLoad(imageURL, imgRef) {
|
|
15186
|
-
const [state, setState] = useState(getState(imgRef));
|
|
15187
15900
|
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
|
|
15191
|
-
}, [imageURL, imgRef]);
|
|
15901
|
+
/**
|
|
15902
|
+
* Parameters for getting image size.
|
|
15903
|
+
*/
|
|
15192
15904
|
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
|
|
15202
|
-
|
|
15905
|
+
/**
|
|
15906
|
+
* Gets the natural image size from props or element.
|
|
15907
|
+
* Returns undefined if focus point is not applicable or size cannot be determined.
|
|
15908
|
+
*
|
|
15909
|
+
* @param params - Image size parameters
|
|
15910
|
+
* @returns Image size or undefined
|
|
15911
|
+
*/
|
|
15912
|
+
function getImageSize({
|
|
15913
|
+
image,
|
|
15914
|
+
aspectRatio,
|
|
15915
|
+
focusPoint,
|
|
15916
|
+
width,
|
|
15917
|
+
height,
|
|
15918
|
+
element,
|
|
15919
|
+
isLoaded
|
|
15920
|
+
}) {
|
|
15921
|
+
// Focus point is not applicable => exit early
|
|
15922
|
+
if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
|
|
15923
|
+
return undefined;
|
|
15924
|
+
}
|
|
15925
|
+
// Size provided via props
|
|
15926
|
+
if (typeof width === 'number' && typeof height === 'number') {
|
|
15927
|
+
return {
|
|
15928
|
+
width,
|
|
15929
|
+
height
|
|
15203
15930
|
};
|
|
15204
|
-
}
|
|
15205
|
-
|
|
15931
|
+
}
|
|
15932
|
+
// Size from loaded element
|
|
15933
|
+
if (element && isLoaded) {
|
|
15934
|
+
return {
|
|
15935
|
+
width: element.naturalWidth,
|
|
15936
|
+
height: element.naturalHeight
|
|
15937
|
+
};
|
|
15938
|
+
}
|
|
15939
|
+
return undefined;
|
|
15206
15940
|
}
|
|
15207
15941
|
|
|
15208
|
-
|
|
15942
|
+
/**
|
|
15943
|
+
* Calculate shift position to center the focus point in the container.
|
|
15944
|
+
*
|
|
15945
|
+
* This function computes the percentage offset needed to position an image
|
|
15946
|
+
* such that a specific focus point on the image aligns with the center of
|
|
15947
|
+
* the container, taking into account the image's scale.
|
|
15948
|
+
*
|
|
15949
|
+
* @param params - Focus point shift calculation parameters
|
|
15950
|
+
* @returns Percentage shift (0-100) for CSS positioning
|
|
15951
|
+
*/
|
|
15209
15952
|
function shiftPosition({
|
|
15210
15953
|
scale,
|
|
15211
15954
|
focusPoint,
|
|
@@ -15220,92 +15963,64 @@ function shiftPosition({
|
|
|
15220
15963
|
return Math.floor(Math.max(Math.min(shift, 1), 0) * 100);
|
|
15221
15964
|
}
|
|
15222
15965
|
|
|
15223
|
-
|
|
15224
|
-
|
|
15966
|
+
/**
|
|
15967
|
+
* Parameters for calculating focus point style.
|
|
15968
|
+
*/
|
|
15969
|
+
|
|
15970
|
+
/**
|
|
15971
|
+
* Calculates CSS style for applying focus point positioning.
|
|
15972
|
+
*
|
|
15973
|
+
* @param params - Focus point style parameters
|
|
15974
|
+
* @returns CSS properties to apply to the image
|
|
15975
|
+
*/
|
|
15976
|
+
function calculateFocusPointStyle({
|
|
15225
15977
|
image,
|
|
15226
15978
|
aspectRatio,
|
|
15227
15979
|
focusPoint,
|
|
15228
|
-
|
|
15229
|
-
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
|
|
15233
|
-
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
|
|
15237
|
-
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
};
|
|
15241
|
-
if (element && isLoaded) return {
|
|
15242
|
-
width: element.naturalWidth,
|
|
15243
|
-
height: element.naturalHeight
|
|
15980
|
+
element,
|
|
15981
|
+
imageSize,
|
|
15982
|
+
containerSize
|
|
15983
|
+
}) {
|
|
15984
|
+
// Focus point is not applicable => exit early
|
|
15985
|
+
if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
|
|
15986
|
+
return {};
|
|
15987
|
+
}
|
|
15988
|
+
if (!element || !imageSize) {
|
|
15989
|
+
// Focus point can be computed but not right now (image size unknown).
|
|
15990
|
+
return {
|
|
15991
|
+
visibility: 'hidden'
|
|
15244
15992
|
};
|
|
15245
|
-
|
|
15246
|
-
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
if (cWidth && cHeight) {
|
|
15254
|
-
// Update only if needed.
|
|
15255
|
-
setContainerSize(oldContainerSize => oldContainerSize?.width === cWidth && oldContainerSize.height === cHeight ? oldContainerSize : {
|
|
15256
|
-
width: cWidth,
|
|
15257
|
-
height: cHeight
|
|
15258
|
-
});
|
|
15259
|
-
} else if (imageSize) {
|
|
15260
|
-
// Wait for a render (in case the container size is dependent on the image size).
|
|
15261
|
-
requestAnimationFrame(updateContainerSize);
|
|
15262
|
-
}
|
|
15263
|
-
}, [element?.offsetHeight, element?.offsetWidth, imageSize]);
|
|
15993
|
+
}
|
|
15994
|
+
if (!containerSize || !imageSize.height || !imageSize.width) {
|
|
15995
|
+
// Missing container or image size, abort focus point compute.
|
|
15996
|
+
return {};
|
|
15997
|
+
}
|
|
15998
|
+
const heightScale = imageSize.height / containerSize.height;
|
|
15999
|
+
const widthScale = imageSize.width / containerSize.width;
|
|
16000
|
+
const scale = Math.min(widthScale, heightScale);
|
|
15264
16001
|
|
|
15265
|
-
//
|
|
15266
|
-
const
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
return {
|
|
15274
|
-
visibility: 'hidden'
|
|
15275
|
-
};
|
|
15276
|
-
}
|
|
15277
|
-
if (!containerSize || !imageSize.height || !imageSize.width) {
|
|
15278
|
-
// Missing container or image size abort focus point compute.
|
|
15279
|
-
return {};
|
|
15280
|
-
}
|
|
15281
|
-
const heightScale = imageSize.height / containerSize.height;
|
|
15282
|
-
const widthScale = imageSize.width / containerSize.width;
|
|
15283
|
-
const scale = Math.min(widthScale, heightScale);
|
|
15284
|
-
|
|
15285
|
-
// Focus Y relative to the top (instead of the center)
|
|
15286
|
-
const focusPointFromTop = Math.abs((focusPoint?.y || 0) - 1) / 2;
|
|
15287
|
-
const y = shiftPosition({
|
|
15288
|
-
scale,
|
|
15289
|
-
focusPoint: focusPointFromTop,
|
|
15290
|
-
imageSize: imageSize.height,
|
|
15291
|
-
containerSize: containerSize.height
|
|
15292
|
-
});
|
|
16002
|
+
// Focus Y relative to the top (instead of the center)
|
|
16003
|
+
const focusPointFromTop = Math.abs((focusPoint?.y || 0) - 1) / 2;
|
|
16004
|
+
const y = shiftPosition({
|
|
16005
|
+
scale,
|
|
16006
|
+
focusPoint: focusPointFromTop,
|
|
16007
|
+
imageSize: imageSize.height,
|
|
16008
|
+
containerSize: containerSize.height
|
|
16009
|
+
});
|
|
15293
16010
|
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
return style;
|
|
15308
|
-
};
|
|
16011
|
+
// Focus X relative to the left (instead of the center)
|
|
16012
|
+
const focusPointFromLeft = Math.abs((focusPoint?.x || 0) + 1) / 2;
|
|
16013
|
+
const x = shiftPosition({
|
|
16014
|
+
scale,
|
|
16015
|
+
focusPoint: focusPointFromLeft,
|
|
16016
|
+
imageSize: imageSize.width,
|
|
16017
|
+
containerSize: containerSize.width
|
|
16018
|
+
});
|
|
16019
|
+
const objectPosition = `${x}% ${y}%`;
|
|
16020
|
+
return {
|
|
16021
|
+
objectPosition
|
|
16022
|
+
};
|
|
16023
|
+
}
|
|
15309
16024
|
|
|
15310
16025
|
/**
|
|
15311
16026
|
* Component display name.
|
|
@@ -15336,25 +16051,18 @@ const DEFAULT_PROPS$4 = {
|
|
|
15336
16051
|
* @param ref Component ref.
|
|
15337
16052
|
* @return React element.
|
|
15338
16053
|
*/
|
|
15339
|
-
const Thumbnail =
|
|
15340
|
-
const {
|
|
15341
|
-
isAnyDisabled,
|
|
15342
|
-
otherProps,
|
|
15343
|
-
disabledStateProps
|
|
15344
|
-
} = useDisableStateProps(props);
|
|
15345
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
16054
|
+
const Thumbnail$1 = props => {
|
|
15346
16055
|
const {
|
|
15347
16056
|
align,
|
|
15348
16057
|
alt,
|
|
15349
|
-
aspectRatio = AspectRatio.original,
|
|
16058
|
+
aspectRatio = AspectRatio$1.original,
|
|
15350
16059
|
badge,
|
|
15351
16060
|
className,
|
|
15352
16061
|
crossOrigin,
|
|
16062
|
+
ref,
|
|
15353
16063
|
fallback = DEFAULT_PROPS$4.fallback,
|
|
16064
|
+
focusPointStyle,
|
|
15354
16065
|
fillHeight,
|
|
15355
|
-
// `focusPoint` needs to be here to remove it from `forwardedProps`.
|
|
15356
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15357
|
-
focusPoint,
|
|
15358
16066
|
image,
|
|
15359
16067
|
imgProps,
|
|
15360
16068
|
imgRef: propImgRef,
|
|
@@ -15362,23 +16070,18 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
15362
16070
|
objectFit,
|
|
15363
16071
|
loading = DEFAULT_PROPS$4.loading,
|
|
15364
16072
|
loadingPlaceholderImageRef,
|
|
16073
|
+
isAnyDisabled,
|
|
16074
|
+
disabledStateProps,
|
|
15365
16075
|
size,
|
|
15366
|
-
theme
|
|
16076
|
+
theme,
|
|
16077
|
+
loadingState,
|
|
15367
16078
|
variant,
|
|
15368
16079
|
linkProps,
|
|
15369
16080
|
linkAs,
|
|
15370
16081
|
...forwardedProps
|
|
15371
|
-
} =
|
|
15372
|
-
const [imgElement, setImgElement] = useState();
|
|
15373
|
-
|
|
15374
|
-
// Image loading state.
|
|
15375
|
-
const loadingState = useImageLoad(image, imgElement);
|
|
15376
|
-
const isLoaded = loadingState === 'isLoaded';
|
|
16082
|
+
} = props;
|
|
15377
16083
|
const isLoading = isLoadingProp || loadingState === 'isLoading';
|
|
15378
16084
|
const hasError = loadingState === 'hasError';
|
|
15379
|
-
|
|
15380
|
-
// Focus point.
|
|
15381
|
-
const focusPointStyle = useFocusPointStyle(props, imgElement, isLoaded);
|
|
15382
16085
|
const hasIconErrorFallback = hasError && typeof fallback === 'string';
|
|
15383
16086
|
const hasCustomErrorFallback = hasError && !hasIconErrorFallback;
|
|
15384
16087
|
const imageErrorStyle = {};
|
|
@@ -15391,7 +16094,6 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
15391
16094
|
}
|
|
15392
16095
|
const isLink = Boolean(linkProps?.href || linkAs);
|
|
15393
16096
|
const isClickable = !isAnyDisabled && Boolean(isLink || !!forwardedProps.onClick);
|
|
15394
|
-
const Wrapper = isClickable ? RawClickable : 'div';
|
|
15395
16097
|
const wrapperProps = {
|
|
15396
16098
|
...forwardedProps
|
|
15397
16099
|
};
|
|
@@ -15405,6 +16107,21 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
15405
16107
|
wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
|
|
15406
16108
|
}
|
|
15407
16109
|
}
|
|
16110
|
+
const wrapperClassName = classNames.join(linkProps?.className, className, block$4({
|
|
16111
|
+
[`align-${align}`]: Boolean(align),
|
|
16112
|
+
[`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
|
|
16113
|
+
[`size-${size}`]: Boolean(size),
|
|
16114
|
+
[`theme-${theme}`]: Boolean(theme),
|
|
16115
|
+
[`variant-${variant}`]: Boolean(variant),
|
|
16116
|
+
'is-clickable': isClickable,
|
|
16117
|
+
'has-error': hasError,
|
|
16118
|
+
'has-icon-error-fallback': hasIconErrorFallback,
|
|
16119
|
+
'has-custom-error-fallback': hasCustomErrorFallback,
|
|
16120
|
+
'is-loading': isLoading,
|
|
16121
|
+
[`object-fit-${objectFit}`]: Boolean(objectFit),
|
|
16122
|
+
'has-badge': !!badge,
|
|
16123
|
+
'fill-height': fillHeight
|
|
16124
|
+
}));
|
|
15408
16125
|
|
|
15409
16126
|
// If we have a loading placeholder image that is really loaded (complete)
|
|
15410
16127
|
const loadingPlaceholderImage = isLoading && loadingPlaceholderImageRef?.current?.complete && loadingPlaceholderImageRef?.current || undefined;
|
|
@@ -15413,24 +16130,7 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
15413
16130
|
const loadingStyle = loadingPlaceholderImage ? {
|
|
15414
16131
|
backgroundImage: `url(${loadingPlaceholderImage.src})`
|
|
15415
16132
|
} : undefined;
|
|
15416
|
-
|
|
15417
|
-
...wrapperProps,
|
|
15418
|
-
ref: ref,
|
|
15419
|
-
className: classNames.join(linkProps?.className, className, block$4({
|
|
15420
|
-
[`align-${align}`]: Boolean(align),
|
|
15421
|
-
[`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
|
|
15422
|
-
[`size-${size}`]: Boolean(size),
|
|
15423
|
-
[`theme-${theme}`]: Boolean(theme),
|
|
15424
|
-
[`variant-${variant}`]: Boolean(variant),
|
|
15425
|
-
'is-clickable': isClickable,
|
|
15426
|
-
'has-error': hasError,
|
|
15427
|
-
'has-icon-error-fallback': hasIconErrorFallback,
|
|
15428
|
-
'has-custom-error-fallback': hasCustomErrorFallback,
|
|
15429
|
-
'is-loading': isLoading,
|
|
15430
|
-
[`object-fit-${objectFit}`]: Boolean(objectFit),
|
|
15431
|
-
'has-badge': !!badge,
|
|
15432
|
-
'fill-height': fillHeight
|
|
15433
|
-
})),
|
|
16133
|
+
const innerImage = /*#__PURE__*/jsxs(Fragment, {
|
|
15434
16134
|
children: [/*#__PURE__*/jsxs("span", {
|
|
15435
16135
|
className: element$4('background'),
|
|
15436
16136
|
children: [/*#__PURE__*/jsx("img", {
|
|
@@ -15446,26 +16146,165 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
15446
16146
|
...focusPointStyle,
|
|
15447
16147
|
...loadingStyle
|
|
15448
16148
|
},
|
|
15449
|
-
ref:
|
|
16149
|
+
ref: propImgRef,
|
|
15450
16150
|
className: classNames.join(element$4('image', {
|
|
15451
16151
|
'is-loading': isLoading,
|
|
15452
16152
|
'has-defined-size': Boolean(imgProps?.height && imgProps.width)
|
|
15453
|
-
}), imgProps?.className)
|
|
16153
|
+
}), imgProps?.className)
|
|
16154
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16155
|
+
// @ts-ignore - crossOrigin prop compatibility between React and Vue JSX
|
|
16156
|
+
,
|
|
15454
16157
|
crossOrigin: crossOrigin,
|
|
15455
16158
|
src: image,
|
|
15456
16159
|
alt: alt,
|
|
15457
16160
|
loading: loading
|
|
15458
16161
|
}), !isLoading && hasError && /*#__PURE__*/jsx("span", {
|
|
15459
16162
|
className: element$4('fallback'),
|
|
15460
|
-
children: hasIconErrorFallback ?
|
|
16163
|
+
children: hasIconErrorFallback ? Icon$1({
|
|
15461
16164
|
icon: fallback,
|
|
15462
16165
|
size: Size$1.xxs,
|
|
15463
|
-
theme
|
|
16166
|
+
theme
|
|
15464
16167
|
}) : fallback
|
|
15465
16168
|
})]
|
|
15466
|
-
}), badge
|
|
16169
|
+
}), badge]
|
|
16170
|
+
});
|
|
16171
|
+
|
|
16172
|
+
/** Render `RawClickable` as a function since it is a core component which needs to be treated as such */
|
|
16173
|
+
if (isClickable) {
|
|
16174
|
+
return RawClickable$1({
|
|
16175
|
+
ref,
|
|
16176
|
+
...wrapperProps,
|
|
16177
|
+
className: wrapperClassName,
|
|
16178
|
+
children: innerImage
|
|
16179
|
+
});
|
|
16180
|
+
}
|
|
16181
|
+
return /*#__PURE__*/jsx("div", {
|
|
16182
|
+
ref: ref,
|
|
16183
|
+
...wrapperProps,
|
|
16184
|
+
className: wrapperClassName,
|
|
16185
|
+
children: innerImage
|
|
16186
|
+
});
|
|
16187
|
+
};
|
|
16188
|
+
|
|
16189
|
+
function useImageLoad(imageURL, imgRef) {
|
|
16190
|
+
const [state, setState] = useState(getImageLoadingState(imgRef));
|
|
16191
|
+
|
|
16192
|
+
// Update state when changing image URL or DOM reference.
|
|
16193
|
+
useEffect(() => {
|
|
16194
|
+
setState(getImageLoadingState(imgRef));
|
|
16195
|
+
}, [imageURL, imgRef]);
|
|
16196
|
+
|
|
16197
|
+
// Listen to `load` and `error` event on image
|
|
16198
|
+
useEffect(() => {
|
|
16199
|
+
const img = imgRef;
|
|
16200
|
+
if (!img) return undefined;
|
|
16201
|
+
const update = event => setState(getImageLoadingState(img, event));
|
|
16202
|
+
img.addEventListener('load', update);
|
|
16203
|
+
img.addEventListener('error', update);
|
|
16204
|
+
return () => {
|
|
16205
|
+
img.removeEventListener('load', update);
|
|
16206
|
+
img.removeEventListener('error', update);
|
|
16207
|
+
};
|
|
16208
|
+
}, [imgRef, imgRef?.src]);
|
|
16209
|
+
return state;
|
|
16210
|
+
}
|
|
16211
|
+
|
|
16212
|
+
// Compute CSS properties to apply the focus point.
|
|
16213
|
+
const useFocusPointStyle = ({
|
|
16214
|
+
image,
|
|
16215
|
+
aspectRatio,
|
|
16216
|
+
focusPoint,
|
|
16217
|
+
imgProps: {
|
|
16218
|
+
width,
|
|
16219
|
+
height
|
|
16220
|
+
} = {}
|
|
16221
|
+
}, element, isLoaded) => {
|
|
16222
|
+
// Get natural image size from imgProps or img element.
|
|
16223
|
+
const imageSize = useMemo(() => getImageSize({
|
|
16224
|
+
image,
|
|
16225
|
+
aspectRatio,
|
|
16226
|
+
focusPoint,
|
|
16227
|
+
width: typeof width === 'number' ? width : undefined,
|
|
16228
|
+
height: typeof height === 'number' ? height : undefined,
|
|
16229
|
+
element,
|
|
16230
|
+
isLoaded
|
|
16231
|
+
}), [aspectRatio, element, focusPoint, height, image, isLoaded, width]);
|
|
16232
|
+
|
|
16233
|
+
// Get container size (dependant on imageSize).
|
|
16234
|
+
const [containerSize, setContainerSize] = useState(undefined);
|
|
16235
|
+
useEffect(function updateContainerSize() {
|
|
16236
|
+
const cWidth = element?.offsetWidth;
|
|
16237
|
+
const cHeight = element?.offsetHeight;
|
|
16238
|
+
if (cWidth && cHeight) {
|
|
16239
|
+
// Update only if needed.
|
|
16240
|
+
setContainerSize(oldContainerSize => oldContainerSize?.width === cWidth && oldContainerSize.height === cHeight ? oldContainerSize : {
|
|
16241
|
+
width: cWidth,
|
|
16242
|
+
height: cHeight
|
|
16243
|
+
});
|
|
16244
|
+
} else if (imageSize) {
|
|
16245
|
+
// Wait for a render (in case the container size is dependent on the image size).
|
|
16246
|
+
requestAnimationFrame(updateContainerSize);
|
|
16247
|
+
}
|
|
16248
|
+
}, [element?.offsetHeight, element?.offsetWidth, imageSize]);
|
|
16249
|
+
|
|
16250
|
+
// Compute style.
|
|
16251
|
+
const style = useMemo(() => calculateFocusPointStyle({
|
|
16252
|
+
image,
|
|
16253
|
+
aspectRatio,
|
|
16254
|
+
focusPoint,
|
|
16255
|
+
element,
|
|
16256
|
+
imageSize,
|
|
16257
|
+
containerSize
|
|
16258
|
+
}), [aspectRatio, containerSize, element, focusPoint, image, imageSize]);
|
|
16259
|
+
return style;
|
|
16260
|
+
};
|
|
16261
|
+
|
|
16262
|
+
/**
|
|
16263
|
+
* Defines the props of the component.
|
|
16264
|
+
*/
|
|
16265
|
+
|
|
16266
|
+
/**
|
|
16267
|
+
* Thumbnail component.
|
|
16268
|
+
*
|
|
16269
|
+
* @param props Component props.
|
|
16270
|
+
* @param ref Component ref.
|
|
16271
|
+
* @return React element.
|
|
16272
|
+
*/
|
|
16273
|
+
const Thumbnail = forwardRef((props, ref) => {
|
|
16274
|
+
const {
|
|
16275
|
+
isAnyDisabled,
|
|
16276
|
+
otherProps,
|
|
16277
|
+
disabledStateProps
|
|
16278
|
+
} = useDisableStateProps(props);
|
|
16279
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
16280
|
+
const {
|
|
16281
|
+
badge,
|
|
16282
|
+
focusPoint,
|
|
16283
|
+
image,
|
|
16284
|
+
imgRef: propImgRef,
|
|
16285
|
+
...forwardedProps
|
|
16286
|
+
} = otherProps;
|
|
16287
|
+
const [imgElement, setImgElement] = useState();
|
|
16288
|
+
|
|
16289
|
+
// Image loading state.
|
|
16290
|
+
const loadingState = useImageLoad(image, imgElement);
|
|
16291
|
+
const isLoaded = loadingState === 'isLoaded';
|
|
16292
|
+
|
|
16293
|
+
// Focus point.
|
|
16294
|
+
const focusPointStyle = useFocusPointStyle(props, imgElement, isLoaded);
|
|
16295
|
+
return Thumbnail$1({
|
|
16296
|
+
ref,
|
|
16297
|
+
...forwardedProps,
|
|
16298
|
+
theme: forwardedProps.theme || defaultTheme,
|
|
16299
|
+
isAnyDisabled,
|
|
16300
|
+
disabledStateProps,
|
|
16301
|
+
focusPointStyle,
|
|
16302
|
+
loadingState,
|
|
16303
|
+
imgRef: useMergeRefs(setImgElement, propImgRef),
|
|
16304
|
+
image,
|
|
16305
|
+
badge: badge && /*#__PURE__*/React__default.cloneElement(badge, {
|
|
15467
16306
|
className: classNames.join(element$4('badge'), badge.props.className)
|
|
15468
|
-
})
|
|
16307
|
+
})
|
|
15469
16308
|
});
|
|
15470
16309
|
});
|
|
15471
16310
|
Thumbnail.displayName = COMPONENT_NAME$4;
|
|
@@ -15487,7 +16326,7 @@ Thumbnail.defaultProps = DEFAULT_PROPS$4;
|
|
|
15487
16326
|
* @deprecated
|
|
15488
16327
|
*/
|
|
15489
16328
|
const ThumbnailAspectRatio = {
|
|
15490
|
-
...AspectRatio
|
|
16329
|
+
...AspectRatio$1
|
|
15491
16330
|
};
|
|
15492
16331
|
|
|
15493
16332
|
/**
|
|
@@ -15918,7 +16757,7 @@ const {
|
|
|
15918
16757
|
* Component default props.
|
|
15919
16758
|
*/
|
|
15920
16759
|
const DEFAULT_PROPS$1 = {
|
|
15921
|
-
aspectRatio: AspectRatio.horizontal,
|
|
16760
|
+
aspectRatio: AspectRatio$1.horizontal,
|
|
15922
16761
|
size: Size$1.xl,
|
|
15923
16762
|
variant: UploaderVariant.square
|
|
15924
16763
|
};
|
|
@@ -15950,7 +16789,7 @@ const Uploader = forwardRef((props, ref) => {
|
|
|
15950
16789
|
...forwardedProps
|
|
15951
16790
|
} = otherProps;
|
|
15952
16791
|
// Adjust to square aspect ratio when using circle variants.
|
|
15953
|
-
const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio.square : aspectRatio;
|
|
16792
|
+
const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio$1.square : aspectRatio;
|
|
15954
16793
|
const handleClick = React__default.useCallback(evt => {
|
|
15955
16794
|
if (isAnyDisabled) {
|
|
15956
16795
|
evt.preventDefault();
|
|
@@ -16163,5 +17002,5 @@ UserBlock.displayName = COMPONENT_NAME;
|
|
|
16163
17002
|
UserBlock.className = CLASSNAME;
|
|
16164
17003
|
UserBlock.defaultProps = DEFAULT_PROPS;
|
|
16165
17004
|
|
|
16166
|
-
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup,
|
|
17005
|
+
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, COMPONENT_NAME$1e as COMPONENT_NAME, Checkbox, Chip, ChipGroup, Combobox, ComboboxButton, ComboboxDivider, ComboboxInput, ComboboxListBox, ComboboxOption, ComboboxOptionAction, ComboboxOptionMoreInfo, ComboboxOptionSkeleton, ComboboxSection, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$16 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, LUMX_CLASSNAME, 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, SUB_COMPONENTS, 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
17006
|
//# sourceMappingURL=index.js.map
|