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

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,8 +1,8 @@
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';
1
+ import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio as AspectRatio$1, ColorVariant, REAL_SIZE_FOR_LUMX_SIZE, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
2
2
  export * from '@lumx/core/js/constants';
3
3
  export * from '@lumx/core/js/types';
4
4
  import * as React from 'react';
5
- import React__default, { useState, useEffect, useMemo, useRef, useCallback, Children, useLayoutEffect, cloneElement, createContext, isValidElement, useContext, useReducer } from 'react';
5
+ import React__default, { useState, useEffect, useMemo, useRef, useCallback, useContext, createContext, useReducer, Children, useLayoutEffect, cloneElement, isValidElement } from 'react';
6
6
  import { mdiAlert } from '@lumx/icons/esm/alert';
7
7
  import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle';
8
8
  import { mdiCheckCircle } from '@lumx/icons/esm/check-circle';
@@ -16,7 +16,7 @@ import concat from 'lodash/concat';
16
16
  import dropRight from 'lodash/dropRight';
17
17
  import partition from 'lodash/partition';
18
18
  import reduce from 'lodash/reduce';
19
- import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/DpdvhbTO.js';
19
+ import { u as useDisabledStateContext, a as useVirtualFocusParent, M as MovingFocusContext, i as isComboboxValue, b as useComboboxRefs, c as useCombobox, S as SectionContext, g as generateOptionId, d as useVirtualFocus, A as A11YLiveMessage, C as ComboboxContext, e as MovingFocusProvider, r as reducer$1, f as initialState, h as ComboboxRefsProvider, P as Portal, j as ClickAwayProvider } from './_internal/BCgo9dYV.js';
20
20
  import isEmpty from 'lodash/isEmpty';
21
21
  import { getDisabledState } from '@lumx/core/js/utils/disabledState';
22
22
  import { mdiCloseCircle } from '@lumx/icons/esm/close-circle';
@@ -24,15 +24,18 @@ import memoize from 'lodash/memoize';
24
24
  import { mdiClose } from '@lumx/icons/esm/close';
25
25
  import isFunction from 'lodash/isFunction';
26
26
  import { mdiImageBroken } from '@lumx/icons/esm/image-broken';
27
+ import noop from 'lodash/noop';
28
+ import castArray from 'lodash/castArray';
27
29
  import { mdiCheck } from '@lumx/icons/esm/check';
28
30
  import { mdiMinus } from '@lumx/icons/esm/minus';
31
+ import { visuallyHidden, bem as bem$1 } from '@lumx/core/js/utils/classNames';
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 { mdiInformationOutline } from '@lumx/icons/esm/information-outline';
29
36
  import { mdiChevronLeft } from '@lumx/icons/esm/chevron-left';
30
37
  import { mdiChevronRight } from '@lumx/icons/esm/chevron-right';
31
- import castArray from 'lodash/castArray';
32
38
  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';
36
39
  import pick from 'lodash/pick';
37
40
  import isInteger from 'lodash/isInteger';
38
41
  import { mdiMagnifyMinusOutline } from '@lumx/icons/esm/magnify-minus-outline';
@@ -101,15 +104,15 @@ const COMPONENT_NAME$1l = 'AlertDialog';
101
104
  /**
102
105
  * Component default class name and class prefix.
103
106
  */
104
- const CLASSNAME$1j = 'lumx-alert-dialog';
107
+ const CLASSNAME$1n = 'lumx-alert-dialog';
105
108
  const {
106
- block: block$14
107
- } = classNames.bem(CLASSNAME$1j);
109
+ block: block$19
110
+ } = classNames.bem(CLASSNAME$1n);
108
111
 
109
112
  /**
110
113
  * Component default props.
111
114
  */
