@lumx/react 4.3.2-alpha.0 → 4.3.2-alpha.1

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 CHANGED
@@ -1,13 +1,12 @@
1
- import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio, ColorVariant, REAL_SIZE_FOR_LUMX_SIZE, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
1
+ import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio, ColorVariant, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
2
2
  export * from '@lumx/core/js/constants';
3
3
  export * from '@lumx/core/js/types';
4
4
  import * as React from 'react';
5
- import React__default, { useMemo, useState, useEffect, useRef, useCallback, useContext, createContext, useReducer, Children, useLayoutEffect, cloneElement, isValidElement } from 'react';
5
+ import React__default, { useState, useEffect, useMemo, useRef, useCallback, Children, useLayoutEffect, cloneElement, createContext, isValidElement, useContext, useReducer } from 'react';
6
6
  import { mdiAlert } from '@lumx/icons/esm/alert';
7
7
  import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle';
8
8
  import { mdiCheckCircle } from '@lumx/icons/esm/check-circle';
9
9
  import { mdiInformation } from '@lumx/icons/esm/information';
10
- import uniqueId from 'lodash/uniqueId';
11
10
  import { classNames, onEnterPressed, onEscapePressed, onButtonPressed, detectHorizontalSwipe } from '@lumx/core/js/utils';
12
11
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
13
12
  import last from 'lodash/last';
@@ -17,7 +16,7 @@ import concat from 'lodash/concat';
17
16
  import dropRight from 'lodash/dropRight';
18
17
  import partition from 'lodash/partition';
19
18
  import reduce from 'lodash/reduce';
20
- import { u as useDisabledStateContext, M as MovingFocusContext, a as useVirtualFocusParent, b as useVirtualFocus, c as MovingFocusProvider, P as Portal, C as ClickAwayProvider } from './_internal/Ui3KfDoH.js';
19
+ import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/DpdvhbTO.js';
21
20
  import isEmpty from 'lodash/isEmpty';
22
21
  import { getDisabledState } from '@lumx/core/js/utils/disabledState';
23
22
  import { mdiCloseCircle } from '@lumx/icons/esm/close-circle';
@@ -27,15 +26,13 @@ import isFunction from 'lodash/isFunction';
27
26
  import { mdiImageBroken } from '@lumx/icons/esm/image-broken';
28
27
  import { mdiCheck } from '@lumx/icons/esm/check';
29
28
  import { mdiMinus } from '@lumx/icons/esm/minus';
30
- import { visuallyHidden, bem as bem$1 } from '@lumx/core/js/utils/classNames';
31
- import noop from 'lodash/noop';
32
- import debounce$1 from 'lodash/debounce';
33
- import { mdiChevronDown } from '@lumx/icons/esm/chevron-down';
34
- import { mdiChevronUp } from '@lumx/icons/esm/chevron-up';
35
- import castArray from 'lodash/castArray';
36
29
  import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left';
37
30
  import { mdiChevronRight } from '@lumx/icons/esm/chevron-right';
31
+ import castArray from 'lodash/castArray';
38
32
  import { mdiDragVertical } from '@lumx/icons/esm/drag-vertical';
33
+ import { mdiChevronDown } from '@lumx/icons/esm/chevron-down';
34
+ import { mdiChevronUp } from '@lumx/icons/esm/chevron-up';
35
+ import noop from 'lodash/noop';
39
36
  import pick from 'lodash/pick';
40
37
  import isInteger from 'lodash/isInteger';
41
38
  import { mdiMagnifyMinusOutline } from '@lumx/icons/esm/magnify-minus-outline';
@@ -55,16 +52,19 @@ import { mdiArrowDown } from '@lumx/icons/esm/arrow-down';
55
52
  import { mdiArrowUp } from '@lumx/icons/esm/arrow-up';
56
53
  import set from 'lodash/set';
57
54
 
55
+ let i = 0;
56
+
58
57
  /**
59
- * Generate a unique and stable id that can then safely be used as html id.
60
- * This is similar to, but much simpler than, React's `useId` hook.
58
+ * Generate a unique id (for use in a11y or other id based DOM linking).
61
59
  *
62
- * Once we upgrade to React 18, this hook will be deprecated.
60
+ * (Tries to emulate React 18 useId hook, to remove once we upgrade React)
63
61
  */
64
- const useId = (prefix = 'lumx') => {
65
- // A common practice to make sure ids are unique is to surround them with colons.
66
- return useMemo(() => `:${uniqueId(prefix)}:`, [prefix]);
67
- };
62
+ function useId() {
63
+ return React__default.useMemo(() => {
64
+ i += 1;
65
+ return `:lumx${i}:`;
66
+ }, []);
67
+ }
68
68
 
69
69
  /**
70
70
  * React.forwardRef but re-typed to attach some custom metadata on our components.
@@ -96,20 +96,20 @@ const CONFIG$1 = {
96
96
  /**
97
97
  * Component display name.
98
98
  */
99
- const COMPONENT_NAME$1k = 'AlertDialog';
99
+ const COMPONENT_NAME$1l = 'AlertDialog';
100
100
 
101
101
  /**
102
102
  * Component default class name and class prefix.
103
103
  */
104
- const CLASSNAME$1m = 'lumx-alert-dialog';
104
+ const CLASSNAME$1j = 'lumx-alert-dialog';
105
105
  const {
106
- block: block$18
107
- } = classNames.bem(CLASSNAME$1m);
106
+ block: block$14
107
+ } = classNames.bem(CLASSNAME$1j);
108
108
 
109
109
  /**
110
110
  * Component default props.
111
111
  */
