@lumx/react 3.10.1-alpha.3 → 3.10.1-alpha.5
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.js +117 -147
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/autocomplete/Autocomplete.tsx +2 -11
- package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -7
- package/src/components/badge/BadgeWrapper.tsx +2 -2
- package/src/components/chip/Chip.tsx +1 -1
- package/src/components/chip/ChipGroup.tsx +2 -5
- package/src/components/date-picker/DatePickerControlled.tsx +1 -1
- package/src/components/dropdown/Dropdown.tsx +2 -2
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +2 -2
- package/src/components/grid-column/GridColumn.tsx +2 -7
- package/src/components/heading/Heading.tsx +2 -7
- package/src/components/image-lightbox/internal/ImageSlide.tsx +2 -2
- package/src/components/image-lightbox/internal/ImageSlideshow.tsx +4 -8
- package/src/components/image-lightbox/useImageLightbox.tsx +3 -4
- package/src/components/list/ListDivider.tsx +2 -8
- package/src/components/list/ListItem.tsx +1 -1
- package/src/components/list/ListSubheader.tsx +2 -2
- package/src/components/popover/usePopoverStyle.tsx +3 -1
- package/src/components/popover/useRestoreFocusOnClose.tsx +1 -1
- package/src/components/popover-dialog/PopoverDialog.test.tsx +1 -1
- package/src/components/popover-dialog/PopoverDialog.tsx +2 -2
- package/src/components/progress-tracker/ProgressTracker.tsx +2 -6
- package/src/components/radio-button/RadioGroup.tsx +2 -11
- package/src/components/select/Select.test.tsx +2 -2
- package/src/components/side-navigation/SideNavigation.tsx +2 -6
- package/src/components/slideshow/SlideshowItem.tsx +2 -11
- package/src/components/slideshow/SlideshowItemGroup.tsx +2 -8
- package/src/components/slideshow/useSlideFocusManagement.tsx +1 -1
- package/src/components/table/TableBody.tsx +2 -6
- package/src/components/table/TableCell.tsx +1 -4
- package/src/components/table/TableHeader.tsx +2 -6
- package/src/components/text-field/TextField.test.tsx +2 -2
- package/src/components/tooltip/Tooltip.test.tsx +2 -2
- package/src/components/tooltip/useTooltipOpen.tsx +3 -3
- package/src/hooks/useCallbackOnEscape.ts +1 -1
- package/src/hooks/useFocusTrap.ts +1 -1
- package/src/hooks/useSizeOnWindowResize.ts +14 -10
- package/src/hooks/useTransitionVisibility.ts +2 -2
- package/src/utils/{DOM → browser/DOM}/startViewTransition.ts +3 -3
- package/src/utils/{focus → browser/focus}/getFirstAndLastFocusable.test.ts +1 -1
- package/src/utils/{focus → browser/focus}/getFocusableElements.test.ts +1 -1
- package/src/utils/{browserDoesNotSupportHover.test.js → browser/isHoverNotSupported.test.js} +5 -5
- package/src/utils/browser/isHoverNotSupported.ts +2 -0
- package/src/utils/browser/{getPrefersReducedMotion.ts → isReducedMotion.ts} +1 -1
- package/src/utils/className/getBasicClass.test.ts +20 -0
- package/src/utils/className/getFontColorClassName.test.ts +11 -0
- package/src/utils/className/getFontColorClassName.ts +9 -0
- package/src/utils/className/getRootClassName.test.ts +11 -0
- package/src/utils/{className.ts → className/getRootClassName.ts} +1 -21
- package/src/utils/className/getTypographyClassName.test.ts +7 -0
- package/src/utils/className/getTypographyClassName.ts +9 -0
- package/src/utils/className/handleBasicClasses.test.ts +28 -0
- package/src/utils/className/index.ts +4 -0
- package/src/utils/function/memoize.test.ts +36 -0
- package/src/utils/function/memoize.ts +13 -0
- package/src/utils/partitionMulti.test.ts +27 -0
- package/src/utils/browserDoesNotSupportHover.ts +0 -2
- package/src/utils/isInternetExplorer.ts +0 -15
- package/src/utils/userHasReducedMotion.ts +0 -7
- package/src/utils/utils.test.ts +0 -21
- /package/src/utils/{DOM → browser/DOM}/findImage.tsx +0 -0
- /package/src/utils/{event.ts → browser/event.ts} +0 -0
- /package/src/utils/{focus → browser/focus}/constants.ts +0 -0
- /package/src/utils/{focus → browser/focus}/getFirstAndLastFocusable.ts +0 -0
- /package/src/utils/{focus → browser/focus}/getFocusableElements.ts +0 -0
- /package/src/utils/{isFocusVisible.ts → browser/isFocusVisible.ts} +0 -0
package/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useState, useEffect, useMemo, useRef, Children, isValidElement, cloneElement, useLayoutEffect, useCallback, Fragment, createContext, useContext, useReducer } from 'react';
|
|
3
|
-
import kebabCase from 'lodash/kebabCase';
|
|
4
3
|
import isBoolean from 'lodash/isBoolean';
|
|
5
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
|
+
import kebabCase from 'lodash/kebabCase';
|
|
6
6
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
7
7
|
import get from 'lodash/get';
|
|
8
8
|
import { C as ClickAwayProvider, i as isEmpty$1 } from './_internal/index.js';
|
|
9
|
-
import memoize from 'lodash/memoize';
|
|
10
|
-
import throttle from 'lodash/throttle';
|
|
11
9
|
|
|
12
10
|
function ownKeys(e, r) {
|
|
13
11
|
var t = Object.keys(e);
|
|
@@ -319,57 +317,6 @@ var classNames = classnames.exports;
|
|
|
319
317
|
|
|
320
318
|
const mdiAlert='M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2z';const mdiAlertCircle='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2';const mdiArrowDown='M11 4h2v12l5.5-5.5 1.42 1.42L12 19.84l-7.92-7.92L5.5 10.5 11 16z';const mdiArrowUp='M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z';const mdiCheck='M21 7 9 19l-5.5-5.5 1.41-1.41L9 16.17 19.59 5.59z';const mdiCheckCircle='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z';const mdiChevronDown='M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z';const mdiChevronLeft='M15.41 16.58 10.83 12l4.58-4.59L14 6l-6 6 6 6z';const mdiChevronRight='M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6z';const mdiChevronUp='M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z';const mdiClose='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';const mdiCloseCircle='M12 2a10 10 0 1 1 0 20 10 10 0 1 1 0-20m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z';const mdiDragVertical='M9 3h2v2H9zm4 0h2v2h-2zM9 7h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2z';const mdiImageBroken='M19 3a2 2 0 0 1 2 2v6h-2v2h-2v2h-2v2h-2v2h-2v2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm2 12v4a2 2 0 0 1-2 2h-4v-2h2v-2h2v-2zm-2-6.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0-.5.5v7a.5.5 0 0 0 .5.5H11v-1h2v-2h2v-2h2V9h2z';const mdiInformation='M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2';const mdiMagnifyMinusOutline='M15.5 14h-.79l-.28-.27A6.5 6.5 0 0 0 16 9.5 6.5 6.5 0 0 0 9.5 3 6.5 6.5 0 0 0 3 9.5 6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7z';const mdiMagnifyPlusOutline='m15.5 14 5 5-1.5 1.5-5-5v-.79l-.27-.28A6.5 6.5 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3 6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z';const mdiMenuDown='m7 10 5 5 5-5z';const mdiMinus='M19 13H5v-2h14z';const mdiPauseCircleOutline='M13 16V8h2v8zm-4 0V8h2v8zm3-14a10 10 0 0 1 10 10 10 10 0 0 1-10 10A10 10 0 0 1 2 12 10 10 0 0 1 12 2m0 2a8 8 0 0 0-8 8 8 8 0 0 0 8 8 8 8 0 0 0 8-8 8 8 0 0 0-8-8';const mdiPlayCircleOutline='M12 20a8.01 8.01 0 0 1 0-16 8.01 8.01 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-2 14.5 6-4.5-6-4.5z';const mdiRadioboxBlank='M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2';const mdiRadioboxMarked='M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 5a5 5 0 0 0-5 5 5 5 0 0 0 5 5 5 5 0 0 0 5-5 5 5 0 0 0-5-5';
|
|
321
319
|
|
|
322
|
-
/**
|
|
323
|
-
* The prefix to use for the CSS classes.
|
|
324
|
-
*/
|
|
325
|
-
const CSS_PREFIX = 'lumx';
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Animation duration constants. Take into consideration that if you change one of these variables,
|
|
329
|
-
* you need to update their scss counterpart as well
|
|
330
|
-
*/
|
|
331
|
-
const DIALOG_TRANSITION_DURATION = 400;
|
|
332
|
-
const EXPANSION_PANEL_TRANSITION_DURATION = 400;
|
|
333
|
-
const NOTIFICATION_TRANSITION_DURATION = 200;
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Delay on hover after which we open or close the tooltip.
|
|
337
|
-
* Only applies to devices supporting pointer hover.
|
|
338
|
-
*/
|
|
339
|
-
const TOOLTIP_HOVER_DELAY = {
|
|
340
|
-
open: 500,
|
|
341
|
-
close: 500
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Delay on long press after which we open or close the tooltip.
|
|
346
|
-
* Only applies to devices not supporting pointer hover.
|
|
347
|
-
*/
|
|
348
|
-
const TOOLTIP_LONG_PRESS_DELAY = {
|
|
349
|
-
open: 250,
|
|
350
|
-
close: 3000
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Optional global `window` instance (not defined when running SSR).
|
|
355
|
-
*/
|
|
356
|
-
const WINDOW = typeof window !== 'undefined' ? window : undefined;
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Optional global `document` instance (not defined when running SSR).
|
|
360
|
-
*/
|
|
361
|
-
const DOCUMENT = typeof document !== 'undefined' ? document : undefined;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Check if we are running in a true browser
|
|
365
|
-
*/
|
|
366
|
-
const IS_BROWSER = typeof navigator !== 'undefined' && !navigator.userAgent.includes('jsdom');
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Visually hidden a11y utility class name
|
|
370
|
-
*/
|
|
371
|
-
const VISUALLY_HIDDEN = 'visually-hidden';
|
|
372
|
-
|
|
373
320
|
const _excluded$1t = ["prefix"];
|
|
374
321
|
|
|
375
322
|
/**
|
|
@@ -567,6 +514,37 @@ function onButtonPressed(handler) {
|
|
|
567
514
|
};
|
|
568
515
|
}
|
|
569
516
|
|
|
517
|
+
/**
|
|
518
|
+
* The prefix to use for the CSS classes.
|
|
519
|
+
*/
|
|
520
|
+
const CSS_PREFIX = 'lumx';
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Animation duration constants. Take into consideration that if you change one of these variables,
|
|
524
|
+
* you need to update their scss counterpart as well
|
|
525
|
+
*/
|
|
526
|
+
const DIALOG_TRANSITION_DURATION = 400;
|
|
527
|
+
const EXPANSION_PANEL_TRANSITION_DURATION = 400;
|
|
528
|
+
const NOTIFICATION_TRANSITION_DURATION = 200;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Delay on hover after which we open or close the tooltip.
|
|
532
|
+
* Only applies to devices supporting pointer hover.
|
|
533
|
+
*/
|
|
534
|
+
const TOOLTIP_HOVER_DELAY = {
|
|
535
|
+
open: 500,
|
|
536
|
+
close: 500
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Delay on long press after which we open or close the tooltip.
|
|
541
|
+
* Only applies to devices not supporting pointer hover.
|
|
542
|
+
*/
|
|
543
|
+
const TOOLTIP_LONG_PRESS_DELAY = {
|
|
544
|
+
open: 250,
|
|
545
|
+
close: 3000
|
|
546
|
+
};
|
|
547
|
+
|
|
570
548
|
// See https://regex101.com/r/YjS1uI/3
|
|
571
549
|
const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
|
|
572
550
|
|
|
@@ -588,6 +566,14 @@ function getRootClassName(componentName, subComponent) {
|
|
|
588
566
|
return formattedClassName;
|
|
589
567
|
}
|
|
590
568
|
|
|
569
|
+
/**
|
|
570
|
+
* Returns the classname associated to the given typography.
|
|
571
|
+
* For example, for `Typography.title` it returns `lumx-typography-title`
|
|
572
|
+
*/
|
|
573
|
+
const getTypographyClassName = typography => {
|
|
574
|
+
return `lumx-typography-${typography}`;
|
|
575
|
+
};
|
|
576
|
+
|
|
591
577
|
/**
|
|
592
578
|
* Returns the classname associated to the given color and variant.
|
|
593
579
|
* For example, for 'dark' and 'L2' it returns `lumx-color-font-dark-l2`
|
|
@@ -597,14 +583,6 @@ const getFontColorClassName = function (color) {
|
|
|
597
583
|
return `lumx-color-font-${color}-${colorVariant}`;
|
|
598
584
|
};
|
|
599
585
|
|
|
600
|
-
/**
|
|
601
|
-
* Returns the classname associated to the given typography.
|
|
602
|
-
* For example, for `Typography.title` it returns `lumx-typography-title`
|
|
603
|
-
*/
|
|
604
|
-
const getTypographyClassName = typography => {
|
|
605
|
-
return `lumx-typography-${typography}`;
|
|
606
|
-
};
|
|
607
|
-
|
|
608
586
|
let i = 0;
|
|
609
587
|
|
|
610
588
|
/**
|
|
@@ -901,9 +879,7 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
901
879
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
902
880
|
ref: ref
|
|
903
881
|
}, forwardedProps, {
|
|
904
|
-
className: classNames(className,
|
|
905
|
-
prefix: CLASSNAME$1j
|
|
906
|
-
}))
|
|
882
|
+
className: classNames(className, CLASSNAME$1j)
|
|
907
883
|
}), /*#__PURE__*/React__default.createElement(TextField, _extends({}, textFieldProps, {
|
|
908
884
|
chips: chips,
|
|
909
885
|
error: error,
|
|
@@ -1035,9 +1011,7 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
1035
1011
|
ref: ref
|
|
1036
1012
|
}, forwardedProps, {
|
|
1037
1013
|
anchorToInput: anchorToInput,
|
|
1038
|
-
className: classNames(className,
|
|
1039
|
-
prefix: CLASSNAME$1i
|
|
1040
|
-
})),
|
|
1014
|
+
className: classNames(className, CLASSNAME$1i),
|
|
1041
1015
|
name: name,
|
|
1042
1016
|
value: value,
|
|
1043
1017
|
onChange: onChange,
|
|
@@ -2069,6 +2043,26 @@ const List = Object.assign(InternalList, {
|
|
|
2069
2043
|
useKeyboardListNavigation
|
|
2070
2044
|
});
|
|
2071
2045
|
|
|
2046
|
+
/**
|
|
2047
|
+
* Optional global `window` instance (not defined when running SSR).
|
|
2048
|
+
*/
|
|
2049
|
+
const WINDOW = typeof window !== 'undefined' ? window : undefined;
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Optional global `document` instance (not defined when running SSR).
|
|
2053
|
+
*/
|
|
2054
|
+
const DOCUMENT = typeof document !== 'undefined' ? document : undefined;
|
|
2055
|
+
|
|
2056
|
+
/**
|
|
2057
|
+
* Check if we are running in a true browser
|
|
2058
|
+
*/
|
|
2059
|
+
const IS_BROWSER = typeof navigator !== 'undefined' && !navigator.userAgent.includes('jsdom');
|
|
2060
|
+
|
|
2061
|
+
/**
|
|
2062
|
+
* Visually hidden a11y utility class name
|
|
2063
|
+
*/
|
|
2064
|
+
const VISUALLY_HIDDEN = 'visually-hidden';
|
|
2065
|
+
|
|
2072
2066
|
/** Pull an element from an array (inverse of array.push) */
|
|
2073
2067
|
const pull = (array, element) => {
|
|
2074
2068
|
const index = array.indexOf(element);
|
|
@@ -4436,6 +4430,21 @@ const useStubPopper = (_a, _p, _ref) => {
|
|
|
4436
4430
|
/** Switch hook implementation between environment */
|
|
4437
4431
|
const usePopper = IS_BROWSER ? usePopper$1 : useStubPopper;
|
|
4438
4432
|
|
|
4433
|
+
/** Memoize a function based on the serialization of its args */
|
|
4434
|
+
function memoize(fn) {
|
|
4435
|
+
const cache = new Map();
|
|
4436
|
+
return function () {
|
|
4437
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4438
|
+
args[_key] = arguments[_key];
|
|
4439
|
+
}
|
|
4440
|
+
const serializedArgs = JSON.stringify(args);
|
|
4441
|
+
if (cache.has(serializedArgs)) return cache.get(serializedArgs);
|
|
4442
|
+
const value = fn(...args);
|
|
4443
|
+
cache.set(serializedArgs, value);
|
|
4444
|
+
return value;
|
|
4445
|
+
};
|
|
4446
|
+
}
|
|
4447
|
+
|
|
4439
4448
|
/**
|
|
4440
4449
|
* Different possible placements for the popover.
|
|
4441
4450
|
*/
|
|
@@ -4909,9 +4918,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
4909
4918
|
}, forwardedProps, {
|
|
4910
4919
|
focusAnchorOnClose: focusAnchorOnClose,
|
|
4911
4920
|
anchorRef: anchorRef,
|
|
4912
|
-
className: classNames(className,
|
|
4913
|
-
prefix: CLASSNAME$1c
|
|
4914
|
-
})),
|
|
4921
|
+
className: classNames(className, CLASSNAME$1c),
|
|
4915
4922
|
elevation: 0,
|
|
4916
4923
|
closeOnClickAway: closeOnClickAway,
|
|
4917
4924
|
closeOnEscape: closeOnEscape,
|
|
@@ -5167,9 +5174,7 @@ const BadgeWrapper = forwardRef((props, ref) => {
|
|
|
5167
5174
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
5168
5175
|
ref: ref
|
|
5169
5176
|
}, forwardedProps, {
|
|
5170
|
-
className: classNames(className,
|
|
5171
|
-
prefix: CLASSNAME$19
|
|
5172
|
-
}))
|
|
5177
|
+
className: classNames(className, CLASSNAME$19)
|
|
5173
5178
|
}), children, badge && /*#__PURE__*/React__default.createElement("div", {
|
|
5174
5179
|
className: `${CLASSNAME$19}__badge`
|
|
5175
5180
|
}, badge));
|
|
@@ -5825,13 +5830,10 @@ const InternalChipGroup = forwardRef((props, ref) => {
|
|
|
5825
5830
|
className
|
|
5826
5831
|
} = props,
|
|
5827
5832
|
forwardedProps = _objectWithoutProperties(props, _excluded$19);
|
|
5828
|
-
const chipGroupClassName = handleBasicClasses({
|
|
5829
|
-
prefix: CLASSNAME$13
|
|
5830
|
-
});
|
|
5831
5833
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
5832
5834
|
ref: ref
|
|
5833
5835
|
}, forwardedProps, {
|
|
5834
|
-
className: classNames(className,
|
|
5836
|
+
className: classNames(className, CLASSNAME$13)
|
|
5835
5837
|
}), children);
|
|
5836
5838
|
});
|
|
5837
5839
|
InternalChipGroup.displayName = COMPONENT_NAME$15;
|
|
@@ -6807,13 +6809,11 @@ const useDisableBodyScroll = modalElement => {
|
|
|
6807
6809
|
}, [modalElement]);
|
|
6808
6810
|
};
|
|
6809
6811
|
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
}
|
|
6816
|
-
};
|
|
6812
|
+
/** Check if user prefers reduced motion */
|
|
6813
|
+
function isReducedMotion() {
|
|
6814
|
+
var _WINDOW$matchMedia;
|
|
6815
|
+
return WINDOW === null || WINDOW === void 0 ? void 0 : (_WINDOW$matchMedia = WINDOW.matchMedia) === null || _WINDOW$matchMedia === void 0 ? void 0 : _WINDOW$matchMedia.call(WINDOW, '(prefers-reduced-motion: reduce)').matches;
|
|
6816
|
+
}
|
|
6817
6817
|
|
|
6818
6818
|
/**
|
|
6819
6819
|
* Returns true if the component is visible tracking the opacity transition.
|
|
@@ -6839,7 +6839,7 @@ const useTransitionVisibility = (ref, isComponentVisible, timeout, onVisibilityC
|
|
|
6839
6839
|
|
|
6840
6840
|
// Transition event is not supported or the user prefers reduced motion.
|
|
6841
6841
|
// => Skip and set visibility to false directly.
|
|
6842
|
-
if (!element || !window.TransitionEvent ||
|
|
6842
|
+
if (!element || !window.TransitionEvent || isReducedMotion()) {
|
|
6843
6843
|
setVisible(false);
|
|
6844
6844
|
return undefined;
|
|
6845
6845
|
}
|
|
@@ -7667,9 +7667,7 @@ const Heading = forwardRef((props, ref) => {
|
|
|
7667
7667
|
const computedHeadingElement = as || headingElement;
|
|
7668
7668
|
return /*#__PURE__*/React__default.createElement(Text, _extends({
|
|
7669
7669
|
ref: ref,
|
|
7670
|
-
className: classNames(className,
|
|
7671
|
-
prefix: CLASSNAME$U
|
|
7672
|
-
})),
|
|
7670
|
+
className: classNames(className, CLASSNAME$U),
|
|
7673
7671
|
as: computedHeadingElement,
|
|
7674
7672
|
typography: DEFAULT_TYPOGRAPHY_BY_LEVEL[computedHeadingElement]
|
|
7675
7673
|
}, forwardedProps), children);
|
|
@@ -7851,9 +7849,7 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
7851
7849
|
forwardedProps = _objectWithoutProperties(props, _excluded$W);
|
|
7852
7850
|
return /*#__PURE__*/React__default.createElement(Component, _extends({}, forwardedProps, {
|
|
7853
7851
|
ref: ref,
|
|
7854
|
-
className: classNames(className,
|
|
7855
|
-
prefix: CLASSNAME$R
|
|
7856
|
-
})),
|
|
7852
|
+
className: classNames(className, CLASSNAME$R),
|
|
7857
7853
|
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
7858
7854
|
['--lumx-grid-column-item-min-width']: Number.isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
7859
7855
|
['--lumx-grid-column-columns']: maxColumns,
|
|
@@ -8140,11 +8136,20 @@ const CLASSNAME$O = getRootClassName(COMPONENT_NAME$O);
|
|
|
8140
8136
|
*/
|
|
8141
8137
|
function useSizeOnWindowResize(elementRef) {
|
|
8142
8138
|
const [size, setSize] = React__default.useState(null);
|
|
8143
|
-
const updateSize = React__default.useMemo(() =>
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8139
|
+
const updateSize = React__default.useMemo(() => {
|
|
8140
|
+
let prevTimeout;
|
|
8141
|
+
function update() {
|
|
8142
|
+
var _elementRef$current;
|
|
8143
|
+
const newSize = (_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.getBoundingClientRect();
|
|
8144
|
+
if (newSize) setSize(newSize);
|
|
8145
|
+
prevTimeout = undefined;
|
|
8146
|
+
}
|
|
8147
|
+
return () => {
|
|
8148
|
+
if (!prevTimeout) {
|
|
8149
|
+
prevTimeout = setTimeout(update, 10);
|
|
8150
|
+
}
|
|
8151
|
+
};
|
|
8152
|
+
}, [elementRef]);
|
|
8148
8153
|
React__default.useEffect(() => {
|
|
8149
8154
|
updateSize();
|
|
8150
8155
|
window.addEventListener('resize', updateSize);
|
|
@@ -8173,12 +8178,6 @@ function useImageSize(imgRef, getInitialSize) {
|
|
|
8173
8178
|
return imageSize;
|
|
8174
8179
|
}
|
|
8175
8180
|
|
|
8176
|
-
/** Check if user prefers reduced motion */
|
|
8177
|
-
function getPrefersReducedMotion() {
|
|
8178
|
-
var _WINDOW$matchMedia;
|
|
8179
|
-
return WINDOW === null || WINDOW === void 0 ? void 0 : (_WINDOW$matchMedia = WINDOW.matchMedia) === null || _WINDOW$matchMedia === void 0 ? void 0 : _WINDOW$matchMedia.call(WINDOW, '(prefers-reduced-motion: reduce)').matches;
|
|
8180
|
-
}
|
|
8181
|
-
|
|
8182
8181
|
/** Minimal recursive deep equal of JS values */
|
|
8183
8182
|
function isEqual(obj1, obj2) {
|
|
8184
8183
|
if (obj1 === obj2) return true;
|
|
@@ -8464,7 +8463,7 @@ const ImageSlide = /*#__PURE__*/React__default.memo(props => {
|
|
|
8464
8463
|
maxWidth: scrollAreaSize === null || scrollAreaSize === void 0 ? void 0 : scrollAreaSize.width
|
|
8465
8464
|
}), {}, {
|
|
8466
8465
|
// Only animate when scale is set, and we are not pointer zooming and the user does not prefer reduced motion
|
|
8467
|
-
transition: scale && !isPointerZooming && !
|
|
8466
|
+
transition: scale && !isPointerZooming && !isReducedMotion() ? 'all 250ms' : undefined
|
|
8468
8467
|
})
|
|
8469
8468
|
}),
|
|
8470
8469
|
loadingPlaceholderImageRef: loadingPlaceholderImageRef
|
|
@@ -8566,13 +8565,6 @@ const ImageSlideshow = _ref => {
|
|
|
8566
8565
|
})));
|
|
8567
8566
|
const getImgRef = React__default.useMemo(() => memoize((index, isActive) => {
|
|
8568
8567
|
return mergeRefs(images === null || images === void 0 ? void 0 : images[index].imgRef, isActive ? activeImageRef : undefined);
|
|
8569
|
-
},
|
|
8570
|
-
// memoize based on both arguments
|
|
8571
|
-
function () {
|
|
8572
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8573
|
-
args[_key] = arguments[_key];
|
|
8574
|
-
}
|
|
8575
|
-
return args.join();
|
|
8576
8568
|
}), [images, activeImageRef]);
|
|
8577
8569
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Slides, {
|
|
8578
8570
|
activeIndex: activeIndex,
|
|
@@ -8650,7 +8642,7 @@ async function startViewTransition(_ref) {
|
|
|
8650
8642
|
viewTransitionName
|
|
8651
8643
|
} = _ref;
|
|
8652
8644
|
const start = (_document = document) === null || _document === void 0 ? void 0 : (_document$startViewTr = _document.startViewTransition) === null || _document$startViewTr === void 0 ? void 0 : _document$startViewTr.bind(document);
|
|
8653
|
-
const prefersReducedMotion =
|
|
8645
|
+
const prefersReducedMotion = isReducedMotion();
|
|
8654
8646
|
const {
|
|
8655
8647
|
flushSync
|
|
8656
8648
|
} = ReactDOM;
|
|
@@ -9367,9 +9359,7 @@ const ListDivider = forwardRef((props, ref) => {
|
|
|
9367
9359
|
return /*#__PURE__*/React__default.createElement("li", _extends({
|
|
9368
9360
|
ref: ref
|
|
9369
9361
|
}, forwardedProps, {
|
|
9370
|
-
className: classNames(className,
|
|
9371
|
-
prefix: CLASSNAME$I
|
|
9372
|
-
}))
|
|
9362
|
+
className: classNames(className, CLASSNAME$I)
|
|
9373
9363
|
}));
|
|
9374
9364
|
});
|
|
9375
9365
|
ListDivider.displayName = COMPONENT_NAME$I;
|
|
@@ -9407,9 +9397,7 @@ const ListSubheader = forwardRef((props, ref) => {
|
|
|
9407
9397
|
return /*#__PURE__*/React__default.createElement("li", _extends({
|
|
9408
9398
|
ref: ref
|
|
9409
9399
|
}, forwardedProps, {
|
|
9410
|
-
className: classNames(className,
|
|
9411
|
-
prefix: CLASSNAME$H
|
|
9412
|
-
}))
|
|
9400
|
+
className: classNames(className, CLASSNAME$H)
|
|
9413
9401
|
}), children);
|
|
9414
9402
|
});
|
|
9415
9403
|
ListSubheader.displayName = COMPONENT_NAME$H;
|
|
@@ -9959,9 +9947,7 @@ const PopoverDialog = forwardRef((props, ref) => {
|
|
|
9959
9947
|
forwardedProps = _objectWithoutProperties(props, _excluded$E);
|
|
9960
9948
|
return /*#__PURE__*/React__default.createElement(Popover, _extends({}, forwardedProps, {
|
|
9961
9949
|
ref: ref,
|
|
9962
|
-
className: classNames(className,
|
|
9963
|
-
prefix: CLASSNAME$A
|
|
9964
|
-
})),
|
|
9950
|
+
className: classNames(className, CLASSNAME$A),
|
|
9965
9951
|
role: "dialog",
|
|
9966
9952
|
"aria-modal": "true"
|
|
9967
9953
|
/**
|
|
@@ -10550,9 +10536,7 @@ const ProgressTracker = forwardRef((props, ref) => {
|
|
|
10550
10536
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
10551
10537
|
ref: mergeRefs(ref, stepListRef)
|
|
10552
10538
|
}, forwardedProps, {
|
|
10553
|
-
className: classNames(className,
|
|
10554
|
-
prefix: CLASSNAME$v
|
|
10555
|
-
}))
|
|
10539
|
+
className: classNames(className, CLASSNAME$v)
|
|
10556
10540
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
10557
10541
|
className: `${CLASSNAME$v}__steps`,
|
|
10558
10542
|
role: "tablist",
|
|
@@ -10877,9 +10861,7 @@ const RadioGroup = forwardRef((props, ref) => {
|
|
|
10877
10861
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
10878
10862
|
ref: ref
|
|
10879
10863
|
}, forwardedProps, {
|
|
10880
|
-
className: classNames(className,
|
|
10881
|
-
prefix: CLASSNAME$r
|
|
10882
|
-
}))
|
|
10864
|
+
className: classNames(className, CLASSNAME$r)
|
|
10883
10865
|
}), children);
|
|
10884
10866
|
});
|
|
10885
10867
|
RadioGroup.displayName = COMPONENT_NAME$r;
|
|
@@ -11163,9 +11145,7 @@ const SideNavigation = forwardRef((props, ref) => {
|
|
|
11163
11145
|
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
11164
11146
|
ref: ref
|
|
11165
11147
|
}, forwardedProps, {
|
|
11166
|
-
className: classNames(className, theme === Theme.dark && 'lumx-color-font-light-N',
|
|
11167
|
-
prefix: CLASSNAME$o
|
|
11168
|
-
}))
|
|
11148
|
+
className: classNames(className, theme === Theme.dark && 'lumx-color-font-light-N', CLASSNAME$o)
|
|
11169
11149
|
}), content);
|
|
11170
11150
|
});
|
|
11171
11151
|
SideNavigation.displayName = COMPONENT_NAME$o;
|
|
@@ -12129,9 +12109,7 @@ const SlideshowItemGroup = forwardRef((props, ref) => {
|
|
|
12129
12109
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
12130
12110
|
ref: mergeRefs(groupRef, ref),
|
|
12131
12111
|
role: role,
|
|
12132
|
-
className: classNames(className,
|
|
12133
|
-
prefix: CLASSNAME$i
|
|
12134
|
-
})),
|
|
12112
|
+
className: classNames(className, CLASSNAME$i),
|
|
12135
12113
|
"aria-roledescription": "slide",
|
|
12136
12114
|
"aria-label": label
|
|
12137
12115
|
}, forwardedProps), children);
|
|
@@ -12287,9 +12265,7 @@ const SlideshowItem = forwardRef((props, ref) => {
|
|
|
12287
12265
|
forwardedProps = _objectWithoutProperties(props, _excluded$i);
|
|
12288
12266
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
12289
12267
|
ref: ref,
|
|
12290
|
-
className: classNames(className,
|
|
12291
|
-
prefix: CLASSNAME$h
|
|
12292
|
-
}))
|
|
12268
|
+
className: classNames(className, CLASSNAME$h)
|
|
12293
12269
|
}, forwardedProps), children);
|
|
12294
12270
|
});
|
|
12295
12271
|
SlideshowItem.displayName = COMPONENT_NAME$h;
|
|
@@ -12786,9 +12762,7 @@ const TableBody = forwardRef((props, ref) => {
|
|
|
12786
12762
|
return /*#__PURE__*/React__default.createElement("tbody", _extends({
|
|
12787
12763
|
ref: ref
|
|
12788
12764
|
}, forwardedProps, {
|
|
12789
|
-
className: classNames(className,
|
|
12790
|
-
prefix: CLASSNAME$c
|
|
12791
|
-
}))
|
|
12765
|
+
className: classNames(className, CLASSNAME$c)
|
|
12792
12766
|
}), children);
|
|
12793
12767
|
});
|
|
12794
12768
|
TableBody.displayName = COMPONENT_NAME$c;
|
|
@@ -12891,9 +12865,7 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
12891
12865
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
12892
12866
|
className: `${CLASSNAME$b}-content`
|
|
12893
12867
|
}, children))), variant === TableCellVariant.body && /*#__PURE__*/React__default.createElement("td", _extends({}, forwardedProps, {
|
|
12894
|
-
className: classNames(className,
|
|
12895
|
-
prefix: CLASSNAME$b
|
|
12896
|
-
}), `${CLASSNAME$b}--body`)
|
|
12868
|
+
className: classNames(className, CLASSNAME$b, `${CLASSNAME$b}--body`)
|
|
12897
12869
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
12898
12870
|
className: `${CLASSNAME$b}-content`
|
|
12899
12871
|
}, children)));
|
|
@@ -12939,9 +12911,7 @@ const TableHeader = forwardRef((props, ref) => {
|
|
|
12939
12911
|
return /*#__PURE__*/React__default.createElement("thead", _extends({
|
|
12940
12912
|
ref: ref
|
|
12941
12913
|
}, forwardedProps, {
|
|
12942
|
-
className: classNames(className,
|
|
12943
|
-
prefix: CLASSNAME$a
|
|
12944
|
-
}))
|
|
12914
|
+
className: classNames(className, CLASSNAME$a)
|
|
12945
12915
|
}), children);
|
|
12946
12916
|
});
|
|
12947
12917
|
TableHeader.displayName = COMPONENT_NAME$a;
|
|
@@ -14043,7 +14013,7 @@ const useInjectTooltipRef = options => {
|
|
|
14043
14013
|
};
|
|
14044
14014
|
|
|
14045
14015
|
/** Return true if the browser does not support pointer hover */
|
|
14046
|
-
const
|
|
14016
|
+
const isHoverNotSupported = () => {
|
|
14047
14017
|
var _window$matchMedia, _window;
|
|
14048
14018
|
return !!((_window$matchMedia = (_window = window).matchMedia) !== null && _window$matchMedia !== void 0 && _window$matchMedia.call(_window, '(hover: none)').matches);
|
|
14049
14019
|
};
|
|
@@ -14090,7 +14060,7 @@ function useTooltipOpen(delay, anchorElement) {
|
|
|
14090
14060
|
// Skip timeout in fake browsers
|
|
14091
14061
|
if (!IS_BROWSER) update();else timer = setTimeout(update, duration);
|
|
14092
14062
|
};
|
|
14093
|
-
const hoverNotSupported =
|
|
14063
|
+
const hoverNotSupported = isHoverNotSupported();
|
|
14094
14064
|
const hasTouch = ('ontouchstart' in window);
|
|
14095
14065
|
|
|
14096
14066
|
// Adapt open/close delay
|