112
- const DEFAULT_PROPS$19 = {
115
+ const DEFAULT_PROPS$1b = {
113
116
  size: Size$1.tiny,
114
117
  kind: Kind$1.info
115
118
  };
@@ -130,8 +133,8 @@ const AlertDialog = forwardRef((props, ref) => {
130
133
  className,
131
134
  cancelProps,
132
135
  confirmProps,
133
- kind = DEFAULT_PROPS$19.kind,
134
- size = DEFAULT_PROPS$19.size,
136
+ kind = DEFAULT_PROPS$1b.kind,
137
+ size = DEFAULT_PROPS$1b.size,
135
138
  dialogProps,
136
139
  children,
137
140
  ...forwardedProps
@@ -172,7 +175,7 @@ const AlertDialog = forwardRef((props, ref) => {
172
175
  'aria-describedby': descriptionId,
173
176
  ...dialogProps
174
177
  },
175
- className: classNames.join(className, block$14({
178
+ className: classNames.join(className, block$19({
176
179
  [`kind-${kind}`]: Boolean(kind)
177
180
  })),
178
181
  ...forwardedProps,
@@ -218,8 +221,8 @@ const AlertDialog = forwardRef((props, ref) => {
218
221
  });
219
222
  });
220
223
  AlertDialog.displayName = COMPONENT_NAME$1l;
221
- AlertDialog.className = CLASSNAME$1j;
222
- AlertDialog.defaultProps = DEFAULT_PROPS$19;
224
+ AlertDialog.className = CLASSNAME$1n;
225
+ AlertDialog.defaultProps = DEFAULT_PROPS$1b;
223
226
 
224
227
  /**
225
228
  * Hook focusing an element when defined and `focus` boolean `true`.
@@ -316,12 +319,12 @@ const COMPONENT_NAME$1k = 'Autocomplete';
316
319
  /**
317
320
  * Component default class name and class prefix.
318
321
  */
319
- const CLASSNAME$1i = 'lumx-autocomplete';
322
+ const CLASSNAME$1m = 'lumx-autocomplete';
320
323
 
321
324
  /**
322
325
  * Component default props.
323
326
  */
324
- const DEFAULT_PROPS$18 = {
327
+ const DEFAULT_PROPS$1a = {
325
328
  anchorToInput: false,
326
329
  closeOnClick: false,
327
330
  closeOnClickAway: true,
@@ -343,13 +346,13 @@ const Autocomplete = forwardRef((props, ref) => {
343
346
  otherProps
344
347
  } = useDisableStateProps(props);
345
348
  const {
346
- anchorToInput = DEFAULT_PROPS$18.anchorToInput,
349
+ anchorToInput = DEFAULT_PROPS$1a.anchorToInput,
347
350
  children,
348
351
  chips,
349
352
  className,
350
- closeOnClick = DEFAULT_PROPS$18.closeOnClick,
351
- closeOnClickAway = DEFAULT_PROPS$18.closeOnClickAway,
352
- closeOnEscape = DEFAULT_PROPS$18.closeOnEscape,
353
+ closeOnClick = DEFAULT_PROPS$1a.closeOnClick,
354
+ closeOnClickAway = DEFAULT_PROPS$1a.closeOnClickAway,
355
+ closeOnEscape = DEFAULT_PROPS$1a.closeOnEscape,
353
356
  error,
354
357
  fitToAnchorWidth,
355
358
  hasError,
@@ -370,7 +373,7 @@ const Autocomplete = forwardRef((props, ref) => {
370
373
  onInfiniteScroll,
371
374
  placeholder,
372
375
  placement,
373
- shouldFocusOnClose = DEFAULT_PROPS$18.shouldFocusOnClose,
376
+ shouldFocusOnClose = DEFAULT_PROPS$1a.shouldFocusOnClose,
374
377
  theme = defaultTheme,
375
378
  value,
376
379
  textFieldProps = {},
@@ -383,7 +386,7 @@ const Autocomplete = forwardRef((props, ref) => {
383
386
  return /*#__PURE__*/jsxs("div", {
384
387
  ref: ref,
385
388
  ...forwardedProps,
386
- className: classNames.join(className, CLASSNAME$1i),
389
+ className: classNames.join(className, CLASSNAME$1m),
387
390
  children: [/*#__PURE__*/jsx(TextField, {
388
391
  ...textFieldProps,
389
392
  chips: chips,
@@ -424,8 +427,8 @@ const Autocomplete = forwardRef((props, ref) => {
424
427
  });
425
428
  });
426
429
  Autocomplete.displayName = COMPONENT_NAME$1k;
427
- Autocomplete.className = CLASSNAME$1i;
428
- Autocomplete.defaultProps = DEFAULT_PROPS$18;
430
+ Autocomplete.className = CLASSNAME$1m;
431
+ Autocomplete.defaultProps = DEFAULT_PROPS$1a;
429
432
 
430
433
  /**
431
434
  * Component display name.
@@ -435,12 +438,12 @@ const COMPONENT_NAME$1j = 'AutocompleteMultiple';
435
438
  /**
436
439
  * Component default class name and class prefix.
437
440
  */
438
- const CLASSNAME$1h = 'lumx-autocomplete-multiple';
441
+ const CLASSNAME$1l = 'lumx-autocomplete-multiple';
439
442
 
440
443
  /**
441
444
  * Component default props.
442
445
  */
443
- const DEFAULT_PROPS$17 = {
446
+ const DEFAULT_PROPS$19 = {
444
447
  closeOnClickAway: true,
445
448
  closeOnEscape: true,
446
449
  selectedChipRender(choice, index, onClear, isDisabled) {
@@ -480,8 +483,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
480
483
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
481
484
  chipsAlignment,
482
485
  className,
483
- closeOnClickAway = DEFAULT_PROPS$17.closeOnClickAway,
484
- closeOnEscape = DEFAULT_PROPS$17.closeOnEscape,
486
+ closeOnClickAway = DEFAULT_PROPS$19.closeOnClickAway,
487
+ closeOnEscape = DEFAULT_PROPS$19.closeOnEscape,
485
488
  fitToAnchorWidth,
486
489
  hasError,
487
490
  helper,
@@ -503,19 +506,19 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
503
506
  onKeyDown,
504
507
  placeholder,
505
508
  placement,
506
- selectedChipRender = DEFAULT_PROPS$17.selectedChipRender,
509
+ selectedChipRender = DEFAULT_PROPS$19.selectedChipRender,
507
510
  shouldFocusOnClose,
508
511
  theme = defaultTheme,
509
512
  type,
510
513
  value,
511
- values = DEFAULT_PROPS$17.values,
514
+ values = DEFAULT_PROPS$19.values,
512
515
  ...forwardedProps
513
516
  } = otherProps;
514
517
  return /*#__PURE__*/jsx(Autocomplete, {
515
518
  ref: ref,
516
519
  ...forwardedProps,
517
520
  anchorToInput: anchorToInput,
518
- className: classNames.join(className, CLASSNAME$1h),
521
+ className: classNames.join(className, CLASSNAME$1l),
519
522
  name: name,
520
523
  value: value,
521
524
  onChange: onChange,
@@ -549,8 +552,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
549
552
  });
550
553
  });
551
554
  AutocompleteMultiple.displayName = COMPONENT_NAME$1j;
552
- AutocompleteMultiple.className = CLASSNAME$1h;
553
- AutocompleteMultiple.defaultProps = DEFAULT_PROPS$17;
555
+ AutocompleteMultiple.className = CLASSNAME$1l;
556
+ AutocompleteMultiple.defaultProps = DEFAULT_PROPS$19;
554
557
 
555
558
  /**
556
559
  * Component display name.
@@ -560,16 +563,16 @@ const COMPONENT_NAME$1i = 'Avatar';
560
563
  /**
561
564
  * Component default class name and class prefix.
562
565
  */
563
- const CLASSNAME$1g = 'lumx-avatar';
566
+ const CLASSNAME$1k = 'lumx-avatar';
564
567
  const {
565
- block: block$13,
566
- element: element$N
567
- } = classNames.bem(CLASSNAME$1g);
568
+ block: block$18,
569
+ element: element$S
570
+ } = classNames.bem(CLASSNAME$1k);
568
571
 
569
572
  /**
570
573
  * Component default props.
571
574
  */
572
- const DEFAULT_PROPS$16 = {
575
+ const DEFAULT_PROPS$18 = {
573
576
  size: Size$1.m
574
577
  };
575
578
 
@@ -592,7 +595,7 @@ const Avatar = forwardRef((props, ref) => {
592
595
  linkAs,
593
596
  onClick,
594
597
  onKeyPress,
595
- size = DEFAULT_PROPS$16.size,
598
+ size = DEFAULT_PROPS$18.size,
596
599
  theme = defaultTheme,
597
600
  thumbnailProps,
598
601
  ...forwardedProps
@@ -600,34 +603,34 @@ const Avatar = forwardRef((props, ref) => {
600
603
  return /*#__PURE__*/jsxs("div", {
601
604
  ref: ref,
602
605
  ...forwardedProps,
603
- className: classNames.join(className, block$13({
606
+ className: classNames.join(className, block$18({
604
607
  [`size-${size}`]: Boolean(size),
605
608
  [`theme-${theme}`]: Boolean(theme)
606
609
  })),
607
610
  children: [/*#__PURE__*/jsx(Thumbnail, {
608
611
  linkProps: linkProps,
609
612
  linkAs: linkAs,
610
- className: element$N('thumbnail'),
613
+ className: element$S('thumbnail'),
611
614
  onClick: onClick,
612
615
  onKeyPress: onKeyPress,
613
616
  ...thumbnailProps,
614
- aspectRatio: AspectRatio.square,
617
+ aspectRatio: AspectRatio$1.square,
615
618
  size: size,
616
619
  image: image,
617
620
  alt: alt,
618
621
  theme: theme
619
622
  }), actions && /*#__PURE__*/jsx("div", {
620
- className: element$N('actions'),
623
+ className: element$S('actions'),
621
624
  children: actions
622
625
  }), badge && /*#__PURE__*/jsx("div", {
623
- className: element$N('badge'),
626
+ className: element$S('badge'),
624
627
  children: badge
625
628
  })]
626
629
  });
627
630
  });
628
631
  Avatar.displayName = COMPONENT_NAME$1i;
629
- Avatar.className = CLASSNAME$1g;
630
- Avatar.defaultProps = DEFAULT_PROPS$16;
632
+ Avatar.className = CLASSNAME$1k;
633
+ Avatar.defaultProps = DEFAULT_PROPS$18;
631
634
 
632
635
  /**
633
636
  * Alignments.
@@ -668,6 +671,12 @@ const TypographyInterface = {
668
671
  */
669
672
  const Typography = {
670
673
  ...TypographyInterface};
674
+ /**
675
+ * All available aspect ratios.
676
+ */
677
+ const AspectRatio = {
678
+ /** Intrinsic content ratio. */
679
+ original: 'original'};
671
680
  /**
672
681
  * Semantic info about the purpose of the component
673
682
  */
@@ -689,8 +698,6 @@ const ColorPalette = {
689
698
  red: 'red',
690
699
  light: 'light'};
691
700
 
692
- /** ColorPalette with all possible color variant combination */
693
-
694
701
  function getDefaultExportFromCjs (x) {
695
702
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
696
703
  }
@@ -851,7 +858,7 @@ function modifier$1(baseName, modifiers) {
851
858
  * block('button', { active: true, disabled: false }); // 'button button--active'
852
859
  */
853
860
 
854
- function block$12(baseName, modifiersOrAdditionalClasses, additionalClasses) {
861
+ function block$17(baseName, modifiersOrAdditionalClasses, additionalClasses) {
855
862
  let modifiers;
856
863
  let classes;
857
864
  if (Array.isArray(modifiersOrAdditionalClasses)) {
@@ -886,11 +893,11 @@ function block$12(baseName, modifiersOrAdditionalClasses, additionalClasses) {
886
893
  * element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
887
894
  */
888
895
 
889
- function element$M(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
896
+ function element$R(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
890
897
  if (Array.isArray(modifiersOrAdditionalClasses)) {
891
- return block$12(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
898
+ return block$17(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
892
899
  }
893
- return block$12(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
900
+ return block$17(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
894
901
  }
895
902
 
896
903
  /**
@@ -899,15 +906,15 @@ function element$M(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
899
906
  function bem(baseName) {
900
907
  function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
901
908
  if (Array.isArray(modifiersOrAdditionalClasses)) {
902
- return block$12(baseName, modifiersOrAdditionalClasses);
909
+ return block$17(baseName, modifiersOrAdditionalClasses);
903
910
  }
904
- return block$12(baseName, modifiersOrAdditionalClasses, additionalClasses);
911
+ return block$17(baseName, modifiersOrAdditionalClasses, additionalClasses);
905
912
  }
906
913
  function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
907
914
  if (Array.isArray(modifiersOrAdditionalClasses)) {
908
- return element$M(baseName, elem, modifiersOrAdditionalClasses);
915
+ return element$R(baseName, elem, modifiersOrAdditionalClasses);
909
916
  }
910
- return element$M(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
917
+ return element$R(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
911
918
  }
912
919
  return {
913
920
  block: blockFn,
@@ -924,15 +931,15 @@ const COMPONENT_NAME$1h = 'Badge';
924
931
  /**
925
932
  * Component default class name and class prefix.
926
933
  */
927
- const CLASSNAME$1f = 'lumx-badge';
934
+ const CLASSNAME$1j = 'lumx-badge';
928
935
  const {
929
- block: block$11
930
- } = bem(CLASSNAME$1f);
936
+ block: block$16
937
+ } = bem(CLASSNAME$1j);
931
938
 
932
939
  /**
933
940
  * Component default props.
934
941
  */
935
- const DEFAULT_PROPS$15 = {
942
+ const DEFAULT_PROPS$17 = {
936
943
  color: ColorPalette.primary
937
944
  };
938
945
 
@@ -946,22 +953,22 @@ const Badge$1 = props => {
946
953
  const {
947
954
  children,
948
955
  className,
949
- color = DEFAULT_PROPS$15.color,
956
+ color = DEFAULT_PROPS$17.color,
950
957
  ref,
951
958
  ...forwardedProps
952
959
  } = props;
953
960
  return /*#__PURE__*/jsx("div", {
954
961
  ref: ref,
955
962
  ...forwardedProps,
956
- className: classnames(className, block$11({
963
+ className: classnames(className, block$16({
957
964
  [`color-${color}`]: Boolean(color)
958
965
  })),
959
966
  children: children
960
967
  });
961
968
  };
962
969
  Badge$1.displayName = COMPONENT_NAME$1h;
963
- Badge$1.className = CLASSNAME$1f;
964
- Badge$1.defaultProps = DEFAULT_PROPS$15;
970
+ Badge$1.className = CLASSNAME$1j;
971
+ Badge$1.defaultProps = DEFAULT_PROPS$17;
965
972
 
966
973
  /**
967
974
  * Defines the props of the component.
@@ -985,11 +992,11 @@ Badge.className = Badge$1.className;
985
992
  Badge.defaultProps = Badge$1.defaultProps;
986
993
 
987
994
  const COMPONENT_NAME$1g = 'BadgeWrapper';
988
- const CLASSNAME$1e = 'lumx-badge-wrapper';
995
+ const CLASSNAME$1i = 'lumx-badge-wrapper';
989
996
  const {
990
- block: block$10,
991
- element: element$L
992
- } = bem(CLASSNAME$1e);
997
+ block: block$15,
998
+ element: element$Q
999
+ } = bem(CLASSNAME$1i);
993
1000
  const BadgeWrapper$1 = props => {
994
1001
  const {
995
1002
  badge,
@@ -1001,9 +1008,9 @@ const BadgeWrapper$1 = props => {
1001
1008
  return /*#__PURE__*/jsxs("div", {
1002
1009
  ref: ref,
1003
1010
  ...forwardedProps,
1004
- className: classnames(className, block$10()),
1011
+ className: classnames(className, block$15()),
1005
1012
  children: [children, badge && /*#__PURE__*/jsx("div", {
1006
- className: element$L('badge'),
1013
+ className: element$Q('badge'),
1007
1014
  children: badge
1008
1015
  })]
1009
1016
  });
@@ -1016,7 +1023,7 @@ const BadgeWrapper = forwardRef((props, ref) => {
1016
1023
  });
1017
1024
  });
1018
1025
  BadgeWrapper.displayName = COMPONENT_NAME$1g;
1019
- BadgeWrapper.className = CLASSNAME$1e;
1026
+ BadgeWrapper.className = CLASSNAME$1i;
1020
1027
 
1021
1028
  /**
1022
1029
  * Render clickable element (link, button or custom element)
@@ -1177,15 +1184,15 @@ const COMPONENT_NAME$1e = 'Button';
1177
1184
  /**
1178
1185
  * Component default class name and class prefix.
1179
1186
  */
1180
- const CLASSNAME$1d = 'lumx-button';
1187
+ const CLASSNAME$1h = 'lumx-button';
1181
1188
  const {
1182
1189
  modifier
1183
- } = bem(CLASSNAME$1d);
1190
+ } = bem(CLASSNAME$1h);
1184
1191
 
1185
1192
  /**
1186
1193
  * Component default props.
1187
1194
  */
1188
- const DEFAULT_PROPS$14 = {
1195
+ const DEFAULT_PROPS$16 = {
1189
1196
  emphasis: Emphasis.high,
1190
1197
  size: Size.m
1191
1198
  };
@@ -1199,10 +1206,10 @@ const DEFAULT_PROPS$14 = {
1199
1206
  const Button$1 = props => {
1200
1207
  const {
1201
1208
  className,
1202
- emphasis = DEFAULT_PROPS$14.emphasis,
1209
+ emphasis = DEFAULT_PROPS$16.emphasis,
1203
1210
  leftIcon,
1204
1211
  rightIcon,
1205
- size = DEFAULT_PROPS$14.size,
1212
+ size = DEFAULT_PROPS$16.size,
1206
1213
  ...forwardedProps
1207
1214
  } = props;
1208
1215
  const buttonClassName = classnames(className, modifier({
@@ -1218,8 +1225,8 @@ const Button$1 = props => {
1218
1225
  });
1219
1226
  };
1220
1227
  Button$1.displayName = COMPONENT_NAME$1e;
1221
- Button$1.className = CLASSNAME$1d;
1222
- Button$1.defaultProps = DEFAULT_PROPS$14;
1228
+ Button$1.className = CLASSNAME$1h;
1229
+ Button$1.defaultProps = DEFAULT_PROPS$16;
1223
1230
 
1224
1231
  /**
1225
1232
  * Properties of a component to use to determine it's name.
@@ -1286,8 +1293,8 @@ const Button = forwardRef((props, ref) => {
1286
1293
  });
1287
1294
  });
1288
1295
  Button.displayName = COMPONENT_NAME$1e;
1289
- Button.className = CLASSNAME$1d;
1290
- Button.defaultProps = DEFAULT_PROPS$14;
1296
+ Button.className = CLASSNAME$1h;
1297
+ Button.defaultProps = DEFAULT_PROPS$16;
1291
1298
 
1292
1299
  const COMPONENT_NAME$1d = 'Icon';
1293
1300
  const IconClassName = 'lumx-icon';
@@ -1296,15 +1303,15 @@ const IconClassName = 'lumx-icon';
1296
1303
  * Defines the props of the component.
1297
1304
  */
1298
1305
 
1299
- const CLASSNAME$1c = IconClassName;
1306
+ const CLASSNAME$1g = IconClassName;
1300
1307
  const {
1301
- block: block$$
1302
- } = bem(CLASSNAME$1c);
1308
+ block: block$14
1309
+ } = bem(CLASSNAME$1g);
1303
1310
 
1304
1311
  /**
1305
1312
  * Component default props.
1306
1313
  */
1307
- const DEFAULT_PROPS$13 = {};
1314
+ const DEFAULT_PROPS$15 = {};
1308
1315
 
1309
1316
  /**
1310
1317
  * Icon component.
@@ -1353,7 +1360,7 @@ const Icon$1 = props => {
1353
1360
  return /*#__PURE__*/jsx("i", {
1354
1361
  ref: ref,
1355
1362
  ...forwardedProps,
1356
- className: classnames(className, block$$({
1363
+ className: classnames(className, block$14({
1357
1364
  [`color-${iconColor}`]: Boolean(iconColor),
1358
1365
  [`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
1359
1366
  'has-shape': hasShape,
@@ -1383,8 +1390,8 @@ const Icon$1 = props => {
1383
1390
  });
1384
1391
  };
1385
1392
  Icon$1.displayName = COMPONENT_NAME$1d;
1386
- Icon$1.className = CLASSNAME$1c;
1387
- Icon$1.defaultProps = DEFAULT_PROPS$13;
1393
+ Icon$1.className = CLASSNAME$1g;
1394
+ Icon$1.defaultProps = DEFAULT_PROPS$15;
1388
1395
 
1389
1396
  /**
1390
1397
  * Component display name.
@@ -1394,12 +1401,12 @@ const COMPONENT_NAME$1c = 'IconButton';
1394
1401
  /**
1395
1402
  * Component default class name and class prefix.
1396
1403
  */
1397
- const CLASSNAME$1b = 'lumx-icon-button';
1404
+ const CLASSNAME$1f = 'lumx-icon-button';
1398
1405
 
1399
1406
  /**
1400
1407
  * Component default props.
1401
1408
  */
1402
- const DEFAULT_PROPS$12 = {
1409
+ const DEFAULT_PROPS$14 = {
1403
1410
  emphasis: Emphasis.high,
1404
1411
  size: Size.m
1405
1412
  };
@@ -1412,11 +1419,11 @@ const DEFAULT_PROPS$12 = {
1412
1419
  */
1413
1420
  const IconButton$1 = props => {
1414
1421
  const {
1415
- emphasis = DEFAULT_PROPS$12.emphasis,
1422
+ emphasis = DEFAULT_PROPS$14.emphasis,
1416
1423
  image,
1417
1424
  icon,
1418
1425
  label,
1419
- size = DEFAULT_PROPS$12.size,
1426
+ size = DEFAULT_PROPS$14.size,
1420
1427
  ...forwardedProps
1421
1428
  } = props;
1422
1429
  const defaultChildren = image ? /*#__PURE__*/jsx("img", {
@@ -1436,8 +1443,8 @@ const IconButton$1 = props => {
1436
1443
  });
1437
1444
  };
1438
1445
  IconButton$1.displayName = COMPONENT_NAME$1c;
1439
- IconButton$1.className = CLASSNAME$1b;
1440
- IconButton$1.defaultProps = DEFAULT_PROPS$12;
1446
+ IconButton$1.className = CLASSNAME$1f;
1447
+ IconButton$1.defaultProps = DEFAULT_PROPS$14;
1441
1448
 
1442
1449
  /**
1443
1450
  * IconButton component.
@@ -1473,8 +1480,8 @@ const IconButton = forwardRef((props, ref) => {
1473
1480
  });
1474
1481
  });
1475
1482
  IconButton.displayName = COMPONENT_NAME$1c;
1476
- IconButton.className = CLASSNAME$1b;
1477
- IconButton.defaultProps = DEFAULT_PROPS$12;
1483
+ IconButton.className = CLASSNAME$1f;
1484
+ IconButton.defaultProps = DEFAULT_PROPS$14;
1478
1485
 
1479
1486
  /**
1480
1487
  * Component display name.
@@ -1484,12 +1491,12 @@ const COMPONENT_NAME$1b = 'ButtonGroup';
1484
1491
  /**
1485
1492
  * Component default class name and class prefix.
1486
1493
  */
1487
- const CLASSNAME$1a = 'lumx-button-group';
1494
+ const CLASSNAME$1e = 'lumx-button-group';
1488
1495
 
1489
1496
  /**
1490
1497
  * Component default props.
1491
1498
  */
1492
- const DEFAULT_PROPS$11 = {};
1499
+ const DEFAULT_PROPS$13 = {};
1493
1500
 
1494
1501
  /**
1495
1502
  * ButtonGroup component.
@@ -1505,13 +1512,13 @@ const ButtonGroup$1 = props => {
1505
1512
  } = props;
1506
1513
  return /*#__PURE__*/jsx("div", {
1507
1514
  ...forwardedProps,
1508
- className: classnames(className, CLASSNAME$1a),
1515
+ className: classnames(className, CLASSNAME$1e),
1509
1516
  children: children
1510
1517
  });
1511
1518
  };
1512
1519
  ButtonGroup$1.displayName = COMPONENT_NAME$1b;
1513
- ButtonGroup$1.className = CLASSNAME$1a;
1514
- ButtonGroup$1.defaultProps = DEFAULT_PROPS$11;
1520
+ ButtonGroup$1.className = CLASSNAME$1e;
1521
+ ButtonGroup$1.defaultProps = DEFAULT_PROPS$13;
1515
1522
 
1516
1523
  /**
1517
1524
  * ButtonGroup component.
@@ -1527,16 +1534,16 @@ const ButtonGroup = forwardRef((props, ref) => {
1527
1534
  });
1528
1535
  });
1529
1536
  ButtonGroup.displayName = COMPONENT_NAME$1b;
1530
- ButtonGroup.className = CLASSNAME$1a;
1531
- ButtonGroup.defaultProps = DEFAULT_PROPS$11;
1537
+ ButtonGroup.className = CLASSNAME$1e;
1538
+ ButtonGroup.defaultProps = DEFAULT_PROPS$13;
1532
1539
 
1533
1540
  const COMPONENT_NAME$1a = 'InputLabel';
1534
1541
  const InputLabelClassName = 'lumx-input-label';
1535
- const CLASSNAME$19 = InputLabelClassName;
1542
+ const CLASSNAME$1d = InputLabelClassName;
1536
1543
  const {
1537
- block: block$_
1538
- } = bem(CLASSNAME$19);
1539
- const DEFAULT_PROPS$10 = {};
1544
+ block: block$13
1545
+ } = bem(CLASSNAME$1d);
1546
+ const DEFAULT_PROPS$12 = {};
1540
1547
 
1541
1548
  /**
1542
1549
  * InputLabel component.
@@ -1556,7 +1563,7 @@ function InputLabel$1(props) {
1556
1563
  ref: ref,
1557
1564
  ...forwardedProps,
1558
1565
  htmlFor: htmlFor,
1559
- className: classnames(className, block$_({
1566
+ className: classnames(className, block$13({
1560
1567
  'is-required': isRequired,
1561
1568
  [`theme-${theme}`]: Boolean(theme),
1562
1569
  'has-custom-typography': Boolean(typography$1)
@@ -1565,8 +1572,8 @@ function InputLabel$1(props) {
1565
1572
  });
1566
1573
  }
1567
1574
  InputLabel$1.displayName = COMPONENT_NAME$1a;
1568
- InputLabel$1.className = CLASSNAME$19;
1569
- InputLabel$1.defaultProps = DEFAULT_PROPS$10;
1575
+ InputLabel$1.className = CLASSNAME$1d;
1576
+ InputLabel$1.defaultProps = DEFAULT_PROPS$12;
1570
1577
 
1571
1578
  const INPUT_HELPER_CONFIGURATION = {
1572
1579
  [Kind.error]: {
@@ -1587,15 +1594,15 @@ const InputHelperClassName = 'lumx-input-helper';
1587
1594
  * Defines the props of the component.
1588
1595
  */
1589
1596
 
1590
- const CLASSNAME$18 = InputHelperClassName;
1597
+ const CLASSNAME$1c = InputHelperClassName;
1591
1598
  const {
1592
- block: block$Z
1593
- } = bem(CLASSNAME$18);
1599
+ block: block$12
1600
+ } = bem(CLASSNAME$1c);
1594
1601
 
1595
1602
  /**
1596
1603
  * Component default props.
1597
1604
  */
1598
- const DEFAULT_PROPS$$ = {
1605
+ const DEFAULT_PROPS$11 = {
1599
1606
  kind: Kind.info
1600
1607
  };
1601
1608
 
@@ -1606,7 +1613,7 @@ function InputHelper$1(props) {
1606
1613
  const {
1607
1614
  children,
1608
1615
  className,
1609
- kind = DEFAULT_PROPS$$.kind,
1616
+ kind = DEFAULT_PROPS$11.kind,
1610
1617
  theme,
1611
1618
  ref,
1612
1619
  ...forwardedProps
@@ -1617,7 +1624,7 @@ function InputHelper$1(props) {
1617
1624
  return /*#__PURE__*/jsx("p", {
1618
1625
  ref: ref,
1619
1626
  ...forwardedProps,
1620
- className: classnames(className, block$Z({
1627
+ className: classnames(className, block$12({
1621
1628
  [`color-${color}`]: Boolean(color),
1622
1629
  [`theme-${theme}`]: Boolean(theme)
1623
1630
  })),
@@ -1625,8 +1632,8 @@ function InputHelper$1(props) {
1625
1632
  });
1626
1633
  }
1627
1634
  InputHelper$1.displayName = COMPONENT_NAME$19;
1628
- InputHelper$1.className = CLASSNAME$18;
1629
- InputHelper$1.defaultProps = DEFAULT_PROPS$$;
1635
+ InputHelper$1.className = CLASSNAME$1c;
1636
+ InputHelper$1.defaultProps = DEFAULT_PROPS$11;
1630
1637
 
1631
1638
  const INTERMEDIATE_STATE = 'intermediate';
1632
1639
 
@@ -1642,11 +1649,11 @@ const COMPONENT_NAME$18 = 'Checkbox';
1642
1649
  /**
1643
1650
  * Component default class name and class prefix.
1644
1651
  */
1645
- const CLASSNAME$17 = 'lumx-checkbox';
1652
+ const CLASSNAME$1b = 'lumx-checkbox';
1646
1653
  const {
1647
- block: block$Y,
1648
- element: element$K
1649
- } = bem(CLASSNAME$17);
1654
+ block: block$11,
1655
+ element: element$P
1656
+ } = bem(CLASSNAME$1b);
1650
1657
 
1651
1658
  /**
1652
1659
  * Checkbox component.
@@ -1682,7 +1689,7 @@ const Checkbox$1 = props => {
1682
1689
  return /*#__PURE__*/jsxs("div", {
1683
1690
  ref: ref,
1684
1691
  ...forwardedProps,
1685
- className: classnames(className, block$Y({
1692
+ className: classnames(className, block$11({
1686
1693
  // Whether state is intermediate class name will "-checked"
1687
1694
  'is-checked': intermediateState ? true : isChecked,
1688
1695
  'is-disabled': isDisabled,
@@ -1690,12 +1697,12 @@ const Checkbox$1 = props => {
1690
1697
  [`theme-${theme}`]: Boolean(theme)
1691
1698
  })),
1692
1699
  children: [/*#__PURE__*/jsxs("div", {
1693
- className: element$K('input-wrapper'),
1700
+ className: element$P('input-wrapper'),
1694
1701
  children: [/*#__PURE__*/jsx("input", {
1695
1702
  ref: inputRef,
1696
1703
  type: "checkbox",
1697
1704
  id: inputId,
1698
- className: element$K('input-native'),
1705
+ className: element$P('input-native'),
1699
1706
  name: name,
1700
1707
  value: value,
1701
1708
  checked: isChecked,
@@ -1707,26 +1714,26 @@ const Checkbox$1 = props => {
1707
1714
  } : {}),
1708
1715
  ...inputProps
1709
1716
  }), /*#__PURE__*/jsxs("div", {
1710
- className: element$K('input-placeholder'),
1717
+ className: element$P('input-placeholder'),
1711
1718
  children: [/*#__PURE__*/jsx("div", {
1712
- className: element$K('input-background')
1719
+ className: element$P('input-background')
1713
1720
  }), /*#__PURE__*/jsx("div", {
1714
- className: element$K('input-indicator'),
1721
+ className: element$P('input-indicator'),
1715
1722
  children: Icon$1({
1716
1723
  icon: intermediateState ? mdiMinus : mdiCheck
1717
1724
  })
1718
1725
  })]
1719
1726
  })]
1720
1727
  }), /*#__PURE__*/jsxs("div", {
1721
- className: element$K('content'),
1728
+ className: element$P('content'),
1722
1729
  children: [label && InputLabel$1({
1723
1730
  htmlFor: inputId,
1724
- className: element$K('label'),
1731
+ className: element$P('label'),
1725
1732
  theme,
1726
1733
  children: label
1727
1734
  }), helper && InputHelper$1({
1728
1735
  id: `${inputId}-helper`,
1729
- className: element$K('helper'),
1736
+ className: element$P('helper'),
1730
1737
  theme,
1731
1738
  children: helper
1732
1739
  })]
@@ -1741,7 +1748,7 @@ const Checkbox$1 = props => {
1741
1748
  /**
1742
1749
  * Component default props.
1743
1750
  */
1744
- const DEFAULT_PROPS$_ = {};
1751
+ const DEFAULT_PROPS$10 = {};
1745
1752
 
1746
1753
  /**
1747
1754
  * Checkbox component.
@@ -1802,8 +1809,8 @@ const Checkbox = forwardRef((props, ref) => {
1802
1809
  });
1803
1810
  });
1804
1811
  Checkbox.displayName = COMPONENT_NAME$18;
1805
- Checkbox.className = CLASSNAME$17;
1806
- Checkbox.defaultProps = DEFAULT_PROPS$_;
1812
+ Checkbox.className = CLASSNAME$1b;
1813
+ Checkbox.defaultProps = DEFAULT_PROPS$10;
1807
1814
 
1808
1815
  /**
1809
1816
  * Wrap mouse event handler to stop event propagation.
@@ -1829,16 +1836,16 @@ const COMPONENT_NAME$17 = 'Chip';
1829
1836
  /**
1830
1837
  * Component default class name and class prefix.
1831
1838
  */
1832
- const CLASSNAME$16 = 'lumx-chip';
1839
+ const CLASSNAME$1a = 'lumx-chip';
1833
1840
  const {
1834
- block: block$X,
1835
- element: element$J
1836
- } = classNames.bem(CLASSNAME$16);
1841
+ block: block$10,
1842
+ element: element$O
1843
+ } = classNames.bem(CLASSNAME$1a);
1837
1844
 
1838
1845
  /**
1839
1846
  * Component default props.
1840
1847
  */
1841
- const DEFAULT_PROPS$Z = {
1848
+ const DEFAULT_PROPS$$ = {
1842
1849
  size: Size$1.m
1843
1850
  };
1844
1851
 
@@ -1868,7 +1875,7 @@ const Chip = forwardRef((props, ref) => {
1868
1875
  onAfterClick,
1869
1876
  onBeforeClick,
1870
1877
  onClick,
1871
- size = DEFAULT_PROPS$Z.size,
1878
+ size = DEFAULT_PROPS$$.size,
1872
1879
  theme = defaultTheme,
1873
1880
  href,
1874
1881
  onKeyDown,
@@ -1899,7 +1906,7 @@ const Chip = forwardRef((props, ref) => {
1899
1906
  ...forwardedProps,
1900
1907
  href: !disabledStateProps.disabled ? href : undefined,
1901
1908
  ref: ref,
1902
- className: classNames.join(className, block$X({
1909
+ className: classNames.join(className, block$10({
1903
1910
  'is-clickable': isClickable,
1904
1911
  [`color-${chipColor}`]: Boolean(chipColor),
1905
1912
  'is-disabled': isAnyDisabled,
@@ -1917,19 +1924,19 @@ const Chip = forwardRef((props, ref) => {
1917
1924
  /*#__PURE__*/
1918
1925
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
1919
1926
  jsx("div", {
1920
- className: element$J('before', {
1927
+ className: element$O('before', {
1921
1928
  'is-clickable': hasBeforeClick
1922
1929
  }),
1923
1930
  onClick: handleOnBeforeClick,
1924
1931
  children: before
1925
1932
  }), /*#__PURE__*/jsx("div", {
1926
- className: element$J('label'),
1933
+ className: element$O('label'),
1927
1934
  children: children
1928
1935
  }), after &&
1929
1936
  /*#__PURE__*/
1930
1937
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
1931
1938
  jsx("div", {
1932
- className: element$J('after', {
1939
+ className: element$O('after', {
1933
1940
  'is-clickable': hasAfterClick
1934
1941
  }),
1935
1942
  onClick: handleOnAfterClick,
@@ -1939,8 +1946,8 @@ const Chip = forwardRef((props, ref) => {
1939
1946
  );
1940
1947
  });
1941
1948
  Chip.displayName = COMPONENT_NAME$17;
1942
- Chip.className = CLASSNAME$16;
1943
- Chip.defaultProps = DEFAULT_PROPS$Z;
1949
+ Chip.className = CLASSNAME$1a;
1950
+ Chip.defaultProps = DEFAULT_PROPS$$;
1944
1951
 
1945
1952
  const INITIAL_STATE_ACTIVE_CHIP = -1;
1946
1953
 
@@ -1996,7 +2003,7 @@ const useChipGroupNavigation = (chips, onChipDeleted, initialActiveChip = INITIA
1996
2003
  /**
1997
2004
  * Component default props.
1998
2005
  */
1999
- const DEFAULT_PROPS$Y = {};
2006
+ const DEFAULT_PROPS$_ = {};
2000
2007
 
2001
2008
  /**
2002
2009
  * Component display name.
@@ -2006,7 +2013,7 @@ const COMPONENT_NAME$16 = 'ChipGroup';
2006
2013
  /**
2007
2014
  * Component default class name and class prefix.
2008
2015
  */
2009
- const CLASSNAME$15 = 'lumx-chip-group';
2016
+ const CLASSNAME$19 = 'lumx-chip-group';
2010
2017
 
2011
2018
  /**
2012
2019
  * ChipGroup component.
@@ -2025,13 +2032,13 @@ const InternalChipGroup = forwardRef((props, ref) => {
2025
2032
  return /*#__PURE__*/jsx("div", {
2026
2033
  ref: ref,
2027
2034
  ...forwardedProps,
2028
- className: classNames.join(className, CLASSNAME$15),
2035
+ className: classNames.join(className, CLASSNAME$19),
2029
2036
  children: children
2030
2037
  });
2031
2038
  });
2032
2039
  InternalChipGroup.displayName = COMPONENT_NAME$16;
2033
- InternalChipGroup.className = CLASSNAME$15;
2034
- InternalChipGroup.defaultProps = DEFAULT_PROPS$Y;
2040
+ InternalChipGroup.className = CLASSNAME$19;
2041
+ InternalChipGroup.defaultProps = DEFAULT_PROPS$_;
2035
2042
  const ChipGroup = Object.assign(InternalChipGroup, {
2036
2043
  useChipGroupNavigation
2037
2044
  });
@@ -2121,11 +2128,11 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
2121
2128
  /**
2122
2129
  * Component default class name and class prefix.
2123
2130
  */
2124
- const CLASSNAME$14 = 'lumx-selection-chip-group';
2131
+ const CLASSNAME$18 = 'lumx-selection-chip-group';
2125
2132
  const {
2126
- block: block$W,
2127
- element: element$I
2128
- } = classNames.bem(CLASSNAME$14);
2133
+ block: block$$,
2134
+ element: element$N
2135
+ } = classNames.bem(CLASSNAME$18);
2129
2136
 
2130
2137
  /**
2131
2138
  * SelectionChipGroup component.
@@ -2155,7 +2162,7 @@ const SelectionChipGroup = ({
2155
2162
  return /*#__PURE__*/jsx(ChipGroup, {
2156
2163
  role: "group",
2157
2164
  "aria-label": label,
2158
- className: block$W(),
2165
+ className: block$$(),
2159
2166
  ...forwardedProps,
2160
2167
  children: value?.map((v, index) => {
2161
2168
  const name = getWithSelector(getOptionName, v);
@@ -2199,7 +2206,7 @@ const SelectionChipGroup = ({
2199
2206
  after: /*#__PURE__*/jsx(Icon, {
2200
2207
  icon: mdiClose
2201
2208
  }),
2202
- className: element$I('chip', [props?.className]),
2209
+ className: element$N('chip', [props?.className]),
2203
2210
  size: "s",
2204
2211
  ref: ref,
2205
2212
  onClick: onClick,
@@ -2215,53 +2222,1403 @@ const SelectionChipGroup = ({
2215
2222
  };
2216
2223
 
2217
2224
  /**
2218
- * Comment block variants.
2225
+ * Provide props for the semantic and behaviors the combobox trigger.
2226
+ *
2227
+ *
2219
2228
  */
2220
- const CommentBlockVariant = {
2221
- indented: 'indented',
2222
- linear: 'linear'
2223
- };
2229
+ function useComboboxTrigger({
2230
+ context,
2231
+ refs,
2232
+ onBlur,
2233
+ onFocus,
2234
+ onKeyDown
2235
+ }) {
2236
+ const {
2237
+ comboboxId,
2238
+ listboxId,
2239
+ isOpen,
2240
+ options,
2241
+ optionsLength,
2242
+ selectedIds,
2243
+ openOnFocus,
2244
+ handleClose,
2245
+ handleOpen,
2246
+ handleSelected,
2247
+ showEmptyState = false,
2248
+ showErrorState = false,
2249
+ status
2250
+ } = context;
2251
+ const highlightedId = useVirtualFocusParent(refs.triggerRef);
2252
+ const {
2253
+ dispatch: movingFocusDispatch
2254
+ } = React__default.useContext(MovingFocusContext);
2255
+ const isErrorStateDisplayed = showErrorState && isOpen && status === 'error';
2256
+ const isEmptyStateDisplayed = showEmptyState && isOpen && status === 'idle' && optionsLength === 0;
2257
+ const showPopover = isOpen && optionsLength > 0 || isEmptyStateDisplayed || isErrorStateDisplayed;
2258
+
2259
+ /**
2260
+ * A debounce close to use to leave time for the
2261
+ * listbox to process things before closing.
2262
+ * This can be useful when clicking an option to leave time for the
2263
+ * event to be processed before closing the popover.
2264
+ */
2265
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2266
+ const debouncedClose = React__default.useCallback(debounce$1(handleClose, 200), []);
2267
+
2268
+ /** Cleanup any ongoing cleanup */
2269
+ React__default.useEffect(() => {
2270
+ return () => {
2271
+ if (debouncedClose?.cancel) {
2272
+ debouncedClose.cancel();
2273
+ }
2274
+ };
2275
+ }, [debouncedClose]);
2276
+ const handleBlur = React__default.useCallback(event => {
2277
+ debouncedClose();
2278
+ if (onBlur) {
2279
+ onBlur(event);
2280
+ }
2281
+ }, [debouncedClose, onBlur]);
2282
+
2283
+ /** Actions triggered when the input field is focused */
2284
+ const handleFocus = event => {
2285
+ // If the field is refocused in the process of closing, cancel close
2286
+ if (debouncedClose?.cancel) {
2287
+ debouncedClose.cancel();
2288
+ }
2289
+ if (onFocus) {
2290
+ onFocus(event);
2291
+ }
2292
+ /**
2293
+ * Only set the open on focus if the combobox isn't already opened.
2294
+ * This avoids the popover re-opening when an option is selected and the
2295
+ * field is refocused
2296
+ */
2297
+ if (openOnFocus && !showPopover) {
2298
+ handleOpen({
2299
+ manual: true
2300
+ });
2301
+ }
2302
+ };
2303
+ const handleClick = () => {
2304
+ handleOpen({
2305
+ manual: true
2306
+ });
2307
+ };
2308
+
2309
+ /**
2310
+ * Keyboard shortcut management following the WAI APG pattern
2311
+ * https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/#kbd_label
2312
+ */
2313
+ const handleKeyDown = React__default.useCallback(async event => {
2314
+ const {
2315
+ key,
2316
+ altKey
2317
+ } = event;
2318
+
2319
+ /**
2320
+ * On Enter key
2321
+ * * Select option that is currently highlighted, if any
2322
+ * * Close suggestions, event if none is highlighted
2323
+ */
2324
+ if (event.key === 'Enter') {
2325
+ if (!showPopover) {
2326
+ return;
2327
+ }
2328
+ if (highlightedId) {
2329
+ // prevent any potential form submission
2330
+ event.preventDefault();
2331
+ const option = options[highlightedId];
2332
+ handleSelected(option, 'keyboard');
2333
+ } else {
2334
+ handleClose();
2335
+ }
2336
+ return;
2337
+ }
2338
+
2339
+ /**
2340
+ * On arrow up/down
2341
+ * * If popover is already opened, do nothing
2342
+ * * If alt key pressed, show the listbox without focusing an option
2343
+ * * If arrow Up is pressed, select last option
2344
+ * * If arrow Down is pressed, select first option
2345
+ * */
2346
+ if (key === 'ArrowDown' || key === 'ArrowUp') {
2347
+ if (showPopover) {
2348
+ return;
2349
+ }
2350
+
2351
+ /** Open the listbox */
2352
+ const listBoxOptions = await handleOpen({
2353
+ manual: true
2354
+ });
2355
+ if (!listBoxOptions) {
2356
+ return;
2357
+ }
2358
+
2359
+ /**
2360
+ * If alt key is pressed, only open without changing visual focus
2361
+ * as per WAI Guidelines
2362
+ */
2363
+ if (!altKey) {
2364
+ /** If a selected id is set, set it as current tabstop */
2365
+ if (selectedIds?.length) {
2366
+ movingFocusDispatch({
2367
+ type: 'SELECT_TAB_STOP',
2368
+ payload: {
2369
+ id: selectedIds?.[0],
2370
+ type: 'keyboard'
2371
+ }
2372
+ });
2373
+ } else {
2374
+ /** Focus either the first or last item depending on the keyboard arrow pressed */
2375
+ movingFocusDispatch({
2376
+ type: 'KEY_NAV',
2377
+ payload: {
2378
+ ctrlKey: false,
2379
+ key: key === 'ArrowUp' ? 'End' : 'Home'
2380
+ }
2381
+ });
2382
+ }
2383
+ }
2384
+ return;
2385
+ }
2386
+
2387
+ // Forward event
2388
+ onKeyDown?.(event);
2389
+ }, [onKeyDown, showPopover, highlightedId, options, handleSelected, handleClose, handleOpen, selectedIds, movingFocusDispatch]);
2390
+ return {
2391
+ id: comboboxId,
2392
+ role: 'combobox',
2393
+ 'aria-activedescendant': showPopover && highlightedId ? highlightedId : '',
2394
+ 'aria-controls': listboxId,
2395
+ 'aria-owns': listboxId,
2396
+ 'aria-expanded': showPopover,
2397
+ onFocus: handleFocus,
2398
+ onBlur: handleBlur,
2399
+ onClick: handleClick,
2400
+ onKeyDown: handleKeyDown
2401
+ };
2402
+ }
2403
+
2404
+ /** Is printable character key press */
2405
+ const isTypeEvent = ({
2406
+ key,
2407
+ altKey,
2408
+ ctrlKey,
2409
+ metaKey
2410
+ }) => key.length === 1 && key !== ' ' && !altKey && !ctrlKey && !metaKey;
2224
2411
 
2225
2412
  /**
2226
- * Defines the props of the component.
2413
+ * Provide props for the semantic and behaviors the combobox button trigger
2414
+ *
2415
+ * Overrides the useComboboxTrigger() props & behavior to add a jump to option
2416
+ * on printable character key down.
2227
2417
  */
2418
+ function useComboboxButton(args) {
2419
+ const {
2420
+ context: {
2421
+ handleOpen
2422
+ },
2423
+ onKeyDown: parentOnKeyDown
2424
+ } = args;
2425
+ const {
2426
+ dispatch: movingFocusDispatch,
2427
+ state: {
2428
+ selectedId: highlightedId
2429
+ }
2430
+ } = React__default.useContext(MovingFocusContext);
2431
+ const searchValueRef = React__default.useRef('');
2432
+ const searchTimeoutRef = React__default.useRef();
2433
+ const onKeyDown = React__default.useMemo(() => {
2434
+ function clearSearchTimeout() {
2435
+ const searchTimeout = searchTimeoutRef.current;
2436
+ if (!searchTimeout) {
2437
+ return;
2438
+ }
2439
+ clearTimeout(searchTimeout);
2440
+ searchTimeoutRef.current = undefined;
2441
+ }
2442
+ function clearSearch() {
2443
+ searchValueRef.current = '';
2444
+ clearSearchTimeout();
2445
+ }
2446
+ return async event => {
2447
+ if (!isTypeEvent(event)) {
2448
+ // Forward key down event
2449
+ parentOnKeyDown?.(event);
2450
+ return undefined;
2451
+ }
2452
+ event.stopPropagation();
2453
+
2454
+ // Clear current search timeout
2455
+ clearSearchTimeout();
2456
+
2457
+ // Open combobox and wait for options to mount
2458
+ const options = await handleOpen({
2459
+ manual: false
2460
+ });
2461
+ const optionArray = options && Object.values(options);
2462
+ if (!optionArray?.length) {
2463
+ return undefined;
2464
+ }
2465
+
2466
+ // Append key to current search
2467
+ searchValueRef.current += event.key.toLowerCase();
2468
+ const searchValue = searchValueRef.current;
2469
+
2470
+ // Clear search after 500ms
2471
+ searchTimeoutRef.current = setTimeout(clearSearch, 500);
2472
+
2473
+ // Search is containing all the same letters (ex: aaaa)
2474
+ const allTheSameLetters = searchValue.split('').every(letter => letter === searchValue[0]);
2475
+
2476
+ // start from currently selected option
2477
+ let startIndex = optionArray.findIndex(option => option.generatedId === highlightedId);
2478
+ if (startIndex === -1) {
2479
+ startIndex = 0;
2480
+ }
2481
+ let index = startIndex;
2482
+ do {
2483
+ // Increment index and loop around to 0 if we get over the array length
2484
+ index = (index + 1) % optionArray.length;
2485
+ const option = optionArray[index];
2486
+ // Search by text value or fallback on id.
2487
+ const optionText = isComboboxValue(option) ? option?.textValue || option?.id : null;
2488
+ if (isComboboxValue(option) && optionText) {
2489
+ const optionTextValue = optionText.toLowerCase();
2490
+
2491
+ // Search on first letter if search is all the same letters
2492
+ const searchText = allTheSameLetters ? searchValue[0] : searchValue;
2493
+
2494
+ // Option text value starts with searched text
2495
+ if (optionTextValue.startsWith(searchText)) {
2496
+ movingFocusDispatch({
2497
+ type: 'SELECT_TAB_STOP',
2498
+ payload: {
2499
+ id: option.generatedId,
2500
+ type: 'keyboard'
2501
+ }
2502
+ });
2503
+ break;
2504
+ }
2505
+ }
2506
+ } while (index !== startIndex);
2507
+ return clearSearchTimeout;
2508
+ };
2509
+ }, [handleOpen, parentOnKeyDown, highlightedId, movingFocusDispatch]);
2510
+ return useComboboxTrigger({
2511
+ ...args,
2512
+ onKeyDown
2513
+ });
2514
+ }
2228
2515
 
2229
2516
  /**
2230
- * Component display name.
2517
+ * Combobox button trigger.
2518
+ *
2519
+ * @family Combobox
2231
2520
  */
2232
- const COMPONENT_NAME$15 = 'CommentBlock';
2521
+ const ComboboxButton = forwardRef((props, ref) => {
2522
+ const {
2523
+ as,
2524
+ label,
2525
+ onFocus,
2526
+ onBlur,
2527
+ labelDisplayMode = 'show-selection',
2528
+ ...forwardedProps
2529
+ } = props;
2530
+ const refs = useComboboxRefs();
2531
+ const context = useCombobox();
2532
+ const buttonProps = useComboboxButton({
2533
+ context,
2534
+ refs,
2535
+ onBlur,
2536
+ onFocus
2537
+ });
2538
+ const Element = as || Button;
2539
+ const showSelection = labelDisplayMode === 'show-selection';
2540
+ const tooltipOnly = labelDisplayMode === 'show-tooltip';
2541
+ const selectionLabel = showSelection && context.selectedIds?.length && context.inputValue;
2542
+ let content = null;
2543
+ if (!tooltipOnly) {
2544
+ // Display selection label or label
2545
+ content = selectionLabel || label;
2546
+ }
2547
+ const hideTooltip =
2548
+ // Hide tooltip if the displayed label and tooltip label are the same
2549
+ label === content ||
2550
+ // Hide tooltip when the combobox is open
2551
+ context.isOpen;
2552
+ const mergedRefs = useMergeRefs(ref, refs.triggerRef, refs.anchorRef);
2553
+ return /*#__PURE__*/jsx(Tooltip, {
2554
+ className: hideTooltip ? visuallyHidden() : undefined,
2555
+ label: label,
2556
+ closeMode: "hide",
2557
+ ariaLinkMode: "aria-labelledby",
2558
+ children: /*#__PURE__*/jsx(Element, {
2559
+ ref: mergedRefs,
2560
+ ...forwardedProps,
2561
+ ...buttonProps,
2562
+ children: content
2563
+ })
2564
+ });
2565
+ });
2566
+
2567
+ const CLASSNAME$17 = 'lumx-combobox-divider';
2568
+
2569
+ /** Combobox option divider */
2570
+ function ComboboxDivider() {
2571
+ return /*#__PURE__*/jsx(ListDivider, {
2572
+ className: CLASSNAME$17,
2573
+ role: "presentation"
2574
+ });
2575
+ }
2233
2576
 
2234
2577
  /**
2235
- * Component default class name and class prefix.
2578
+ * Provide props for the semantic and behaviors the combobox input trigger
2579
+ *
2580
+ * Overrides the useComboboxTrigger() props & behavior to prevent open on click
2581
+ * if `openOnFocus` is not enabled.
2236
2582
  */
2237
- const CLASSNAME$13 = 'lumx-comment-block';
2238
- const {
2239
- block: block$V,
2240
- element: element$H
2241
- } = classNames.bem(CLASSNAME$13);
2583
+ function useComboboxInput({
2584
+ onKeyDown: propsOnKeyDown,
2585
+ ...args
2586
+ }) {
2587
+ const triggerProps = useComboboxTrigger(args);
2588
+ const {
2589
+ onClick,
2590
+ onKeyDown,
2591
+ 'aria-expanded': showPopover
2592
+ } = triggerProps;
2593
+ const handleClick = () => {
2594
+ if (!args.context.openOnFocus && !args.context.openOnClick) {
2595
+ // Skip if input should not opening on focus nor click
2596
+ return;
2597
+ }
2598
+ onClick();
2599
+ };
2600
+ const handleKeyDown = evt => {
2601
+ if (evt.key === 'Escape') {
2602
+ // Reset field if closed
2603
+ if (!showPopover) {
2604
+ args.context.handleInputChange('');
2605
+ }
2606
+ return;
2607
+ }
2608
+ onKeyDown(evt);
2609
+ if (propsOnKeyDown) {
2610
+ propsOnKeyDown(evt);
2611
+ }
2612
+ };
2613
+ return {
2614
+ ...triggerProps,
2615
+ onClick: handleClick,
2616
+ onKeyDown: handleKeyDown
2617
+ };
2618
+ }
2242
2619
 
2243
2620
  /**
2244
- * Component default props.
2621
+ * Combobox input trigger.
2622
+ *
2623
+ * @family Combobox
2245
2624
  */
2246
- const DEFAULT_PROPS$X = {
2247
- variant: CommentBlockVariant.indented
2625
+ const ComboboxInput = ({
2626
+ hideToggle,
2627
+ inputRef,
2628
+ textFieldRef,
2629
+ afterElement,
2630
+ onFocus,
2631
+ onBlur,
2632
+ onKeyDown,
2633
+ clearButtonProps,
2634
+ hasClearButton,
2635
+ theme,
2636
+ ...textFieldProps
2637
+ }) => {
2638
+ const refs = useComboboxRefs();
2639
+ const context = useCombobox();
2640
+ const inputProps = useComboboxInput({
2641
+ refs,
2642
+ context,
2643
+ onBlur,
2644
+ onFocus,
2645
+ onKeyDown
2646
+ });
2647
+ const {
2648
+ listboxId,
2649
+ isOpen,
2650
+ handleOpen,
2651
+ handleClose,
2652
+ inputValue,
2653
+ handleInputChange
2654
+ } = context;
2655
+
2656
+ /** Callback for when the toggle button is trigged */
2657
+ const handleManualToggle = () => {
2658
+ if (isOpen) {
2659
+ handleClose();
2660
+ } else {
2661
+ handleOpen({
2662
+ manual: true
2663
+ });
2664
+ }
2665
+ refs.triggerRef?.current?.focus();
2666
+ };
2667
+ return /*#__PURE__*/jsx(TextField
2668
+ // Disable native autocomplete
2669
+ , {
2670
+ autoComplete: "off",
2671
+ ...textFieldProps,
2672
+ inputRef: mergeRefs(refs.triggerRef, inputRef),
2673
+ textFieldRef: mergeRefs(refs.anchorRef, textFieldRef)
2674
+ // Combobox props
2675
+ ,
2676
+ ...inputProps,
2677
+ theme: theme,
2678
+ value: inputValue,
2679
+ onClear: () => handleInputChange(''),
2680
+ onChange: handleInputChange,
2681
+ clearButtonProps: hasClearButton ? {
2682
+ ...clearButtonProps,
2683
+ label: context.translations.clearLabel
2684
+ } : undefined,
2685
+ afterElement: (!hideToggle || afterElement) && /*#__PURE__*/jsxs(Fragment, {
2686
+ children: [afterElement, !hideToggle && /*#__PURE__*/jsx(IconButton, {
2687
+ theme: theme,
2688
+ onClick: handleManualToggle,
2689
+ label: context.translations.showSuggestionsLabel,
2690
+ emphasis: Emphasis$1.low,
2691
+ size: Size$1.s,
2692
+ icon: inputProps['aria-expanded'] ? mdiChevronUp : mdiChevronDown,
2693
+ type: "button",
2694
+ tabIndex: -1,
2695
+ "aria-expanded": inputProps['aria-expanded'],
2696
+ "aria-haspopup": "listbox",
2697
+ "aria-controls": listboxId
2698
+ })]
2699
+ })
2700
+ });
2701
+ };
2702
+
2703
+ const ComboboxOptionContext = /*#__PURE__*/createContext({});
2704
+ /** Context Provider to store the current combobox option id. */
2705
+ const ComboboxOptionContextProvider = ({
2706
+ optionId,
2707
+ isKeyboardHighlighted,
2708
+ children
2709
+ }) => {
2710
+ const value = React__default.useMemo(() => ({
2711
+ optionId,
2712
+ isKeyboardHighlighted
2713
+ }), [optionId, isKeyboardHighlighted]);
2714
+ return /*#__PURE__*/jsx(ComboboxOptionContext.Provider, {
2715
+ value: value,
2716
+ children: children
2717
+ });
2248
2718
  };
2249
2719
 
2250
2720
  /**
2251
- * CommentBlock component.
2252
- *
2253
- * @param props Component props.
2254
- * @param ref Component ref.
2255
- * @return React element.
2721
+ * Retrieve the current combobox option id.
2722
+ * Must be used within a ComboboxOptionIdProvider
2256
2723
  */
2257
- const CommentBlock = forwardRef((props, ref) => {
2258
- const defaultTheme = useTheme() || Theme$1.light;
2724
+ const useComboboxOptionContext = () => {
2725
+ const comboboxOption = useContext(ComboboxOptionContext);
2726
+ if (!comboboxOption?.optionId) {
2727
+ throw new Error('This hook must be used within a ComboboxOptionIdProvider');
2728
+ }
2729
+ return comboboxOption;
2730
+ };
2731
+
2732
+ /** Retrieve the current combobox section id */
2733
+ const useComboboxSectionId = () => {
2734
+ return useContext(SectionContext);
2735
+ };
2736
+
2737
+ /**
2738
+ * Register the given option to the context
2739
+ */
2740
+ const useRegisterOption = (registerId, option, shouldRegister) => {
2259
2741
  const {
2260
- actions,
2261
- avatarProps,
2262
- children,
2263
- className,
2264
- date,
2742
+ dispatch
2743
+ } = useCombobox();
2744
+
2745
+ /** Register the given options */
2746
+ React__default.useEffect(() => {
2747
+ if (option && shouldRegister) {
2748
+ dispatch({
2749
+ type: 'ADD_OPTION',
2750
+ payload: {
2751
+ id: registerId,
2752
+ option
2753
+ }
2754
+ });
2755
+ }
2756
+
2757
+ // Unregister ids if/when the component unmounts or if option changes
2758
+ return () => {
2759
+ if (option) {
2760
+ dispatch({
2761
+ type: 'REMOVE_OPTION',
2762
+ payload: {
2763
+ id: registerId
2764
+ }
2765
+ });
2766
+ }
2767
+ };
2768
+ }, [dispatch, option, registerId, shouldRegister]);
2769
+ };
2770
+
2771
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
2772
+ const COMBOBOX_OPTION_CLASSNAME = 'lumx-combobox-option';
2773
+ const LUMX_CLASSNAME = 'lumx-list-item';
2774
+ const {
2775
+ block: block$_,
2776
+ element: element$M
2777
+ } = classNames.bem(COMBOBOX_OPTION_CLASSNAME);
2778
+ const lumxListItem = classNames.bem(LUMX_CLASSNAME);
2779
+
2780
+ /**
2781
+ * Content of the option.
2782
+ * This should only be rendered if the option is shown.
2783
+ */
2784
+ const OptionContent = forwardRef((props, ref) => {
2785
+ const {
2786
+ id,
2787
+ onSelect,
2788
+ isSelected,
2789
+ isDisabled,
2790
+ children,
2791
+ className,
2792
+ before,
2793
+ after,
2794
+ as,
2795
+ size = Size$1.tiny,
2796
+ comboboxType,
2797
+ tooltipProps,
2798
+ description,
2799
+ 'aria-hidden': ariaHidden,
2800
+ autofocus,
2801
+ ...forwardedProps
2802
+ } = props;
2803
+ const itemRef = React__default.useRef(null);
2804
+ const {
2805
+ state
2806
+ } = React__default.useContext(MovingFocusContext);
2807
+ const {
2808
+ selectedIds
2809
+ } = useCombobox();
2810
+ const hasSelection = selectedIds !== undefined;
2811
+ const isHighlighted = useVirtualFocus(id, itemRef, false, comboboxType === 'grid' ? id : undefined, autofocus);
2812
+ const Element = as || 'span';
2813
+ const ariaSelected = isSelected ? 'true' : 'false';
2814
+ const ariaDescriptionId = description ? `${id}-description` : undefined;
2815
+ const isKeyboardHighlighted = state.isUsingKeyboard && isHighlighted;
2816
+
2817
+ /**
2818
+ * The DS `ListItem` component has a lot of behavior / default props we do not want here.
2819
+ * Notably the before/after items are within the interactive element, which we do not want.
2820
+ * So we use a native li tag.
2821
+ */
2822
+ return /*#__PURE__*/jsx("li", {
2823
+ className: block$_(undefined, [className ?? '', lumxListItem.block({
2824
+ [`size-${size}`]: !!size
2825
+ })]),
2826
+ role: "presentation",
2827
+ ref: itemRef,
2828
+ "aria-hidden": ariaHidden,
2829
+ style: {
2830
+ display: ariaHidden ? 'none' : undefined
2831
+ },
2832
+ ...forwardedProps,
2833
+ children: /*#__PURE__*/jsxs(GenericBlock, {
2834
+ as: "div",
2835
+ role: comboboxType === 'grid' ? 'row' : 'presentation',
2836
+ className: element$M('content', {
2837
+ // Not using the lumx list item disabled style as it blocks pointer events
2838
+ 'is-disabled': !!isDisabled
2839
+ },
2840
+ // TODO: migrate away from using lumx-list-item styles https://lumapps.atlassian.net/browse/DSW-288
2841
+ [lumxListItem.element('link', {
2842
+ 'is-selected': Boolean(isSelected),
2843
+ 'is-highlighted': Boolean(isHighlighted)
2844
+ })]),
2845
+ "data-focus-visible-added": isKeyboardHighlighted ? 'true' : undefined,
2846
+ children: [before && /*#__PURE__*/jsx(GenericBlock.Figure, {
2847
+ as: "span",
2848
+ role: "presentation",
2849
+ className: element$M('before', undefined, [lumxListItem.element('before')]),
2850
+ children: before
2851
+ }), /*#__PURE__*/jsxs(GenericBlock.Content, {
2852
+ as: "span",
2853
+ role: "presentation",
2854
+ className: lumxListItem.element('content'),
2855
+ children: [/*#__PURE__*/jsx(Tooltip, {
2856
+ forceOpen: isKeyboardHighlighted,
2857
+ closeMode: "hide",
2858
+ ...tooltipProps,
2859
+ children: /*#__PURE__*/jsx(Element, {
2860
+ id: id,
2861
+ className: element$M('trigger'),
2862
+ role: comboboxType === 'grid' ? 'gridcell' : 'option',
2863
+ "aria-selected": hasSelection ? ariaSelected : undefined,
2864
+ "aria-disabled": isDisabled,
2865
+ "aria-describedby": ariaDescriptionId,
2866
+ onClick: onSelect
2867
+ // Prevent mouse down to avoid blur before the click is activated
2868
+ ,
2869
+ onMouseDown: event => event.preventDefault(),
2870
+ ref: ref,
2871
+ ...forwardedProps,
2872
+ children: children
2873
+ })
2874
+ }), description && /*#__PURE__*/jsx(Text, {
2875
+ as: "span",
2876
+ id: ariaDescriptionId,
2877
+ role: "presentation",
2878
+ className: element$M('description'),
2879
+ typography: "caption",
2880
+ color: "dark",
2881
+ colorVariant: "L2",
2882
+ children: description
2883
+ })]
2884
+ }), after && /*#__PURE__*/jsx(GenericBlock.Actions, {
2885
+ as: "span",
2886
+ role: "presentation",
2887
+ className: element$M('after', undefined, [lumxListItem.element('after')]),
2888
+ children: /*#__PURE__*/jsx(ComboboxOptionContextProvider, {
2889
+ optionId: id,
2890
+ isKeyboardHighlighted: isKeyboardHighlighted,
2891
+ children: after
2892
+ })
2893
+ })]
2894
+ })
2895
+ });
2896
+ });
2897
+
2898
+ /**
2899
+ * Props for ComboboxOption with additional generic properties.
2900
+ */
2901
+
2902
+ /**
2903
+ * Option to set within a combobox list.
2904
+ *
2905
+ * @family Combobox
2906
+ * @param ComboboxOptionProps
2907
+ * @returns ComboboxOption
2908
+ */
2909
+ const ComboboxOption = forwardRef((props, ref) => {
2910
+ const {
2911
+ children,
2912
+ id,
2913
+ textValue,
2914
+ data,
2915
+ filterFromInput = true,
2916
+ onSelect: onOptionSelect,
2917
+ isDisabled,
2918
+ as = 'span',
2919
+ ...optionProps
2920
+ } = props;
2921
+
2922
+ // Get the id of the current group, if any.
2923
+ const section = useComboboxSectionId();
2924
+ const {
2925
+ comboboxId,
2926
+ selectedIds,
2927
+ showAll,
2928
+ inputValue,
2929
+ handleSelected,
2930
+ type
2931
+ } = useCombobox();
2932
+ // Generate a unique id for this option.
2933
+ const generatedId = generateOptionId(comboboxId, id);
2934
+ const isSelected = selectedIds?.includes(generatedId);
2935
+
2936
+ // If no text value is set and the direct child is a simple string, use it as value.
2937
+ const isStringChild = typeof children === 'string' || typeof children === 'number';
2938
+ const value = children && !textValue && isStringChild ? children.toString() : textValue;
2939
+ const showOption = !filterFromInput || showAll || value?.toString()?.toLowerCase().includes(inputValue?.toLowerCase());
2940
+ const registeredOption = React__default.useMemo(() => ({
2941
+ id,
2942
+ generatedId,
2943
+ textValue: value,
2944
+ data,
2945
+ filter: filterFromInput,
2946
+ isDisabled: isDisabled || !showOption,
2947
+ sectionId: section.sectionId,
2948
+ onSelect: onOptionSelect
2949
+ }), [data, filterFromInput, generatedId, section.sectionId, id, isDisabled, onOptionSelect, showOption, value]);
2950
+
2951
+ // Register the option
2952
+ useRegisterOption(generatedId, registeredOption, showOption);
2953
+ const handleSelect = React__default.useCallback(() => handleSelected(registeredOption, 'click'), [handleSelected, registeredOption]);
2954
+ if (!id || !showOption) {
2955
+ return null;
2956
+ }
2957
+ return /*#__PURE__*/jsx(OptionContent, {
2958
+ id: generatedId,
2959
+ onSelect: handleSelect,
2960
+ isSelected: isSelected,
2961
+ isDisabled: isDisabled,
2962
+ as: as,
2963
+ ref: ref,
2964
+ comboboxType: type,
2965
+ "aria-hidden": section.isLoading,
2966
+ ...optionProps,
2967
+ children: children || textValue
2968
+ });
2969
+ });
2970
+
2971
+ // Default widths the skeletons must have
2972
+ const defaultWidths = [REAL_SIZE_FOR_LUMX_SIZE.xxl, REAL_SIZE_FOR_LUMX_SIZE.xl, REAL_SIZE_FOR_LUMX_SIZE.l];
2973
+ const {
2974
+ block: block$Z,
2975
+ element: element$L
2976
+ } = classNames.bem(COMBOBOX_OPTION_CLASSNAME);
2977
+
2978
+ /**
2979
+ * Skeleton for a combobox option.
2980
+ * A typography skeleton is rendered by default but can be overridden by passing children.
2981
+ */
2982
+ const ComboboxOptionSkeleton = ({
2983
+ className,
2984
+ index,
2985
+ before,
2986
+ after,
2987
+ size = Size$1.tiny,
2988
+ children
2989
+ }) => {
2990
+ const renderedChildren = typeof children === 'function' ? children({
2991
+ index
2992
+ }) : children;
2993
+ const content = renderedChildren || /*#__PURE__*/jsx(SkeletonTypography, {
2994
+ typography: "body1",
2995
+ width: index !== undefined && defaultWidths[index] ? defaultWidths[index] : REAL_SIZE_FOR_LUMX_SIZE.xl
2996
+ });
2997
+ return /*#__PURE__*/jsxs("li", {
2998
+ role: "presentation",
2999
+ className: block$Z({
3000
+ skeleton: true
3001
+ }, ['lumx-list-item', `lumx-list-item--size-${size}`, className]),
3002
+ children: [/*#__PURE__*/jsxs("div", {
3003
+ role: "presentation",
3004
+ className: element$L('content', ['lumx-list-item__wrapper']),
3005
+ children: [before && /*#__PURE__*/jsx(Text, {
3006
+ as: "span",
3007
+ role: "presentation",
3008
+ className: element$L('before', ['lumx-list-item__before']),
3009
+ children: before
3010
+ }), content]
3011
+ }), after && /*#__PURE__*/jsx("div", {
3012
+ role: "presentation",
3013
+ className: element$L('after', ['lumx-list-item__after']),
3014
+ children: after
3015
+ })]
3016
+ });
3017
+ };
3018
+
3019
+ /** Default skeleton for the options list of the combobox */
3020
+ const ComboboxListSkeleton = ({
3021
+ isLoadingMore,
3022
+ children
3023
+ }) => /*#__PURE__*/jsx(Fragment, {
3024
+ children: Array.from({
3025
+ length: isLoadingMore ? 1 : 3
3026
+ }).map((_, index) => {
3027
+ const renderedChildren = typeof children === 'function' ? children({
3028
+ index
3029
+ }) : children || /*#__PURE__*/jsx(ComboboxOptionSkeleton, {
3030
+ index: index
3031
+ });
3032
+ return (
3033
+ /*#__PURE__*/
3034
+ // eslint-disable-next-line react/no-array-index-key
3035
+ jsx(React__default.Fragment, {
3036
+ children: renderedChildren
3037
+ }, index)
3038
+ );
3039
+ })
3040
+ });
3041
+
3042
+ /** The states in which the full loading must be displayed */
3043
+ const FULL_LOADING_STATES = ['loading', 'debouncing', 'filtering'];
3044
+ const CLASSNAME$16 = 'lumx-combobox-listbox';
3045
+ const {
3046
+ block: block$Y,
3047
+ element: element$K
3048
+ } = bem$1(CLASSNAME$16);
3049
+
3050
+ /**
3051
+ * The listbox containing the combobox's options.
3052
+ *
3053
+ * @family Combobox
3054
+ * @param ComboboxListBoxProps
3055
+ * @returns ComboboxListBox
3056
+ */
3057
+ const ComboboxListBox = ({
3058
+ children,
3059
+ renderItemSkeleton,
3060
+ label,
3061
+ popoverProps,
3062
+ footer,
3063
+ listRef,
3064
+ ...forwardedProps
3065
+ }) => {
3066
+ const {
3067
+ status,
3068
+ listboxId,
3069
+ isOpen,
3070
+ optionsLength,
3071
+ handleClose: contextHandleClose,
3072
+ type,
3073
+ inputValue,
3074
+ showEmptyState,
3075
+ showErrorState,
3076
+ translations
3077
+ } = useCombobox();
3078
+ const {
3079
+ anchorRef
3080
+ } = useComboboxRefs();
3081
+ const {
3082
+ onClose,
3083
+ ...otherPopoverProps
3084
+ } = popoverProps || {};
3085
+ const {
3086
+ style,
3087
+ className,
3088
+ ...listProps
3089
+ } = forwardedProps;
3090
+ // The states to show a full skeleton instead of the options
3091
+ const showFullLoading = FULL_LOADING_STATES.includes(status);
3092
+ const isErrorStateDisplayed = showErrorState && isOpen && status === 'error';
3093
+ const isEmptyStateDisplayed = showEmptyState && isOpen && status === 'idle' && optionsLength === 0;
3094
+
3095
+ /**
3096
+ * The conditions in which we want to show the content of the popover
3097
+ * * The parent asked for the popover to be opened
3098
+ * * There is at least one option to displayed OR a skeleton
3099
+ */
3100
+ const showPopover = isOpen && (optionsLength > 0 || showFullLoading) || isEmptyStateDisplayed || isErrorStateDisplayed;
3101
+ const handleClose = () => {
3102
+ if (isOpen) {
3103
+ contextHandleClose?.();
3104
+ onClose?.();
3105
+ }
3106
+ };
3107
+ const emptyMessage = translations.noResultsForInputLabel(inputValue);
3108
+ return /*#__PURE__*/jsxs(Fragment, {
3109
+ children: [/*#__PURE__*/jsxs(Text, {
3110
+ as: "p",
3111
+ className: visuallyHidden(),
3112
+ role: "log",
3113
+ "aria-live": "assertive",
3114
+ children: [isOpen && !showFullLoading && !isEmptyStateDisplayed && !isErrorStateDisplayed && translations.nbOptionsLabel(optionsLength), isErrorStateDisplayed && `${translations.serviceUnavailableLabel} ${translations.tryReloadLabel}`, showFullLoading && translations.loadingLabel, isEmptyStateDisplayed && emptyMessage]
3115
+ }), /*#__PURE__*/jsx(Popover, {
3116
+ role: "none",
3117
+ onClose: handleClose,
3118
+ anchorRef: anchorRef,
3119
+ fitToAnchorWidth: true,
3120
+ fitWithinViewportHeight: true,
3121
+ closeOnEscape: true,
3122
+ closeOnClickAway: true,
3123
+ placement: Placement.BOTTOM,
3124
+ isOpen: isOpen,
3125
+ ...otherPopoverProps,
3126
+ children: /*#__PURE__*/jsxs("div", {
3127
+ style: {
3128
+ ...style,
3129
+ overflowY: 'auto',
3130
+ display: showPopover ? 'flex' : 'none',
3131
+ flexDirection: 'column'
3132
+ },
3133
+ children: [/*#__PURE__*/jsxs("ul", {
3134
+ ref: listRef,
3135
+ id: listboxId,
3136
+ role: type,
3137
+ "aria-label": label,
3138
+ className: block$Y([className, 'lumx-list lumx-list--item-padding-big']),
3139
+ style: {
3140
+ flex: 1,
3141
+ overflowY: 'auto'
3142
+ },
3143
+ ...listProps,
3144
+ children: [!showFullLoading && children, [...FULL_LOADING_STATES, 'loadingMore'].includes(status) && /*#__PURE__*/jsx(ComboboxListSkeleton, {
3145
+ isLoadingMore: status === 'loadingMore',
3146
+ children: renderItemSkeleton
3147
+ })]
3148
+ }), footer, (isEmptyStateDisplayed || isErrorStateDisplayed) && /*#__PURE__*/jsx(GenericBlock, {
3149
+ className: element$K('state'),
3150
+ orientation: "vertical",
3151
+ vAlign: "center",
3152
+ children: /*#__PURE__*/jsxs(GenericBlock.Content, {
3153
+ children: [inputValue && isEmptyStateDisplayed && /*#__PURE__*/jsx(Text, {
3154
+ as: "p",
3155
+ typography: "body1",
3156
+ color: "dark",
3157
+ colorVariant: "L2",
3158
+ dangerouslySetInnerHTML: {
3159
+ __html: translations.noResultsForInputLabel(inputValue)
3160
+ }
3161
+ }), !inputValue && isEmptyStateDisplayed && /*#__PURE__*/jsx(Text, {
3162
+ as: "p",
3163
+ typography: "body1",
3164
+ color: "dark",
3165
+ colorVariant: "L2",
3166
+ children: translations.noResultsForInputLabel()
3167
+ }), isErrorStateDisplayed && /*#__PURE__*/jsxs(Fragment, {
3168
+ children: [/*#__PURE__*/jsx(Heading, {
3169
+ as: "h2",
3170
+ typography: "subtitle2",
3171
+ children: translations.serviceUnavailableLabel
3172
+ }), /*#__PURE__*/jsx(Text, {
3173
+ as: "p",
3174
+ typography: "body1",
3175
+ color: "dark",
3176
+ colorVariant: "L2",
3177
+ children: translations.tryReloadLabel
3178
+ })]
3179
+ })]
3180
+ })
3181
+ })]
3182
+ })
3183
+ })]
3184
+ });
3185
+ };
3186
+
3187
+ /**
3188
+ * Action to set on a Combobox Option.
3189
+ * Allows to add an interactive element that
3190
+ * can be navigated to and triggered using the keyboard.
3191
+ *
3192
+ * Defaults as "button"
3193
+ *
3194
+ * @family Combobox
3195
+ * @param ComboboxOptionActionProps
3196
+ * @returns ComboboxOptionAction
3197
+ */
3198
+ const ComboboxOptionAction = props => {
3199
+ const {
3200
+ as,
3201
+ isDisabled,
3202
+ onClick,
3203
+ id: originalId,
3204
+ ...forwardedProps
3205
+ } = props;
3206
+ const {
3207
+ optionId
3208
+ } = useComboboxOptionContext();
3209
+ const {
3210
+ triggerRef
3211
+ } = useComboboxRefs();
3212
+ const itemRef = React__default.useRef(null);
3213
+ const generatedId = useId();
3214
+ const id = originalId || generatedId;
3215
+ const isHighlighted = useVirtualFocus(id, itemRef, isDisabled, optionId);
3216
+ const {
3217
+ state
3218
+ } = React__default.useContext(MovingFocusContext);
3219
+ const Component = as || 'button';
3220
+ const registeredActionOption = React__default.useMemo(() => ({
3221
+ id,
3222
+ generatedId: id,
3223
+ isAction: true,
3224
+ isDisabled,
3225
+ onSelect: () => {
3226
+ itemRef.current?.click();
3227
+ }
3228
+ }), [id, isDisabled]);
3229
+
3230
+ // Register the option
3231
+ useRegisterOption(id, registeredActionOption, !isDisabled);
3232
+ const handleActionClick = React__default.useCallback(() => {
3233
+ if (onClick) {
3234
+ onClick();
3235
+ }
3236
+ if (triggerRef?.current) {
3237
+ triggerRef.current?.focus();
3238
+ }
3239
+ }, [triggerRef, onClick]);
3240
+ return /*#__PURE__*/jsx(Component, {
3241
+ ...forwardedProps,
3242
+ isDisabled: isDisabled,
3243
+ id: id,
3244
+ role: "gridcell",
3245
+ ref: itemRef,
3246
+ "data-focus-visible-added": state.isUsingKeyboard && isHighlighted ? 'true' : undefined,
3247
+ "aria-disabled": isDisabled,
3248
+ onClick: handleActionClick
3249
+ });
3250
+ };
3251
+
3252
+ const useBooleanState = defaultValue => {
3253
+ const [booleanValue, setBoolean] = useState(defaultValue);
3254
+ const setToFalse = useCallback(() => setBoolean(false), []);
3255
+ const setToTrue = useCallback(() => setBoolean(true), []);
3256
+ const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
3257
+ return [booleanValue, setToFalse, setToTrue, toggleBoolean];
3258
+ };
3259
+
3260
+ const CLASSNAME$15 = 'lumx-combobox-option-more-info';
3261
+ const {
3262
+ block: block$X,
3263
+ element: element$J
3264
+ } = classNames.bem(CLASSNAME$15);
3265
+
3266
+ /**
3267
+ * Display more info on the option as a popover opening on mouse hover or keyboard nav
3268
+ * Please consider using a simpler option description instead for better UX and a11y.
3269
+ *
3270
+ * @family Combobox
3271
+ */
3272
+ const ComboboxOptionMoreInfo = ({
3273
+ buttonProps,
3274
+ popoverProps,
3275
+ onToggle,
3276
+ children
3277
+ }) => {
3278
+ const ref = React__default.useRef(null);
3279
+ const [isHovered,, onMouseLeave, onMouseEnter] = useBooleanState(false);
3280
+ const comboboxOption = useComboboxOptionContext();
3281
+
3282
+ // Open on mouse hover or key nav
3283
+ const isOpen = isHovered || comboboxOption.isKeyboardHighlighted;
3284
+ React__default.useEffect(() => {
3285
+ onToggle?.(isOpen);
3286
+ }, [isOpen, onToggle]);
3287
+ return /*#__PURE__*/jsxs(Fragment, {
3288
+ children: [/*#__PURE__*/jsx(IconButton, {
3289
+ ...buttonProps,
3290
+ ref: ref,
3291
+ className: block$X([buttonProps?.className]),
3292
+ icon: mdiInformationOutline,
3293
+ size: "s",
3294
+ emphasis: "low",
3295
+ onMouseEnter: onMouseEnter,
3296
+ onMouseLeave: onMouseLeave
3297
+ // Button actually plays no role here other than a target for the mouse hover
3298
+ // Keyboard accessibility is handled via combobox keyboard highlighting
3299
+ ,
3300
+ "aria-hidden": true,
3301
+ label: ""
3302
+ }), /*#__PURE__*/jsx(Popover, {
3303
+ ...popoverProps,
3304
+ className: element$J('popover', [popoverProps?.className]),
3305
+ anchorRef: ref,
3306
+ isOpen: isOpen,
3307
+ closeOnEscape: true,
3308
+ closeOnClickAway: true,
3309
+ placement: "bottom-start",
3310
+ children: children
3311
+ }), /*#__PURE__*/jsx(A11YLiveMessage, {
3312
+ hidden: true,
3313
+ children: isOpen ? children : undefined
3314
+ })]
3315
+ });
3316
+ };
3317
+
3318
+ const CLASSNAME$14 = 'lumx-combobox-section';
3319
+ const {
3320
+ block: block$W,
3321
+ element: element$I
3322
+ } = classNames.bem(CLASSNAME$14);
3323
+
3324
+ /**
3325
+ * Content of the ComboboxSection.
3326
+ */
3327
+ const ComboboxSectionContent = ({
3328
+ className,
3329
+ title,
3330
+ children,
3331
+ isLoading,
3332
+ renderItemSkeleton
3333
+ }) => {
3334
+ const {
3335
+ options
3336
+ } = useCombobox();
3337
+ const {
3338
+ sectionId
3339
+ } = useComboboxSectionId();
3340
+ const hasRegisteredChildren = Boolean(Object.values(options).find(option => isComboboxValue(option) && option.sectionId === sectionId));
3341
+ const titleId = title && `${sectionId}-title`;
3342
+ if (!children && !isLoading) {
3343
+ return null;
3344
+ }
3345
+ const isHidden = !hasRegisteredChildren && !isLoading;
3346
+ return /*#__PURE__*/jsxs("li", {
3347
+ className: block$W([className]),
3348
+ role: !isHidden ? 'none' : undefined,
3349
+ "aria-hidden": isHidden,
3350
+ style: {
3351
+ display: isHidden ? 'none' : undefined
3352
+ },
3353
+ children: [title && /*#__PURE__*/jsx(Text, {
3354
+ as: "span",
3355
+ className: element$I('header', [ListSubheader.className]),
3356
+ "aria-hidden": "true",
3357
+ id: titleId,
3358
+ children: title
3359
+ }), /*#__PURE__*/jsxs("ul", {
3360
+ className: element$I('content'),
3361
+ role: "group",
3362
+ "aria-labelledby": titleId,
3363
+ children: [children, isLoading && /*#__PURE__*/jsx(ComboboxListSkeleton, {
3364
+ children: renderItemSkeleton
3365
+ })]
3366
+ })]
3367
+ });
3368
+ };
3369
+
3370
+ /**
3371
+ * Section for options of a Combobox.
3372
+ *
3373
+ * @family Combobox
3374
+ * @param ComboboxSectionProps
3375
+ * @returns ComboboxSection
3376
+ */
3377
+ const ComboboxSection = ({
3378
+ children,
3379
+ ...props
3380
+ }) => {
3381
+ const sectionId = useId();
3382
+ const value = React__default.useMemo(() => ({
3383
+ sectionId,
3384
+ isLoading: props.isLoading
3385
+ }), [sectionId, props.isLoading]);
3386
+ return /*#__PURE__*/jsx(SectionContext.Provider, {
3387
+ value: value,
3388
+ children: /*#__PURE__*/jsx(ComboboxSectionContent, {
3389
+ ...props,
3390
+ children: children
3391
+ })
3392
+ });
3393
+ };
3394
+
3395
+ /** Context provider for the combobox. */
3396
+ const ComboboxProvider = ({
3397
+ children,
3398
+ value
3399
+ }) => {
3400
+ return /*#__PURE__*/jsx(ComboboxContext.Provider, {
3401
+ value: value,
3402
+ children: /*#__PURE__*/jsx(MovingFocusProvider, {
3403
+ options: {
3404
+ direction: value.type === 'grid' ? 'both' : 'vertical',
3405
+ firstFocusDirection: value.type === 'grid' ? 'vertical' : undefined,
3406
+ loopAround: {
3407
+ row: 'next-loop',
3408
+ col: 'inside'
3409
+ },
3410
+ gridJumpToShortcutDirection: 'vertical',
3411
+ defaultSelectedId: value.selectedIds?.[0],
3412
+ listKey: value.inputValue
3413
+ },
3414
+ children: children
3415
+ })
3416
+ });
3417
+ };
3418
+
3419
+ const Combobox$1 = ({
3420
+ id: htmlId,
3421
+ inputValue,
3422
+ defaultInputValue,
3423
+ autoFilter = true,
3424
+ openOnClick,
3425
+ openOnFocus,
3426
+ status,
3427
+ showEmptyState = !autoFilter,
3428
+ showErrorState = !!status,
3429
+ selectedIds,
3430
+ onInputChange,
3431
+ onSelect,
3432
+ onOpen,
3433
+ children,
3434
+ selectionType,
3435
+ translations
3436
+ }) => {
3437
+ const textFieldRef = useRef(null);
3438
+ const triggerRef = useRef(null);
3439
+
3440
+ // Generate a unique id for the combobox that will be used for every child components.
3441
+ const generatedId = useId();
3442
+ const comboboxId = htmlId || generatedId;
3443
+ const listboxId = `${comboboxId}-popover`;
3444
+
3445
+ /** Generate the selected option id from the given selected id. */
3446
+ const currentSelectedIds = selectedIds?.map(selectedId => generateOptionId(comboboxId, selectedId.toString()));
3447
+
3448
+ /** Generate the state */
3449
+ const [state, dispatch] = useReducer(reducer$1, initialState, defaultState => ({
3450
+ ...defaultState,
3451
+ comboboxId,
3452
+ listboxId,
3453
+ // a default input value can be set if needed
3454
+ inputValue: defaultInputValue || defaultState.inputValue
3455
+ }));
3456
+
3457
+ /**
3458
+ * Return the current input value.
3459
+ */
3460
+ const currentInputValue = useMemo(() => {
3461
+ // If the component is controlled and a value is already set by the parent, use this value
3462
+ if (inputValue !== null && inputValue !== undefined) {
3463
+ return inputValue;
3464
+ }
3465
+
3466
+ // Then use the local value
3467
+ if (state.inputValue) {
3468
+ return state.inputValue;
3469
+ }
3470
+
3471
+ // In all other cases, return an empty string.
3472
+ return '';
3473
+ }, [inputValue, state.inputValue]);
3474
+
3475
+ /** Return a memoized state */
3476
+ const synchedState = useMemo(() => {
3477
+ return {
3478
+ ...state,
3479
+ showAll: !autoFilter || state.showAll,
3480
+ inputValue: currentInputValue,
3481
+ status: status || state.status,
3482
+ listboxId
3483
+ };
3484
+ }, [currentInputValue, listboxId, autoFilter, state, status]);
3485
+
3486
+ /** Props to set in the context */
3487
+ const comboboxProviderValue = useMemo(() => ({
3488
+ ...synchedState,
3489
+ openOnFocus,
3490
+ openOnClick,
3491
+ onInputChange,
3492
+ onOpen,
3493
+ onSelect,
3494
+ dispatch,
3495
+ selectionType,
3496
+ selectedIds: currentSelectedIds,
3497
+ showEmptyState,
3498
+ showErrorState,
3499
+ translations
3500
+ }), [synchedState, openOnFocus, openOnClick, onInputChange, onOpen, onSelect, selectionType, currentSelectedIds, showEmptyState, showErrorState, translations]);
3501
+ return /*#__PURE__*/jsx(ComboboxRefsProvider, {
3502
+ triggerRef: triggerRef,
3503
+ anchorRef: textFieldRef,
3504
+ children: /*#__PURE__*/jsx(ComboboxProvider, {
3505
+ value: comboboxProviderValue,
3506
+ children: children
3507
+ })
3508
+ });
3509
+ };
3510
+
3511
+ const SUB_COMPONENTS = {
3512
+ /**
3513
+ * Option to set within a combobox list.
3514
+ *
3515
+ * @family Combobox
3516
+ * @param ComboboxOptionProps
3517
+ * @returns ComboboxOption
3518
+ */
3519
+ Option: ComboboxOption,
3520
+ /**
3521
+ * Skeleton for a combobox option.
3522
+ * A typography skeleton is rendered by default but can be overridden by passing children.
3523
+ */
3524
+ OptionSkeleton: ComboboxOptionSkeleton,
3525
+ /**
3526
+ * Section for options of a Combobox.
3527
+ *
3528
+ * @family Combobox
3529
+ * @param ComboboxSectionProps
3530
+ * @returns ComboboxSection
3531
+ */
3532
+ Section: ComboboxSection,
3533
+ /**
3534
+ * Combobox input trigger.
3535
+ *
3536
+ * @family Combobox
3537
+ */
3538
+ Input: ComboboxInput,
3539
+ /**
3540
+ * The listbox containing the combobox's options.
3541
+ *
3542
+ * @family Combobox
3543
+ * @param ComboboxListBoxProps
3544
+ * @returns ComboboxListBox
3545
+ */
3546
+ List: ComboboxListBox,
3547
+ /**
3548
+ * Combobox button trigger.
3549
+ *
3550
+ * @family Combobox
3551
+ */
3552
+ Button: ComboboxButton
3553
+ };
3554
+
3555
+ /**
3556
+ *
3557
+ * A Combobox is a combination of two components:
3558
+ * * An input to enter the user's value
3559
+ * * A popover with a list of suggestions to fill the value.
3560
+ *
3561
+ * These two components are included via the Combobox.Input and Combobox.ListBox components.
3562
+ *
3563
+ * In its simplest implementation the component will automatically filter the given options
3564
+ * from the value of the input and fill the input with the textValue of the selected option.
3565
+ *
3566
+ * Props are available for more complex implementations.
3567
+ *
3568
+ * @family Combobox
3569
+ * @param ComboboxProps
3570
+ * @returns Combobox
3571
+ */
3572
+ const Combobox = Object.assign(Combobox$1, SUB_COMPONENTS);
3573
+
3574
+ /**
3575
+ * Comment block variants.
3576
+ */
3577
+ const CommentBlockVariant = {
3578
+ indented: 'indented',
3579
+ linear: 'linear'
3580
+ };
3581
+
3582
+ /**
3583
+ * Defines the props of the component.
3584
+ */
3585
+
3586
+ /**
3587
+ * Component display name.
3588
+ */
3589
+ const COMPONENT_NAME$15 = 'CommentBlock';
3590
+
3591
+ /**
3592
+ * Component default class name and class prefix.
3593
+ */
3594
+ const CLASSNAME$13 = 'lumx-comment-block';
3595
+ const {
3596
+ block: block$V,
3597
+ element: element$H
3598
+ } = classNames.bem(CLASSNAME$13);
3599
+
3600
+ /**
3601
+ * Component default props.
3602
+ */
3603
+ const DEFAULT_PROPS$Z = {
3604
+ variant: CommentBlockVariant.indented
3605
+ };
3606
+
3607
+ /**
3608
+ * CommentBlock component.
3609
+ *
3610
+ * @param props Component props.
3611
+ * @param ref Component ref.
3612
+ * @return React element.
3613
+ */
3614
+ const CommentBlock = forwardRef((props, ref) => {
3615
+ const defaultTheme = useTheme() || Theme$1.light;
3616
+ const {
3617
+ actions,
3618
+ avatarProps,
3619
+ children,
3620
+ className,
3621
+ date,
2265
3622
  fullDate,
2266
3623
  hasActions,
2267
3624
  headerActions,
@@ -2273,7 +3630,7 @@ const CommentBlock = forwardRef((props, ref) => {
2273
3630
  onMouseLeave,
2274
3631
  text,
2275
3632
  theme = defaultTheme,
2276
- variant = DEFAULT_PROPS$X.variant,
3633
+ variant = DEFAULT_PROPS$Z.variant,
2277
3634
  ...forwardedProps
2278
3635
  } = props;
2279
3636
  const hasChildren = Children.count(children) > 0;
@@ -2342,7 +3699,7 @@ const CommentBlock = forwardRef((props, ref) => {
2342
3699
  });
2343
3700
  CommentBlock.displayName = COMPONENT_NAME$15;
2344
3701
  CommentBlock.className = CLASSNAME$13;
2345
- CommentBlock.defaultProps = DEFAULT_PROPS$X;
3702
+ CommentBlock.defaultProps = DEFAULT_PROPS$Z;
2346
3703
 
2347
3704
  /**
2348
3705
  * Add a number of months from a date while resetting the day to prevent month length mismatches.
@@ -2832,14 +4189,6 @@ const DatePicker = forwardRef((props, ref) => {
2832
4189
  DatePicker.displayName = COMPONENT_NAME$14;
2833
4190
  DatePicker.className = CLASSNAME$12;
2834
4191
 
2835
- const useBooleanState = defaultValue => {
2836
- const [booleanValue, setBoolean] = useState(defaultValue);
2837
- const setToFalse = useCallback(() => setBoolean(false), []);
2838
- const setToTrue = useCallback(() => setBoolean(true), []);
2839
- const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
2840
- return [booleanValue, setToFalse, setToTrue, toggleBoolean];
2841
- };
2842
-
2843
4192
  /**
2844
4193
  * Component display name.
2845
4194
  */
@@ -3447,7 +4796,7 @@ const {
3447
4796
  /**
3448
4797
  * Component default props.
3449
4798
  */
3450
- const DEFAULT_PROPS$W = {
4799
+ const DEFAULT_PROPS$Y = {
3451
4800
  size: Size$1.big,
3452
4801
  disableBodyScroll: true
3453
4802
  };
@@ -3478,11 +4827,11 @@ const Dialog = forwardRef((props, ref) => {
3478
4827
  parentElement,
3479
4828
  contentRef,
3480
4829
  preventAutoClose,
3481
- size = DEFAULT_PROPS$W.size,
4830
+ size = DEFAULT_PROPS$Y.size,
3482
4831
  zIndex,
3483
4832
  dialogProps,
3484
4833
  onVisibilityChange,
3485
- disableBodyScroll = DEFAULT_PROPS$W.disableBodyScroll,
4834
+ disableBodyScroll = DEFAULT_PROPS$Y.disableBodyScroll,
3486
4835
  preventCloseOnClick,
3487
4836
  preventCloseOnEscape,
3488
4837
  ...forwardedProps
@@ -3622,7 +4971,7 @@ const Dialog = forwardRef((props, ref) => {
3622
4971
  });
3623
4972
  Dialog.displayName = COMPONENT_NAME$11;
3624
4973
  Dialog.className = CLASSNAME$11;
3625
- Dialog.defaultProps = DEFAULT_PROPS$W;
4974
+ Dialog.defaultProps = DEFAULT_PROPS$Y;
3626
4975
 
3627
4976
  /**
3628
4977
  * Component display name.
@@ -3666,7 +5015,7 @@ const Divider$1 = props => {
3666
5015
  /**
3667
5016
  * Component default props.
3668
5017
  */
3669
- const DEFAULT_PROPS$V = {};
5018
+ const DEFAULT_PROPS$X = {};
3670
5019
 
3671
5020
  /**
3672
5021
  * Divider component.
@@ -3689,7 +5038,7 @@ const Divider = forwardRef((props, ref) => {
3689
5038
  });
3690
5039
  Divider.displayName = COMPONENT_NAME$10;
3691
5040
  Divider.className = CLASSNAME$10;
3692
- Divider.defaultProps = DEFAULT_PROPS$V;
5041
+ Divider.defaultProps = DEFAULT_PROPS$X;
3693
5042
 
3694
5043
  /**
3695
5044
  * Component display name.
@@ -3914,7 +5263,7 @@ const {
3914
5263
  /**
3915
5264
  * Component default props.
3916
5265
  */
3917
- const DEFAULT_PROPS$U = {
5266
+ const DEFAULT_PROPS$W = {
3918
5267
  tabIndex: -1
3919
5268
  };
3920
5269
 
@@ -3933,7 +5282,7 @@ const InternalList = forwardRef((props, ref) => {
3933
5282
  isClickable,
3934
5283
  itemPadding,
3935
5284
  onListItemSelected,
3936
- tabIndex = DEFAULT_PROPS$U.tabIndex,
5285
+ tabIndex = DEFAULT_PROPS$W.tabIndex,
3937
5286
  ...forwardedProps
3938
5287
  } = props;
3939
5288
  const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
@@ -3949,7 +5298,7 @@ const InternalList = forwardRef((props, ref) => {
3949
5298
  });
3950
5299
  InternalList.displayName = COMPONENT_NAME$_;
3951
5300
  InternalList.className = CLASSNAME$_;
3952
- InternalList.defaultProps = DEFAULT_PROPS$U;
5301
+ InternalList.defaultProps = DEFAULT_PROPS$W;
3953
5302
  const List = Object.assign(InternalList, {
3954
5303
  useKeyboardListNavigation
3955
5304
  });
@@ -6394,7 +7743,7 @@ const {
6394
7743
  /**
6395
7744
  * Component default props.
6396
7745
  */
6397
- const DEFAULT_PROPS$T = {
7746
+ const DEFAULT_PROPS$V = {
6398
7747
  elevation: 3,
6399
7748
  placement: Placement.AUTO,
6400
7749
  focusAnchorOnClose: true,
@@ -6411,24 +7760,24 @@ const _InnerPopover = forwardRef((props, ref) => {
6411
7760
  className,
6412
7761
  closeOnClickAway,
6413
7762
  closeOnEscape,
6414
- elevation = DEFAULT_PROPS$T.elevation,
7763
+ elevation = DEFAULT_PROPS$V.elevation,
6415
7764
  focusElement,
6416
7765
  hasArrow,
6417
7766
  isOpen,
6418
7767
  onClose,
6419
7768
  parentElement,
6420
- usePortal = DEFAULT_PROPS$T.usePortal,
6421
- focusAnchorOnClose = DEFAULT_PROPS$T.focusAnchorOnClose,
7769
+ usePortal = DEFAULT_PROPS$V.usePortal,
7770
+ focusAnchorOnClose = DEFAULT_PROPS$V.focusAnchorOnClose,
6422
7771
  withFocusTrap,
6423
7772
  boundaryRef,
6424
7773
  fitToAnchorWidth,
6425
7774
  fitWithinViewportHeight,
6426
7775
  focusTrapZoneElement,
6427
7776
  offset,
6428
- placement = DEFAULT_PROPS$T.placement,
7777
+ placement = DEFAULT_PROPS$V.placement,
6429
7778
  style,
6430
7779
  theme,
6431
- zIndex = DEFAULT_PROPS$T.zIndex,
7780
+ zIndex = DEFAULT_PROPS$V.zIndex,
6432
7781
  ...forwardedProps
6433
7782
  } = props;
6434
7783
  const popoverRef = useRef(null);
@@ -6514,7 +7863,7 @@ const Popover = skipRender(
6514
7863
  () => Boolean(DOCUMENT), _InnerPopover);
6515
7864
  Popover.displayName = COMPONENT_NAME$Z;
6516
7865
  Popover.className = CLASSNAME$Z;
6517
- Popover.defaultProps = DEFAULT_PROPS$T;
7866
+ Popover.defaultProps = DEFAULT_PROPS$V;
6518
7867
 
6519
7868
  // The error margin in px we want to have for triggering infinite scroll
6520
7869
  const SCROLL_TRIGGER_MARGIN = 5;
@@ -6574,7 +7923,7 @@ const {
6574
7923
  /**
6575
7924
  * Component default props.
6576
7925
  */
6577
- const DEFAULT_PROPS$S = {
7926
+ const DEFAULT_PROPS$U = {
6578
7927
  closeOnClick: true,
6579
7928
  closeOnClickAway: true,
6580
7929
  closeOnEscape: true,
@@ -6597,18 +7946,18 @@ const Dropdown = forwardRef((props, ref) => {
6597
7946
  anchorRef,
6598
7947
  children,
6599
7948
  className,
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,
7949
+ closeOnClick = DEFAULT_PROPS$U.closeOnClick,
7950
+ closeOnClickAway = DEFAULT_PROPS$U.closeOnClickAway,
7951
+ closeOnEscape = DEFAULT_PROPS$U.closeOnEscape,
7952
+ fitToAnchorWidth = DEFAULT_PROPS$U.fitToAnchorWidth,
7953
+ fitWithinViewportHeight = DEFAULT_PROPS$U.fitWithinViewportHeight,
6605
7954
  isOpen,
6606
7955
  offset,
6607
- focusAnchorOnClose = DEFAULT_PROPS$S.focusAnchorOnClose,
7956
+ focusAnchorOnClose = DEFAULT_PROPS$U.focusAnchorOnClose,
6608
7957
  onClose,
6609
7958
  onInfiniteScroll,
6610
- placement = DEFAULT_PROPS$S.placement,
6611
- shouldFocusOnOpen = DEFAULT_PROPS$S.shouldFocusOnOpen,
7959
+ placement = DEFAULT_PROPS$U.placement,
7960
+ shouldFocusOnOpen = DEFAULT_PROPS$U.shouldFocusOnOpen,
6612
7961
  zIndex,
6613
7962
  ...forwardedProps
6614
7963
  } = props;
@@ -6654,7 +8003,7 @@ const Dropdown = forwardRef((props, ref) => {
6654
8003
  });
6655
8004
  Dropdown.displayName = COMPONENT_NAME$Y;
6656
8005
  Dropdown.className = CLASSNAME$Y;
6657
- Dropdown.defaultProps = DEFAULT_PROPS$S;
8006
+ Dropdown.defaultProps = DEFAULT_PROPS$U;
6658
8007
 
6659
8008
  /**
6660
8009
  * Component display name.
@@ -6673,7 +8022,7 @@ const {
6673
8022
  /**
6674
8023
  * Component default props.
6675
8024
  */
6676
- const DEFAULT_PROPS$R = {
8025
+ const DEFAULT_PROPS$T = {
6677
8026
  closeMode: 'unmount'
6678
8027
  };
6679
8028
  const isDragHandle = isComponent(DragHandle);
@@ -6691,7 +8040,7 @@ const ExpansionPanel = forwardRef((props, ref) => {
6691
8040
  const defaultTheme = useTheme() || Theme$1.light;
6692
8041
  const {
6693
8042
  className,
6694
- closeMode = DEFAULT_PROPS$R.closeMode,
8043
+ closeMode = DEFAULT_PROPS$T.closeMode,
6695
8044
  children: anyChildren,
6696
8045
  hasBackground,
6697
8046
  hasHeaderDivider,
@@ -6808,11 +8157,11 @@ const ExpansionPanel = forwardRef((props, ref) => {
6808
8157
  });
6809
8158
  ExpansionPanel.displayName = COMPONENT_NAME$X;
6810
8159
  ExpansionPanel.className = CLASSNAME$X;
6811
- ExpansionPanel.defaultProps = DEFAULT_PROPS$R;
8160
+ ExpansionPanel.defaultProps = DEFAULT_PROPS$T;
6812
8161
 
6813
8162
  const COMPONENT_NAME$W = 'Flag';
6814
8163
  const CLASSNAME$W = 'lumx-flag';
6815
- const DEFAULT_PROPS$Q = {};
8164
+ const DEFAULT_PROPS$S = {};
6816
8165
  const {
6817
8166
  block: block$N,
6818
8167
  element: element$B
@@ -6876,7 +8225,7 @@ const Flag = forwardRef((props, ref) => {
6876
8225
  });
6877
8226
  Flag.displayName = COMPONENT_NAME$W;
6878
8227
  Flag.className = CLASSNAME$W;
6879
- Flag.defaultProps = DEFAULT_PROPS$Q;
8228
+ Flag.defaultProps = DEFAULT_PROPS$S;
6880
8229
 
6881
8230
  /**
6882
8231
  * Defines the props of the component.
@@ -6969,7 +8318,7 @@ const {
6969
8318
  /**
6970
8319
  * Component default props.
6971
8320
  */
6972
- const DEFAULT_PROPS$P = {
8321
+ const DEFAULT_PROPS$R = {
6973
8322
  gap: Size$1.big,
6974
8323
  orientation: Orientation$1.horizontal
6975
8324
  };
@@ -6999,8 +8348,8 @@ const BaseGenericBlock = forwardRef((props, ref) => {
6999
8348
  children,
7000
8349
  actions,
7001
8350
  actionsProps,
7002
- gap = DEFAULT_PROPS$P.gap,
7003
- orientation = DEFAULT_PROPS$P.orientation,
8351
+ gap = DEFAULT_PROPS$R.gap,
8352
+ orientation = DEFAULT_PROPS$R.orientation,
7004
8353
  contentProps,
7005
8354
  ...forwardedProps
7006
8355
  } = props;
@@ -7054,7 +8403,7 @@ const BaseGenericBlock = forwardRef((props, ref) => {
7054
8403
  });
7055
8404
  BaseGenericBlock.displayName = COMPONENT_NAME$U;
7056
8405
  BaseGenericBlock.className = CLASSNAME$U;
7057
- BaseGenericBlock.defaultProps = DEFAULT_PROPS$P;
8406
+ BaseGenericBlock.defaultProps = DEFAULT_PROPS$R;
7058
8407
  const GenericBlock = Object.assign(BaseGenericBlock, {
7059
8408
  Figure,
7060
8409
  Content,
@@ -7102,7 +8451,7 @@ const CLASSNAME$T = 'lumx-heading';
7102
8451
  /**
7103
8452
  * Component default props.
7104
8453
  */
7105
- const DEFAULT_PROPS$O = {};
8454
+ const DEFAULT_PROPS$Q = {};
7106
8455
 
7107
8456
  /**
7108
8457
  * Get Heading component common props
@@ -7203,7 +8552,7 @@ const {
7203
8552
  /**
7204
8553
  * Component default props.
7205
8554
  */
7206
- const DEFAULT_PROPS$N = {};
8555
+ const DEFAULT_PROPS$P = {};
7207
8556
 
7208
8557
  /**
7209
8558
  * Text component common props
@@ -7290,7 +8639,7 @@ const Text = forwardRef((props, ref) => {
7290
8639
  });
7291
8640
  Text.displayName = COMPONENT_NAME$S;
7292
8641
  Text.className = CLASSNAME$S;
7293
- Text.defaultProps = DEFAULT_PROPS$N;
8642
+ Text.defaultProps = DEFAULT_PROPS$P;
7294
8643
 
7295
8644
  const HeadingLevelContext = /*#__PURE__*/createContext(defaultContext);
7296
8645
 
@@ -7327,7 +8676,7 @@ const Heading = forwardRef((props, ref) => {
7327
8676
  });
7328
8677
  Heading.displayName = COMPONENT_NAME$T;
7329
8678
  Heading.className = CLASSNAME$T;
7330
- Heading.defaultProps = DEFAULT_PROPS$O;
8679
+ Heading.defaultProps = DEFAULT_PROPS$Q;
7331
8680
 
7332
8681
  /**
7333
8682
  * Computes the next heading level based on the optional prop level or the parent context level.
@@ -7378,7 +8727,7 @@ const {
7378
8727
  /**
7379
8728
  * Component default props.
7380
8729
  */
7381
- const DEFAULT_PROPS$M = {
8730
+ const DEFAULT_PROPS$O = {
7382
8731
  orientation: Orientation$1.horizontal,
7383
8732
  wrap: 'nowrap'
7384
8733
  };
@@ -7396,9 +8745,9 @@ const Grid = forwardRef((props, ref) => {
7396
8745
  className,
7397
8746
  gutter,
7398
8747
  hAlign,
7399
- orientation = DEFAULT_PROPS$M.orientation,
8748
+ orientation = DEFAULT_PROPS$O.orientation,
7400
8749
  vAlign,
7401
- wrap = DEFAULT_PROPS$M.wrap,
8750
+ wrap = DEFAULT_PROPS$O.wrap,
7402
8751
  ...forwardedProps
7403
8752
  } = props;
7404
8753
  return /*#__PURE__*/jsx("div", {
@@ -7416,7 +8765,7 @@ const Grid = forwardRef((props, ref) => {
7416
8765
  });
7417
8766
  Grid.displayName = COMPONENT_NAME$R;
7418
8767
  Grid.className = CLASSNAME$R;
7419
- Grid.defaultProps = DEFAULT_PROPS$M;
8768
+ Grid.defaultProps = DEFAULT_PROPS$O;
7420
8769
 
7421
8770
  /**
7422
8771
  * Component display name.
@@ -7474,7 +8823,7 @@ const CLASSNAME$P = 'lumx-grid-column';
7474
8823
  /**
7475
8824
  * Component default props.
7476
8825
  */
7477
- const DEFAULT_PROPS$L = {};
8826
+ const DEFAULT_PROPS$N = {};
7478
8827
 
7479
8828
  /**
7480
8829
  * The GridColumn is a layout component that can display children in a grid
@@ -7482,10 +8831,9 @@ const DEFAULT_PROPS$L = {};
7482
8831
  * with a number of column that reduce when there is not enough space for each item.
7483
8832
  *
7484
8833
  * @param props Component props.
7485
- * @param ref Component ref.
7486
- * @return React element.
8834
+ * @return JSX element.
7487
8835
  */
7488
- const GridColumn = forwardRef((props, ref) => {
8836
+ const GridColumn$1 = props => {
7489
8837
  const {
7490
8838
  as: Component = 'div',
7491
8839
  gap,
@@ -7494,12 +8842,13 @@ const GridColumn = forwardRef((props, ref) => {
7494
8842
  children,
7495
8843
  className,
7496
8844
  style = {},
8845
+ ref,
7497
8846
  ...forwardedProps
7498
8847
  } = props;
7499
8848
  return /*#__PURE__*/jsx(Component, {
7500
8849
  ...forwardedProps,
7501
8850
  ref: ref,
7502
- className: classNames.join(className, CLASSNAME$P),
8851
+ className: classnames(className, CLASSNAME$P),
7503
8852
  style: {
7504
8853
  ...style,
7505
8854
  ['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
@@ -7508,10 +8857,40 @@ const GridColumn = forwardRef((props, ref) => {
7508
8857
  },
7509
8858
  children: children
7510
8859
  });
8860
+ };
8861
+ GridColumn$1.displayName = COMPONENT_NAME$P;
8862
+ GridColumn$1.className = CLASSNAME$P;
8863
+ GridColumn$1.defaultProps = DEFAULT_PROPS$N;
8864
+
8865
+ /**
8866
+ * Defines the props of the component.
8867
+ */
8868
+
8869
+ // Re-export types for backward compatibility
8870
+
8871
+ /**
8872
+ * Component default props.
8873
+ */
8874
+ const DEFAULT_PROPS$M = {};
8875
+
8876
+ /**
8877
+ * The GridColumn is a layout component that can display children in a grid
8878
+ * with custom display properties. It also comes with a responsive design,
8879
+ * with a number of column that reduce when there is not enough space for each item.
8880
+ *
8881
+ * @param props Component props.
8882
+ * @param ref Component ref.
8883
+ * @return React element.
8884
+ */
8885
+ const GridColumn = forwardRef((props, ref) => {
8886
+ return GridColumn$1({
8887
+ ref,
8888
+ ...props
8889
+ });
7511
8890
  });
7512
8891
  GridColumn.displayName = COMPONENT_NAME$P;
7513
8892
  GridColumn.className = CLASSNAME$P;
7514
- GridColumn.defaultProps = DEFAULT_PROPS$L;
8893
+ GridColumn.defaultProps = DEFAULT_PROPS$M;
7515
8894
 
7516
8895
  /**
7517
8896
  * Icon component.
@@ -7629,7 +9008,7 @@ const {
7629
9008
  /**
7630
9009
  * Component default props.
7631
9010
  */
7632
- const DEFAULT_PROPS$K = {
9011
+ const DEFAULT_PROPS$L = {
7633
9012
  captionPosition: ImageBlockCaptionPosition.below,
7634
9013
  align: Alignment.left
7635
9014
  };
@@ -7645,9 +9024,9 @@ const ImageBlock = forwardRef((props, ref) => {
7645
9024
  const defaultTheme = useTheme() || Theme$1.light;
7646
9025
  const {
7647
9026
  actions,
7648
- align = DEFAULT_PROPS$K.align,
9027
+ align = DEFAULT_PROPS$L.align,
7649
9028
  alt,
7650
- captionPosition = DEFAULT_PROPS$K.captionPosition,
9029
+ captionPosition = DEFAULT_PROPS$L.captionPosition,
7651
9030
  captionStyle,
7652
9031
  className,
7653
9032
  description,
@@ -7701,7 +9080,7 @@ const ImageBlock = forwardRef((props, ref) => {
7701
9080
  });
7702
9081
  ImageBlock.displayName = COMPONENT_NAME$O;
7703
9082
  ImageBlock.className = CLASSNAME$O;
7704
- ImageBlock.defaultProps = DEFAULT_PROPS$K;
9083
+ ImageBlock.defaultProps = DEFAULT_PROPS$L;
7705
9084
 
7706
9085
  /**
7707
9086
  * Component display name.
@@ -8461,7 +9840,7 @@ const {
8461
9840
  /**
8462
9841
  * Component default props.
8463
9842
  */
8464
- const DEFAULT_PROPS$J = {};
9843
+ const DEFAULT_PROPS$K = {};
8465
9844
 
8466
9845
  /**
8467
9846
  * InlineList component.
@@ -8514,7 +9893,7 @@ const InlineList = forwardRef((props, ref) => {
8514
9893
  });
8515
9894
  InlineList.displayName = COMPONENT_NAME$M;
8516
9895
  InlineList.className = CLASSNAME$M;
8517
- InlineList.defaultProps = DEFAULT_PROPS$J;
9896
+ InlineList.defaultProps = DEFAULT_PROPS$K;
8518
9897
 
8519
9898
  /**
8520
9899
  * InputHelper component.
@@ -8685,26 +10064,12 @@ const Lightbox = forwardRef((props, ref) => {
8685
10064
  })
8686
10065
  })
8687
10066
  })
8688
- })]
8689
- })
8690
- });
8691
- });
8692
- Lightbox.displayName = COMPONENT_NAME$L;
8693
- Lightbox.className = CLASSNAME$L;
8694
-
8695
- /** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
8696
- const forwardRefPolymorphic = React__default.forwardRef;
8697
-
8698
- /**
8699
- * Render clickable element (link, button or custom element)
8700
- * (also does some basic disabled state handling)
8701
- */
8702
- const RawClickable = forwardRefPolymorphic((props, ref) => {
8703
- return RawClickable$1({
8704
- ref,
8705
- ...props
10067
+ })]
10068
+ })
8706
10069
  });
8707
10070
  });
10071
+ Lightbox.displayName = COMPONENT_NAME$L;
10072
+ Lightbox.className = CLASSNAME$L;
8708
10073
 
8709
10074
  /**
8710
10075
  * Component display name.
@@ -8718,7 +10083,101 @@ const CLASSNAME$K = 'lumx-link';
8718
10083
  const {
8719
10084
  block: block$E,
8720
10085
  element: element$u
8721
- } = classNames.bem(CLASSNAME$K);
10086
+ } = bem(CLASSNAME$K);
10087
+
10088
+ /**
10089
+ * Link component (Core UI).
10090
+ *
10091
+ * @param props Component props.
10092
+ * @return JSX element.
10093
+ */
10094
+ const Link$1 = props => {
10095
+ const {
10096
+ label,
10097
+ className,
10098
+ color: propColor,
10099
+ colorVariant: propColorVariant,
10100
+ leftIcon,
10101
+ rightIcon,
10102
+ typography: typography$1,
10103
+ as,
10104
+ ref,
10105
+ isDisabled,
10106
+ theme,
10107
+ href,
10108
+ target,
10109
+ onClick,
10110
+ ...forwardedProps
10111
+ } = props;
10112
+ const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
10113
+
10114
+ // Determine element type
10115
+ const ElementType = as || (href ? 'a' : 'button');
10116
+
10117
+ // Build disabled props
10118
+ const disabledProps = {};
10119
+ if (isDisabled) {
10120
+ if (ElementType === 'button' || !href && !as) {
10121
+ disabledProps.disabled = true;
10122
+ } else {
10123
+ disabledProps['aria-disabled'] = true;
10124
+ disabledProps.tabIndex = -1;
10125
+ }
10126
+ }
10127
+
10128
+ // Build class name
10129
+ const combinedClassName = classnames(className, block$E({
10130
+ [`color-${color}`]: Boolean(color),
10131
+ [`color-variant-${colorVariant}`]: Boolean(colorVariant),
10132
+ 'has-typography': !!typography$1
10133
+ }), typography$1 && typography(typography$1));
10134
+
10135
+ // Build content with proper spacing for icons
10136
+ const content = /*#__PURE__*/jsxs(Fragment, {
10137
+ children: [leftIcon && /*#__PURE__*/jsxs(Fragment, {
10138
+ children: [" ", Icon$1({
10139
+ icon: leftIcon,
10140
+ className: element$u('left-icon')
10141
+ }), " "]
10142
+ }), label && /*#__PURE__*/jsx("span", {
10143
+ className: element$u('content'),
10144
+ children: label
10145
+ }), rightIcon && /*#__PURE__*/jsxs(Fragment, {
10146
+ children: [" ", Icon$1({
10147
+ icon: rightIcon,
10148
+ className: element$u('right-icon')
10149
+ }), " "]
10150
+ })]
10151
+ });
10152
+
10153
+ // Build element props
10154
+ const elementProps = {
10155
+ ref,
10156
+ className: combinedClassName,
10157
+ onClick: isDisabled ? undefined : onClick,
10158
+ ...forwardedProps,
10159
+ ...disabledProps
10160
+ };
10161
+ if (href) {
10162
+ elementProps.href = href;
10163
+ }
10164
+ if (target) {
10165
+ elementProps.target = target;
10166
+ }
10167
+ return /*#__PURE__*/jsx(ElementType, {
10168
+ ...elementProps,
10169
+ children: content
10170
+ });
10171
+ };
10172
+
10173
+ /**
10174
+ * Defines the props of the component.
10175
+ */
10176
+
10177
+ /**
10178
+ * Component default props.
10179
+ */
10180
+ const DEFAULT_PROPS$J = {};
8722
10181
 
8723
10182
  /**
8724
10183
  * Link component.
@@ -8729,47 +10188,42 @@ const {
8729
10188
  */
8730
10189
  const Link = forwardRef((props, ref) => {
8731
10190
  const {
10191
+ isAnyDisabled,
8732
10192
  disabledStateProps,
8733
10193
  otherProps
8734
10194
  } = useDisableStateProps(props);
8735
10195
  const {
8736
10196
  children,
8737
10197
  className,
8738
- color: propColor,
8739
- colorVariant: propColorVariant,
10198
+ color,
10199
+ colorVariant,
8740
10200
  leftIcon,
8741
10201
  rightIcon,
8742
10202
  typography,
8743
10203
  linkAs,
8744
10204
  ...forwardedProps
8745
10205
  } = otherProps;
8746
- const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
8747
- return /*#__PURE__*/jsx(RawClickable, {
8748
- ref: ref,
8749
- as: linkAs || (forwardedProps.href ? 'a' : 'button'),
10206
+
10207
+ // Wrap children with spaces if they contain icons
10208
+ const label = wrapChildrenIconWithSpaces(children);
10209
+ return Link$1({
10210
+ ref,
10211
+ label,
10212
+ className,
10213
+ color,
10214
+ colorVariant,
10215
+ leftIcon,
10216
+ rightIcon,
10217
+ typography,
10218
+ as: linkAs,
8750
10219
  ...forwardedProps,
8751
10220
  ...disabledStateProps,
8752
- className: classNames.join(className, block$E({
8753
- [`color-${color}`]: Boolean(color),
8754
- [`color-variant-${colorVariant}`]: Boolean(colorVariant),
8755
- 'has-typography': !!typography
8756
- }), typography && classNames.typography(typography)),
8757
- children: wrapChildrenIconWithSpaces(/*#__PURE__*/jsxs(Fragment, {
8758
- children: [leftIcon && /*#__PURE__*/jsx(Icon, {
8759
- icon: leftIcon,
8760
- className: element$u('left-icon')
8761
- }), children && /*#__PURE__*/jsx("span", {
8762
- className: element$u('content'),
8763
- children: children
8764
- }), rightIcon && /*#__PURE__*/jsx(Icon, {
8765
- icon: rightIcon,
8766
- className: element$u('right-icon')
8767
- })]
8768
- }))
10221
+ isDisabled: isAnyDisabled
8769
10222
  });
8770
10223
  });
8771
10224
  Link.displayName = COMPONENT_NAME$K;
8772
10225
  Link.className = CLASSNAME$K;
10226
+ Link.defaultProps = DEFAULT_PROPS$J;
8773
10227
 
8774
10228
  /**
8775
10229
  * Component display name.
@@ -8839,7 +10293,7 @@ const LinkPreview = forwardRef((props, ref) => {
8839
10293
  // Avoid redundant links in focus order
8840
10294
  tabIndex: -1
8841
10295
  },
8842
- aspectRatio: AspectRatio.free,
10296
+ aspectRatio: AspectRatio$1.free,
8843
10297
  fillHeight: true
8844
10298
  })
8845
10299
  }), /*#__PURE__*/jsxs("div", {
@@ -9248,7 +10702,7 @@ const Mosaic = forwardRef((props, ref) => {
9248
10702
  align: align || Alignment.left,
9249
10703
  image: image,
9250
10704
  theme: theme,
9251
- aspectRatio: AspectRatio.free,
10705
+ aspectRatio: AspectRatio$1.free,
9252
10706
  fillHeight: true,
9253
10707
  onClick: handleImageClick?.(index, onClick) || onClick
9254
10708
  }), thumbnails.length > 4 && index === 3 && /*#__PURE__*/jsx("div", {
@@ -9266,6 +10720,20 @@ Mosaic.displayName = COMPONENT_NAME$E;
9266
10720
  Mosaic.className = CLASSNAME$E;
9267
10721
  Mosaic.defaultProps = DEFAULT_PROPS$G;
9268
10722
 
10723
+ /** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
10724
+ const forwardRefPolymorphic = React__default.forwardRef;
10725
+
10726
+ /**
10727
+ * Render clickable element (link, button or custom element)
10728
+ * (also does some basic disabled state handling)
10729
+ */
10730
+ const RawClickable = forwardRefPolymorphic((props, ref) => {
10731
+ return RawClickable$1({
10732
+ ref,
10733
+ ...props
10734
+ });
10735
+ });
10736
+
9269
10737
  const NavigationContext = /*#__PURE__*/createContext({
9270
10738
  orientation: Orientation$1.vertical
9271
10739
  });
@@ -11013,6 +12481,8 @@ const SelectMultipleField = props => {
11013
12481
  const defaultTheme = useTheme();
11014
12482
  const {
11015
12483
  anchorRef,
12484
+ // We don't have a clear button in select multiple but it must be removed from the forwardedProps
12485
+ clearButtonProps,
11016
12486
  handleKeyboardNav,
11017
12487
  hasError,
11018
12488
  icon,
@@ -13009,7 +14479,7 @@ const CLASSNAME$c = 'lumx-table';
13009
14479
 
13010
14480
  const {
13011
14481
  block: block$d
13012
- } = classNames.bem(CLASSNAME$c);
14482
+ } = bem(CLASSNAME$c);
13013
14483
 
13014
14484
  /**
13015
14485
  * Defines the props of the component.
@@ -13024,29 +14494,54 @@ const DEFAULT_PROPS$f = {};
13024
14494
  * Table component.
13025
14495
  *
13026
14496
  * @param props Component props.
13027
- * @param ref Component ref.
13028
14497
  * @return React element.
13029
14498
  */
13030
- const Table = forwardRef((props, ref) => {
13031
- const defaultTheme = useTheme() || Theme$1.light;
14499
+ const Table$1 = props => {
13032
14500
  const {
13033
14501
  children,
13034
14502
  className,
13035
14503
  hasBefore,
13036
14504
  hasDividers,
13037
- theme = defaultTheme,
14505
+ ref,
14506
+ theme,
13038
14507
  ...forwardedProps
13039
14508
  } = props;
13040
14509
  return /*#__PURE__*/jsx("table", {
13041
14510
  ref: ref,
13042
14511
  ...forwardedProps,
13043
- className: classNames.join(className, block$d({
14512
+ className: classnames(className, block$d({
13044
14513
  'has-before': hasBefore,
13045
14514
  'has-dividers': hasDividers,
13046
14515
  [`theme-${theme}`]: Boolean(theme)
13047
14516
  })),
13048
14517
  children: children
13049
14518
  });
14519
+ };
14520
+
14521
+ /**
14522
+ * Defines the props of the component.
14523
+ */
14524
+
14525
+ /**
14526
+ * Table component.
14527
+ *
14528
+ * @param props Component props.
14529
+ * @param ref Component ref.
14530
+ * @return React element.
14531
+ */
14532
+ const Table = forwardRef((props, ref) => {
14533
+ const defaultTheme = useTheme() || Theme$1.light;
14534
+ const {
14535
+ children,
14536
+ theme = defaultTheme,
14537
+ ...otherProps
14538
+ } = props;
14539
+ return Table$1({
14540
+ ref,
14541
+ theme,
14542
+ children,
14543
+ ...otherProps
14544
+ });
13050
14545
  });
13051
14546
  Table.displayName = COMPONENT_NAME$d;
13052
14547
  Table.className = CLASSNAME$c;
@@ -13066,21 +14561,44 @@ const CLASSNAME$b = `${CLASSNAME$c}__body`;
13066
14561
  * TableBody component.
13067
14562
  *
13068
14563
  * @param props Component props.
13069
- * @param ref Component ref.
13070
14564
  * @return React element.
13071
14565
  */
13072
- const TableBody = forwardRef((props, ref) => {
14566
+ const TableBody$1 = props => {
13073
14567
  const {
13074
14568
  children,
13075
14569
  className,
14570
+ ref,
13076
14571
  ...forwardedProps
13077
14572
  } = props;
13078
14573
  return /*#__PURE__*/jsx("tbody", {
13079
14574
  ref: ref,
13080
14575
  ...forwardedProps,
13081
- className: classNames.join(className, CLASSNAME$b),
14576
+ className: classnames(className, CLASSNAME$b),
13082
14577
  children: children
13083
14578
  });
14579
+ };
14580
+
14581
+ /**
14582
+ * Defines the props of the component.
14583
+ */
14584
+
14585
+ /**
14586
+ * TableBody component.
14587
+ *
14588
+ * @param props Component props.
14589
+ * @param ref Component ref.
14590
+ * @return React element.
14591
+ */
14592
+ const TableBody = forwardRef((props, ref) => {
14593
+ const {
14594
+ children,
14595
+ ...otherProps
14596
+ } = props;
14597
+ return TableBody$1({
14598
+ ref,
14599
+ children,
14600
+ ...otherProps
14601
+ });
13084
14602
  });
13085
14603
  TableBody.displayName = COMPONENT_NAME$c;
13086
14604
  TableBody.className = CLASSNAME$b;
@@ -13112,7 +14630,7 @@ const COMPONENT_NAME$b = 'TableCell';
13112
14630
  const CLASSNAME$a = `${CLASSNAME$c}__cell`;
13113
14631
  const {
13114
14632
  block: block$c
13115
- } = classNames.bem(CLASSNAME$a);
14633
+ } = bem(CLASSNAME$a);
13116
14634
 
13117
14635
  /**
13118
14636
  * Component default props.
@@ -13125,16 +14643,16 @@ const DEFAULT_PROPS$e = {
13125
14643
  * TableCell component.
13126
14644
  *
13127
14645
  * @param props Component props.
13128
- * @param ref Component ref.
13129
14646
  * @return React element.
13130
14647
  */
13131
- const TableCell = forwardRef((props, ref) => {
14648
+ const TableCell$1 = props => {
13132
14649
  const {
13133
14650
  children,
13134
14651
  className,
13135
14652
  icon,
13136
14653
  isSortable,
13137
14654
  onHeaderClick,
14655
+ ref,
13138
14656
  sortOrder,
13139
14657
  variant = DEFAULT_PROPS$e.variant,
13140
14658
  ...forwardedProps
@@ -13158,7 +14676,7 @@ const TableCell = forwardRef((props, ref) => {
13158
14676
  children: [variant === TableCellVariant.head && /*#__PURE__*/jsx("th", {
13159
14677
  ref: ref,
13160
14678
  ...forwardedProps,
13161
- className: classNames.join(className, block$c({
14679
+ className: classnames(className, block$c({
13162
14680
  'is-sortable': isSortable,
13163
14681
  'is-sorted': isSortable && !!sortOrder,
13164
14682
  head: true
@@ -13167,26 +14685,27 @@ const TableCell = forwardRef((props, ref) => {
13167
14685
  children: /*#__PURE__*/jsxs(Wrapper, {
13168
14686
  className: `${CLASSNAME$a}-wrapper`,
13169
14687
  ...wrapperProps,
13170
- children: [icon && !isSortable && /*#__PURE__*/jsx(Icon, {
14688
+ children: [icon && !isSortable && Icon$1({
13171
14689
  className: `${CLASSNAME$a}-icon`,
13172
- icon: icon,
13173
- size: Size$1.xxs
13174
- }), isSortable && sortOrder === ThOrder.asc && /*#__PURE__*/jsx(Icon, {
14690
+ icon,
14691
+ size: Size.xxs
14692
+ }), isSortable && sortOrder === ThOrder.asc && Icon$1({
13175
14693
  className: `${CLASSNAME$a}-icon`,
13176
14694
  icon: mdiArrowUp,
13177
- size: Size$1.xxs
13178
- }), isSortable && sortOrder === ThOrder.desc && /*#__PURE__*/jsx(Icon, {
14695
+ size: Size.xxs
14696
+ }), isSortable && sortOrder === ThOrder.desc && Icon$1({
13179
14697
  className: `${CLASSNAME$a}-icon`,
13180
14698
  icon: mdiArrowDown,
13181
- size: Size$1.xxs
14699
+ size: Size.xxs
13182
14700
  }), /*#__PURE__*/jsx("div", {
13183
14701
  className: `${CLASSNAME$a}-content`,
13184
14702
  children: children
13185
14703
  })]
13186
14704
  })
13187
14705
  }), variant === TableCellVariant.body && /*#__PURE__*/jsx("td", {
14706
+ ref: ref,
13188
14707
  ...forwardedProps,
13189
- className: classNames.join(className, block$c({
14708
+ className: classnames(className, block$c({
13190
14709
  body: true
13191
14710
  })),
13192
14711
  children: /*#__PURE__*/jsx("div", {
@@ -13195,6 +14714,29 @@ const TableCell = forwardRef((props, ref) => {
13195
14714
  })
13196
14715
  })]
13197
14716
  });
14717
+ };
14718
+
14719
+ /**
14720
+ * Defines the props of the component.
14721
+ */
14722
+
14723
+ /**
14724
+ * TableCell component.
14725
+ *
14726
+ * @param props Component props.
14727
+ * @param ref Component ref.
14728
+ * @return React element.
14729
+ */
14730
+ const TableCell = forwardRef((props, ref) => {
14731
+ const {
14732
+ children,
14733
+ ...otherProps
14734
+ } = props;
14735
+ return TableCell$1({
14736
+ ref,
14737
+ children,
14738
+ ...otherProps
14739
+ });
13198
14740
  });
13199
14741
  TableCell.displayName = COMPONENT_NAME$b;
13200
14742
  TableCell.className = CLASSNAME$a;
@@ -13219,21 +14761,44 @@ const DEFAULT_PROPS$d = {};
13219
14761
  * TableHeader component.
13220
14762
  *
13221
14763
  * @param props Component props.
13222
- * @param ref Component ref.
13223
14764
  * @return React element.
13224
14765
  */
13225
- const TableHeader = forwardRef((props, ref) => {
14766
+ const TableHeader$1 = props => {
13226
14767
  const {
13227
14768
  children,
13228
14769
  className,
14770
+ ref,
13229
14771
  ...forwardedProps
13230
14772
  } = props;
13231
14773
  return /*#__PURE__*/jsx("thead", {
13232
14774
  ref: ref,
13233
14775
  ...forwardedProps,
13234
- className: classNames.join(className, CLASSNAME$9),
14776
+ className: classnames(className, CLASSNAME$9),
13235
14777
  children: children
13236
14778
  });
14779
+ };
14780
+
14781
+ /**
14782
+ * Defines the props of the component.
14783
+ */
14784
+
14785
+ /**
14786
+ * TableHeader component.
14787
+ *
14788
+ * @param props Component props.
14789
+ * @param ref Component ref.
14790
+ * @return React element.
14791
+ */
14792
+ const TableHeader = forwardRef((props, ref) => {
14793
+ const {
14794
+ children,
14795
+ ...otherProps
14796
+ } = props;
14797
+ return TableHeader$1({
14798
+ ref,
14799
+ children,
14800
+ ...otherProps
14801
+ });
13237
14802
  });
13238
14803
  TableHeader.displayName = COMPONENT_NAME$a;
13239
14804
  TableHeader.className = CLASSNAME$9;
@@ -13250,7 +14815,7 @@ const COMPONENT_NAME$9 = 'TableRow';
13250
14815
  const CLASSNAME$8 = `${CLASSNAME$c}__row`;
13251
14816
  const {
13252
14817
  block: block$b
13253
- } = classNames.bem(CLASSNAME$8);
14818
+ } = bem(CLASSNAME$8);
13254
14819
 
13255
14820
  /**
13256
14821
  * Component default props.
@@ -13261,34 +14826,69 @@ const DEFAULT_PROPS$c = {};
13261
14826
  * TableRow component.
13262
14827
  *
13263
14828
  * @param props Component props.
13264
- * @param ref Component ref.
13265
14829
  * @return React element.
13266
14830
  */
13267
- const TableRow = forwardRef((props, ref) => {
13268
- const {
13269
- isAnyDisabled,
13270
- disabledStateProps,
13271
- otherProps
13272
- } = useDisableStateProps(props);
14831
+ const TableRow$1 = props => {
13273
14832
  const {
13274
14833
  children,
13275
14834
  className,
13276
14835
  isClickable,
13277
14836
  isSelected,
14837
+ ref,
14838
+ tabIndex,
14839
+ 'aria-disabled': ariaDisabled,
13278
14840
  ...forwardedProps
13279
- } = otherProps;
14841
+ } = props;
14842
+ const isDisabled = Boolean(ariaDisabled);
14843
+
14844
+ // Use object spread for tabIndex to ensure cross-framework compatibility (Vue JSX expects lowercase 'tabindex')
14845
+ const tabIndexProps = tabIndex !== undefined ? {
14846
+ tabIndex
14847
+ } : {};
13280
14848
  return /*#__PURE__*/jsx("tr", {
13281
14849
  ref: ref,
13282
- tabIndex: isClickable && !disabledStateProps.disabled ? 0 : -1,
14850
+ "aria-disabled": ariaDisabled,
14851
+ ...tabIndexProps,
13283
14852
  ...forwardedProps,
13284
- className: classNames.join(className, block$b({
13285
- 'is-clickable': isClickable && !isAnyDisabled,
13286
- 'is-disabled': isAnyDisabled,
13287
- 'is-selected': isSelected && !isAnyDisabled
14853
+ className: classnames(className, block$b({
14854
+ 'is-clickable': isClickable && !isDisabled,
14855
+ 'is-disabled': isDisabled,
14856
+ 'is-selected': isSelected && !isDisabled
13288
14857
  })),
13289
- "aria-disabled": isAnyDisabled,
13290
14858
  children: children
13291
14859
  });
14860
+ };
14861
+
14862
+ /**
14863
+ * Defines the props of the component.
14864
+ */
14865
+
14866
+ /**
14867
+ * TableRow component.
14868
+ *
14869
+ * @param props Component props.
14870
+ * @param ref Component ref.
14871
+ * @return React element.
14872
+ */
14873
+ const TableRow = forwardRef((props, ref) => {
14874
+ const {
14875
+ isAnyDisabled,
14876
+ otherProps
14877
+ } = useDisableStateProps(props);
14878
+ const {
14879
+ children,
14880
+ isClickable,
14881
+ 'aria-disabled': _ariaDisabled,
14882
+ ...forwardedProps
14883
+ } = otherProps;
14884
+ return TableRow$1({
14885
+ ref,
14886
+ children,
14887
+ isClickable,
14888
+ tabIndex: isClickable && !isAnyDisabled ? 0 : -1,
14889
+ 'aria-disabled': isAnyDisabled,
14890
+ ...forwardedProps
14891
+ });
13292
14892
  });
13293
14893
  TableRow.displayName = COMPONENT_NAME$9;
13294
14894
  TableRow.className = CLASSNAME$8;
@@ -13953,7 +15553,14 @@ TextField.displayName = COMPONENT_NAME$5;
13953
15553
  TextField.className = CLASSNAME$5;
13954
15554
  TextField.defaultProps = DEFAULT_PROPS$5;
13955
15555
 
13956
- function getState(img, event) {
15556
+ /**
15557
+ * Determines the loading state of an HTML image element.
15558
+ *
15559
+ * @param img - The HTML image element to check
15560
+ * @param event - Optional event (load or error) that triggered the state check
15561
+ * @returns The current loading state: 'hasError', 'isLoading', or 'isLoaded'
15562
+ */
15563
+ function getImageLoadingState(img, event) {
13957
15564
  // Error event occurred or image has no source.
13958
15565
  if (event?.type === 'error' || img?.complete && !img.getAttribute('src')) {
13959
15566
  return 'hasError';
@@ -13965,30 +15572,58 @@ function getState(img, event) {
13965
15572
  // Else loaded.
13966
15573
  return 'isLoaded';
13967
15574
  }
13968
- function useImageLoad(imageURL, imgRef) {
13969
- const [state, setState] = useState(getState(imgRef));
13970
15575
 
13971
- // Update state when changing image URL or DOM reference.
13972
- useEffect(() => {
13973
- setState(getState(imgRef));
13974
- }, [imageURL, imgRef]);
15576
+ /**
15577
+ * Parameters for getting image size.
15578
+ */
13975
15579
 
13976
- // Listen to `load` and `error` event on image
13977
- useEffect(() => {
13978
- const img = imgRef;
13979
- if (!img) return undefined;
13980
- const update = event => setState(getState(img, event));
13981
- img.addEventListener('load', update);
13982
- img.addEventListener('error', update);
13983
- return () => {
13984
- img.removeEventListener('load', update);
13985
- img.removeEventListener('error', update);
15580
+ /**
15581
+ * Gets the natural image size from props or element.
15582
+ * Returns undefined if focus point is not applicable or size cannot be determined.
15583
+ *
15584
+ * @param params - Image size parameters
15585
+ * @returns Image size or undefined
15586
+ */
15587
+ function getImageSize({
15588
+ image,
15589
+ aspectRatio,
15590
+ focusPoint,
15591
+ width,
15592
+ height,
15593
+ element,
15594
+ isLoaded
15595
+ }) {
15596
+ // Focus point is not applicable => exit early
15597
+ if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
15598
+ return undefined;
15599
+ }
15600
+ // Size provided via props
15601
+ if (typeof width === 'number' && typeof height === 'number') {
15602
+ return {
15603
+ width,
15604
+ height
13986
15605
  };
13987
- }, [imgRef, imgRef?.src]);
13988
- return state;
15606
+ }
15607
+ // Size from loaded element
15608
+ if (element && isLoaded) {
15609
+ return {
15610
+ width: element.naturalWidth,
15611
+ height: element.naturalHeight
15612
+ };
15613
+ }
15614
+ return undefined;
13989
15615
  }
13990
15616
 
13991
- // Calculate shift to center the focus point in the container.
15617
+ /**
15618
+ * Calculate shift position to center the focus point in the container.
15619
+ *
15620
+ * This function computes the percentage offset needed to position an image
15621
+ * such that a specific focus point on the image aligns with the center of
15622
+ * the container, taking into account the image's scale.
15623
+ *
15624
+ * @param params - Focus point shift calculation parameters
15625
+ * @returns Percentage shift (0-100) for CSS positioning
15626
+ */
13992
15627
  function shiftPosition({
13993
15628
  scale,
13994
15629
  focusPoint,
@@ -14003,92 +15638,64 @@ function shiftPosition({
14003
15638
  return Math.floor(Math.max(Math.min(shift, 1), 0) * 100);
14004
15639
  }
14005
15640
 
14006
- // Compute CSS properties to apply the focus point.
14007
- const useFocusPointStyle = ({
15641
+ /**
15642
+ * Parameters for calculating focus point style.
15643
+ */
15644
+
15645
+ /**
15646
+ * Calculates CSS style for applying focus point positioning.
15647
+ *
15648
+ * @param params - Focus point style parameters
15649
+ * @returns CSS properties to apply to the image
15650
+ */
15651
+ function calculateFocusPointStyle({
14008
15652
  image,
14009
15653
  aspectRatio,
14010
15654
  focusPoint,
14011
- imgProps: {
14012
- width,
14013
- height
14014
- } = {}
14015
- }, element, isLoaded) => {
14016
- // Get natural image size from imgProps or img element.
14017
- const imageSize = useMemo(() => {
14018
- // Focus point is not applicable => exit early
14019
- if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) return undefined;
14020
- if (typeof width === 'number' && typeof height === 'number') return {
14021
- width,
14022
- height
14023
- };
14024
- if (element && isLoaded) return {
14025
- width: element.naturalWidth,
14026
- height: element.naturalHeight
15655
+ element,
15656
+ imageSize,
15657
+ containerSize
15658
+ }) {
15659
+ // Focus point is not applicable => exit early
15660
+ if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
15661
+ return {};
15662
+ }
15663
+ if (!element || !imageSize) {
15664
+ // Focus point can be computed but not right now (image size unknown).
15665
+ return {
15666
+ visibility: 'hidden'
14027
15667
  };
14028
- return undefined;
14029
- }, [aspectRatio, element, focusPoint?.x, focusPoint?.y, height, image, isLoaded, width]);
14030
-
14031
- // Get container size (dependant on imageSize).
14032
- const [containerSize, setContainerSize] = useState(undefined);
14033
- useEffect(function updateContainerSize() {
14034
- const cWidth = element?.offsetWidth;
14035
- const cHeight = element?.offsetHeight;
14036
- if (cWidth && cHeight) {
14037
- // Update only if needed.
14038
- setContainerSize(oldContainerSize => oldContainerSize?.width === cWidth && oldContainerSize.height === cHeight ? oldContainerSize : {
14039
- width: cWidth,
14040
- height: cHeight
14041
- });
14042
- } else if (imageSize) {
14043
- // Wait for a render (in case the container size is dependent on the image size).
14044
- requestAnimationFrame(updateContainerSize);
14045
- }
14046
- }, [element?.offsetHeight, element?.offsetWidth, imageSize]);
15668
+ }
15669
+ if (!containerSize || !imageSize.height || !imageSize.width) {
15670
+ // Missing container or image size, abort focus point compute.
15671
+ return {};
15672
+ }
15673
+ const heightScale = imageSize.height / containerSize.height;
15674
+ const widthScale = imageSize.width / containerSize.width;
15675
+ const scale = Math.min(widthScale, heightScale);
14047
15676
 
14048
- // Compute style.
14049
- const style = useMemo(() => {
14050
- // Focus point is not applicable => exit early
14051
- if (!image || aspectRatio === AspectRatio.original || !focusPoint?.x && !focusPoint?.y) {
14052
- return {};
14053
- }
14054
- if (!element || !imageSize) {
14055
- // Focus point can be computed but now right now (image size unknown).
14056
- return {
14057
- visibility: 'hidden'
14058
- };
14059
- }
14060
- if (!containerSize || !imageSize.height || !imageSize.width) {
14061
- // Missing container or image size abort focus point compute.
14062
- return {};
14063
- }
14064
- const heightScale = imageSize.height / containerSize.height;
14065
- const widthScale = imageSize.width / containerSize.width;
14066
- const scale = Math.min(widthScale, heightScale);
14067
-
14068
- // Focus Y relative to the top (instead of the center)
14069
- const focusPointFromTop = Math.abs((focusPoint?.y || 0) - 1) / 2;
14070
- const y = shiftPosition({
14071
- scale,
14072
- focusPoint: focusPointFromTop,
14073
- imageSize: imageSize.height,
14074
- containerSize: containerSize.height
14075
- });
15677
+ // Focus Y relative to the top (instead of the center)
15678
+ const focusPointFromTop = Math.abs((focusPoint?.y || 0) - 1) / 2;
15679
+ const y = shiftPosition({
15680
+ scale,
15681
+ focusPoint: focusPointFromTop,
15682
+ imageSize: imageSize.height,
15683
+ containerSize: containerSize.height
15684
+ });
14076
15685
 
14077
- // Focus X relative to the left (instead of the center)
14078
- const focusPointFromLeft = Math.abs((focusPoint?.x || 0) + 1) / 2;
14079
- const x = shiftPosition({
14080
- scale,
14081
- focusPoint: focusPointFromLeft,
14082
- imageSize: imageSize.width,
14083
- containerSize: containerSize.width
14084
- });
14085
- const objectPosition = `${x}% ${y}%`;
14086
- return {
14087
- objectPosition
14088
- };
14089
- }, [aspectRatio, containerSize, element, focusPoint?.x, focusPoint?.y, image, imageSize]);
14090
- return style;
14091
- };
15686
+ // Focus X relative to the left (instead of the center)
15687
+ const focusPointFromLeft = Math.abs((focusPoint?.x || 0) + 1) / 2;
15688
+ const x = shiftPosition({
15689
+ scale,
15690
+ focusPoint: focusPointFromLeft,
15691
+ imageSize: imageSize.width,
15692
+ containerSize: containerSize.width
15693
+ });
15694
+ const objectPosition = `${x}% ${y}%`;
15695
+ return {
15696
+ objectPosition
15697
+ };
15698
+ }
14092
15699
 
14093
15700
  /**
14094
15701
  * Component display name.
@@ -14119,25 +15726,18 @@ const DEFAULT_PROPS$4 = {
14119
15726
  * @param ref Component ref.
14120
15727
  * @return React element.
14121
15728
  */
14122
- const Thumbnail = forwardRef((props, ref) => {
14123
- const {
14124
- isAnyDisabled,
14125
- otherProps,
14126
- disabledStateProps
14127
- } = useDisableStateProps(props);
14128
- const defaultTheme = useTheme() || Theme$1.light;
15729
+ const Thumbnail$1 = props => {
14129
15730
  const {
14130
15731
  align,
14131
15732
  alt,
14132
- aspectRatio = AspectRatio.original,
15733
+ aspectRatio = AspectRatio$1.original,
14133
15734
  badge,
14134
15735
  className,
14135
15736
  crossOrigin,
15737
+ ref,
14136
15738
  fallback = DEFAULT_PROPS$4.fallback,
15739
+ focusPointStyle,
14137
15740
  fillHeight,
14138
- // `focusPoint` needs to be here to remove it from `forwardedProps`.
14139
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
14140
- focusPoint,
14141
15741
  image,
14142
15742
  imgProps,
14143
15743
  imgRef: propImgRef,
@@ -14145,23 +15745,18 @@ const Thumbnail = forwardRef((props, ref) => {
14145
15745
  objectFit,
14146
15746
  loading = DEFAULT_PROPS$4.loading,
14147
15747
  loadingPlaceholderImageRef,
15748
+ isAnyDisabled,
15749
+ disabledStateProps,
14148
15750
  size,
14149
- theme = defaultTheme,
15751
+ theme,
15752
+ loadingState,
14150
15753
  variant,
14151
15754
  linkProps,
14152
15755
  linkAs,
14153
15756
  ...forwardedProps
14154
- } = otherProps;
14155
- const [imgElement, setImgElement] = useState();
14156
-
14157
- // Image loading state.
14158
- const loadingState = useImageLoad(image, imgElement);
14159
- const isLoaded = loadingState === 'isLoaded';
15757
+ } = props;
14160
15758
  const isLoading = isLoadingProp || loadingState === 'isLoading';
14161
15759
  const hasError = loadingState === 'hasError';
14162
-
14163
- // Focus point.
14164
- const focusPointStyle = useFocusPointStyle(props, imgElement, isLoaded);
14165
15760
  const hasIconErrorFallback = hasError && typeof fallback === 'string';
14166
15761
  const hasCustomErrorFallback = hasError && !hasIconErrorFallback;
14167
15762
  const imageErrorStyle = {};
@@ -14174,7 +15769,6 @@ const Thumbnail = forwardRef((props, ref) => {
14174
15769
  }
14175
15770
  const isLink = Boolean(linkProps?.href || linkAs);
14176
15771
  const isClickable = !isAnyDisabled && Boolean(isLink || !!forwardedProps.onClick);
14177
- const Wrapper = isClickable ? RawClickable : 'div';
14178
15772
  const wrapperProps = {
14179
15773
  ...forwardedProps
14180
15774
  };
@@ -14188,6 +15782,21 @@ const Thumbnail = forwardRef((props, ref) => {
14188
15782
  wrapperProps['aria-label'] = forwardedProps['aria-label'] || alt;
14189
15783
  }
14190
15784
  }
15785
+ const wrapperClassName = classNames.join(linkProps?.className, className, block$4({
15786
+ [`align-${align}`]: Boolean(align),
15787
+ [`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
15788
+ [`size-${size}`]: Boolean(size),
15789
+ [`theme-${theme}`]: Boolean(theme),
15790
+ [`variant-${variant}`]: Boolean(variant),
15791
+ 'is-clickable': isClickable,
15792
+ 'has-error': hasError,
15793
+ 'has-icon-error-fallback': hasIconErrorFallback,
15794
+ 'has-custom-error-fallback': hasCustomErrorFallback,
15795
+ 'is-loading': isLoading,
15796
+ [`object-fit-${objectFit}`]: Boolean(objectFit),
15797
+ 'has-badge': !!badge,
15798
+ 'fill-height': fillHeight
15799
+ }));
14191
15800
 
14192
15801
  // If we have a loading placeholder image that is really loaded (complete)
14193
15802
  const loadingPlaceholderImage = isLoading && loadingPlaceholderImageRef?.current?.complete && loadingPlaceholderImageRef?.current || undefined;
@@ -14196,24 +15805,7 @@ const Thumbnail = forwardRef((props, ref) => {
14196
15805
  const loadingStyle = loadingPlaceholderImage ? {
14197
15806
  backgroundImage: `url(${loadingPlaceholderImage.src})`
14198
15807
  } : undefined;
14199
- return /*#__PURE__*/jsxs(Wrapper, {
14200
- ...wrapperProps,
14201
- ref: ref,
14202
- className: classNames.join(linkProps?.className, className, block$4({
14203
- [`align-${align}`]: Boolean(align),
14204
- [`aspect-ratio-${aspectRatio}`]: Boolean(aspectRatio),
14205
- [`size-${size}`]: Boolean(size),
14206
- [`theme-${theme}`]: Boolean(theme),
14207
- [`variant-${variant}`]: Boolean(variant),
14208
- 'is-clickable': isClickable,
14209
- 'has-error': hasError,
14210
- 'has-icon-error-fallback': hasIconErrorFallback,
14211
- 'has-custom-error-fallback': hasCustomErrorFallback,
14212
- 'is-loading': isLoading,
14213
- [`object-fit-${objectFit}`]: Boolean(objectFit),
14214
- 'has-badge': !!badge,
14215
- 'fill-height': fillHeight
14216
- })),
15808
+ const innerImage = /*#__PURE__*/jsxs(Fragment, {
14217
15809
  children: [/*#__PURE__*/jsxs("span", {
14218
15810
  className: element$4('background'),
14219
15811
  children: [/*#__PURE__*/jsx("img", {
@@ -14229,26 +15821,165 @@ const Thumbnail = forwardRef((props, ref) => {
14229
15821
  ...focusPointStyle,
14230
15822
  ...loadingStyle
14231
15823
  },
14232
- ref: useMergeRefs(setImgElement, propImgRef),
15824
+ ref: propImgRef,
14233
15825
  className: classNames.join(element$4('image', {
14234
15826
  'is-loading': isLoading,
14235
15827
  'has-defined-size': Boolean(imgProps?.height && imgProps.width)
14236
- }), imgProps?.className),
15828
+ }), imgProps?.className)
15829
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15830
+ // @ts-ignore - crossOrigin prop compatibility between React and Vue JSX
15831
+ ,
14237
15832
  crossOrigin: crossOrigin,
14238
15833
  src: image,
14239
15834
  alt: alt,
14240
15835
  loading: loading
14241
15836
  }), !isLoading && hasError && /*#__PURE__*/jsx("span", {
14242
15837
  className: element$4('fallback'),
14243
- children: hasIconErrorFallback ? /*#__PURE__*/jsx(Icon, {
15838
+ children: hasIconErrorFallback ? Icon$1({
14244
15839
  icon: fallback,
14245
15840
  size: Size$1.xxs,
14246
- theme: theme
15841
+ theme
14247
15842
  }) : fallback
14248
15843
  })]
14249
- }), badge && /*#__PURE__*/React__default.cloneElement(badge, {
15844
+ }), badge]
15845
+ });
15846
+
15847
+ /** Render `RawClickable` as a function since it is a core component which needs to be treated as such */
15848
+ if (isClickable) {
15849
+ return RawClickable$1({
15850
+ ref,
15851
+ ...wrapperProps,
15852
+ className: wrapperClassName,
15853
+ children: innerImage
15854
+ });
15855
+ }
15856
+ return /*#__PURE__*/jsx("div", {
15857
+ ref: ref,
15858
+ ...wrapperProps,
15859
+ className: wrapperClassName,
15860
+ children: innerImage
15861
+ });
15862
+ };
15863
+
15864
+ function useImageLoad(imageURL, imgRef) {
15865
+ const [state, setState] = useState(getImageLoadingState(imgRef));
15866
+
15867
+ // Update state when changing image URL or DOM reference.
15868
+ useEffect(() => {
15869
+ setState(getImageLoadingState(imgRef));
15870
+ }, [imageURL, imgRef]);
15871
+
15872
+ // Listen to `load` and `error` event on image
15873
+ useEffect(() => {
15874
+ const img = imgRef;
15875
+ if (!img) return undefined;
15876
+ const update = event => setState(getImageLoadingState(img, event));
15877
+ img.addEventListener('load', update);
15878
+ img.addEventListener('error', update);
15879
+ return () => {
15880
+ img.removeEventListener('load', update);
15881
+ img.removeEventListener('error', update);
15882
+ };
15883
+ }, [imgRef, imgRef?.src]);
15884
+ return state;
15885
+ }
15886
+
15887
+ // Compute CSS properties to apply the focus point.
15888
+ const useFocusPointStyle = ({
15889
+ image,
15890
+ aspectRatio,
15891
+ focusPoint,
15892
+ imgProps: {
15893
+ width,
15894
+ height
15895
+ } = {}
15896
+ }, element, isLoaded) => {
15897
+ // Get natural image size from imgProps or img element.
15898
+ const imageSize = useMemo(() => getImageSize({
15899
+ image,
15900
+ aspectRatio,
15901
+ focusPoint,
15902
+ width: typeof width === 'number' ? width : undefined,
15903
+ height: typeof height === 'number' ? height : undefined,
15904
+ element,
15905
+ isLoaded
15906
+ }), [aspectRatio, element, focusPoint, height, image, isLoaded, width]);
15907
+
15908
+ // Get container size (dependant on imageSize).
15909
+ const [containerSize, setContainerSize] = useState(undefined);
15910
+ useEffect(function updateContainerSize() {
15911
+ const cWidth = element?.offsetWidth;
15912
+ const cHeight = element?.offsetHeight;
15913
+ if (cWidth && cHeight) {
15914
+ // Update only if needed.
15915
+ setContainerSize(oldContainerSize => oldContainerSize?.width === cWidth && oldContainerSize.height === cHeight ? oldContainerSize : {
15916
+ width: cWidth,
15917
+ height: cHeight
15918
+ });
15919
+ } else if (imageSize) {
15920
+ // Wait for a render (in case the container size is dependent on the image size).
15921
+ requestAnimationFrame(updateContainerSize);
15922
+ }
15923
+ }, [element?.offsetHeight, element?.offsetWidth, imageSize]);
15924
+
15925
+ // Compute style.
15926
+ const style = useMemo(() => calculateFocusPointStyle({
15927
+ image,
15928
+ aspectRatio,
15929
+ focusPoint,
15930
+ element,
15931
+ imageSize,
15932
+ containerSize
15933
+ }), [aspectRatio, containerSize, element, focusPoint, image, imageSize]);
15934
+ return style;
15935
+ };
15936
+
15937
+ /**
15938
+ * Defines the props of the component.
15939
+ */
15940
+
15941
+ /**
15942
+ * Thumbnail component.
15943
+ *
15944
+ * @param props Component props.
15945
+ * @param ref Component ref.
15946
+ * @return React element.
15947
+ */
15948
+ const Thumbnail = forwardRef((props, ref) => {
15949
+ const {
15950
+ isAnyDisabled,
15951
+ otherProps,
15952
+ disabledStateProps
15953
+ } = useDisableStateProps(props);
15954
+ const defaultTheme = useTheme() || Theme$1.light;
15955
+ const {
15956
+ badge,
15957
+ focusPoint,
15958
+ image,
15959
+ imgRef: propImgRef,
15960
+ ...forwardedProps
15961
+ } = otherProps;
15962
+ const [imgElement, setImgElement] = useState();
15963
+
15964
+ // Image loading state.
15965
+ const loadingState = useImageLoad(image, imgElement);
15966
+ const isLoaded = loadingState === 'isLoaded';
15967
+
15968
+ // Focus point.
15969
+ const focusPointStyle = useFocusPointStyle(props, imgElement, isLoaded);
15970
+ return Thumbnail$1({
15971
+ ref,
15972
+ ...forwardedProps,
15973
+ theme: forwardedProps.theme || defaultTheme,
15974
+ isAnyDisabled,
15975
+ disabledStateProps,
15976
+ focusPointStyle,
15977
+ loadingState,
15978
+ imgRef: useMergeRefs(setImgElement, propImgRef),
15979
+ image,
15980
+ badge: badge && /*#__PURE__*/React__default.cloneElement(badge, {
14250
15981
  className: classNames.join(element$4('badge'), badge.props.className)
14251
- })]
15982
+ })
14252
15983
  });
14253
15984
  });
14254
15985
  Thumbnail.displayName = COMPONENT_NAME$4;
@@ -14270,7 +16001,7 @@ Thumbnail.defaultProps = DEFAULT_PROPS$4;
14270
16001
  * @deprecated
14271
16002
  */
14272
16003
  const ThumbnailAspectRatio = {
14273
- ...AspectRatio
16004
+ ...AspectRatio$1
14274
16005
  };
14275
16006
 
14276
16007
  /**
@@ -14701,7 +16432,7 @@ const {
14701
16432
  * Component default props.
14702
16433
  */
14703
16434
  const DEFAULT_PROPS$1 = {
14704
- aspectRatio: AspectRatio.horizontal,
16435
+ aspectRatio: AspectRatio$1.horizontal,
14705
16436
  size: Size$1.xl,
14706
16437
  variant: UploaderVariant.square
14707
16438
  };
@@ -14733,7 +16464,7 @@ const Uploader = forwardRef((props, ref) => {
14733
16464
  ...forwardedProps
14734
16465
  } = otherProps;
14735
16466
  // Adjust to square aspect ratio when using circle variants.
14736
- const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio.square : aspectRatio;
16467
+ const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio$1.square : aspectRatio;
14737
16468
  const handleClick = React__default.useCallback(evt => {
14738
16469
  if (isAnyDisabled) {
14739
16470
  evt.preventDefault();
@@ -14946,5 +16677,5 @@ UserBlock.displayName = COMPONENT_NAME;
14946
16677
  UserBlock.className = CLASSNAME;
14947
16678
  UserBlock.defaultProps = DEFAULT_PROPS;
14948
16679
 
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 };
16680
+ export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonGroup, CLASSNAME$1h as CLASSNAME, COMBOBOX_OPTION_CLASSNAME, COMPONENT_NAME$1e as COMPONENT_NAME, Checkbox, Chip, ChipGroup, Combobox, ComboboxButton, ComboboxDivider, ComboboxInput, ComboboxListBox, ComboboxOption, ComboboxOptionAction, ComboboxOptionMoreInfo, ComboboxOptionSkeleton, ComboboxSection, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$16 as DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, LUMX_CLASSNAME, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, SUB_COMPONENTS, Select, SelectMultiple, SelectMultipleField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, Text, TextField, ThOrder, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, isClickable, useFocusPointStyle, useHeadingLevel, useTheme };
14950
16681
  //# sourceMappingURL=index.js.map