112
- const DEFAULT_PROPS$16 = {
112
+ const DEFAULT_PROPS$19 = {
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$16.kind,
134
- size = DEFAULT_PROPS$16.size,
133
+ kind = DEFAULT_PROPS$19.kind,
134
+ size = DEFAULT_PROPS$19.size,
135
135
  dialogProps,
136
136
  children,
137
137
  ...forwardedProps
@@ -172,7 +172,7 @@ const AlertDialog = forwardRef((props, ref) => {
172
172
  'aria-describedby': descriptionId,
173
173
  ...dialogProps
174
174
  },
175
- className: classNames.join(className, block$18({
175
+ className: classNames.join(className, block$14({
176
176
  [`kind-${kind}`]: Boolean(kind)
177
177
  })),
178
178
  ...forwardedProps,
@@ -217,9 +217,9 @@ const AlertDialog = forwardRef((props, ref) => {
217
217
  })]
218
218
  });
219
219
  });
220
- AlertDialog.displayName = COMPONENT_NAME$1k;
221
- AlertDialog.className = CLASSNAME$1m;
222
- AlertDialog.defaultProps = DEFAULT_PROPS$16;
220
+ AlertDialog.displayName = COMPONENT_NAME$1l;
221
+ AlertDialog.className = CLASSNAME$1j;
222
+ AlertDialog.defaultProps = DEFAULT_PROPS$19;
223
223
 
224
224
  /**
225
225
  * Hook focusing an element when defined and `focus` boolean `true`.
@@ -311,17 +311,17 @@ function useDisableStateProps(props) {
311
311
  /**
312
312
  * Component display name.
313
313
  */
314
- const COMPONENT_NAME$1j = 'Autocomplete';
314
+ const COMPONENT_NAME$1k = 'Autocomplete';
315
315
 
316
316
  /**
317
317
  * Component default class name and class prefix.
318
318
  */
319
- const CLASSNAME$1l = 'lumx-autocomplete';
319
+ const CLASSNAME$1i = 'lumx-autocomplete';
320
320
 
321
321
  /**
322
322
  * Component default props.
323
323
  */
324
- const DEFAULT_PROPS$15 = {
324
+ const DEFAULT_PROPS$18 = {
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$15.anchorToInput,
346
+ anchorToInput = DEFAULT_PROPS$18.anchorToInput,
347
347
  children,
348
348
  chips,
349
349
  className,
350
- closeOnClick = DEFAULT_PROPS$15.closeOnClick,
351
- closeOnClickAway = DEFAULT_PROPS$15.closeOnClickAway,
352
- closeOnEscape = DEFAULT_PROPS$15.closeOnEscape,
350
+ closeOnClick = DEFAULT_PROPS$18.closeOnClick,
351
+ closeOnClickAway = DEFAULT_PROPS$18.closeOnClickAway,
352
+ closeOnEscape = DEFAULT_PROPS$18.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$15.shouldFocusOnClose,
373
+ shouldFocusOnClose = DEFAULT_PROPS$18.shouldFocusOnClose,
374
374
  theme = defaultTheme,
375
375
  value,
376
376
  textFieldProps = {},
@@ -383,7 +383,7 @@ const Autocomplete = forwardRef((props, ref) => {
383
383
  return /*#__PURE__*/jsxs("div", {
384
384
  ref: ref,
385
385
  ...forwardedProps,
386
- className: classNames.join(className, CLASSNAME$1l),
386
+ className: classNames.join(className, CLASSNAME$1i),
387
387
  children: [/*#__PURE__*/jsx(TextField, {
388
388
  ...textFieldProps,
389
389
  chips: chips,
@@ -423,24 +423,24 @@ const Autocomplete = forwardRef((props, ref) => {
423
423
  })]
424
424
  });
425
425
  });
426
- Autocomplete.displayName = COMPONENT_NAME$1j;
427
- Autocomplete.className = CLASSNAME$1l;
428
- Autocomplete.defaultProps = DEFAULT_PROPS$15;
426
+ Autocomplete.displayName = COMPONENT_NAME$1k;
427
+ Autocomplete.className = CLASSNAME$1i;
428
+ Autocomplete.defaultProps = DEFAULT_PROPS$18;
429
429
 
430
430
  /**
431
431
  * Component display name.
432
432
  */
433
- const COMPONENT_NAME$1i = 'AutocompleteMultiple';
433
+ const COMPONENT_NAME$1j = 'AutocompleteMultiple';
434
434
 
435
435
  /**
436
436
  * Component default class name and class prefix.
437
437
  */
438
- const CLASSNAME$1k = 'lumx-autocomplete-multiple';
438
+ const CLASSNAME$1h = 'lumx-autocomplete-multiple';
439
439
 
440
440
  /**
441
441
  * Component default props.
442
442
  */
443
- const DEFAULT_PROPS$14 = {
443
+ const DEFAULT_PROPS$17 = {
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$14.closeOnClickAway,
484
- closeOnEscape = DEFAULT_PROPS$14.closeOnEscape,
483
+ closeOnClickAway = DEFAULT_PROPS$17.closeOnClickAway,
484
+ closeOnEscape = DEFAULT_PROPS$17.closeOnEscape,
485
485
  fitToAnchorWidth,
486
486
  hasError,
487
487
  helper,
@@ -503,19 +503,19 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
503
503
  onKeyDown,
504
504
  placeholder,
505
505
  placement,
506
- selectedChipRender = DEFAULT_PROPS$14.selectedChipRender,
506
+ selectedChipRender = DEFAULT_PROPS$17.selectedChipRender,
507
507
  shouldFocusOnClose,
508
508
  theme = defaultTheme,
509
509
  type,
510
510
  value,
511
- values = DEFAULT_PROPS$14.values,
511
+ values = DEFAULT_PROPS$17.values,
512
512
  ...forwardedProps
513
513
  } = otherProps;
514
514
  return /*#__PURE__*/jsx(Autocomplete, {
515
515
  ref: ref,
516
516
  ...forwardedProps,
517
517
  anchorToInput: anchorToInput,
518
- className: classNames.join(className, CLASSNAME$1k),
518
+ className: classNames.join(className, CLASSNAME$1h),
519
519
  name: name,
520
520
  value: value,
521
521
  onChange: onChange,
@@ -548,28 +548,28 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
548
548
  children: children
549
549
  });
550
550
  });
551
- AutocompleteMultiple.displayName = COMPONENT_NAME$1i;
552
- AutocompleteMultiple.className = CLASSNAME$1k;
553
- AutocompleteMultiple.defaultProps = DEFAULT_PROPS$14;
551
+ AutocompleteMultiple.displayName = COMPONENT_NAME$1j;
552
+ AutocompleteMultiple.className = CLASSNAME$1h;
553
+ AutocompleteMultiple.defaultProps = DEFAULT_PROPS$17;
554
554
 
555
555
  /**
556
556
  * Component display name.
557
557
  */
558
- const COMPONENT_NAME$1h = 'Avatar';
558
+ const COMPONENT_NAME$1i = 'Avatar';
559
559
 
560
560
  /**
561
561
  * Component default class name and class prefix.
562
562
  */
563
- const CLASSNAME$1j = 'lumx-avatar';
563
+ const CLASSNAME$1g = 'lumx-avatar';
564
564
  const {
565
- block: block$17,
566
- element: element$R
567
- } = classNames.bem(CLASSNAME$1j);
565
+ block: block$13,
566
+ element: element$N
567
+ } = classNames.bem(CLASSNAME$1g);
568
568
 
569
569
  /**
570
570
  * Component default props.
571
571
  */
572
- const DEFAULT_PROPS$13 = {
572
+ const DEFAULT_PROPS$16 = {
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$13.size,
595
+ size = DEFAULT_PROPS$16.size,
596
596
  theme = defaultTheme,
597
597
  thumbnailProps,
598
598
  ...forwardedProps
@@ -600,14 +600,14 @@ const Avatar = forwardRef((props, ref) => {
600
600
  return /*#__PURE__*/jsxs("div", {
601
601
  ref: ref,
602
602
  ...forwardedProps,
603
- className: classNames.join(className, block$17({
603
+ className: classNames.join(className, block$13({
604
604
  [`size-${size}`]: Boolean(size),
605
605
  [`theme-${theme}`]: Boolean(theme)
606
606
  })),
607
607
  children: [/*#__PURE__*/jsx(Thumbnail, {
608
608
  linkProps: linkProps,
609
609
  linkAs: linkAs,
610
- className: element$R('thumbnail'),
610
+ className: element$N('thumbnail'),
611
611
  onClick: onClick,
612
612
  onKeyPress: onKeyPress,
613
613
  ...thumbnailProps,
@@ -617,92 +617,17 @@ const Avatar = forwardRef((props, ref) => {
617
617
  alt: alt,
618
618
  theme: theme
619
619
  }), actions && /*#__PURE__*/jsx("div", {
620
- className: element$R('actions'),
620
+ className: element$N('actions'),
621
621
  children: actions
622
622
  }), badge && /*#__PURE__*/jsx("div", {
623
- className: element$R('badge'),
624
- children: badge
625
- })]
626
- });
627
- });
628
- Avatar.displayName = COMPONENT_NAME$1h;
629
- Avatar.className = CLASSNAME$1j;
630
- Avatar.defaultProps = DEFAULT_PROPS$13;
631
-
632
- /**
633
- * Component display name.
634
- */
635
- const COMPONENT_NAME$1g = 'Badge';
636
-
637
- /**
638
- * Component default class name and class prefix.
639
- */
640
- const CLASSNAME$1i = 'lumx-badge';
641
- const {
642
- block: block$16
643
- } = classNames.bem(CLASSNAME$1i);
644
-
645
- /**
646
- * Component default props.
647
- */
648
- const DEFAULT_PROPS$12 = {
649
- color: ColorPalette$1.primary
650
- };
651
-
652
- /**
653
- * Badge component.
654
- *
655
- * @param props Component props.
656
- * @param ref Component ref.
657
- * @return React element.
658
- */
659
- const Badge = forwardRef((props, ref) => {
660
- const {
661
- children,
662
- className,
663
- color = DEFAULT_PROPS$12.color,
664
- ...forwardedProps
665
- } = props;
666
- return /*#__PURE__*/jsx("div", {
667
- ref: ref,
668
- ...forwardedProps,
669
- className: classNames.join(className, block$16({
670
- [`color-${color}`]: Boolean(color)
671
- })),
672
- children: children
673
- });
674
- });
675
- Badge.displayName = COMPONENT_NAME$1g;
676
- Badge.className = CLASSNAME$1i;
677
- Badge.defaultProps = DEFAULT_PROPS$12;
678
-
679
- /**
680
- * Component default class name and class prefix.
681
- */
682
- const CLASSNAME$1h = 'lumx-badge-wrapper';
683
- const {
684
- block: block$15,
685
- element: element$Q
686
- } = classNames.bem(CLASSNAME$1h);
687
- const BadgeWrapper = forwardRef((props, ref) => {
688
- const {
689
- badge,
690
- children,
691
- className,
692
- ...forwardedProps
693
- } = props;
694
- return /*#__PURE__*/jsxs("div", {
695
- ref: ref,
696
- ...forwardedProps,
697
- className: classNames.join(className, block$15()),
698
- children: [children, badge && /*#__PURE__*/jsx("div", {
699
- className: element$Q('badge'),
623
+ className: element$N('badge'),
700
624
  children: badge
701
625
  })]
702
626
  });
703
627
  });
704
- BadgeWrapper.displayName = 'BadgeWrapper';
705
- BadgeWrapper.className = CLASSNAME$1h;
628
+ Avatar.displayName = COMPONENT_NAME$1i;
629
+ Avatar.className = CLASSNAME$1g;
630
+ Avatar.defaultProps = DEFAULT_PROPS$16;
706
631
 
707
632
  /**
708
633
  * Alignments.
@@ -764,6 +689,8 @@ const ColorPalette = {
764
689
  red: 'red',
765
690
  light: 'light'};
766
691
 
692
+ /** ColorPalette with all possible color variant combination */
693
+
767
694
  function getDefaultExportFromCjs (x) {
768
695
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
769
696
  }
@@ -924,7 +851,7 @@ function modifier$1(baseName, modifiers) {
924
851
  * block('button', { active: true, disabled: false }); // 'button button--active'
925
852
  */
926
853
 
927
- function block$14(baseName, modifiersOrAdditionalClasses, additionalClasses) {
854
+ function block$12(baseName, modifiersOrAdditionalClasses, additionalClasses) {
928
855
  let modifiers;
929
856
  let classes;
930
857
  if (Array.isArray(modifiersOrAdditionalClasses)) {
@@ -959,11 +886,11 @@ function block$14(baseName, modifiersOrAdditionalClasses, additionalClasses) {
959
886
  * element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
960
887
  */
961
888
 
962
- function element$P(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
889
+ function element$M(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
963
890
  if (Array.isArray(modifiersOrAdditionalClasses)) {
964
- return block$14(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
891
+ return block$12(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
965
892
  }
966
- return block$14(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
893
+ return block$12(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
967
894
  }
968
895
 
969
896
  /**
@@ -972,15 +899,15 @@ function element$P(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
972
899
  function bem(baseName) {
973
900
  function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
974
901
  if (Array.isArray(modifiersOrAdditionalClasses)) {
975
- return block$14(baseName, modifiersOrAdditionalClasses);
902
+ return block$12(baseName, modifiersOrAdditionalClasses);
976
903
  }
977
- return block$14(baseName, modifiersOrAdditionalClasses, additionalClasses);
904
+ return block$12(baseName, modifiersOrAdditionalClasses, additionalClasses);
978
905
  }
979
906
  function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
980
907
  if (Array.isArray(modifiersOrAdditionalClasses)) {
981
- return element$P(baseName, elem, modifiersOrAdditionalClasses);
908
+ return element$M(baseName, elem, modifiersOrAdditionalClasses);
982
909
  }
983
- return element$P(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
910
+ return element$M(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
984
911
  }
985
912
  return {
986
913
  block: blockFn,
@@ -989,6 +916,108 @@ function bem(baseName) {
989
916
  };
990
917
  }
991
918
 
919
+ /**
920
+ * Component display name.
921
+ */
922
+ const COMPONENT_NAME$1h = 'Badge';
923
+
924
+ /**
925
+ * Component default class name and class prefix.
926
+ */
927
+ const CLASSNAME$1f = 'lumx-badge';
928
+ const {
929
+ block: block$11
930
+ } = bem(CLASSNAME$1f);
931
+
932
+ /**
933
+ * Component default props.
934
+ */
935
+ const DEFAULT_PROPS$15 = {
936
+ color: ColorPalette.primary
937
+ };
938
+
939
+ /**
940
+ * Badge component.
941
+ *
942
+ * @param props Component props.
943
+ * @return JSX element.
944
+ */
945
+ const Badge$1 = props => {
946
+ const {
947
+ children,
948
+ className,
949
+ color = DEFAULT_PROPS$15.color,
950
+ ref,
951
+ ...forwardedProps
952
+ } = props;
953
+ return /*#__PURE__*/jsx("div", {
954
+ ref: ref,
955
+ ...forwardedProps,
956
+ className: classnames(className, block$11({
957
+ [`color-${color}`]: Boolean(color)
958
+ })),
959
+ children: children
960
+ });
961
+ };
962
+ Badge$1.displayName = COMPONENT_NAME$1h;
963
+ Badge$1.className = CLASSNAME$1f;
964
+ Badge$1.defaultProps = DEFAULT_PROPS$15;
965
+
966
+ /**
967
+ * Defines the props of the component.
968
+ */
969
+
970
+ /**
971
+ * Badge component.
972
+ *
973
+ * @param props Component props.
974
+ * @param ref Component ref.
975
+ * @return React element.
976
+ */
977
+ const Badge = forwardRef((props, ref) => {
978
+ return Badge$1({
979
+ ...props,
980
+ ref
981
+ });
982
+ });
983
+ Badge.displayName = Badge$1.displayName;
984
+ Badge.className = Badge$1.className;
985
+ Badge.defaultProps = Badge$1.defaultProps;
986
+
987
+ const COMPONENT_NAME$1g = 'BadgeWrapper';
988
+ const CLASSNAME$1e = 'lumx-badge-wrapper';
989
+ const {
990
+ block: block$10,
991
+ element: element$L
992
+ } = bem(CLASSNAME$1e);
993
+ const BadgeWrapper$1 = props => {
994
+ const {
995
+ badge,
996
+ children,
997
+ className,
998
+ ref,
999
+ ...forwardedProps
1000
+ } = props;
1001
+ return /*#__PURE__*/jsxs("div", {
1002
+ ref: ref,
1003
+ ...forwardedProps,
1004
+ className: classnames(className, block$10()),
1005
+ children: [children, badge && /*#__PURE__*/jsx("div", {
1006
+ className: element$L('badge'),
1007
+ children: badge
1008
+ })]
1009
+ });
1010
+ };
1011
+
1012
+ const BadgeWrapper = forwardRef((props, ref) => {
1013
+ return BadgeWrapper$1({
1014
+ ...props,
1015
+ ref
1016
+ });
1017
+ });
1018
+ BadgeWrapper.displayName = COMPONENT_NAME$1g;
1019
+ BadgeWrapper.className = CLASSNAME$1e;
1020
+
992
1021
  /**
993
1022
  * Render clickable element (link, button or custom element)
994
1023
  * (also does some basic disabled state handling)
@@ -1148,15 +1177,15 @@ const COMPONENT_NAME$1e = 'Button';
1148
1177
  /**
1149
1178
  * Component default class name and class prefix.
1150
1179
  */
1151
- const CLASSNAME$1g = 'lumx-button';
1180
+ const CLASSNAME$1d = 'lumx-button';
1152
1181
  const {
1153
1182
  modifier
1154
- } = bem(CLASSNAME$1g);
1183
+ } = bem(CLASSNAME$1d);
1155
1184
 
1156
1185
  /**
1157
1186
  * Component default props.
1158
1187
  */
1159
- const DEFAULT_PROPS$11 = {
1188
+ const DEFAULT_PROPS$14 = {
1160
1189
  emphasis: Emphasis.high,
1161
1190
  size: Size.m
1162
1191
  };
@@ -1170,10 +1199,10 @@ const DEFAULT_PROPS$11 = {
1170
1199
  const Button$1 = props => {
1171
1200
  const {
1172
1201
  className,
1173
- emphasis = DEFAULT_PROPS$11.emphasis,
1202
+ emphasis = DEFAULT_PROPS$14.emphasis,
1174
1203
  leftIcon,
1175
1204
  rightIcon,
1176
- size = DEFAULT_PROPS$11.size,
1205
+ size = DEFAULT_PROPS$14.size,
1177
1206
  ...forwardedProps
1178
1207
  } = props;
1179
1208
  const buttonClassName = classnames(className, modifier({
@@ -1189,8 +1218,8 @@ const Button$1 = props => {
1189
1218
  });
1190
1219
  };
1191
1220
  Button$1.displayName = COMPONENT_NAME$1e;
1192
- Button$1.className = CLASSNAME$1g;
1193
- Button$1.defaultProps = DEFAULT_PROPS$11;
1221
+ Button$1.className = CLASSNAME$1d;
1222
+ Button$1.defaultProps = DEFAULT_PROPS$14;
1194
1223
 
1195
1224
  /**
1196
1225
  * Properties of a component to use to determine it's name.
@@ -1257,8 +1286,8 @@ const Button = forwardRef((props, ref) => {
1257
1286
  });
1258
1287
  });
1259
1288
  Button.displayName = COMPONENT_NAME$1e;
1260
- Button.className = CLASSNAME$1g;
1261
- Button.defaultProps = DEFAULT_PROPS$11;
1289
+ Button.className = CLASSNAME$1d;
1290
+ Button.defaultProps = DEFAULT_PROPS$14;
1262
1291
 
1263
1292
  const COMPONENT_NAME$1d = 'Icon';
1264
1293
  const IconClassName = 'lumx-icon';
@@ -1267,15 +1296,15 @@ const IconClassName = 'lumx-icon';
1267
1296
  * Defines the props of the component.
1268
1297
  */
1269
1298
 
1270
- const CLASSNAME$1f = IconClassName;
1299
+ const CLASSNAME$1c = IconClassName;
1271
1300
  const {
1272
- block: block$13
1273
- } = bem(CLASSNAME$1f);
1301
+ block: block$$
1302
+ } = bem(CLASSNAME$1c);
1274
1303
 
1275
1304
  /**
1276
1305
  * Component default props.
1277
1306
  */
1278
- const DEFAULT_PROPS$10 = {};
1307
+ const DEFAULT_PROPS$13 = {};
1279
1308
 
1280
1309
  /**
1281
1310
  * Icon component.
@@ -1324,7 +1353,7 @@ const Icon$1 = props => {
1324
1353
  return /*#__PURE__*/jsx("i", {
1325
1354
  ref: ref,
1326
1355
  ...forwardedProps,
1327
- className: classnames(className, block$13({
1356
+ className: classnames(className, block$$({
1328
1357
  [`color-${iconColor}`]: Boolean(iconColor),
1329
1358
  [`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
1330
1359
  'has-shape': hasShape,
@@ -1354,8 +1383,8 @@ const Icon$1 = props => {
1354
1383
  });
1355
1384
  };
1356
1385
  Icon$1.displayName = COMPONENT_NAME$1d;
1357
- Icon$1.className = CLASSNAME$1f;
1358
- Icon$1.defaultProps = DEFAULT_PROPS$10;
1386
+ Icon$1.className = CLASSNAME$1c;
1387
+ Icon$1.defaultProps = DEFAULT_PROPS$13;
1359
1388
 
1360
1389
  /**
1361
1390
  * Component display name.
@@ -1365,12 +1394,12 @@ const COMPONENT_NAME$1c = 'IconButton';
1365
1394
  /**
1366
1395
  * Component default class name and class prefix.
1367
1396
  */
1368
- const CLASSNAME$1e = 'lumx-icon-button';
1397
+ const CLASSNAME$1b = 'lumx-icon-button';
1369
1398
 
1370
1399
  /**
1371
1400
  * Component default props.
1372
1401
  */
1373
- const DEFAULT_PROPS$$ = {
1402
+ const DEFAULT_PROPS$12 = {
1374
1403
  emphasis: Emphasis.high,
1375
1404
  size: Size.m
1376
1405
  };
@@ -1383,11 +1412,11 @@ const DEFAULT_PROPS$$ = {
1383
1412
  */
1384
1413
  const IconButton$1 = props => {
1385
1414
  const {
1386
- emphasis = DEFAULT_PROPS$$.emphasis,
1415
+ emphasis = DEFAULT_PROPS$12.emphasis,
1387
1416
  image,
1388
1417
  icon,
1389
1418
  label,
1390
- size = DEFAULT_PROPS$$.size,
1419
+ size = DEFAULT_PROPS$12.size,
1391
1420
  ...forwardedProps
1392
1421
  } = props;
1393
1422
  const defaultChildren = image ? /*#__PURE__*/jsx("img", {
@@ -1407,8 +1436,8 @@ const IconButton$1 = props => {
1407
1436
  });
1408
1437
  };
1409
1438
  IconButton$1.displayName = COMPONENT_NAME$1c;
1410
- IconButton$1.className = CLASSNAME$1e;
1411
- IconButton$1.defaultProps = DEFAULT_PROPS$$;
1439
+ IconButton$1.className = CLASSNAME$1b;
1440
+ IconButton$1.defaultProps = DEFAULT_PROPS$12;
1412
1441
 
1413
1442
  /**
1414
1443
  * IconButton component.
@@ -1444,8 +1473,8 @@ const IconButton = forwardRef((props, ref) => {
1444
1473
  });
1445
1474
  });
1446
1475
  IconButton.displayName = COMPONENT_NAME$1c;
1447
- IconButton.className = CLASSNAME$1e;
1448
- IconButton.defaultProps = DEFAULT_PROPS$$;
1476
+ IconButton.className = CLASSNAME$1b;
1477
+ IconButton.defaultProps = DEFAULT_PROPS$12;
1449
1478
 
1450
1479
  /**
1451
1480
  * Component display name.
@@ -1455,12 +1484,12 @@ const COMPONENT_NAME$1b = 'ButtonGroup';
1455
1484
  /**
1456
1485
  * Component default class name and class prefix.
1457
1486
  */
1458
- const CLASSNAME$1d = 'lumx-button-group';
1487
+ const CLASSNAME$1a = 'lumx-button-group';
1459
1488
 
1460
1489
  /**
1461
1490
  * Component default props.
1462
1491
  */
1463
- const DEFAULT_PROPS$_ = {};
1492
+ const DEFAULT_PROPS$11 = {};
1464
1493
 
1465
1494
  /**
1466
1495
  * ButtonGroup component.
@@ -1476,13 +1505,13 @@ const ButtonGroup$1 = props => {
1476
1505
  } = props;
1477
1506
  return /*#__PURE__*/jsx("div", {
1478
1507
  ...forwardedProps,
1479
- className: classnames(className, CLASSNAME$1d),
1508
+ className: classnames(className, CLASSNAME$1a),
1480
1509
  children: children
1481
1510
  });
1482
1511
  };
1483
1512
  ButtonGroup$1.displayName = COMPONENT_NAME$1b;
1484
- ButtonGroup$1.className = CLASSNAME$1d;
1485
- ButtonGroup$1.defaultProps = DEFAULT_PROPS$_;
1513
+ ButtonGroup$1.className = CLASSNAME$1a;
1514
+ ButtonGroup$1.defaultProps = DEFAULT_PROPS$11;
1486
1515
 
1487
1516
  /**
1488
1517
  * ButtonGroup component.
@@ -1498,16 +1527,16 @@ const ButtonGroup = forwardRef((props, ref) => {
1498
1527
  });
1499
1528
  });
1500
1529
  ButtonGroup.displayName = COMPONENT_NAME$1b;
1501
- ButtonGroup.className = CLASSNAME$1d;
1502
- ButtonGroup.defaultProps = DEFAULT_PROPS$_;
1530
+ ButtonGroup.className = CLASSNAME$1a;
1531
+ ButtonGroup.defaultProps = DEFAULT_PROPS$11;
1503
1532
 
1504
1533
  const COMPONENT_NAME$1a = 'InputLabel';
1505
1534
  const InputLabelClassName = 'lumx-input-label';
1506
- const CLASSNAME$1c = InputLabelClassName;
1535
+ const CLASSNAME$19 = InputLabelClassName;
1507
1536
  const {
1508
- block: block$12
1509
- } = bem(CLASSNAME$1c);
1510
- const DEFAULT_PROPS$Z = {};
1537
+ block: block$_
1538
+ } = bem(CLASSNAME$19);
1539
+ const DEFAULT_PROPS$10 = {};
1511
1540
 
1512
1541
  /**
1513
1542
  * InputLabel component.
@@ -1527,7 +1556,7 @@ function InputLabel$1(props) {
1527
1556
  ref: ref,
1528
1557
  ...forwardedProps,
1529
1558
  htmlFor: htmlFor,
1530
- className: classnames(className, block$12({
1559
+ className: classnames(className, block$_({
1531
1560
  'is-required': isRequired,
1532
1561
  [`theme-${theme}`]: Boolean(theme),
1533
1562
  'has-custom-typography': Boolean(typography$1)
@@ -1536,8 +1565,8 @@ function InputLabel$1(props) {
1536
1565
  });
1537
1566
  }
1538
1567
  InputLabel$1.displayName = COMPONENT_NAME$1a;
1539
- InputLabel$1.className = CLASSNAME$1c;
1540
- InputLabel$1.defaultProps = DEFAULT_PROPS$Z;
1568
+ InputLabel$1.className = CLASSNAME$19;
1569
+ InputLabel$1.defaultProps = DEFAULT_PROPS$10;
1541
1570
 
1542
1571
  const INPUT_HELPER_CONFIGURATION = {
1543
1572
  [Kind.error]: {
@@ -1558,15 +1587,15 @@ const InputHelperClassName = 'lumx-input-helper';
1558
1587
  * Defines the props of the component.
1559
1588
  */
1560
1589
 
1561
- const CLASSNAME$1b = InputHelperClassName;
1590
+ const CLASSNAME$18 = InputHelperClassName;
1562
1591
  const {
1563
- block: block$11
1564
- } = bem(CLASSNAME$1b);
1592
+ block: block$Z
1593
+ } = bem(CLASSNAME$18);
1565
1594
 
1566
1595
  /**
1567
1596
  * Component default props.
1568
1597
  */
1569
- const DEFAULT_PROPS$Y = {
1598
+ const DEFAULT_PROPS$$ = {
1570
1599
  kind: Kind.info
1571
1600
  };
1572
1601
 
@@ -1577,7 +1606,7 @@ function InputHelper$1(props) {
1577
1606
  const {
1578
1607
  children,
1579
1608
  className,
1580
- kind = DEFAULT_PROPS$Y.kind,
1609
+ kind = DEFAULT_PROPS$$.kind,
1581
1610
  theme,
1582
1611
  ref,
1583
1612
  ...forwardedProps
@@ -1588,7 +1617,7 @@ function InputHelper$1(props) {
1588
1617
  return /*#__PURE__*/jsx("p", {
1589
1618
  ref: ref,
1590
1619
  ...forwardedProps,
1591
- className: classnames(className, block$11({
1620
+ className: classnames(className, block$Z({
1592
1621
  [`color-${color}`]: Boolean(color),
1593
1622
  [`theme-${theme}`]: Boolean(theme)
1594
1623
  })),
@@ -1596,8 +1625,8 @@ function InputHelper$1(props) {
1596
1625
  });
1597
1626
  }
1598
1627
  InputHelper$1.displayName = COMPONENT_NAME$19;
1599
- InputHelper$1.className = CLASSNAME$1b;
1600
- InputHelper$1.defaultProps = DEFAULT_PROPS$Y;
1628
+ InputHelper$1.className = CLASSNAME$18;
1629
+ InputHelper$1.defaultProps = DEFAULT_PROPS$$;
1601
1630
 
1602
1631
  const INTERMEDIATE_STATE = 'intermediate';
1603
1632
 
@@ -1613,11 +1642,11 @@ const COMPONENT_NAME$18 = 'Checkbox';
1613
1642
  /**
1614
1643
  * Component default class name and class prefix.
1615
1644
  */
1616
- const CLASSNAME$1a = 'lumx-checkbox';
1645
+ const CLASSNAME$17 = 'lumx-checkbox';
1617
1646
  const {
1618
- block: block$10,
1619
- element: element$O
1620
- } = bem(CLASSNAME$1a);
1647
+ block: block$Y,
1648
+ element: element$K
1649
+ } = bem(CLASSNAME$17);
1621
1650
 
1622
1651
  /**
1623
1652
  * Checkbox component.
@@ -1653,7 +1682,7 @@ const Checkbox$1 = props => {
1653
1682
  return /*#__PURE__*/jsxs("div", {
1654
1683
  ref: ref,
1655
1684
  ...forwardedProps,
1656
- className: classnames(className, block$10({
1685
+ className: classnames(className, block$Y({
1657
1686
  // Whether state is intermediate class name will "-checked"
1658
1687
  'is-checked': intermediateState ? true : isChecked,
1659
1688
  'is-disabled': isDisabled,
@@ -1661,12 +1690,12 @@ const Checkbox$1 = props => {
1661
1690
  [`theme-${theme}`]: Boolean(theme)
1662
1691
  })),
1663
1692
  children: [/*#__PURE__*/jsxs("div", {
1664
- className: element$O('input-wrapper'),
1693
+ className: element$K('input-wrapper'),
1665
1694
  children: [/*#__PURE__*/jsx("input", {
1666
1695
  ref: inputRef,
1667
1696
  type: "checkbox",
1668
1697
  id: inputId,
1669
- className: element$O('input-native'),
1698
+ className: element$K('input-native'),
1670
1699
  name: name,
1671
1700
  value: value,
1672
1701
  checked: isChecked,
@@ -1678,26 +1707,26 @@ const Checkbox$1 = props => {
1678
1707
  } : {}),
1679
1708
  ...inputProps
1680
1709
  }), /*#__PURE__*/jsxs("div", {
1681
- className: element$O('input-placeholder'),
1710
+ className: element$K('input-placeholder'),
1682
1711
  children: [/*#__PURE__*/jsx("div", {
1683
- className: element$O('input-background')
1712
+ className: element$K('input-background')
1684
1713
  }), /*#__PURE__*/jsx("div", {
1685
- className: element$O('input-indicator'),
1714
+ className: element$K('input-indicator'),
1686
1715
  children: Icon$1({
1687
1716
  icon: intermediateState ? mdiMinus : mdiCheck
1688
1717
  })
1689
1718
  })]
1690
1719
  })]
1691
1720
  }), /*#__PURE__*/jsxs("div", {
1692
- className: element$O('content'),
1721
+ className: element$K('content'),
1693
1722
  children: [label && InputLabel$1({
1694
1723
  htmlFor: inputId,
1695
- className: element$O('label'),
1724
+ className: element$K('label'),
1696
1725
  theme,
1697
1726
  children: label
1698
1727
  }), helper && InputHelper$1({
1699
1728
  id: `${inputId}-helper`,
1700
- className: element$O('helper'),
1729
+ className: element$K('helper'),
1701
1730
  theme,
1702
1731
  children: helper
1703
1732
  })]
@@ -1712,7 +1741,7 @@ const Checkbox$1 = props => {
1712
1741
  /**
1713
1742
  * Component default props.
1714
1743
  */
1715
- const DEFAULT_PROPS$X = {};
1744
+ const DEFAULT_PROPS$_ = {};
1716
1745
 
1717
1746
  /**
1718
1747
  * Checkbox component.
@@ -1773,8 +1802,8 @@ const Checkbox = forwardRef((props, ref) => {
1773
1802
  });
1774
1803
  });
1775
1804
  Checkbox.displayName = COMPONENT_NAME$18;
1776
- Checkbox.className = CLASSNAME$1a;
1777
- Checkbox.defaultProps = DEFAULT_PROPS$X;
1805
+ Checkbox.className = CLASSNAME$17;
1806
+ Checkbox.defaultProps = DEFAULT_PROPS$_;
1778
1807
 
1779
1808
  /**
1780
1809
  * Wrap mouse event handler to stop event propagation.
@@ -1800,16 +1829,16 @@ const COMPONENT_NAME$17 = 'Chip';
1800
1829
  /**
1801
1830
  * Component default class name and class prefix.
1802
1831
  */
1803
- const CLASSNAME$19 = 'lumx-chip';
1832
+ const CLASSNAME$16 = 'lumx-chip';
1804
1833
  const {
1805
- block: block$$,
1806
- element: element$N
1807
- } = classNames.bem(CLASSNAME$19);
1834
+ block: block$X,
1835
+ element: element$J
1836
+ } = classNames.bem(CLASSNAME$16);
1808
1837
 
1809
1838
  /**
1810
1839
  * Component default props.
1811
1840
  */
1812
- const DEFAULT_PROPS$W = {
1841
+ const DEFAULT_PROPS$Z = {
1813
1842
  size: Size$1.m
1814
1843
  };
1815
1844
 
@@ -1839,7 +1868,7 @@ const Chip = forwardRef((props, ref) => {
1839
1868
  onAfterClick,
1840
1869
  onBeforeClick,
1841
1870
  onClick,
1842
- size = DEFAULT_PROPS$W.size,
1871
+ size = DEFAULT_PROPS$Z.size,
1843
1872
  theme = defaultTheme,
1844
1873
  href,
1845
1874
  onKeyDown,
@@ -1870,7 +1899,7 @@ const Chip = forwardRef((props, ref) => {
1870
1899
  ...forwardedProps,
1871
1900
  href: !disabledStateProps.disabled ? href : undefined,
1872
1901
  ref: ref,
1873
- className: classNames.join(className, block$$({
1902
+ className: classNames.join(className, block$X({
1874
1903
  'is-clickable': isClickable,
1875
1904
  [`color-${chipColor}`]: Boolean(chipColor),
1876
1905
  'is-disabled': isAnyDisabled,
@@ -1888,19 +1917,19 @@ const Chip = forwardRef((props, ref) => {
1888
1917
  /*#__PURE__*/
1889
1918
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
1890
1919
  jsx("div", {
1891
- className: element$N('before', {
1920
+ className: element$J('before', {
1892
1921
  'is-clickable': hasBeforeClick
1893
1922
  }),
1894
1923
  onClick: handleOnBeforeClick,
1895
1924
  children: before
1896
1925
  }), /*#__PURE__*/jsx("div", {
1897
- className: element$N('label'),
1926
+ className: element$J('label'),
1898
1927
  children: children
1899
1928
  }), after &&
1900
1929
  /*#__PURE__*/
1901
1930
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
1902
1931
  jsx("div", {
1903
- className: element$N('after', {
1932
+ className: element$J('after', {
1904
1933
  'is-clickable': hasAfterClick
1905
1934
  }),
1906
1935
  onClick: handleOnAfterClick,
@@ -1910,8 +1939,8 @@ const Chip = forwardRef((props, ref) => {
1910
1939
  );
1911
1940
  });
1912
1941
  Chip.displayName = COMPONENT_NAME$17;
1913
- Chip.className = CLASSNAME$19;
1914
- Chip.defaultProps = DEFAULT_PROPS$W;
1942
+ Chip.className = CLASSNAME$16;
1943
+ Chip.defaultProps = DEFAULT_PROPS$Z;
1915
1944
 
1916
1945
  const INITIAL_STATE_ACTIVE_CHIP = -1;
1917
1946
 
@@ -1967,7 +1996,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
1967
1996
  /**
1968
1997
  * Component default props.
1969
1998
  */
1970
- const DEFAULT_PROPS$V = {};
1999
+ const DEFAULT_PROPS$Y = {};
1971
2000
 
1972
2001
  /**
1973
2002
  * Component display name.
@@ -1977,7 +2006,7 @@ const COMPONENT_NAME$16 = 'ChipGroup';
1977
2006
  /**
1978
2007
  * Component default class name and class prefix.
1979
2008
  */
1980
- const CLASSNAME$18 = 'lumx-chip-group';
2009
+ const CLASSNAME$15 = 'lumx-chip-group';
1981
2010
 
1982
2011
  /**
1983
2012
  * ChipGroup component.
@@ -1996,13 +2025,13 @@ const InternalChipGroup = forwardRef((props, ref) => {
1996
2025
  return /*#__PURE__*/jsx("div", {
1997
2026
  ref: ref,
1998
2027
  ...forwardedProps,
1999
- className: classNames.join(className, CLASSNAME$18),
2028
+ className: classNames.join(className, CLASSNAME$15),
2000
2029
  children: children
2001
2030
  });
2002
2031
  });
2003
2032
  InternalChipGroup.displayName = COMPONENT_NAME$16;
2004
- InternalChipGroup.className = CLASSNAME$18;
2005
- InternalChipGroup.defaultProps = DEFAULT_PROPS$V;
2033
+ InternalChipGroup.className = CLASSNAME$15;
2034
+ InternalChipGroup.defaultProps = DEFAULT_PROPS$Y;
2006
2035
  const ChipGroup = Object.assign(InternalChipGroup, {
2007
2036
  useChipGroupNavigation
2008
2037
  });
@@ -2092,11 +2121,11 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
2092
2121
  /**
2093
2122
  * Component default class name and class prefix.
2094
2123
  */
2095
- const CLASSNAME$17 = 'lumx-selection-chip-group';
2124
+ const CLASSNAME$14 = 'lumx-selection-chip-group';
2096
2125
  const {
2097
- block: block$_,
2098
- element: element$M
2099
- } = classNames.bem(CLASSNAME$17);
2126
+ block: block$W,
2127
+ element: element$I
2128
+ } = classNames.bem(CLASSNAME$14);
2100
2129
 
2101
2130
  /**
2102
2131
  * SelectionChipGroup component.
@@ -2126,7 +2155,7 @@ const SelectionChipGroup = ({
2126
2155
  return /*#__PURE__*/jsx(ChipGroup, {
2127
2156
  role: "group",
2128
2157
  "aria-label": label,
2129
- className: block$_(),
2158
+ className: block$W(),
2130
2159
  ...forwardedProps,
2131
2160
  children: value?.map((v, index) => {
2132
2161
  const name = getWithSelector(getOptionName, v);
@@ -2170,7 +2199,7 @@ const SelectionChipGroup = ({
2170
2199
  after: /*#__PURE__*/jsx(Icon, {
2171
2200
  icon: mdiClose
2172
2201
  }),
2173
- className: element$M('chip', [props?.className]),
2202
+ className: element$I('chip', [props?.className]),
2174
2203
  size: "s",
2175
2204
  ref: ref,
2176
2205
  onClick: onClick,
@@ -2185,1569 +2214,48 @@ const SelectionChipGroup = ({
2185
2214
  });
2186
2215
  };
2187
2216
 
2188
- /** Context to store the refs of the combobox elements */
2189
- const ComboboxRefsContext = /*#__PURE__*/createContext({
2190
- triggerRef: {
2191
- current: null
2192
- },
2193
- anchorRef: {
2194
- current: null
2195
- }
2196
- });
2197
- /** Provider to store the required refs for the Combobox */
2198
- const ComboboxRefsProvider = ({
2199
- triggerRef,
2200
- anchorRef,
2201
- children
2202
- }) => {
2203
- const value = useMemo(() => ({
2204
- triggerRef,
2205
- anchorRef
2206
- }), [triggerRef, anchorRef]);
2207
- return /*#__PURE__*/jsx(ComboboxRefsContext.Provider, {
2208
- value: value,
2209
- children: children
2210
- });
2211
- };
2212
-
2213
- /** Retrieves the combobox elements references from context */
2214
- const useComboboxRefs = () => {
2215
- const refs = useContext(ComboboxRefsContext);
2216
- if (!refs) {
2217
- throw new Error('The useComboboxRefs hook must be called within a ComboboxRefsProvider');
2218
- }
2219
- return refs;
2220
- };
2221
-
2222
- /** Generate the combobox option id from the combobox id and the given id */
2223
- const generateOptionId = (comboboxId, optionId) => `${comboboxId}-option-${optionId}`;
2224
-
2225
- /** Verifies that the combobox registered option is an action */
2226
- const isComboboxAction = option => Boolean(option?.isAction);
2227
-
2228
- /** Verifies that the combobox registered option is the option's value */
2229
- const isComboboxValue = option => {
2230
- return !isComboboxAction(option);
2217
+ /**
2218
+ * Comment block variants.
2219
+ */
2220
+ const CommentBlockVariant = {
2221
+ indented: 'indented',
2222
+ linear: 'linear'
2231
2223
  };
2232
2224
 
2233
- const comboboxId = `combobox-${uniqueId()}`;
2234
- const initialState = {
2235
- comboboxId,
2236
- listboxId: `${comboboxId}-popover`,
2237
- status: 'idle',
2238
- isOpen: false,
2239
- inputValue: '',
2240
- showAll: true,
2241
- options: {},
2242
- type: 'listbox',
2243
- optionsLength: 0
2244
- };
2225
+ /**
2226
+ * Defines the props of the component.
2227
+ */
2245
2228
 
2246
- /** Actions when the combobox opens. */
2247
- const OPEN_COMBOBOX = (state, action) => {
2248
- const {
2249
- manual
2250
- } = action.payload || {};
2251
- // If the combobox was manually opened, show all suggestions
2252
- return {
2253
- ...state,
2254
- showAll: Boolean(manual),
2255
- isOpen: true
2256
- };
2257
- };
2229
+ /**
2230
+ * Component display name.
2231
+ */
2232
+ const COMPONENT_NAME$15 = 'CommentBlock';
2258
2233
 
2259
- /** Actions when the combobox closes */
2260
- const CLOSE_COMBOBOX = state => {
2261
- return {
2262
- ...state,
2263
- showAll: true,
2264
- isOpen: false
2265
- };
2266
- };
2234
+ /**
2235
+ * Component default class name and class prefix.
2236
+ */
2237
+ const CLASSNAME$13 = 'lumx-comment-block';
2238
+ const {
2239
+ block: block$V,
2240
+ element: element$H
2241
+ } = classNames.bem(CLASSNAME$13);
2267
2242
 
2268
- /** Actions on input update. */
2269
- const SET_INPUT_VALUE = (state, action) => {
2270
- return {
2271
- ...state,
2272
- inputValue: action.payload,
2273
- // When the user is changing the value, show only values that are related to the input value.
2274
- showAll: false,
2275
- isOpen: true
2276
- };
2243
+ /**
2244
+ * Component default props.
2245
+ */
2246
+ const DEFAULT_PROPS$X = {
2247
+ variant: CommentBlockVariant.indented
2277
2248
  };
2278
2249
 
2279
- /** Register an option to the state */
2280
- const ADD_OPTION = (state, action) => {
2281
- const {
2282
- id,
2283
- option
2284
- } = action.payload;
2285
- const {
2286
- options
2287
- } = state;
2288
- if (options[id]) {
2289
- // Option already exists, return state unchanged
2290
- return state;
2291
- }
2292
- const newOptions = {
2293
- ...options,
2294
- [id]: option
2295
- };
2296
- let newType = state.type;
2297
- if (isComboboxAction(option)) {
2298
- newType = 'grid';
2299
- }
2300
- let newOptionsLength = state.optionsLength;
2301
- if (isComboboxValue(option)) {
2302
- newOptionsLength += 1;
2303
- }
2304
- return {
2305
- ...state,
2306
- options: newOptions,
2307
- type: newType,
2308
- optionsLength: newOptionsLength
2309
- };
2310
- };
2311
-
2312
- /** Remove an option from the state */
2313
- const REMOVE_OPTION = (state, action) => {
2314
- const {
2315
- id
2316
- } = action.payload;
2317
- const {
2318
- options
2319
- } = state;
2320
- const option = options[id];
2321
- if (!options[id]) {
2322
- // Option doesn't exist, return state unchanged
2323
- return state;
2324
- }
2325
- const newOptions = {
2326
- ...options
2327
- };
2328
- delete newOptions[id];
2329
- let newOptionsLength = state.optionsLength;
2330
- if (isComboboxValue(option)) {
2331
- newOptionsLength -= 1;
2332
- }
2333
- return {
2334
- ...state,
2335
- options: newOptions,
2336
- optionsLength: newOptionsLength
2337
- };
2338
- };
2339
-
2340
- /** Reducers for each action type: */
2341
- const REDUCERS = {
2342
- OPEN_COMBOBOX,
2343
- CLOSE_COMBOBOX,
2344
- SET_INPUT_VALUE,
2345
- ADD_OPTION,
2346
- REMOVE_OPTION
2347
- };
2348
-
2349
- /** Main reducer */
2350
- const reducer$1 = (state, action) => {
2351
- return REDUCERS[action.type]?.(state, action) || state;
2352
- };
2353
-
2354
- /** Dispatch for the combobox component */
2355
-
2356
- /** Context for the Combobox component */
2357
- const ComboboxContext = /*#__PURE__*/React__default.createContext({
2358
- ...initialState,
2359
- openOnFocus: false,
2360
- openOnClick: false,
2361
- selectionType: 'single',
2362
- optionsLength: 0,
2363
- onSelect: noop,
2364
- onInputChange: noop,
2365
- onOpen: noop,
2366
- dispatch: noop,
2367
- translations: {
2368
- clearLabel: '',
2369
- tryReloadLabel: '',
2370
- showSuggestionsLabel: '',
2371
- noResultsForInputLabel: input => input || '',
2372
- loadingLabel: '',
2373
- serviceUnavailableLabel: '',
2374
- nbOptionsLabel: options => `${options}`
2375
- }
2376
- });
2377
-
2378
- /** Context for a combobox section to store its unique id */
2379
- const SectionContext = /*#__PURE__*/React__default.createContext({
2380
- sectionId: ''
2381
- });
2382
-
2383
- /** Retrieve the current combobox state and actions */
2384
- const useCombobox = () => {
2385
- const comboboxContext = React__default.useContext(ComboboxContext);
2386
- const {
2387
- dispatch: movingFocusDispatch
2388
- } = React__default.useContext(MovingFocusContext);
2389
- const {
2390
- onSelect,
2391
- onInputChange,
2392
- onOpen,
2393
- dispatch,
2394
- inputValue,
2395
- ...contextValues
2396
- } = comboboxContext;
2397
- const {
2398
- triggerRef
2399
- } = useComboboxRefs();
2400
-
2401
- /** Action triggered when the listBox is closed without selecting any option */
2402
- const handleClose = React__default.useCallback(() => {
2403
- dispatch({
2404
- type: 'CLOSE_COMBOBOX'
2405
- });
2406
- // Reset visual focus
2407
- movingFocusDispatch({
2408
- type: 'RESET_SELECTED_TAB_STOP'
2409
- });
2410
- }, [dispatch, movingFocusDispatch]);
2411
-
2412
- // Handle callbacks on options mounted
2413
- const [optionsMountedCallbacks, setOptionsMountedCallback] = React__default.useState();
2414
- React__default.useEffect(() => {
2415
- if (comboboxContext.optionsLength > 0 && optionsMountedCallbacks?.length) {
2416
- const optionsArray = Object.values(comboboxContext.options);
2417
- // Execute callbacks
2418
- for (const callback of optionsMountedCallbacks) {
2419
- callback(optionsArray);
2420
- }
2421
- setOptionsMountedCallback(undefined);
2422
- }
2423
- }, [comboboxContext.options, comboboxContext.optionsLength, optionsMountedCallbacks]);
2424
-
2425
- /** Callback for when an option is selected */
2426
- const handleSelected = React__default.useCallback((option, source) => {
2427
- if (option?.isDisabled) {
2428
- return;
2429
- }
2430
- if (isComboboxValue(option)) {
2431
- /**
2432
- * We only close the list if the selection type is single.
2433
- * If it is multiple, we want to allow the user to continue
2434
- * selecting multiple options.
2435
- */
2436
- if (comboboxContext.selectionType !== 'multiple') {
2437
- handleClose();
2438
- }
2439
- /** Call parent onSelect callback */
2440
- if (onSelect) {
2441
- onSelect(option);
2442
- }
2443
- }
2444
-
2445
- /** If the option itself has a custom action, also call it */
2446
- if (option?.onSelect) {
2447
- option.onSelect(option, source);
2448
- }
2449
-
2450
- /** Reset focus on input */
2451
- if (triggerRef?.current) {
2452
- triggerRef.current?.focus();
2453
- }
2454
- }, [comboboxContext.selectionType, handleClose, onSelect, triggerRef]);
2455
-
2456
- /** Callback for when the input must be updated */
2457
- const handleInputChange = React__default.useCallback((value, ...args) => {
2458
- // Update the local state
2459
- dispatch({
2460
- type: 'SET_INPUT_VALUE',
2461
- payload: value
2462
- });
2463
- // If a callback if given, call it with the value
2464
- if (onInputChange) {
2465
- onInputChange(value, ...args);
2466
- }
2467
- // Reset visual focus
2468
- movingFocusDispatch({
2469
- type: 'RESET_SELECTED_TAB_STOP'
2470
- });
2471
- }, [dispatch, movingFocusDispatch, onInputChange]);
2472
-
2473
- /**
2474
- * Open the popover
2475
- *
2476
- * @returns a promise with the updated context once all options are mounted
2477
- */
2478
- const handleOpen = React__default.useCallback(params => {
2479
- /** update the local state */
2480
- dispatch({
2481
- type: 'OPEN_COMBOBOX',
2482
- payload: params
2483
- });
2484
- /** If a parent callback was given, trigger it with state information */
2485
- if (onOpen) {
2486
- onOpen({
2487
- currentValue: inputValue,
2488
- manual: Boolean(params?.manual)
2489
- });
2490
- }
2491
-
2492
- // Promise resolving options on mount
2493
- return new Promise(resolve => {
2494
- // Append to the list of callback on options mounted
2495
- setOptionsMountedCallback((callbacks = []) => {
2496
- callbacks.push(resolve);
2497
- return callbacks;
2498
- });
2499
- });
2500
- }, [dispatch, inputValue, onOpen]);
2501
- return React__default.useMemo(() => ({
2502
- handleClose,
2503
- handleOpen,
2504
- handleInputChange,
2505
- handleSelected,
2506
- dispatch,
2507
- inputValue,
2508
- ...contextValues
2509
- }), [contextValues, dispatch, handleClose, handleInputChange, handleOpen, handleSelected, inputValue]);
2510
- };
2511
-
2512
- /**
2513
- * Provide props for the semantic and behaviors the combobox trigger.
2514
- *
2515
- *
2516
- */
2517
- function useComboboxTrigger({
2518
- context,
2519
- refs,
2520
- onBlur,
2521
- onFocus,
2522
- onKeyDown
2523
- }) {
2524
- const {
2525
- comboboxId,
2526
- listboxId,
2527
- isOpen,
2528
- options,
2529
- optionsLength,
2530
- selectedIds,
2531
- openOnFocus,
2532
- handleClose,
2533
- handleOpen,
2534
- handleSelected,
2535
- showEmptyState = false,
2536
- showErrorState = false,
2537
- status
2538
- } = context;
2539
- const highlightedId = useVirtualFocusParent(refs.triggerRef);
2540
- const {
2541
- dispatch: movingFocusDispatch
2542
- } = React__default.useContext(MovingFocusContext);
2543
- const isErrorStateDisplayed = showErrorState && isOpen && status === 'error';
2544
- const isEmptyStateDisplayed = showEmptyState && isOpen && status === 'idle' && optionsLength === 0;
2545
- const showPopover = isOpen && optionsLength > 0 || isEmptyStateDisplayed || isErrorStateDisplayed;
2546
-
2547
- /**
2548
- * A debounce close to use to leave time for the
2549
- * listbox to process things before closing.
2550
- * This can be useful when clicking an option to leave time for the
2551
- * event to be processed before closing the popover.
2552
- */
2553
- // eslint-disable-next-line react-hooks/exhaustive-deps
2554
- const debouncedClose = React__default.useCallback(debounce$1(handleClose, 200), []);
2555
-
2556
- /** Cleanup any ongoing cleanup */
2557
- React__default.useEffect(() => {
2558
- return () => {
2559
- if (debouncedClose?.cancel) {
2560
- debouncedClose.cancel();
2561
- }
2562
- };
2563
- }, [debouncedClose]);
2564
- const handleBlur = React__default.useCallback(event => {
2565
- debouncedClose();
2566
- if (onBlur) {
2567
- onBlur(event);
2568
- }
2569
- }, [debouncedClose, onBlur]);
2570
-
2571
- /** Actions triggered when the input field is focused */
2572
- const handleFocus = event => {
2573
- // If the field is refocused in the process of closing, cancel close
2574
- if (debouncedClose?.cancel) {
2575
- debouncedClose.cancel();
2576
- }
2577
- if (onFocus) {
2578
- onFocus(event);
2579
- }
2580
- /**
2581
- * Only set the open on focus if the combobox isn't already opened.
2582
- * This avoids the popover re-opening when an option is selected and the
2583
- * field is refocused
2584
- */
2585
- if (openOnFocus && !showPopover) {
2586
- handleOpen({
2587
- manual: true
2588
- });
2589
- }
2590
- };
2591
- const handleClick = () => {
2592
- handleOpen({
2593
- manual: true
2594
- });
2595
- };
2596
-
2597
- /**
2598
- * Keyboard shortcut management following the WAI APG pattern
2599
- * https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/#kbd_label
2600
- */
2601
- const handleKeyDown = React__default.useCallback(async event => {
2602
- const {
2603
- key,
2604
- altKey
2605
- } = event;
2606
-
2607
- /**
2608
- * On Enter key
2609
- * * Select option that is currently highlighted, if any
2610
- * * Close suggestions, event if none is highlighted
2611
- */
2612
- if (event.key === 'Enter') {
2613
- if (!showPopover) {
2614
- return;
2615
- }
2616
- if (highlightedId) {
2617
- // prevent any potential form submission
2618
- event.preventDefault();
2619
- const option = options[highlightedId];
2620
- handleSelected(option, 'keyboard');
2621
- } else {
2622
- handleClose();
2623
- }
2624
- return;
2625
- }
2626
-
2627
- /**
2628
- * On arrow up/down
2629
- * * If popover is already opened, do nothing
2630
- * * If alt key pressed, show the listbox without focusing an option
2631
- * * If arrow Up is pressed, select last option
2632
- * * If arrow Down is pressed, select first option
2633
- * */
2634
- if (key === 'ArrowDown' || key === 'ArrowUp') {
2635
- if (showPopover) {
2636
- return;
2637
- }
2638
-
2639
- /** Open the listbox */
2640
- const listBoxOptions = await handleOpen({
2641
- manual: true
2642
- });
2643
- if (!listBoxOptions) {
2644
- return;
2645
- }
2646
-
2647
- /**
2648
- * If alt key is pressed, only open without changing visual focus
2649
- * as per WAI Guidelines
2650
- */
2651
- if (!altKey) {
2652
- /** If a selected id is set, set it as current tabstop */
2653
- if (selectedIds?.length) {
2654
- movingFocusDispatch({
2655
- type: 'SELECT_TAB_STOP',
2656
- payload: {
2657
- id: selectedIds?.[0],
2658
- type: 'keyboard'
2659
- }
2660
- });
2661
- } else {
2662
- /** Focus either the first or last item depending on the keyboard arrow pressed */
2663
- movingFocusDispatch({
2664
- type: 'KEY_NAV',
2665
- payload: {
2666
- ctrlKey: false,
2667
- key: key === 'ArrowUp' ? 'End' : 'Home'
2668
- }
2669
- });
2670
- }
2671
- }
2672
- return;
2673
- }
2674
-
2675
- // Forward event
2676
- onKeyDown?.(event);
2677
- }, [onKeyDown, showPopover, highlightedId, options, handleSelected, handleClose, handleOpen, selectedIds, movingFocusDispatch]);
2678
- return {
2679
- id: comboboxId,
2680
- role: 'combobox',
2681
- 'aria-activedescendant': showPopover && highlightedId ? highlightedId : '',
2682
- 'aria-controls': listboxId,
2683
- 'aria-owns': listboxId,
2684
- 'aria-expanded': showPopover,
2685
- onFocus: handleFocus,
2686
- onBlur: handleBlur,
2687
- onClick: handleClick,
2688
- onKeyDown: handleKeyDown
2689
- };
2690
- }
2691
-
2692
- /** Is printable character key press */
2693
- const isTypeEvent = ({
2694
- key,
2695
- altKey,
2696
- ctrlKey,
2697
- metaKey
2698
- }) => key.length === 1 && key !== ' ' && !altKey && !ctrlKey && !metaKey;
2699
-
2700
- /**
2701
- * Provide props for the semantic and behaviors the combobox button trigger
2702
- *
2703
- * Overrides the useComboboxTrigger() props & behavior to add a jump to option
2704
- * on printable character key down.
2705
- */
2706
- function useComboboxButton(args) {
2707
- const {
2708
- context: {
2709
- handleOpen
2710
- },
2711
- onKeyDown: parentOnKeyDown
2712
- } = args;
2713
- const {
2714
- dispatch: movingFocusDispatch,
2715
- state: {
2716
- selectedId: highlightedId
2717
- }
2718
- } = React__default.useContext(MovingFocusContext);
2719
- const searchValueRef = React__default.useRef('');
2720
- const searchTimeoutRef = React__default.useRef();
2721
- const onKeyDown = React__default.useMemo(() => {
2722
- function clearSearchTimeout() {
2723
- const searchTimeout = searchTimeoutRef.current;
2724
- if (!searchTimeout) {
2725
- return;
2726
- }
2727
- clearTimeout(searchTimeout);
2728
- searchTimeoutRef.current = undefined;
2729
- }
2730
- function clearSearch() {
2731
- searchValueRef.current = '';
2732
- clearSearchTimeout();
2733
- }
2734
- return async event => {
2735
- if (!isTypeEvent(event)) {
2736
- // Forward key down event
2737
- parentOnKeyDown?.(event);
2738
- return undefined;
2739
- }
2740
- event.stopPropagation();
2741
-
2742
- // Clear current search timeout
2743
- clearSearchTimeout();
2744
-
2745
- // Open combobox and wait for options to mount
2746
- const options = await handleOpen({
2747
- manual: false
2748
- });
2749
- const optionArray = options && Object.values(options);
2750
- if (!optionArray?.length) {
2751
- return undefined;
2752
- }
2753
-
2754
- // Append key to current search
2755
- searchValueRef.current += event.key.toLowerCase();
2756
- const searchValue = searchValueRef.current;
2757
-
2758
- // Clear search after 500ms
2759
- searchTimeoutRef.current = setTimeout(clearSearch, 500);
2760
-
2761
- // Search is containing all the same letters (ex: aaaa)
2762
- const allTheSameLetters = searchValue.split('').every(letter => letter === searchValue[0]);
2763
-
2764
- // start from currently selected option
2765
- let startIndex = optionArray.findIndex(option => option.generatedId === highlightedId);
2766
- if (startIndex === -1) {
2767
- startIndex = 0;
2768
- }
2769
- let index = startIndex;
2770
- do {
2771
- // Increment index and loop around to 0 if we get over the array length
2772
- index = (index + 1) % optionArray.length;
2773
- const option = optionArray[index];
2774
- // Search by text value or fallback on id.
2775
- const optionText = isComboboxValue(option) ? option?.textValue || option?.id : null;
2776
- if (isComboboxValue(option) && optionText) {
2777
- const optionTextValue = optionText.toLowerCase();
2778
-
2779
- // Search on first letter if search is all the same letters
2780
- const searchText = allTheSameLetters ? searchValue[0] : searchValue;
2781
-
2782
- // Option text value starts with searched text
2783
- if (optionTextValue.startsWith(searchText)) {
2784
- movingFocusDispatch({
2785
- type: 'SELECT_TAB_STOP',
2786
- payload: {
2787
- id: option.generatedId,
2788
- type: 'keyboard'
2789
- }
2790
- });
2791
- break;
2792
- }
2793
- }
2794
- } while (index !== startIndex);
2795
- return clearSearchTimeout;
2796
- };
2797
- }, [handleOpen, parentOnKeyDown, highlightedId, movingFocusDispatch]);
2798
- return useComboboxTrigger({
2799
- ...args,
2800
- onKeyDown
2801
- });
2802
- }
2803
-
2804
- /**
2805
- * Combobox button trigger.
2806
- *
2807
- * @family Combobox
2808
- */
2809
- const ComboboxButton = forwardRef((props, ref) => {
2810
- const {
2811
- as,
2812
- label,
2813
- onFocus,
2814
- onBlur,
2815
- labelDisplayMode = 'show-selection',
2816
- ...forwardedProps
2817
- } = props;
2818
- const refs = useComboboxRefs();
2819
- const context = useCombobox();
2820
- const buttonProps = useComboboxButton({
2821
- context,
2822
- refs,
2823
- onBlur,
2824
- onFocus
2825
- });
2826
- const Element = as || Button;
2827
- const showSelection = labelDisplayMode === 'show-selection';
2828
- const tooltipOnly = labelDisplayMode === 'show-tooltip';
2829
- const selectionLabel = showSelection && context.selectedIds?.length && context.inputValue;
2830
- let content = null;
2831
- if (!tooltipOnly) {
2832
- // Display selection label or label
2833
- content = selectionLabel || label;
2834
- }
2835
- const hideTooltip =
2836
- // Hide tooltip if the displayed label and tooltip label are the same
2837
- label === content ||
2838
- // Hide tooltip when the combobox is open
2839
- context.isOpen;
2840
- const mergedRefs = useMergeRefs(ref, refs.triggerRef, refs.anchorRef);
2841
- return /*#__PURE__*/jsx(Tooltip, {
2842
- className: hideTooltip ? visuallyHidden() : undefined,
2843
- label: label,
2844
- closeMode: "hide",
2845
- ariaLinkMode: "aria-labelledby",
2846
- children: /*#__PURE__*/jsx(Element, {
2847
- ref: mergedRefs,
2848
- ...forwardedProps,
2849
- ...buttonProps,
2850
- children: content
2851
- })
2852
- });
2853
- });
2854
-
2855
- /**
2856
- * Provide props for the semantic and behaviors the combobox input trigger
2857
- *
2858
- * Overrides the useComboboxTrigger() props & behavior to prevent open on click
2859
- * if `openOnFocus` is not enabled.
2860
- */
2861
- function useComboboxInput({
2862
- onKeyDown: propsOnKeyDown,
2863
- ...args
2864
- }) {
2865
- const triggerProps = useComboboxTrigger(args);
2866
- const {
2867
- onClick,
2868
- onKeyDown,
2869
- 'aria-expanded': showPopover
2870
- } = triggerProps;
2871
- const handleClick = () => {
2872
- if (!args.context.openOnFocus && !args.context.openOnClick) {
2873
- // Skip if input should not opening on focus nor click
2874
- return;
2875
- }
2876
- onClick();
2877
- };
2878
- const handleKeyDown = evt => {
2879
- if (evt.key === 'Escape') {
2880
- // Reset field if closed
2881
- if (!showPopover) {
2882
- args.context.handleInputChange('');
2883
- }
2884
- return;
2885
- }
2886
- onKeyDown(evt);
2887
- if (propsOnKeyDown) {
2888
- propsOnKeyDown(evt);
2889
- }
2890
- };
2891
- return {
2892
- ...triggerProps,
2893
- onClick: handleClick,
2894
- onKeyDown: handleKeyDown
2895
- };
2896
- }
2897
-
2898
- /**
2899
- * Combobox input trigger.
2900
- *
2901
- * @family Combobox
2902
- */
2903
- const ComboboxInput = ({
2904
- hideToggle,
2905
- inputRef,
2906
- textFieldRef,
2907
- afterElement,
2908
- onFocus,
2909
- onBlur,
2910
- onKeyDown,
2911
- clearButtonProps,
2912
- hasClearButton,
2913
- theme,
2914
- ...textFieldProps
2915
- }) => {
2916
- const refs = useComboboxRefs();
2917
- const context = useCombobox();
2918
- const inputProps = useComboboxInput({
2919
- refs,
2920
- context,
2921
- onBlur,
2922
- onFocus,
2923
- onKeyDown
2924
- });
2925
- const {
2926
- listboxId,
2927
- isOpen,
2928
- handleOpen,
2929
- handleClose,
2930
- inputValue,
2931
- handleInputChange
2932
- } = context;
2933
-
2934
- /** Callback for when the toggle button is trigged */
2935
- const handleManualToggle = () => {
2936
- if (isOpen) {
2937
- handleClose();
2938
- } else {
2939
- handleOpen({
2940
- manual: true
2941
- });
2942
- }
2943
- refs.triggerRef?.current?.focus();
2944
- };
2945
- return /*#__PURE__*/jsx(TextField
2946
- // Disable native autocomplete
2947
- , {
2948
- autoComplete: "off",
2949
- ...textFieldProps,
2950
- inputRef: mergeRefs(refs.triggerRef, inputRef),
2951
- textFieldRef: mergeRefs(refs.anchorRef, textFieldRef)
2952
- // Combobox props
2953
- ,
2954
- ...inputProps,
2955
- theme: theme,
2956
- value: inputValue,
2957
- onClear: () => handleInputChange(''),
2958
- onChange: handleInputChange,
2959
- clearButtonProps: hasClearButton ? {
2960
- ...clearButtonProps,
2961
- label: context.translations.clearLabel
2962
- } : undefined,
2963
- afterElement: (!hideToggle || afterElement) && /*#__PURE__*/jsxs(Fragment, {
2964
- children: [afterElement, !hideToggle && /*#__PURE__*/jsx(IconButton, {
2965
- theme: theme,
2966
- onClick: handleManualToggle,
2967
- label: context.translations.showSuggestionsLabel,
2968
- emphasis: Emphasis$1.low,
2969
- size: Size$1.s,
2970
- icon: inputProps['aria-expanded'] ? mdiChevronUp : mdiChevronDown,
2971
- type: "button",
2972
- tabIndex: -1,
2973
- "aria-expanded": inputProps['aria-expanded'],
2974
- "aria-haspopup": "listbox",
2975
- "aria-controls": listboxId
2976
- })]
2977
- })
2978
- });
2979
- };
2980
-
2981
- const ComboboxOptionContext = /*#__PURE__*/createContext({});
2982
- /** Context Provider to store the current combobox option id. */
2983
- const ComboboxOptionContextProvider = ({
2984
- optionId,
2985
- isKeyboardHighlighted,
2986
- children
2987
- }) => {
2988
- const value = React__default.useMemo(() => ({
2989
- optionId,
2990
- isKeyboardHighlighted
2991
- }), [optionId, isKeyboardHighlighted]);
2992
- return /*#__PURE__*/jsx(ComboboxOptionContext.Provider, {
2993
- value: value,
2994
- children: children
2995
- });
2996
- };
2997
-
2998
- /** Retrieve the current combobox section id */
2999
- const useComboboxSectionId = () => {
3000
- return useContext(SectionContext);
3001
- };
3002
-
3003
- /**
3004
- * Register the given option to the context
3005
- */
3006
- const useRegisterOption = (registerId, option, shouldRegister) => {
3007
- const {
3008
- dispatch
3009
- } = useCombobox();
3010
-
3011
- /** Register the given options */
3012
- React__default.useEffect(() => {
3013
- if (option && shouldRegister) {
3014
- dispatch({
3015
- type: 'ADD_OPTION',
3016
- payload: {
3017
- id: registerId,
3018
- option
3019
- }
3020
- });
3021
- }
3022
-
3023
- // Unregister ids if/when the component unmounts or if option changes
3024
- return () => {
3025
- if (option) {
3026
- dispatch({
3027
- type: 'REMOVE_OPTION',
3028
- payload: {
3029
- id: registerId
3030
- }
3031
- });
3032
- }
3033
- };
3034
- }, [dispatch, option, registerId, shouldRegister]);
3035
- };
3036
-
3037
- /* eslint-disable jsx-a11y/click-events-have-key-events */
3038
- const CLASSNAME$16 = 'lumx-combobox-option';
3039
- const LUMX_CLASSNAME = 'lumx-list-item';
3040
- const {
3041
- block: block$Z,
3042
- element: element$L
3043
- } = classNames.bem(CLASSNAME$16);
3044
- const lumxListItem = classNames.bem(LUMX_CLASSNAME);
3045
-
3046
- /**
3047
- * Content of the option.
3048
- * This should only be rendered if the option is shown.
3049
- */
3050
- const OptionContent = forwardRef((props, ref) => {
3051
- const {
3052
- id,
3053
- onSelect,
3054
- isSelected,
3055
- isDisabled,
3056
- children,
3057
- className,
3058
- before,
3059
- after,
3060
- as,
3061
- size = Size$1.tiny,
3062
- comboboxType,
3063
- tooltipProps,
3064
- description,
3065
- 'aria-hidden': ariaHidden,
3066
- autofocus,
3067
- ...forwardedProps
3068
- } = props;
3069
- const itemRef = React__default.useRef(null);
3070
- const {
3071
- state
3072
- } = React__default.useContext(MovingFocusContext);
3073
- const {
3074
- selectedIds
3075
- } = useCombobox();
3076
- const hasSelection = selectedIds !== undefined;
3077
- const isHighlighted = useVirtualFocus(id, itemRef, false, comboboxType === 'grid' ? id : undefined, autofocus);
3078
- const Element = as || 'span';
3079
- const ariaSelected = isSelected ? 'true' : 'false';
3080
- const ariaDescriptionId = description ? `${id}-description` : undefined;
3081
- const isKeyboardHighlighted = state.isUsingKeyboard && isHighlighted;
3082
-
3083
- /**
3084
- * The DS `ListItem` component has a lot of behavior / default props we do not want here.
3085
- * Notably the before/after items are within the interactive element, which we do not want.
3086
- * So we use a native li tag.
3087
- */
3088
- return /*#__PURE__*/jsx("li", {
3089
- className: block$Z(undefined, [className ?? '', lumxListItem.block({
3090
- [`size-${size}`]: !!size
3091
- })]),
3092
- role: "presentation",
3093
- ref: itemRef,
3094
- "aria-hidden": ariaHidden,
3095
- style: {
3096
- display: ariaHidden ? 'none' : undefined
3097
- },
3098
- ...forwardedProps,
3099
- children: /*#__PURE__*/jsxs(GenericBlock, {
3100
- as: "div",
3101
- role: comboboxType === 'grid' ? 'row' : 'presentation',
3102
- className: element$L('content', {
3103
- // Not using the lumx list item disabled style as it blocks pointer events
3104
- 'is-disabled': !!isDisabled
3105
- },
3106
- // TODO: migrate away from using lumx-list-item styles https://lumapps.atlassian.net/browse/DSW-288
3107
- [lumxListItem.element('link', {
3108
- 'is-selected': Boolean(isSelected),
3109
- 'is-highlighted': Boolean(isHighlighted)
3110
- })]),
3111
- "data-focus-visible-added": isKeyboardHighlighted ? 'true' : undefined,
3112
- children: [before && /*#__PURE__*/jsx(GenericBlock.Figure, {
3113
- as: "span",
3114
- role: "presentation",
3115
- className: element$L('before', undefined, [lumxListItem.element('before')]),
3116
- children: before
3117
- }), /*#__PURE__*/jsxs(GenericBlock.Content, {
3118
- as: "span",
3119
- role: "presentation",
3120
- className: lumxListItem.element('content'),
3121
- children: [/*#__PURE__*/jsx(Tooltip, {
3122
- forceOpen: isKeyboardHighlighted,
3123
- closeMode: "hide",
3124
- ...tooltipProps,
3125
- children: /*#__PURE__*/jsx(Element, {
3126
- id: id,
3127
- className: element$L('trigger'),
3128
- role: comboboxType === 'grid' ? 'gridcell' : 'option',
3129
- "aria-selected": hasSelection ? ariaSelected : undefined,
3130
- "aria-disabled": isDisabled,
3131
- "aria-describedby": ariaDescriptionId,
3132
- onClick: onSelect
3133
- // Prevent mouse down to avoid blur before the click is activated
3134
- ,
3135
- onMouseDown: event => event.preventDefault(),
3136
- ref: ref,
3137
- ...forwardedProps,
3138
- children: children
3139
- })
3140
- }), description && /*#__PURE__*/jsx(Text, {
3141
- as: "span",
3142
- id: ariaDescriptionId,
3143
- role: "presentation",
3144
- className: element$L('description'),
3145
- typography: "caption",
3146
- color: "dark",
3147
- colorVariant: "L2",
3148
- children: description
3149
- })]
3150
- }), after && /*#__PURE__*/jsx(GenericBlock.Actions, {
3151
- as: "span",
3152
- role: "presentation",
3153
- className: element$L('after', undefined, [lumxListItem.element('after')]),
3154
- children: /*#__PURE__*/jsx(ComboboxOptionContextProvider, {
3155
- optionId: id,
3156
- isKeyboardHighlighted: isKeyboardHighlighted,
3157
- children: after
3158
- })
3159
- })]
3160
- })
3161
- });
3162
- });
3163
-
3164
- /**
3165
- * Props for ComboboxOption with additional generic properties.
3166
- */
3167
-
3168
- /**
3169
- * Option to set within a combobox list.
3170
- *
3171
- * @family Combobox
3172
- * @param ComboboxOptionProps
3173
- * @returns ComboboxOption
3174
- */
3175
- const ComboboxOption = forwardRef((props, ref) => {
3176
- const {
3177
- children,
3178
- id,
3179
- textValue,
3180
- data,
3181
- filterFromInput = true,
3182
- onSelect: onOptionSelect,
3183
- isDisabled,
3184
- as = 'span',
3185
- ...optionProps
3186
- } = props;
3187
-
3188
- // Get the id of the current group, if any.
3189
- const section = useComboboxSectionId();
3190
- const {
3191
- comboboxId,
3192
- selectedIds,
3193
- showAll,
3194
- inputValue,
3195
- handleSelected,
3196
- type
3197
- } = useCombobox();
3198
- // Generate a unique id for this option.
3199
- const generatedId = generateOptionId(comboboxId, id);
3200
- const isSelected = selectedIds?.includes(generatedId);
3201
-
3202
- // If no text value is set and the direct child is a simple string, use it as value.
3203
- const isStringChild = typeof children === 'string' || typeof children === 'number';
3204
- const value = children && !textValue && isStringChild ? children.toString() : textValue;
3205
- const showOption = !filterFromInput || showAll || value?.toString()?.toLowerCase().includes(inputValue?.toLowerCase());
3206
- const registeredOption = React__default.useMemo(() => ({
3207
- id,
3208
- generatedId,
3209
- textValue: value,
3210
- data,
3211
- filter: filterFromInput,
3212
- isDisabled: isDisabled || !showOption,
3213
- sectionId: section.sectionId,
3214
- onSelect: onOptionSelect
3215
- }), [data, filterFromInput, generatedId, section.sectionId, id, isDisabled, onOptionSelect, showOption, value]);
3216
-
3217
- // Register the option
3218
- useRegisterOption(generatedId, registeredOption, showOption);
3219
- const handleSelect = React__default.useCallback(() => handleSelected(registeredOption, 'click'), [handleSelected, registeredOption]);
3220
- if (!id || !showOption) {
3221
- return null;
3222
- }
3223
- return /*#__PURE__*/jsx(OptionContent, {
3224
- id: generatedId,
3225
- onSelect: handleSelect,
3226
- isSelected: isSelected,
3227
- isDisabled: isDisabled,
3228
- as: as,
3229
- ref: ref,
3230
- comboboxType: type,
3231
- "aria-hidden": section.isLoading,
3232
- ...optionProps,
3233
- children: children || textValue
3234
- });
3235
- });
3236
-
3237
- // Default widths the skeletons must have
3238
- const defaultWidths = [REAL_SIZE_FOR_LUMX_SIZE.xxl, REAL_SIZE_FOR_LUMX_SIZE.xl, REAL_SIZE_FOR_LUMX_SIZE.l];
3239
- const {
3240
- block: block$Y,
3241
- element: element$K
3242
- } = classNames.bem(CLASSNAME$16);
3243
-
3244
- /**
3245
- * Skeleton for a combobox option.
3246
- * A typography skeleton is rendered by default but can be overridden by passing children.
3247
- */
3248
- const ComboboxOptionSkeleton = ({
3249
- className,
3250
- index,
3251
- before,
3252
- after,
3253
- size = Size$1.tiny,
3254
- children
3255
- }) => {
3256
- const renderedChildren = typeof children === 'function' ? children({
3257
- index
3258
- }) : children;
3259
- const content = renderedChildren || /*#__PURE__*/jsx(SkeletonTypography, {
3260
- typography: "body1",
3261
- width: index !== undefined && defaultWidths[index] ? defaultWidths[index] : REAL_SIZE_FOR_LUMX_SIZE.xl
3262
- });
3263
- return /*#__PURE__*/jsxs("li", {
3264
- role: "presentation",
3265
- className: block$Y({
3266
- skeleton: true
3267
- }, ['lumx-list-item', `lumx-list-item--size-${size}`, className]),
3268
- children: [/*#__PURE__*/jsxs("div", {
3269
- role: "presentation",
3270
- className: element$K('content', ['lumx-list-item__wrapper']),
3271
- children: [before && /*#__PURE__*/jsx(Text, {
3272
- as: "span",
3273
- role: "presentation",
3274
- className: element$K('before', ['lumx-list-item__before']),
3275
- children: before
3276
- }), content]
3277
- }), after && /*#__PURE__*/jsx("div", {
3278
- role: "presentation",
3279
- className: element$K('after', ['lumx-list-item__after']),
3280
- children: after
3281
- })]
3282
- });
3283
- };
3284
-
3285
- /** Default skeleton for the options list of the combobox */
3286
- const ComboboxListSkeleton = ({
3287
- isLoadingMore,
3288
- children
3289
- }) => /*#__PURE__*/jsx(Fragment, {
3290
- children: Array.from({
3291
- length: isLoadingMore ? 1 : 3
3292
- }).map((_, index) => {
3293
- const renderedChildren = typeof children === 'function' ? children({
3294
- index
3295
- }) : children || /*#__PURE__*/jsx(ComboboxOptionSkeleton, {
3296
- index: index
3297
- });
3298
- return (
3299
- /*#__PURE__*/
3300
- // eslint-disable-next-line react/no-array-index-key
3301
- jsx(React__default.Fragment, {
3302
- children: renderedChildren
3303
- }, index)
3304
- );
3305
- })
3306
- });
3307
-
3308
- /** The states in which the full loading must be displayed */
3309
- const FULL_LOADING_STATES = ['loading', 'debouncing', 'filtering'];
3310
- const CLASSNAME$15 = 'lumx-combobox-listbox';
3311
- const {
3312
- block: block$X,
3313
- element: element$J
3314
- } = bem$1(CLASSNAME$15);
3315
-
3316
- /**
3317
- * The listbox containing the combobox's options.
3318
- *
3319
- * @family Combobox
3320
- * @param ComboboxListBoxProps
3321
- * @returns ComboboxListBox
3322
- */
3323
- const ComboboxListBox = ({
3324
- children,
3325
- renderItemSkeleton,
3326
- label,
3327
- popoverProps,
3328
- footer,
3329
- listRef,
3330
- ...forwardedProps
3331
- }) => {
3332
- const {
3333
- status,
3334
- listboxId,
3335
- isOpen,
3336
- optionsLength,
3337
- handleClose: contextHandleClose,
3338
- type,
3339
- inputValue,
3340
- showEmptyState,
3341
- showErrorState,
3342
- translations
3343
- } = useCombobox();
3344
- const {
3345
- anchorRef
3346
- } = useComboboxRefs();
3347
- const {
3348
- onClose,
3349
- ...otherPopoverProps
3350
- } = popoverProps || {};
3351
- const {
3352
- style,
3353
- className,
3354
- ...listProps
3355
- } = forwardedProps;
3356
- // The states to show a full skeleton instead of the options
3357
- const showFullLoading = FULL_LOADING_STATES.includes(status);
3358
- const isErrorStateDisplayed = showErrorState && isOpen && status === 'error';
3359
- const isEmptyStateDisplayed = showEmptyState && isOpen && status === 'idle' && optionsLength === 0;
3360
-
3361
- /**
3362
- * The conditions in which we want to show the content of the popover
3363
- * * The parent asked for the popover to be opened
3364
- * * There is at least one option to displayed OR a skeleton
3365
- */
3366
- const showPopover = isOpen && (optionsLength > 0 || showFullLoading) || isEmptyStateDisplayed || isErrorStateDisplayed;
3367
- const handleClose = () => {
3368
- if (isOpen) {
3369
- contextHandleClose?.();
3370
- onClose?.();
3371
- }
3372
- };
3373
- const emptyMessage = translations.noResultsForInputLabel(inputValue);
3374
- return /*#__PURE__*/jsxs(Fragment, {
3375
- children: [/*#__PURE__*/jsxs(Text, {
3376
- as: "p",
3377
- className: visuallyHidden(),
3378
- role: "log",
3379
- "aria-live": "assertive",
3380
- children: [isOpen && !showFullLoading && !isEmptyStateDisplayed && !isErrorStateDisplayed && translations.nbOptionsLabel(optionsLength), isErrorStateDisplayed && `${translations.serviceUnavailableLabel} ${translations.tryReloadLabel}`, showFullLoading && translations.loadingLabel, isEmptyStateDisplayed && emptyMessage]
3381
- }), /*#__PURE__*/jsx(Popover, {
3382
- role: "none",
3383
- onClose: handleClose,
3384
- anchorRef: anchorRef,
3385
- fitToAnchorWidth: true,
3386
- fitWithinViewportHeight: true,
3387
- closeOnEscape: true,
3388
- closeOnClickAway: true,
3389
- placement: Placement.BOTTOM,
3390
- isOpen: isOpen,
3391
- ...otherPopoverProps,
3392
- children: /*#__PURE__*/jsxs("div", {
3393
- style: {
3394
- ...style,
3395
- overflowY: 'auto',
3396
- display: showPopover ? 'flex' : 'none',
3397
- flexDirection: 'column'
3398
- },
3399
- children: [/*#__PURE__*/jsxs("ul", {
3400
- ref: listRef,
3401
- id: listboxId,
3402
- role: type,
3403
- "aria-label": label,
3404
- className: block$X([className, 'lumx-list lumx-list--item-padding-big']),
3405
- style: {
3406
- flex: 1,
3407
- overflowY: 'auto'
3408
- },
3409
- ...listProps,
3410
- children: [!showFullLoading && children, [...FULL_LOADING_STATES, 'loadingMore'].includes(status) && /*#__PURE__*/jsx(ComboboxListSkeleton, {
3411
- isLoadingMore: status === 'loadingMore',
3412
- children: renderItemSkeleton
3413
- })]
3414
- }), footer, (isEmptyStateDisplayed || isErrorStateDisplayed) && /*#__PURE__*/jsx(GenericBlock, {
3415
- className: element$J('state'),
3416
- orientation: "vertical",
3417
- vAlign: "center",
3418
- children: /*#__PURE__*/jsxs(GenericBlock.Content, {
3419
- children: [inputValue && isEmptyStateDisplayed && /*#__PURE__*/jsx(Text, {
3420
- as: "p",
3421
- typography: "body1",
3422
- color: "dark",
3423
- colorVariant: "L2",
3424
- dangerouslySetInnerHTML: {
3425
- __html: translations.noResultsForInputLabel(inputValue)
3426
- }
3427
- }), !inputValue && isEmptyStateDisplayed && /*#__PURE__*/jsx(Text, {
3428
- as: "p",
3429
- typography: "body1",
3430
- color: "dark",
3431
- colorVariant: "L2",
3432
- children: translations.noResultsForInputLabel()
3433
- }), isErrorStateDisplayed && /*#__PURE__*/jsxs(Fragment, {
3434
- children: [/*#__PURE__*/jsx(Heading, {
3435
- as: "h2",
3436
- typography: "subtitle2",
3437
- children: translations.serviceUnavailableLabel
3438
- }), /*#__PURE__*/jsx(Text, {
3439
- as: "p",
3440
- typography: "body1",
3441
- color: "dark",
3442
- colorVariant: "L2",
3443
- children: translations.tryReloadLabel
3444
- })]
3445
- })]
3446
- })
3447
- })]
3448
- })
3449
- })]
3450
- });
3451
- };
3452
-
3453
- const CLASSNAME$14 = 'lumx-combobox-section';
3454
- const {
3455
- block: block$W,
3456
- element: element$I
3457
- } = classNames.bem(CLASSNAME$14);
3458
-
3459
- /**
3460
- * Content of the ComboboxSection.
3461
- */
3462
- const ComboboxSectionContent = ({
3463
- className,
3464
- title,
3465
- children,
3466
- isLoading,
3467
- renderItemSkeleton
3468
- }) => {
3469
- const {
3470
- options
3471
- } = useCombobox();
3472
- const {
3473
- sectionId
3474
- } = useComboboxSectionId();
3475
- const hasRegisteredChildren = Boolean(Object.values(options).find(option => isComboboxValue(option) && option.sectionId === sectionId));
3476
- const titleId = title && `${sectionId}-title`;
3477
- if (!children && !isLoading) {
3478
- return null;
3479
- }
3480
- const isHidden = !hasRegisteredChildren && !isLoading;
3481
- return /*#__PURE__*/jsxs("li", {
3482
- className: block$W([className]),
3483
- role: !isHidden ? 'none' : undefined,
3484
- "aria-hidden": isHidden,
3485
- style: {
3486
- display: isHidden ? 'none' : undefined
3487
- },
3488
- children: [title && /*#__PURE__*/jsx(Text, {
3489
- as: "span",
3490
- className: element$I('header', [ListSubheader.className]),
3491
- "aria-hidden": "true",
3492
- id: titleId,
3493
- children: title
3494
- }), /*#__PURE__*/jsxs("ul", {
3495
- className: element$I('content'),
3496
- role: "group",
3497
- "aria-labelledby": titleId,
3498
- children: [children, isLoading && /*#__PURE__*/jsx(ComboboxListSkeleton, {
3499
- children: renderItemSkeleton
3500
- })]
3501
- })]
3502
- });
3503
- };
3504
-
3505
- /**
3506
- * Section for options of a Combobox.
3507
- *
3508
- * @family Combobox
3509
- * @param ComboboxSectionProps
3510
- * @returns ComboboxSection
3511
- */
3512
- const ComboboxSection = ({
3513
- children,
3514
- ...props
3515
- }) => {
3516
- const sectionId = useId();
3517
- const value = React__default.useMemo(() => ({
3518
- sectionId,
3519
- isLoading: props.isLoading
3520
- }), [sectionId, props.isLoading]);
3521
- return /*#__PURE__*/jsx(SectionContext.Provider, {
3522
- value: value,
3523
- children: /*#__PURE__*/jsx(ComboboxSectionContent, {
3524
- ...props,
3525
- children: children
3526
- })
3527
- });
3528
- };
3529
-
3530
- /** Context provider for the combobox. */
3531
- const ComboboxProvider = ({
3532
- children,
3533
- value
3534
- }) => {
3535
- return /*#__PURE__*/jsx(ComboboxContext.Provider, {
3536
- value: value,
3537
- children: /*#__PURE__*/jsx(MovingFocusProvider, {
3538
- options: {
3539
- direction: value.type === 'grid' ? 'both' : 'vertical',
3540
- firstFocusDirection: value.type === 'grid' ? 'vertical' : undefined,
3541
- loopAround: {
3542
- row: 'next-loop',
3543
- col: 'inside'
3544
- },
3545
- gridJumpToShortcutDirection: 'vertical',
3546
- defaultSelectedId: value.selectedIds?.[0],
3547
- listKey: value.inputValue
3548
- },
3549
- children: children
3550
- })
3551
- });
3552
- };
3553
-
3554
- const Combobox$1 = ({
3555
- id: htmlId,
3556
- inputValue,
3557
- defaultInputValue,
3558
- autoFilter = true,
3559
- openOnClick,
3560
- openOnFocus,
3561
- status,
3562
- showEmptyState = !autoFilter,
3563
- showErrorState = !!status,
3564
- selectedIds,
3565
- onInputChange,
3566
- onSelect,
3567
- onOpen,
3568
- children,
3569
- selectionType,
3570
- translations
3571
- }) => {
3572
- const textFieldRef = useRef(null);
3573
- const triggerRef = useRef(null);
3574
-
3575
- // Generate a unique id for the combobox that will be used for every child components.
3576
- const generatedId = useId('combobox');
3577
- const comboboxId = htmlId || generatedId;
3578
- const listboxId = `${comboboxId}-popover`;
3579
-
3580
- /** Generate the selected option id from the given selected id. */
3581
- const currentSelectedIds = selectedIds?.map(selectedId => generateOptionId(comboboxId, selectedId.toString()));
3582
-
3583
- /** Generate the state */
3584
- const [state, dispatch] = useReducer(reducer$1, initialState, defaultState => ({
3585
- ...defaultState,
3586
- comboboxId,
3587
- listboxId,
3588
- // a default input value can be set if needed
3589
- inputValue: defaultInputValue || defaultState.inputValue
3590
- }));
3591
-
3592
- /**
3593
- * Return the current input value.
3594
- */
3595
- const currentInputValue = useMemo(() => {
3596
- // If the component is controlled and a value is already set by the parent, use this value
3597
- if (inputValue !== null && inputValue !== undefined) {
3598
- return inputValue;
3599
- }
3600
-
3601
- // Then use the local value
3602
- if (state.inputValue) {
3603
- return state.inputValue;
3604
- }
3605
-
3606
- // In all other cases, return an empty string.
3607
- return '';
3608
- }, [inputValue, state.inputValue]);
3609
-
3610
- /** Return a memoized state */
3611
- const synchedState = useMemo(() => {
3612
- return {
3613
- ...state,
3614
- showAll: !autoFilter || state.showAll,
3615
- inputValue: currentInputValue,
3616
- status: status || state.status,
3617
- listboxId
3618
- };
3619
- }, [currentInputValue, listboxId, autoFilter, state, status]);
3620
-
3621
- /** Props to set in the context */
3622
- const comboboxProviderValue = useMemo(() => ({
3623
- ...synchedState,
3624
- openOnFocus,
3625
- openOnClick,
3626
- onInputChange,
3627
- onOpen,
3628
- onSelect,
3629
- dispatch,
3630
- selectionType,
3631
- selectedIds: currentSelectedIds,
3632
- showEmptyState,
3633
- showErrorState,
3634
- translations
3635
- }), [synchedState, openOnFocus, openOnClick, onInputChange, onOpen, onSelect, selectionType, currentSelectedIds, showEmptyState, showErrorState, translations]);
3636
- return /*#__PURE__*/jsx(ComboboxRefsProvider, {
3637
- triggerRef: triggerRef,
3638
- anchorRef: textFieldRef,
3639
- children: /*#__PURE__*/jsx(ComboboxProvider, {
3640
- value: comboboxProviderValue,
3641
- children: children
3642
- })
3643
- });
3644
- };
3645
-
3646
- const SUB_COMPONENTS = {
3647
- /**
3648
- * Option to set within a combobox list.
3649
- *
3650
- * @family Combobox
3651
- * @param ComboboxOptionProps
3652
- * @returns ComboboxOption
3653
- */
3654
- Option: ComboboxOption,
3655
- /**
3656
- * Skeleton for a combobox option.
3657
- * A typography skeleton is rendered by default but can be overridden by passing children.
3658
- */
3659
- OptionSkeleton: ComboboxOptionSkeleton,
3660
- /**
3661
- * Section for options of a Combobox.
3662
- *
3663
- * @family Combobox
3664
- * @param ComboboxSectionProps
3665
- * @returns ComboboxSection
3666
- */
3667
- Section: ComboboxSection,
3668
- /**
3669
- * Combobox input trigger.
3670
- *
3671
- * @family Combobox
3672
- */
3673
- Input: ComboboxInput,
3674
- /**
3675
- * The listbox containing the combobox's options.
3676
- *
3677
- * @family Combobox
3678
- * @param ComboboxListBoxProps
3679
- * @returns ComboboxListBox
3680
- */
3681
- List: ComboboxListBox,
3682
- /**
3683
- * Combobox button trigger.
3684
- *
3685
- * @family Combobox
3686
- */
3687
- Button: ComboboxButton
3688
- };
3689
-
3690
- /**
3691
- *
3692
- * A Combobox is a combination of two components:
3693
- * * An input to enter the user's value
3694
- * * A popover with a list of suggestions to fill the value.
3695
- *
3696
- * These two components are included via the Combobox.Input and Combobox.ListBox components.
3697
- *
3698
- * In its simplest implementation the component will automatically filter the given options
3699
- * from the value of the input and fill the input with the textValue of the selected option.
3700
- *
3701
- * Props are available for more complex implementations.
3702
- *
3703
- * @family Combobox
3704
- * @param ComboboxProps
3705
- * @returns Combobox
3706
- */
3707
- const Combobox = Object.assign(Combobox$1, SUB_COMPONENTS);
3708
-
3709
- /**
3710
- * Comment block variants.
3711
- */
3712
- const CommentBlockVariant = {
3713
- indented: 'indented',
3714
- linear: 'linear'
3715
- };
3716
-
3717
- /**
3718
- * Defines the props of the component.
3719
- */
3720
-
3721
- /**
3722
- * Component display name.
3723
- */
3724
- const COMPONENT_NAME$15 = 'CommentBlock';
3725
-
3726
- /**
3727
- * Component default class name and class prefix.
3728
- */
3729
- const CLASSNAME$13 = 'lumx-comment-block';
3730
- const {
3731
- block: block$V,
3732
- element: element$H
3733
- } = classNames.bem(CLASSNAME$13);
3734
-
3735
- /**
3736
- * Component default props.
3737
- */
3738
- const DEFAULT_PROPS$U = {
3739
- variant: CommentBlockVariant.indented
3740
- };
3741
-
3742
- /**
3743
- * CommentBlock component.
3744
- *
3745
- * @param props Component props.
3746
- * @param ref Component ref.
3747
- * @return React element.
3748
- */
3749
- const CommentBlock = forwardRef((props, ref) => {
3750
- const defaultTheme = useTheme() || Theme$1.light;
2250
+ /**
2251
+ * CommentBlock component.
2252
+ *
2253
+ * @param props Component props.
2254
+ * @param ref Component ref.
2255
+ * @return React element.
2256
+ */
2257
+ const CommentBlock = forwardRef((props, ref) => {
2258
+ const defaultTheme = useTheme() || Theme$1.light;
3751
2259
  const {
3752
2260
  actions,
3753
2261
  avatarProps,
@@ -3765,7 +2273,7 @@ const CommentBlock = forwardRef((props, ref) => {
3765
2273
  onMouseLeave,
3766
2274
  text,
3767
2275
  theme = defaultTheme,
3768
- variant = DEFAULT_PROPS$U.variant,
2276
+ variant = DEFAULT_PROPS$X.variant,
3769
2277
  ...forwardedProps
3770
2278
  } = props;
3771
2279
  const hasChildren = Children.count(children) > 0;
@@ -3834,7 +2342,7 @@ const CommentBlock = forwardRef((props, ref) => {
3834
2342
  });
3835
2343
  CommentBlock.displayName = COMPONENT_NAME$15;
3836
2344
  CommentBlock.className = CLASSNAME$13;
3837
- CommentBlock.defaultProps = DEFAULT_PROPS$U;
2345
+ CommentBlock.defaultProps = DEFAULT_PROPS$X;
3838
2346
 
3839
2347
  /**
3840
2348
  * Add a number of months from a date while resetting the day to prevent month length mismatches.
@@ -4939,7 +3447,7 @@ const {
4939
3447
  /**
4940
3448
  * Component default props.
4941
3449
  */
4942
- const DEFAULT_PROPS$T = {
3450
+ const DEFAULT_PROPS$W = {
4943
3451
  size: Size$1.big,
4944
3452
  disableBodyScroll: true
4945
3453
  };
@@ -4970,11 +3478,11 @@ const Dialog = forwardRef((props, ref) => {
4970
3478
  parentElement,
4971
3479
  contentRef,
4972
3480
  preventAutoClose,
4973
- size = DEFAULT_PROPS$T.size,
3481
+ size = DEFAULT_PROPS$W.size,
4974
3482
  zIndex,
4975
3483
  dialogProps,
4976
3484
  onVisibilityChange,
4977
- disableBodyScroll = DEFAULT_PROPS$T.disableBodyScroll,
3485
+ disableBodyScroll = DEFAULT_PROPS$W.disableBodyScroll,
4978
3486
  preventCloseOnClick,
4979
3487
  preventCloseOnEscape,
4980
3488
  ...forwardedProps
@@ -5114,7 +3622,7 @@ const Dialog = forwardRef((props, ref) => {
5114
3622
  });
5115
3623
  Dialog.displayName = COMPONENT_NAME$11;
5116
3624
  Dialog.className = CLASSNAME$11;
5117
- Dialog.defaultProps = DEFAULT_PROPS$T;
3625
+ Dialog.defaultProps = DEFAULT_PROPS$W;
5118
3626
 
5119
3627
  /**
5120
3628
  * Component display name.
@@ -5127,12 +3635,38 @@ const COMPONENT_NAME$10 = 'Divider';
5127
3635
  const CLASSNAME$10 = 'lumx-divider';
5128
3636
  const {
5129
3637
  block: block$T
5130
- } = classNames.bem(CLASSNAME$10);
3638
+ } = bem(CLASSNAME$10);
3639
+
3640
+ /**
3641
+ * Divider component.
3642
+ *
3643
+ * @param props Component props.
3644
+ * @return JSX element.
3645
+ */
3646
+ const Divider$1 = props => {
3647
+ const {
3648
+ className,
3649
+ theme,
3650
+ ref,
3651
+ ...forwardedProps
3652
+ } = props;
3653
+ return /*#__PURE__*/jsx("hr", {
3654
+ ref: ref,
3655
+ ...forwardedProps,
3656
+ className: classnames(className, block$T({
3657
+ [`theme-${theme}`]: Boolean(theme)
3658
+ }))
3659
+ });
3660
+ };
3661
+
3662
+ /**
3663
+ * Defines the props of the component.
3664
+ */
5131
3665
 
5132
3666
  /**
5133
3667
  * Component default props.
5134
3668
  */
5135
- const DEFAULT_PROPS$S = {};
3669
+ const DEFAULT_PROPS$V = {};
5136
3670
 
5137
3671
  /**
5138
3672
  * Divider component.
@@ -5144,21 +3678,18 @@ const DEFAULT_PROPS$S = {};
5144
3678
  const Divider = forwardRef((props, ref) => {
5145
3679
  const defaultTheme = useTheme() || Theme$1.light;
5146
3680
  const {
5147
- className,
5148
3681
  theme = defaultTheme,
5149
- ...forwardedProps
3682
+ ...otherProps
5150
3683
  } = props;
5151
- return /*#__PURE__*/jsx("hr", {
5152
- ref: ref,
5153
- ...forwardedProps,
5154
- className: classNames.join(className, block$T({
5155
- [`theme-${theme}`]: Boolean(theme)
5156
- }))
3684
+ return Divider$1({
3685
+ ref,
3686
+ theme,
3687
+ ...otherProps
5157
3688
  });
5158
3689
  });
5159
3690
  Divider.displayName = COMPONENT_NAME$10;
5160
3691
  Divider.className = CLASSNAME$10;
5161
- Divider.defaultProps = DEFAULT_PROPS$S;
3692
+ Divider.defaultProps = DEFAULT_PROPS$V;
5162
3693
 
5163
3694
  /**
5164
3695
  * Component display name.
@@ -5383,7 +3914,7 @@ const {
5383
3914
  /**
5384
3915
  * Component default props.
5385
3916
  */
5386
- const DEFAULT_PROPS$R = {
3917
+ const DEFAULT_PROPS$U = {
5387
3918
  tabIndex: -1
5388
3919
  };
5389
3920
 
@@ -5402,7 +3933,7 @@ const InternalList = forwardRef((props, ref) => {
5402
3933
  isClickable,
5403
3934
  itemPadding,
5404
3935
  onListItemSelected,
5405
- tabIndex = DEFAULT_PROPS$R.tabIndex,
3936
+ tabIndex = DEFAULT_PROPS$U.tabIndex,
5406
3937
  ...forwardedProps
5407
3938
  } = props;
5408
3939
  const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
@@ -5418,7 +3949,7 @@ const InternalList = forwardRef((props, ref) => {
5418
3949
  });
5419
3950
  InternalList.displayName = COMPONENT_NAME$_;
5420
3951
  InternalList.className = CLASSNAME$_;
5421
- InternalList.defaultProps = DEFAULT_PROPS$R;
3952
+ InternalList.defaultProps = DEFAULT_PROPS$U;
5422
3953
  const List = Object.assign(InternalList, {
5423
3954
  useKeyboardListNavigation
5424
3955
  });
@@ -7863,7 +6394,7 @@ const {
7863
6394
  /**
7864
6395
  * Component default props.
7865
6396
  */
7866
- const DEFAULT_PROPS$Q = {
6397
+ const DEFAULT_PROPS$T = {
7867
6398
  elevation: 3,
7868
6399
  placement: Placement.AUTO,
7869
6400
  focusAnchorOnClose: true,
@@ -7880,24 +6411,24 @@ const _InnerPopover = forwardRef((props, ref) => {
7880
6411
  className,
7881
6412
  closeOnClickAway,
7882
6413
  closeOnEscape,
7883
- elevation = DEFAULT_PROPS$Q.elevation,
6414
+ elevation = DEFAULT_PROPS$T.elevation,
7884
6415
  focusElement,
7885
6416
  hasArrow,
7886
6417
  isOpen,
7887
6418
  onClose,
7888
6419
  parentElement,
7889
- usePortal = DEFAULT_PROPS$Q.usePortal,
7890
- focusAnchorOnClose = DEFAULT_PROPS$Q.focusAnchorOnClose,
6420
+ usePortal = DEFAULT_PROPS$T.usePortal,
6421
+ focusAnchorOnClose = DEFAULT_PROPS$T.focusAnchorOnClose,
7891
6422
  withFocusTrap,
7892
6423
  boundaryRef,
7893
6424
  fitToAnchorWidth,
7894
6425
  fitWithinViewportHeight,
7895
6426
  focusTrapZoneElement,
7896
6427
  offset,
7897
- placement = DEFAULT_PROPS$Q.placement,
6428
+ placement = DEFAULT_PROPS$T.placement,
7898
6429
  style,
7899
6430
  theme,
7900
- zIndex = DEFAULT_PROPS$Q.zIndex,
6431
+ zIndex = DEFAULT_PROPS$T.zIndex,
7901
6432
  ...forwardedProps
7902
6433
  } = props;
7903
6434
  const popoverRef = useRef(null);
@@ -7983,7 +6514,7 @@ const Popover = skipRender(
7983
6514
  () => Boolean(DOCUMENT), _InnerPopover);
7984
6515
  Popover.displayName = COMPONENT_NAME$Z;
7985
6516
  Popover.className = CLASSNAME$Z;
7986
- Popover.defaultProps = DEFAULT_PROPS$Q;
6517
+ Popover.defaultProps = DEFAULT_PROPS$T;
7987
6518
 
7988
6519
  // The error margin in px we want to have for triggering infinite scroll
7989
6520
  const SCROLL_TRIGGER_MARGIN = 5;
@@ -8043,7 +6574,7 @@ const {
8043
6574
  /**
8044
6575
  * Component default props.
8045
6576
  */
8046
- const DEFAULT_PROPS$P = {
6577
+ const DEFAULT_PROPS$S = {
8047
6578
  closeOnClick: true,
8048
6579
  closeOnClickAway: true,
8049
6580
  closeOnEscape: true,
@@ -8066,18 +6597,18 @@ const Dropdown = forwardRef((props, ref) => {
8066
6597
  anchorRef,
8067
6598
  children,
8068
6599
  className,
8069
- closeOnClick = DEFAULT_PROPS$P.closeOnClick,
8070
- closeOnClickAway = DEFAULT_PROPS$P.closeOnClickAway,
8071
- closeOnEscape = DEFAULT_PROPS$P.closeOnEscape,
8072
- fitToAnchorWidth = DEFAULT_PROPS$P.fitToAnchorWidth,
8073
- fitWithinViewportHeight = DEFAULT_PROPS$P.fitWithinViewportHeight,
6600
+ closeOnClick = DEFAULT_PROPS$S.closeOnClick,
6601
+ closeOnClickAway = DEFAULT_PROPS$S.closeOnClickAway,
6602
+ closeOnEscape = DEFAULT_PROPS$S.closeOnEscape,
6603
+ fitToAnchorWidth = DEFAULT_PROPS$S.fitToAnchorWidth,
6604
+ fitWithinViewportHeight = DEFAULT_PROPS$S.fitWithinViewportHeight,
8074
6605
  isOpen,
8075
6606
  offset,
8076
- focusAnchorOnClose = DEFAULT_PROPS$P.focusAnchorOnClose,
6607
+ focusAnchorOnClose = DEFAULT_PROPS$S.focusAnchorOnClose,
8077
6608
  onClose,
8078
6609
  onInfiniteScroll,
8079
- placement = DEFAULT_PROPS$P.placement,
8080
- shouldFocusOnOpen = DEFAULT_PROPS$P.shouldFocusOnOpen,
6610
+ placement = DEFAULT_PROPS$S.placement,
6611
+ shouldFocusOnOpen = DEFAULT_PROPS$S.shouldFocusOnOpen,
8081
6612
  zIndex,
8082
6613
  ...forwardedProps
8083
6614
  } = props;
@@ -8123,7 +6654,7 @@ const Dropdown = forwardRef((props, ref) => {
8123
6654
  });
8124
6655
  Dropdown.displayName = COMPONENT_NAME$Y;
8125
6656
  Dropdown.className = CLASSNAME$Y;
8126
- Dropdown.defaultProps = DEFAULT_PROPS$P;
6657
+ Dropdown.defaultProps = DEFAULT_PROPS$S;
8127
6658
 
8128
6659
  /**
8129
6660
  * Component display name.
@@ -8142,7 +6673,7 @@ const {
8142
6673
  /**
8143
6674
  * Component default props.
8144
6675
  */
8145
- const DEFAULT_PROPS$O = {
6676
+ const DEFAULT_PROPS$R = {
8146
6677
  closeMode: 'unmount'
8147
6678
  };
8148
6679
  const isDragHandle = isComponent(DragHandle);
@@ -8160,7 +6691,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
8160
6691
  const defaultTheme = useTheme() || Theme$1.light;
8161
6692
  const {
8162
6693
  className,
8163
- closeMode = DEFAULT_PROPS$O.closeMode,
6694
+ closeMode = DEFAULT_PROPS$R.closeMode,
8164
6695
  children: anyChildren,
8165
6696
  hasBackground,
8166
6697
  hasHeaderDivider,
@@ -8277,11 +6808,11 @@ const ExpansionPanel = forwardRef((props, ref) => {
8277
6808
  });
8278
6809
  ExpansionPanel.displayName = COMPONENT_NAME$X;
8279
6810
  ExpansionPanel.className = CLASSNAME$X;
8280
- ExpansionPanel.defaultProps = DEFAULT_PROPS$O;
6811
+ ExpansionPanel.defaultProps = DEFAULT_PROPS$R;
8281
6812
 
8282
6813
  const COMPONENT_NAME$W = 'Flag';
8283
6814
  const CLASSNAME$W = 'lumx-flag';
8284
- const DEFAULT_PROPS$N = {};
6815
+ const DEFAULT_PROPS$Q = {};
8285
6816
  const {
8286
6817
  block: block$N,
8287
6818
  element: element$B
@@ -8345,7 +6876,7 @@ const Flag = forwardRef((props, ref) => {
8345
6876
  });
8346
6877
  Flag.displayName = COMPONENT_NAME$W;
8347
6878
  Flag.className = CLASSNAME$W;
8348
- Flag.defaultProps = DEFAULT_PROPS$N;
6879
+ Flag.defaultProps = DEFAULT_PROPS$Q;
8349
6880
 
8350
6881
  /**
8351
6882
  * Defines the props of the component.
@@ -8438,7 +6969,7 @@ const {
8438
6969
  /**
8439
6970
  * Component default props.
8440
6971
  */
8441
- const DEFAULT_PROPS$M = {
6972
+ const DEFAULT_PROPS$P = {
8442
6973
  gap: Size$1.big,
8443
6974
  orientation: Orientation$1.horizontal
8444
6975
  };
@@ -8468,8 +6999,8 @@ const BaseGenericBlock = forwardRef((props, ref) => {
8468
6999
  children,
8469
7000
  actions,
8470
7001
  actionsProps,
8471
- gap = DEFAULT_PROPS$M.gap,
8472
- orientation = DEFAULT_PROPS$M.orientation,
7002
+ gap = DEFAULT_PROPS$P.gap,
7003
+ orientation = DEFAULT_PROPS$P.orientation,
8473
7004
  contentProps,
8474
7005
  ...forwardedProps
8475
7006
  } = props;
@@ -8523,7 +7054,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
8523
7054
  });
8524
7055
  BaseGenericBlock.displayName = COMPONENT_NAME$U;
8525
7056
  BaseGenericBlock.className = CLASSNAME$U;
8526
- BaseGenericBlock.defaultProps = DEFAULT_PROPS$M;
7057
+ BaseGenericBlock.defaultProps = DEFAULT_PROPS$P;
8527
7058
  const GenericBlock = Object.assign(BaseGenericBlock, {
8528
7059
  Figure,
8529
7060
  Content,
@@ -8571,7 +7102,7 @@ const CLASSNAME$T = 'lumx-heading';
8571
7102
  /**
8572
7103
  * Component default props.
8573
7104
  */
8574
- const DEFAULT_PROPS$L = {};
7105
+ const DEFAULT_PROPS$O = {};
8575
7106
 
8576
7107
  /**
8577
7108
  * Get Heading component common props
@@ -8672,7 +7203,7 @@ const {
8672
7203
  /**
8673
7204
  * Component default props.
8674
7205
  */
8675
- const DEFAULT_PROPS$K = {};
7206
+ const DEFAULT_PROPS$N = {};
8676
7207
 
8677
7208
  /**
8678
7209
  * Text component common props
@@ -8759,7 +7290,7 @@ const Text = forwardRef((props, ref) => {
8759
7290
  });
8760
7291
  Text.displayName = COMPONENT_NAME$S;
8761
7292
  Text.className = CLASSNAME$S;
8762
- Text.defaultProps = DEFAULT_PROPS$K;
7293
+ Text.defaultProps = DEFAULT_PROPS$N;
8763
7294
 
8764
7295
  const HeadingLevelContext = /*#__PURE__*/createContext(defaultContext);
8765
7296
 
@@ -8796,7 +7327,7 @@ const Heading = forwardRef((props, ref) => {
8796
7327
  });
8797
7328
  Heading.displayName = COMPONENT_NAME$T;
8798
7329
  Heading.className = CLASSNAME$T;
8799
- Heading.defaultProps = DEFAULT_PROPS$L;
7330
+ Heading.defaultProps = DEFAULT_PROPS$O;
8800
7331
 
8801
7332
  /**
8802
7333
  * Computes the next heading level based on the optional prop level or the parent context level.
@@ -8847,7 +7378,7 @@ const {
8847
7378
  /**
8848
7379
  * Component default props.
8849
7380
  */
8850
- const DEFAULT_PROPS$J = {
7381
+ const DEFAULT_PROPS$M = {
8851
7382
  orientation: Orientation$1.horizontal,
8852
7383
  wrap: 'nowrap'
8853
7384
  };
@@ -8865,9 +7396,9 @@ const Grid = forwardRef((props, ref) => {
8865
7396
  className,
8866
7397
  gutter,
8867
7398
  hAlign,
8868
- orientation = DEFAULT_PROPS$J.orientation,
7399
+ orientation = DEFAULT_PROPS$M.orientation,
8869
7400
  vAlign,
8870
- wrap = DEFAULT_PROPS$J.wrap,
7401
+ wrap = DEFAULT_PROPS$M.wrap,
8871
7402
  ...forwardedProps
8872
7403
  } = props;
8873
7404
  return /*#__PURE__*/jsx("div", {
@@ -8885,7 +7416,7 @@ const Grid = forwardRef((props, ref) => {
8885
7416
  });
8886
7417
  Grid.displayName = COMPONENT_NAME$R;
8887
7418
  Grid.className = CLASSNAME$R;
8888
- Grid.defaultProps = DEFAULT_PROPS$J;
7419
+ Grid.defaultProps = DEFAULT_PROPS$M;
8889
7420
 
8890
7421
  /**
8891
7422
  * Component display name.
@@ -8943,7 +7474,7 @@ const CLASSNAME$P = 'lumx-grid-column';
8943
7474
  /**
8944
7475
  * Component default props.
8945
7476
  */
8946
- const DEFAULT_PROPS$I = {};
7477
+ const DEFAULT_PROPS$L = {};
8947
7478
 
8948
7479
  /**
8949
7480
  * The GridColumn is a layout component that can display children in a grid
@@ -8980,7 +7511,7 @@ const GridColumn = forwardRef((props, ref) => {
8980
7511
  });
8981
7512
  GridColumn.displayName = COMPONENT_NAME$P;
8982
7513
  GridColumn.className = CLASSNAME$P;
8983
- GridColumn.defaultProps = DEFAULT_PROPS$I;
7514
+ GridColumn.defaultProps = DEFAULT_PROPS$L;
8984
7515
 
8985
7516
  /**
8986
7517
  * Icon component.
@@ -9098,7 +7629,7 @@ const {
9098
7629
  /**
9099
7630
  * Component default props.
9100
7631
  */
9101
- const DEFAULT_PROPS$H = {
7632
+ const DEFAULT_PROPS$K = {
9102
7633
  captionPosition: ImageBlockCaptionPosition.below,
9103
7634
  align: Alignment.left
9104
7635
  };
@@ -9114,9 +7645,9 @@ const ImageBlock = forwardRef((props, ref) => {
9114
7645
  const defaultTheme = useTheme() || Theme$1.light;
9115
7646
  const {
9116
7647
  actions,
9117
- align = DEFAULT_PROPS$H.align,
7648
+ align = DEFAULT_PROPS$K.align,
9118
7649
  alt,
9119
- captionPosition = DEFAULT_PROPS$H.captionPosition,
7650
+ captionPosition = DEFAULT_PROPS$K.captionPosition,
9120
7651
  captionStyle,
9121
7652
  className,
9122
7653
  description,
@@ -9170,7 +7701,7 @@ const ImageBlock = forwardRef((props, ref) => {
9170
7701
  });
9171
7702
  ImageBlock.displayName = COMPONENT_NAME$O;
9172
7703
  ImageBlock.className = CLASSNAME$O;
9173
- ImageBlock.defaultProps = DEFAULT_PROPS$H;
7704
+ ImageBlock.defaultProps = DEFAULT_PROPS$K;
9174
7705
 
9175
7706
  /**
9176
7707
  * Component display name.
@@ -9930,7 +8461,7 @@ const {
9930
8461
  /**
9931
8462
  * Component default props.
9932
8463
  */
9933
- const DEFAULT_PROPS$G = {};
8464
+ const DEFAULT_PROPS$J = {};
9934
8465
 
9935
8466
  /**
9936
8467
  * InlineList component.
@@ -9983,7 +8514,7 @@ const InlineList = forwardRef((props, ref) => {
9983
8514
  });
9984
8515
  InlineList.displayName = COMPONENT_NAME$M;
9985
8516
  InlineList.className = CLASSNAME$M;
9986
- InlineList.defaultProps = DEFAULT_PROPS$G;
8517
+ InlineList.defaultProps = DEFAULT_PROPS$J;
9987
8518
 
9988
8519
  /**
9989
8520
  * InputHelper component.
@@ -10257,7 +8788,7 @@ const {
10257
8788
  /**
10258
8789
  * Component default props.
10259
8790
  */
10260
- const DEFAULT_PROPS$F = {
8791
+ const DEFAULT_PROPS$I = {
10261
8792
  size: Size$1.regular,
10262
8793
  titleHeading: 'h2'
10263
8794
  };
@@ -10277,11 +8808,11 @@ const LinkPreview = forwardRef((props, ref) => {
10277
8808
  link,
10278
8809
  linkAs,
10279
8810
  linkProps,
10280
- size = DEFAULT_PROPS$F.size,
8811
+ size = DEFAULT_PROPS$I.size,
10281
8812
  theme = defaultTheme,
10282
8813
  thumbnailProps,
10283
8814
  title,
10284
- titleHeading = DEFAULT_PROPS$F.titleHeading,
8815
+ titleHeading = DEFAULT_PROPS$I.titleHeading,
10285
8816
  ...forwardedProps
10286
8817
  } = props;
10287
8818
  // Use title heading as title wrapper (see DEFAULT_PROPS for the default value).
@@ -10349,7 +8880,7 @@ const LinkPreview = forwardRef((props, ref) => {
10349
8880
  });
10350
8881
  LinkPreview.displayName = COMPONENT_NAME$J;
10351
8882
  LinkPreview.className = CLASSNAME$J;
10352
- LinkPreview.defaultProps = DEFAULT_PROPS$F;
8883
+ LinkPreview.defaultProps = DEFAULT_PROPS$I;
10353
8884
 
10354
8885
  /**
10355
8886
  * Render link with default <a> HTML component or a custom one provided by `linkAs`.
@@ -10382,7 +8913,7 @@ const {
10382
8913
  /**
10383
8914
  * Component default props.
10384
8915
  */
10385
- const DEFAULT_PROPS$E = {
8916
+ const DEFAULT_PROPS$H = {
10386
8917
  size: Size$1.regular
10387
8918
  };
10388
8919
 
@@ -10421,7 +8952,7 @@ const ListItem = forwardRef((props, ref) => {
10421
8952
  linkProps = {},
10422
8953
  linkRef,
10423
8954
  onItemSelected,
10424
- size = DEFAULT_PROPS$E.size,
8955
+ size = DEFAULT_PROPS$H.size,
10425
8956
  ...forwardedProps
10426
8957
  } = otherProps;
10427
8958
  const role = linkAs || linkProps.href ? 'link' : 'button';
@@ -10478,7 +9009,7 @@ const ListItem = forwardRef((props, ref) => {
10478
9009
  });
10479
9010
  ListItem.displayName = COMPONENT_NAME$I;
10480
9011
  ListItem.className = CLASSNAME$I;
10481
- ListItem.defaultProps = DEFAULT_PROPS$E;
9012
+ ListItem.defaultProps = DEFAULT_PROPS$H;
10482
9013
 
10483
9014
  /**
10484
9015
  * Component display name.
@@ -10666,7 +9197,7 @@ const {
10666
9197
  /**
10667
9198
  * Component default props.
10668
9199
  */
10669
- const DEFAULT_PROPS$D = {};
9200
+ const DEFAULT_PROPS$G = {};
10670
9201
 
10671
9202
  /**
10672
9203
  * Mosaic component.
@@ -10733,7 +9264,7 @@ const Mosaic = forwardRef((props, ref) => {
10733
9264
  });
10734
9265
  Mosaic.displayName = COMPONENT_NAME$E;
10735
9266
  Mosaic.className = CLASSNAME$E;
10736
- Mosaic.defaultProps = DEFAULT_PROPS$D;
9267
+ Mosaic.defaultProps = DEFAULT_PROPS$G;
10737
9268
 
10738
9269
  const NavigationContext = /*#__PURE__*/createContext({
10739
9270
  orientation: Orientation$1.vertical
@@ -10922,7 +9453,7 @@ const {
10922
9453
  /**
10923
9454
  * Component default props
10924
9455
  */
10925
- const DEFAULT_PROPS$C = {
9456
+ const DEFAULT_PROPS$F = {
10926
9457
  orientation: Orientation$1.vertical
10927
9458
  };
10928
9459
  const Navigation = forwardRef((props, ref) => {
@@ -10931,7 +9462,7 @@ const Navigation = forwardRef((props, ref) => {
10931
9462
  children,
10932
9463
  className,
10933
9464
  theme = defaultTheme,
10934
- orientation = DEFAULT_PROPS$C.orientation,
9465
+ orientation = DEFAULT_PROPS$F.orientation,
10935
9466
  ...forwardedProps
10936
9467
  } = props;
10937
9468
  return /*#__PURE__*/jsx(ThemeProvider, {
@@ -10957,7 +9488,7 @@ const Navigation = forwardRef((props, ref) => {
10957
9488
  });
10958
9489
  Navigation.displayName = COMPONENT_NAME$C;
10959
9490
  Navigation.className = CLASSNAME$C;
10960
- Navigation.defaultProps = DEFAULT_PROPS$C;
9491
+ Navigation.defaultProps = DEFAULT_PROPS$F;
10961
9492
 
10962
9493
  // Sub components
10963
9494
  Navigation.Section = NavigationSection;
@@ -11002,7 +9533,7 @@ const {
11002
9533
  /**
11003
9534
  * Component default props.
11004
9535
  */
11005
- const DEFAULT_PROPS$B = {
9536
+ const DEFAULT_PROPS$E = {
11006
9537
  zIndex: 9999,
11007
9538
  usePortal: true
11008
9539
  };
@@ -11026,8 +9557,8 @@ const Notification = forwardRef((props, ref) => {
11026
9557
  onClick,
11027
9558
  theme = defaultTheme,
11028
9559
  type,
11029
- zIndex = DEFAULT_PROPS$B.zIndex,
11030
- usePortal = DEFAULT_PROPS$B.usePortal,
9560
+ zIndex = DEFAULT_PROPS$E.zIndex,
9561
+ usePortal = DEFAULT_PROPS$E.usePortal,
11031
9562
  style,
11032
9563
  ...forwardedProps
11033
9564
  } = props;
@@ -11092,7 +9623,7 @@ const Notification = forwardRef((props, ref) => {
11092
9623
  });
11093
9624
  Notification.displayName = COMPONENT_NAME$B;
11094
9625
  Notification.className = CLASSNAME$B;
11095
- Notification.defaultProps = DEFAULT_PROPS$B;
9626
+ Notification.defaultProps = DEFAULT_PROPS$E;
11096
9627
 
11097
9628
  /**
11098
9629
  * Component display name.
@@ -11107,7 +9638,7 @@ const CLASSNAME$A = 'lumx-popover-dialog';
11107
9638
  /**
11108
9639
  * Component default props.
11109
9640
  */
11110
- const DEFAULT_PROPS$A = {};
9641
+ const DEFAULT_PROPS$D = {};
11111
9642
 
11112
9643
  /**
11113
9644
  * PopoverDialog component.
@@ -11150,7 +9681,7 @@ const PopoverDialog = forwardRef((props, ref) => {
11150
9681
  });
11151
9682
  PopoverDialog.displayName = COMPONENT_NAME$A;
11152
9683
  PopoverDialog.className = CLASSNAME$A;
11153
- PopoverDialog.defaultProps = DEFAULT_PROPS$A;
9684
+ PopoverDialog.defaultProps = DEFAULT_PROPS$D;
11154
9685
 
11155
9686
  /**
11156
9687
  * Component display name.
@@ -11169,7 +9700,7 @@ const {
11169
9700
  /**
11170
9701
  * Component default props.
11171
9702
  */
11172
- const DEFAULT_PROPS$z = {
9703
+ const DEFAULT_PROPS$C = {
11173
9704
  orientation: Orientation$1.horizontal
11174
9705
  };
11175
9706
 
@@ -11189,7 +9720,7 @@ const PostBlock = forwardRef((props, ref) => {
11189
9720
  className,
11190
9721
  meta,
11191
9722
  onClick,
11192
- orientation = DEFAULT_PROPS$z.orientation,
9723
+ orientation = DEFAULT_PROPS$C.orientation,
11193
9724
  tags,
11194
9725
  text,
11195
9726
  theme = defaultTheme,
@@ -11251,7 +9782,7 @@ const PostBlock = forwardRef((props, ref) => {
11251
9782
  });
11252
9783
  PostBlock.displayName = COMPONENT_NAME$z;
11253
9784
  PostBlock.className = CLASSNAME$z;
11254
- PostBlock.defaultProps = DEFAULT_PROPS$z;
9785
+ PostBlock.defaultProps = DEFAULT_PROPS$C;
11255
9786
 
11256
9787
  /**
11257
9788
  * Component display name.
@@ -11270,7 +9801,7 @@ const {
11270
9801
  /**
11271
9802
  * Component default props.
11272
9803
  */
11273
- const DEFAULT_PROPS$y = {};
9804
+ const DEFAULT_PROPS$B = {};
11274
9805
 
11275
9806
  /**
11276
9807
  * ProgressLinear component.
@@ -11301,7 +9832,7 @@ const ProgressLinear = forwardRef((props, ref) => {
11301
9832
  });
11302
9833
  ProgressLinear.displayName = COMPONENT_NAME$y;
11303
9834
  ProgressLinear.className = CLASSNAME$y;
11304
- ProgressLinear.defaultProps = DEFAULT_PROPS$y;
9835
+ ProgressLinear.defaultProps = DEFAULT_PROPS$B;
11305
9836
 
11306
9837
  /**
11307
9838
  * Component display name.
@@ -11320,7 +9851,7 @@ const {
11320
9851
  /**
11321
9852
  * Component default props.
11322
9853
  */
11323
- const DEFAULT_PROPS$x = {
9854
+ const DEFAULT_PROPS$A = {
11324
9855
  size: Size$1.m,
11325
9856
  display: 'block'
11326
9857
  };
@@ -11337,8 +9868,8 @@ const ProgressCircular = forwardRef((props, ref) => {
11337
9868
  const {
11338
9869
  className,
11339
9870
  theme = defaultTheme,
11340
- size = DEFAULT_PROPS$x.size,
11341
- display = DEFAULT_PROPS$x.display,
9871
+ size = DEFAULT_PROPS$A.size,
9872
+ display = DEFAULT_PROPS$A.display,
11342
9873
  ...forwardedProps
11343
9874
  } = props;
11344
9875
  const Element = display === 'block' ? 'div' : 'span';
@@ -11370,7 +9901,7 @@ const ProgressCircular = forwardRef((props, ref) => {
11370
9901
  });
11371
9902
  ProgressCircular.displayName = COMPONENT_NAME$x;
11372
9903
  ProgressCircular.className = CLASSNAME$x;
11373
- ProgressCircular.defaultProps = DEFAULT_PROPS$x;
9904
+ ProgressCircular.defaultProps = DEFAULT_PROPS$A;
11374
9905
 
11375
9906
  const ProgressVariant = {
11376
9907
  linear: 'linear',
@@ -11397,7 +9928,7 @@ const {
11397
9928
  /**
11398
9929
  * Component default props.
11399
9930
  */
11400
- const DEFAULT_PROPS$w = {
9931
+ const DEFAULT_PROPS$z = {
11401
9932
  variant: ProgressVariant.circular
11402
9933
  };
11403
9934
 
@@ -11414,7 +9945,7 @@ const Progress = forwardRef((props, ref) => {
11414
9945
  const {
11415
9946
  className,
11416
9947
  theme = defaultTheme,
11417
- variant = DEFAULT_PROPS$w.variant,
9948
+ variant = DEFAULT_PROPS$z.variant,
11418
9949
  ...forwardedProps
11419
9950
  } = props;
11420
9951
  return /*#__PURE__*/jsxs("div", {
@@ -11433,7 +9964,7 @@ const Progress = forwardRef((props, ref) => {
11433
9964
  });
11434
9965
  Progress.displayName = COMPONENT_NAME$w;
11435
9966
  Progress.className = CLASSNAME$w;
11436
- Progress.defaultProps = DEFAULT_PROPS$w;
9967
+ Progress.defaultProps = DEFAULT_PROPS$z;
11437
9968
 
11438
9969
  const INIT_STATE = {
11439
9970
  isLazy: true,
@@ -11560,7 +10091,7 @@ const useTabProviderContextState = () => {
11560
10091
  return context?.[0];
11561
10092
  };
11562
10093
 
11563
- const DEFAULT_PROPS$v = {
10094
+ const DEFAULT_PROPS$y = {
11564
10095
  isLazy: INIT_STATE.isLazy,
11565
10096
  shouldActivateOnFocus: INIT_STATE.shouldActivateOnFocus
11566
10097
  };
@@ -11589,7 +10120,7 @@ const ProgressTrackerProvider = props => {
11589
10120
  dispatch({
11590
10121
  type: 'update',
11591
10122
  payload: {
11592
- ...DEFAULT_PROPS$v,
10123
+ ...DEFAULT_PROPS$y,
11593
10124
  ...propState,
11594
10125
  activeTabIndex: propState.activeStepIndex || INIT_STATE.activeTabIndex
11595
10126
  }
@@ -11612,7 +10143,7 @@ const ProgressTrackerProvider = props => {
11612
10143
  children: children
11613
10144
  });
11614
10145
  };
11615
- ProgressTrackerProvider.defaultProps = DEFAULT_PROPS$v;
10146
+ ProgressTrackerProvider.defaultProps = DEFAULT_PROPS$y;
11616
10147
 
11617
10148
  const useRovingTabIndex = ({
11618
10149
  parentRef,
@@ -11704,7 +10235,7 @@ const {
11704
10235
  /**
11705
10236
  * Component default props.
11706
10237
  */
11707
- const DEFAULT_PROPS$u = {};
10238
+ const DEFAULT_PROPS$x = {};
11708
10239
 
11709
10240
  /**
11710
10241
  * ProgressTracker component.
@@ -11760,7 +10291,7 @@ const ProgressTracker = forwardRef((props, ref) => {
11760
10291
  });
11761
10292
  ProgressTracker.displayName = COMPONENT_NAME$v;
11762
10293
  ProgressTracker.className = CLASSNAME$v;
11763
- ProgressTracker.defaultProps = DEFAULT_PROPS$u;
10294
+ ProgressTracker.defaultProps = DEFAULT_PROPS$x;
11764
10295
 
11765
10296
  /**
11766
10297
  * Component display name.
@@ -11779,7 +10310,7 @@ const {
11779
10310
  /**
11780
10311
  * Component default props.
11781
10312
  */
11782
- const DEFAULT_PROPS$t = {};
10313
+ const DEFAULT_PROPS$w = {};
11783
10314
 
11784
10315
  /**
11785
10316
  * ProgressTrackerStep component.
@@ -11874,7 +10405,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
11874
10405
  });
11875
10406
  ProgressTrackerStep.displayName = COMPONENT_NAME$u;
11876
10407
  ProgressTrackerStep.className = CLASSNAME$u;
11877
- ProgressTrackerStep.defaultProps = DEFAULT_PROPS$t;
10408
+ ProgressTrackerStep.defaultProps = DEFAULT_PROPS$w;
11878
10409
 
11879
10410
  /**
11880
10411
  * Component display name.
@@ -11892,7 +10423,7 @@ const {
11892
10423
  /**
11893
10424
  * Component default props.
11894
10425
  */
11895
- const DEFAULT_PROPS$s = {};
10426
+ const DEFAULT_PROPS$v = {};
11896
10427
 
11897
10428
  /**
11898
10429
  * ProgressTrackerStepPanel component.
@@ -11928,7 +10459,7 @@ const ProgressTrackerStepPanel = forwardRef((props, ref) => {
11928
10459
  });
11929
10460
  ProgressTrackerStepPanel.displayName = COMPONENT_NAME$t;
11930
10461
  ProgressTrackerStepPanel.className = CLASSNAME$t;
11931
- ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$s;
10462
+ ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$v;
11932
10463
 
11933
10464
  /**
11934
10465
  * Component display name.
@@ -11942,27 +10473,15 @@ const CLASSNAME$s = 'lumx-radio-button';
11942
10473
  const {
11943
10474
  block: block$p,
11944
10475
  element: element$h
11945
- } = classNames.bem(CLASSNAME$s);
11946
-
11947
- /**
11948
- * Component default props.
11949
- */
11950
- const DEFAULT_PROPS$r = {};
10476
+ } = bem(CLASSNAME$s);
11951
10477
 
11952
10478
  /**
11953
10479
  * RadioButton component.
11954
10480
  *
11955
10481
  * @param props Component props.
11956
- * @param ref Component ref.
11957
- * @return React element.
10482
+ * @return JSX element.
11958
10483
  */
11959
- const RadioButton = forwardRef((props, ref) => {
11960
- const {
11961
- isAnyDisabled,
11962
- disabledStateProps,
11963
- otherProps
11964
- } = useDisableStateProps(props);
11965
- const defaultTheme = useTheme() || Theme$1.light;
10484
+ const RadioButton$1 = props => {
11966
10485
  const {
11967
10486
  checked,
11968
10487
  className,
@@ -11972,14 +10491,15 @@ const RadioButton = forwardRef((props, ref) => {
11972
10491
  isChecked = checked,
11973
10492
  label,
11974
10493
  name,
10494
+ ref,
11975
10495
  onChange,
11976
- theme = defaultTheme,
10496
+ theme,
11977
10497
  value,
11978
- inputProps,
10498
+ inputProps = {},
10499
+ isDisabled,
10500
+ inputId,
11979
10501
  ...forwardedProps
11980
- } = otherProps;
11981
- const generatedInputId = useId();
11982
- const inputId = id || generatedInputId;
10502
+ } = props;
11983
10503
  const handleChange = event => {
11984
10504
  if (onChange) {
11985
10505
  onChange(value, name, event);
@@ -11988,9 +10508,9 @@ const RadioButton = forwardRef((props, ref) => {
11988
10508
  return /*#__PURE__*/jsxs("div", {
11989
10509
  ref: ref,
11990
10510
  ...forwardedProps,
11991
- className: classNames.join(className, block$p({
10511
+ className: classnames(className, block$p({
11992
10512
  'is-checked': isChecked,
11993
- 'is-disabled': isAnyDisabled,
10513
+ 'is-disabled': isDisabled,
11994
10514
  'is-unchecked': !isChecked,
11995
10515
  [`theme-${theme}`]: Boolean(theme)
11996
10516
  })),
@@ -11999,15 +10519,16 @@ const RadioButton = forwardRef((props, ref) => {
11999
10519
  children: [/*#__PURE__*/jsx("input", {
12000
10520
  ref: inputRef,
12001
10521
  className: element$h('input-native'),
12002
- ...disabledStateProps,
12003
10522
  id: inputId,
12004
10523
  type: "radio",
12005
10524
  name: name,
12006
10525
  value: value,
12007
10526
  checked: isChecked,
12008
10527
  onChange: handleChange,
12009
- readOnly: inputProps?.readOnly || isAnyDisabled,
12010
10528
  "aria-describedby": helper ? `${inputId}-helper` : undefined,
10529
+ ...(inputProps?.readOnly ? {
10530
+ readOnly: inputProps.readOnly
10531
+ } : {}),
12011
10532
  ...inputProps
12012
10533
  }), /*#__PURE__*/jsxs("div", {
12013
10534
  className: element$h('input-placeholder'),
@@ -12019,23 +10540,85 @@ const RadioButton = forwardRef((props, ref) => {
12019
10540
  })]
12020
10541
  }), /*#__PURE__*/jsxs("div", {
12021
10542
  className: element$h('content'),
12022
- children: [label && /*#__PURE__*/jsx(InputLabel, {
10543
+ children: [label && InputLabel$1({
12023
10544
  htmlFor: inputId,
12024
- theme: theme,
12025
10545
  className: element$h('label'),
10546
+ theme,
12026
10547
  children: label
12027
- }), helper && /*#__PURE__*/jsx(InputHelper, {
10548
+ }), helper && InputHelper$1({
12028
10549
  id: `${inputId}-helper`,
12029
- theme: theme,
12030
10550
  className: element$h('helper'),
10551
+ theme,
12031
10552
  children: helper
12032
10553
  })]
12033
10554
  })]
12034
10555
  });
10556
+ };
10557
+
10558
+ /**
10559
+ * Defines the props of the component.
10560
+ */
10561
+
10562
+ /**
10563
+ * Component default props.
10564
+ */
10565
+ const DEFAULT_PROPS$u = {};
10566
+
10567
+ /**
10568
+ * RadioButton component.
10569
+ *
10570
+ * @param props Component props.
10571
+ * @param ref Component ref.
10572
+ * @return React element.
10573
+ */
10574
+ const RadioButton = forwardRef((props, ref) => {
10575
+ const {
10576
+ isAnyDisabled,
10577
+ disabledStateProps,
10578
+ otherProps
10579
+ } = useDisableStateProps(props);
10580
+ const defaultTheme = useTheme() || Theme$1.light;
10581
+ const {
10582
+ checked,
10583
+ className,
10584
+ helper,
10585
+ id,
10586
+ inputRef,
10587
+ isChecked = checked,
10588
+ label,
10589
+ name,
10590
+ onChange,
10591
+ theme = defaultTheme,
10592
+ value,
10593
+ inputProps = {},
10594
+ ...forwardedProps
10595
+ } = otherProps;
10596
+ const generatedInputId = useId();
10597
+ const inputId = id || generatedInputId;
10598
+ return RadioButton$1({
10599
+ ref,
10600
+ className,
10601
+ helper,
10602
+ inputRef,
10603
+ isChecked,
10604
+ label,
10605
+ name,
10606
+ onChange,
10607
+ theme,
10608
+ value,
10609
+ inputProps: {
10610
+ ...inputProps,
10611
+ ...disabledStateProps,
10612
+ readOnly: inputProps.readOnly || disabledStateProps['aria-disabled']
10613
+ },
10614
+ ...forwardedProps,
10615
+ isDisabled: isAnyDisabled,
10616
+ inputId
10617
+ });
12035
10618
  });
12036
10619
  RadioButton.displayName = COMPONENT_NAME$s;
12037
10620
  RadioButton.className = CLASSNAME$s;
12038
- RadioButton.defaultProps = DEFAULT_PROPS$r;
10621
+ RadioButton.defaultProps = DEFAULT_PROPS$u;
12039
10622
 
12040
10623
  /**
12041
10624
  * Component display name.
@@ -12047,25 +10630,58 @@ const COMPONENT_NAME$r = 'RadioGroup';
12047
10630
  */
12048
10631
  const CLASSNAME$r = 'lumx-radio-group';
12049
10632
 
10633
+ /**
10634
+ * Component default props.
10635
+ */
10636
+ const DEFAULT_PROPS$t = {};
10637
+
12050
10638
  /**
12051
10639
  * RadioGroup component.
12052
10640
  *
12053
10641
  * @param props Component props.
12054
- * @param ref Component ref.
12055
- * @return React element.
10642
+ * @return JSX element.
12056
10643
  */
12057
- const RadioGroup = forwardRef((props, ref) => {
10644
+ const RadioGroup$1 = props => {
12058
10645
  const {
12059
10646
  children,
12060
10647
  className,
10648
+ ref,
12061
10649
  ...forwardedProps
12062
10650
  } = props;
12063
10651
  return /*#__PURE__*/jsx("div", {
12064
10652
  ref: ref,
12065
10653
  ...forwardedProps,
12066
- className: classNames.join(className, CLASSNAME$r),
10654
+ className: classnames(className, CLASSNAME$r),
12067
10655
  children: children
12068
10656
  });
10657
+ };
10658
+ RadioGroup$1.displayName = COMPONENT_NAME$r;
10659
+ RadioGroup$1.className = CLASSNAME$r;
10660
+ RadioGroup$1.defaultProps = DEFAULT_PROPS$t;
10661
+
10662
+ /**
10663
+ * Defines the props of the component.
10664
+ */
10665
+
10666
+ /**
10667
+ * RadioGroup component.
10668
+ *
10669
+ * @param props Component props.
10670
+ * @param ref Component ref.
10671
+ * @return React element.
10672
+ */
10673
+ const RadioGroup = forwardRef((props, ref) => {
10674
+ const {
10675
+ children,
10676
+ className,
10677
+ ...forwardedProps
10678
+ } = props;
10679
+ return RadioGroup$1({
10680
+ ref,
10681
+ className,
10682
+ children,
10683
+ ...forwardedProps
10684
+ });
12069
10685
  });
12070
10686
  RadioGroup.displayName = COMPONENT_NAME$r;
12071
10687
  RadioGroup.className = CLASSNAME$r;
@@ -12225,7 +10841,7 @@ const {
12225
10841
  } = classNames.bem(CLASSNAME$p);
12226
10842
 
12227
10843
  /** The default value of props. */
12228
- const DEFAULT_PROPS$q = {
10844
+ const DEFAULT_PROPS$s = {
12229
10845
  selectedValueRender: choice => choice,
12230
10846
  variant: SelectVariant.input
12231
10847
  };
@@ -12348,7 +10964,7 @@ const Select = forwardRef((props, ref) => {
12348
10964
  const isEmpty$1 = isEmpty(props.value);
12349
10965
  const hasInputClear = props.onClear && props.clearButtonProps && !isEmpty$1;
12350
10966
  return WithSelectContext(SelectField, {
12351
- ...DEFAULT_PROPS$q,
10967
+ ...DEFAULT_PROPS$s,
12352
10968
  ...props,
12353
10969
  className: classNames.join(props.className, block$n({
12354
10970
  'has-input-clear': hasInputClear,
@@ -12360,7 +10976,7 @@ const Select = forwardRef((props, ref) => {
12360
10976
  });
12361
10977
  Select.displayName = COMPONENT_NAME$q;
12362
10978
  Select.className = CLASSNAME$p;
12363
- Select.defaultProps = DEFAULT_PROPS$q;
10979
+ Select.defaultProps = DEFAULT_PROPS$s;
12364
10980
  Select.className = CLASSNAME$p;
12365
10981
 
12366
10982
  /** The display name of the component. */
@@ -12374,7 +10990,7 @@ const {
12374
10990
  } = classNames.bem(CLASSNAME$o);
12375
10991
 
12376
10992
  /** The default value of props. */
12377
- const DEFAULT_PROPS$p = {
10993
+ const DEFAULT_PROPS$r = {
12378
10994
  selectedChipRender(choice, index, onClear, isDisabled, theme) {
12379
10995
  const onClick = event => onClear && onClear(event, choice);
12380
10996
  return /*#__PURE__*/jsx(Chip, {
@@ -12500,7 +11116,7 @@ const SelectMultipleField = props => {
12500
11116
  */
12501
11117
  const SelectMultiple = forwardRef((props, ref) => {
12502
11118
  return WithSelectContext(SelectMultipleField, {
12503
- ...DEFAULT_PROPS$p,
11119
+ ...DEFAULT_PROPS$r,
12504
11120
  ...props,
12505
11121
  className: classNames.join(props.className, block$m({
12506
11122
  'has-multiple': !props.isEmpty
@@ -12511,7 +11127,7 @@ const SelectMultiple = forwardRef((props, ref) => {
12511
11127
  });
12512
11128
  SelectMultiple.displayName = COMPONENT_NAME$p;
12513
11129
  SelectMultiple.className = CLASSNAME$o;
12514
- SelectMultiple.defaultProps = DEFAULT_PROPS$p;
11130
+ SelectMultiple.defaultProps = DEFAULT_PROPS$r;
12515
11131
 
12516
11132
  /**
12517
11133
  * Component display name.
@@ -12566,7 +11182,7 @@ const {
12566
11182
  /**
12567
11183
  * Component default props.
12568
11184
  */
12569
- const DEFAULT_PROPS$o = {
11185
+ const DEFAULT_PROPS$q = {
12570
11186
  emphasis: Emphasis$1.high,
12571
11187
  closeMode: 'unmount'
12572
11188
  };
@@ -12582,7 +11198,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
12582
11198
  const {
12583
11199
  children,
12584
11200
  className,
12585
- emphasis = DEFAULT_PROPS$o.emphasis,
11201
+ emphasis = DEFAULT_PROPS$q.emphasis,
12586
11202
  icon,
12587
11203
  isOpen,
12588
11204
  isSelected,
@@ -12592,7 +11208,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
12592
11208
  onActionClick,
12593
11209
  onClick,
12594
11210
  toggleButtonProps,
12595
- closeMode = DEFAULT_PROPS$o.closeMode,
11211
+ closeMode = DEFAULT_PROPS$q.closeMode,
12596
11212
  ...forwardedProps
12597
11213
  } = props;
12598
11214
  const content = children && Children.toArray(children).filter(isComponent(SideNavigationItem));
@@ -12663,9 +11279,7 @@ const SideNavigationItem = forwardRef((props, ref) => {
12663
11279
  });
12664
11280
  SideNavigationItem.displayName = COMPONENT_NAME$n;
12665
11281
  SideNavigationItem.className = CLASSNAME$m;
12666
- SideNavigationItem.defaultProps = DEFAULT_PROPS$o;
12667
-
12668
- const DEFAULT_PROPS$n = {};
11282
+ SideNavigationItem.defaultProps = DEFAULT_PROPS$q;
12669
11283
 
12670
11284
  /**
12671
11285
  * Component display name.
@@ -12678,38 +11292,37 @@ const COMPONENT_NAME$m = 'SkeletonCircle';
12678
11292
  const CLASSNAME$l = 'lumx-skeleton-circle';
12679
11293
  const {
12680
11294
  block: block$k
12681
- } = classNames.bem(CLASSNAME$l);
11295
+ } = bem(CLASSNAME$l);
12682
11296
 
12683
11297
  /**
12684
11298
  * SkeletonCircle component.
12685
11299
  *
12686
11300
  * @param props Component props.
12687
- * @param ref Component ref.
12688
- * @return React element.
11301
+ * @return JSX element.
12689
11302
  */
12690
- const SkeletonCircle = forwardRef((props, ref) => {
12691
- const defaultTheme = useTheme() || Theme$1.light;
11303
+ const SkeletonCircle$1 = props => {
12692
11304
  const {
12693
11305
  className,
12694
11306
  size,
12695
11307
  color,
12696
- theme = defaultTheme,
11308
+ theme,
11309
+ ref,
12697
11310
  ...forwardedProps
12698
11311
  } = props;
12699
11312
  return /*#__PURE__*/jsx("div", {
12700
11313
  ref: ref,
12701
11314
  ...forwardedProps,
12702
- className: classNames.join(className, block$k({
11315
+ className: classnames(className, block$k({
12703
11316
  [`size-${size}`]: Boolean(size),
12704
11317
  [`color-${color}`]: Boolean(color),
12705
11318
  [`theme-${theme}`]: Boolean(theme)
12706
11319
  }))
12707
11320
  });
12708
- });
12709
- SkeletonCircle.displayName = COMPONENT_NAME$m;
12710
- SkeletonCircle.defaultProps = DEFAULT_PROPS$n;
12711
- SkeletonCircle.className = CLASSNAME$l;
11321
+ };
12712
11322
 
11323
+ /**
11324
+ * Skeleton variants.
11325
+ */
12713
11326
  const SkeletonRectangleVariant = {
12714
11327
  squared: 'squared',
12715
11328
  rounded: 'rounded',
@@ -12720,10 +11333,6 @@ const SkeletonRectangleVariant = {
12720
11333
  * Defines the props of the component.
12721
11334
  */
12722
11335
 
12723
- const DEFAULT_PROPS$m = {
12724
- variant: SkeletonRectangleVariant.squared
12725
- };
12726
-
12727
11336
  /**
12728
11337
  * Component display name.
12729
11338
  */
@@ -12736,31 +11345,37 @@ const CLASSNAME$k = 'lumx-skeleton-rectangle';
12736
11345
  const {
12737
11346
  block: block$j,
12738
11347
  element: element$c
12739
- } = classNames.bem(CLASSNAME$k);
11348
+ } = bem(CLASSNAME$k);
11349
+
11350
+ /**
11351
+ * Component default props.
11352
+ */
11353
+ const DEFAULT_PROPS$p = {
11354
+ variant: SkeletonRectangleVariant.squared
11355
+ };
12740
11356
 
12741
11357
  /**
12742
11358
  * SkeletonRectangle component.
12743
11359
  *
12744
11360
  * @param props Component props.
12745
- * @param ref Component ref.
12746
- * @return React element.
11361
+ * @return JSX element.
12747
11362
  */
12748
- const SkeletonRectangle = forwardRef((props, ref) => {
12749
- const defaultTheme = useTheme() || Theme$1.light;
11363
+ const SkeletonRectangle$1 = props => {
12750
11364
  const {
12751
11365
  aspectRatio,
12752
11366
  className,
12753
11367
  height,
12754
- theme = defaultTheme,
12755
- variant = DEFAULT_PROPS$m.variant,
11368
+ theme,
11369
+ variant = DEFAULT_PROPS$p.variant,
12756
11370
  width,
12757
11371
  color,
11372
+ ref,
12758
11373
  ...forwardedProps
12759
11374
  } = props;
12760
11375
  return /*#__PURE__*/jsx("div", {
12761
11376
  ref: ref,
12762
11377
  ...forwardedProps,
12763
- className: classNames.join(className, block$j({
11378
+ className: classnames(className, block$j({
12764
11379
  [`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
12765
11380
  [`height-${height}`]: Boolean(aspectRatio ? undefined : height),
12766
11381
  [`theme-${theme}`]: Boolean(theme),
@@ -12772,12 +11387,7 @@ const SkeletonRectangle = forwardRef((props, ref) => {
12772
11387
  className: element$c('inner')
12773
11388
  })
12774
11389
  });
12775
- });
12776
- SkeletonRectangle.displayName = COMPONENT_NAME$l;
12777
- SkeletonRectangle.className = CLASSNAME$k;
12778
- SkeletonRectangle.defaultProps = DEFAULT_PROPS$m;
12779
-
12780
- const DEFAULT_PROPS$l = {};
11390
+ };
12781
11391
 
12782
11392
  /**
12783
11393
  * Component display name.
@@ -12791,29 +11401,28 @@ const CLASSNAME$j = 'lumx-skeleton-typography';
12791
11401
  const {
12792
11402
  block: block$i,
12793
11403
  element: element$b
12794
- } = classNames.bem(CLASSNAME$j);
11404
+ } = bem(CLASSNAME$j);
12795
11405
 
12796
11406
  /**
12797
11407
  * SkeletonTypography component.
12798
11408
  *
12799
11409
  * @param props Component props.
12800
- * @param ref Component ref.
12801
- * @return React element.
11410
+ * @return JSX element.
12802
11411
  */
12803
- const SkeletonTypography = forwardRef((props, ref) => {
12804
- const defaultTheme = useTheme() || Theme$1.light;
11412
+ const SkeletonTypography$1 = props => {
12805
11413
  const {
12806
11414
  className,
12807
- theme = defaultTheme,
11415
+ theme,
12808
11416
  typography,
12809
11417
  width,
12810
11418
  color,
11419
+ ref,
12811
11420
  ...forwardedProps
12812
11421
  } = props;
12813
11422
  return /*#__PURE__*/jsx("div", {
12814
11423
  ref: ref,
12815
11424
  ...forwardedProps,
12816
- className: classNames.join(className, block$i({
11425
+ className: classnames(className, block$i({
12817
11426
  [`theme-${theme}`]: Boolean(theme),
12818
11427
  [`typography-${typography}`]: Boolean(typography),
12819
11428
  [`color-${color}`]: Boolean(color)
@@ -12826,9 +11435,119 @@ const SkeletonTypography = forwardRef((props, ref) => {
12826
11435
  className: element$b('inner')
12827
11436
  })
12828
11437
  });
11438
+ };
11439
+
11440
+ /**
11441
+ * Defines the props of the component.
11442
+ */
11443
+
11444
+ const DEFAULT_PROPS$o = {};
11445
+
11446
+ /**
11447
+ * SkeletonCircle component.
11448
+ *
11449
+ * @param props Component props.
11450
+ * @param ref Component ref.
11451
+ * @return React element.
11452
+ */
11453
+ const SkeletonCircle = forwardRef((props, ref) => {
11454
+ const defaultTheme = useTheme() || Theme$1.light;
11455
+ const {
11456
+ className,
11457
+ size,
11458
+ color,
11459
+ theme = defaultTheme,
11460
+ ...forwardedProps
11461
+ } = props;
11462
+ return SkeletonCircle$1({
11463
+ ref,
11464
+ className,
11465
+ size,
11466
+ color,
11467
+ theme,
11468
+ ...forwardedProps
11469
+ });
11470
+ });
11471
+ SkeletonCircle.displayName = COMPONENT_NAME$m;
11472
+ SkeletonCircle.defaultProps = DEFAULT_PROPS$o;
11473
+ SkeletonCircle.className = CLASSNAME$l;
11474
+
11475
+ /**
11476
+ * Defines the props of the component.
11477
+ */
11478
+
11479
+ const DEFAULT_PROPS$n = DEFAULT_PROPS$p;
11480
+
11481
+ /**
11482
+ * SkeletonRectangle component.
11483
+ *
11484
+ * @param props Component props.
11485
+ * @param ref Component ref.
11486
+ * @return React element.
11487
+ */
11488
+ const SkeletonRectangle = forwardRef((props, ref) => {
11489
+ const defaultTheme = useTheme() || Theme$1.light;
11490
+ const {
11491
+ aspectRatio,
11492
+ className,
11493
+ height,
11494
+ theme = defaultTheme,
11495
+ variant = DEFAULT_PROPS$n.variant,
11496
+ width,
11497
+ color,
11498
+ ...forwardedProps
11499
+ } = props;
11500
+ return SkeletonRectangle$1({
11501
+ ref,
11502
+ aspectRatio,
11503
+ className,
11504
+ height,
11505
+ theme,
11506
+ variant,
11507
+ width,
11508
+ color,
11509
+ ...forwardedProps
11510
+ });
11511
+ });
11512
+ SkeletonRectangle.displayName = COMPONENT_NAME$l;
11513
+ SkeletonRectangle.className = CLASSNAME$k;
11514
+ SkeletonRectangle.defaultProps = DEFAULT_PROPS$n;
11515
+
11516
+ /**
11517
+ * Defines the props of the component.
11518
+ */
11519
+
11520
+ const DEFAULT_PROPS$m = {};
11521
+
11522
+ /**
11523
+ * SkeletonTypography component.
11524
+ *
11525
+ * @param props Component props.
11526
+ * @param ref Component ref.
11527
+ * @return React element.
11528
+ */
11529
+ const SkeletonTypography = forwardRef((props, ref) => {
11530
+ const defaultTheme = useTheme() || Theme$1.light;
11531
+ const {
11532
+ className,
11533
+ theme = defaultTheme,
11534
+ typography,
11535
+ width,
11536
+ color,
11537
+ ...forwardedProps
11538
+ } = props;
11539
+ return SkeletonTypography$1({
11540
+ ref,
11541
+ className,
11542
+ theme,
11543
+ typography,
11544
+ width,
11545
+ color,
11546
+ ...forwardedProps
11547
+ });
12829
11548
  });
12830
11549
  SkeletonTypography.displayName = COMPONENT_NAME$k;
12831
- SkeletonTypography.defaultProps = DEFAULT_PROPS$l;
11550
+ SkeletonTypography.defaultProps = DEFAULT_PROPS$m;
12832
11551
  SkeletonTypography.className = CLASSNAME$j;
12833
11552
 
12834
11553
  const useEnhancedEffect = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
@@ -12883,7 +11602,7 @@ const {
12883
11602
  /**
12884
11603
  * Component default props.
12885
11604
  */
12886
- const DEFAULT_PROPS$k = {
11605
+ const DEFAULT_PROPS$l = {
12887
11606
  precision: 0,
12888
11607
  steps: 0
12889
11608
  };
@@ -12934,8 +11653,8 @@ const Slider = forwardRef((props, ref) => {
12934
11653
  name,
12935
11654
  onChange,
12936
11655
  onMouseDown,
12937
- precision = DEFAULT_PROPS$k.precision,
12938
- steps = DEFAULT_PROPS$k.steps,
11656
+ precision = DEFAULT_PROPS$l.precision,
11657
+ steps = DEFAULT_PROPS$l.steps,
12939
11658
  theme = defaultTheme,
12940
11659
  value,
12941
11660
  ...forwardedProps
@@ -13138,7 +11857,7 @@ const Slider = forwardRef((props, ref) => {
13138
11857
  });
13139
11858
  Slider.displayName = COMPONENT_NAME$j;
13140
11859
  Slider.className = CLASSNAME$i;
13141
- Slider.defaultProps = DEFAULT_PROPS$k;
11860
+ Slider.defaultProps = DEFAULT_PROPS$l;
13142
11861
 
13143
11862
  /**
13144
11863
  * Making setInterval Declarative with React Hooks.
@@ -13516,7 +12235,7 @@ SlideshowItemGroup.className = CLASSNAME$h;
13516
12235
  /**
13517
12236
  * Component default props.
13518
12237
  */
13519
- const DEFAULT_PROPS$j = {
12238
+ const DEFAULT_PROPS$k = {
13520
12239
  ...DEFAULT_OPTIONS,
13521
12240
  slideMode: SlideMode.transformTranslate
13522
12241
  };
@@ -13532,19 +12251,19 @@ const Slideshow = forwardRef((props, ref) => {
13532
12251
  const defaultTheme = useTheme() || Theme$1.light;
13533
12252
  const {
13534
12253
  activeIndex,
13535
- autoPlay = DEFAULT_PROPS$j.autoPlay,
12254
+ autoPlay = DEFAULT_PROPS$k.autoPlay,
13536
12255
  children,
13537
12256
  className,
13538
12257
  fillHeight,
13539
12258
  groupBy = DEFAULT_OPTIONS.groupBy,
13540
- interval = DEFAULT_PROPS$j.interval,
12259
+ interval = DEFAULT_PROPS$k.interval,
13541
12260
  onChange,
13542
12261
  slideshowControlsProps,
13543
12262
  theme = defaultTheme,
13544
12263
  id,
13545
12264
  slidesId,
13546
12265
  slideGroupLabel,
13547
- slideMode = DEFAULT_PROPS$j.slideMode,
12266
+ slideMode = DEFAULT_PROPS$k.slideMode,
13548
12267
  ...forwardedProps
13549
12268
  } = props;
13550
12269
  // Number of slideshow items.
@@ -13566,7 +12285,7 @@ const Slideshow = forwardRef((props, ref) => {
13566
12285
  toggleForcePause
13567
12286
  } = SlideshowControls.useSlideshowControls({
13568
12287
  activeIndex,
13569
- defaultActiveIndex: DEFAULT_PROPS$j.activeIndex,
12288
+ defaultActiveIndex: DEFAULT_PROPS$k.activeIndex,
13570
12289
  autoPlay: Boolean(autoPlay),
13571
12290
  itemsCount,
13572
12291
  groupBy,
@@ -13636,7 +12355,7 @@ const Slideshow = forwardRef((props, ref) => {
13636
12355
  });
13637
12356
  });
13638
12357
  Slideshow.displayName = 'Slideshow';
13639
- Slideshow.defaultProps = DEFAULT_PROPS$j;
12358
+ Slideshow.defaultProps = DEFAULT_PROPS$k;
13640
12359
 
13641
12360
  /**
13642
12361
  * Component display name.
@@ -13745,7 +12464,7 @@ const {
13745
12464
  /**
13746
12465
  * Component default props.
13747
12466
  */
13748
- const DEFAULT_PROPS$i = {
12467
+ const DEFAULT_PROPS$j = {
13749
12468
  activeIndex: 0
13750
12469
  };
13751
12470
 
@@ -13759,7 +12478,7 @@ const DEFAULT_PROPS$i = {
13759
12478
  const InternalSlideshowControls = forwardRef((props, ref) => {
13760
12479
  const defaultTheme = useTheme() || Theme$1.light;
13761
12480
  const {
13762
- activeIndex = DEFAULT_PROPS$i.activeIndex,
12481
+ activeIndex = DEFAULT_PROPS$j.activeIndex,
13763
12482
  className,
13764
12483
  nextButtonProps,
13765
12484
  onNextClick,
@@ -13874,7 +12593,7 @@ const InternalSlideshowControls = forwardRef((props, ref) => {
13874
12593
  });
13875
12594
  InternalSlideshowControls.displayName = COMPONENT_NAME$g;
13876
12595
  InternalSlideshowControls.className = CLASSNAME$f;
13877
- InternalSlideshowControls.defaultProps = DEFAULT_PROPS$i;
12596
+ InternalSlideshowControls.defaultProps = DEFAULT_PROPS$j;
13878
12597
  const SlideshowControls = Object.assign(InternalSlideshowControls, {
13879
12598
  useSlideshowControls,
13880
12599
  useSlideshowControlsDefaultOptions: DEFAULT_OPTIONS
@@ -14006,7 +12725,7 @@ const {
14006
12725
  /**
14007
12726
  * Component default props.
14008
12727
  */
14009
- const DEFAULT_PROPS$h = {
12728
+ const DEFAULT_PROPS$i = {
14010
12729
  slideMode: SlideMode.transformTranslate
14011
12730
  };
14012
12731
 
@@ -14033,7 +12752,7 @@ const Slides = forwardRef((props, ref) => {
14033
12752
  afterSlides,
14034
12753
  hasControls,
14035
12754
  slideGroupLabel,
14036
- slideMode = DEFAULT_PROPS$h.slideMode,
12755
+ slideMode = DEFAULT_PROPS$i.slideMode,
14037
12756
  onChange,
14038
12757
  ...forwardedProps
14039
12758
  } = props;
@@ -14115,46 +12834,41 @@ const CLASSNAME$d = 'lumx-switch';
14115
12834
  const {
14116
12835
  block: block$e,
14117
12836
  element: element$7
14118
- } = classNames.bem(CLASSNAME$d);
12837
+ } = bem(CLASSNAME$d);
14119
12838
 
14120
12839
  /**
14121
12840
  * Component default props.
14122
12841
  */
14123
- const DEFAULT_PROPS$g = {
14124
- position: Alignment.left
12842
+ const DEFAULT_PROPS$h = {
12843
+ position: 'left'
14125
12844
  };
14126
12845
 
14127
12846
  /**
14128
12847
  * Switch component.
14129
12848
  *
14130
12849
  * @param props Component props.
14131
- * @param ref Component ref.
14132
- * @return React element.
12850
+ * @return JSX element.
14133
12851
  */
14134
- const Switch = forwardRef((props, ref) => {
14135
- const {
14136
- isAnyDisabled,
14137
- disabledStateProps,
14138
- otherProps
14139
- } = useDisableStateProps(props);
14140
- const defaultTheme = useTheme() || Theme$1.light;
12852
+ const Switch$1 = props => {
14141
12853
  const {
14142
12854
  checked,
14143
- children,
14144
12855
  className,
14145
12856
  helper,
14146
12857
  id,
12858
+ inputRef,
14147
12859
  isChecked = checked,
12860
+ label,
14148
12861
  name,
12862
+ ref,
14149
12863
  onChange,
14150
- position = DEFAULT_PROPS$g.position,
14151
- theme = defaultTheme,
12864
+ theme,
14152
12865
  value,
14153
12866
  inputProps = {},
12867
+ isDisabled,
12868
+ inputId,
12869
+ position = DEFAULT_PROPS$h.position,
14154
12870
  ...forwardedProps
14155
- } = otherProps;
14156
- const generatedInputId = useId();
14157
- const inputId = id || generatedInputId;
12871
+ } = props;
14158
12872
  const handleChange = event => {
14159
12873
  if (onChange) {
14160
12874
  onChange(!isChecked, value, name, event);
@@ -14163,28 +12877,30 @@ const Switch = forwardRef((props, ref) => {
14163
12877
  return /*#__PURE__*/jsxs("div", {
14164
12878
  ref: ref,
14165
12879
  ...forwardedProps,
14166
- className: classNames.join(className, block$e({
12880
+ className: classnames(className, block$e({
14167
12881
  'is-checked': isChecked,
14168
- 'is-disabled': isAnyDisabled,
12882
+ 'is-disabled': isDisabled,
12883
+ 'is-unchecked': !isChecked,
14169
12884
  [`position-${position}`]: Boolean(position),
14170
- [`theme-${theme}`]: Boolean(theme),
14171
- 'is-unchecked': !isChecked
12885
+ [`theme-${theme}`]: Boolean(theme)
14172
12886
  })),
14173
12887
  children: [/*#__PURE__*/jsxs("div", {
14174
12888
  className: element$7('input-wrapper'),
14175
12889
  children: [/*#__PURE__*/jsx("input", {
12890
+ ref: inputRef,
14176
12891
  type: "checkbox",
14177
12892
  role: "switch",
14178
12893
  id: inputId,
14179
12894
  className: element$7('input-native'),
14180
12895
  name: name,
14181
12896
  value: value,
14182
- ...disabledStateProps,
14183
- readOnly: inputProps.readOnly || isAnyDisabled,
14184
- checked: isChecked,
14185
- "aria-checked": Boolean(isChecked),
12897
+ checked: Boolean(isChecked),
14186
12898
  onChange: handleChange,
14187
12899
  "aria-describedby": helper ? `${inputId}-helper` : undefined,
12900
+ "aria-checked": Boolean(isChecked),
12901
+ ...(inputProps?.readOnly ? {
12902
+ readOnly: inputProps.readOnly
12903
+ } : {}),
14188
12904
  ...inputProps
14189
12905
  }), /*#__PURE__*/jsxs("div", {
14190
12906
  className: element$7('input-placeholder'),
@@ -14194,21 +12910,88 @@ const Switch = forwardRef((props, ref) => {
14194
12910
  className: element$7('input-indicator')
14195
12911
  })]
14196
12912
  })]
14197
- }), Children.count(children) > 0 && /*#__PURE__*/jsxs("div", {
12913
+ }), /*#__PURE__*/jsxs("div", {
14198
12914
  className: element$7('content'),
14199
- children: [/*#__PURE__*/jsx(InputLabel, {
12915
+ children: [label && InputLabel$1({
14200
12916
  htmlFor: inputId,
14201
- theme: theme,
14202
12917
  className: element$7('label'),
14203
- children: children
14204
- }), !isEmpty(helper) && /*#__PURE__*/jsx(InputHelper, {
12918
+ theme,
12919
+ children: label
12920
+ }), helper && InputHelper$1({
14205
12921
  id: `${inputId}-helper`,
14206
- theme: theme,
14207
12922
  className: element$7('helper'),
12923
+ theme,
14208
12924
  children: helper
14209
12925
  })]
14210
12926
  })]
14211
12927
  });
12928
+ };
12929
+
12930
+ /**
12931
+ * Defines the props of the component.
12932
+ */
12933
+
12934
+ /**
12935
+ * Component default props.
12936
+ */
12937
+ const DEFAULT_PROPS$g = {
12938
+ position: Alignment.left
12939
+ };
12940
+
12941
+ /**
12942
+ * Switch component.
12943
+ *
12944
+ * @param props Component props.
12945
+ * @param ref Component ref.
12946
+ * @return React element.
12947
+ */
12948
+ const Switch = forwardRef((props, ref) => {
12949
+ const {
12950
+ isAnyDisabled,
12951
+ disabledStateProps,
12952
+ otherProps
12953
+ } = useDisableStateProps(props);
12954
+ const defaultTheme = useTheme() || Theme$1.light;
12955
+ const {
12956
+ checked,
12957
+ children,
12958
+ className,
12959
+ helper,
12960
+ id,
12961
+ inputRef,
12962
+ isChecked = checked,
12963
+ name,
12964
+ onChange,
12965
+ position = DEFAULT_PROPS$g.position,
12966
+ theme = defaultTheme,
12967
+ value,
12968
+ inputProps = {},
12969
+ ...forwardedProps
12970
+ } = otherProps;
12971
+ const localInputRef = React__default.useRef(null);
12972
+ const generatedInputId = useId();
12973
+ const inputId = id || generatedInputId;
12974
+ return Switch$1({
12975
+ ref,
12976
+ className,
12977
+ helper,
12978
+ inputRef: useMergeRefs(inputRef, localInputRef),
12979
+ isChecked,
12980
+ label: children,
12981
+ name,
12982
+ onChange,
12983
+ position,
12984
+ theme,
12985
+ value,
12986
+ inputProps: {
12987
+ ...inputProps,
12988
+ ...disabledStateProps,
12989
+ readOnly: inputProps.readOnly || isAnyDisabled
12990
+ },
12991
+ ...forwardedProps,
12992
+ isDisabled: isAnyDisabled,
12993
+ inputId
12994
+ });
14212
12995
  });
14213
12996
  Switch.displayName = COMPONENT_NAME$e;
14214
12997
  Switch.className = CLASSNAME$d;
@@ -16163,5 +14946,5 @@ UserBlock.displayName = COMPONENT_NAME;
16163
14946
  UserBlock.className = CLASSNAME;
16164
14947
  UserBlock.defaultProps = DEFAULT_PROPS;
16165
14948
 
16166
- export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$1g as CLASSNAME, COMPONENT_NAME$1e as COMPONENT_NAME, Checkbox, Chip, ChipGroup, Combobox, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$11 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, SUB_COMPONENTS, Select, SelectMultiple, SelectMultipleField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
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$14 as DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectMultiple, SelectMultipleField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
16167
14950
  //# sourceMappingURL=index.js.map