@lumx/react 4.3.2-alpha.1 → 4.3.2-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +171 -56
- package/index.js +722 -364
- package/index.js.map +1 -1
- package/package.json +8 -3
- package/utils/index.js +1 -1
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio, ColorVariant, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
|
|
2
|
-
export * from '@lumx/core/js/constants';
|
|
3
|
-
export * from '@lumx/core/js/types';
|
|
1
|
+
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio as AspectRatio$1, ColorVariant, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants/index.js';
|
|
2
|
+
export * from '@lumx/core/js/constants/index.js';
|
|
3
|
+
export * from '@lumx/core/js/types/index.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { useState, useEffect, useMemo, useRef, useCallback, Children, useLayoutEffect, cloneElement, createContext, isValidElement, useContext, useReducer } from 'react';
|
|
6
|
-
import { mdiAlert } from '@lumx/icons/esm/alert';
|
|
7
|
-
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle';
|
|
8
|
-
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle';
|
|
9
|
-
import { mdiInformation } from '@lumx/icons/esm/information';
|
|
10
|
-
import { classNames, onEnterPressed, onEscapePressed, onButtonPressed, detectHorizontalSwipe } from '@lumx/core/js/utils';
|
|
6
|
+
import { mdiAlert } from '@lumx/icons/esm/alert.js';
|
|
7
|
+
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle.js';
|
|
8
|
+
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle.js';
|
|
9
|
+
import { mdiInformation } from '@lumx/icons/esm/information.js';
|
|
10
|
+
import { classNames, onEnterPressed, onEscapePressed, onButtonPressed, detectHorizontalSwipe } from '@lumx/core/js/utils/index.js';
|
|
11
11
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
12
12
|
import last from 'lodash/last';
|
|
13
13
|
import pull from 'lodash/pull';
|
|
@@ -18,38 +18,38 @@ import partition from 'lodash/partition';
|
|
|
18
18
|
import reduce from 'lodash/reduce';
|
|
19
19
|
import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/DpdvhbTO.js';
|
|
20
20
|
import isEmpty from 'lodash/isEmpty';
|
|
21
|
-
import { getDisabledState } from '@lumx/core/js/utils/disabledState';
|
|
22
|
-
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle';
|
|
21
|
+
import { getDisabledState } from '@lumx/core/js/utils/disabledState/index.js';
|
|
22
|
+
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle.js';
|
|
23
23
|
import memoize from 'lodash/memoize';
|
|
24
|
-
import { mdiClose } from '@lumx/icons/esm/close';
|
|
24
|
+
import { mdiClose } from '@lumx/icons/esm/close.js';
|
|
25
25
|
import isFunction from 'lodash/isFunction';
|
|
26
|
-
import { mdiImageBroken } from '@lumx/icons/esm/image-broken';
|
|
27
|
-
import { mdiCheck } from '@lumx/icons/esm/check';
|
|
28
|
-
import { mdiMinus } from '@lumx/icons/esm/minus';
|
|
29
|
-
import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left';
|
|
30
|
-
import { mdiChevronRight } from '@lumx/icons/esm/chevron-right';
|
|
26
|
+
import { mdiImageBroken } from '@lumx/icons/esm/image-broken.js';
|
|
27
|
+
import { mdiCheck } from '@lumx/icons/esm/check.js';
|
|
28
|
+
import { mdiMinus } from '@lumx/icons/esm/minus.js';
|
|
29
|
+
import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left.js';
|
|
30
|
+
import { mdiChevronRight } from '@lumx/icons/esm/chevron-right.js';
|
|
31
31
|
import castArray from 'lodash/castArray';
|
|
32
|
-
import { mdiDragVertical } from '@lumx/icons/esm/drag-vertical';
|
|
33
|
-
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down';
|
|
34
|
-
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up';
|
|
32
|
+
import { mdiDragVertical } from '@lumx/icons/esm/drag-vertical.js';
|
|
33
|
+
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down.js';
|
|
34
|
+
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up.js';
|
|
35
35
|
import noop from 'lodash/noop';
|
|
36
36
|
import pick from 'lodash/pick';
|
|
37
37
|
import isInteger from 'lodash/isInteger';
|
|
38
|
-
import { mdiMagnifyMinusOutline } from '@lumx/icons/esm/magnify-minus-outline';
|
|
39
|
-
import { mdiMagnifyPlusOutline } from '@lumx/icons/esm/magnify-plus-outline';
|
|
38
|
+
import { mdiMagnifyMinusOutline } from '@lumx/icons/esm/magnify-minus-outline.js';
|
|
39
|
+
import { mdiMagnifyPlusOutline } from '@lumx/icons/esm/magnify-plus-outline.js';
|
|
40
40
|
import throttle from 'lodash/throttle';
|
|
41
41
|
import range from 'lodash/range';
|
|
42
|
-
import { mdiPlayCircleOutline } from '@lumx/icons/esm/play-circle-outline';
|
|
43
|
-
import { mdiPauseCircleOutline } from '@lumx/icons/esm/pause-circle-outline';
|
|
42
|
+
import { mdiPlayCircleOutline } from '@lumx/icons/esm/play-circle-outline.js';
|
|
43
|
+
import { mdiPauseCircleOutline } from '@lumx/icons/esm/pause-circle-outline.js';
|
|
44
44
|
import chunk from 'lodash/chunk';
|
|
45
45
|
import ReactDOM from 'react-dom';
|
|
46
46
|
import take from 'lodash/take';
|
|
47
|
-
import { mdiRadioboxBlank } from '@lumx/icons/esm/radiobox-blank';
|
|
48
|
-
import { mdiRadioboxMarked } from '@lumx/icons/esm/radiobox-marked';
|
|
49
|
-
import { mdiMenuDown } from '@lumx/icons/esm/menu-down';
|
|
50
|
-
import { getWithSelector } from '@lumx/core/js/utils/selectors/getWithSelector';
|
|
51
|
-
import { mdiArrowDown } from '@lumx/icons/esm/arrow-down';
|
|
52
|
-
import { mdiArrowUp } from '@lumx/icons/esm/arrow-up';
|
|
47
|
+
import { mdiRadioboxBlank } from '@lumx/icons/esm/radiobox-blank.js';
|
|
48
|
+
import { mdiRadioboxMarked } from '@lumx/icons/esm/radiobox-marked.js';
|
|
49
|
+
import { mdiMenuDown } from '@lumx/icons/esm/menu-down.js';
|
|
50
|
+
import { getWithSelector } from '@lumx/core/js/utils/selectors/getWithSelector/index.js';
|
|
51
|
+
import { mdiArrowDown } from '@lumx/icons/esm/arrow-down.js';
|
|
52
|
+
import { mdiArrowUp } from '@lumx/icons/esm/arrow-up.js';
|
|
53
53
|
import set from 'lodash/set';
|
|
54
54
|
|
|
55
55
|
let i = 0;
|
|
@@ -109,7 +109,7 @@ const {
|
|
|
109
109
|
/**
|
|
110
110
|
* Component default props.
|
|
111
111
|
*/
|
|
112
|
-
const DEFAULT_PROPS$
|
|
112
|
+
const DEFAULT_PROPS$1a = {
|
|
113
113
|
size: Size$1.tiny,
|
|
114
114
|
kind: Kind$1.info
|
|
115
115
|
};
|
|
@@ -130,8 +130,8 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
130
130
|
className,
|
|
131
131
|
cancelProps,
|
|
132
132
|
confirmProps,
|
|
133
|
-
kind = DEFAULT_PROPS$
|
|
134
|
-
size = DEFAULT_PROPS$
|
|
133
|
+
kind = DEFAULT_PROPS$1a.kind,
|
|
134
|
+
size = DEFAULT_PROPS$1a.size,
|
|
135
135
|
dialogProps,
|
|
136
136
|
children,
|
|
137
137
|
...forwardedProps
|
|
@@ -219,7 +219,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
219
219
|
});
|
|
220
220
|
AlertDialog.displayName = COMPONENT_NAME$1l;
|
|
221
221
|
AlertDialog.className = CLASSNAME$1j;
|
|
222
|
-
AlertDialog.defaultProps = DEFAULT_PROPS$
|
|
222
|
+
AlertDialog.defaultProps = DEFAULT_PROPS$1a;
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
225
|
* Hook focusing an element when defined and `focus` boolean `true`.
|
|
@@ -321,7 +321,7 @@ const CLASSNAME$1i = 'lumx-autocomplete';
|
|
|
321
321
|
/**
|
|
322
322
|
* Component default props.
|
|
323
323
|
*/
|
|
324
|
-
const DEFAULT_PROPS$
|
|
324
|
+
const DEFAULT_PROPS$19 = {
|
|
325
325
|
anchorToInput: false,
|
|
326
326
|
closeOnClick: false,
|
|
327
327
|
closeOnClickAway: true,
|
|
@@ -343,13 +343,13 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
343
343
|
otherProps
|
|
344
344
|
} = useDisableStateProps(props);
|
|
345
345
|
const {
|
|
346
|
-
anchorToInput = DEFAULT_PROPS$
|
|
346
|
+
anchorToInput = DEFAULT_PROPS$19.anchorToInput,
|
|
347
347
|
children,
|
|
348
348
|
chips,
|
|
349
349
|
className,
|
|
350
|
-
closeOnClick = DEFAULT_PROPS$
|
|
351
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
352
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
350
|
+
closeOnClick = DEFAULT_PROPS$19.closeOnClick,
|
|
351
|
+
closeOnClickAway = DEFAULT_PROPS$19.closeOnClickAway,
|
|
352
|
+
closeOnEscape = DEFAULT_PROPS$19.closeOnEscape,
|
|
353
353
|
error,
|
|
354
354
|
fitToAnchorWidth,
|
|
355
355
|
hasError,
|
|
@@ -370,7 +370,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
370
370
|
onInfiniteScroll,
|
|
371
371
|
placeholder,
|
|
372
372
|
placement,
|
|
373
|
-
shouldFocusOnClose = DEFAULT_PROPS$
|
|
373
|
+
shouldFocusOnClose = DEFAULT_PROPS$19.shouldFocusOnClose,
|
|
374
374
|
theme = defaultTheme,
|
|
375
375
|
value,
|
|
376
376
|
textFieldProps = {},
|
|
@@ -425,7 +425,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
425
425
|
});
|
|
426
426
|
Autocomplete.displayName = COMPONENT_NAME$1k;
|
|
427
427
|
Autocomplete.className = CLASSNAME$1i;
|
|
428
|
-
Autocomplete.defaultProps = DEFAULT_PROPS$
|
|
428
|
+
Autocomplete.defaultProps = DEFAULT_PROPS$19;
|
|
429
429
|
|
|
430
430
|
/**
|
|
431
431
|
* Component display name.
|
|
@@ -440,7 +440,7 @@ const CLASSNAME$1h = 'lumx-autocomplete-multiple';
|
|
|
440
440
|
/**
|
|
441
441
|
* Component default props.
|
|
442
442
|
*/
|
|
443
|
-
const DEFAULT_PROPS$
|
|
443
|
+
const DEFAULT_PROPS$18 = {
|
|
444
444
|
closeOnClickAway: true,
|
|
445
445
|
closeOnEscape: true,
|
|
446
446
|
selectedChipRender(choice, index, onClear, isDisabled) {
|
|
@@ -480,8 +480,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
480
480
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
481
481
|
chipsAlignment,
|
|
482
482
|
className,
|
|
483
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
484
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
483
|
+
closeOnClickAway = DEFAULT_PROPS$18.closeOnClickAway,
|
|
484
|
+
closeOnEscape = DEFAULT_PROPS$18.closeOnEscape,
|
|
485
485
|
fitToAnchorWidth,
|
|
486
486
|
hasError,
|
|
487
487
|
helper,
|
|
@@ -503,12 +503,12 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
503
503
|
onKeyDown,
|
|
504
504
|
placeholder,
|
|
505
505
|
placement,
|
|
506
|
-
selectedChipRender = DEFAULT_PROPS$
|
|
506
|
+
selectedChipRender = DEFAULT_PROPS$18.selectedChipRender,
|
|
507
507
|
shouldFocusOnClose,
|
|
508
508
|
theme = defaultTheme,
|
|
509
509
|
type,
|
|
510
510
|
value,
|
|
511
|
-
values = DEFAULT_PROPS$
|
|
511
|
+
values = DEFAULT_PROPS$18.values,
|
|
512
512
|
...forwardedProps
|
|
513
513
|
} = otherProps;
|
|
514
514
|
return /*#__PURE__*/jsx(Autocomplete, {
|
|
@@ -550,7 +550,7 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
550
550
|
});
|
|
551
551
|
AutocompleteMultiple.displayName = COMPONENT_NAME$1j;
|
|
552
552
|
AutocompleteMultiple.className = CLASSNAME$1h;
|
|
553
|
-
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$
|
|
553
|
+
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$18;
|
|
554
554
|
|
|
555
555
|
/**
|
|
556
556
|
* Component display name.
|
|
@@ -569,7 +569,7 @@ const {
|
|
|
569
569
|
/**
|
|
570
570
|
* Component default props.
|
|
571
571
|
*/
|
|
572
|
-
const DEFAULT_PROPS$
|
|
572
|
+
const DEFAULT_PROPS$17 = {
|
|
573
573
|
size: Size$1.m
|
|
574
574
|
};
|
|
575
575
|
|
|
@@ -592,7 +592,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
592
592
|
linkAs,
|
|
593
593
|
onClick,
|
|
594
594
|
onKeyPress,
|
|
595
|
-
size = DEFAULT_PROPS$
|
|
595
|
+
size = DEFAULT_PROPS$17.size,
|
|
596
596
|
theme = defaultTheme,
|
|
597
597
|
thumbnailProps,
|
|
598
598
|
...forwardedProps
|
|
@@ -611,7 +611,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
611
611
|
onClick: onClick,
|
|
612
612
|
onKeyPress: onKeyPress,
|
|
613
613
|
...thumbnailProps,
|
|
614
|
-
aspectRatio: AspectRatio.square,
|
|
614
|
+
aspectRatio: AspectRatio$1.square,
|
|
615
615
|
size: size,
|
|
616
616
|
image: image,
|
|
617
617
|
alt: alt,
|
|
@@ -627,7 +627,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
627
627
|
});
|
|
628
628
|
Avatar.displayName = COMPONENT_NAME$1i;
|
|
629
629
|
Avatar.className = CLASSNAME$1g;
|
|
630
|
-
Avatar.defaultProps = DEFAULT_PROPS$
|
|
630
|
+
Avatar.defaultProps = DEFAULT_PROPS$17;
|
|
631
631
|
|
|
632
632
|
/**
|
|
633
633
|
* Alignments.
|
|
@@ -668,6 +668,12 @@ const TypographyInterface = {
|
|
|
668
668
|
*/
|
|
669
669
|
const Typography = {
|
|
670
670
|
...TypographyInterface};
|
|
671
|
+
/**
|
|
672
|
+
* All available aspect ratios.
|
|
673
|
+
*/
|
|
674
|
+
const AspectRatio = {
|
|
675
|
+
/** Intrinsic content ratio. */
|
|
676
|
+
original: 'original'};
|
|
671
677
|
/**
|
|
672
678
|
* Semantic info about the purpose of the component
|
|
673
679
|
*/
|
|
@@ -932,7 +938,7 @@ const {
|
|
|
932
938
|
/**
|
|
933
939
|
* Component default props.
|
|
934
940
|
*/
|
|
935
|
-
const DEFAULT_PROPS$
|
|
941
|
+
const DEFAULT_PROPS$16 = {
|
|
936
942
|
color: ColorPalette.primary
|
|
937
943
|
};
|
|
938
944
|
|
|
@@ -946,7 +952,7 @@ const Badge$1 = props => {
|
|
|
946
952
|
const {
|
|
947
953
|
children,
|
|
948
954
|
className,
|
|
949
|
-
color = DEFAULT_PROPS$
|
|
955
|
+
color = DEFAULT_PROPS$16.color,
|
|
950
956
|
ref,
|
|
951
957
|
...forwardedProps
|
|
952
958
|
} = props;
|
|
@@ -961,7 +967,7 @@ const Badge$1 = props => {
|
|
|
961
967
|
};
|
|
962
968
|
Badge$1.displayName = COMPONENT_NAME$1h;
|
|
963
969
|
Badge$1.className = CLASSNAME$1f;
|
|
964
|
-
Badge$1.defaultProps = DEFAULT_PROPS$
|
|
970
|
+
Badge$1.defaultProps = DEFAULT_PROPS$16;
|
|
965
971
|
|
|
966
972
|
/**
|
|
967
973
|
* Defines the props of the component.
|
|
@@ -1185,7 +1191,7 @@ const {
|
|
|
1185
1191
|
/**
|
|
1186
1192
|
* Component default props.
|
|
1187
1193
|
*/
|
|
1188
|
-
const DEFAULT_PROPS$
|
|
1194
|
+
const DEFAULT_PROPS$15 = {
|
|
1189
1195
|
emphasis: Emphasis.high,
|
|
1190
1196
|
size: Size.m
|
|
1191
1197
|
};
|
|
@@ -1199,10 +1205,10 @@ const DEFAULT_PROPS$14 = {
|
|
|
1199
1205
|
const Button$1 = props => {
|
|
1200
1206
|
const {
|
|
1201
1207
|
className,
|
|
1202
|
-
emphasis = DEFAULT_PROPS$
|
|
1208
|
+
emphasis = DEFAULT_PROPS$15.emphasis,
|
|
1203
1209
|
leftIcon,
|
|
1204
1210
|
rightIcon,
|
|
1205
|
-
size = DEFAULT_PROPS$
|
|
1211
|
+
size = DEFAULT_PROPS$15.size,
|
|
1206
1212
|
...forwardedProps
|
|
1207
1213
|
} = props;
|
|
1208
1214
|
const buttonClassName = classnames(className, modifier({
|
|
@@ -1219,7 +1225,7 @@ const Button$1 = props => {
|
|
|
1219
1225
|
};
|
|
1220
1226
|
Button$1.displayName = COMPONENT_NAME$1e;
|
|
1221
1227
|
Button$1.className = CLASSNAME$1d;
|
|
1222
|
-
Button$1.defaultProps = DEFAULT_PROPS$
|
|
1228
|
+
Button$1.defaultProps = DEFAULT_PROPS$15;
|
|
1223
1229
|
|
|
1224
1230
|
/**
|
|
1225
1231
|
* Properties of a component to use to determine it's name.
|
|
@@ -1287,7 +1293,7 @@ const Button = forwardRef((props, ref) => {
|
|
|
1287
1293
|
});
|
|
1288
1294
|
Button.displayName = COMPONENT_NAME$1e;
|
|
1289
1295
|
Button.className = CLASSNAME$1d;
|
|
1290
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
1296
|
+
Button.defaultProps = DEFAULT_PROPS$15;
|
|
1291
1297
|
|
|
1292
1298
|
const COMPONENT_NAME$1d = 'Icon';
|
|
1293
1299
|
const IconClassName = 'lumx-icon';
|
|
@@ -1304,7 +1310,7 @@ const {
|
|
|
1304
1310
|
/**
|
|
1305
1311
|
* Component default props.
|
|
1306
1312
|
*/
|
|
1307
|
-
const DEFAULT_PROPS$
|
|
1313
|
+
const DEFAULT_PROPS$14 = {};
|
|
1308
1314
|
|
|
1309
1315
|
/**
|
|
1310
1316
|
* Icon component.
|
|
@@ -1384,7 +1390,7 @@ const Icon$1 = props => {
|
|
|
1384
1390
|
};
|
|
1385
1391
|
Icon$1.displayName = COMPONENT_NAME$1d;
|
|
1386
1392
|
Icon$1.className = CLASSNAME$1c;
|
|
1387
|
-
Icon$1.defaultProps = DEFAULT_PROPS$
|
|
1393
|
+
Icon$1.defaultProps = DEFAULT_PROPS$14;
|
|
1388
1394
|
|
|
1389
1395
|
/**
|
|
1390
1396
|
* Component display name.
|
|
@@ -1399,7 +1405,7 @@ const CLASSNAME$1b = 'lumx-icon-button';
|
|
|
1399
1405
|
/**
|
|
1400
1406
|
* Component default props.
|
|
1401
1407
|
*/
|
|
1402
|
-
const DEFAULT_PROPS$
|
|
1408
|
+
const DEFAULT_PROPS$13 = {
|
|
1403
1409
|
emphasis: Emphasis.high,
|
|
1404
1410
|
size: Size.m
|
|
1405
1411
|
};
|
|
@@ -1412,11 +1418,11 @@ const DEFAULT_PROPS$12 = {
|
|
|
1412
1418
|
*/
|
|
1413
1419
|
const IconButton$1 = props => {
|
|
1414
1420
|
const {
|
|
1415
|
-
emphasis = DEFAULT_PROPS$
|
|
1421
|
+
emphasis = DEFAULT_PROPS$13.emphasis,
|
|
1416
1422
|
image,
|
|
1417
1423
|
icon,
|
|
1418
1424
|
label,
|
|
1419
|
-
size = DEFAULT_PROPS$
|
|
1425
|
+
size = DEFAULT_PROPS$13.size,
|
|
1420
1426
|
...forwardedProps
|
|
1421
1427
|
} = props;
|
|
1422
1428
|
const defaultChildren = image ? /*#__PURE__*/jsx("img", {
|
|
@@ -1437,7 +1443,7 @@ const IconButton$1 = props => {
|
|
|
1437
1443
|
};
|
|
1438
1444
|
IconButton$1.displayName = COMPONENT_NAME$1c;
|
|
1439
1445
|
IconButton$1.className = CLASSNAME$1b;
|
|
1440
|
-
IconButton$1.defaultProps = DEFAULT_PROPS$
|
|
1446
|
+
IconButton$1.defaultProps = DEFAULT_PROPS$13;
|
|
1441
1447
|
|
|
1442
1448
|
/**
|
|
1443
1449
|
* IconButton component.
|
|
@@ -1474,7 +1480,7 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
1474
1480
|
});
|
|
1475
1481
|
IconButton.displayName = COMPONENT_NAME$1c;
|
|
1476
1482
|
IconButton.className = CLASSNAME$1b;
|
|
1477
|
-
IconButton.defaultProps = DEFAULT_PROPS$
|
|
1483
|
+
IconButton.defaultProps = DEFAULT_PROPS$13;
|
|
1478
1484
|
|
|
1479
1485
|
/**
|
|
1480
1486
|
* Component display name.
|
|
@@ -1489,7 +1495,7 @@ const CLASSNAME$1a = 'lumx-button-group';
|
|
|
1489
1495
|
/**
|
|
1490
1496
|
* Component default props.
|
|
1491
1497
|
*/
|
|
1492
|
-
const DEFAULT_PROPS$
|
|
1498
|
+
const DEFAULT_PROPS$12 = {};
|
|
1493
1499
|
|
|
1494
1500
|
/**
|
|
1495
1501
|
* ButtonGroup component.
|
|
@@ -1511,7 +1517,7 @@ const ButtonGroup$1 = props => {
|
|
|
1511
1517
|
};
|
|
1512
1518
|
ButtonGroup$1.displayName = COMPONENT_NAME$1b;
|
|
1513
1519
|
ButtonGroup$1.className = CLASSNAME$1a;
|
|
1514
|
-
ButtonGroup$1.defaultProps = DEFAULT_PROPS$
|
|
1520
|
+
ButtonGroup$1.defaultProps = DEFAULT_PROPS$12;
|
|
1515
1521
|
|
|
1516
1522
|
/**
|
|
1517
1523
|
* ButtonGroup component.
|
|
@@ -1528,7 +1534,7 @@ const ButtonGroup = forwardRef((props, ref) => {
|
|
|
1528
1534
|
});
|
|
1529
1535
|
ButtonGroup.displayName = COMPONENT_NAME$1b;
|
|
1530
1536
|
ButtonGroup.className = CLASSNAME$1a;
|
|
1531
|
-
ButtonGroup.defaultProps = DEFAULT_PROPS$
|
|
1537
|
+
ButtonGroup.defaultProps = DEFAULT_PROPS$12;
|
|
1532
1538
|
|
|
1533
1539
|
const COMPONENT_NAME$1a = 'InputLabel';
|
|
1534
1540
|
const InputLabelClassName = 'lumx-input-label';
|
|
@@ -1536,7 +1542,7 @@ const CLASSNAME$19 = InputLabelClassName;
|
|
|
1536
1542
|
const {
|
|
1537
1543
|
block: block$_
|
|
1538
1544
|
} = bem(CLASSNAME$19);
|
|
1539
|
-
const DEFAULT_PROPS$
|
|
1545
|
+
const DEFAULT_PROPS$11 = {};
|
|
1540
1546
|
|
|
1541
1547
|
/**
|
|
1542
1548
|
* InputLabel component.
|
|
@@ -1566,7 +1572,7 @@ function InputLabel$1(props) {
|
|
|
1566
1572
|
}
|
|
1567
1573
|
InputLabel$1.displayName = COMPONENT_NAME$1a;
|
|
1568
1574
|
InputLabel$1.className = CLASSNAME$19;
|
|
1569
|
-
InputLabel$1.defaultProps = DEFAULT_PROPS$
|
|
1575
|
+
InputLabel$1.defaultProps = DEFAULT_PROPS$11;
|
|
1570
1576
|
|
|
1571
1577
|
const INPUT_HELPER_CONFIGURATION = {
|
|
1572
1578
|
[Kind.error]: {
|
|
@@ -1595,7 +1601,7 @@ const {
|
|
|
1595
1601
|
/**
|
|
1596
1602
|
* Component default props.
|
|
1597
1603
|
*/
|
|
1598
|
-
const DEFAULT_PROPS
|
|
1604
|
+
const DEFAULT_PROPS$10 = {
|
|
1599
1605
|
kind: Kind.info
|
|
1600
1606
|
};
|
|
1601
1607
|
|
|
@@ -1606,7 +1612,7 @@ function InputHelper$1(props) {
|
|
|
1606
1612
|
const {
|
|
1607
1613
|
children,
|
|
1608
1614
|
className,
|
|
1609
|
-
kind = DEFAULT_PROPS
|
|
1615
|
+
kind = DEFAULT_PROPS$10.kind,
|
|
1610
1616
|
theme,
|
|
1611
1617
|
ref,
|
|
1612
1618
|
...forwardedProps
|
|
@@ -1626,7 +1632,7 @@ function InputHelper$1(props) {
|
|
|
1626
1632
|
}
|
|
1627
1633
|
InputHelper$1.displayName = COMPONENT_NAME$19;
|
|
1628
1634
|
InputHelper$1.className = CLASSNAME$18;
|
|
1629
|
-
InputHelper$1.defaultProps = DEFAULT_PROPS
|
|
1635
|
+
InputHelper$1.defaultProps = DEFAULT_PROPS$10;
|
|
1630
1636
|
|
|
1631
1637
|
const INTERMEDIATE_STATE = 'intermediate';
|
|
1632
1638
|
|
|
@@ -1741,7 +1747,7 @@ const Checkbox$1 = props => {
|
|
|
1741
1747
|
/**
|
|
1742
1748
|
* Component default props.
|
|
1743
1749
|
*/
|
|
1744
|
-
const DEFAULT_PROPS
|
|
1750
|
+
const DEFAULT_PROPS$$ = {};
|
|
1745
1751
|
|
|
1746
1752
|
/**
|
|
1747
1753
|
* Checkbox component.
|
|
@@ -1803,7 +1809,7 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1803
1809
|
});
|
|
1804
1810
|
Checkbox.displayName = COMPONENT_NAME$18;
|
|
1805
1811
|
Checkbox.className = CLASSNAME$17;
|
|
1806
|
-
Checkbox.defaultProps = DEFAULT_PROPS
|
|
1812
|
+
Checkbox.defaultProps = DEFAULT_PROPS$$;
|
|
1807
1813
|
|
|
1808
1814
|
/**
|
|
1809
1815
|
* Wrap mouse event handler to stop event propagation.
|
|
@@ -1838,7 +1844,7 @@ const {
|
|
|
1838
1844
|
/**
|
|
1839
1845
|
* Component default props.
|
|
1840
1846
|
*/
|
|
1841
|
-
const DEFAULT_PROPS$
|
|
1847
|
+
const DEFAULT_PROPS$_ = {
|
|
1842
1848
|
size: Size$1.m
|
|
1843
1849
|
};
|
|
1844
1850
|
|
|
@@ -1868,7 +1874,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1868
1874
|
onAfterClick,
|
|
1869
1875
|
onBeforeClick,
|
|
1870
1876
|
onClick,
|
|
1871
|
-
size = DEFAULT_PROPS$
|
|
1877
|
+
size = DEFAULT_PROPS$_.size,
|
|
1872
1878
|
theme = defaultTheme,
|
|
1873
1879
|
href,
|
|
1874
1880
|
onKeyDown,
|
|
@@ -1940,7 +1946,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1940
1946
|
});
|
|
1941
1947
|
Chip.displayName = COMPONENT_NAME$17;
|
|
1942
1948
|
Chip.className = CLASSNAME$16;
|
|
1943
|
-
Chip.defaultProps = DEFAULT_PROPS$
|
|
1949
|
+
Chip.defaultProps = DEFAULT_PROPS$_;
|
|
1944
1950
|
|
|
1945
1951
|
const INITIAL_STATE_ACTIVE_CHIP = -1;
|
|
1946
1952
|
|
|
@@ -1996,7 +2002,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
|
|
|
1996
2002
|
/**
|
|
1997
2003
|
* Component default props.
|
|
1998
2004
|
*/
|
|
1999
|
-
const DEFAULT_PROPS$
|
|
2005
|
+
const DEFAULT_PROPS$Z = {};
|
|
2000
2006
|
|
|
2001
2007
|
/**
|
|
2002
2008
|
* Component display name.
|
|
@@ -2031,7 +2037,7 @@ const InternalChipGroup = forwardRef((props, ref) => {
|
|
|
2031
2037
|
});
|
|
2032
2038
|
InternalChipGroup.displayName = COMPONENT_NAME$16;
|
|
2033
2039
|
InternalChipGroup.className = CLASSNAME$15;
|
|
2034
|
-
InternalChipGroup.defaultProps = DEFAULT_PROPS$
|
|
2040
|
+
InternalChipGroup.defaultProps = DEFAULT_PROPS$Z;
|
|
2035
2041
|
const ChipGroup = Object.assign(InternalChipGroup, {
|
|
2036
2042
|
useChipGroupNavigation
|
|
2037
2043
|
});
|
|
@@ -2243,7 +2249,7 @@ const {
|
|
|
2243
2249
|
/**
|
|
2244
2250
|
* Component default props.
|
|
2245
2251
|
*/
|
|
2246
|
-
const DEFAULT_PROPS$
|
|
2252
|
+
const DEFAULT_PROPS$Y = {
|
|
2247
2253
|
variant: CommentBlockVariant.indented
|
|
2248
2254
|
};
|
|
2249
2255
|
|
|
@@ -2273,7 +2279,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
2273
2279
|
onMouseLeave,
|
|
2274
2280
|
text,
|
|
2275
2281
|
theme = defaultTheme,
|
|
2276
|
-
variant = DEFAULT_PROPS$
|
|
2282
|
+
variant = DEFAULT_PROPS$Y.variant,
|
|
2277
2283
|
...forwardedProps
|
|
2278
2284
|
} = props;
|
|
2279
2285
|
const hasChildren = Children.count(children) > 0;
|
|
@@ -2342,7 +2348,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
2342
2348
|
});
|
|
2343
2349
|
CommentBlock.displayName = COMPONENT_NAME$15;
|
|
2344
2350
|
CommentBlock.className = CLASSNAME$13;
|
|
2345
|
-
CommentBlock.defaultProps = DEFAULT_PROPS$
|
|
2351
|
+
CommentBlock.defaultProps = DEFAULT_PROPS$Y;
|
|
2346
2352
|
|
|
2347
2353
|
/**
|
|
2348
2354
|
* Add a number of months from a date while resetting the day to prevent month length mismatches.
|
|
@@ -3447,7 +3453,7 @@ const {
|
|
|
3447
3453
|
/**
|
|
3448
3454
|
* Component default props.
|
|
3449
3455
|
*/
|
|
3450
|
-
const DEFAULT_PROPS$
|
|
3456
|
+
const DEFAULT_PROPS$X = {
|
|
3451
3457
|
size: Size$1.big,
|
|
3452
3458
|
disableBodyScroll: true
|
|
3453
3459
|
};
|
|
@@ -3478,11 +3484,11 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
3478
3484
|
parentElement,
|
|
3479
3485
|
contentRef,
|
|
3480
3486
|
preventAutoClose,
|
|
3481
|
-
size = DEFAULT_PROPS$
|
|
3487
|
+
size = DEFAULT_PROPS$X.size,
|
|
3482
3488
|
zIndex,
|
|
3483
3489
|
dialogProps,
|
|
3484
3490
|
onVisibilityChange,
|
|
3485
|
-
disableBodyScroll = DEFAULT_PROPS$
|
|
3491
|
+
disableBodyScroll = DEFAULT_PROPS$X.disableBodyScroll,
|
|
3486
3492
|
preventCloseOnClick,
|
|
3487
3493
|
preventCloseOnEscape,
|
|
3488
3494
|
...forwardedProps
|
|
@@ -3622,7 +3628,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
3622
3628
|
});
|
|
3623
3629
|
Dialog.displayName = COMPONENT_NAME$11;
|
|
3624
3630
|
Dialog.className = CLASSNAME$11;
|
|
3625
|
-
Dialog.defaultProps = DEFAULT_PROPS$
|
|
3631
|
+
Dialog.defaultProps = DEFAULT_PROPS$X;
|
|
3626
3632
|
|
|
3627
3633
|
/**
|
|
3628
3634
|
* Component display name.
|
|
@@ -3666,7 +3672,7 @@ const Divider$1 = props => {
|
|
|
3666
3672
|
/**
|
|
3667
3673
|
* Component default props.
|
|
3668
3674
|
*/
|
|
3669
|
-
const DEFAULT_PROPS$
|
|
3675
|
+
const DEFAULT_PROPS$W = {};
|
|
3670
3676
|
|
|
3671
3677
|
/**
|
|
3672
3678
|
* Divider component.
|
|
@@ -3689,7 +3695,7 @@ const Divider = forwardRef((props, ref) => {
|
|
|
3689
3695
|
});
|
|
3690
3696
|
Divider.displayName = COMPONENT_NAME$10;
|
|
3691
3697
|
Divider.className = CLASSNAME$10;
|
|
3692
|
-
Divider.defaultProps = DEFAULT_PROPS$
|
|
3698
|
+
Divider.defaultProps = DEFAULT_PROPS$W;
|
|
3693
3699
|
|
|
3694
3700
|
/**
|
|
3695
3701
|
* Component display name.
|
|
@@ -3914,7 +3920,7 @@ const {
|
|
|
3914
3920
|
/**
|
|
3915
3921
|
* Component default props.
|
|
3916
3922
|
*/
|
|
3917
|
-
const DEFAULT_PROPS$
|
|
3923
|
+
const DEFAULT_PROPS$V = {
|
|
3918
3924
|
tabIndex: -1
|
|
3919
3925
|
};
|
|
3920
3926
|
|
|
@@ -3933,7 +3939,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
3933
3939
|
isClickable,
|
|
3934
3940
|
itemPadding,
|
|
3935
3941
|
onListItemSelected,
|
|
3936
|
-
tabIndex = DEFAULT_PROPS$
|
|
3942
|
+
tabIndex = DEFAULT_PROPS$V.tabIndex,
|
|
3937
3943
|
...forwardedProps
|
|
3938
3944
|
} = props;
|
|
3939
3945
|
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
@@ -3949,7 +3955,7 @@ const InternalList = forwardRef((props, ref) => {
|
|
|
3949
3955
|
});
|
|
3950
3956
|
InternalList.displayName = COMPONENT_NAME$_;
|
|
3951
3957
|
InternalList.className = CLASSNAME$_;
|
|
3952
|
-
InternalList.defaultProps = DEFAULT_PROPS$
|
|
3958
|
+
InternalList.defaultProps = DEFAULT_PROPS$V;
|
|
3953
3959
|
const List = Object.assign(InternalList, {
|
|
3954
3960
|
useKeyboardListNavigation
|
|
3955
3961
|
});
|
|
@@ -4068,7 +4074,7 @@ function getNodeName(element) {
|
|
|
4068
4074
|
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
4069
4075
|
}
|
|
4070
4076
|
|
|
4071
|
-
/*:: import type { Window } from '../types'; */
|
|
4077
|
+
/*:: import type { Window } from '../types.js'; */
|
|
4072
4078
|
|
|
4073
4079
|
/*:: declare function getWindow(node: Node | Window): Window; */
|
|
4074
4080
|
function getWindow(node) {
|
|
@@ -6394,7 +6400,7 @@ const {
|
|
|
6394
6400
|
/**
|
|
6395
6401
|
* Component default props.
|
|
6396
6402
|
*/
|
|
6397
|
-
const DEFAULT_PROPS$
|
|
6403
|
+
const DEFAULT_PROPS$U = {
|
|
6398
6404
|
elevation: 3,
|
|
6399
6405
|
placement: Placement.AUTO,
|
|
6400
6406
|
focusAnchorOnClose: true,
|
|
@@ -6411,24 +6417,24 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
6411
6417
|
className,
|
|
6412
6418
|
closeOnClickAway,
|
|
6413
6419
|
closeOnEscape,
|
|
6414
|
-
elevation = DEFAULT_PROPS$
|
|
6420
|
+
elevation = DEFAULT_PROPS$U.elevation,
|
|
6415
6421
|
focusElement,
|
|
6416
6422
|
hasArrow,
|
|
6417
6423
|
isOpen,
|
|
6418
6424
|
onClose,
|
|
6419
6425
|
parentElement,
|
|
6420
|
-
usePortal = DEFAULT_PROPS$
|
|
6421
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
6426
|
+
usePortal = DEFAULT_PROPS$U.usePortal,
|
|
6427
|
+
focusAnchorOnClose = DEFAULT_PROPS$U.focusAnchorOnClose,
|
|
6422
6428
|
withFocusTrap,
|
|
6423
6429
|
boundaryRef,
|
|
6424
6430
|
fitToAnchorWidth,
|
|
6425
6431
|
fitWithinViewportHeight,
|
|
6426
6432
|
focusTrapZoneElement,
|
|
6427
6433
|
offset,
|
|
6428
|
-
placement = DEFAULT_PROPS$
|
|
6434
|
+
placement = DEFAULT_PROPS$U.placement,
|
|
6429
6435
|
style,
|
|
6430
6436
|
theme,
|
|
6431
|
-
zIndex = DEFAULT_PROPS$
|
|
6437
|
+
zIndex = DEFAULT_PROPS$U.zIndex,
|
|
6432
6438
|
...forwardedProps
|
|
6433
6439
|
} = props;
|
|
6434
6440
|
const popoverRef = useRef(null);
|
|
@@ -6514,7 +6520,7 @@ const Popover = skipRender(
|
|
|
6514
6520
|
() => Boolean(DOCUMENT), _InnerPopover);
|
|
6515
6521
|
Popover.displayName = COMPONENT_NAME$Z;
|
|
6516
6522
|
Popover.className = CLASSNAME$Z;
|
|
6517
|
-
Popover.defaultProps = DEFAULT_PROPS$
|
|
6523
|
+
Popover.defaultProps = DEFAULT_PROPS$U;
|
|
6518
6524
|
|
|
6519
6525
|
// The error margin in px we want to have for triggering infinite scroll
|
|
6520
6526
|
const SCROLL_TRIGGER_MARGIN = 5;
|
|
@@ -6574,7 +6580,7 @@ const {
|
|
|
6574
6580
|
/**
|
|
6575
6581
|
* Component default props.
|
|
6576
6582
|
*/
|
|
6577
|
-
const DEFAULT_PROPS$
|
|
6583
|
+
const DEFAULT_PROPS$T = {
|
|
6578
6584
|
closeOnClick: true,
|
|
6579
6585
|
closeOnClickAway: true,
|
|
6580
6586
|
closeOnEscape: true,
|
|
@@ -6597,18 +6603,18 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
6597
6603
|
anchorRef,
|
|
6598
6604
|
children,
|
|
6599
6605
|
className,
|
|
6600
|
-
closeOnClick = DEFAULT_PROPS$
|
|
6601
|
-
closeOnClickAway = DEFAULT_PROPS$
|
|
6602
|
-
closeOnEscape = DEFAULT_PROPS$
|
|
6603
|
-
fitToAnchorWidth = DEFAULT_PROPS$
|
|
6604
|
-
fitWithinViewportHeight = DEFAULT_PROPS$
|
|
6606
|
+
closeOnClick = DEFAULT_PROPS$T.closeOnClick,
|
|
6607
|
+
closeOnClickAway = DEFAULT_PROPS$T.closeOnClickAway,
|
|
6608
|
+
closeOnEscape = DEFAULT_PROPS$T.closeOnEscape,
|
|
6609
|
+
fitToAnchorWidth = DEFAULT_PROPS$T.fitToAnchorWidth,
|
|
6610
|
+
fitWithinViewportHeight = DEFAULT_PROPS$T.fitWithinViewportHeight,
|
|
6605
6611
|
isOpen,
|
|
6606
6612
|
offset,
|
|
6607
|
-
focusAnchorOnClose = DEFAULT_PROPS$
|
|
6613
|
+
focusAnchorOnClose = DEFAULT_PROPS$T.focusAnchorOnClose,
|
|
6608
6614
|
onClose,
|
|
6609
6615
|
onInfiniteScroll,
|
|
6610
|
-
placement = DEFAULT_PROPS$
|
|
6611
|
-
shouldFocusOnOpen = DEFAULT_PROPS$
|
|
6616
|
+
placement = DEFAULT_PROPS$T.placement,
|
|
6617
|
+
shouldFocusOnOpen = DEFAULT_PROPS$T.shouldFocusOnOpen,
|
|
6612
6618
|
zIndex,
|
|
6613
6619
|
...forwardedProps
|
|
6614
6620
|
} = props;
|
|
@@ -6654,7 +6660,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
6654
6660
|
});
|
|
6655
6661
|
Dropdown.displayName = COMPONENT_NAME$Y;
|
|
6656
6662
|
Dropdown.className = CLASSNAME$Y;
|
|
6657
|
-
Dropdown.defaultProps = DEFAULT_PROPS$
|
|
6663
|
+
Dropdown.defaultProps = DEFAULT_PROPS$T;
|
|
6658
6664
|
|
|
6659
6665
|
/**
|
|
6660
6666
|
* Component display name.
|
|
@@ -6673,7 +6679,7 @@ const {
|
|
|
6673
6679
|
/**
|
|
6674
6680
|
* Component default props.
|
|
6675
6681
|
*/
|
|
6676
|
-
const DEFAULT_PROPS$
|
|
6682
|
+
const DEFAULT_PROPS$S = {
|
|
6677
6683
|
closeMode: 'unmount'
|
|
6678
6684
|
};
|
|
6679
6685
|
const isDragHandle = isComponent(DragHandle);
|
|
@@ -6691,7 +6697,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
6691
6697
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
6692
6698
|
const {
|
|
6693
6699
|
className,
|
|
6694
|
-
closeMode = DEFAULT_PROPS$
|
|
6700
|
+
closeMode = DEFAULT_PROPS$S.closeMode,
|
|
6695
6701
|
children: anyChildren,
|
|
6696
6702
|
hasBackground,
|
|
6697
6703
|
hasHeaderDivider,
|
|
@@ -6808,11 +6814,11 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
6808
6814
|
});
|
|
6809
6815
|
ExpansionPanel.displayName = COMPONENT_NAME$X;
|
|
6810
6816
|
ExpansionPanel.className = CLASSNAME$X;
|
|
6811
|
-
ExpansionPanel.defaultProps = DEFAULT_PROPS$
|
|
6817
|
+
ExpansionPanel.defaultProps = DEFAULT_PROPS$S;
|
|
6812
6818
|
|
|
6813
6819
|
const COMPONENT_NAME$W = 'Flag';
|
|
6814
6820
|
const CLASSNAME$W = 'lumx-flag';
|
|
6815
|
-
const DEFAULT_PROPS$
|
|
6821
|
+
const DEFAULT_PROPS$R = {};
|
|
6816
6822
|
const {
|
|
6817
6823
|
block: block$N,
|
|
6818
6824
|
element: element$B
|
|
@@ -6876,7 +6882,7 @@ const Flag = forwardRef((props, ref) => {
|
|
|
6876
6882
|
});
|
|
6877
6883
|
Flag.displayName = COMPONENT_NAME$W;
|
|
6878
6884
|
Flag.className = CLASSNAME$W;
|
|
6879
|
-
Flag.defaultProps = DEFAULT_PROPS$
|
|
6885
|
+
Flag.defaultProps = DEFAULT_PROPS$R;
|
|
6880
6886
|
|
|
6881
6887
|
/**
|
|
6882
6888
|
* Defines the props of the component.
|
|
@@ -6969,7 +6975,7 @@ const {
|
|
|
6969
6975
|
/**
|
|
6970
6976
|
* Component default props.
|
|
6971
6977
|
*/
|
|
6972
|
-
const DEFAULT_PROPS$
|
|
6978
|
+
const DEFAULT_PROPS$Q = {
|
|
6973
6979
|
gap: Size$1.big,
|
|
6974
6980
|
orientation: Orientation$1.horizontal
|
|
6975
6981
|
};
|
|
@@ -6999,8 +7005,8 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
6999
7005
|
children,
|
|
7000
7006
|
actions,
|
|
7001
7007
|
actionsProps,
|
|
7002
|
-
gap = DEFAULT_PROPS$
|
|
7003
|
-
orientation = DEFAULT_PROPS$
|
|
7008
|
+
gap = DEFAULT_PROPS$Q.gap,
|
|
7009
|
+
orientation = DEFAULT_PROPS$Q.orientation,
|
|
7004
7010
|
contentProps,
|
|
7005
7011
|
...forwardedProps
|
|
7006
7012
|
} = props;
|
|
@@ -7054,7 +7060,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
7054
7060
|
});
|
|
7055
7061
|
BaseGenericBlock.displayName = COMPONENT_NAME$U;
|
|
7056
7062
|
BaseGenericBlock.className = CLASSNAME$U;
|
|
7057
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS$
|
|
7063
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS$Q;
|
|
7058
7064
|
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
7059
7065
|
Figure,
|
|
7060
7066
|
Content,
|
|
@@ -7102,7 +7108,7 @@ const CLASSNAME$T = 'lumx-heading';
|
|
|
7102
7108
|
/**
|
|
7103
7109
|
* Component default props.
|
|
7104
7110
|
*/
|
|
7105
|
-
const DEFAULT_PROPS$
|
|
7111
|
+
const DEFAULT_PROPS$P = {};
|
|
7106
7112
|
|
|
7107
7113
|
/**
|
|
7108
7114
|
* Get Heading component common props
|
|
@@ -7203,7 +7209,7 @@ const {
|
|
|
7203
7209
|
/**
|
|
7204
7210
|
* Component default props.
|
|
7205
7211
|
*/
|
|
7206
|
-
const DEFAULT_PROPS$
|
|
7212
|
+
const DEFAULT_PROPS$O = {};
|
|
7207
7213
|
|
|
7208
7214
|
/**
|
|
7209
7215
|
* Text component common props
|
|
@@ -7290,7 +7296,7 @@ const Text = forwardRef((props, ref) => {
|
|
|
7290
7296
|
});
|
|
7291
7297
|
Text.displayName = COMPONENT_NAME$S;
|
|
7292
7298
|
Text.className = CLASSNAME$S;
|
|
7293
|
-
Text.defaultProps = DEFAULT_PROPS$
|
|
7299
|
+
Text.defaultProps = DEFAULT_PROPS$O;
|
|
7294
7300
|
|
|
7295
7301
|
const HeadingLevelContext = /*#__PURE__*/createContext(defaultContext);
|
|
7296
7302
|
|
|
@@ -7327,7 +7333,7 @@ const Heading = forwardRef((props, ref) => {
|
|
|
7327
7333
|
});
|
|
7328
7334
|
Heading.displayName = COMPONENT_NAME$T;
|
|
7329
7335
|
Heading.className = CLASSNAME$T;
|
|
7330
|
-
Heading.defaultProps = DEFAULT_PROPS$
|
|
7336
|
+
Heading.defaultProps = DEFAULT_PROPS$P;
|
|
7331
7337
|
|
|
7332
7338
|
/**
|
|
7333
7339
|
* Computes the next heading level based on the optional prop level or the parent context level.
|
|
@@ -7378,7 +7384,7 @@ const {
|
|
|
7378
7384
|
/**
|
|
7379
7385
|
* Component default props.
|
|
7380
7386
|
*/
|
|
7381
|
-
const DEFAULT_PROPS$
|
|
7387
|
+
const DEFAULT_PROPS$N = {
|
|
7382
7388
|
orientation: Orientation$1.horizontal,
|
|
7383
7389
|
wrap: 'nowrap'
|
|
7384
7390
|
};
|
|
@@ -7396,9 +7402,9 @@ const Grid = forwardRef((props, ref) => {
|
|
|
7396
7402
|
className,
|
|
7397
7403
|
gutter,
|
|
7398
7404
|
hAlign,
|
|
7399
|
-
orientation = DEFAULT_PROPS$
|
|
7405
|
+
orientation = DEFAULT_PROPS$N.orientation,
|
|
7400
7406
|
vAlign,
|
|
7401
|
-
wrap = DEFAULT_PROPS$
|
|
7407
|
+
wrap = DEFAULT_PROPS$N.wrap,
|
|
7402
7408
|
...forwardedProps
|
|
7403
7409
|
} = props;
|
|
7404
7410
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -7416,7 +7422,7 @@ const Grid = forwardRef((props, ref) => {
|
|
|
7416
7422
|
});
|
|
7417
7423
|
Grid.displayName = COMPONENT_NAME$R;
|
|
7418
7424
|
Grid.className = CLASSNAME$R;
|
|
7419
|
-
Grid.defaultProps = DEFAULT_PROPS$
|
|
7425
|
+
Grid.defaultProps = DEFAULT_PROPS$N;
|
|
7420
7426
|
|
|
7421
7427
|
/**
|
|
7422
7428
|
* Component display name.
|
|
@@ -7474,7 +7480,7 @@ const CLASSNAME$P = 'lumx-grid-column';
|
|
|
7474
7480
|
/**
|
|
7475
7481
|
* Component default props.
|
|
7476
7482
|
*/
|
|
7477
|
-
const DEFAULT_PROPS$
|
|
7483
|
+
const DEFAULT_PROPS$M = {};
|
|
7478
7484
|
|
|
7479
7485
|
/**
|
|
7480
7486
|
* The GridColumn is a layout component that can display children in a grid
|
|
@@ -7511,7 +7517,7 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
7511
7517
|
});
|
|
7512
7518
|
GridColumn.displayName = COMPONENT_NAME$P;
|
|
7513
7519
|
GridColumn.className = CLASSNAME$P;
|
|
7514
|
-
GridColumn.defaultProps = DEFAULT_PROPS$
|
|
7520
|
+
GridColumn.defaultProps = DEFAULT_PROPS$M;
|
|
7515
7521
|
|
|
7516
7522
|
/**
|
|
7517
7523
|
* Icon component.
|
|
@@ -7629,7 +7635,7 @@ const {
|
|
|
7629
7635
|
/**
|
|
7630
7636
|
* Component default props.
|
|
7631
7637
|
*/
|
|
7632
|
-
const DEFAULT_PROPS$
|
|
7638
|
+
const DEFAULT_PROPS$L = {
|
|
7633
7639
|
captionPosition: ImageBlockCaptionPosition.below,
|
|
7634
7640
|
align: Alignment.left
|
|
7635
7641
|
};
|
|
@@ -7645,9 +7651,9 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
7645
7651
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
7646
7652
|
const {
|
|
7647
7653
|
actions,
|
|
7648
|
-
align = DEFAULT_PROPS$
|
|
7654
|
+
align = DEFAULT_PROPS$L.align,
|
|
7649
7655
|
alt,
|
|
7650
|
-
captionPosition = DEFAULT_PROPS$
|
|
7656
|
+
captionPosition = DEFAULT_PROPS$L.captionPosition,
|
|
7651
7657
|
captionStyle,
|
|
7652
7658
|
className,
|
|
7653
7659
|
description,
|
|
@@ -7701,7 +7707,7 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
7701
7707
|
});
|
|
7702
7708
|
ImageBlock.displayName = COMPONENT_NAME$O;
|
|
7703
7709
|
ImageBlock.className = CLASSNAME$O;
|
|
7704
|
-
ImageBlock.defaultProps = DEFAULT_PROPS$
|
|
7710
|
+
ImageBlock.defaultProps = DEFAULT_PROPS$L;
|
|
7705
7711
|
|
|
7706
7712
|
/**
|
|
7707
7713
|
* Component display name.
|
|
@@ -8461,7 +8467,7 @@ const {
|
|
|
8461
8467
|
/**
|
|
8462
8468
|
* Component default props.
|
|
8463
8469
|
*/
|
|
8464
|
-
const DEFAULT_PROPS$
|
|
8470
|
+
const DEFAULT_PROPS$K = {};
|
|
8465
8471
|
|
|
8466
8472
|
/**
|
|
8467
8473
|
* InlineList component.
|
|
@@ -8514,7 +8520,7 @@ const InlineList = forwardRef((props, ref) => {
|
|
|
8514
8520
|
});
|
|
8515
8521
|
InlineList.displayName = COMPONENT_NAME$M;
|
|
8516
8522
|
InlineList.className = CLASSNAME$M;
|
|
8517
|
-
InlineList.defaultProps = DEFAULT_PROPS$
|
|
8523
|
+
InlineList.defaultProps = DEFAULT_PROPS$K;
|
|
8518
8524
|
|
|
8519
8525
|
/**
|
|
8520
8526
|
* InputHelper component.
|
|
@@ -8692,20 +8698,6 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
8692
8698
|
Lightbox.displayName = COMPONENT_NAME$L;
|
|
8693
8699
|
Lightbox.className = CLASSNAME$L;
|
|
8694
8700
|
|
|
8695
|
-
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
8696
|
-
const forwardRefPolymorphic = React__default.forwardRef;
|
|
8697
|
-
|
|
8698
|
-
/**
|
|
8699
|
-
* Render clickable element (link, button or custom element)
|
|
8700
|
-
* (also does some basic disabled state handling)
|
|
8701
|
-
*/
|
|
8702
|
-
const RawClickable = forwardRefPolymorphic((props, ref) => {
|
|
8703
|
-
return RawClickable$1({
|
|
8704
|
-
ref,
|
|
8705
|
-
...props
|
|
8706
|
-
});
|
|
8707
|
-
});
|
|
8708
|
-
|
|
8709
8701
|
/**
|
|
8710
8702
|
* Component display name.
|
|
8711
8703
|
*/
|
|
@@ -8718,7 +8710,101 @@ const CLASSNAME$K = 'lumx-link';
|
|
|
8718
8710
|
const {
|
|
8719
8711
|
block: block$E,
|
|
8720
8712
|
element: element$u
|
|
8721
|
-
} =
|
|
8713
|
+
} = bem(CLASSNAME$K);
|
|
8714
|
+
|
|
8715
|
+
/**
|
|
8716
|
+
* Link component (Core UI).
|
|
8717
|
+
*
|
|
8718
|
+
* @param props Component props.
|
|
8719
|
+
* @return JSX element.
|
|
8720
|
+
*/
|
|
8721
|
+
const Link$1 = props => {
|
|
8722
|
+
const {
|
|
8723
|
+
label,
|
|
8724
|
+
className,
|
|
8725
|
+
color: propColor,
|
|
8726
|
+
colorVariant: propColorVariant,
|
|
8727
|
+
leftIcon,
|
|
8728
|
+
rightIcon,
|
|
8729
|
+
typography: typography$1,
|
|
8730
|
+
as,
|
|
8731
|
+
ref,
|
|
8732
|
+
isDisabled,
|
|
8733
|
+
theme,
|
|
8734
|
+
href,
|
|
8735
|
+
target,
|
|
8736
|
+
onClick,
|
|
8737
|
+
...forwardedProps
|
|
8738
|
+
} = props;
|
|
8739
|
+
const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
|
|
8740
|
+
|
|
8741
|
+
// Determine element type
|
|
8742
|
+
const ElementType = as || (href ? 'a' : 'button');
|
|
8743
|
+
|
|
8744
|
+
// Build disabled props
|
|
8745
|
+
const disabledProps = {};
|
|
8746
|
+
if (isDisabled) {
|
|
8747
|
+
if (ElementType === 'button' || !href && !as) {
|
|
8748
|
+
disabledProps.disabled = true;
|
|
8749
|
+
} else {
|
|
8750
|
+
disabledProps['aria-disabled'] = true;
|
|
8751
|
+
disabledProps.tabIndex = -1;
|
|
8752
|
+
}
|
|
8753
|
+
}
|
|
8754
|
+
|
|
8755
|
+
// Build class name
|
|
8756
|
+
const combinedClassName = classnames(className, block$E({
|
|
8757
|
+
[`color-${color}`]: Boolean(color),
|
|
8758
|
+
[`color-variant-${colorVariant}`]: Boolean(colorVariant),
|
|
8759
|
+
'has-typography': !!typography$1
|
|
8760
|
+
}), typography$1 && typography(typography$1));
|
|
8761
|
+
|
|
8762
|
+
// Build content with proper spacing for icons
|
|
8763
|
+
const content = /*#__PURE__*/jsxs(Fragment, {
|
|
8764
|
+
children: [leftIcon && /*#__PURE__*/jsxs(Fragment, {
|
|
8765
|
+
children: [" ", Icon$1({
|
|
8766
|
+
icon: leftIcon,
|
|
8767
|
+
className: element$u('left-icon')
|
|
8768
|
+
}), " "]
|
|
8769
|
+
}), label && /*#__PURE__*/jsx("span", {
|
|
8770
|
+
className: element$u('content'),
|
|
8771
|
+
children: label
|
|
8772
|
+
}), rightIcon && /*#__PURE__*/jsxs(Fragment, {
|
|
8773
|
+
children: [" ", Icon$1({
|
|
8774
|
+
icon: rightIcon,
|
|
8775
|
+
className: element$u('right-icon')
|
|
8776
|
+
}), " "]
|
|
8777
|
+
})]
|
|
8778
|
+
});
|
|
8779
|
+
|
|
8780
|
+
// Build element props
|
|
8781
|
+
const elementProps = {
|
|
8782
|
+
ref,
|
|
8783
|
+
className: combinedClassName,
|
|
8784
|
+
onClick: isDisabled ? undefined : onClick,
|
|
8785
|
+
...forwardedProps,
|
|
8786
|
+
...disabledProps
|
|
8787
|
+
};
|
|
8788
|
+
if (href) {
|
|
8789
|
+
elementProps.href = href;
|
|
8790
|
+
}
|
|
8791
|
+
if (target) {
|
|
8792
|
+
elementProps.target = target;
|
|
8793
|
+
}
|
|
8794
|
+
return /*#__PURE__*/jsx(ElementType, {
|
|
8795
|
+
...elementProps,
|
|
8796
|
+
children: content
|
|
8797
|
+
});
|
|
8798
|
+
};
|
|
8799
|
+
|
|
8800
|
+
/**
|
|
8801
|
+
* Defines the props of the component.
|
|
8802
|
+
*/
|
|
8803
|
+
|
|
8804
|
+
/**
|
|
8805
|
+
* Component default props.
|
|
8806
|
+
*/
|
|
8807
|
+
const DEFAULT_PROPS$J = {};
|
|
8722
8808
|
|
|
8723
8809
|
/**
|
|
8724
8810
|
* Link component.
|
|
@@ -8729,47 +8815,42 @@ const {
|
|
|
8729
8815
|
*/
|
|
8730
8816
|
const Link = forwardRef((props, ref) => {
|
|
8731
8817
|
const {
|
|
8818
|
+
isAnyDisabled,
|
|
8732
8819
|
disabledStateProps,
|
|
8733
8820
|
otherProps
|
|
8734
8821
|
} = useDisableStateProps(props);
|
|
8735
8822
|
const {
|
|
8736
8823
|
children,
|
|
8737
8824
|
className,
|
|
8738
|
-
color
|
|
8739
|
-
colorVariant
|
|
8825
|
+
color,
|
|
8826
|
+
colorVariant,
|
|
8740
8827
|
leftIcon,
|
|
8741
8828
|
rightIcon,
|
|
8742
8829
|
typography,
|
|
8743
8830
|
linkAs,
|
|
8744
8831
|
...forwardedProps
|
|
8745
8832
|
} = otherProps;
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8833
|
+
|
|
8834
|
+
// Wrap children with spaces if they contain icons
|
|
8835
|
+
const label = wrapChildrenIconWithSpaces(children);
|
|
8836
|
+
return Link$1({
|
|
8837
|
+
ref,
|
|
8838
|
+
label,
|
|
8839
|
+
className,
|
|
8840
|
+
color,
|
|
8841
|
+
colorVariant,
|
|
8842
|
+
leftIcon,
|
|
8843
|
+
rightIcon,
|
|
8844
|
+
typography,
|
|
8845
|
+
as: linkAs,
|
|
8750
8846
|
...forwardedProps,
|
|
8751
8847
|
...disabledStateProps,
|
|
8752
|
-
|
|
8753
|
-
[`color-${color}`]: Boolean(color),
|
|
8754
|
-
[`color-variant-${colorVariant}`]: Boolean(colorVariant),
|
|
8755
|
-
'has-typography': !!typography
|
|
8756
|
-
}), typography && classNames.typography(typography)),
|
|
8757
|
-
children: wrapChildrenIconWithSpaces(/*#__PURE__*/jsxs(Fragment, {
|
|
8758
|
-
children: [leftIcon && /*#__PURE__*/jsx(Icon, {
|
|
8759
|
-
icon: leftIcon,
|
|
8760
|
-
className: element$u('left-icon')
|
|
8761
|
-
}), children && /*#__PURE__*/jsx("span", {
|
|
8762
|
-
className: element$u('content'),
|
|
8763
|
-
children: children
|
|
8764
|
-
}), rightIcon && /*#__PURE__*/jsx(Icon, {
|
|
8765
|
-
icon: rightIcon,
|
|
8766
|
-
className: element$u('right-icon')
|
|
8767
|
-
})]
|
|
8768
|
-
}))
|
|
8848
|
+
isDisabled: isAnyDisabled
|
|
8769
8849
|
});
|
|
8770
8850
|
});
|
|
8771
8851
|
Link.displayName = COMPONENT_NAME$K;
|
|
8772
8852
|
Link.className = CLASSNAME$K;
|
|
8853
|
+
Link.defaultProps = DEFAULT_PROPS$J;
|
|
8773
8854
|
|
|
8774
8855
|
/**
|
|
8775
8856
|
* Component display name.
|
|
@@ -8839,7 +8920,7 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
8839
8920
|
// Avoid redundant links in focus order
|
|
8840
8921
|
tabIndex: -1
|
|
8841
8922
|
},
|
|
8842
|
-
aspectRatio: AspectRatio.free,
|
|
8923
|
+
aspectRatio: AspectRatio$1.free,
|
|
8843
8924
|
fillHeight: true
|
|
8844
8925
|
})
|
|
8845
8926
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -9248,7 +9329,7 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
9248
9329
|
align: align || Alignment.left,
|
|
9249
9330
|
image: image,
|
|
9250
9331
|
theme: theme,
|
|
9251
|
-
aspectRatio: AspectRatio.free,
|
|
9332
|
+
aspectRatio: AspectRatio$1.free,
|
|
9252
9333
|
fillHeight: true,
|
|
9253
9334
|
onClick: handleImageClick?.(index, onClick) || onClick
|
|
9254
9335
|
}), thumbnails.length > 4 && index === 3 && /*#__PURE__*/jsx("div", {
|
|
@@ -9266,6 +9347,20 @@ Mosaic.displayName = COMPONENT_NAME$E;
|
|
|
9266
9347
|
Mosaic.className = CLASSNAME$E;
|
|
9267
9348
|
Mosaic.defaultProps = DEFAULT_PROPS$G;
|
|
9268
9349
|
|
|
9350
|
+
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
9351
|
+
const forwardRefPolymorphic = React__default.forwardRef;
|
|
9352
|
+
|
|
9353
|
+
/**
|
|
9354
|
+
* Render clickable element (link, button or custom element)
|
|
9355
|
+
* (also does some basic disabled state handling)
|
|
9356
|
+
*/
|
|
9357
|
+
const RawClickable = forwardRefPolymorphic((props, ref) => {
|
|
9358
|
+
return RawClickable$1({
|
|
9359
|
+
ref,
|
|
9360
|
+
...props
|
|
9361
|
+
});
|
|
9362
|
+
});
|
|
9363
|
+
|
|
9269
9364
|
const NavigationContext = /*#__PURE__*/createContext({
|
|
9270
9365
|
orientation: Orientation$1.vertical
|
|
9271
9366
|
});
|
|
@@ -11013,6 +11108,8 @@ const SelectMultipleField = props => {
|
|
|
11013
11108
|
const defaultTheme = useTheme();
|
|
11014
11109
|
const {
|
|
11015
11110
|
anchorRef,
|
|
11111
|
+
// We don't have a clear button in select multiple but it must be removed from the forwardedProps
|
|
11112
|
+
clearButtonProps,
|
|
11016
11113
|
handleKeyboardNav,
|
|
11017
11114
|
hasError,
|
|
11018
11115
|
icon,
|
|
@@ -13009,7 +13106,7 @@ const CLASSNAME$c = 'lumx-table';
|
|
|
13009
13106
|
|
|
13010
13107
|
const {
|
|
13011
13108
|
block: block$d
|
|
13012
|
-
} =
|
|
13109
|
+
} = bem(CLASSNAME$c);
|
|
13013
13110
|
|
|
13014
13111
|
/**
|
|
13015
13112
|
* Defines the props of the component.
|
|
@@ -13024,29 +13121,54 @@ const DEFAULT_PROPS$f = {};
|
|
|
13024
13121
|
* Table component.
|
|
13025
13122
|
*
|
|
13026
13123
|
* @param props Component props.
|
|
13027
|
-
* @param ref Component ref.
|
|
13028
13124
|
* @return React element.
|
|
13029
13125
|
*/
|
|
13030
|
-
const Table =
|
|
13031
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
13126
|
+
const Table$1 = props => {
|
|
13032
13127
|
const {
|
|
13033
13128
|
children,
|
|
13034
13129
|
className,
|
|
13035
13130
|
hasBefore,
|
|
13036
13131
|
hasDividers,
|
|
13037
|
-
|
|
13132
|
+
ref,
|
|
13133
|
+
theme,
|
|
13038
13134
|
...forwardedProps
|
|
13039
13135
|
} = props;
|
|
13040
13136
|
return /*#__PURE__*/jsx("table", {
|
|
13041
13137
|
ref: ref,
|
|
13042
13138
|
...forwardedProps,
|
|
13043
|
-
className:
|
|
13139
|
+
className: classnames(className, block$d({
|
|
13044
13140
|
'has-before': hasBefore,
|
|
13045
13141
|
'has-dividers': hasDividers,
|
|
13046
13142
|
[`theme-${theme}`]: Boolean(theme)
|
|
13047
13143
|
})),
|
|
13048
13144
|
children: children
|
|
13049
13145
|
});
|
|
13146
|
+
};
|
|
13147
|
+
|
|
13148
|
+
/**
|
|
13149
|
+
* Defines the props of the component.
|
|
13150
|
+
*/
|
|
13151
|
+
|
|
13152
|
+
/**
|
|
13153
|
+
* Table component.
|
|
13154
|
+
*
|
|
13155
|
+
* @param props Component props.
|
|
13156
|
+
* @param ref Component ref.
|
|
13157
|
+
* @return React element.
|
|
13158
|
+
*/
|
|
13159
|
+
const Table = forwardRef((props, ref) => {
|
|
13160
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
13161
|
+
const {
|
|
13162
|
+
children,
|
|
13163
|
+
theme = defaultTheme,
|
|
13164
|
+
...otherProps
|
|
13165
|
+
} = props;
|
|
13166
|
+
return Table$1({
|
|
13167
|
+
ref,
|
|
13168
|
+
theme,
|
|
13169
|
+
children,
|
|
13170
|
+
...otherProps
|
|
13171
|
+
});
|
|
13050
13172
|
});
|
|
13051
13173
|
Table.displayName = COMPONENT_NAME$d;
|
|
13052
13174
|
Table.className = CLASSNAME$c;
|
|
@@ -13066,21 +13188,44 @@ const CLASSNAME$b = `${CLASSNAME$c}__body`;
|
|
|
13066
13188
|
* TableBody component.
|
|
13067
13189
|
*
|
|
13068
13190
|
* @param props Component props.
|
|
13069
|
-
* @param ref Component ref.
|
|
13070
13191
|
* @return React element.
|
|
13071
13192
|
*/
|
|
13072
|
-
const TableBody =
|
|
13193
|
+
const TableBody$1 = props => {
|
|
13073
13194
|
const {
|
|
13074
13195
|
children,
|
|
13075
13196
|
className,
|
|
13197
|
+
ref,
|
|
13076
13198
|
...forwardedProps
|
|
13077
13199
|
} = props;
|
|
13078
13200
|
return /*#__PURE__*/jsx("tbody", {
|
|
13079
13201
|
ref: ref,
|
|
13080
13202
|
...forwardedProps,
|
|
13081
|
-
className:
|
|
13203
|
+
className: classnames(className, CLASSNAME$b),
|
|
13082
13204
|
children: children
|
|
13083
13205
|
});
|
|
13206
|
+
};
|
|
13207
|
+
|
|
13208
|
+
/**
|
|
13209
|
+
* Defines the props of the component.
|
|
13210
|
+
*/
|
|
13211
|
+
|
|
13212
|
+
/**
|
|
13213
|
+
* TableBody component.
|
|
13214
|
+
*
|
|
13215
|
+
* @param props Component props.
|
|
13216
|
+
* @param ref Component ref.
|
|
13217
|
+
* @return React element.
|
|
13218
|
+
*/
|
|
13219
|
+
const TableBody = forwardRef((props, ref) => {
|
|
13220
|
+
const {
|
|
13221
|
+
children,
|
|
13222
|
+
...otherProps
|
|
13223
|
+
} = props;
|
|
13224
|
+
return TableBody$1({
|
|
13225
|
+
ref,
|
|
13226
|
+
children,
|
|
13227
|
+
...otherProps
|
|
13228
|
+
});
|
|
13084
13229
|
});
|
|
13085
13230
|
TableBody.displayName = COMPONENT_NAME$c;
|
|
13086
13231
|
TableBody.className = CLASSNAME$b;
|
|
@@ -13112,7 +13257,7 @@ const COMPONENT_NAME$b = 'TableCell';
|
|
|
13112
13257
|
const CLASSNAME$a = `${CLASSNAME$c}__cell`;
|
|
13113
13258
|
const {
|
|
13114
13259
|
block: block$c
|
|
13115
|
-
} =
|
|
13260
|
+
} = bem(CLASSNAME$a);
|
|
13116
13261
|
|
|
13117
13262
|
/**
|
|
13118
13263
|
* Component default props.
|
|
@@ -13125,16 +13270,16 @@ const DEFAULT_PROPS$e = {
|
|
|
13125
13270
|
* TableCell component.
|
|
13126
13271
|
*
|
|
13127
13272
|
* @param props Component props.
|
|
13128
|
-
* @param ref Component ref.
|
|
13129
13273
|
* @return React element.
|
|
13130
13274
|
*/
|
|
13131
|
-
const TableCell =
|
|
13275
|
+
const TableCell$1 = props => {
|
|
13132
13276
|
const {
|
|
13133
13277
|
children,
|
|
13134
13278
|
className,
|
|
13135
13279
|
icon,
|
|
13136
13280
|
isSortable,
|
|
13137
13281
|
onHeaderClick,
|
|
13282
|
+
ref,
|
|
13138
13283
|
sortOrder,
|
|
13139
13284
|
variant = DEFAULT_PROPS$e.variant,
|
|
13140
13285
|
...forwardedProps
|
|
@@ -13158,7 +13303,7 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
13158
13303
|
children: [variant === TableCellVariant.head && /*#__PURE__*/jsx("th", {
|
|
13159
13304
|
ref: ref,
|
|
13160
13305
|
...forwardedProps,
|
|
13161
|
-
className:
|
|
13306
|
+
className: classnames(className, block$c({
|
|
13162
13307
|
'is-sortable': isSortable,
|
|
13163
13308
|
'is-sorted': isSortable && !!sortOrder,
|
|
13164
13309
|
head: true
|
|
@@ -13167,26 +13312,27 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
13167
13312
|
children: /*#__PURE__*/jsxs(Wrapper, {
|
|
13168
13313
|
className: `${CLASSNAME$a}-wrapper`,
|
|
13169
13314
|
...wrapperProps,
|
|
13170
|
-
children: [icon && !isSortable &&
|
|
13315
|
+
children: [icon && !isSortable && Icon$1({
|
|
13171
13316
|
className: `${CLASSNAME$a}-icon`,
|
|
13172
|
-
icon
|
|
13173
|
-
size: Size
|
|
13174
|
-
}), isSortable && sortOrder === ThOrder.asc &&
|
|
13317
|
+
icon,
|
|
13318
|
+
size: Size.xxs
|
|
13319
|
+
}), isSortable && sortOrder === ThOrder.asc && Icon$1({
|
|
13175
13320
|
className: `${CLASSNAME$a}-icon`,
|
|
13176
13321
|
icon: mdiArrowUp,
|
|
13177
|
-
size: Size
|
|
13178
|
-
}), isSortable && sortOrder === ThOrder.desc &&
|
|
13322
|
+
size: Size.xxs
|
|
13323
|
+
}), isSortable && sortOrder === ThOrder.desc && Icon$1({
|
|
13179
13324
|
className: `${CLASSNAME$a}-icon`,
|
|
13180
13325
|
icon: mdiArrowDown,
|
|
13181
|
-
size: Size
|
|
13326
|
+
size: Size.xxs
|
|
13182
13327
|
}), /*#__PURE__*/jsx("div", {
|
|
13183
13328
|
className: `${CLASSNAME$a}-content`,
|
|
13184
13329
|
children: children
|
|
13185
13330
|
})]
|
|
13186
13331
|
})
|
|
13187
13332
|
}), variant === TableCellVariant.body && /*#__PURE__*/jsx("td", {
|
|
13333
|
+
ref: ref,
|
|
13188
13334
|
...forwardedProps,
|
|
13189
|
-
className:
|
|
13335
|
+
className: classnames(className, block$c({
|
|
13190
13336
|
body: true
|
|
13191
13337
|
})),
|
|
13192
13338
|
children: /*#__PURE__*/jsx("div", {
|
|
@@ -13195,6 +13341,29 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
13195
13341
|
})
|
|
13196
13342
|
})]
|
|
13197
13343
|
});
|
|
13344
|
+
};
|
|
13345
|
+
|
|
13346
|
+
/**
|
|
13347
|
+
* Defines the props of the component.
|
|
13348
|
+
*/
|
|
13349
|
+
|
|
13350
|
+
/**
|
|
13351
|
+
* TableCell component.
|
|
13352
|
+
*
|
|
13353
|
+
* @param props Component props.
|
|
13354
|
+
* @param ref Component ref.
|
|
13355
|
+
* @return React element.
|
|
13356
|
+
*/
|
|
13357
|
+
const TableCell = forwardRef((props, ref) => {
|
|
13358
|
+
const {
|
|
13359
|
+
children,
|
|
13360
|
+
...otherProps
|
|
13361
|
+
} = props;
|
|
13362
|
+
return TableCell$1({
|
|
13363
|
+
ref,
|
|
13364
|
+
children,
|
|
13365
|
+
...otherProps
|
|
13366
|
+
});
|
|
13198
13367
|
});
|
|
13199
13368
|
TableCell.displayName = COMPONENT_NAME$b;
|
|
13200
13369
|
TableCell.className = CLASSNAME$a;
|
|
@@ -13219,21 +13388,44 @@ const DEFAULT_PROPS$d = {};
|
|
|
13219
13388
|
* TableHeader component.
|
|
13220
13389
|
*
|
|
13221
13390
|
* @param props Component props.
|
|
13222
|
-
* @param ref Component ref.
|
|
13223
13391
|
* @return React element.
|
|
13224
13392
|
*/
|
|
13225
|
-
const TableHeader =
|
|
13393
|
+
const TableHeader$1 = props => {
|
|
13226
13394
|
const {
|
|
13227
13395
|
children,
|
|
13228
13396
|
className,
|
|
13397
|
+
ref,
|
|
13229
13398
|
...forwardedProps
|
|
13230
13399
|
} = props;
|
|
13231
13400
|
return /*#__PURE__*/jsx("thead", {
|
|
13232
13401
|
ref: ref,
|
|
13233
13402
|
...forwardedProps,
|
|
13234
|
-
className:
|
|
13403
|
+
className: classnames(className, CLASSNAME$9),
|
|
13235
13404
|
children: children
|
|
13236
13405
|
});
|
|
13406
|
+
};
|
|
13407
|
+
|
|
13408
|
+
/**
|
|
13409
|
+
* Defines the props of the component.
|
|
13410
|
+
*/
|
|
13411
|
+
|
|
13412
|
+
/**
|
|
13413
|
+
* TableHeader component.
|
|
13414
|
+
*
|
|
13415
|
+
* @param props Component props.
|
|
13416
|
+
* @param ref Component ref.
|
|
13417
|
+
* @return React element.
|
|
13418
|
+
*/
|
|
13419
|
+
const TableHeader = forwardRef((props, ref) => {
|
|
13420
|
+
const {
|
|
13421
|
+
children,
|
|
13422
|
+
...otherProps
|
|
13423
|
+
} = props;
|
|
13424
|
+
return TableHeader$1({
|
|
13425
|
+
ref,
|
|
13426
|
+
children,
|
|
13427
|
+
...otherProps
|
|
13428
|
+
});
|
|
13237
13429
|
});
|
|
13238
13430
|
TableHeader.displayName = COMPONENT_NAME$a;
|
|
13239
13431
|
TableHeader.className = CLASSNAME$9;
|
|
@@ -13250,7 +13442,7 @@ const COMPONENT_NAME$9 = 'TableRow';
|
|
|
13250
13442
|
const CLASSNAME$8 = `${CLASSNAME$c}__row`;
|
|
13251
13443
|
const {
|
|
13252
13444
|
block: block$b
|
|
13253
|
-
} =
|
|
13445
|
+
} = bem(CLASSNAME$8);
|
|
13254
13446
|
|
|
13255
13447
|
/**
|
|
13256
13448
|
* Component default props.
|
|
@@ -13261,34 +13453,69 @@ const DEFAULT_PROPS$c = {};
|
|
|
13261
13453
|
* TableRow component.
|
|
13262
13454
|
*
|
|
13263
13455
|
* @param props Component props.
|
|
13264
|
-
* @param ref Component ref.
|
|
13265
13456
|
* @return React element.
|
|
13266
13457
|
*/
|
|
13267
|
-
const TableRow =
|
|
13268
|
-
const {
|
|
13269
|
-
isAnyDisabled,
|
|
13270
|
-
disabledStateProps,
|
|
13271
|
-
otherProps
|
|
13272
|
-
} = useDisableStateProps(props);
|
|
13458
|
+
const TableRow$1 = props => {
|
|
13273
13459
|
const {
|
|
13274
13460
|
children,
|
|
13275
13461
|
className,
|
|
13276
13462
|
isClickable,
|
|
13277
13463
|
isSelected,
|
|
13464
|
+
ref,
|
|
13465
|
+
tabIndex,
|
|
13466
|
+
'aria-disabled': ariaDisabled,
|
|
13278
13467
|
...forwardedProps
|
|
13279
|
-
} =
|
|
13468
|
+
} = props;
|
|
13469
|
+
const isDisabled = Boolean(ariaDisabled);
|
|
13470
|
+
|
|
13471
|
+
// Use object spread for tabIndex to ensure cross-framework compatibility (Vue JSX expects lowercase 'tabindex')
|
|
13472
|
+
const tabIndexProps = tabIndex !== undefined ? {
|
|
13473
|
+
tabIndex
|
|
13474
|
+
} : {};
|
|
13280
13475
|
return /*#__PURE__*/jsx("tr", {
|
|
13281
13476
|
ref: ref,
|
|
13282
|
-
|
|
13477
|
+
"aria-disabled": ariaDisabled,
|
|
13478
|
+
...tabIndexProps,
|
|
13283
13479
|
...forwardedProps,
|
|
13284
|
-
className:
|
|
13285
|
-
'is-clickable': isClickable && !
|
|
13286
|
-
'is-disabled':
|
|
13287
|
-
'is-selected': isSelected && !
|
|
13480
|
+
className: classnames(className, block$b({
|
|
13481
|
+
'is-clickable': isClickable && !isDisabled,
|
|
13482
|
+
'is-disabled': isDisabled,
|
|
13483
|
+
'is-selected': isSelected && !isDisabled
|
|
13288
13484
|
})),
|
|
13289
|
-
"aria-disabled": isAnyDisabled,
|
|
13290
13485
|
children: children
|
|
13291
13486
|
});
|
|
13487
|
+
};
|
|
13488
|
+
|
|
13489
|
+
/**
|
|
13490
|
+
* Defines the props of the component.
|
|
13491
|
+
*/
|
|
13492
|
+
|
|
13493
|
+
/**
|
|
13494
|
+
* TableRow component.
|
|
13495
|
+
*
|
|
13496
|
+
* @param props Component props.
|
|
13497
|
+
* @param ref Component ref.
|
|
13498
|
+
* @return React element.
|
|
13499
|
+
*/
|
|
13500
|
+
const TableRow = forwardRef((props, ref) => {
|
|
13501
|
+
const {
|
|
13502
|
+
isAnyDisabled,
|
|
13503
|
+
otherProps
|
|
13504
|
+
} = useDisableStateProps(props);
|
|
13505
|
+
const {
|
|
13506
|
+
children,
|
|
13507
|
+
isClickable,
|
|
13508
|
+
'aria-disabled': _ariaDisabled,
|
|
13509
|
+
...forwardedProps
|
|
13510
|
+
} = otherProps;
|
|
13511
|
+
return TableRow$1({
|
|
13512
|
+
ref,
|
|
13513
|
+
children,
|
|
13514
|
+
isClickable,
|
|
13515
|
+
tabIndex: isClickable && !isAnyDisabled ? 0 : -1,
|
|
13516
|
+
'aria-disabled': isAnyDisabled,
|
|
13517
|
+
...forwardedProps
|
|
13518
|
+
});
|
|
13292
13519
|
});
|
|
13293
13520
|
TableRow.displayName = COMPONENT_NAME$9;
|
|
13294
13521
|
TableRow.className = CLASSNAME$8;
|
|
@@ -13953,7 +14180,14 @@ TextField.displayName = COMPONENT_NAME$5;
|
|
|
13953
14180
|
TextField.className = CLASSNAME$5;
|
|
13954
14181
|
TextField.defaultProps = DEFAULT_PROPS$5;
|
|
13955
14182
|
|
|
13956
|
-
|
|
14183
|
+
/**
|
|
14184
|
+
* Determines the loading state of an HTML image element.
|
|
14185
|
+
*
|
|
14186
|
+
* @param img - The HTML image element to check
|
|
14187
|
+
* @param event - Optional event (load or error) that triggered the state check
|
|
14188
|
+
* @returns The current loading state: 'hasError', 'isLoading', or 'isLoaded'
|
|
14189
|
+
*/
|
|
14190
|
+
function getImageLoadingState(img, event) {
|
|
13957
14191
|
// Error event occurred or image has no source.
|
|
13958
14192
|
if (event?.type === 'error' || img?.complete && !img.getAttribute('src')) {
|
|
13959
14193
|
return 'hasError';
|
|
@@ -13965,30 +14199,58 @@ function getState(img, event) {
|
|
|
13965
14199
|
// Else loaded.
|
|
13966
14200
|
return 'isLoaded';
|
|
13967
14201
|
}
|
|
13968
|
-
function useImageLoad(imageURL, imgRef) {
|
|
13969
|
-
const [state, setState] = useState(getState(imgRef));
|
|
13970
14202
|
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
}, [imageURL, imgRef]);
|
|
14203
|
+
/**
|
|
14204
|
+
* Parameters for getting image size.
|
|
14205
|
+
*/
|
|
13975
14206
|
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
|
|
14207
|
+
/**
|
|
14208
|
+
* Gets the natural image size from props or element.
|
|
14209
|
+
* Returns undefined if focus point is not applicable or size cannot be determined.
|
|
14210
|
+
*
|
|
14211
|
+
* @param params - Image size parameters
|
|
14212
|
+
* @returns Image size or undefined
|
|
14213
|
+
*/
|
|
14214
|
+
function getImageSize({
|
|
14215
|
+
image,
|
|
14216
|
+
aspectRatio,
|
|
14217
|
+
focusPoint,
|
|
14218
|
+
width,
|
|
14219
|
+
height,
|
|
14220
|
+
element,
|
|
14221
|
+
isLoaded
|
|
14222
|
+
}) {
|
|
14223
|
+
// Focus point is not applicable => exit early
|
|
14224
|
+
if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
|
|
14225
|
+
return undefined;
|
|
14226
|
+
}
|
|
14227
|
+
// Size provided via props
|
|
14228
|
+
if (typeof width === 'number' && typeof height === 'number') {
|
|
14229
|
+
return {
|
|
14230
|
+
width,
|
|
14231
|
+
height
|
|
13986
14232
|
};
|
|
13987
|
-
}
|
|
13988
|
-
|
|
14233
|
+
}
|
|
14234
|
+
// Size from loaded element
|
|
14235
|
+
if (element && isLoaded) {
|
|
14236
|
+
return {
|
|
14237
|
+
width: element.naturalWidth,
|
|
14238
|
+
height: element.naturalHeight
|
|
14239
|
+
};
|
|
14240
|
+
}
|
|
14241
|
+
return undefined;
|
|
13989
14242
|
}
|
|
13990
14243
|
|
|
13991
|
-
|
|
14244
|
+
/**
|
|
14245
|
+
* Calculate shift position to center the focus point in the container.
|
|
14246
|
+
*
|
|
14247
|
+
* This function computes the percentage offset needed to position an image
|
|
14248
|
+
* such that a specific focus point on the image aligns with the center of
|
|
14249
|
+
* the container, taking into account the image's scale.
|
|
14250
|
+
*
|
|
14251
|
+
* @param params - Focus point shift calculation parameters
|
|
14252
|
+
* @returns Percentage shift (0-100) for CSS positioning
|
|
14253
|
+
*/
|
|
13992
14254
|
function shiftPosition({
|
|
13993
14255
|
scale,
|
|
13994
14256
|
focusPoint,
|
|
@@ -14003,92 +14265,64 @@ function shiftPosition({
|
|
|
14003
14265
|
return Math.floor(Math.max(Math.min(shift, 1), 0) * 100);
|
|
14004
14266
|
}
|
|
14005
14267
|
|
|
14006
|
-
|
|
14007
|
-
|
|
14268
|
+
/**
|
|
14269
|
+
* Parameters for calculating focus point style.
|
|
14270
|
+
*/
|
|
14271
|
+
|
|
14272
|
+
/**
|
|
14273
|
+
* Calculates CSS style for applying focus point positioning.
|
|
14274
|
+
*
|
|
14275
|
+
* @param params - Focus point style parameters
|
|
14276
|
+
* @returns CSS properties to apply to the image
|
|
14277
|
+
*/
|
|
14278
|
+
function calculateFocusPointStyle({
|
|
14008
14279
|
image,
|
|
14009
14280
|
aspectRatio,
|
|
14010
14281
|
focusPoint,
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
};
|
|
14024
|
-
if (element && isLoaded) return {
|
|
14025
|
-
width: element.naturalWidth,
|
|
14026
|
-
height: element.naturalHeight
|
|
14282
|
+
element,
|
|
14283
|
+
imageSize,
|
|
14284
|
+
containerSize
|
|
14285
|
+
}) {
|
|
14286
|
+
// Focus point is not applicable => exit early
|
|
14287
|
+
if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
|
|
14288
|
+
return {};
|
|
14289
|
+
}
|
|
14290
|
+
if (!element || !imageSize) {
|
|
14291
|
+
// Focus point can be computed but not right now (image size unknown).
|
|
14292
|
+
return {
|
|
14293
|
+
visibility: 'hidden'
|
|
14027
14294
|
};
|
|
14028
|
-
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
if (cWidth && cHeight) {
|
|
14037
|
-
// Update only if needed.
|
|
14038
|
-
setContainerSize(oldContainerSize => oldContainerSize?.width === cWidth && oldContainerSize.height === cHeight ? oldContainerSize : {
|
|
14039
|
-
width: cWidth,
|
|
14040
|
-
height: cHeight
|
|
14041
|
-
});
|
|
14042
|
-
} else if (imageSize) {
|
|
14043
|
-
// Wait for a render (in case the container size is dependent on the image size).
|
|
14044
|
-
requestAnimationFrame(updateContainerSize);
|
|
14045
|
-
}
|
|
14046
|
-
}, [element?.offsetHeight, element?.offsetWidth, imageSize]);
|
|
14295
|
+
}
|
|
14296
|
+
if (!containerSize || !imageSize.height || !imageSize.width) {
|
|
14297
|
+
// Missing container or image size, abort focus point compute.
|
|
14298
|
+
return {};
|
|
14299
|
+
}
|
|
14300
|
+
const heightScale = imageSize.height / containerSize.height;
|
|
14301
|
+
const widthScale = imageSize.width / containerSize.width;
|
|
14302
|
+
const scale = Math.min(widthScale, heightScale);
|
|
14047
14303
|
|
|
14048
|
-
//
|
|
14049
|
-
const
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
return {
|
|
14057
|
-
visibility: 'hidden'
|
|
14058
|
-
};
|
|
14059
|
-
}
|
|
14060
|
-
if (!containerSize || !imageSize.height || !imageSize.width) {
|
|
14061
|
-
// Missing container or image size abort focus point compute.
|
|
14062
|
-
return {};
|
|
14063
|
-
}
|
|
14064
|
-
const heightScale = imageSize.height / containerSize.height;
|
|
14065
|
-
const widthScale = imageSize.width / containerSize.width;
|
|
14066
|
-
const scale = Math.min(widthScale, heightScale);
|
|
14067
|
-
|
|
14068
|
-
// Focus Y relative to the top (instead of the center)
|
|
14069
|
-
const focusPointFromTop = Math.abs((focusPoint?.y || 0) - 1) / 2;
|
|
14070
|
-
const y = shiftPosition({
|
|
14071
|
-
scale,
|
|
14072
|
-
focusPoint: focusPointFromTop,
|
|
14073
|
-
imageSize: imageSize.height,
|
|
14074
|
-
containerSize: containerSize.height
|
|
14075
|
-
});
|
|
14304
|
+
// Focus Y relative to the top (instead of the center)
|
|
14305
|
+
const focusPointFromTop = Math.abs((focusPoint?.y || 0) - 1) / 2;
|
|
14306
|
+
const y = shiftPosition({
|
|
14307
|
+
scale,
|
|
14308
|
+
focusPoint: focusPointFromTop,
|
|
14309
|
+
imageSize: imageSize.height,
|
|
14310
|
+
containerSize: containerSize.height
|
|
14311
|
+
});
|
|
14076
14312
|
|
|
14077
|
-
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
return style;
|
|
14091
|
-
};
|
|
14313
|
+
// Focus X relative to the left (instead of the center)
|
|
14314
|
+
const focusPointFromLeft = Math.abs((focusPoint?.x || 0) + 1) / 2;
|
|
14315
|
+
const x = shiftPosition({
|
|
14316
|
+
scale,
|
|
14317
|
+
focusPoint: focusPointFromLeft,
|
|
14318
|
+
imageSize: imageSize.width,
|
|
14319
|
+
containerSize: containerSize.width
|
|
14320
|
+
});
|
|
14321
|
+
const objectPosition = `${x}% ${y}%`;
|
|
14322
|
+
return {
|
|
14323
|
+
objectPosition
|
|
14324
|
+
};
|
|
14325
|
+
}
|
|
14092
14326
|
|
|
14093
14327
|
/**
|
|
14094
14328
|
* Component display name.
|
|
@@ -14119,25 +14353,18 @@ const DEFAULT_PROPS$4 = {
|
|
|
14119
14353
|
* @param ref Component ref.
|
|
14120
14354
|
* @return React element.
|
|
14121
14355
|
*/
|
|
14122
|
-
const Thumbnail =
|
|
14123
|
-
const {
|
|
14124
|
-
isAnyDisabled,
|
|
14125
|
-
otherProps,
|
|
14126
|
-
disabledStateProps
|
|
14127
|
-
} = useDisableStateProps(props);
|
|
14128
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
14356
|
+
const Thumbnail$1 = props => {
|
|
14129
14357
|
const {
|
|
14130
14358
|
align,
|
|
14131
14359
|
alt,
|
|
14132
|
-
aspectRatio = AspectRatio.original,
|
|
14360
|
+
aspectRatio = AspectRatio$1.original,
|
|
14133
14361
|
badge,
|
|
14134
14362
|
className,
|
|
14135
14363
|
crossOrigin,
|
|
14364
|
+
ref,
|
|
14136
14365
|
fallback = DEFAULT_PROPS$4.fallback,
|
|
14366
|
+
focusPointStyle,
|
|
14137
14367
|
fillHeight,
|
|
14138
|
-
// `focusPoint` needs to be here to remove it from `forwardedProps`.
|
|
14139
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14140
|
-
focusPoint,
|
|
14141
14368
|
image,
|
|
14142
14369
|
imgProps,
|
|
14143
14370
|
imgRef: propImgRef,
|
|
@@ -14145,23 +14372,18 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14145
14372
|
objectFit,
|
|
14146
14373
|
loading = DEFAULT_PROPS$4.loading,
|
|
14147
14374
|
loadingPlaceholderImageRef,
|
|
14375
|
+
isAnyDisabled,
|
|
14376
|
+
disabledStateProps,
|
|
14148
14377
|
size,
|
|
14149
|
-
theme
|
|
14378
|
+
theme,
|
|
14379
|
+
loadingState,
|
|
14150
14380
|
variant,
|
|
14151
14381
|
linkProps,
|
|
14152
14382
|
linkAs,
|
|
14153
14383
|
...forwardedProps
|
|
14154
|
-
} =
|
|
14155
|
-
const [imgElement, setImgElement] = useState();
|
|
14156
|
-
|
|
14157
|
-
// Image loading state.
|
|
14158
|
-
const loadingState = useImageLoad(image, imgElement);
|
|
14159
|
-
const isLoaded = loadingState === 'isLoaded';
|
|
14384
|
+
} = props;
|
|
14160
14385
|
const isLoading = isLoadingProp || loadingState === 'isLoading';
|
|
14161
14386
|
const hasError = loadingState === 'hasError';
|
|
14162
|
-
|
|
14163
|
-
// Focus point.
|
|
14164
|
-
const focusPointStyle = useFocusPointStyle(props, imgElement, isLoaded);
|
|
14165
14387
|
const hasIconErrorFallback = hasError && typeof fallback === 'string';
|
|
14166
14388
|
const hasCustomErrorFallback = hasError && !hasIconErrorFallback;
|
|
14167
14389
|
const imageErrorStyle = {};
|
|
@@ -14174,7 +14396,6 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14174
14396
|
}
|
|
14175
14397
|
const isLink = Boolean(linkProps?.href || linkAs);
|
|
14176
14398
|
const isClickable = !isAnyDisabled && Boolean(isLink || !!forwardedProps.onClick);
|
|
14177
|
-
const Wrapper = isClickable ? RawClickable : 'div';
|
|
14178
14399
|
const wrapperProps = {
|
|
14179
14400
|
...forwardedProps
|
|
14180
14401
|
};
|
|
@@ -14188,6 +14409,21 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14188
14409
|
wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
|
|
14189
14410
|
}
|
|
14190
14411
|
}
|
|
14412
|
+
const wrapperClassName = classNames.join(linkProps?.className, className, block$4({
|
|
14413
|
+
[`align-${align}`]: Boolean(align),
|
|
14414
|
+
[`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
|
|
14415
|
+
[`size-${size}`]: Boolean(size),
|
|
14416
|
+
[`theme-${theme}`]: Boolean(theme),
|
|
14417
|
+
[`variant-${variant}`]: Boolean(variant),
|
|
14418
|
+
'is-clickable': isClickable,
|
|
14419
|
+
'has-error': hasError,
|
|
14420
|
+
'has-icon-error-fallback': hasIconErrorFallback,
|
|
14421
|
+
'has-custom-error-fallback': hasCustomErrorFallback,
|
|
14422
|
+
'is-loading': isLoading,
|
|
14423
|
+
[`object-fit-${objectFit}`]: Boolean(objectFit),
|
|
14424
|
+
'has-badge': !!badge,
|
|
14425
|
+
'fill-height': fillHeight
|
|
14426
|
+
}));
|
|
14191
14427
|
|
|
14192
14428
|
// If we have a loading placeholder image that is really loaded (complete)
|
|
14193
14429
|
const loadingPlaceholderImage = isLoading && loadingPlaceholderImageRef?.current?.complete && loadingPlaceholderImageRef?.current || undefined;
|
|
@@ -14196,24 +14432,7 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14196
14432
|
const loadingStyle = loadingPlaceholderImage ? {
|
|
14197
14433
|
backgroundImage: `url(${loadingPlaceholderImage.src})`
|
|
14198
14434
|
} : undefined;
|
|
14199
|
-
|
|
14200
|
-
...wrapperProps,
|
|
14201
|
-
ref: ref,
|
|
14202
|
-
className: classNames.join(linkProps?.className, className, block$4({
|
|
14203
|
-
[`align-${align}`]: Boolean(align),
|
|
14204
|
-
[`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
|
|
14205
|
-
[`size-${size}`]: Boolean(size),
|
|
14206
|
-
[`theme-${theme}`]: Boolean(theme),
|
|
14207
|
-
[`variant-${variant}`]: Boolean(variant),
|
|
14208
|
-
'is-clickable': isClickable,
|
|
14209
|
-
'has-error': hasError,
|
|
14210
|
-
'has-icon-error-fallback': hasIconErrorFallback,
|
|
14211
|
-
'has-custom-error-fallback': hasCustomErrorFallback,
|
|
14212
|
-
'is-loading': isLoading,
|
|
14213
|
-
[`object-fit-${objectFit}`]: Boolean(objectFit),
|
|
14214
|
-
'has-badge': !!badge,
|
|
14215
|
-
'fill-height': fillHeight
|
|
14216
|
-
})),
|
|
14435
|
+
const innerImage = /*#__PURE__*/jsxs(Fragment, {
|
|
14217
14436
|
children: [/*#__PURE__*/jsxs("span", {
|
|
14218
14437
|
className: element$4('background'),
|
|
14219
14438
|
children: [/*#__PURE__*/jsx("img", {
|
|
@@ -14229,26 +14448,165 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14229
14448
|
...focusPointStyle,
|
|
14230
14449
|
...loadingStyle
|
|
14231
14450
|
},
|
|
14232
|
-
ref:
|
|
14451
|
+
ref: propImgRef,
|
|
14233
14452
|
className: classNames.join(element$4('image', {
|
|
14234
14453
|
'is-loading': isLoading,
|
|
14235
14454
|
'has-defined-size': Boolean(imgProps?.height && imgProps.width)
|
|
14236
|
-
}), imgProps?.className)
|
|
14455
|
+
}), imgProps?.className)
|
|
14456
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14457
|
+
// @ts-ignore - crossOrigin prop compatibility between React and Vue JSX
|
|
14458
|
+
,
|
|
14237
14459
|
crossOrigin: crossOrigin,
|
|
14238
14460
|
src: image,
|
|
14239
14461
|
alt: alt,
|
|
14240
14462
|
loading: loading
|
|
14241
14463
|
}), !isLoading && hasError && /*#__PURE__*/jsx("span", {
|
|
14242
14464
|
className: element$4('fallback'),
|
|
14243
|
-
children: hasIconErrorFallback ?
|
|
14465
|
+
children: hasIconErrorFallback ? Icon$1({
|
|
14244
14466
|
icon: fallback,
|
|
14245
14467
|
size: Size$1.xxs,
|
|
14246
|
-
theme
|
|
14468
|
+
theme
|
|
14247
14469
|
}) : fallback
|
|
14248
14470
|
})]
|
|
14249
|
-
}), badge
|
|
14471
|
+
}), badge]
|
|
14472
|
+
});
|
|
14473
|
+
|
|
14474
|
+
/** Render `RawClickable` as a function since it is a core component which needs to be treated as such */
|
|
14475
|
+
if (isClickable) {
|
|
14476
|
+
return RawClickable$1({
|
|
14477
|
+
ref,
|
|
14478
|
+
...wrapperProps,
|
|
14479
|
+
className: wrapperClassName,
|
|
14480
|
+
children: innerImage
|
|
14481
|
+
});
|
|
14482
|
+
}
|
|
14483
|
+
return /*#__PURE__*/jsx("div", {
|
|
14484
|
+
ref: ref,
|
|
14485
|
+
...wrapperProps,
|
|
14486
|
+
className: wrapperClassName,
|
|
14487
|
+
children: innerImage
|
|
14488
|
+
});
|
|
14489
|
+
};
|
|
14490
|
+
|
|
14491
|
+
function useImageLoad(imageURL, imgRef) {
|
|
14492
|
+
const [state, setState] = useState(getImageLoadingState(imgRef));
|
|
14493
|
+
|
|
14494
|
+
// Update state when changing image URL or DOM reference.
|
|
14495
|
+
useEffect(() => {
|
|
14496
|
+
setState(getImageLoadingState(imgRef));
|
|
14497
|
+
}, [imageURL, imgRef]);
|
|
14498
|
+
|
|
14499
|
+
// Listen to `load` and `error` event on image
|
|
14500
|
+
useEffect(() => {
|
|
14501
|
+
const img = imgRef;
|
|
14502
|
+
if (!img) return undefined;
|
|
14503
|
+
const update = event => setState(getImageLoadingState(img, event));
|
|
14504
|
+
img.addEventListener('load', update);
|
|
14505
|
+
img.addEventListener('error', update);
|
|
14506
|
+
return () => {
|
|
14507
|
+
img.removeEventListener('load', update);
|
|
14508
|
+
img.removeEventListener('error', update);
|
|
14509
|
+
};
|
|
14510
|
+
}, [imgRef, imgRef?.src]);
|
|
14511
|
+
return state;
|
|
14512
|
+
}
|
|
14513
|
+
|
|
14514
|
+
// Compute CSS properties to apply the focus point.
|
|
14515
|
+
const useFocusPointStyle = ({
|
|
14516
|
+
image,
|
|
14517
|
+
aspectRatio,
|
|
14518
|
+
focusPoint,
|
|
14519
|
+
imgProps: {
|
|
14520
|
+
width,
|
|
14521
|
+
height
|
|
14522
|
+
} = {}
|
|
14523
|
+
}, element, isLoaded) => {
|
|
14524
|
+
// Get natural image size from imgProps or img element.
|
|
14525
|
+
const imageSize = useMemo(() => getImageSize({
|
|
14526
|
+
image,
|
|
14527
|
+
aspectRatio,
|
|
14528
|
+
focusPoint,
|
|
14529
|
+
width: typeof width === 'number' ? width : undefined,
|
|
14530
|
+
height: typeof height === 'number' ? height : undefined,
|
|
14531
|
+
element,
|
|
14532
|
+
isLoaded
|
|
14533
|
+
}), [aspectRatio, element, focusPoint, height, image, isLoaded, width]);
|
|
14534
|
+
|
|
14535
|
+
// Get container size (dependant on imageSize).
|
|
14536
|
+
const [containerSize, setContainerSize] = useState(undefined);
|
|
14537
|
+
useEffect(function updateContainerSize() {
|
|
14538
|
+
const cWidth = element?.offsetWidth;
|
|
14539
|
+
const cHeight = element?.offsetHeight;
|
|
14540
|
+
if (cWidth && cHeight) {
|
|
14541
|
+
// Update only if needed.
|
|
14542
|
+
setContainerSize(oldContainerSize => oldContainerSize?.width === cWidth && oldContainerSize.height === cHeight ? oldContainerSize : {
|
|
14543
|
+
width: cWidth,
|
|
14544
|
+
height: cHeight
|
|
14545
|
+
});
|
|
14546
|
+
} else if (imageSize) {
|
|
14547
|
+
// Wait for a render (in case the container size is dependent on the image size).
|
|
14548
|
+
requestAnimationFrame(updateContainerSize);
|
|
14549
|
+
}
|
|
14550
|
+
}, [element?.offsetHeight, element?.offsetWidth, imageSize]);
|
|
14551
|
+
|
|
14552
|
+
// Compute style.
|
|
14553
|
+
const style = useMemo(() => calculateFocusPointStyle({
|
|
14554
|
+
image,
|
|
14555
|
+
aspectRatio,
|
|
14556
|
+
focusPoint,
|
|
14557
|
+
element,
|
|
14558
|
+
imageSize,
|
|
14559
|
+
containerSize
|
|
14560
|
+
}), [aspectRatio, containerSize, element, focusPoint, image, imageSize]);
|
|
14561
|
+
return style;
|
|
14562
|
+
};
|
|
14563
|
+
|
|
14564
|
+
/**
|
|
14565
|
+
* Defines the props of the component.
|
|
14566
|
+
*/
|
|
14567
|
+
|
|
14568
|
+
/**
|
|
14569
|
+
* Thumbnail component.
|
|
14570
|
+
*
|
|
14571
|
+
* @param props Component props.
|
|
14572
|
+
* @param ref Component ref.
|
|
14573
|
+
* @return React element.
|
|
14574
|
+
*/
|
|
14575
|
+
const Thumbnail = forwardRef((props, ref) => {
|
|
14576
|
+
const {
|
|
14577
|
+
isAnyDisabled,
|
|
14578
|
+
otherProps,
|
|
14579
|
+
disabledStateProps
|
|
14580
|
+
} = useDisableStateProps(props);
|
|
14581
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
14582
|
+
const {
|
|
14583
|
+
badge,
|
|
14584
|
+
focusPoint,
|
|
14585
|
+
image,
|
|
14586
|
+
imgRef: propImgRef,
|
|
14587
|
+
...forwardedProps
|
|
14588
|
+
} = otherProps;
|
|
14589
|
+
const [imgElement, setImgElement] = useState();
|
|
14590
|
+
|
|
14591
|
+
// Image loading state.
|
|
14592
|
+
const loadingState = useImageLoad(image, imgElement);
|
|
14593
|
+
const isLoaded = loadingState === 'isLoaded';
|
|
14594
|
+
|
|
14595
|
+
// Focus point.
|
|
14596
|
+
const focusPointStyle = useFocusPointStyle(props, imgElement, isLoaded);
|
|
14597
|
+
return Thumbnail$1({
|
|
14598
|
+
ref,
|
|
14599
|
+
...forwardedProps,
|
|
14600
|
+
theme: forwardedProps.theme || defaultTheme,
|
|
14601
|
+
isAnyDisabled,
|
|
14602
|
+
disabledStateProps,
|
|
14603
|
+
focusPointStyle,
|
|
14604
|
+
loadingState,
|
|
14605
|
+
imgRef: useMergeRefs(setImgElement, propImgRef),
|
|
14606
|
+
image,
|
|
14607
|
+
badge: badge && /*#__PURE__*/React__default.cloneElement(badge, {
|
|
14250
14608
|
className: classNames.join(element$4('badge'), badge.props.className)
|
|
14251
|
-
})
|
|
14609
|
+
})
|
|
14252
14610
|
});
|
|
14253
14611
|
});
|
|
14254
14612
|
Thumbnail.displayName = COMPONENT_NAME$4;
|
|
@@ -14270,7 +14628,7 @@ Thumbnail.defaultProps = DEFAULT_PROPS$4;
|
|
|
14270
14628
|
* @deprecated
|
|
14271
14629
|
*/
|
|
14272
14630
|
const ThumbnailAspectRatio = {
|
|
14273
|
-
...AspectRatio
|
|
14631
|
+
...AspectRatio$1
|
|
14274
14632
|
};
|
|
14275
14633
|
|
|
14276
14634
|
/**
|
|
@@ -14701,7 +15059,7 @@ const {
|
|
|
14701
15059
|
* Component default props.
|
|
14702
15060
|
*/
|
|
14703
15061
|
const DEFAULT_PROPS$1 = {
|
|
14704
|
-
aspectRatio: AspectRatio.horizontal,
|
|
15062
|
+
aspectRatio: AspectRatio$1.horizontal,
|
|
14705
15063
|
size: Size$1.xl,
|
|
14706
15064
|
variant: UploaderVariant.square
|
|
14707
15065
|
};
|
|
@@ -14733,7 +15091,7 @@ const Uploader = forwardRef((props, ref) => {
|
|
|
14733
15091
|
...forwardedProps
|
|
14734
15092
|
} = otherProps;
|
|
14735
15093
|
// Adjust to square aspect ratio when using circle variants.
|
|
14736
|
-
const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio.square : aspectRatio;
|
|
15094
|
+
const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio$1.square : aspectRatio;
|
|
14737
15095
|
const handleClick = React__default.useCallback(evt => {
|
|
14738
15096
|
if (isAnyDisabled) {
|
|
14739
15097
|
evt.preventDefault();
|
|
@@ -14946,5 +15304,5 @@ UserBlock.displayName = COMPONENT_NAME;
|
|
|
14946
15304
|
UserBlock.className = CLASSNAME;
|
|
14947
15305
|
UserBlock.defaultProps = DEFAULT_PROPS;
|
|
14948
15306
|
|
|
14949
|
-
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$1d as CLASSNAME, COMPONENT_NAME$1e as COMPONENT_NAME, Checkbox, Chip, ChipGroup, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$
|
|
15307
|
+
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$1d as CLASSNAME, COMPONENT_NAME$1e as COMPONENT_NAME, Checkbox, Chip, ChipGroup, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$15 as DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectMultiple, SelectMultipleField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
|
|
14950
15308
|
//# sourceMappingURL=index.js.map
|