@lumx/react 4.9.0-next.13 → 4.9.0-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +7 -7
- package/index.js +779 -730
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -12,19 +12,19 @@ import pull from 'lodash/pull.js';
|
|
|
12
12
|
import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/Dpulze-1.js';
|
|
13
13
|
import isEmpty from 'lodash/isEmpty.js';
|
|
14
14
|
import get from 'lodash/get.js';
|
|
15
|
-
import { getDisabledState } from '@lumx/core/js/utils/disabledState';
|
|
15
|
+
import { getDisabledState as getDisabledState$1 } from '@lumx/core/js/utils/disabledState';
|
|
16
16
|
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle.js';
|
|
17
17
|
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up.js';
|
|
18
18
|
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down.js';
|
|
19
19
|
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle.js';
|
|
20
20
|
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle.js';
|
|
21
21
|
import { mdiInformationOutline } from '@lumx/icons/esm/information-outline.js';
|
|
22
|
+
import castArray from 'lodash/castArray.js';
|
|
22
23
|
import noop$1 from 'lodash/noop.js';
|
|
23
24
|
import concat from 'lodash/concat.js';
|
|
24
25
|
import dropRight from 'lodash/dropRight.js';
|
|
25
26
|
import partition from 'lodash/partition.js';
|
|
26
27
|
import reduce from 'lodash/reduce.js';
|
|
27
|
-
import castArray from 'lodash/castArray.js';
|
|
28
28
|
import { mdiAlert } from '@lumx/icons/esm/alert.js';
|
|
29
29
|
import { mdiInformation } from '@lumx/icons/esm/information.js';
|
|
30
30
|
import { mdiClose } from '@lumx/icons/esm/close.js';
|
|
@@ -105,7 +105,7 @@ const COMPONENT_NAME$1w = 'AlertDialog';
|
|
|
105
105
|
*/
|
|
106
106
|
const CLASSNAME$1v = 'lumx-alert-dialog';
|
|
107
107
|
const {
|
|
108
|
-
block: block$
|
|
108
|
+
block: block$19
|
|
109
109
|
} = classNames.bem(CLASSNAME$1v);
|
|
110
110
|
|
|
111
111
|
/**
|
|
@@ -174,7 +174,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
174
174
|
'aria-describedby': descriptionId,
|
|
175
175
|
...dialogProps
|
|
176
176
|
},
|
|
177
|
-
className: classNames.join(className, block$
|
|
177
|
+
className: classNames.join(className, block$19({
|
|
178
178
|
[`kind-${kind}`]: Boolean(kind)
|
|
179
179
|
})),
|
|
180
180
|
...forwardedProps,
|
|
@@ -293,7 +293,7 @@ function useDisableStateProps(props) {
|
|
|
293
293
|
...otherProps
|
|
294
294
|
} = props;
|
|
295
295
|
const disabledStateContext = useDisabledStateContext();
|
|
296
|
-
const disabledStateProps = getDisabledState(disabledStateContext, {
|
|
296
|
+
const disabledStateProps = getDisabledState$1(disabledStateContext, {
|
|
297
297
|
disabled,
|
|
298
298
|
isDisabled,
|
|
299
299
|
'aria-disabled': ariaDisabled
|
|
@@ -664,7 +664,7 @@ function modifier$1(baseName, modifiers) {
|
|
|
664
664
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
665
665
|
*/
|
|
666
666
|
|
|
667
|
-
function block$
|
|
667
|
+
function block$18(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
668
668
|
let modifiers;
|
|
669
669
|
let classes;
|
|
670
670
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
@@ -699,7 +699,7 @@ const ACTION_ELEMENT = `${PREFIX}__action`;
|
|
|
699
699
|
const actionArea = Object.assign(/** Action area container class. Sets `position: relative`. */
|
|
700
700
|
() => PREFIX, {
|
|
701
701
|
/** Action element class. Adds a `::before` pseudo-element with `position: absolute; inset: 0` to expand the click area. */
|
|
702
|
-
action: modifiers => block$
|
|
702
|
+
action: modifiers => block$18(ACTION_ELEMENT, modifiers)
|
|
703
703
|
});
|
|
704
704
|
|
|
705
705
|
/** Resolve color & color variant from a `ColorWithVariants` and optionally a `ColorVariant`. */
|
|
@@ -821,11 +821,11 @@ const visuallyHidden = () => VISUALLY_HIDDEN;
|
|
|
821
821
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
822
822
|
*/
|
|
823
823
|
|
|
824
|
-
function element$
|
|
824
|
+
function element$R(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
825
825
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
826
|
-
return block$
|
|
826
|
+
return block$18(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
|
|
827
827
|
}
|
|
828
|
-
return block$
|
|
828
|
+
return block$18(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
/**
|
|
@@ -834,15 +834,15 @@ function element$Q(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
|
|
|
834
834
|
function bem(baseName) {
|
|
835
835
|
function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
|
|
836
836
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
837
|
-
return block$
|
|
837
|
+
return block$18(baseName, modifiersOrAdditionalClasses);
|
|
838
838
|
}
|
|
839
|
-
return block$
|
|
839
|
+
return block$18(baseName, modifiersOrAdditionalClasses, additionalClasses);
|
|
840
840
|
}
|
|
841
841
|
function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
842
842
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
843
|
-
return element$
|
|
843
|
+
return element$R(baseName, elem, modifiersOrAdditionalClasses);
|
|
844
844
|
}
|
|
845
|
-
return element$
|
|
845
|
+
return element$R(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
|
|
846
846
|
}
|
|
847
847
|
return {
|
|
848
848
|
block: blockFn,
|
|
@@ -1000,8 +1000,8 @@ const COMPONENT_NAME$1t = 'Avatar';
|
|
|
1000
1000
|
*/
|
|
1001
1001
|
const CLASSNAME$1s = 'lumx-avatar';
|
|
1002
1002
|
const {
|
|
1003
|
-
block: block$
|
|
1004
|
-
element: element$
|
|
1003
|
+
block: block$17,
|
|
1004
|
+
element: element$Q
|
|
1005
1005
|
} = bem(CLASSNAME$1s);
|
|
1006
1006
|
|
|
1007
1007
|
/**
|
|
@@ -1032,15 +1032,15 @@ const Avatar$1 = props => {
|
|
|
1032
1032
|
return /*#__PURE__*/jsxs("div", {
|
|
1033
1033
|
ref: ref,
|
|
1034
1034
|
...forwardedProps,
|
|
1035
|
-
className: classnames(className, block$
|
|
1035
|
+
className: classnames(className, block$17({
|
|
1036
1036
|
[`size-${size}`]: Boolean(size),
|
|
1037
1037
|
[`theme-${theme}`]: Boolean(theme)
|
|
1038
1038
|
})),
|
|
1039
1039
|
children: [image, actions && /*#__PURE__*/jsx("div", {
|
|
1040
|
-
className: element$
|
|
1040
|
+
className: element$Q('actions'),
|
|
1041
1041
|
children: actions
|
|
1042
1042
|
}), badge && /*#__PURE__*/jsx("div", {
|
|
1043
|
-
className: element$
|
|
1043
|
+
className: element$Q('badge'),
|
|
1044
1044
|
children: badge
|
|
1045
1045
|
})]
|
|
1046
1046
|
});
|
|
@@ -1081,7 +1081,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
1081
1081
|
image: /*#__PURE__*/jsx(Thumbnail, {
|
|
1082
1082
|
linkProps: linkProps,
|
|
1083
1083
|
linkAs: linkAs,
|
|
1084
|
-
className: element$
|
|
1084
|
+
className: element$Q('thumbnail'),
|
|
1085
1085
|
onClick: onClick,
|
|
1086
1086
|
onKeyPress: onKeyPress,
|
|
1087
1087
|
...thumbnailProps,
|
|
@@ -1107,7 +1107,7 @@ const COMPONENT_NAME$1s = 'Badge';
|
|
|
1107
1107
|
*/
|
|
1108
1108
|
const CLASSNAME$1r = 'lumx-badge';
|
|
1109
1109
|
const {
|
|
1110
|
-
block: block$
|
|
1110
|
+
block: block$16
|
|
1111
1111
|
} = bem(CLASSNAME$1r);
|
|
1112
1112
|
|
|
1113
1113
|
/**
|
|
@@ -1134,7 +1134,7 @@ const Badge$1 = props => {
|
|
|
1134
1134
|
return /*#__PURE__*/jsx("div", {
|
|
1135
1135
|
ref: ref,
|
|
1136
1136
|
...forwardedProps,
|
|
1137
|
-
className: classnames(className, block$
|
|
1137
|
+
className: classnames(className, block$16({
|
|
1138
1138
|
[`color-${color}`]: Boolean(color)
|
|
1139
1139
|
})),
|
|
1140
1140
|
children: children
|
|
@@ -1168,8 +1168,8 @@ Badge.defaultProps = Badge$1.defaultProps;
|
|
|
1168
1168
|
const COMPONENT_NAME$1r = 'BadgeWrapper';
|
|
1169
1169
|
const CLASSNAME$1q = 'lumx-badge-wrapper';
|
|
1170
1170
|
const {
|
|
1171
|
-
block: block$
|
|
1172
|
-
element: element$
|
|
1171
|
+
block: block$15,
|
|
1172
|
+
element: element$P
|
|
1173
1173
|
} = bem(CLASSNAME$1q);
|
|
1174
1174
|
const BadgeWrapper$1 = props => {
|
|
1175
1175
|
const {
|
|
@@ -1182,9 +1182,9 @@ const BadgeWrapper$1 = props => {
|
|
|
1182
1182
|
return /*#__PURE__*/jsxs("div", {
|
|
1183
1183
|
ref: ref,
|
|
1184
1184
|
...forwardedProps,
|
|
1185
|
-
className: classnames(className, block$
|
|
1185
|
+
className: classnames(className, block$15()),
|
|
1186
1186
|
children: [children, badge && /*#__PURE__*/jsx("div", {
|
|
1187
|
-
className: element$
|
|
1187
|
+
className: element$P('badge'),
|
|
1188
1188
|
children: badge
|
|
1189
1189
|
})]
|
|
1190
1190
|
});
|
|
@@ -1488,7 +1488,7 @@ const IconClassName = 'lumx-icon';
|
|
|
1488
1488
|
|
|
1489
1489
|
const CLASSNAME$1o = IconClassName;
|
|
1490
1490
|
const {
|
|
1491
|
-
block: block$
|
|
1491
|
+
block: block$14
|
|
1492
1492
|
} = bem(CLASSNAME$1o);
|
|
1493
1493
|
|
|
1494
1494
|
/**
|
|
@@ -1543,7 +1543,7 @@ const Icon$1 = props => {
|
|
|
1543
1543
|
return /*#__PURE__*/jsx("i", {
|
|
1544
1544
|
ref: ref,
|
|
1545
1545
|
...forwardedProps,
|
|
1546
|
-
className: classnames(className, block$
|
|
1546
|
+
className: classnames(className, block$14({
|
|
1547
1547
|
[`color-${iconColor}`]: Boolean(iconColor),
|
|
1548
1548
|
[`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
|
|
1549
1549
|
'has-shape': hasShape,
|
|
@@ -1732,7 +1732,7 @@ const COMPONENT_NAME$1l = 'InputLabel';
|
|
|
1732
1732
|
const InputLabelClassName = 'lumx-input-label';
|
|
1733
1733
|
const CLASSNAME$1l = InputLabelClassName;
|
|
1734
1734
|
const {
|
|
1735
|
-
block: block$
|
|
1735
|
+
block: block$13
|
|
1736
1736
|
} = bem(CLASSNAME$1l);
|
|
1737
1737
|
const DEFAULT_PROPS$16 = {};
|
|
1738
1738
|
|
|
@@ -1754,7 +1754,7 @@ function InputLabel$1(props) {
|
|
|
1754
1754
|
ref: ref,
|
|
1755
1755
|
...forwardedProps,
|
|
1756
1756
|
htmlFor: htmlFor,
|
|
1757
|
-
className: classnames(className, block$
|
|
1757
|
+
className: classnames(className, block$13({
|
|
1758
1758
|
'is-required': isRequired,
|
|
1759
1759
|
[`theme-${theme}`]: Boolean(theme),
|
|
1760
1760
|
'has-custom-typography': Boolean(typography$1)
|
|
@@ -1787,7 +1787,7 @@ const InputHelperClassName = 'lumx-input-helper';
|
|
|
1787
1787
|
|
|
1788
1788
|
const CLASSNAME$1k = InputHelperClassName;
|
|
1789
1789
|
const {
|
|
1790
|
-
block: block$
|
|
1790
|
+
block: block$12
|
|
1791
1791
|
} = bem(CLASSNAME$1k);
|
|
1792
1792
|
|
|
1793
1793
|
/**
|
|
@@ -1815,7 +1815,7 @@ function InputHelper$1(props) {
|
|
|
1815
1815
|
return /*#__PURE__*/jsx("p", {
|
|
1816
1816
|
ref: ref,
|
|
1817
1817
|
...forwardedProps,
|
|
1818
|
-
className: classnames(className, block$
|
|
1818
|
+
className: classnames(className, block$12({
|
|
1819
1819
|
[`color-${color}`]: Boolean(color),
|
|
1820
1820
|
[`theme-${theme}`]: Boolean(theme)
|
|
1821
1821
|
})),
|
|
@@ -1842,8 +1842,8 @@ const COMPONENT_NAME$1j = 'Checkbox';
|
|
|
1842
1842
|
*/
|
|
1843
1843
|
const CLASSNAME$1j = 'lumx-checkbox';
|
|
1844
1844
|
const {
|
|
1845
|
-
block: block$
|
|
1846
|
-
element: element$
|
|
1845
|
+
block: block$11,
|
|
1846
|
+
element: element$O
|
|
1847
1847
|
} = bem(CLASSNAME$1j);
|
|
1848
1848
|
|
|
1849
1849
|
/**
|
|
@@ -1880,7 +1880,7 @@ const Checkbox$1 = props => {
|
|
|
1880
1880
|
return /*#__PURE__*/jsxs("div", {
|
|
1881
1881
|
ref: ref,
|
|
1882
1882
|
...forwardedProps,
|
|
1883
|
-
className: classnames(className, block$
|
|
1883
|
+
className: classnames(className, block$11({
|
|
1884
1884
|
// Whether state is intermediate class name will "-checked"
|
|
1885
1885
|
'is-checked': intermediateState ? true : isChecked,
|
|
1886
1886
|
'is-disabled': isDisabled,
|
|
@@ -1888,12 +1888,12 @@ const Checkbox$1 = props => {
|
|
|
1888
1888
|
[`theme-${theme}`]: Boolean(theme)
|
|
1889
1889
|
})),
|
|
1890
1890
|
children: [/*#__PURE__*/jsxs("div", {
|
|
1891
|
-
className: element$
|
|
1891
|
+
className: element$O('input-wrapper'),
|
|
1892
1892
|
children: [/*#__PURE__*/jsx("input", {
|
|
1893
1893
|
ref: inputRef,
|
|
1894
1894
|
type: "checkbox",
|
|
1895
1895
|
id: inputId,
|
|
1896
|
-
className: element$
|
|
1896
|
+
className: element$O('input-native'),
|
|
1897
1897
|
name: name,
|
|
1898
1898
|
value: value,
|
|
1899
1899
|
checked: isChecked,
|
|
@@ -1905,26 +1905,26 @@ const Checkbox$1 = props => {
|
|
|
1905
1905
|
} : {}),
|
|
1906
1906
|
...inputProps
|
|
1907
1907
|
}), /*#__PURE__*/jsxs("div", {
|
|
1908
|
-
className: element$
|
|
1908
|
+
className: element$O('input-placeholder'),
|
|
1909
1909
|
children: [/*#__PURE__*/jsx("div", {
|
|
1910
|
-
className: element$
|
|
1910
|
+
className: element$O('input-background')
|
|
1911
1911
|
}), /*#__PURE__*/jsx("div", {
|
|
1912
|
-
className: element$
|
|
1912
|
+
className: element$O('input-indicator'),
|
|
1913
1913
|
children: Icon$1({
|
|
1914
1914
|
icon: intermediateState ? mdiMinus : mdiCheck
|
|
1915
1915
|
})
|
|
1916
1916
|
})]
|
|
1917
1917
|
})]
|
|
1918
1918
|
}), /*#__PURE__*/jsxs("div", {
|
|
1919
|
-
className: element$
|
|
1919
|
+
className: element$O('content'),
|
|
1920
1920
|
children: [label && InputLabel$1({
|
|
1921
1921
|
htmlFor: inputId,
|
|
1922
|
-
className: element$
|
|
1922
|
+
className: element$O('label'),
|
|
1923
1923
|
theme,
|
|
1924
1924
|
children: label
|
|
1925
1925
|
}), helper && InputHelper$1({
|
|
1926
1926
|
id: `${inputId}-helper`,
|
|
1927
|
-
className: element$
|
|
1927
|
+
className: element$O('helper'),
|
|
1928
1928
|
theme,
|
|
1929
1929
|
children: helper
|
|
1930
1930
|
})]
|
|
@@ -2029,8 +2029,8 @@ const COMPONENT_NAME$1i = 'Chip';
|
|
|
2029
2029
|
*/
|
|
2030
2030
|
const CLASSNAME$1i = 'lumx-chip';
|
|
2031
2031
|
const {
|
|
2032
|
-
block: block
|
|
2033
|
-
element: element$
|
|
2032
|
+
block: block$10,
|
|
2033
|
+
element: element$N
|
|
2034
2034
|
} = bem(CLASSNAME$1i);
|
|
2035
2035
|
|
|
2036
2036
|
/**
|
|
@@ -2098,7 +2098,7 @@ const Chip$1 = props => {
|
|
|
2098
2098
|
...forwardedProps,
|
|
2099
2099
|
href: !disabledStateProps.disabled ? href : undefined,
|
|
2100
2100
|
ref: ref,
|
|
2101
|
-
className: classnames(className, block
|
|
2101
|
+
className: classnames(className, block$10({
|
|
2102
2102
|
'is-clickable': isClickable,
|
|
2103
2103
|
[`color-${chipColor}`]: Boolean(chipColor),
|
|
2104
2104
|
'is-disabled': isAnyDisabled,
|
|
@@ -2115,19 +2115,19 @@ const Chip$1 = props => {
|
|
|
2115
2115
|
/*#__PURE__*/
|
|
2116
2116
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2117
2117
|
jsx("div", {
|
|
2118
|
-
className: element$
|
|
2118
|
+
className: element$N('before', {
|
|
2119
2119
|
'is-clickable': hasBeforeClick
|
|
2120
2120
|
}),
|
|
2121
2121
|
onClick: handleBeforeClick,
|
|
2122
2122
|
children: before
|
|
2123
2123
|
}), /*#__PURE__*/jsx("div", {
|
|
2124
|
-
className: element$
|
|
2124
|
+
className: element$N('label'),
|
|
2125
2125
|
children: children
|
|
2126
2126
|
}), after &&
|
|
2127
2127
|
/*#__PURE__*/
|
|
2128
2128
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2129
2129
|
jsx("div", {
|
|
2130
|
-
className: element$
|
|
2130
|
+
className: element$N('after', {
|
|
2131
2131
|
'is-clickable': hasAfterClick
|
|
2132
2132
|
}),
|
|
2133
2133
|
onClick: handleAfterClick,
|
|
@@ -2390,8 +2390,8 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
|
|
|
2390
2390
|
*/
|
|
2391
2391
|
const CLASSNAME$1g = 'lumx-selection-chip-group';
|
|
2392
2392
|
const {
|
|
2393
|
-
block: block
|
|
2394
|
-
element: element$
|
|
2393
|
+
block: block$$,
|
|
2394
|
+
element: element$M
|
|
2395
2395
|
} = classNames.bem(CLASSNAME$1g);
|
|
2396
2396
|
|
|
2397
2397
|
/**
|
|
@@ -2422,7 +2422,7 @@ const SelectionChipGroup = ({
|
|
|
2422
2422
|
return /*#__PURE__*/jsx(ChipGroup, {
|
|
2423
2423
|
role: "group",
|
|
2424
2424
|
"aria-label": label,
|
|
2425
|
-
className: block
|
|
2425
|
+
className: block$$(),
|
|
2426
2426
|
...forwardedProps,
|
|
2427
2427
|
children: value?.map((v, index) => {
|
|
2428
2428
|
const name = getWithSelector(getOptionName, v);
|
|
@@ -2466,7 +2466,7 @@ const SelectionChipGroup = ({
|
|
|
2466
2466
|
after: /*#__PURE__*/jsx(Icon, {
|
|
2467
2467
|
icon: mdiClose
|
|
2468
2468
|
}),
|
|
2469
|
-
className: element$
|
|
2469
|
+
className: element$M('chip', [props?.className]),
|
|
2470
2470
|
size: "s",
|
|
2471
2471
|
ref: ref,
|
|
2472
2472
|
onClick: onClick,
|
|
@@ -3133,7 +3133,9 @@ function setupListbox(handle, signal, notify) {
|
|
|
3133
3133
|
onActivate: item => {
|
|
3134
3134
|
item.setAttribute('data-focus-visible-added', 'true');
|
|
3135
3135
|
trigger.setAttribute('aria-activedescendant', item.id);
|
|
3136
|
-
item
|
|
3136
|
+
// Scroll to the element in listbox or else the item
|
|
3137
|
+
const toScrollTo = item.closest('[role=listbox] > *') || item;
|
|
3138
|
+
toScrollTo.scrollIntoView({
|
|
3137
3139
|
behavior: 'smooth',
|
|
3138
3140
|
block: 'nearest'
|
|
3139
3141
|
});
|
|
@@ -3347,7 +3349,7 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3347
3349
|
/**
|
|
3348
3350
|
* Attach the shared keydown listener to the trigger.
|
|
3349
3351
|
*
|
|
3350
|
-
* Handles: Enter, ArrowDown, ArrowUp, Escape (2-tier),
|
|
3352
|
+
* Handles: Enter, ArrowDown, ArrowUp, Escape (2-tier), PageUp, PageDown.
|
|
3351
3353
|
* Mode-specific keys (Space, Home, End, ArrowLeft/Right, printable chars, etc.)
|
|
3352
3354
|
* are delegated to the `onKeydown` hook provided by the mode controller.
|
|
3353
3355
|
*/
|
|
@@ -3434,15 +3436,6 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3434
3436
|
}
|
|
3435
3437
|
flag = true;
|
|
3436
3438
|
break;
|
|
3437
|
-
case 'Tab':
|
|
3438
|
-
// Click the active option (if any) and close. Let Tab propagate.
|
|
3439
|
-
if (nav?.hasActiveItem && nav.activeItem && !isOptionDisabled(nav.activeItem)) {
|
|
3440
|
-
nav.activeItem.click();
|
|
3441
|
-
}
|
|
3442
|
-
// The delegated click handler closes for single-select, but for multi-select
|
|
3443
|
-
// or when no item is active, we still need to explicitly close.
|
|
3444
|
-
handle.setIsOpen(false);
|
|
3445
|
-
break;
|
|
3446
3439
|
case 'PageUp':
|
|
3447
3440
|
if (handle.isOpen && nav?.hasActiveItem) {
|
|
3448
3441
|
nav.goToOffset(-10);
|
|
@@ -3482,10 +3475,17 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3482
3475
|
}
|
|
3483
3476
|
trigger.setAttribute('aria-expanded', String(isOpenState));
|
|
3484
3477
|
|
|
3485
|
-
// On first attach, wire up the mode-specific controller
|
|
3478
|
+
// On first attach, wire up the mode-specific controller, shared keydown, and focusout handlers.
|
|
3486
3479
|
if (isNewController) {
|
|
3487
3480
|
const onKeydown = onTriggerAttach?.(handle, abortController.signal) || undefined;
|
|
3488
3481
|
attachTriggerKeydown(trigger, abortController.signal, onKeydown);
|
|
3482
|
+
|
|
3483
|
+
// Close the popup when the trigger loses focus
|
|
3484
|
+
trigger.addEventListener('focusout', () => {
|
|
3485
|
+
handle.setIsOpen(false);
|
|
3486
|
+
}, {
|
|
3487
|
+
signal: abortController.signal
|
|
3488
|
+
});
|
|
3489
3489
|
}
|
|
3490
3490
|
if (listbox && !focusNav) {
|
|
3491
3491
|
focusNav = setupListbox(handle, abortController.signal, notify);
|
|
@@ -3551,7 +3551,7 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3551
3551
|
registerOption(element, callback) {
|
|
3552
3552
|
const filterLower = filterValue.toLowerCase();
|
|
3553
3553
|
const text = getOptionValue(element).toLowerCase();
|
|
3554
|
-
const isFiltered = filterLower.length > 0 && !text.
|
|
3554
|
+
const isFiltered = filterLower.length > 0 && !text.includes(filterLower);
|
|
3555
3555
|
optionRegistrations.set(element, {
|
|
3556
3556
|
callback,
|
|
3557
3557
|
lastFiltered: isFiltered
|
|
@@ -3569,7 +3569,7 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3569
3569
|
const filterLower = newFilter.toLowerCase();
|
|
3570
3570
|
for (const [element, reg] of optionRegistrations) {
|
|
3571
3571
|
const text = getOptionValue(element).toLowerCase();
|
|
3572
|
-
const isFiltered = filterLower.length > 0 && !text.
|
|
3572
|
+
const isFiltered = filterLower.length > 0 && !text.includes(filterLower);
|
|
3573
3573
|
// Only notify when state actually changes to avoid unnecessary re-renders.
|
|
3574
3574
|
if (isFiltered !== reg.lastFiltered) {
|
|
3575
3575
|
reg.lastFiltered = isFiltered;
|
|
@@ -3827,6 +3827,13 @@ function setupComboboxButton(button, callbacks) {
|
|
|
3827
3827
|
return event => {
|
|
3828
3828
|
const nav = combobox.focusNav;
|
|
3829
3829
|
switch (event.key) {
|
|
3830
|
+
case 'Tab':
|
|
3831
|
+
// Selects the focused option
|
|
3832
|
+
if (combobox.isOpen && nav?.hasActiveItem && nav.activeItem) {
|
|
3833
|
+
combobox.select(nav.activeItem);
|
|
3834
|
+
}
|
|
3835
|
+
// Return false to continue normal 'Tab' behavior (focus next).
|
|
3836
|
+
return false;
|
|
3830
3837
|
case ' ':
|
|
3831
3838
|
// Space acts like Enter in button mode.
|
|
3832
3839
|
if (combobox.isOpen && nav?.hasActiveItem && nav.activeItem) {
|
|
@@ -6062,8 +6069,8 @@ const COMPONENT_NAME$1f = 'Tooltip';
|
|
|
6062
6069
|
*/
|
|
6063
6070
|
const CLASSNAME$1e = 'lumx-tooltip';
|
|
6064
6071
|
const {
|
|
6065
|
-
block: block$
|
|
6066
|
-
element: element$
|
|
6072
|
+
block: block$_,
|
|
6073
|
+
element: element$L
|
|
6067
6074
|
} = bem(CLASSNAME$1e);
|
|
6068
6075
|
|
|
6069
6076
|
/**
|
|
@@ -6095,7 +6102,7 @@ const TooltipPopup = props => {
|
|
|
6095
6102
|
...forwardedProps,
|
|
6096
6103
|
id: id,
|
|
6097
6104
|
role: "tooltip",
|
|
6098
|
-
className: classnames(className, block$
|
|
6105
|
+
className: classnames(className, block$_({
|
|
6099
6106
|
[`position-${position}`]: Boolean(position)
|
|
6100
6107
|
}), isHidden && visuallyHidden()),
|
|
6101
6108
|
style: {
|
|
@@ -6104,9 +6111,9 @@ const TooltipPopup = props => {
|
|
|
6104
6111
|
},
|
|
6105
6112
|
"data-popper-placement": position,
|
|
6106
6113
|
children: [/*#__PURE__*/jsx("div", {
|
|
6107
|
-
className: element$
|
|
6114
|
+
className: element$L('arrow')
|
|
6108
6115
|
}), /*#__PURE__*/jsx("div", {
|
|
6109
|
-
className: element$
|
|
6116
|
+
className: element$L('inner'),
|
|
6110
6117
|
children: labelLines.map((line, index) => /*#__PURE__*/jsx("p", {
|
|
6111
6118
|
children: line
|
|
6112
6119
|
}, index))
|
|
@@ -6623,6 +6630,9 @@ function setupComboboxInput(input, options) {
|
|
|
6623
6630
|
onSelect: optionOnSelect
|
|
6624
6631
|
} = options;
|
|
6625
6632
|
|
|
6633
|
+
/** Check if the input is disabled (native `disabled` attribute or `aria-disabled="true"`). */
|
|
6634
|
+
const isDisabled = () => input.disabled || input.getAttribute('aria-disabled') === 'true';
|
|
6635
|
+
|
|
6626
6636
|
/**
|
|
6627
6637
|
* True when the current input value came from user typing (real InputEvent).
|
|
6628
6638
|
* False when the value was set programmatically (select, clear, etc.).
|
|
@@ -6660,6 +6670,7 @@ function setupComboboxInput(input, options) {
|
|
|
6660
6670
|
// Filter on real user typing (InputEvent with `inputType`).
|
|
6661
6671
|
input.addEventListener('input', event => {
|
|
6662
6672
|
if (!(event instanceof InputEvent)) return;
|
|
6673
|
+
if (isDisabled()) return;
|
|
6663
6674
|
combobox.focusNav?.clear();
|
|
6664
6675
|
userHasTyped = true;
|
|
6665
6676
|
combobox.setIsOpen(true);
|
|
@@ -6672,6 +6683,7 @@ function setupComboboxInput(input, options) {
|
|
|
6672
6683
|
|
|
6673
6684
|
// Open on focus.
|
|
6674
6685
|
input.addEventListener('focus', () => {
|
|
6686
|
+
if (isDisabled()) return;
|
|
6675
6687
|
combobox.focusNav?.clear();
|
|
6676
6688
|
combobox.setIsOpen(true);
|
|
6677
6689
|
}, {
|
|
@@ -6679,7 +6691,10 @@ function setupComboboxInput(input, options) {
|
|
|
6679
6691
|
});
|
|
6680
6692
|
|
|
6681
6693
|
// Open on click (handles the case where the input is already focused, so focus doesn't re-fire).
|
|
6682
|
-
input.addEventListener('click', () =>
|
|
6694
|
+
input.addEventListener('click', () => {
|
|
6695
|
+
if (isDisabled()) return;
|
|
6696
|
+
combobox.setIsOpen(true);
|
|
6697
|
+
}, {
|
|
6683
6698
|
signal
|
|
6684
6699
|
});
|
|
6685
6700
|
|
|
@@ -6725,6 +6740,23 @@ function setupComboboxInput(input, options) {
|
|
|
6725
6740
|
return handle;
|
|
6726
6741
|
}
|
|
6727
6742
|
|
|
6743
|
+
/** Disable state */
|
|
6744
|
+
|
|
6745
|
+
/**
|
|
6746
|
+
* Calculate the disabled state based on context and props.
|
|
6747
|
+
*/
|
|
6748
|
+
function getDisabledState(context, props) {
|
|
6749
|
+
const {
|
|
6750
|
+
disabled,
|
|
6751
|
+
isDisabled = disabled,
|
|
6752
|
+
'aria-disabled': ariaDisabled
|
|
6753
|
+
} = props;
|
|
6754
|
+
return {
|
|
6755
|
+
disabled: !!isDisabled,
|
|
6756
|
+
'aria-disabled': ariaDisabled === true || ariaDisabled === 'true'
|
|
6757
|
+
};
|
|
6758
|
+
}
|
|
6759
|
+
|
|
6728
6760
|
/**
|
|
6729
6761
|
* Component display name.
|
|
6730
6762
|
*/
|
|
@@ -6761,7 +6793,12 @@ const ComboboxInput$1 = (props, {
|
|
|
6761
6793
|
theme,
|
|
6762
6794
|
...forwardedProps
|
|
6763
6795
|
} = props;
|
|
6796
|
+
|
|
6797
|
+
// Compute whether the combobox is disabled (native or aria-disabled).
|
|
6798
|
+
const disabledState = getDisabledState(undefined, props);
|
|
6799
|
+
const isAnyDisabled = disabledState.disabled || disabledState['aria-disabled'] || undefined;
|
|
6764
6800
|
return /*#__PURE__*/jsx(TextField, {
|
|
6801
|
+
autoComplete: "off",
|
|
6765
6802
|
...forwardedProps,
|
|
6766
6803
|
ref: ref,
|
|
6767
6804
|
role: "combobox",
|
|
@@ -6770,11 +6807,11 @@ const ComboboxInput$1 = (props, {
|
|
|
6770
6807
|
"aria-expanded": isOpen,
|
|
6771
6808
|
inputRef: inputRef,
|
|
6772
6809
|
textFieldRef: textFieldRef,
|
|
6773
|
-
autoComplete: "off",
|
|
6774
6810
|
theme: theme,
|
|
6775
6811
|
afterElement: toggleButtonProps ? /*#__PURE__*/jsx(IconButton, {
|
|
6776
6812
|
...toggleButtonProps,
|
|
6777
6813
|
theme: theme,
|
|
6814
|
+
isDisabled: isAnyDisabled,
|
|
6778
6815
|
emphasis: "low",
|
|
6779
6816
|
size: "s",
|
|
6780
6817
|
icon: isOpen ? mdiChevronUp : mdiChevronDown,
|
|
@@ -6802,8 +6839,8 @@ const CLASSNAME$1c = 'lumx-text-field';
|
|
|
6802
6839
|
const INPUT_NATIVE_CLASSNAME = `${CLASSNAME$1c}__input-native`;
|
|
6803
6840
|
|
|
6804
6841
|
const {
|
|
6805
|
-
block: block$
|
|
6806
|
-
element: element$
|
|
6842
|
+
block: block$Z,
|
|
6843
|
+
element: element$K
|
|
6807
6844
|
} = bem(CLASSNAME$1c);
|
|
6808
6845
|
|
|
6809
6846
|
/**
|
|
@@ -6873,7 +6910,7 @@ const TextField$1 = props => {
|
|
|
6873
6910
|
const isNotEmpty = valueLength > 0;
|
|
6874
6911
|
return /*#__PURE__*/jsxs("div", {
|
|
6875
6912
|
ref: ref,
|
|
6876
|
-
className: classnames(className, block$
|
|
6913
|
+
className: classnames(className, block$Z({
|
|
6877
6914
|
'has-chips': Boolean(chips),
|
|
6878
6915
|
'has-error': !isValid && hasError,
|
|
6879
6916
|
'has-icon': Boolean(icon),
|
|
@@ -6889,16 +6926,16 @@ const TextField$1 = props => {
|
|
|
6889
6926
|
[`theme-${theme}`]: Boolean(theme)
|
|
6890
6927
|
})),
|
|
6891
6928
|
children: [(label || maxLength) && /*#__PURE__*/jsxs("div", {
|
|
6892
|
-
className: element$
|
|
6929
|
+
className: element$K('header'),
|
|
6893
6930
|
children: [label && InputLabel$1({
|
|
6894
6931
|
...labelProps,
|
|
6895
6932
|
htmlFor: textFieldId,
|
|
6896
|
-
className: element$
|
|
6933
|
+
className: element$K('label'),
|
|
6897
6934
|
isRequired,
|
|
6898
6935
|
theme,
|
|
6899
6936
|
children: label
|
|
6900
6937
|
}), maxLength && /*#__PURE__*/jsxs("div", {
|
|
6901
|
-
className: element$
|
|
6938
|
+
className: element$K('char-counter'),
|
|
6902
6939
|
children: [/*#__PURE__*/jsx("span", {
|
|
6903
6940
|
children: maxLength - valueLength
|
|
6904
6941
|
}), maxLength - valueLength === 0 && Icon$1({
|
|
@@ -6907,44 +6944,44 @@ const TextField$1 = props => {
|
|
|
6907
6944
|
})]
|
|
6908
6945
|
})]
|
|
6909
6946
|
}), /*#__PURE__*/jsxs("div", {
|
|
6910
|
-
className: element$
|
|
6947
|
+
className: element$K('wrapper'),
|
|
6911
6948
|
ref: textFieldRef,
|
|
6912
6949
|
children: [icon && Icon$1({
|
|
6913
|
-
className: element$
|
|
6950
|
+
className: element$K('input-icon'),
|
|
6914
6951
|
color: theme === Theme.dark ? 'light' : undefined,
|
|
6915
6952
|
icon,
|
|
6916
6953
|
size: Size.xs
|
|
6917
6954
|
}), chips ? /*#__PURE__*/jsxs("div", {
|
|
6918
|
-
className: element$
|
|
6955
|
+
className: element$K('chips'),
|
|
6919
6956
|
children: [chips, input]
|
|
6920
6957
|
}) : /*#__PURE__*/jsx("div", {
|
|
6921
|
-
className: element$
|
|
6958
|
+
className: element$K('input-wrapper'),
|
|
6922
6959
|
children: input
|
|
6923
6960
|
}), (isValid || hasError) && Icon$1({
|
|
6924
|
-
className: element$
|
|
6961
|
+
className: element$K('input-validity'),
|
|
6925
6962
|
color: theme === Theme.dark ? 'light' : undefined,
|
|
6926
6963
|
icon: isValid ? mdiCheckCircle : mdiAlertCircle,
|
|
6927
6964
|
size: Size.xxs
|
|
6928
6965
|
}), clearButtonProps && isNotEmpty && !isAnyDisabled && /*#__PURE__*/jsx(IconButton, {
|
|
6929
6966
|
...clearButtonProps,
|
|
6930
|
-
className: element$
|
|
6967
|
+
className: element$K('input-clear'),
|
|
6931
6968
|
icon: mdiCloseCircle,
|
|
6932
6969
|
emphasis: Emphasis.low,
|
|
6933
6970
|
size: Size.s,
|
|
6934
6971
|
theme: theme,
|
|
6935
6972
|
type: "button"
|
|
6936
6973
|
}), afterElement && /*#__PURE__*/jsx("div", {
|
|
6937
|
-
className: element$
|
|
6974
|
+
className: element$K('after-element'),
|
|
6938
6975
|
children: afterElement
|
|
6939
6976
|
})]
|
|
6940
6977
|
}), hasError && error && InputHelper$1({
|
|
6941
6978
|
children: error,
|
|
6942
|
-
className: element$
|
|
6979
|
+
className: element$K('helper'),
|
|
6943
6980
|
kind: Kind.error,
|
|
6944
6981
|
theme,
|
|
6945
6982
|
id: errorId
|
|
6946
6983
|
}), helper && InputHelper$1({
|
|
6947
|
-
className: element$
|
|
6984
|
+
className: element$K('helper'),
|
|
6948
6985
|
theme,
|
|
6949
6986
|
id: helperId,
|
|
6950
6987
|
children: helper
|
|
@@ -6953,7 +6990,7 @@ const TextField$1 = props => {
|
|
|
6953
6990
|
};
|
|
6954
6991
|
|
|
6955
6992
|
const {
|
|
6956
|
-
block: block$
|
|
6993
|
+
block: block$Y
|
|
6957
6994
|
} = bem(INPUT_NATIVE_CLASSNAME);
|
|
6958
6995
|
|
|
6959
6996
|
/**
|
|
@@ -6990,7 +7027,7 @@ const RawInputText$1 = props => {
|
|
|
6990
7027
|
name: name,
|
|
6991
7028
|
type: type,
|
|
6992
7029
|
ref: ref,
|
|
6993
|
-
className: classnames(className, block$
|
|
7030
|
+
className: classnames(className, block$Y({
|
|
6994
7031
|
[`theme-${theme}`]: Boolean(theme),
|
|
6995
7032
|
text: true
|
|
6996
7033
|
})),
|
|
@@ -7019,7 +7056,7 @@ const RawInputText = forwardRef((props, ref) => {
|
|
|
7019
7056
|
});
|
|
7020
7057
|
|
|
7021
7058
|
const {
|
|
7022
|
-
block: block$
|
|
7059
|
+
block: block$X
|
|
7023
7060
|
} = bem(INPUT_NATIVE_CLASSNAME);
|
|
7024
7061
|
|
|
7025
7062
|
/**
|
|
@@ -7055,7 +7092,7 @@ const RawInputTextarea$1 = props => {
|
|
|
7055
7092
|
...forwardedProps,
|
|
7056
7093
|
name: name,
|
|
7057
7094
|
ref: ref,
|
|
7058
|
-
className: classnames(className, block$
|
|
7095
|
+
className: classnames(className, block$X({
|
|
7059
7096
|
[`theme-${theme}`]: Boolean(theme),
|
|
7060
7097
|
textarea: true
|
|
7061
7098
|
})),
|
|
@@ -7381,7 +7418,7 @@ const COMPONENT_NAME$1c = 'List';
|
|
|
7381
7418
|
*/
|
|
7382
7419
|
const CLASSNAME$1b = 'lumx-list';
|
|
7383
7420
|
const {
|
|
7384
|
-
block: block$
|
|
7421
|
+
block: block$W
|
|
7385
7422
|
} = bem(CLASSNAME$1b);
|
|
7386
7423
|
|
|
7387
7424
|
/**
|
|
@@ -7405,7 +7442,7 @@ const List$1 = props => {
|
|
|
7405
7442
|
} = props;
|
|
7406
7443
|
return /*#__PURE__*/jsx("ul", {
|
|
7407
7444
|
...forwardedProps,
|
|
7408
|
-
className: classnames(className, block$
|
|
7445
|
+
className: classnames(className, block$W({
|
|
7409
7446
|
[`item-padding-${itemPadding}`]: Boolean(itemPadding)
|
|
7410
7447
|
})),
|
|
7411
7448
|
ref: ref,
|
|
@@ -7554,8 +7591,8 @@ const COMPONENT_NAME$1a = 'ListItem';
|
|
|
7554
7591
|
*/
|
|
7555
7592
|
const CLASSNAME$19 = 'lumx-list-item';
|
|
7556
7593
|
const {
|
|
7557
|
-
block: block$
|
|
7558
|
-
element: element$
|
|
7594
|
+
block: block$V,
|
|
7595
|
+
element: element$J
|
|
7559
7596
|
} = bem(CLASSNAME$19);
|
|
7560
7597
|
|
|
7561
7598
|
/**
|
|
@@ -7593,7 +7630,7 @@ const ListItem$1 = props => {
|
|
|
7593
7630
|
return /*#__PURE__*/jsx("li", {
|
|
7594
7631
|
ref: ref,
|
|
7595
7632
|
...forwardedProps,
|
|
7596
|
-
className: classnames(className, block$
|
|
7633
|
+
className: classnames(className, block$V({
|
|
7597
7634
|
[`size-${size}`]: Boolean(size)
|
|
7598
7635
|
})),
|
|
7599
7636
|
children: RawClickable({
|
|
@@ -7601,7 +7638,7 @@ const ListItem$1 = props => {
|
|
|
7601
7638
|
isDisabled,
|
|
7602
7639
|
'aria-disabled': ariaDisabled,
|
|
7603
7640
|
...linkProps,
|
|
7604
|
-
className: element$
|
|
7641
|
+
className: element$J(clickable ? 'link' : 'wrapper', {
|
|
7605
7642
|
'is-highlighted': isHighlighted,
|
|
7606
7643
|
'is-selected': isSelected,
|
|
7607
7644
|
'is-disabled': isDisabled || ariaDisabled === 'true'
|
|
@@ -7610,13 +7647,13 @@ const ListItem$1 = props => {
|
|
|
7610
7647
|
ref: linkRef,
|
|
7611
7648
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
7612
7649
|
children: [before && /*#__PURE__*/jsx("div", {
|
|
7613
|
-
className: element$
|
|
7650
|
+
className: element$J('before'),
|
|
7614
7651
|
children: before
|
|
7615
7652
|
}), /*#__PURE__*/jsx("div", {
|
|
7616
|
-
className: element$
|
|
7653
|
+
className: element$J('content'),
|
|
7617
7654
|
children: children
|
|
7618
7655
|
}), after && /*#__PURE__*/jsx("div", {
|
|
7619
|
-
className: element$
|
|
7656
|
+
className: element$J('after'),
|
|
7620
7657
|
children: after
|
|
7621
7658
|
})]
|
|
7622
7659
|
})
|
|
@@ -7684,7 +7721,7 @@ const COMPONENT_NAME$18 = 'Text';
|
|
|
7684
7721
|
*/
|
|
7685
7722
|
const CLASSNAME$17 = 'lumx-text';
|
|
7686
7723
|
const {
|
|
7687
|
-
block: block$
|
|
7724
|
+
block: block$U
|
|
7688
7725
|
} = bem(CLASSNAME$17);
|
|
7689
7726
|
|
|
7690
7727
|
/**
|
|
@@ -7726,7 +7763,7 @@ const getTextProps = props => {
|
|
|
7726
7763
|
'--lumx-text-white-space': whiteSpace
|
|
7727
7764
|
};
|
|
7728
7765
|
return {
|
|
7729
|
-
className: classnames(className, block$
|
|
7766
|
+
className: classnames(className, block$U({
|
|
7730
7767
|
'is-truncated': isTruncated && !isTruncatedMultiline,
|
|
7731
7768
|
'is-truncated-multiline': isTruncatedMultiline,
|
|
7732
7769
|
'no-wrap': noWrap
|
|
@@ -7749,8 +7786,8 @@ const COMPONENT_NAME$17 = 'ComboboxOption';
|
|
|
7749
7786
|
*/
|
|
7750
7787
|
const CLASSNAME$16 = 'lumx-combobox-option';
|
|
7751
7788
|
const {
|
|
7752
|
-
block: block$
|
|
7753
|
-
element: element$
|
|
7789
|
+
block: block$T,
|
|
7790
|
+
element: element$I
|
|
7754
7791
|
} = bem(CLASSNAME$16);
|
|
7755
7792
|
|
|
7756
7793
|
/**
|
|
@@ -7795,7 +7832,7 @@ const ComboboxOption$1 = (props, {
|
|
|
7795
7832
|
as: 'button',
|
|
7796
7833
|
...actionProps,
|
|
7797
7834
|
id,
|
|
7798
|
-
className: element$
|
|
7835
|
+
className: element$I('action'),
|
|
7799
7836
|
handleClick,
|
|
7800
7837
|
'aria-selected': isSelected ? 'true' : 'false',
|
|
7801
7838
|
'data-value': value,
|
|
@@ -7813,7 +7850,7 @@ const ComboboxOption$1 = (props, {
|
|
|
7813
7850
|
size: 'tiny',
|
|
7814
7851
|
...forwardedProps,
|
|
7815
7852
|
hidden,
|
|
7816
|
-
className: !hidden ? classnames(className, block$
|
|
7853
|
+
className: !hidden ? classnames(className, block$T()) : undefined,
|
|
7817
7854
|
before,
|
|
7818
7855
|
after,
|
|
7819
7856
|
role: itemRole,
|
|
@@ -7821,7 +7858,7 @@ const ComboboxOption$1 = (props, {
|
|
|
7821
7858
|
children: [wrappedAction, description && /*#__PURE__*/jsx("p", {
|
|
7822
7859
|
id: descriptionId,
|
|
7823
7860
|
...getTextProps({
|
|
7824
|
-
className: element$
|
|
7861
|
+
className: element$I('description'),
|
|
7825
7862
|
typography: 'caption',
|
|
7826
7863
|
color: 'dark-L2'
|
|
7827
7864
|
}),
|
|
@@ -8030,8 +8067,8 @@ const COMPONENT_NAME$15 = 'ComboboxOptionMoreInfo';
|
|
|
8030
8067
|
*/
|
|
8031
8068
|
const CLASSNAME$14 = 'lumx-combobox-option-more-info';
|
|
8032
8069
|
const {
|
|
8033
|
-
block: block$
|
|
8034
|
-
element: element$
|
|
8070
|
+
block: block$S,
|
|
8071
|
+
element: element$H
|
|
8035
8072
|
} = bem(CLASSNAME$14);
|
|
8036
8073
|
|
|
8037
8074
|
/**
|
|
@@ -8066,7 +8103,7 @@ const ComboboxOptionMoreInfo$1 = (props, {
|
|
|
8066
8103
|
icon: mdiInformationOutline,
|
|
8067
8104
|
size: "s",
|
|
8068
8105
|
...buttonProps,
|
|
8069
|
-
className: block$
|
|
8106
|
+
className: block$S([className, buttonProps?.className]),
|
|
8070
8107
|
emphasis: "low",
|
|
8071
8108
|
onMouseEnter: onMouseEnter,
|
|
8072
8109
|
onMouseLeave: onMouseLeave
|
|
@@ -8077,7 +8114,7 @@ const ComboboxOptionMoreInfo$1 = (props, {
|
|
|
8077
8114
|
label: ""
|
|
8078
8115
|
}), /*#__PURE__*/jsx(Popover, {
|
|
8079
8116
|
id: popoverId,
|
|
8080
|
-
className: element$
|
|
8117
|
+
className: element$H('popover'),
|
|
8081
8118
|
anchorRef: ref,
|
|
8082
8119
|
isOpen: isOpen,
|
|
8083
8120
|
closeMode: "unmount",
|
|
@@ -8278,8 +8315,8 @@ const COMPONENT_NAME$14 = 'Popover';
|
|
|
8278
8315
|
*/
|
|
8279
8316
|
const CLASSNAME$13 = 'lumx-popover';
|
|
8280
8317
|
const {
|
|
8281
|
-
block: block$
|
|
8282
|
-
element: element$
|
|
8318
|
+
block: block$R,
|
|
8319
|
+
element: element$G
|
|
8283
8320
|
} = bem(CLASSNAME$13);
|
|
8284
8321
|
|
|
8285
8322
|
/**
|
|
@@ -8342,7 +8379,7 @@ const Popover$1 = (props, {
|
|
|
8342
8379
|
children: /*#__PURE__*/jsxs(Component, {
|
|
8343
8380
|
...forwardedProps,
|
|
8344
8381
|
ref: ref,
|
|
8345
|
-
className: classnames(className, block$
|
|
8382
|
+
className: classnames(className, block$R({
|
|
8346
8383
|
[`theme-${theme}`]: Boolean(theme),
|
|
8347
8384
|
[`elevation-${adjustedElevation}`]: Boolean(adjustedElevation),
|
|
8348
8385
|
[`position-${position}`]: Boolean(position),
|
|
@@ -8355,7 +8392,7 @@ const Popover$1 = (props, {
|
|
|
8355
8392
|
childrenRefs: clickAwayRefs,
|
|
8356
8393
|
children: [hasArrow && /*#__PURE__*/jsx("div", {
|
|
8357
8394
|
ref: arrowRef,
|
|
8358
|
-
className: element$
|
|
8395
|
+
className: element$G('arrow'),
|
|
8359
8396
|
style: isHidden ? undefined : arrowStyle,
|
|
8360
8397
|
children: /*#__PURE__*/jsx("svg", {
|
|
8361
8398
|
viewBox: "0 0 14 14",
|
|
@@ -8821,8 +8858,8 @@ const COMPONENT_NAME$13 = 'SkeletonTypography';
|
|
|
8821
8858
|
*/
|
|
8822
8859
|
const CLASSNAME$12 = 'lumx-skeleton-typography';
|
|
8823
8860
|
const {
|
|
8824
|
-
block: block$
|
|
8825
|
-
element: element$
|
|
8861
|
+
block: block$Q,
|
|
8862
|
+
element: element$F
|
|
8826
8863
|
} = bem(CLASSNAME$12);
|
|
8827
8864
|
|
|
8828
8865
|
/**
|
|
@@ -8844,7 +8881,7 @@ const SkeletonTypography$1 = props => {
|
|
|
8844
8881
|
return /*#__PURE__*/jsx("div", {
|
|
8845
8882
|
ref: ref,
|
|
8846
8883
|
...forwardedProps,
|
|
8847
|
-
className: classnames(className, block$
|
|
8884
|
+
className: classnames(className, block$Q({
|
|
8848
8885
|
[`theme-${theme}`]: Boolean(theme),
|
|
8849
8886
|
[`typography-${typography}`]: Boolean(typography),
|
|
8850
8887
|
[`color-${color}`]: Boolean(color)
|
|
@@ -8854,7 +8891,7 @@ const SkeletonTypography$1 = props => {
|
|
|
8854
8891
|
width
|
|
8855
8892
|
},
|
|
8856
8893
|
children: /*#__PURE__*/jsx("div", {
|
|
8857
|
-
className: element$
|
|
8894
|
+
className: element$F('inner')
|
|
8858
8895
|
})
|
|
8859
8896
|
});
|
|
8860
8897
|
};
|
|
@@ -8886,9 +8923,10 @@ const ComboboxOptionSkeleton$1 = props => {
|
|
|
8886
8923
|
children,
|
|
8887
8924
|
className,
|
|
8888
8925
|
ref,
|
|
8926
|
+
count = 1,
|
|
8889
8927
|
...forwardedProps
|
|
8890
8928
|
} = props;
|
|
8891
|
-
|
|
8929
|
+
const itemProps = {
|
|
8892
8930
|
ref,
|
|
8893
8931
|
size: 'tiny',
|
|
8894
8932
|
role: 'none',
|
|
@@ -8903,6 +8941,13 @@ const ComboboxOptionSkeleton$1 = props => {
|
|
|
8903
8941
|
theme: "light"
|
|
8904
8942
|
})]
|
|
8905
8943
|
})
|
|
8944
|
+
};
|
|
8945
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
8946
|
+
children: Array.from({
|
|
8947
|
+
length: count
|
|
8948
|
+
}, (_, i) => /*#__PURE__*/jsx(ListItem$1, {
|
|
8949
|
+
...itemProps
|
|
8950
|
+
}, i))
|
|
8906
8951
|
});
|
|
8907
8952
|
};
|
|
8908
8953
|
|
|
@@ -8931,19 +8976,13 @@ const ComboboxOptionSkeleton$1 = props => {
|
|
|
8931
8976
|
* @return React element(s).
|
|
8932
8977
|
*/
|
|
8933
8978
|
const ComboboxOptionSkeleton = props => {
|
|
8934
|
-
const {
|
|
8935
|
-
count = 1,
|
|
8936
|
-
...itemProps
|
|
8937
|
-
} = props;
|
|
8938
8979
|
const {
|
|
8939
8980
|
handle
|
|
8940
8981
|
} = useComboboxContext();
|
|
8941
8982
|
useEffect(() => handle?.registerSkeleton(), [handle]);
|
|
8942
|
-
return
|
|
8943
|
-
|
|
8944
|
-
}
|
|
8945
|
-
...itemProps
|
|
8946
|
-
}, i));
|
|
8983
|
+
return /*#__PURE__*/jsx(ComboboxOptionSkeleton$1, {
|
|
8984
|
+
...props
|
|
8985
|
+
});
|
|
8947
8986
|
};
|
|
8948
8987
|
ComboboxOptionSkeleton.displayName = COMPONENT_NAME$12;
|
|
8949
8988
|
ComboboxOptionSkeleton.className = CLASSNAME$11;
|
|
@@ -8954,6 +8993,10 @@ const COMPONENT_NAME$11 = 'ComboboxPopover';
|
|
|
8954
8993
|
* Component default class name.
|
|
8955
8994
|
*/
|
|
8956
8995
|
const CLASSNAME$10 = 'lumx-combobox-popover';
|
|
8996
|
+
const {
|
|
8997
|
+
block: block$P,
|
|
8998
|
+
element: element$E
|
|
8999
|
+
} = bem(CLASSNAME$10);
|
|
8957
9000
|
|
|
8958
9001
|
/**
|
|
8959
9002
|
* Defines the props for the core ComboboxPopover template.
|
|
@@ -8975,7 +9018,8 @@ const CLASSNAME$10 = 'lumx-combobox-popover';
|
|
|
8975
9018
|
* @return JSX element.
|
|
8976
9019
|
*/
|
|
8977
9020
|
const ComboboxPopover$1 = (props, {
|
|
8978
|
-
Popover
|
|
9021
|
+
Popover,
|
|
9022
|
+
FlexBox
|
|
8979
9023
|
}) => {
|
|
8980
9024
|
const {
|
|
8981
9025
|
children,
|
|
@@ -8993,17 +9037,95 @@ const ComboboxPopover$1 = (props, {
|
|
|
8993
9037
|
...forwardedProps,
|
|
8994
9038
|
placement: placement,
|
|
8995
9039
|
fitToAnchorWidth: fitToAnchorWidth,
|
|
8996
|
-
className:
|
|
9040
|
+
className: block$P([className]),
|
|
8997
9041
|
anchorRef: anchorRef,
|
|
8998
9042
|
isOpen: isOpen,
|
|
8999
9043
|
onClose: handleClose,
|
|
9000
9044
|
closeOnClickAway: closeOnClickAway,
|
|
9001
9045
|
closeOnEscape: closeOnEscape,
|
|
9002
9046
|
closeMode: "hide",
|
|
9003
|
-
children:
|
|
9047
|
+
children: /*#__PURE__*/jsx(FlexBox, {
|
|
9048
|
+
orientation: "vertical",
|
|
9049
|
+
className: element$E('scroll'),
|
|
9050
|
+
children: children
|
|
9051
|
+
})
|
|
9004
9052
|
});
|
|
9005
9053
|
};
|
|
9006
9054
|
|
|
9055
|
+
/**
|
|
9056
|
+
* Defines the props of the component.
|
|
9057
|
+
*/
|
|
9058
|
+
|
|
9059
|
+
/**
|
|
9060
|
+
* Component display name.
|
|
9061
|
+
*/
|
|
9062
|
+
const COMPONENT_NAME$10 = 'FlexBox';
|
|
9063
|
+
|
|
9064
|
+
/**
|
|
9065
|
+
* Component default class name and class prefix.
|
|
9066
|
+
*/
|
|
9067
|
+
const CLASSNAME$$ = 'lumx-flex-box';
|
|
9068
|
+
const {
|
|
9069
|
+
block: block$O
|
|
9070
|
+
} = bem(CLASSNAME$$);
|
|
9071
|
+
|
|
9072
|
+
/**
|
|
9073
|
+
* Get FlexBox component props (className computation).
|
|
9074
|
+
*
|
|
9075
|
+
* @param props Component props.
|
|
9076
|
+
* @return Computed props with className.
|
|
9077
|
+
*/
|
|
9078
|
+
function getFlexBoxProps(props) {
|
|
9079
|
+
const {
|
|
9080
|
+
className,
|
|
9081
|
+
fillSpace,
|
|
9082
|
+
gap,
|
|
9083
|
+
hAlign,
|
|
9084
|
+
marginAuto,
|
|
9085
|
+
noShrink,
|
|
9086
|
+
vAlign,
|
|
9087
|
+
wrap,
|
|
9088
|
+
orientation,
|
|
9089
|
+
...forwardedProps
|
|
9090
|
+
} = props;
|
|
9091
|
+
const adjustedOrientation = orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null);
|
|
9092
|
+
return {
|
|
9093
|
+
...forwardedProps,
|
|
9094
|
+
className: classnames(className, block$O({
|
|
9095
|
+
[`orientation-${adjustedOrientation}`]: Boolean(adjustedOrientation),
|
|
9096
|
+
[`v-align-${vAlign}`]: Boolean(vAlign),
|
|
9097
|
+
[`h-align-${hAlign}`]: Boolean(hAlign),
|
|
9098
|
+
[`gap-${gap}`]: Boolean(gap),
|
|
9099
|
+
wrap: Boolean(wrap),
|
|
9100
|
+
'fill-space': fillSpace,
|
|
9101
|
+
'no-shrink': noShrink,
|
|
9102
|
+
...Object.fromEntries(castArray(marginAuto).filter(Boolean).map(align => [`margin-auto-${align}`, true]))
|
|
9103
|
+
}))
|
|
9104
|
+
};
|
|
9105
|
+
}
|
|
9106
|
+
|
|
9107
|
+
/**
|
|
9108
|
+
* FlexBox component.
|
|
9109
|
+
*
|
|
9110
|
+
* @param props Component props.
|
|
9111
|
+
* @param ref Component ref.
|
|
9112
|
+
* @return React element.
|
|
9113
|
+
*/
|
|
9114
|
+
const FlexBox = forwardRef((props, ref) => {
|
|
9115
|
+
const {
|
|
9116
|
+
as: Component = 'div',
|
|
9117
|
+
children,
|
|
9118
|
+
...forwardedProps
|
|
9119
|
+
} = props;
|
|
9120
|
+
return /*#__PURE__*/jsx(Component, {
|
|
9121
|
+
ref: ref,
|
|
9122
|
+
...getFlexBoxProps(forwardedProps),
|
|
9123
|
+
children: children
|
|
9124
|
+
});
|
|
9125
|
+
});
|
|
9126
|
+
FlexBox.displayName = COMPONENT_NAME$10;
|
|
9127
|
+
FlexBox.className = CLASSNAME$$;
|
|
9128
|
+
|
|
9007
9129
|
/**
|
|
9008
9130
|
* Props for Popover that can be passed to Combobox.Popover.
|
|
9009
9131
|
* Excludes isOpen, anchorRef, children, and onClose which are managed internally.
|
|
@@ -9036,7 +9158,8 @@ const ComboboxPopover = props => {
|
|
|
9036
9158
|
anchorRef: anchorRef,
|
|
9037
9159
|
handleClose: () => setIsOpen(false)
|
|
9038
9160
|
}, {
|
|
9039
|
-
Popover
|
|
9161
|
+
Popover,
|
|
9162
|
+
FlexBox
|
|
9040
9163
|
});
|
|
9041
9164
|
};
|
|
9042
9165
|
ComboboxPopover.displayName = COMPONENT_NAME$11;
|
|
@@ -9074,12 +9197,12 @@ ComboboxProvider.displayName = 'Combobox.Provider';
|
|
|
9074
9197
|
/**
|
|
9075
9198
|
* Component display name.
|
|
9076
9199
|
*/
|
|
9077
|
-
const COMPONENT_NAME
|
|
9200
|
+
const COMPONENT_NAME$$ = 'ComboboxSection';
|
|
9078
9201
|
|
|
9079
9202
|
/**
|
|
9080
9203
|
* Component default class name and class prefix.
|
|
9081
9204
|
*/
|
|
9082
|
-
const CLASSNAME
|
|
9205
|
+
const CLASSNAME$_ = 'lumx-combobox-section';
|
|
9083
9206
|
|
|
9084
9207
|
/**
|
|
9085
9208
|
* ComboboxSection core template.
|
|
@@ -9106,7 +9229,7 @@ const ComboboxSection$1 = (props, {
|
|
|
9106
9229
|
...forwardedProps,
|
|
9107
9230
|
hidden: hidden,
|
|
9108
9231
|
"aria-hidden": ariaHidden || undefined,
|
|
9109
|
-
className: !hidden ? classnames(className, CLASSNAME
|
|
9232
|
+
className: !hidden ? classnames(className, CLASSNAME$_) : undefined,
|
|
9110
9233
|
role: !ariaHidden ? 'none' : undefined,
|
|
9111
9234
|
itemsWrapperProps: {
|
|
9112
9235
|
role: 'group'
|
|
@@ -9115,365 +9238,24 @@ const ComboboxSection$1 = (props, {
|
|
|
9115
9238
|
});
|
|
9116
9239
|
};
|
|
9117
9240
|
|
|
9118
|
-
const INITIAL_INDEX = -1;
|
|
9119
|
-
|
|
9120
9241
|
/**
|
|
9121
|
-
*
|
|
9122
|
-
* a list using the keyboard.
|
|
9123
|
-
*
|
|
9124
|
-
* @param items the list of items that will be navigated using the keyboard.
|
|
9125
|
-
* @param ref A reference to the element that is controlling the navigation.
|
|
9126
|
-
* @param onListItemSelected callback to be executed when the ENTER key is pressed on an item.
|
|
9127
|
-
* @param onListItemNavigated callback to be executed when the Arrow keys are pressed.
|
|
9128
|
-
* @param onEnterPressed callback to be executed when the ENTER key is pressed.
|
|
9129
|
-
* @param onBackspacePressed callback to be executed when the BACKSPACE key is pressed.
|
|
9130
|
-
* @param keepFocusAfterSelection determines whether after selecting an item, the focus should be maintained on the current target or not.
|
|
9131
|
-
* @param initialIndex where should the navigation start from. it defaults to `-1`, so the first item navigated is the item on position `0`.
|
|
9132
|
-
* @param preventTabOnEnteredValue determines whether upon TAB, if there is a value entered, the event is prevented or not.
|
|
9133
|
-
* @return useKeyboardListNavigation helpers.
|
|
9242
|
+
* Component display name.
|
|
9134
9243
|
*/
|
|
9135
|
-
const
|
|
9136
|
-
const [activeItemIndex, setActiveItemIndex] = useState(initialIndex);
|
|
9137
|
-
|
|
9138
|
-
/**
|
|
9139
|
-
* This function calculates the next index in the list to be highlighted
|
|
9140
|
-
* @param key - key code pressed
|
|
9141
|
-
* @return next active index
|
|
9142
|
-
*/
|
|
9143
|
-
const calculateActiveIndex = key => {
|
|
9144
|
-
switch (key) {
|
|
9145
|
-
case 'ArrowDown':
|
|
9146
|
-
return activeItemIndex + 1 < items.length ? activeItemIndex + 1 : 0;
|
|
9147
|
-
case 'ArrowUp':
|
|
9148
|
-
return activeItemIndex - 1 >= 0 ? activeItemIndex - 1 : items.length - 1;
|
|
9149
|
-
default:
|
|
9150
|
-
return initialIndex;
|
|
9151
|
-
}
|
|
9152
|
-
};
|
|
9244
|
+
const COMPONENT_NAME$_ = 'ListSection';
|
|
9153
9245
|
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9246
|
+
/**
|
|
9247
|
+
* Component default class name and class prefix.
|
|
9248
|
+
*/
|
|
9249
|
+
const CLASSNAME$Z = 'lumx-list-section';
|
|
9250
|
+
const {
|
|
9251
|
+
block: block$N,
|
|
9252
|
+
element: element$D
|
|
9253
|
+
} = bem(CLASSNAME$Z);
|
|
9160
9254
|
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
const preventDefaultAndStopPropagation = evt => {
|
|
9166
|
-
evt.preventDefault();
|
|
9167
|
-
evt.stopPropagation();
|
|
9168
|
-
};
|
|
9169
|
-
|
|
9170
|
-
/**
|
|
9171
|
-
* Handles navigation with the arrows using the keyboard
|
|
9172
|
-
* @param evt - key pressed event
|
|
9173
|
-
*/
|
|
9174
|
-
const onArrowPressed = evt => {
|
|
9175
|
-
const {
|
|
9176
|
-
key
|
|
9177
|
-
} = evt;
|
|
9178
|
-
const nextActiveIndex = calculateActiveIndex(key);
|
|
9179
|
-
setActiveItemIndex(nextActiveIndex);
|
|
9180
|
-
preventDefaultAndStopPropagation(evt);
|
|
9181
|
-
if (onListItemNavigated) {
|
|
9182
|
-
const selectedItem = items[nextActiveIndex];
|
|
9183
|
-
onListItemNavigated(selectedItem);
|
|
9184
|
-
}
|
|
9185
|
-
};
|
|
9186
|
-
|
|
9187
|
-
/**
|
|
9188
|
-
* Handles the event when the backspace key is pressed
|
|
9189
|
-
* @param evt - key pressed event
|
|
9190
|
-
*/
|
|
9191
|
-
const onBackspaceKeyPressed = evt => {
|
|
9192
|
-
if (onBackspacePressed) {
|
|
9193
|
-
onBackspacePressed(evt);
|
|
9194
|
-
}
|
|
9195
|
-
};
|
|
9196
|
-
|
|
9197
|
-
/**
|
|
9198
|
-
* Handles when the ENTER key is pressed
|
|
9199
|
-
* @param evt - key pressed event
|
|
9200
|
-
*/
|
|
9201
|
-
const onEnterKeyPressed = evt => {
|
|
9202
|
-
if (!onListItemSelected) {
|
|
9203
|
-
return;
|
|
9204
|
-
}
|
|
9205
|
-
preventDefaultAndStopPropagation(evt);
|
|
9206
|
-
if (!keepFocusAfterSelection) {
|
|
9207
|
-
evt.currentTarget.blur();
|
|
9208
|
-
}
|
|
9209
|
-
const selectedItem = items[activeItemIndex];
|
|
9210
|
-
if (selectedItem) {
|
|
9211
|
-
onListItemSelected(selectedItem);
|
|
9212
|
-
resetActiveIndex();
|
|
9213
|
-
} else if (activeItemIndex === initialIndex && onEnterPressed) {
|
|
9214
|
-
const value = get(evt, 'target.value');
|
|
9215
|
-
onEnterPressed(value);
|
|
9216
|
-
resetActiveIndex();
|
|
9217
|
-
}
|
|
9218
|
-
};
|
|
9219
|
-
|
|
9220
|
-
/**
|
|
9221
|
-
* Handles when the TAB key is pressed
|
|
9222
|
-
* @param evt - key pressed event
|
|
9223
|
-
*/
|
|
9224
|
-
const onTabKeyPressed = evt => {
|
|
9225
|
-
const value = get(evt, 'target.value');
|
|
9226
|
-
if (preventTabOnEnteredValue && value && value.length > 0) {
|
|
9227
|
-
preventDefaultAndStopPropagation(evt);
|
|
9228
|
-
}
|
|
9229
|
-
};
|
|
9230
|
-
|
|
9231
|
-
/**
|
|
9232
|
-
* In order to make it easier in the future to add new events depending on the key
|
|
9233
|
-
* a map was created to add these handlers. In the future, if there is another event
|
|
9234
|
-
* that we need to manage depending on a specific key, we just need to add the key code
|
|
9235
|
-
* here, and as a value, the handler for said key.
|
|
9236
|
-
*/
|
|
9237
|
-
const eventsForKeyPressed = {
|
|
9238
|
-
ArrowDown: onArrowPressed,
|
|
9239
|
-
Tab: onTabKeyPressed,
|
|
9240
|
-
ArrowUp: onArrowPressed,
|
|
9241
|
-
Enter: onEnterKeyPressed,
|
|
9242
|
-
Backspace: onBackspaceKeyPressed
|
|
9243
|
-
};
|
|
9244
|
-
|
|
9245
|
-
/**
|
|
9246
|
-
* Calculates the next active item index depending on the key pressed.
|
|
9247
|
-
* If the key pressed was ENTER, the function executes the callback `onListItemSelected`
|
|
9248
|
-
* and resets the active index, since an item was selected.
|
|
9249
|
-
* @param evt - key pressed or key down event
|
|
9250
|
-
*/
|
|
9251
|
-
const onKeyboardNavigation = evt => {
|
|
9252
|
-
const {
|
|
9253
|
-
key
|
|
9254
|
-
} = evt;
|
|
9255
|
-
const handler = eventsForKeyPressed[key];
|
|
9256
|
-
if (handler) {
|
|
9257
|
-
handler(evt);
|
|
9258
|
-
}
|
|
9259
|
-
};
|
|
9260
|
-
useEffect(() => {
|
|
9261
|
-
const {
|
|
9262
|
-
current: currentElement
|
|
9263
|
-
} = ref;
|
|
9264
|
-
if (!currentElement) {
|
|
9265
|
-
return undefined;
|
|
9266
|
-
}
|
|
9267
|
-
currentElement.addEventListener('focus', resetActiveIndex);
|
|
9268
|
-
currentElement.addEventListener('keydown', onKeyboardNavigation);
|
|
9269
|
-
return () => {
|
|
9270
|
-
currentElement.removeEventListener('focus', resetActiveIndex);
|
|
9271
|
-
currentElement.removeEventListener('keydown', onKeyboardNavigation);
|
|
9272
|
-
};
|
|
9273
|
-
});
|
|
9274
|
-
return {
|
|
9275
|
-
activeItemIndex,
|
|
9276
|
-
onKeyboardNavigation,
|
|
9277
|
-
resetActiveIndex,
|
|
9278
|
-
setActiveItemIndex
|
|
9279
|
-
};
|
|
9280
|
-
};
|
|
9281
|
-
|
|
9282
|
-
/**
|
|
9283
|
-
* Defines the props of the component.
|
|
9284
|
-
*/
|
|
9285
|
-
|
|
9286
|
-
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
9287
|
-
/**
|
|
9288
|
-
* List component.
|
|
9289
|
-
*
|
|
9290
|
-
* @param props Component props.
|
|
9291
|
-
* @param ref Component ref.
|
|
9292
|
-
* @return React element.
|
|
9293
|
-
*/
|
|
9294
|
-
const InternalList = forwardRef((props, ref) => {
|
|
9295
|
-
const {
|
|
9296
|
-
children,
|
|
9297
|
-
isClickable,
|
|
9298
|
-
onListItemSelected,
|
|
9299
|
-
itemPadding,
|
|
9300
|
-
...forwardedProps
|
|
9301
|
-
} = props;
|
|
9302
|
-
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
9303
|
-
return List$1({
|
|
9304
|
-
...forwardedProps,
|
|
9305
|
-
ref,
|
|
9306
|
-
children,
|
|
9307
|
-
itemPadding: adjustedItemPadding
|
|
9308
|
-
});
|
|
9309
|
-
});
|
|
9310
|
-
InternalList.displayName = COMPONENT_NAME$1c;
|
|
9311
|
-
InternalList.className = CLASSNAME$1b;
|
|
9312
|
-
InternalList.defaultProps = DEFAULT_PROPS$Y;
|
|
9313
|
-
const List = Object.assign(InternalList, {
|
|
9314
|
-
useKeyboardListNavigation
|
|
9315
|
-
});
|
|
9316
|
-
|
|
9317
|
-
/**
|
|
9318
|
-
* ListItem.Action props.
|
|
9319
|
-
*/
|
|
9320
|
-
|
|
9321
|
-
/**
|
|
9322
|
-
* ListItem.Action sub-component.
|
|
9323
|
-
*
|
|
9324
|
-
* Renders a button or link with action area classes.
|
|
9325
|
-
* When placed as a child of ListItem, it activates the action area pattern:
|
|
9326
|
-
* the entire list item becomes visually clickable, while other interactive
|
|
9327
|
-
* elements (in `before`/`after` slots) remain independently clickable.
|
|
9328
|
-
*
|
|
9329
|
-
* @param props Component props.
|
|
9330
|
-
* @param ref Component ref.
|
|
9331
|
-
* @return React element.
|
|
9332
|
-
*/
|
|
9333
|
-
const ListItemAction = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
9334
|
-
const {
|
|
9335
|
-
children,
|
|
9336
|
-
onClick,
|
|
9337
|
-
...forwardedProps
|
|
9338
|
-
} = props;
|
|
9339
|
-
return ListItemAction$1({
|
|
9340
|
-
...forwardedProps,
|
|
9341
|
-
handleClick: onClick,
|
|
9342
|
-
ref,
|
|
9343
|
-
children
|
|
9344
|
-
});
|
|
9345
|
-
}), {
|
|
9346
|
-
displayName: COMPONENT_NAME$19,
|
|
9347
|
-
className: CLASSNAME$18,
|
|
9348
|
-
defaultProps: DEFAULT_PROPS$W
|
|
9349
|
-
});
|
|
9350
|
-
|
|
9351
|
-
/**
|
|
9352
|
-
* Defines the props of the component.
|
|
9353
|
-
*/
|
|
9354
|
-
|
|
9355
|
-
/**
|
|
9356
|
-
* ListItem component.
|
|
9357
|
-
*
|
|
9358
|
-
* @param props Component props.
|
|
9359
|
-
* @param ref Component ref.
|
|
9360
|
-
* @return React element.
|
|
9361
|
-
*/
|
|
9362
|
-
const _ListItem = forwardRef((props, ref) => {
|
|
9363
|
-
const {
|
|
9364
|
-
disabledStateProps,
|
|
9365
|
-
otherProps
|
|
9366
|
-
} = useDisableStateProps(props);
|
|
9367
|
-
const {
|
|
9368
|
-
onItemSelected,
|
|
9369
|
-
onClick,
|
|
9370
|
-
linkRef,
|
|
9371
|
-
...forwardedProps
|
|
9372
|
-
} = otherProps;
|
|
9373
|
-
const handleClick = event => {
|
|
9374
|
-
onItemSelected?.(event);
|
|
9375
|
-
onClick?.(event);
|
|
9376
|
-
};
|
|
9377
|
-
return ListItem$1({
|
|
9378
|
-
...forwardedProps,
|
|
9379
|
-
isDisabled: disabledStateProps.disabled,
|
|
9380
|
-
'aria-disabled': disabledStateProps['aria-disabled'],
|
|
9381
|
-
ref,
|
|
9382
|
-
linkRef,
|
|
9383
|
-
handleClick: onItemSelected || props.onClick ? handleClick : undefined
|
|
9384
|
-
});
|
|
9385
|
-
});
|
|
9386
|
-
_ListItem.displayName = COMPONENT_NAME$1a;
|
|
9387
|
-
_ListItem.className = CLASSNAME$19;
|
|
9388
|
-
_ListItem.defaultProps = DEFAULT_PROPS$X;
|
|
9389
|
-
|
|
9390
|
-
/**
|
|
9391
|
-
* ListItem component with Action sub-component.
|
|
9392
|
-
*/
|
|
9393
|
-
const ListItem = Object.assign(_ListItem, {
|
|
9394
|
-
/** Sub-component that renders the default action (button or link) for the action area pattern. */
|
|
9395
|
-
Action: ListItemAction
|
|
9396
|
-
});
|
|
9397
|
-
|
|
9398
|
-
/**
|
|
9399
|
-
* Component display name.
|
|
9400
|
-
*/
|
|
9401
|
-
const COMPONENT_NAME$$ = 'ListDivider';
|
|
9402
|
-
|
|
9403
|
-
/**
|
|
9404
|
-
* Component default class name and class prefix.
|
|
9405
|
-
*/
|
|
9406
|
-
const CLASSNAME$_ = 'lumx-list-divider';
|
|
9407
|
-
|
|
9408
|
-
/**
|
|
9409
|
-
* Component default props.
|
|
9410
|
-
*/
|
|
9411
|
-
const DEFAULT_PROPS$T = {};
|
|
9412
|
-
|
|
9413
|
-
/**
|
|
9414
|
-
* ListDivider component.
|
|
9415
|
-
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9416
|
-
*
|
|
9417
|
-
* @param props Component props.
|
|
9418
|
-
* @return JSX element.
|
|
9419
|
-
*/
|
|
9420
|
-
const ListDivider$1 = props => {
|
|
9421
|
-
const {
|
|
9422
|
-
className,
|
|
9423
|
-
ref,
|
|
9424
|
-
...forwardedProps
|
|
9425
|
-
} = props;
|
|
9426
|
-
return /*#__PURE__*/jsx("li", {
|
|
9427
|
-
ref: ref,
|
|
9428
|
-
role: "none",
|
|
9429
|
-
...forwardedProps,
|
|
9430
|
-
className: classnames(className, CLASSNAME$_)
|
|
9431
|
-
});
|
|
9432
|
-
};
|
|
9433
|
-
ListDivider$1.displayName = COMPONENT_NAME$$;
|
|
9434
|
-
ListDivider$1.className = CLASSNAME$_;
|
|
9435
|
-
ListDivider$1.defaultProps = DEFAULT_PROPS$T;
|
|
9436
|
-
|
|
9437
|
-
/**
|
|
9438
|
-
* Defines the props of the component.
|
|
9439
|
-
*/
|
|
9440
|
-
|
|
9441
|
-
/**
|
|
9442
|
-
* ListDivider component.
|
|
9443
|
-
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9444
|
-
*
|
|
9445
|
-
* @param props Component props.
|
|
9446
|
-
* @param ref Component ref.
|
|
9447
|
-
* @return React element.
|
|
9448
|
-
*/
|
|
9449
|
-
const ListDivider = forwardRef((props, ref) => {
|
|
9450
|
-
return ListDivider$1({
|
|
9451
|
-
...props,
|
|
9452
|
-
ref
|
|
9453
|
-
});
|
|
9454
|
-
});
|
|
9455
|
-
ListDivider.displayName = COMPONENT_NAME$$;
|
|
9456
|
-
ListDivider.className = CLASSNAME$_;
|
|
9457
|
-
ListDivider.defaultProps = DEFAULT_PROPS$T;
|
|
9458
|
-
|
|
9459
|
-
/**
|
|
9460
|
-
* Component display name.
|
|
9461
|
-
*/
|
|
9462
|
-
const COMPONENT_NAME$_ = 'ListSection';
|
|
9463
|
-
|
|
9464
|
-
/**
|
|
9465
|
-
* Component default class name and class prefix.
|
|
9466
|
-
*/
|
|
9467
|
-
const CLASSNAME$Z = 'lumx-list-section';
|
|
9468
|
-
const {
|
|
9469
|
-
block: block$O,
|
|
9470
|
-
element: element$D
|
|
9471
|
-
} = bem(CLASSNAME$Z);
|
|
9472
|
-
|
|
9473
|
-
/**
|
|
9474
|
-
* Component default props.
|
|
9475
|
-
*/
|
|
9476
|
-
const DEFAULT_PROPS$S = {};
|
|
9255
|
+
/**
|
|
9256
|
+
* Component default props.
|
|
9257
|
+
*/
|
|
9258
|
+
const DEFAULT_PROPS$T = {};
|
|
9477
9259
|
|
|
9478
9260
|
/**
|
|
9479
9261
|
* ListSection component.
|
|
@@ -9498,7 +9280,7 @@ const ListSection$1 = props => {
|
|
|
9498
9280
|
return /*#__PURE__*/jsxs("li", {
|
|
9499
9281
|
ref: ref,
|
|
9500
9282
|
...forwardedProps,
|
|
9501
|
-
className: classnames(className, block$
|
|
9283
|
+
className: classnames(className, block$N()),
|
|
9502
9284
|
children: [hasHeader && /*#__PURE__*/jsxs(Text, {
|
|
9503
9285
|
as: "p",
|
|
9504
9286
|
typography: "overline",
|
|
@@ -9513,69 +9295,35 @@ const ListSection$1 = props => {
|
|
|
9513
9295
|
"aria-labelledby": hasHeader ? labelId : undefined,
|
|
9514
9296
|
children: children
|
|
9515
9297
|
})]
|
|
9516
|
-
});
|
|
9517
|
-
};
|
|
9518
|
-
ListSection$1.displayName = COMPONENT_NAME$_;
|
|
9519
|
-
ListSection$1.className = CLASSNAME$Z;
|
|
9520
|
-
ListSection$1.defaultProps = DEFAULT_PROPS$
|
|
9521
|
-
|
|
9522
|
-
/**
|
|
9523
|
-
* Defines the props of the component.
|
|
9524
|
-
*/
|
|
9525
|
-
|
|
9526
|
-
/**
|
|
9527
|
-
* ListSection component.
|
|
9528
|
-
*
|
|
9529
|
-
* @param props Component props.
|
|
9530
|
-
* @param ref Component ref.
|
|
9531
|
-
* @return React element.
|
|
9532
|
-
*/
|
|
9533
|
-
const ListSection = forwardRef((props, ref) => {
|
|
9534
|
-
const id = useId();
|
|
9535
|
-
return ListSection$1({
|
|
9536
|
-
...props,
|
|
9537
|
-
ref,
|
|
9538
|
-
id,
|
|
9539
|
-
Text
|
|
9540
|
-
});
|
|
9541
|
-
});
|
|
9542
|
-
ListSection.displayName = COMPONENT_NAME$_;
|
|
9543
|
-
ListSection.className = CLASSNAME$Z;
|
|
9544
|
-
ListSection.defaultProps = DEFAULT_PROPS$S;
|
|
9545
|
-
|
|
9546
|
-
/**
|
|
9547
|
-
* Component display name.
|
|
9548
|
-
*/
|
|
9549
|
-
const COMPONENT_NAME$Z = 'ListSubheader';
|
|
9298
|
+
});
|
|
9299
|
+
};
|
|
9300
|
+
ListSection$1.displayName = COMPONENT_NAME$_;
|
|
9301
|
+
ListSection$1.className = CLASSNAME$Z;
|
|
9302
|
+
ListSection$1.defaultProps = DEFAULT_PROPS$T;
|
|
9550
9303
|
|
|
9551
9304
|
/**
|
|
9552
|
-
*
|
|
9305
|
+
* Defines the props of the component.
|
|
9553
9306
|
*/
|
|
9554
|
-
const CLASSNAME$Y = 'lumx-list-subheader';
|
|
9555
9307
|
|
|
9556
9308
|
/**
|
|
9557
|
-
*
|
|
9558
|
-
* @deprecated ListSubheader produces improper list structure. use ListSection instead.
|
|
9309
|
+
* ListSection component.
|
|
9559
9310
|
*
|
|
9560
9311
|
* @param props Component props.
|
|
9561
9312
|
* @param ref Component ref.
|
|
9562
9313
|
* @return React element.
|
|
9563
9314
|
*/
|
|
9564
|
-
const
|
|
9565
|
-
const
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
ref: ref,
|
|
9572
|
-
...forwardedProps,
|
|
9573
|
-
className: classNames.join(className, CLASSNAME$Y),
|
|
9574
|
-
children: children
|
|
9315
|
+
const ListSection = forwardRef((props, ref) => {
|
|
9316
|
+
const id = useId();
|
|
9317
|
+
return ListSection$1({
|
|
9318
|
+
...props,
|
|
9319
|
+
ref,
|
|
9320
|
+
id,
|
|
9321
|
+
Text
|
|
9575
9322
|
});
|
|
9576
9323
|
});
|
|
9577
|
-
|
|
9578
|
-
|
|
9324
|
+
ListSection.displayName = COMPONENT_NAME$_;
|
|
9325
|
+
ListSection.className = CLASSNAME$Z;
|
|
9326
|
+
ListSection.defaultProps = DEFAULT_PROPS$T;
|
|
9579
9327
|
|
|
9580
9328
|
/**
|
|
9581
9329
|
* Props for Combobox.Section component.
|
|
@@ -9623,21 +9371,21 @@ const ComboboxSection = forwardRef((props, ref) => {
|
|
|
9623
9371
|
ListSection
|
|
9624
9372
|
});
|
|
9625
9373
|
});
|
|
9626
|
-
ComboboxSection.displayName = COMPONENT_NAME
|
|
9627
|
-
ComboboxSection.className = CLASSNAME
|
|
9374
|
+
ComboboxSection.displayName = COMPONENT_NAME$$;
|
|
9375
|
+
ComboboxSection.className = CLASSNAME$_;
|
|
9628
9376
|
|
|
9629
9377
|
/**
|
|
9630
9378
|
* Component display name.
|
|
9631
9379
|
*/
|
|
9632
|
-
const COMPONENT_NAME$
|
|
9380
|
+
const COMPONENT_NAME$Z = 'ComboboxState';
|
|
9633
9381
|
|
|
9634
9382
|
/**
|
|
9635
9383
|
* Component default class name and class prefix.
|
|
9636
9384
|
*/
|
|
9637
|
-
const CLASSNAME$
|
|
9385
|
+
const CLASSNAME$Y = 'lumx-combobox-state';
|
|
9638
9386
|
const {
|
|
9639
|
-
block: block$
|
|
9640
|
-
} = bem(CLASSNAME$
|
|
9387
|
+
block: block$M
|
|
9388
|
+
} = bem(CLASSNAME$Y);
|
|
9641
9389
|
|
|
9642
9390
|
/**
|
|
9643
9391
|
* Defines the props for the core ComboboxState template.
|
|
@@ -9692,7 +9440,7 @@ const ComboboxState$1 = (props, {
|
|
|
9692
9440
|
// the popover's closeMode="hide") and revealing it doesn't trigger announcements.
|
|
9693
9441
|
const renderContent = isOpen;
|
|
9694
9442
|
return /*#__PURE__*/jsxs(GenericBlock, {
|
|
9695
|
-
className: classnames(!show && visuallyHidden(), block$
|
|
9443
|
+
className: classnames(!show && visuallyHidden(), block$M(), padding('regular')),
|
|
9696
9444
|
orientation: "vertical",
|
|
9697
9445
|
...alignProps,
|
|
9698
9446
|
role: "status",
|
|
@@ -9799,21 +9547,21 @@ function partitionMulti(elements, predicates) {
|
|
|
9799
9547
|
/**
|
|
9800
9548
|
* Component display name.
|
|
9801
9549
|
*/
|
|
9802
|
-
const COMPONENT_NAME$
|
|
9550
|
+
const COMPONENT_NAME$Y = 'GenericBlock';
|
|
9803
9551
|
|
|
9804
9552
|
/**
|
|
9805
9553
|
* Component default class name and class prefix.
|
|
9806
9554
|
*/
|
|
9807
|
-
const CLASSNAME$
|
|
9555
|
+
const CLASSNAME$X = 'lumx-generic-block';
|
|
9808
9556
|
const {
|
|
9809
|
-
block: block$
|
|
9557
|
+
block: block$L,
|
|
9810
9558
|
element: element$C
|
|
9811
|
-
} = bem(CLASSNAME$
|
|
9559
|
+
} = bem(CLASSNAME$X);
|
|
9812
9560
|
|
|
9813
9561
|
/**
|
|
9814
9562
|
* Component default props.
|
|
9815
9563
|
*/
|
|
9816
|
-
const DEFAULT_PROPS$
|
|
9564
|
+
const DEFAULT_PROPS$S = {
|
|
9817
9565
|
gap: Size.big,
|
|
9818
9566
|
orientation: Orientation.horizontal
|
|
9819
9567
|
};
|
|
@@ -9837,17 +9585,17 @@ const GenericBlock$1 = props => {
|
|
|
9837
9585
|
children,
|
|
9838
9586
|
actions,
|
|
9839
9587
|
actionsProps,
|
|
9840
|
-
gap = DEFAULT_PROPS$
|
|
9588
|
+
gap = DEFAULT_PROPS$S.gap,
|
|
9841
9589
|
ref,
|
|
9842
9590
|
content,
|
|
9843
|
-
orientation = DEFAULT_PROPS$
|
|
9591
|
+
orientation = DEFAULT_PROPS$S.orientation,
|
|
9844
9592
|
contentProps,
|
|
9845
9593
|
FlexBox,
|
|
9846
9594
|
...forwardedProps
|
|
9847
9595
|
} = props;
|
|
9848
9596
|
return /*#__PURE__*/jsxs(FlexBox, {
|
|
9849
9597
|
ref: ref,
|
|
9850
|
-
className: classnames(className, block$
|
|
9598
|
+
className: classnames(className, block$L()),
|
|
9851
9599
|
gap: gap,
|
|
9852
9600
|
orientation: orientation,
|
|
9853
9601
|
...forwardedProps,
|
|
@@ -9950,9 +9698,9 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
9950
9698
|
}) : undefined
|
|
9951
9699
|
});
|
|
9952
9700
|
});
|
|
9953
|
-
BaseGenericBlock.displayName = COMPONENT_NAME$
|
|
9954
|
-
BaseGenericBlock.className = CLASSNAME$
|
|
9955
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS$
|
|
9701
|
+
BaseGenericBlock.displayName = COMPONENT_NAME$Y;
|
|
9702
|
+
BaseGenericBlock.className = CLASSNAME$X;
|
|
9703
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS$S;
|
|
9956
9704
|
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
9957
9705
|
Figure,
|
|
9958
9706
|
Content,
|
|
@@ -10110,8 +9858,69 @@ const ComboboxState = props => {
|
|
|
10110
9858
|
Text
|
|
10111
9859
|
});
|
|
10112
9860
|
};
|
|
10113
|
-
ComboboxState.displayName = COMPONENT_NAME$
|
|
10114
|
-
ComboboxState.className = CLASSNAME$
|
|
9861
|
+
ComboboxState.displayName = COMPONENT_NAME$Z;
|
|
9862
|
+
ComboboxState.className = CLASSNAME$Y;
|
|
9863
|
+
|
|
9864
|
+
/**
|
|
9865
|
+
* Component display name.
|
|
9866
|
+
*/
|
|
9867
|
+
const COMPONENT_NAME$X = 'ListDivider';
|
|
9868
|
+
|
|
9869
|
+
/**
|
|
9870
|
+
* Component default class name and class prefix.
|
|
9871
|
+
*/
|
|
9872
|
+
const CLASSNAME$W = 'lumx-list-divider';
|
|
9873
|
+
|
|
9874
|
+
/**
|
|
9875
|
+
* Component default props.
|
|
9876
|
+
*/
|
|
9877
|
+
const DEFAULT_PROPS$R = {};
|
|
9878
|
+
|
|
9879
|
+
/**
|
|
9880
|
+
* ListDivider component.
|
|
9881
|
+
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9882
|
+
*
|
|
9883
|
+
* @param props Component props.
|
|
9884
|
+
* @return JSX element.
|
|
9885
|
+
*/
|
|
9886
|
+
const ListDivider$1 = props => {
|
|
9887
|
+
const {
|
|
9888
|
+
className,
|
|
9889
|
+
ref,
|
|
9890
|
+
...forwardedProps
|
|
9891
|
+
} = props;
|
|
9892
|
+
return /*#__PURE__*/jsx("li", {
|
|
9893
|
+
ref: ref,
|
|
9894
|
+
role: "none",
|
|
9895
|
+
...forwardedProps,
|
|
9896
|
+
className: classnames(className, CLASSNAME$W)
|
|
9897
|
+
});
|
|
9898
|
+
};
|
|
9899
|
+
ListDivider$1.displayName = COMPONENT_NAME$X;
|
|
9900
|
+
ListDivider$1.className = CLASSNAME$W;
|
|
9901
|
+
ListDivider$1.defaultProps = DEFAULT_PROPS$R;
|
|
9902
|
+
|
|
9903
|
+
/**
|
|
9904
|
+
* Defines the props of the component.
|
|
9905
|
+
*/
|
|
9906
|
+
|
|
9907
|
+
/**
|
|
9908
|
+
* ListDivider component.
|
|
9909
|
+
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9910
|
+
*
|
|
9911
|
+
* @param props Component props.
|
|
9912
|
+
* @param ref Component ref.
|
|
9913
|
+
* @return React element.
|
|
9914
|
+
*/
|
|
9915
|
+
const ListDivider = forwardRef((props, ref) => {
|
|
9916
|
+
return ListDivider$1({
|
|
9917
|
+
...props,
|
|
9918
|
+
ref
|
|
9919
|
+
});
|
|
9920
|
+
});
|
|
9921
|
+
ListDivider.displayName = COMPONENT_NAME$X;
|
|
9922
|
+
ListDivider.className = CLASSNAME$W;
|
|
9923
|
+
ListDivider.defaultProps = DEFAULT_PROPS$R;
|
|
10115
9924
|
|
|
10116
9925
|
/**
|
|
10117
9926
|
* Combobox compound component namespace.
|
|
@@ -10167,7 +9976,7 @@ const COMPONENT_NAME$W = 'CommentBlock';
|
|
|
10167
9976
|
*/
|
|
10168
9977
|
const CLASSNAME$V = 'lumx-comment-block';
|
|
10169
9978
|
const {
|
|
10170
|
-
block: block$
|
|
9979
|
+
block: block$K,
|
|
10171
9980
|
element: element$B
|
|
10172
9981
|
} = classNames.bem(CLASSNAME$V);
|
|
10173
9982
|
|
|
@@ -10210,7 +10019,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
10210
10019
|
const hasChildren = Children.count(children) > 0;
|
|
10211
10020
|
return /*#__PURE__*/jsxs("div", {
|
|
10212
10021
|
ref: ref,
|
|
10213
|
-
className: classNames.join(className, block$
|
|
10022
|
+
className: classNames.join(className, block$K({
|
|
10214
10023
|
'has-children': hasChildren && isOpen,
|
|
10215
10024
|
'has-indented-children': hasChildren && variant === CommentBlockVariant.indented,
|
|
10216
10025
|
'has-linear-children': hasChildren && variant === CommentBlockVariant.linear,
|
|
@@ -11169,7 +10978,7 @@ const COMPONENT_NAME$S = 'Dialog';
|
|
|
11169
10978
|
*/
|
|
11170
10979
|
const CLASSNAME$T = 'lumx-dialog';
|
|
11171
10980
|
const {
|
|
11172
|
-
block: block$
|
|
10981
|
+
block: block$J,
|
|
11173
10982
|
element: element$z
|
|
11174
10983
|
} = classNames.bem(CLASSNAME$T);
|
|
11175
10984
|
|
|
@@ -11285,7 +11094,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
11285
11094
|
children: /*#__PURE__*/jsxs("div", {
|
|
11286
11095
|
ref: mergeRefs(rootRef, ref),
|
|
11287
11096
|
...forwardedProps,
|
|
11288
|
-
className: classNames.join(className, block$
|
|
11097
|
+
className: classNames.join(className, block$J({
|
|
11289
11098
|
'is-hidden': !isOpen,
|
|
11290
11099
|
'is-loading': isLoading,
|
|
11291
11100
|
'is-shown': isOpen || isVisible,
|
|
@@ -11366,7 +11175,7 @@ const COMPONENT_NAME$R = 'Divider';
|
|
|
11366
11175
|
*/
|
|
11367
11176
|
const CLASSNAME$S = 'lumx-divider';
|
|
11368
11177
|
const {
|
|
11369
|
-
block: block$
|
|
11178
|
+
block: block$I
|
|
11370
11179
|
} = bem(CLASSNAME$S);
|
|
11371
11180
|
|
|
11372
11181
|
/**
|
|
@@ -11385,7 +11194,7 @@ const Divider$1 = props => {
|
|
|
11385
11194
|
return /*#__PURE__*/jsx("hr", {
|
|
11386
11195
|
ref: ref,
|
|
11387
11196
|
...forwardedProps,
|
|
11388
|
-
className: classnames(className, block$
|
|
11197
|
+
className: classnames(className, block$I({
|
|
11389
11198
|
[`theme-${theme}`]: Boolean(theme)
|
|
11390
11199
|
}))
|
|
11391
11200
|
});
|
|
@@ -11433,7 +11242,7 @@ const COMPONENT_NAME$Q = 'DragHandle';
|
|
|
11433
11242
|
*/
|
|
11434
11243
|
const CLASSNAME$R = 'lumx-drag-handle';
|
|
11435
11244
|
const {
|
|
11436
|
-
block: block$
|
|
11245
|
+
block: block$H
|
|
11437
11246
|
} = bem(CLASSNAME$R);
|
|
11438
11247
|
|
|
11439
11248
|
/**
|
|
@@ -11452,7 +11261,7 @@ const DragHandle$1 = props => {
|
|
|
11452
11261
|
return /*#__PURE__*/jsx("div", {
|
|
11453
11262
|
ref: ref,
|
|
11454
11263
|
...forwardedProps,
|
|
11455
|
-
className: classnames(className, block$
|
|
11264
|
+
className: classnames(className, block$H({
|
|
11456
11265
|
[`theme-${theme}`]: Boolean(theme)
|
|
11457
11266
|
})),
|
|
11458
11267
|
children: Icon$1({
|
|
@@ -11468,32 +11277,231 @@ const DragHandle$1 = props => {
|
|
|
11468
11277
|
*/
|
|
11469
11278
|
|
|
11470
11279
|
/**
|
|
11471
|
-
* Component default props.
|
|
11472
|
-
*/
|
|
11473
|
-
const DEFAULT_PROPS$N = {};
|
|
11474
|
-
|
|
11475
|
-
/**
|
|
11476
|
-
* DragHandle component.
|
|
11280
|
+
* Component default props.
|
|
11281
|
+
*/
|
|
11282
|
+
const DEFAULT_PROPS$N = {};
|
|
11283
|
+
|
|
11284
|
+
/**
|
|
11285
|
+
* DragHandle component.
|
|
11286
|
+
*
|
|
11287
|
+
* @param props Component props.
|
|
11288
|
+
* @param ref Component ref.
|
|
11289
|
+
* @return React element.
|
|
11290
|
+
*/
|
|
11291
|
+
const DragHandle = forwardRef((props, ref) => {
|
|
11292
|
+
const defaultTheme = useTheme();
|
|
11293
|
+
const {
|
|
11294
|
+
theme = defaultTheme,
|
|
11295
|
+
...otherProps
|
|
11296
|
+
} = props;
|
|
11297
|
+
return DragHandle$1({
|
|
11298
|
+
ref,
|
|
11299
|
+
theme,
|
|
11300
|
+
...otherProps
|
|
11301
|
+
});
|
|
11302
|
+
});
|
|
11303
|
+
DragHandle.displayName = COMPONENT_NAME$Q;
|
|
11304
|
+
DragHandle.className = CLASSNAME$R;
|
|
11305
|
+
DragHandle.defaultProps = DEFAULT_PROPS$N;
|
|
11306
|
+
|
|
11307
|
+
const INITIAL_INDEX = -1;
|
|
11308
|
+
|
|
11309
|
+
/**
|
|
11310
|
+
* This custom hook provides the necessary set of functions and values to properly navigate
|
|
11311
|
+
* a list using the keyboard.
|
|
11312
|
+
*
|
|
11313
|
+
* @param items the list of items that will be navigated using the keyboard.
|
|
11314
|
+
* @param ref A reference to the element that is controlling the navigation.
|
|
11315
|
+
* @param onListItemSelected callback to be executed when the ENTER key is pressed on an item.
|
|
11316
|
+
* @param onListItemNavigated callback to be executed when the Arrow keys are pressed.
|
|
11317
|
+
* @param onEnterPressed callback to be executed when the ENTER key is pressed.
|
|
11318
|
+
* @param onBackspacePressed callback to be executed when the BACKSPACE key is pressed.
|
|
11319
|
+
* @param keepFocusAfterSelection determines whether after selecting an item, the focus should be maintained on the current target or not.
|
|
11320
|
+
* @param initialIndex where should the navigation start from. it defaults to `-1`, so the first item navigated is the item on position `0`.
|
|
11321
|
+
* @param preventTabOnEnteredValue determines whether upon TAB, if there is a value entered, the event is prevented or not.
|
|
11322
|
+
* @return useKeyboardListNavigation helpers.
|
|
11323
|
+
*/
|
|
11324
|
+
const useKeyboardListNavigation = (items, ref, onListItemSelected, onListItemNavigated, onEnterPressed, onBackspacePressed, keepFocusAfterSelection = false, initialIndex = INITIAL_INDEX, preventTabOnEnteredValue = true) => {
|
|
11325
|
+
const [activeItemIndex, setActiveItemIndex] = useState(initialIndex);
|
|
11326
|
+
|
|
11327
|
+
/**
|
|
11328
|
+
* This function calculates the next index in the list to be highlighted
|
|
11329
|
+
* @param key - key code pressed
|
|
11330
|
+
* @return next active index
|
|
11331
|
+
*/
|
|
11332
|
+
const calculateActiveIndex = key => {
|
|
11333
|
+
switch (key) {
|
|
11334
|
+
case 'ArrowDown':
|
|
11335
|
+
return activeItemIndex + 1 < items.length ? activeItemIndex + 1 : 0;
|
|
11336
|
+
case 'ArrowUp':
|
|
11337
|
+
return activeItemIndex - 1 >= 0 ? activeItemIndex - 1 : items.length - 1;
|
|
11338
|
+
default:
|
|
11339
|
+
return initialIndex;
|
|
11340
|
+
}
|
|
11341
|
+
};
|
|
11342
|
+
|
|
11343
|
+
/**
|
|
11344
|
+
* Resets the active index to the initial state
|
|
11345
|
+
*/
|
|
11346
|
+
const resetActiveIndex = () => {
|
|
11347
|
+
setActiveItemIndex(initialIndex);
|
|
11348
|
+
};
|
|
11349
|
+
|
|
11350
|
+
/**
|
|
11351
|
+
* Prevents the default event and stops the propagation of said event
|
|
11352
|
+
* @param evt - key pressed event
|
|
11353
|
+
*/
|
|
11354
|
+
const preventDefaultAndStopPropagation = evt => {
|
|
11355
|
+
evt.preventDefault();
|
|
11356
|
+
evt.stopPropagation();
|
|
11357
|
+
};
|
|
11358
|
+
|
|
11359
|
+
/**
|
|
11360
|
+
* Handles navigation with the arrows using the keyboard
|
|
11361
|
+
* @param evt - key pressed event
|
|
11362
|
+
*/
|
|
11363
|
+
const onArrowPressed = evt => {
|
|
11364
|
+
const {
|
|
11365
|
+
key
|
|
11366
|
+
} = evt;
|
|
11367
|
+
const nextActiveIndex = calculateActiveIndex(key);
|
|
11368
|
+
setActiveItemIndex(nextActiveIndex);
|
|
11369
|
+
preventDefaultAndStopPropagation(evt);
|
|
11370
|
+
if (onListItemNavigated) {
|
|
11371
|
+
const selectedItem = items[nextActiveIndex];
|
|
11372
|
+
onListItemNavigated(selectedItem);
|
|
11373
|
+
}
|
|
11374
|
+
};
|
|
11375
|
+
|
|
11376
|
+
/**
|
|
11377
|
+
* Handles the event when the backspace key is pressed
|
|
11378
|
+
* @param evt - key pressed event
|
|
11379
|
+
*/
|
|
11380
|
+
const onBackspaceKeyPressed = evt => {
|
|
11381
|
+
if (onBackspacePressed) {
|
|
11382
|
+
onBackspacePressed(evt);
|
|
11383
|
+
}
|
|
11384
|
+
};
|
|
11385
|
+
|
|
11386
|
+
/**
|
|
11387
|
+
* Handles when the ENTER key is pressed
|
|
11388
|
+
* @param evt - key pressed event
|
|
11389
|
+
*/
|
|
11390
|
+
const onEnterKeyPressed = evt => {
|
|
11391
|
+
if (!onListItemSelected) {
|
|
11392
|
+
return;
|
|
11393
|
+
}
|
|
11394
|
+
preventDefaultAndStopPropagation(evt);
|
|
11395
|
+
if (!keepFocusAfterSelection) {
|
|
11396
|
+
evt.currentTarget.blur();
|
|
11397
|
+
}
|
|
11398
|
+
const selectedItem = items[activeItemIndex];
|
|
11399
|
+
if (selectedItem) {
|
|
11400
|
+
onListItemSelected(selectedItem);
|
|
11401
|
+
resetActiveIndex();
|
|
11402
|
+
} else if (activeItemIndex === initialIndex && onEnterPressed) {
|
|
11403
|
+
const value = get(evt, 'target.value');
|
|
11404
|
+
onEnterPressed(value);
|
|
11405
|
+
resetActiveIndex();
|
|
11406
|
+
}
|
|
11407
|
+
};
|
|
11408
|
+
|
|
11409
|
+
/**
|
|
11410
|
+
* Handles when the TAB key is pressed
|
|
11411
|
+
* @param evt - key pressed event
|
|
11412
|
+
*/
|
|
11413
|
+
const onTabKeyPressed = evt => {
|
|
11414
|
+
const value = get(evt, 'target.value');
|
|
11415
|
+
if (preventTabOnEnteredValue && value && value.length > 0) {
|
|
11416
|
+
preventDefaultAndStopPropagation(evt);
|
|
11417
|
+
}
|
|
11418
|
+
};
|
|
11419
|
+
|
|
11420
|
+
/**
|
|
11421
|
+
* In order to make it easier in the future to add new events depending on the key
|
|
11422
|
+
* a map was created to add these handlers. In the future, if there is another event
|
|
11423
|
+
* that we need to manage depending on a specific key, we just need to add the key code
|
|
11424
|
+
* here, and as a value, the handler for said key.
|
|
11425
|
+
*/
|
|
11426
|
+
const eventsForKeyPressed = {
|
|
11427
|
+
ArrowDown: onArrowPressed,
|
|
11428
|
+
Tab: onTabKeyPressed,
|
|
11429
|
+
ArrowUp: onArrowPressed,
|
|
11430
|
+
Enter: onEnterKeyPressed,
|
|
11431
|
+
Backspace: onBackspaceKeyPressed
|
|
11432
|
+
};
|
|
11433
|
+
|
|
11434
|
+
/**
|
|
11435
|
+
* Calculates the next active item index depending on the key pressed.
|
|
11436
|
+
* If the key pressed was ENTER, the function executes the callback `onListItemSelected`
|
|
11437
|
+
* and resets the active index, since an item was selected.
|
|
11438
|
+
* @param evt - key pressed or key down event
|
|
11439
|
+
*/
|
|
11440
|
+
const onKeyboardNavigation = evt => {
|
|
11441
|
+
const {
|
|
11442
|
+
key
|
|
11443
|
+
} = evt;
|
|
11444
|
+
const handler = eventsForKeyPressed[key];
|
|
11445
|
+
if (handler) {
|
|
11446
|
+
handler(evt);
|
|
11447
|
+
}
|
|
11448
|
+
};
|
|
11449
|
+
useEffect(() => {
|
|
11450
|
+
const {
|
|
11451
|
+
current: currentElement
|
|
11452
|
+
} = ref;
|
|
11453
|
+
if (!currentElement) {
|
|
11454
|
+
return undefined;
|
|
11455
|
+
}
|
|
11456
|
+
currentElement.addEventListener('focus', resetActiveIndex);
|
|
11457
|
+
currentElement.addEventListener('keydown', onKeyboardNavigation);
|
|
11458
|
+
return () => {
|
|
11459
|
+
currentElement.removeEventListener('focus', resetActiveIndex);
|
|
11460
|
+
currentElement.removeEventListener('keydown', onKeyboardNavigation);
|
|
11461
|
+
};
|
|
11462
|
+
});
|
|
11463
|
+
return {
|
|
11464
|
+
activeItemIndex,
|
|
11465
|
+
onKeyboardNavigation,
|
|
11466
|
+
resetActiveIndex,
|
|
11467
|
+
setActiveItemIndex
|
|
11468
|
+
};
|
|
11469
|
+
};
|
|
11470
|
+
|
|
11471
|
+
/**
|
|
11472
|
+
* Defines the props of the component.
|
|
11473
|
+
*/
|
|
11474
|
+
|
|
11475
|
+
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
11476
|
+
/**
|
|
11477
|
+
* List component.
|
|
11477
11478
|
*
|
|
11478
11479
|
* @param props Component props.
|
|
11479
11480
|
* @param ref Component ref.
|
|
11480
11481
|
* @return React element.
|
|
11481
11482
|
*/
|
|
11482
|
-
const
|
|
11483
|
-
const defaultTheme = useTheme();
|
|
11483
|
+
const InternalList = forwardRef((props, ref) => {
|
|
11484
11484
|
const {
|
|
11485
|
-
|
|
11486
|
-
|
|
11485
|
+
children,
|
|
11486
|
+
isClickable,
|
|
11487
|
+
onListItemSelected,
|
|
11488
|
+
itemPadding,
|
|
11489
|
+
...forwardedProps
|
|
11487
11490
|
} = props;
|
|
11488
|
-
|
|
11491
|
+
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
11492
|
+
return List$1({
|
|
11493
|
+
...forwardedProps,
|
|
11489
11494
|
ref,
|
|
11490
|
-
|
|
11491
|
-
|
|
11495
|
+
children,
|
|
11496
|
+
itemPadding: adjustedItemPadding
|
|
11492
11497
|
});
|
|
11493
11498
|
});
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11499
|
+
InternalList.displayName = COMPONENT_NAME$1c;
|
|
11500
|
+
InternalList.className = CLASSNAME$1b;
|
|
11501
|
+
InternalList.defaultProps = DEFAULT_PROPS$Y;
|
|
11502
|
+
const List = Object.assign(InternalList, {
|
|
11503
|
+
useKeyboardListNavigation
|
|
11504
|
+
});
|
|
11497
11505
|
|
|
11498
11506
|
// The error margin in px we want to have for triggering infinite scroll
|
|
11499
11507
|
const SCROLL_TRIGGER_MARGIN = 5;
|
|
@@ -11546,7 +11554,7 @@ const COMPONENT_NAME$P = 'Dropdown';
|
|
|
11546
11554
|
*/
|
|
11547
11555
|
const CLASSNAME$Q = 'lumx-dropdown';
|
|
11548
11556
|
const {
|
|
11549
|
-
block: block$
|
|
11557
|
+
block: block$G,
|
|
11550
11558
|
element: element$y
|
|
11551
11559
|
} = classNames.bem(CLASSNAME$Q);
|
|
11552
11560
|
|
|
@@ -11612,7 +11620,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
11612
11620
|
...forwardedProps,
|
|
11613
11621
|
focusAnchorOnClose: focusAnchorOnClose,
|
|
11614
11622
|
anchorRef: anchorRef,
|
|
11615
|
-
className: classNames.join(className, block$
|
|
11623
|
+
className: classNames.join(className, block$G()),
|
|
11616
11624
|
elevation: 0,
|
|
11617
11625
|
closeOnClickAway: closeOnClickAway,
|
|
11618
11626
|
closeOnEscape: closeOnEscape,
|
|
@@ -11645,7 +11653,7 @@ const COMPONENT_NAME$O = 'ExpansionPanel';
|
|
|
11645
11653
|
*/
|
|
11646
11654
|
const CLASSNAME$P = 'lumx-expansion-panel';
|
|
11647
11655
|
const {
|
|
11648
|
-
block: block$
|
|
11656
|
+
block: block$F,
|
|
11649
11657
|
element: element$x
|
|
11650
11658
|
} = bem(CLASSNAME$P);
|
|
11651
11659
|
|
|
@@ -11701,7 +11709,7 @@ const ExpansionPanel$1 = props => {
|
|
|
11701
11709
|
}
|
|
11702
11710
|
};
|
|
11703
11711
|
const color = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
|
|
11704
|
-
const rootClassName = classnames(className, block$
|
|
11712
|
+
const rootClassName = classnames(className, block$F({
|
|
11705
11713
|
'has-background': hasBackground,
|
|
11706
11714
|
'has-header': Boolean(!isEmpty(headerProps.children)),
|
|
11707
11715
|
'has-header-divider': hasHeaderDivider,
|
|
@@ -11844,7 +11852,7 @@ const COMPONENT_NAME$N = 'Flag';
|
|
|
11844
11852
|
const CLASSNAME$O = 'lumx-flag';
|
|
11845
11853
|
const DEFAULT_PROPS$K = {};
|
|
11846
11854
|
const {
|
|
11847
|
-
block: block$
|
|
11855
|
+
block: block$E,
|
|
11848
11856
|
element: element$w
|
|
11849
11857
|
} = bem(CLASSNAME$O);
|
|
11850
11858
|
|
|
@@ -11869,7 +11877,7 @@ const Flag$1 = props => {
|
|
|
11869
11877
|
const isTruncated = !!truncate;
|
|
11870
11878
|
return /*#__PURE__*/jsxs("div", {
|
|
11871
11879
|
...forwardedProps,
|
|
11872
|
-
className: classnames(className, block$
|
|
11880
|
+
className: classnames(className, block$E({
|
|
11873
11881
|
[`color-${flagColor}`]: Boolean(flagColor),
|
|
11874
11882
|
'is-truncated': isTruncated
|
|
11875
11883
|
})),
|
|
@@ -11908,80 +11916,6 @@ Flag.displayName = COMPONENT_NAME$N;
|
|
|
11908
11916
|
Flag.className = CLASSNAME$O;
|
|
11909
11917
|
Flag.defaultProps = DEFAULT_PROPS$K;
|
|
11910
11918
|
|
|
11911
|
-
/**
|
|
11912
|
-
* Defines the props of the component.
|
|
11913
|
-
*/
|
|
11914
|
-
|
|
11915
|
-
/**
|
|
11916
|
-
* Component display name.
|
|
11917
|
-
*/
|
|
11918
|
-
const COMPONENT_NAME$M = 'FlexBox';
|
|
11919
|
-
|
|
11920
|
-
/**
|
|
11921
|
-
* Component default class name and class prefix.
|
|
11922
|
-
*/
|
|
11923
|
-
const CLASSNAME$N = 'lumx-flex-box';
|
|
11924
|
-
const {
|
|
11925
|
-
block: block$E
|
|
11926
|
-
} = bem(CLASSNAME$N);
|
|
11927
|
-
|
|
11928
|
-
/**
|
|
11929
|
-
* Get FlexBox component props (className computation).
|
|
11930
|
-
*
|
|
11931
|
-
* @param props Component props.
|
|
11932
|
-
* @return Computed props with className.
|
|
11933
|
-
*/
|
|
11934
|
-
function getFlexBoxProps(props) {
|
|
11935
|
-
const {
|
|
11936
|
-
className,
|
|
11937
|
-
fillSpace,
|
|
11938
|
-
gap,
|
|
11939
|
-
hAlign,
|
|
11940
|
-
marginAuto,
|
|
11941
|
-
noShrink,
|
|
11942
|
-
vAlign,
|
|
11943
|
-
wrap,
|
|
11944
|
-
orientation,
|
|
11945
|
-
...forwardedProps
|
|
11946
|
-
} = props;
|
|
11947
|
-
const adjustedOrientation = orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null);
|
|
11948
|
-
return {
|
|
11949
|
-
...forwardedProps,
|
|
11950
|
-
className: classnames(className, block$E({
|
|
11951
|
-
[`orientation-${adjustedOrientation}`]: Boolean(adjustedOrientation),
|
|
11952
|
-
[`v-align-${vAlign}`]: Boolean(vAlign),
|
|
11953
|
-
[`h-align-${hAlign}`]: Boolean(hAlign),
|
|
11954
|
-
[`gap-${gap}`]: Boolean(gap),
|
|
11955
|
-
wrap: Boolean(wrap),
|
|
11956
|
-
'fill-space': fillSpace,
|
|
11957
|
-
'no-shrink': noShrink,
|
|
11958
|
-
...Object.fromEntries(castArray(marginAuto).filter(Boolean).map(align => [`margin-auto-${align}`, true]))
|
|
11959
|
-
}))
|
|
11960
|
-
};
|
|
11961
|
-
}
|
|
11962
|
-
|
|
11963
|
-
/**
|
|
11964
|
-
* FlexBox component.
|
|
11965
|
-
*
|
|
11966
|
-
* @param props Component props.
|
|
11967
|
-
* @param ref Component ref.
|
|
11968
|
-
* @return React element.
|
|
11969
|
-
*/
|
|
11970
|
-
const FlexBox = forwardRef((props, ref) => {
|
|
11971
|
-
const {
|
|
11972
|
-
as: Component = 'div',
|
|
11973
|
-
children,
|
|
11974
|
-
...forwardedProps
|
|
11975
|
-
} = props;
|
|
11976
|
-
return /*#__PURE__*/jsx(Component, {
|
|
11977
|
-
ref: ref,
|
|
11978
|
-
...getFlexBoxProps(forwardedProps),
|
|
11979
|
-
children: children
|
|
11980
|
-
});
|
|
11981
|
-
});
|
|
11982
|
-
FlexBox.displayName = COMPONENT_NAME$M;
|
|
11983
|
-
FlexBox.className = CLASSNAME$N;
|
|
11984
|
-
|
|
11985
11919
|
/** The maximum authorized heading level. */
|
|
11986
11920
|
const MAX_HEADING_LEVEL = 6;
|
|
11987
11921
|
|
|
@@ -12008,12 +11942,12 @@ const defaultContext = {
|
|
|
12008
11942
|
/**
|
|
12009
11943
|
* Component display name.
|
|
12010
11944
|
*/
|
|
12011
|
-
const COMPONENT_NAME$
|
|
11945
|
+
const COMPONENT_NAME$M = 'Heading';
|
|
12012
11946
|
|
|
12013
11947
|
/**
|
|
12014
11948
|
* Component default class name and class prefix.
|
|
12015
11949
|
*/
|
|
12016
|
-
const CLASSNAME$
|
|
11950
|
+
const CLASSNAME$N = 'lumx-heading';
|
|
12017
11951
|
|
|
12018
11952
|
/**
|
|
12019
11953
|
* Component default props.
|
|
@@ -12038,7 +11972,7 @@ const getHeadingProps = (props, contextHeadingElement) => {
|
|
|
12038
11972
|
return {
|
|
12039
11973
|
...otherProps,
|
|
12040
11974
|
as: computedHeadingElement,
|
|
12041
|
-
className: classnames(className, CLASSNAME$
|
|
11975
|
+
className: classnames(className, CLASSNAME$N),
|
|
12042
11976
|
typography: typography || DEFAULT_TYPOGRAPHY_BY_LEVEL[computedHeadingElement]
|
|
12043
11977
|
};
|
|
12044
11978
|
};
|
|
@@ -12076,8 +12010,8 @@ const Heading = forwardRef((props, ref) => {
|
|
|
12076
12010
|
children: children
|
|
12077
12011
|
});
|
|
12078
12012
|
});
|
|
12079
|
-
Heading.displayName = COMPONENT_NAME$
|
|
12080
|
-
Heading.className = CLASSNAME$
|
|
12013
|
+
Heading.displayName = COMPONENT_NAME$M;
|
|
12014
|
+
Heading.className = CLASSNAME$N;
|
|
12081
12015
|
Heading.defaultProps = DEFAULT_PROPS$J;
|
|
12082
12016
|
|
|
12083
12017
|
/**
|
|
@@ -12116,15 +12050,15 @@ const HeadingLevelProvider = ({
|
|
|
12116
12050
|
/**
|
|
12117
12051
|
* Component display name.
|
|
12118
12052
|
*/
|
|
12119
|
-
const COMPONENT_NAME$
|
|
12053
|
+
const COMPONENT_NAME$L = 'Grid';
|
|
12120
12054
|
|
|
12121
12055
|
/**
|
|
12122
12056
|
* Component default class name and class prefix.
|
|
12123
12057
|
*/
|
|
12124
|
-
const CLASSNAME$
|
|
12058
|
+
const CLASSNAME$M = 'lumx-grid';
|
|
12125
12059
|
const {
|
|
12126
12060
|
block: block$D
|
|
12127
|
-
} = classNames.bem(CLASSNAME$
|
|
12061
|
+
} = classNames.bem(CLASSNAME$M);
|
|
12128
12062
|
|
|
12129
12063
|
/**
|
|
12130
12064
|
* Component default props.
|
|
@@ -12155,7 +12089,7 @@ const Grid = forwardRef((props, ref) => {
|
|
|
12155
12089
|
return /*#__PURE__*/jsx("div", {
|
|
12156
12090
|
ref: ref,
|
|
12157
12091
|
...forwardedProps,
|
|
12158
|
-
className: classNames.join(className, classNames.bem(`${CLASSNAME$
|
|
12092
|
+
className: classNames.join(className, classNames.bem(`${CLASSNAME$M}-container`).block(), block$D({
|
|
12159
12093
|
[`h-align-${hAlign}`]: Boolean(hAlign),
|
|
12160
12094
|
[`v-align-${vAlign}`]: Boolean(vAlign),
|
|
12161
12095
|
[`orientation-${orientation}`]: Boolean(orientation),
|
|
@@ -12165,22 +12099,22 @@ const Grid = forwardRef((props, ref) => {
|
|
|
12165
12099
|
children: children
|
|
12166
12100
|
});
|
|
12167
12101
|
});
|
|
12168
|
-
Grid.displayName = COMPONENT_NAME$
|
|
12169
|
-
Grid.className = CLASSNAME$
|
|
12102
|
+
Grid.displayName = COMPONENT_NAME$L;
|
|
12103
|
+
Grid.className = CLASSNAME$M;
|
|
12170
12104
|
Grid.defaultProps = DEFAULT_PROPS$I;
|
|
12171
12105
|
|
|
12172
12106
|
/**
|
|
12173
12107
|
* Component display name.
|
|
12174
12108
|
*/
|
|
12175
|
-
const COMPONENT_NAME$
|
|
12109
|
+
const COMPONENT_NAME$K = 'GridItem';
|
|
12176
12110
|
|
|
12177
12111
|
/**
|
|
12178
12112
|
* Component default class name and class prefix.
|
|
12179
12113
|
*/
|
|
12180
|
-
const CLASSNAME$
|
|
12114
|
+
const CLASSNAME$L = 'lumx-grid-item';
|
|
12181
12115
|
const {
|
|
12182
12116
|
block: block$C
|
|
12183
|
-
} = classNames.bem(CLASSNAME$
|
|
12117
|
+
} = classNames.bem(CLASSNAME$L);
|
|
12184
12118
|
|
|
12185
12119
|
/**
|
|
12186
12120
|
* GridItem component.
|
|
@@ -12209,18 +12143,18 @@ const GridItem = forwardRef((props, ref) => {
|
|
|
12209
12143
|
children: children
|
|
12210
12144
|
});
|
|
12211
12145
|
});
|
|
12212
|
-
GridItem.displayName = COMPONENT_NAME$
|
|
12213
|
-
GridItem.className = CLASSNAME$
|
|
12146
|
+
GridItem.displayName = COMPONENT_NAME$K;
|
|
12147
|
+
GridItem.className = CLASSNAME$L;
|
|
12214
12148
|
|
|
12215
12149
|
/**
|
|
12216
12150
|
* Component display name.
|
|
12217
12151
|
*/
|
|
12218
|
-
const COMPONENT_NAME$
|
|
12152
|
+
const COMPONENT_NAME$J = 'GridColumn';
|
|
12219
12153
|
|
|
12220
12154
|
/**
|
|
12221
12155
|
* Component default class name and class prefix.
|
|
12222
12156
|
*/
|
|
12223
|
-
const CLASSNAME$
|
|
12157
|
+
const CLASSNAME$K = 'lumx-grid-column';
|
|
12224
12158
|
|
|
12225
12159
|
/**
|
|
12226
12160
|
* Component default props.
|
|
@@ -12250,7 +12184,7 @@ const GridColumn$1 = props => {
|
|
|
12250
12184
|
return /*#__PURE__*/jsx(Component, {
|
|
12251
12185
|
...forwardedProps,
|
|
12252
12186
|
ref: ref,
|
|
12253
|
-
className: classnames(className, CLASSNAME$
|
|
12187
|
+
className: classnames(className, CLASSNAME$K),
|
|
12254
12188
|
style: {
|
|
12255
12189
|
...style,
|
|
12256
12190
|
['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
@@ -12260,8 +12194,8 @@ const GridColumn$1 = props => {
|
|
|
12260
12194
|
children: children
|
|
12261
12195
|
});
|
|
12262
12196
|
};
|
|
12263
|
-
GridColumn$1.displayName = COMPONENT_NAME$
|
|
12264
|
-
GridColumn$1.className = CLASSNAME$
|
|
12197
|
+
GridColumn$1.displayName = COMPONENT_NAME$J;
|
|
12198
|
+
GridColumn$1.className = CLASSNAME$K;
|
|
12265
12199
|
GridColumn$1.defaultProps = DEFAULT_PROPS$H;
|
|
12266
12200
|
|
|
12267
12201
|
/**
|
|
@@ -12290,8 +12224,8 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
12290
12224
|
...props
|
|
12291
12225
|
});
|
|
12292
12226
|
});
|
|
12293
|
-
GridColumn.displayName = COMPONENT_NAME$
|
|
12294
|
-
GridColumn.className = CLASSNAME$
|
|
12227
|
+
GridColumn.displayName = COMPONENT_NAME$J;
|
|
12228
|
+
GridColumn.className = CLASSNAME$K;
|
|
12295
12229
|
GridColumn.defaultProps = DEFAULT_PROPS$G;
|
|
12296
12230
|
|
|
12297
12231
|
/**
|
|
@@ -12411,16 +12345,16 @@ const ImageBlockCaptionPosition = {
|
|
|
12411
12345
|
/**
|
|
12412
12346
|
* Component display name.
|
|
12413
12347
|
*/
|
|
12414
|
-
const COMPONENT_NAME$
|
|
12348
|
+
const COMPONENT_NAME$I = 'ImageBlock';
|
|
12415
12349
|
|
|
12416
12350
|
/**
|
|
12417
12351
|
* Component default class name and class prefix.
|
|
12418
12352
|
*/
|
|
12419
|
-
const CLASSNAME$
|
|
12353
|
+
const CLASSNAME$J = 'lumx-image-block';
|
|
12420
12354
|
const {
|
|
12421
12355
|
block: block$B,
|
|
12422
12356
|
element: element$v
|
|
12423
|
-
} = classNames.bem(CLASSNAME$
|
|
12357
|
+
} = classNames.bem(CLASSNAME$J);
|
|
12424
12358
|
|
|
12425
12359
|
/**
|
|
12426
12360
|
* Component default props.
|
|
@@ -12479,7 +12413,7 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
12479
12413
|
alt: alt || title
|
|
12480
12414
|
}), /*#__PURE__*/jsx(ImageCaption, {
|
|
12481
12415
|
as: "figcaption",
|
|
12482
|
-
baseClassName: CLASSNAME$
|
|
12416
|
+
baseClassName: CLASSNAME$J,
|
|
12483
12417
|
theme: theme,
|
|
12484
12418
|
title: title,
|
|
12485
12419
|
titleProps: titleProps,
|
|
@@ -12495,19 +12429,19 @@ const ImageBlock = forwardRef((props, ref) => {
|
|
|
12495
12429
|
})]
|
|
12496
12430
|
});
|
|
12497
12431
|
});
|
|
12498
|
-
ImageBlock.displayName = COMPONENT_NAME$
|
|
12499
|
-
ImageBlock.className = CLASSNAME$
|
|
12432
|
+
ImageBlock.displayName = COMPONENT_NAME$I;
|
|
12433
|
+
ImageBlock.className = CLASSNAME$J;
|
|
12500
12434
|
ImageBlock.defaultProps = DEFAULT_PROPS$F;
|
|
12501
12435
|
|
|
12502
12436
|
/**
|
|
12503
12437
|
* Component display name.
|
|
12504
12438
|
*/
|
|
12505
|
-
const COMPONENT_NAME$
|
|
12439
|
+
const COMPONENT_NAME$H = 'ImageLightbox';
|
|
12506
12440
|
|
|
12507
12441
|
/**
|
|
12508
12442
|
* Component default class name and class prefix.
|
|
12509
12443
|
*/
|
|
12510
|
-
const CLASSNAME$
|
|
12444
|
+
const CLASSNAME$I = 'lumx-image-lightbox';
|
|
12511
12445
|
|
|
12512
12446
|
/**
|
|
12513
12447
|
* Observe element size (only works if it's size depends on the window size).
|
|
@@ -12753,7 +12687,7 @@ function useAnimateScroll(scrollAreaRef) {
|
|
|
12753
12687
|
|
|
12754
12688
|
const {
|
|
12755
12689
|
element: element$u
|
|
12756
|
-
} = classNames.bem(CLASSNAME$
|
|
12690
|
+
} = classNames.bem(CLASSNAME$I);
|
|
12757
12691
|
/** Internal image slide component for ImageLightbox */
|
|
12758
12692
|
const ImageSlide = /*#__PURE__*/React__default.memo(props => {
|
|
12759
12693
|
const {
|
|
@@ -12845,7 +12779,7 @@ const ImageSlide = /*#__PURE__*/React__default.memo(props => {
|
|
|
12845
12779
|
|
|
12846
12780
|
const {
|
|
12847
12781
|
element: element$t
|
|
12848
|
-
} = classNames.bem(CLASSNAME$
|
|
12782
|
+
} = classNames.bem(CLASSNAME$I);
|
|
12849
12783
|
/** Internal image slideshow component for ImageLightbox */
|
|
12850
12784
|
const ImageSlideshow = ({
|
|
12851
12785
|
activeImageIndex,
|
|
@@ -13091,7 +13025,7 @@ function useImageLightbox(props) {
|
|
|
13091
13025
|
viewTransitionName: {
|
|
13092
13026
|
source: currentImageRef,
|
|
13093
13027
|
target: triggerImageRefs[currentIndex],
|
|
13094
|
-
name: CLASSNAME$
|
|
13028
|
+
name: CLASSNAME$I
|
|
13095
13029
|
}
|
|
13096
13030
|
});
|
|
13097
13031
|
}
|
|
@@ -13143,7 +13077,7 @@ function useImageLightbox(props) {
|
|
|
13143
13077
|
viewTransitionName: {
|
|
13144
13078
|
source: triggerImage,
|
|
13145
13079
|
target: currentImageRef,
|
|
13146
|
-
name: CLASSNAME$
|
|
13080
|
+
name: CLASSNAME$I
|
|
13147
13081
|
}
|
|
13148
13082
|
});
|
|
13149
13083
|
}
|
|
@@ -13197,7 +13131,7 @@ const Inner = forwardRef((props, ref) => {
|
|
|
13197
13131
|
}, [onClose]);
|
|
13198
13132
|
return /*#__PURE__*/jsx(Lightbox, {
|
|
13199
13133
|
ref: ref,
|
|
13200
|
-
className: classNames.join(className, CLASSNAME$
|
|
13134
|
+
className: classNames.join(className, CLASSNAME$I),
|
|
13201
13135
|
parentElement: parentElement,
|
|
13202
13136
|
isOpen: isOpen,
|
|
13203
13137
|
onClose: onClose,
|
|
@@ -13226,8 +13160,8 @@ const Inner = forwardRef((props, ref) => {
|
|
|
13226
13160
|
})
|
|
13227
13161
|
});
|
|
13228
13162
|
});
|
|
13229
|
-
Inner.displayName = COMPONENT_NAME$
|
|
13230
|
-
Inner.className = CLASSNAME$
|
|
13163
|
+
Inner.displayName = COMPONENT_NAME$H;
|
|
13164
|
+
Inner.className = CLASSNAME$I;
|
|
13231
13165
|
|
|
13232
13166
|
/**
|
|
13233
13167
|
* ImageLightbox component.
|
|
@@ -13243,16 +13177,16 @@ const ImageLightbox = Object.assign(Inner, {
|
|
|
13243
13177
|
/**
|
|
13244
13178
|
* Component display name.
|
|
13245
13179
|
*/
|
|
13246
|
-
const COMPONENT_NAME$
|
|
13180
|
+
const COMPONENT_NAME$G = 'InlineList';
|
|
13247
13181
|
|
|
13248
13182
|
/**
|
|
13249
13183
|
* Component default class name and class prefix.
|
|
13250
13184
|
*/
|
|
13251
|
-
const CLASSNAME$
|
|
13185
|
+
const CLASSNAME$H = 'lumx-inline-list';
|
|
13252
13186
|
const {
|
|
13253
13187
|
block: block$A,
|
|
13254
13188
|
element: element$s
|
|
13255
|
-
} = bem(CLASSNAME$
|
|
13189
|
+
} = bem(CLASSNAME$H);
|
|
13256
13190
|
|
|
13257
13191
|
/**
|
|
13258
13192
|
* Component default props.
|
|
@@ -13304,8 +13238,8 @@ const InlineList$1 = props => {
|
|
|
13304
13238
|
})
|
|
13305
13239
|
);
|
|
13306
13240
|
};
|
|
13307
|
-
InlineList$1.displayName = COMPONENT_NAME$
|
|
13308
|
-
InlineList$1.className = CLASSNAME$
|
|
13241
|
+
InlineList$1.displayName = COMPONENT_NAME$G;
|
|
13242
|
+
InlineList$1.className = CLASSNAME$H;
|
|
13309
13243
|
InlineList$1.defaultProps = DEFAULT_PROPS$E;
|
|
13310
13244
|
|
|
13311
13245
|
/**
|
|
@@ -13330,8 +13264,8 @@ const InlineList = forwardRef((props, ref) => {
|
|
|
13330
13264
|
items: Children.toArray(children)
|
|
13331
13265
|
});
|
|
13332
13266
|
});
|
|
13333
|
-
InlineList.displayName = COMPONENT_NAME$
|
|
13334
|
-
InlineList.className = CLASSNAME$
|
|
13267
|
+
InlineList.displayName = COMPONENT_NAME$G;
|
|
13268
|
+
InlineList.className = CLASSNAME$H;
|
|
13335
13269
|
InlineList.defaultProps = DEFAULT_PROPS$E;
|
|
13336
13270
|
|
|
13337
13271
|
/**
|
|
@@ -13375,16 +13309,16 @@ InputLabel.defaultProps = InputLabel$1.defaultProps;
|
|
|
13375
13309
|
/**
|
|
13376
13310
|
* Component display name.
|
|
13377
13311
|
*/
|
|
13378
|
-
const COMPONENT_NAME$
|
|
13312
|
+
const COMPONENT_NAME$F = 'Lightbox';
|
|
13379
13313
|
|
|
13380
13314
|
/**
|
|
13381
13315
|
* Component default class name and class prefix.
|
|
13382
13316
|
*/
|
|
13383
|
-
const CLASSNAME$
|
|
13317
|
+
const CLASSNAME$G = 'lumx-lightbox';
|
|
13384
13318
|
const {
|
|
13385
13319
|
block: block$z,
|
|
13386
13320
|
element: element$r
|
|
13387
|
-
} = classNames.bem(CLASSNAME$
|
|
13321
|
+
} = classNames.bem(CLASSNAME$G);
|
|
13388
13322
|
|
|
13389
13323
|
/**
|
|
13390
13324
|
* Lightbox component.
|
|
@@ -13507,8 +13441,8 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
13507
13441
|
})
|
|
13508
13442
|
});
|
|
13509
13443
|
});
|
|
13510
|
-
Lightbox.displayName = COMPONENT_NAME$
|
|
13511
|
-
Lightbox.className = CLASSNAME$
|
|
13444
|
+
Lightbox.displayName = COMPONENT_NAME$F;
|
|
13445
|
+
Lightbox.className = CLASSNAME$G;
|
|
13512
13446
|
|
|
13513
13447
|
/**
|
|
13514
13448
|
* Defines the props of the component.
|
|
@@ -13517,15 +13451,15 @@ Lightbox.className = CLASSNAME$F;
|
|
|
13517
13451
|
/**
|
|
13518
13452
|
* Component display name.
|
|
13519
13453
|
*/
|
|
13520
|
-
const COMPONENT_NAME$
|
|
13454
|
+
const COMPONENT_NAME$E = 'Link';
|
|
13521
13455
|
|
|
13522
13456
|
/**
|
|
13523
13457
|
* Component default class name and class prefix.
|
|
13524
13458
|
*/
|
|
13525
|
-
const CLASSNAME$
|
|
13459
|
+
const CLASSNAME$F = 'lumx-link';
|
|
13526
13460
|
const {
|
|
13527
13461
|
block: block$y
|
|
13528
|
-
} = bem(CLASSNAME$
|
|
13462
|
+
} = bem(CLASSNAME$F);
|
|
13529
13463
|
|
|
13530
13464
|
/**
|
|
13531
13465
|
* Link component.
|
|
@@ -13564,7 +13498,7 @@ const Link$1 = props => {
|
|
|
13564
13498
|
|
|
13565
13499
|
const {
|
|
13566
13500
|
element: element$q
|
|
13567
|
-
} = classNames.bem(CLASSNAME$
|
|
13501
|
+
} = classNames.bem(CLASSNAME$F);
|
|
13568
13502
|
|
|
13569
13503
|
/**
|
|
13570
13504
|
* Defines the props of the component.
|
|
@@ -13610,22 +13544,22 @@ const Link = forwardRef((props, ref) => {
|
|
|
13610
13544
|
}))
|
|
13611
13545
|
});
|
|
13612
13546
|
});
|
|
13613
|
-
Link.displayName = COMPONENT_NAME$
|
|
13614
|
-
Link.className = CLASSNAME$
|
|
13547
|
+
Link.displayName = COMPONENT_NAME$E;
|
|
13548
|
+
Link.className = CLASSNAME$F;
|
|
13615
13549
|
|
|
13616
13550
|
/**
|
|
13617
13551
|
* Component display name.
|
|
13618
13552
|
*/
|
|
13619
|
-
const COMPONENT_NAME$
|
|
13553
|
+
const COMPONENT_NAME$D = 'LinkPreview';
|
|
13620
13554
|
|
|
13621
13555
|
/**
|
|
13622
13556
|
* Component default class name and class prefix.
|
|
13623
13557
|
*/
|
|
13624
|
-
const CLASSNAME$
|
|
13558
|
+
const CLASSNAME$E = 'lumx-link-preview';
|
|
13625
13559
|
const {
|
|
13626
13560
|
block: block$x,
|
|
13627
13561
|
element: element$p
|
|
13628
|
-
} = classNames.bem(CLASSNAME$
|
|
13562
|
+
} = classNames.bem(CLASSNAME$E);
|
|
13629
13563
|
|
|
13630
13564
|
/**
|
|
13631
13565
|
* Component default props.
|
|
@@ -13720,10 +13654,125 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
13720
13654
|
})
|
|
13721
13655
|
});
|
|
13722
13656
|
});
|
|
13723
|
-
LinkPreview.displayName = COMPONENT_NAME$
|
|
13724
|
-
LinkPreview.className = CLASSNAME$
|
|
13657
|
+
LinkPreview.displayName = COMPONENT_NAME$D;
|
|
13658
|
+
LinkPreview.className = CLASSNAME$E;
|
|
13725
13659
|
LinkPreview.defaultProps = DEFAULT_PROPS$D;
|
|
13726
13660
|
|
|
13661
|
+
/**
|
|
13662
|
+
* ListItem.Action props.
|
|
13663
|
+
*/
|
|
13664
|
+
|
|
13665
|
+
/**
|
|
13666
|
+
* ListItem.Action sub-component.
|
|
13667
|
+
*
|
|
13668
|
+
* Renders a button or link with action area classes.
|
|
13669
|
+
* When placed as a child of ListItem, it activates the action area pattern:
|
|
13670
|
+
* the entire list item becomes visually clickable, while other interactive
|
|
13671
|
+
* elements (in `before`/`after` slots) remain independently clickable.
|
|
13672
|
+
*
|
|
13673
|
+
* @param props Component props.
|
|
13674
|
+
* @param ref Component ref.
|
|
13675
|
+
* @return React element.
|
|
13676
|
+
*/
|
|
13677
|
+
const ListItemAction = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
13678
|
+
const {
|
|
13679
|
+
children,
|
|
13680
|
+
onClick,
|
|
13681
|
+
...forwardedProps
|
|
13682
|
+
} = props;
|
|
13683
|
+
return ListItemAction$1({
|
|
13684
|
+
...forwardedProps,
|
|
13685
|
+
handleClick: onClick,
|
|
13686
|
+
ref,
|
|
13687
|
+
children
|
|
13688
|
+
});
|
|
13689
|
+
}), {
|
|
13690
|
+
displayName: COMPONENT_NAME$19,
|
|
13691
|
+
className: CLASSNAME$18,
|
|
13692
|
+
defaultProps: DEFAULT_PROPS$W
|
|
13693
|
+
});
|
|
13694
|
+
|
|
13695
|
+
/**
|
|
13696
|
+
* Defines the props of the component.
|
|
13697
|
+
*/
|
|
13698
|
+
|
|
13699
|
+
/**
|
|
13700
|
+
* ListItem component.
|
|
13701
|
+
*
|
|
13702
|
+
* @param props Component props.
|
|
13703
|
+
* @param ref Component ref.
|
|
13704
|
+
* @return React element.
|
|
13705
|
+
*/
|
|
13706
|
+
const _ListItem = forwardRef((props, ref) => {
|
|
13707
|
+
const {
|
|
13708
|
+
disabledStateProps,
|
|
13709
|
+
otherProps
|
|
13710
|
+
} = useDisableStateProps(props);
|
|
13711
|
+
const {
|
|
13712
|
+
onItemSelected,
|
|
13713
|
+
onClick,
|
|
13714
|
+
linkRef,
|
|
13715
|
+
...forwardedProps
|
|
13716
|
+
} = otherProps;
|
|
13717
|
+
const handleClick = event => {
|
|
13718
|
+
onItemSelected?.(event);
|
|
13719
|
+
onClick?.(event);
|
|
13720
|
+
};
|
|
13721
|
+
return ListItem$1({
|
|
13722
|
+
...forwardedProps,
|
|
13723
|
+
isDisabled: disabledStateProps.disabled,
|
|
13724
|
+
'aria-disabled': disabledStateProps['aria-disabled'],
|
|
13725
|
+
ref,
|
|
13726
|
+
linkRef,
|
|
13727
|
+
handleClick: onItemSelected || props.onClick ? handleClick : undefined
|
|
13728
|
+
});
|
|
13729
|
+
});
|
|
13730
|
+
_ListItem.displayName = COMPONENT_NAME$1a;
|
|
13731
|
+
_ListItem.className = CLASSNAME$19;
|
|
13732
|
+
_ListItem.defaultProps = DEFAULT_PROPS$X;
|
|
13733
|
+
|
|
13734
|
+
/**
|
|
13735
|
+
* ListItem component with Action sub-component.
|
|
13736
|
+
*/
|
|
13737
|
+
const ListItem = Object.assign(_ListItem, {
|
|
13738
|
+
/** Sub-component that renders the default action (button or link) for the action area pattern. */
|
|
13739
|
+
Action: ListItemAction
|
|
13740
|
+
});
|
|
13741
|
+
|
|
13742
|
+
/**
|
|
13743
|
+
* Component display name.
|
|
13744
|
+
*/
|
|
13745
|
+
const COMPONENT_NAME$C = 'ListSubheader';
|
|
13746
|
+
|
|
13747
|
+
/**
|
|
13748
|
+
* Component default class name and class prefix.
|
|
13749
|
+
*/
|
|
13750
|
+
const CLASSNAME$D = 'lumx-list-subheader';
|
|
13751
|
+
|
|
13752
|
+
/**
|
|
13753
|
+
* ListSubheader component.
|
|
13754
|
+
* @deprecated ListSubheader produces improper list structure. use ListSection instead.
|
|
13755
|
+
*
|
|
13756
|
+
* @param props Component props.
|
|
13757
|
+
* @param ref Component ref.
|
|
13758
|
+
* @return React element.
|
|
13759
|
+
*/
|
|
13760
|
+
const ListSubheader = forwardRef((props, ref) => {
|
|
13761
|
+
const {
|
|
13762
|
+
children,
|
|
13763
|
+
className,
|
|
13764
|
+
...forwardedProps
|
|
13765
|
+
} = props;
|
|
13766
|
+
return /*#__PURE__*/jsx("li", {
|
|
13767
|
+
ref: ref,
|
|
13768
|
+
...forwardedProps,
|
|
13769
|
+
className: classNames.join(className, CLASSNAME$D),
|
|
13770
|
+
children: children
|
|
13771
|
+
});
|
|
13772
|
+
});
|
|
13773
|
+
ListSubheader.displayName = COMPONENT_NAME$C;
|
|
13774
|
+
ListSubheader.className = CLASSNAME$D;
|
|
13775
|
+
|
|
13727
13776
|
/**
|
|
13728
13777
|
* Component display name.
|
|
13729
13778
|
*/
|