@lumx/react 4.9.0-next.9 → 4.10.0-next.0
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 +157 -57
- package/index.js +1179 -946
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, ColorVariant, VISUALLY_HIDDEN, Theme as Theme$1, AspectRatio as AspectRatio$1, DOCUMENT, IS_BROWSER as IS_BROWSER$1, WINDOW, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment as Alignment$1
|
|
1
|
+
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, ColorVariant as ColorVariant$1, VISUALLY_HIDDEN, Theme as Theme$1, AspectRatio as AspectRatio$1, DOCUMENT, IS_BROWSER as IS_BROWSER$1, WINDOW, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, NOTIFICATION_TRANSITION_DURATION, Alignment as Alignment$1 } from '@lumx/core/js/constants';
|
|
2
2
|
export * from '@lumx/core/js/constants';
|
|
3
3
|
export * from '@lumx/core/js/types';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -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`. */
|
|
@@ -725,7 +725,7 @@ function resolveColorWithVariants(colorWithVariants, colorVariant) {
|
|
|
725
725
|
* color('font', undefined); // undefined
|
|
726
726
|
*/
|
|
727
727
|
function color(type, propColor, propColorVariant) {
|
|
728
|
-
const [cColor, cColorVariant = ColorVariant.N] = resolveColorWithVariants(propColor, propColorVariant);
|
|
728
|
+
const [cColor, cColorVariant = ColorVariant$1.N] = resolveColorWithVariants(propColor, propColorVariant);
|
|
729
729
|
return `lumx-color-${type}-${cColor}-${cColorVariant}`;
|
|
730
730
|
}
|
|
731
731
|
|
|
@@ -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,
|
|
@@ -948,7 +948,10 @@ const AspectRatio = {
|
|
|
948
948
|
/** Ratio 3:2 */
|
|
949
949
|
horizontal: 'horizontal',
|
|
950
950
|
/** Ratio 1:1 */
|
|
951
|
-
square: 'square'
|
|
951
|
+
square: 'square',
|
|
952
|
+
/** Ratio constrained by the parent. */
|
|
953
|
+
free: 'free'
|
|
954
|
+
};
|
|
952
955
|
/**
|
|
953
956
|
* Semantic info about the purpose of the component
|
|
954
957
|
*/
|
|
@@ -969,6 +972,12 @@ const ColorPalette = {
|
|
|
969
972
|
yellow: 'yellow',
|
|
970
973
|
red: 'red',
|
|
971
974
|
light: 'light'};
|
|
975
|
+
/**
|
|
976
|
+
* See SCSS variable $lumx-color-variants
|
|
977
|
+
*/
|
|
978
|
+
const ColorVariant = {
|
|
979
|
+
N: 'N'
|
|
980
|
+
};
|
|
972
981
|
|
|
973
982
|
/** ColorPalette with all possible color variant combination */
|
|
974
983
|
|
|
@@ -997,8 +1006,8 @@ const COMPONENT_NAME$1t = 'Avatar';
|
|
|
997
1006
|
*/
|
|
998
1007
|
const CLASSNAME$1s = 'lumx-avatar';
|
|
999
1008
|
const {
|
|
1000
|
-
block: block$
|
|
1001
|
-
element: element$
|
|
1009
|
+
block: block$17,
|
|
1010
|
+
element: element$Q
|
|
1002
1011
|
} = bem(CLASSNAME$1s);
|
|
1003
1012
|
|
|
1004
1013
|
/**
|
|
@@ -1029,15 +1038,15 @@ const Avatar$1 = props => {
|
|
|
1029
1038
|
return /*#__PURE__*/jsxs("div", {
|
|
1030
1039
|
ref: ref,
|
|
1031
1040
|
...forwardedProps,
|
|
1032
|
-
className: classnames(className, block$
|
|
1041
|
+
className: classnames(className, block$17({
|
|
1033
1042
|
[`size-${size}`]: Boolean(size),
|
|
1034
1043
|
[`theme-${theme}`]: Boolean(theme)
|
|
1035
1044
|
})),
|
|
1036
1045
|
children: [image, actions && /*#__PURE__*/jsx("div", {
|
|
1037
|
-
className: element$
|
|
1046
|
+
className: element$Q('actions'),
|
|
1038
1047
|
children: actions
|
|
1039
1048
|
}), badge && /*#__PURE__*/jsx("div", {
|
|
1040
|
-
className: element$
|
|
1049
|
+
className: element$Q('badge'),
|
|
1041
1050
|
children: badge
|
|
1042
1051
|
})]
|
|
1043
1052
|
});
|
|
@@ -1078,7 +1087,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
1078
1087
|
image: /*#__PURE__*/jsx(Thumbnail, {
|
|
1079
1088
|
linkProps: linkProps,
|
|
1080
1089
|
linkAs: linkAs,
|
|
1081
|
-
className: element$
|
|
1090
|
+
className: element$Q('thumbnail'),
|
|
1082
1091
|
onClick: onClick,
|
|
1083
1092
|
onKeyPress: onKeyPress,
|
|
1084
1093
|
...thumbnailProps,
|
|
@@ -1104,7 +1113,7 @@ const COMPONENT_NAME$1s = 'Badge';
|
|
|
1104
1113
|
*/
|
|
1105
1114
|
const CLASSNAME$1r = 'lumx-badge';
|
|
1106
1115
|
const {
|
|
1107
|
-
block: block$
|
|
1116
|
+
block: block$16
|
|
1108
1117
|
} = bem(CLASSNAME$1r);
|
|
1109
1118
|
|
|
1110
1119
|
/**
|
|
@@ -1131,7 +1140,7 @@ const Badge$1 = props => {
|
|
|
1131
1140
|
return /*#__PURE__*/jsx("div", {
|
|
1132
1141
|
ref: ref,
|
|
1133
1142
|
...forwardedProps,
|
|
1134
|
-
className: classnames(className, block$
|
|
1143
|
+
className: classnames(className, block$16({
|
|
1135
1144
|
[`color-${color}`]: Boolean(color)
|
|
1136
1145
|
})),
|
|
1137
1146
|
children: children
|
|
@@ -1165,8 +1174,8 @@ Badge.defaultProps = Badge$1.defaultProps;
|
|
|
1165
1174
|
const COMPONENT_NAME$1r = 'BadgeWrapper';
|
|
1166
1175
|
const CLASSNAME$1q = 'lumx-badge-wrapper';
|
|
1167
1176
|
const {
|
|
1168
|
-
block: block$
|
|
1169
|
-
element: element$
|
|
1177
|
+
block: block$15,
|
|
1178
|
+
element: element$P
|
|
1170
1179
|
} = bem(CLASSNAME$1q);
|
|
1171
1180
|
const BadgeWrapper$1 = props => {
|
|
1172
1181
|
const {
|
|
@@ -1179,9 +1188,9 @@ const BadgeWrapper$1 = props => {
|
|
|
1179
1188
|
return /*#__PURE__*/jsxs("div", {
|
|
1180
1189
|
ref: ref,
|
|
1181
1190
|
...forwardedProps,
|
|
1182
|
-
className: classnames(className, block$
|
|
1191
|
+
className: classnames(className, block$15()),
|
|
1183
1192
|
children: [children, badge && /*#__PURE__*/jsx("div", {
|
|
1184
|
-
className: element$
|
|
1193
|
+
className: element$P('badge'),
|
|
1185
1194
|
children: badge
|
|
1186
1195
|
})]
|
|
1187
1196
|
});
|
|
@@ -1485,7 +1494,7 @@ const IconClassName = 'lumx-icon';
|
|
|
1485
1494
|
|
|
1486
1495
|
const CLASSNAME$1o = IconClassName;
|
|
1487
1496
|
const {
|
|
1488
|
-
block: block$
|
|
1497
|
+
block: block$14
|
|
1489
1498
|
} = bem(CLASSNAME$1o);
|
|
1490
1499
|
|
|
1491
1500
|
/**
|
|
@@ -1540,7 +1549,7 @@ const Icon$1 = props => {
|
|
|
1540
1549
|
return /*#__PURE__*/jsx("i", {
|
|
1541
1550
|
ref: ref,
|
|
1542
1551
|
...forwardedProps,
|
|
1543
|
-
className: classnames(className, block$
|
|
1552
|
+
className: classnames(className, block$14({
|
|
1544
1553
|
[`color-${iconColor}`]: Boolean(iconColor),
|
|
1545
1554
|
[`color-variant-${iconColorVariant}`]: Boolean(iconColorVariant),
|
|
1546
1555
|
'has-shape': hasShape,
|
|
@@ -1729,7 +1738,7 @@ const COMPONENT_NAME$1l = 'InputLabel';
|
|
|
1729
1738
|
const InputLabelClassName = 'lumx-input-label';
|
|
1730
1739
|
const CLASSNAME$1l = InputLabelClassName;
|
|
1731
1740
|
const {
|
|
1732
|
-
block: block$
|
|
1741
|
+
block: block$13
|
|
1733
1742
|
} = bem(CLASSNAME$1l);
|
|
1734
1743
|
const DEFAULT_PROPS$16 = {};
|
|
1735
1744
|
|
|
@@ -1751,7 +1760,7 @@ function InputLabel$1(props) {
|
|
|
1751
1760
|
ref: ref,
|
|
1752
1761
|
...forwardedProps,
|
|
1753
1762
|
htmlFor: htmlFor,
|
|
1754
|
-
className: classnames(className, block$
|
|
1763
|
+
className: classnames(className, block$13({
|
|
1755
1764
|
'is-required': isRequired,
|
|
1756
1765
|
[`theme-${theme}`]: Boolean(theme),
|
|
1757
1766
|
'has-custom-typography': Boolean(typography$1)
|
|
@@ -1784,7 +1793,7 @@ const InputHelperClassName = 'lumx-input-helper';
|
|
|
1784
1793
|
|
|
1785
1794
|
const CLASSNAME$1k = InputHelperClassName;
|
|
1786
1795
|
const {
|
|
1787
|
-
block: block$
|
|
1796
|
+
block: block$12
|
|
1788
1797
|
} = bem(CLASSNAME$1k);
|
|
1789
1798
|
|
|
1790
1799
|
/**
|
|
@@ -1812,7 +1821,7 @@ function InputHelper$1(props) {
|
|
|
1812
1821
|
return /*#__PURE__*/jsx("p", {
|
|
1813
1822
|
ref: ref,
|
|
1814
1823
|
...forwardedProps,
|
|
1815
|
-
className: classnames(className, block$
|
|
1824
|
+
className: classnames(className, block$12({
|
|
1816
1825
|
[`color-${color}`]: Boolean(color),
|
|
1817
1826
|
[`theme-${theme}`]: Boolean(theme)
|
|
1818
1827
|
})),
|
|
@@ -1839,8 +1848,8 @@ const COMPONENT_NAME$1j = 'Checkbox';
|
|
|
1839
1848
|
*/
|
|
1840
1849
|
const CLASSNAME$1j = 'lumx-checkbox';
|
|
1841
1850
|
const {
|
|
1842
|
-
block: block$
|
|
1843
|
-
element: element$
|
|
1851
|
+
block: block$11,
|
|
1852
|
+
element: element$O
|
|
1844
1853
|
} = bem(CLASSNAME$1j);
|
|
1845
1854
|
|
|
1846
1855
|
/**
|
|
@@ -1877,7 +1886,7 @@ const Checkbox$1 = props => {
|
|
|
1877
1886
|
return /*#__PURE__*/jsxs("div", {
|
|
1878
1887
|
ref: ref,
|
|
1879
1888
|
...forwardedProps,
|
|
1880
|
-
className: classnames(className, block$
|
|
1889
|
+
className: classnames(className, block$11({
|
|
1881
1890
|
// Whether state is intermediate class name will "-checked"
|
|
1882
1891
|
'is-checked': intermediateState ? true : isChecked,
|
|
1883
1892
|
'is-disabled': isDisabled,
|
|
@@ -1885,12 +1894,12 @@ const Checkbox$1 = props => {
|
|
|
1885
1894
|
[`theme-${theme}`]: Boolean(theme)
|
|
1886
1895
|
})),
|
|
1887
1896
|
children: [/*#__PURE__*/jsxs("div", {
|
|
1888
|
-
className: element$
|
|
1897
|
+
className: element$O('input-wrapper'),
|
|
1889
1898
|
children: [/*#__PURE__*/jsx("input", {
|
|
1890
1899
|
ref: inputRef,
|
|
1891
1900
|
type: "checkbox",
|
|
1892
1901
|
id: inputId,
|
|
1893
|
-
className: element$
|
|
1902
|
+
className: element$O('input-native'),
|
|
1894
1903
|
name: name,
|
|
1895
1904
|
value: value,
|
|
1896
1905
|
checked: isChecked,
|
|
@@ -1902,26 +1911,26 @@ const Checkbox$1 = props => {
|
|
|
1902
1911
|
} : {}),
|
|
1903
1912
|
...inputProps
|
|
1904
1913
|
}), /*#__PURE__*/jsxs("div", {
|
|
1905
|
-
className: element$
|
|
1914
|
+
className: element$O('input-placeholder'),
|
|
1906
1915
|
children: [/*#__PURE__*/jsx("div", {
|
|
1907
|
-
className: element$
|
|
1916
|
+
className: element$O('input-background')
|
|
1908
1917
|
}), /*#__PURE__*/jsx("div", {
|
|
1909
|
-
className: element$
|
|
1918
|
+
className: element$O('input-indicator'),
|
|
1910
1919
|
children: Icon$1({
|
|
1911
1920
|
icon: intermediateState ? mdiMinus : mdiCheck
|
|
1912
1921
|
})
|
|
1913
1922
|
})]
|
|
1914
1923
|
})]
|
|
1915
1924
|
}), /*#__PURE__*/jsxs("div", {
|
|
1916
|
-
className: element$
|
|
1925
|
+
className: element$O('content'),
|
|
1917
1926
|
children: [label && InputLabel$1({
|
|
1918
1927
|
htmlFor: inputId,
|
|
1919
|
-
className: element$
|
|
1928
|
+
className: element$O('label'),
|
|
1920
1929
|
theme,
|
|
1921
1930
|
children: label
|
|
1922
1931
|
}), helper && InputHelper$1({
|
|
1923
1932
|
id: `${inputId}-helper`,
|
|
1924
|
-
className: element$
|
|
1933
|
+
className: element$O('helper'),
|
|
1925
1934
|
theme,
|
|
1926
1935
|
children: helper
|
|
1927
1936
|
})]
|
|
@@ -2026,8 +2035,8 @@ const COMPONENT_NAME$1i = 'Chip';
|
|
|
2026
2035
|
*/
|
|
2027
2036
|
const CLASSNAME$1i = 'lumx-chip';
|
|
2028
2037
|
const {
|
|
2029
|
-
block: block
|
|
2030
|
-
element: element$
|
|
2038
|
+
block: block$10,
|
|
2039
|
+
element: element$N
|
|
2031
2040
|
} = bem(CLASSNAME$1i);
|
|
2032
2041
|
|
|
2033
2042
|
/**
|
|
@@ -2095,7 +2104,7 @@ const Chip$1 = props => {
|
|
|
2095
2104
|
...forwardedProps,
|
|
2096
2105
|
href: !disabledStateProps.disabled ? href : undefined,
|
|
2097
2106
|
ref: ref,
|
|
2098
|
-
className: classnames(className, block
|
|
2107
|
+
className: classnames(className, block$10({
|
|
2099
2108
|
'is-clickable': isClickable,
|
|
2100
2109
|
[`color-${chipColor}`]: Boolean(chipColor),
|
|
2101
2110
|
'is-disabled': isAnyDisabled,
|
|
@@ -2112,19 +2121,19 @@ const Chip$1 = props => {
|
|
|
2112
2121
|
/*#__PURE__*/
|
|
2113
2122
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2114
2123
|
jsx("div", {
|
|
2115
|
-
className: element$
|
|
2124
|
+
className: element$N('before', {
|
|
2116
2125
|
'is-clickable': hasBeforeClick
|
|
2117
2126
|
}),
|
|
2118
2127
|
onClick: handleBeforeClick,
|
|
2119
2128
|
children: before
|
|
2120
2129
|
}), /*#__PURE__*/jsx("div", {
|
|
2121
|
-
className: element$
|
|
2130
|
+
className: element$N('label'),
|
|
2122
2131
|
children: children
|
|
2123
2132
|
}), after &&
|
|
2124
2133
|
/*#__PURE__*/
|
|
2125
2134
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2126
2135
|
jsx("div", {
|
|
2127
|
-
className: element$
|
|
2136
|
+
className: element$N('after', {
|
|
2128
2137
|
'is-clickable': hasAfterClick
|
|
2129
2138
|
}),
|
|
2130
2139
|
onClick: handleAfterClick,
|
|
@@ -2387,8 +2396,8 @@ function useFocusLastChipOnBackspace(chipRefs, inputRef) {
|
|
|
2387
2396
|
*/
|
|
2388
2397
|
const CLASSNAME$1g = 'lumx-selection-chip-group';
|
|
2389
2398
|
const {
|
|
2390
|
-
block: block
|
|
2391
|
-
element: element$
|
|
2399
|
+
block: block$$,
|
|
2400
|
+
element: element$M
|
|
2392
2401
|
} = classNames.bem(CLASSNAME$1g);
|
|
2393
2402
|
|
|
2394
2403
|
/**
|
|
@@ -2419,7 +2428,7 @@ const SelectionChipGroup = ({
|
|
|
2419
2428
|
return /*#__PURE__*/jsx(ChipGroup, {
|
|
2420
2429
|
role: "group",
|
|
2421
2430
|
"aria-label": label,
|
|
2422
|
-
className: block
|
|
2431
|
+
className: block$$(),
|
|
2423
2432
|
...forwardedProps,
|
|
2424
2433
|
children: value?.map((v, index) => {
|
|
2425
2434
|
const name = getWithSelector(getOptionName, v);
|
|
@@ -2463,7 +2472,7 @@ const SelectionChipGroup = ({
|
|
|
2463
2472
|
after: /*#__PURE__*/jsx(Icon, {
|
|
2464
2473
|
icon: mdiClose
|
|
2465
2474
|
}),
|
|
2466
|
-
className: element$
|
|
2475
|
+
className: element$M('chip', [props?.className]),
|
|
2467
2476
|
size: "s",
|
|
2468
2477
|
ref: ref,
|
|
2469
2478
|
onClick: onClick,
|
|
@@ -2495,7 +2504,8 @@ function isOptionDisabled(option) {
|
|
|
2495
2504
|
/** Returns true when the cell is NOT the first gridcell in its row (i.e., it's an action cell). */
|
|
2496
2505
|
function isActionCell(cell) {
|
|
2497
2506
|
const row = cell.closest('[role="row"]');
|
|
2498
|
-
|
|
2507
|
+
if (!row) return false;
|
|
2508
|
+
return row.querySelector('[role="gridcell"]') !== cell;
|
|
2499
2509
|
}
|
|
2500
2510
|
|
|
2501
2511
|
/** Predicate matching an option element that carries `aria-selected="true"`. */
|
|
@@ -3130,7 +3140,9 @@ function setupListbox(handle, signal, notify) {
|
|
|
3130
3140
|
onActivate: item => {
|
|
3131
3141
|
item.setAttribute('data-focus-visible-added', 'true');
|
|
3132
3142
|
trigger.setAttribute('aria-activedescendant', item.id);
|
|
3133
|
-
item
|
|
3143
|
+
// Scroll to the element in listbox or else the item
|
|
3144
|
+
const toScrollTo = item.closest('[role=listbox] > *') || item;
|
|
3145
|
+
toScrollTo.scrollIntoView({
|
|
3134
3146
|
behavior: 'smooth',
|
|
3135
3147
|
block: 'nearest'
|
|
3136
3148
|
});
|
|
@@ -3344,7 +3356,7 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3344
3356
|
/**
|
|
3345
3357
|
* Attach the shared keydown listener to the trigger.
|
|
3346
3358
|
*
|
|
3347
|
-
* Handles: Enter, ArrowDown, ArrowUp, Escape (2-tier),
|
|
3359
|
+
* Handles: Enter, ArrowDown, ArrowUp, Escape (2-tier), PageUp, PageDown.
|
|
3348
3360
|
* Mode-specific keys (Space, Home, End, ArrowLeft/Right, printable chars, etc.)
|
|
3349
3361
|
* are delegated to the `onKeydown` hook provided by the mode controller.
|
|
3350
3362
|
*/
|
|
@@ -3366,16 +3378,17 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3366
3378
|
switch (event.key) {
|
|
3367
3379
|
case 'Enter':
|
|
3368
3380
|
if (handle.isOpen && nav?.hasActiveItem && nav.activeItem) {
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3381
|
+
// Capture activeItem before click — the click handler may close
|
|
3382
|
+
// the popover and clear the focus navigation state.
|
|
3383
|
+
const {
|
|
3384
|
+
activeItem
|
|
3385
|
+
} = nav;
|
|
3386
|
+
// "Click" on active option
|
|
3387
|
+
if (!isOptionDisabled(activeItem)) {
|
|
3388
|
+
activeItem.click();
|
|
3374
3389
|
}
|
|
3375
|
-
//
|
|
3376
|
-
|
|
3377
|
-
// and disabled options, the delegated handler did NOT close, so this is needed.
|
|
3378
|
-
if (!handle.isMultiSelect) {
|
|
3390
|
+
// Only close when not in multi select and not in action cell
|
|
3391
|
+
if (!handle.isMultiSelect && !isActionCell(activeItem)) {
|
|
3379
3392
|
handle.setIsOpen(false);
|
|
3380
3393
|
}
|
|
3381
3394
|
} else if (!handle.isMultiSelect) {
|
|
@@ -3431,15 +3444,6 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3431
3444
|
}
|
|
3432
3445
|
flag = true;
|
|
3433
3446
|
break;
|
|
3434
|
-
case 'Tab':
|
|
3435
|
-
// Click the active option (if any) and close. Let Tab propagate.
|
|
3436
|
-
if (nav?.hasActiveItem && nav.activeItem && !isOptionDisabled(nav.activeItem)) {
|
|
3437
|
-
nav.activeItem.click();
|
|
3438
|
-
}
|
|
3439
|
-
// The delegated click handler closes for single-select, but for multi-select
|
|
3440
|
-
// or when no item is active, we still need to explicitly close.
|
|
3441
|
-
handle.setIsOpen(false);
|
|
3442
|
-
break;
|
|
3443
3447
|
case 'PageUp':
|
|
3444
3448
|
if (handle.isOpen && nav?.hasActiveItem) {
|
|
3445
3449
|
nav.goToOffset(-10);
|
|
@@ -3479,10 +3483,17 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3479
3483
|
}
|
|
3480
3484
|
trigger.setAttribute('aria-expanded', String(isOpenState));
|
|
3481
3485
|
|
|
3482
|
-
// On first attach, wire up the mode-specific controller
|
|
3486
|
+
// On first attach, wire up the mode-specific controller, shared keydown, and focusout handlers.
|
|
3483
3487
|
if (isNewController) {
|
|
3484
3488
|
const onKeydown = onTriggerAttach?.(handle, abortController.signal) || undefined;
|
|
3485
3489
|
attachTriggerKeydown(trigger, abortController.signal, onKeydown);
|
|
3490
|
+
|
|
3491
|
+
// Close the popup when the trigger loses focus
|
|
3492
|
+
trigger.addEventListener('focusout', () => {
|
|
3493
|
+
handle.setIsOpen(false);
|
|
3494
|
+
}, {
|
|
3495
|
+
signal: abortController.signal
|
|
3496
|
+
});
|
|
3486
3497
|
}
|
|
3487
3498
|
if (listbox && !focusNav) {
|
|
3488
3499
|
focusNav = setupListbox(handle, abortController.signal, notify);
|
|
@@ -3548,7 +3559,7 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3548
3559
|
registerOption(element, callback) {
|
|
3549
3560
|
const filterLower = filterValue.toLowerCase();
|
|
3550
3561
|
const text = getOptionValue(element).toLowerCase();
|
|
3551
|
-
const isFiltered = filterLower.length > 0 && !text.
|
|
3562
|
+
const isFiltered = filterLower.length > 0 && !text.includes(filterLower);
|
|
3552
3563
|
optionRegistrations.set(element, {
|
|
3553
3564
|
callback,
|
|
3554
3565
|
lastFiltered: isFiltered
|
|
@@ -3566,7 +3577,7 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3566
3577
|
const filterLower = newFilter.toLowerCase();
|
|
3567
3578
|
for (const [element, reg] of optionRegistrations) {
|
|
3568
3579
|
const text = getOptionValue(element).toLowerCase();
|
|
3569
|
-
const isFiltered = filterLower.length > 0 && !text.
|
|
3580
|
+
const isFiltered = filterLower.length > 0 && !text.includes(filterLower);
|
|
3570
3581
|
// Only notify when state actually changes to avoid unnecessary re-renders.
|
|
3571
3582
|
if (isFiltered !== reg.lastFiltered) {
|
|
3572
3583
|
reg.lastFiltered = isFiltered;
|
|
@@ -3824,6 +3835,13 @@ function setupComboboxButton(button, callbacks) {
|
|
|
3824
3835
|
return event => {
|
|
3825
3836
|
const nav = combobox.focusNav;
|
|
3826
3837
|
switch (event.key) {
|
|
3838
|
+
case 'Tab':
|
|
3839
|
+
// Selects the focused option
|
|
3840
|
+
if (combobox.isOpen && nav?.hasActiveItem && nav.activeItem) {
|
|
3841
|
+
combobox.select(nav.activeItem);
|
|
3842
|
+
}
|
|
3843
|
+
// Return false to continue normal 'Tab' behavior (focus next).
|
|
3844
|
+
return false;
|
|
3827
3845
|
case ' ':
|
|
3828
3846
|
// Space acts like Enter in button mode.
|
|
3829
3847
|
if (combobox.isOpen && nav?.hasActiveItem && nav.activeItem) {
|
|
@@ -6059,8 +6077,8 @@ const COMPONENT_NAME$1f = 'Tooltip';
|
|
|
6059
6077
|
*/
|
|
6060
6078
|
const CLASSNAME$1e = 'lumx-tooltip';
|
|
6061
6079
|
const {
|
|
6062
|
-
block: block$
|
|
6063
|
-
element: element$
|
|
6080
|
+
block: block$_,
|
|
6081
|
+
element: element$L
|
|
6064
6082
|
} = bem(CLASSNAME$1e);
|
|
6065
6083
|
|
|
6066
6084
|
/**
|
|
@@ -6092,7 +6110,7 @@ const TooltipPopup = props => {
|
|
|
6092
6110
|
...forwardedProps,
|
|
6093
6111
|
id: id,
|
|
6094
6112
|
role: "tooltip",
|
|
6095
|
-
className: classnames(className, block$
|
|
6113
|
+
className: classnames(className, block$_({
|
|
6096
6114
|
[`position-${position}`]: Boolean(position)
|
|
6097
6115
|
}), isHidden && visuallyHidden()),
|
|
6098
6116
|
style: {
|
|
@@ -6101,9 +6119,9 @@ const TooltipPopup = props => {
|
|
|
6101
6119
|
},
|
|
6102
6120
|
"data-popper-placement": position,
|
|
6103
6121
|
children: [/*#__PURE__*/jsx("div", {
|
|
6104
|
-
className: element$
|
|
6122
|
+
className: element$L('arrow')
|
|
6105
6123
|
}), /*#__PURE__*/jsx("div", {
|
|
6106
|
-
className: element$
|
|
6124
|
+
className: element$L('inner'),
|
|
6107
6125
|
children: labelLines.map((line, index) => /*#__PURE__*/jsx("p", {
|
|
6108
6126
|
children: line
|
|
6109
6127
|
}, index))
|
|
@@ -6620,6 +6638,9 @@ function setupComboboxInput(input, options) {
|
|
|
6620
6638
|
onSelect: optionOnSelect
|
|
6621
6639
|
} = options;
|
|
6622
6640
|
|
|
6641
|
+
/** Check if the input is disabled (native `disabled` attribute or `aria-disabled="true"`). */
|
|
6642
|
+
const isDisabled = () => input.disabled || input.getAttribute('aria-disabled') === 'true';
|
|
6643
|
+
|
|
6623
6644
|
/**
|
|
6624
6645
|
* True when the current input value came from user typing (real InputEvent).
|
|
6625
6646
|
* False when the value was set programmatically (select, clear, etc.).
|
|
@@ -6657,6 +6678,7 @@ function setupComboboxInput(input, options) {
|
|
|
6657
6678
|
// Filter on real user typing (InputEvent with `inputType`).
|
|
6658
6679
|
input.addEventListener('input', event => {
|
|
6659
6680
|
if (!(event instanceof InputEvent)) return;
|
|
6681
|
+
if (isDisabled()) return;
|
|
6660
6682
|
combobox.focusNav?.clear();
|
|
6661
6683
|
userHasTyped = true;
|
|
6662
6684
|
combobox.setIsOpen(true);
|
|
@@ -6669,6 +6691,7 @@ function setupComboboxInput(input, options) {
|
|
|
6669
6691
|
|
|
6670
6692
|
// Open on focus.
|
|
6671
6693
|
input.addEventListener('focus', () => {
|
|
6694
|
+
if (isDisabled()) return;
|
|
6672
6695
|
combobox.focusNav?.clear();
|
|
6673
6696
|
combobox.setIsOpen(true);
|
|
6674
6697
|
}, {
|
|
@@ -6676,7 +6699,10 @@ function setupComboboxInput(input, options) {
|
|
|
6676
6699
|
});
|
|
6677
6700
|
|
|
6678
6701
|
// Open on click (handles the case where the input is already focused, so focus doesn't re-fire).
|
|
6679
|
-
input.addEventListener('click', () =>
|
|
6702
|
+
input.addEventListener('click', () => {
|
|
6703
|
+
if (isDisabled()) return;
|
|
6704
|
+
combobox.setIsOpen(true);
|
|
6705
|
+
}, {
|
|
6680
6706
|
signal
|
|
6681
6707
|
});
|
|
6682
6708
|
|
|
@@ -6722,6 +6748,23 @@ function setupComboboxInput(input, options) {
|
|
|
6722
6748
|
return handle;
|
|
6723
6749
|
}
|
|
6724
6750
|
|
|
6751
|
+
/** Disable state */
|
|
6752
|
+
|
|
6753
|
+
/**
|
|
6754
|
+
* Calculate the disabled state based on context and props.
|
|
6755
|
+
*/
|
|
6756
|
+
function getDisabledState(context, props) {
|
|
6757
|
+
const {
|
|
6758
|
+
disabled,
|
|
6759
|
+
isDisabled = disabled,
|
|
6760
|
+
'aria-disabled': ariaDisabled
|
|
6761
|
+
} = props;
|
|
6762
|
+
return {
|
|
6763
|
+
disabled: !!isDisabled,
|
|
6764
|
+
'aria-disabled': ariaDisabled === true || ariaDisabled === 'true'
|
|
6765
|
+
};
|
|
6766
|
+
}
|
|
6767
|
+
|
|
6725
6768
|
/**
|
|
6726
6769
|
* Component display name.
|
|
6727
6770
|
*/
|
|
@@ -6758,7 +6801,12 @@ const ComboboxInput$1 = (props, {
|
|
|
6758
6801
|
theme,
|
|
6759
6802
|
...forwardedProps
|
|
6760
6803
|
} = props;
|
|
6804
|
+
|
|
6805
|
+
// Compute whether the combobox is disabled (native or aria-disabled).
|
|
6806
|
+
const disabledState = getDisabledState(undefined, props);
|
|
6807
|
+
const isAnyDisabled = disabledState.disabled || disabledState['aria-disabled'] || undefined;
|
|
6761
6808
|
return /*#__PURE__*/jsx(TextField, {
|
|
6809
|
+
autoComplete: "off",
|
|
6762
6810
|
...forwardedProps,
|
|
6763
6811
|
ref: ref,
|
|
6764
6812
|
role: "combobox",
|
|
@@ -6767,11 +6815,11 @@ const ComboboxInput$1 = (props, {
|
|
|
6767
6815
|
"aria-expanded": isOpen,
|
|
6768
6816
|
inputRef: inputRef,
|
|
6769
6817
|
textFieldRef: textFieldRef,
|
|
6770
|
-
autoComplete: "off",
|
|
6771
6818
|
theme: theme,
|
|
6772
6819
|
afterElement: toggleButtonProps ? /*#__PURE__*/jsx(IconButton, {
|
|
6773
6820
|
...toggleButtonProps,
|
|
6774
6821
|
theme: theme,
|
|
6822
|
+
isDisabled: isAnyDisabled,
|
|
6775
6823
|
emphasis: "low",
|
|
6776
6824
|
size: "s",
|
|
6777
6825
|
icon: isOpen ? mdiChevronUp : mdiChevronDown,
|
|
@@ -6799,8 +6847,8 @@ const CLASSNAME$1c = 'lumx-text-field';
|
|
|
6799
6847
|
const INPUT_NATIVE_CLASSNAME = `${CLASSNAME$1c}__input-native`;
|
|
6800
6848
|
|
|
6801
6849
|
const {
|
|
6802
|
-
block: block$
|
|
6803
|
-
element: element$
|
|
6850
|
+
block: block$Z,
|
|
6851
|
+
element: element$K
|
|
6804
6852
|
} = bem(CLASSNAME$1c);
|
|
6805
6853
|
|
|
6806
6854
|
/**
|
|
@@ -6870,7 +6918,7 @@ const TextField$1 = props => {
|
|
|
6870
6918
|
const isNotEmpty = valueLength > 0;
|
|
6871
6919
|
return /*#__PURE__*/jsxs("div", {
|
|
6872
6920
|
ref: ref,
|
|
6873
|
-
className: classnames(className, block$
|
|
6921
|
+
className: classnames(className, block$Z({
|
|
6874
6922
|
'has-chips': Boolean(chips),
|
|
6875
6923
|
'has-error': !isValid && hasError,
|
|
6876
6924
|
'has-icon': Boolean(icon),
|
|
@@ -6886,16 +6934,16 @@ const TextField$1 = props => {
|
|
|
6886
6934
|
[`theme-${theme}`]: Boolean(theme)
|
|
6887
6935
|
})),
|
|
6888
6936
|
children: [(label || maxLength) && /*#__PURE__*/jsxs("div", {
|
|
6889
|
-
className: element$
|
|
6937
|
+
className: element$K('header'),
|
|
6890
6938
|
children: [label && InputLabel$1({
|
|
6891
6939
|
...labelProps,
|
|
6892
6940
|
htmlFor: textFieldId,
|
|
6893
|
-
className: element$
|
|
6941
|
+
className: element$K('label'),
|
|
6894
6942
|
isRequired,
|
|
6895
6943
|
theme,
|
|
6896
6944
|
children: label
|
|
6897
6945
|
}), maxLength && /*#__PURE__*/jsxs("div", {
|
|
6898
|
-
className: element$
|
|
6946
|
+
className: element$K('char-counter'),
|
|
6899
6947
|
children: [/*#__PURE__*/jsx("span", {
|
|
6900
6948
|
children: maxLength - valueLength
|
|
6901
6949
|
}), maxLength - valueLength === 0 && Icon$1({
|
|
@@ -6904,44 +6952,44 @@ const TextField$1 = props => {
|
|
|
6904
6952
|
})]
|
|
6905
6953
|
})]
|
|
6906
6954
|
}), /*#__PURE__*/jsxs("div", {
|
|
6907
|
-
className: element$
|
|
6955
|
+
className: element$K('wrapper'),
|
|
6908
6956
|
ref: textFieldRef,
|
|
6909
6957
|
children: [icon && Icon$1({
|
|
6910
|
-
className: element$
|
|
6958
|
+
className: element$K('input-icon'),
|
|
6911
6959
|
color: theme === Theme.dark ? 'light' : undefined,
|
|
6912
6960
|
icon,
|
|
6913
6961
|
size: Size.xs
|
|
6914
6962
|
}), chips ? /*#__PURE__*/jsxs("div", {
|
|
6915
|
-
className: element$
|
|
6963
|
+
className: element$K('chips'),
|
|
6916
6964
|
children: [chips, input]
|
|
6917
6965
|
}) : /*#__PURE__*/jsx("div", {
|
|
6918
|
-
className: element$
|
|
6966
|
+
className: element$K('input-wrapper'),
|
|
6919
6967
|
children: input
|
|
6920
6968
|
}), (isValid || hasError) && Icon$1({
|
|
6921
|
-
className: element$
|
|
6969
|
+
className: element$K('input-validity'),
|
|
6922
6970
|
color: theme === Theme.dark ? 'light' : undefined,
|
|
6923
6971
|
icon: isValid ? mdiCheckCircle : mdiAlertCircle,
|
|
6924
6972
|
size: Size.xxs
|
|
6925
6973
|
}), clearButtonProps && isNotEmpty && !isAnyDisabled && /*#__PURE__*/jsx(IconButton, {
|
|
6926
6974
|
...clearButtonProps,
|
|
6927
|
-
className: element$
|
|
6975
|
+
className: element$K('input-clear'),
|
|
6928
6976
|
icon: mdiCloseCircle,
|
|
6929
6977
|
emphasis: Emphasis.low,
|
|
6930
6978
|
size: Size.s,
|
|
6931
6979
|
theme: theme,
|
|
6932
6980
|
type: "button"
|
|
6933
6981
|
}), afterElement && /*#__PURE__*/jsx("div", {
|
|
6934
|
-
className: element$
|
|
6982
|
+
className: element$K('after-element'),
|
|
6935
6983
|
children: afterElement
|
|
6936
6984
|
})]
|
|
6937
6985
|
}), hasError && error && InputHelper$1({
|
|
6938
6986
|
children: error,
|
|
6939
|
-
className: element$
|
|
6987
|
+
className: element$K('helper'),
|
|
6940
6988
|
kind: Kind.error,
|
|
6941
6989
|
theme,
|
|
6942
6990
|
id: errorId
|
|
6943
6991
|
}), helper && InputHelper$1({
|
|
6944
|
-
className: element$
|
|
6992
|
+
className: element$K('helper'),
|
|
6945
6993
|
theme,
|
|
6946
6994
|
id: helperId,
|
|
6947
6995
|
children: helper
|
|
@@ -6950,7 +6998,7 @@ const TextField$1 = props => {
|
|
|
6950
6998
|
};
|
|
6951
6999
|
|
|
6952
7000
|
const {
|
|
6953
|
-
block: block$
|
|
7001
|
+
block: block$Y
|
|
6954
7002
|
} = bem(INPUT_NATIVE_CLASSNAME);
|
|
6955
7003
|
|
|
6956
7004
|
/**
|
|
@@ -6974,6 +7022,7 @@ const RawInputText$1 = props => {
|
|
|
6974
7022
|
theme,
|
|
6975
7023
|
value,
|
|
6976
7024
|
handleChange,
|
|
7025
|
+
handleInput,
|
|
6977
7026
|
type = DEFAULT_PROPS$10.type,
|
|
6978
7027
|
name,
|
|
6979
7028
|
ref,
|
|
@@ -6982,16 +7031,20 @@ const RawInputText$1 = props => {
|
|
|
6982
7031
|
const handleOnChange = evt => {
|
|
6983
7032
|
handleChange?.(evt.target.value, name, evt);
|
|
6984
7033
|
};
|
|
7034
|
+
const handleOnInput = evt => {
|
|
7035
|
+
handleInput?.(evt.target.value, name, evt);
|
|
7036
|
+
};
|
|
6985
7037
|
return /*#__PURE__*/jsx("input", {
|
|
6986
7038
|
...forwardedProps,
|
|
6987
7039
|
name: name,
|
|
6988
7040
|
type: type,
|
|
6989
7041
|
ref: ref,
|
|
6990
|
-
className: classnames(className, block$
|
|
7042
|
+
className: classnames(className, block$Y({
|
|
6991
7043
|
[`theme-${theme}`]: Boolean(theme),
|
|
6992
7044
|
text: true
|
|
6993
7045
|
})),
|
|
6994
7046
|
onChange: handleOnChange,
|
|
7047
|
+
onInput: handleOnInput,
|
|
6995
7048
|
value: value
|
|
6996
7049
|
});
|
|
6997
7050
|
};
|
|
@@ -7016,7 +7069,7 @@ const RawInputText = forwardRef((props, ref) => {
|
|
|
7016
7069
|
});
|
|
7017
7070
|
|
|
7018
7071
|
const {
|
|
7019
|
-
block: block$
|
|
7072
|
+
block: block$X
|
|
7020
7073
|
} = bem(INPUT_NATIVE_CLASSNAME);
|
|
7021
7074
|
|
|
7022
7075
|
/**
|
|
@@ -7040,6 +7093,7 @@ const RawInputTextarea$1 = props => {
|
|
|
7040
7093
|
theme,
|
|
7041
7094
|
value,
|
|
7042
7095
|
handleChange,
|
|
7096
|
+
handleInput,
|
|
7043
7097
|
rows = DEFAULT_PROPS$$.rows,
|
|
7044
7098
|
name,
|
|
7045
7099
|
ref,
|
|
@@ -7048,15 +7102,19 @@ const RawInputTextarea$1 = props => {
|
|
|
7048
7102
|
const handleOnChange = evt => {
|
|
7049
7103
|
handleChange?.(evt.target.value, name, evt);
|
|
7050
7104
|
};
|
|
7105
|
+
const handleOnInput = evt => {
|
|
7106
|
+
handleInput?.(evt.target.value, name, evt);
|
|
7107
|
+
};
|
|
7051
7108
|
return /*#__PURE__*/jsx("textarea", {
|
|
7052
7109
|
...forwardedProps,
|
|
7053
7110
|
name: name,
|
|
7054
7111
|
ref: ref,
|
|
7055
|
-
className: classnames(className, block$
|
|
7112
|
+
className: classnames(className, block$X({
|
|
7056
7113
|
[`theme-${theme}`]: Boolean(theme),
|
|
7057
7114
|
textarea: true
|
|
7058
7115
|
})),
|
|
7059
7116
|
onChange: handleOnChange,
|
|
7117
|
+
onInput: handleOnInput,
|
|
7060
7118
|
value: value,
|
|
7061
7119
|
rows: rows
|
|
7062
7120
|
});
|
|
@@ -7378,7 +7436,7 @@ const COMPONENT_NAME$1c = 'List';
|
|
|
7378
7436
|
*/
|
|
7379
7437
|
const CLASSNAME$1b = 'lumx-list';
|
|
7380
7438
|
const {
|
|
7381
|
-
block: block$
|
|
7439
|
+
block: block$W
|
|
7382
7440
|
} = bem(CLASSNAME$1b);
|
|
7383
7441
|
|
|
7384
7442
|
/**
|
|
@@ -7402,7 +7460,7 @@ const List$1 = props => {
|
|
|
7402
7460
|
} = props;
|
|
7403
7461
|
return /*#__PURE__*/jsx("ul", {
|
|
7404
7462
|
...forwardedProps,
|
|
7405
|
-
className: classnames(className, block$
|
|
7463
|
+
className: classnames(className, block$W({
|
|
7406
7464
|
[`item-padding-${itemPadding}`]: Boolean(itemPadding)
|
|
7407
7465
|
})),
|
|
7408
7466
|
ref: ref,
|
|
@@ -7551,8 +7609,8 @@ const COMPONENT_NAME$1a = 'ListItem';
|
|
|
7551
7609
|
*/
|
|
7552
7610
|
const CLASSNAME$19 = 'lumx-list-item';
|
|
7553
7611
|
const {
|
|
7554
|
-
block: block$
|
|
7555
|
-
element: element$
|
|
7612
|
+
block: block$V,
|
|
7613
|
+
element: element$J
|
|
7556
7614
|
} = bem(CLASSNAME$19);
|
|
7557
7615
|
|
|
7558
7616
|
/**
|
|
@@ -7590,7 +7648,7 @@ const ListItem$1 = props => {
|
|
|
7590
7648
|
return /*#__PURE__*/jsx("li", {
|
|
7591
7649
|
ref: ref,
|
|
7592
7650
|
...forwardedProps,
|
|
7593
|
-
className: classnames(className, block$
|
|
7651
|
+
className: classnames(className, block$V({
|
|
7594
7652
|
[`size-${size}`]: Boolean(size)
|
|
7595
7653
|
})),
|
|
7596
7654
|
children: RawClickable({
|
|
@@ -7598,7 +7656,7 @@ const ListItem$1 = props => {
|
|
|
7598
7656
|
isDisabled,
|
|
7599
7657
|
'aria-disabled': ariaDisabled,
|
|
7600
7658
|
...linkProps,
|
|
7601
|
-
className: element$
|
|
7659
|
+
className: element$J(clickable ? 'link' : 'wrapper', {
|
|
7602
7660
|
'is-highlighted': isHighlighted,
|
|
7603
7661
|
'is-selected': isSelected,
|
|
7604
7662
|
'is-disabled': isDisabled || ariaDisabled === 'true'
|
|
@@ -7607,13 +7665,13 @@ const ListItem$1 = props => {
|
|
|
7607
7665
|
ref: linkRef,
|
|
7608
7666
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
7609
7667
|
children: [before && /*#__PURE__*/jsx("div", {
|
|
7610
|
-
className: element$
|
|
7668
|
+
className: element$J('before'),
|
|
7611
7669
|
children: before
|
|
7612
7670
|
}), /*#__PURE__*/jsx("div", {
|
|
7613
|
-
className: element$
|
|
7671
|
+
className: element$J('content'),
|
|
7614
7672
|
children: children
|
|
7615
7673
|
}), after && /*#__PURE__*/jsx("div", {
|
|
7616
|
-
className: element$
|
|
7674
|
+
className: element$J('after'),
|
|
7617
7675
|
children: after
|
|
7618
7676
|
})]
|
|
7619
7677
|
})
|
|
@@ -7681,7 +7739,7 @@ const COMPONENT_NAME$18 = 'Text';
|
|
|
7681
7739
|
*/
|
|
7682
7740
|
const CLASSNAME$17 = 'lumx-text';
|
|
7683
7741
|
const {
|
|
7684
|
-
block: block$
|
|
7742
|
+
block: block$U
|
|
7685
7743
|
} = bem(CLASSNAME$17);
|
|
7686
7744
|
|
|
7687
7745
|
/**
|
|
@@ -7723,7 +7781,7 @@ const getTextProps = props => {
|
|
|
7723
7781
|
'--lumx-text-white-space': whiteSpace
|
|
7724
7782
|
};
|
|
7725
7783
|
return {
|
|
7726
|
-
className: classnames(className, block$
|
|
7784
|
+
className: classnames(className, block$U({
|
|
7727
7785
|
'is-truncated': isTruncated && !isTruncatedMultiline,
|
|
7728
7786
|
'is-truncated-multiline': isTruncatedMultiline,
|
|
7729
7787
|
'no-wrap': noWrap
|
|
@@ -7746,8 +7804,8 @@ const COMPONENT_NAME$17 = 'ComboboxOption';
|
|
|
7746
7804
|
*/
|
|
7747
7805
|
const CLASSNAME$16 = 'lumx-combobox-option';
|
|
7748
7806
|
const {
|
|
7749
|
-
block: block$
|
|
7750
|
-
element: element$
|
|
7807
|
+
block: block$T,
|
|
7808
|
+
element: element$I
|
|
7751
7809
|
} = bem(CLASSNAME$16);
|
|
7752
7810
|
|
|
7753
7811
|
/**
|
|
@@ -7792,7 +7850,7 @@ const ComboboxOption$1 = (props, {
|
|
|
7792
7850
|
as: 'button',
|
|
7793
7851
|
...actionProps,
|
|
7794
7852
|
id,
|
|
7795
|
-
className: element$
|
|
7853
|
+
className: element$I('action'),
|
|
7796
7854
|
handleClick,
|
|
7797
7855
|
'aria-selected': isSelected ? 'true' : 'false',
|
|
7798
7856
|
'data-value': value,
|
|
@@ -7810,7 +7868,7 @@ const ComboboxOption$1 = (props, {
|
|
|
7810
7868
|
size: 'tiny',
|
|
7811
7869
|
...forwardedProps,
|
|
7812
7870
|
hidden,
|
|
7813
|
-
className: !hidden ? classnames(className, block$
|
|
7871
|
+
className: !hidden ? classnames(className, block$T()) : undefined,
|
|
7814
7872
|
before,
|
|
7815
7873
|
after,
|
|
7816
7874
|
role: itemRole,
|
|
@@ -7818,7 +7876,7 @@ const ComboboxOption$1 = (props, {
|
|
|
7818
7876
|
children: [wrappedAction, description && /*#__PURE__*/jsx("p", {
|
|
7819
7877
|
id: descriptionId,
|
|
7820
7878
|
...getTextProps({
|
|
7821
|
-
className: element$
|
|
7879
|
+
className: element$I('description'),
|
|
7822
7880
|
typography: 'caption',
|
|
7823
7881
|
color: 'dark-L2'
|
|
7824
7882
|
}),
|
|
@@ -8027,8 +8085,8 @@ const COMPONENT_NAME$15 = 'ComboboxOptionMoreInfo';
|
|
|
8027
8085
|
*/
|
|
8028
8086
|
const CLASSNAME$14 = 'lumx-combobox-option-more-info';
|
|
8029
8087
|
const {
|
|
8030
|
-
block: block$
|
|
8031
|
-
element: element$
|
|
8088
|
+
block: block$S,
|
|
8089
|
+
element: element$H
|
|
8032
8090
|
} = bem(CLASSNAME$14);
|
|
8033
8091
|
|
|
8034
8092
|
/**
|
|
@@ -8063,7 +8121,7 @@ const ComboboxOptionMoreInfo$1 = (props, {
|
|
|
8063
8121
|
icon: mdiInformationOutline,
|
|
8064
8122
|
size: "s",
|
|
8065
8123
|
...buttonProps,
|
|
8066
|
-
className: block$
|
|
8124
|
+
className: block$S([className, buttonProps?.className]),
|
|
8067
8125
|
emphasis: "low",
|
|
8068
8126
|
onMouseEnter: onMouseEnter,
|
|
8069
8127
|
onMouseLeave: onMouseLeave
|
|
@@ -8074,7 +8132,7 @@ const ComboboxOptionMoreInfo$1 = (props, {
|
|
|
8074
8132
|
label: ""
|
|
8075
8133
|
}), /*#__PURE__*/jsx(Popover, {
|
|
8076
8134
|
id: popoverId,
|
|
8077
|
-
className: element$
|
|
8135
|
+
className: element$H('popover'),
|
|
8078
8136
|
anchorRef: ref,
|
|
8079
8137
|
isOpen: isOpen,
|
|
8080
8138
|
closeMode: "unmount",
|
|
@@ -8275,8 +8333,8 @@ const COMPONENT_NAME$14 = 'Popover';
|
|
|
8275
8333
|
*/
|
|
8276
8334
|
const CLASSNAME$13 = 'lumx-popover';
|
|
8277
8335
|
const {
|
|
8278
|
-
block: block$
|
|
8279
|
-
element: element$
|
|
8336
|
+
block: block$R,
|
|
8337
|
+
element: element$G
|
|
8280
8338
|
} = bem(CLASSNAME$13);
|
|
8281
8339
|
|
|
8282
8340
|
/**
|
|
@@ -8339,7 +8397,7 @@ const Popover$1 = (props, {
|
|
|
8339
8397
|
children: /*#__PURE__*/jsxs(Component, {
|
|
8340
8398
|
...forwardedProps,
|
|
8341
8399
|
ref: ref,
|
|
8342
|
-
className: classnames(className, block$
|
|
8400
|
+
className: classnames(className, block$R({
|
|
8343
8401
|
[`theme-${theme}`]: Boolean(theme),
|
|
8344
8402
|
[`elevation-${adjustedElevation}`]: Boolean(adjustedElevation),
|
|
8345
8403
|
[`position-${position}`]: Boolean(position),
|
|
@@ -8352,7 +8410,7 @@ const Popover$1 = (props, {
|
|
|
8352
8410
|
childrenRefs: clickAwayRefs,
|
|
8353
8411
|
children: [hasArrow && /*#__PURE__*/jsx("div", {
|
|
8354
8412
|
ref: arrowRef,
|
|
8355
|
-
className: element$
|
|
8413
|
+
className: element$G('arrow'),
|
|
8356
8414
|
style: isHidden ? undefined : arrowStyle,
|
|
8357
8415
|
children: /*#__PURE__*/jsx("svg", {
|
|
8358
8416
|
viewBox: "0 0 14 14",
|
|
@@ -8818,8 +8876,8 @@ const COMPONENT_NAME$13 = 'SkeletonTypography';
|
|
|
8818
8876
|
*/
|
|
8819
8877
|
const CLASSNAME$12 = 'lumx-skeleton-typography';
|
|
8820
8878
|
const {
|
|
8821
|
-
block: block$
|
|
8822
|
-
element: element$
|
|
8879
|
+
block: block$Q,
|
|
8880
|
+
element: element$F
|
|
8823
8881
|
} = bem(CLASSNAME$12);
|
|
8824
8882
|
|
|
8825
8883
|
/**
|
|
@@ -8841,7 +8899,7 @@ const SkeletonTypography$1 = props => {
|
|
|
8841
8899
|
return /*#__PURE__*/jsx("div", {
|
|
8842
8900
|
ref: ref,
|
|
8843
8901
|
...forwardedProps,
|
|
8844
|
-
className: classnames(className, block$
|
|
8902
|
+
className: classnames(className, block$Q({
|
|
8845
8903
|
[`theme-${theme}`]: Boolean(theme),
|
|
8846
8904
|
[`typography-${typography}`]: Boolean(typography),
|
|
8847
8905
|
[`color-${color}`]: Boolean(color)
|
|
@@ -8851,7 +8909,7 @@ const SkeletonTypography$1 = props => {
|
|
|
8851
8909
|
width
|
|
8852
8910
|
},
|
|
8853
8911
|
children: /*#__PURE__*/jsx("div", {
|
|
8854
|
-
className: element$
|
|
8912
|
+
className: element$F('inner')
|
|
8855
8913
|
})
|
|
8856
8914
|
});
|
|
8857
8915
|
};
|
|
@@ -8883,9 +8941,10 @@ const ComboboxOptionSkeleton$1 = props => {
|
|
|
8883
8941
|
children,
|
|
8884
8942
|
className,
|
|
8885
8943
|
ref,
|
|
8944
|
+
count = 1,
|
|
8886
8945
|
...forwardedProps
|
|
8887
8946
|
} = props;
|
|
8888
|
-
|
|
8947
|
+
const itemProps = {
|
|
8889
8948
|
ref,
|
|
8890
8949
|
size: 'tiny',
|
|
8891
8950
|
role: 'none',
|
|
@@ -8900,6 +8959,13 @@ const ComboboxOptionSkeleton$1 = props => {
|
|
|
8900
8959
|
theme: "light"
|
|
8901
8960
|
})]
|
|
8902
8961
|
})
|
|
8962
|
+
};
|
|
8963
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
8964
|
+
children: Array.from({
|
|
8965
|
+
length: count
|
|
8966
|
+
}, (_, i) => /*#__PURE__*/jsx(ListItem$1, {
|
|
8967
|
+
...itemProps
|
|
8968
|
+
}, i))
|
|
8903
8969
|
});
|
|
8904
8970
|
};
|
|
8905
8971
|
|
|
@@ -8928,19 +8994,13 @@ const ComboboxOptionSkeleton$1 = props => {
|
|
|
8928
8994
|
* @return React element(s).
|
|
8929
8995
|
*/
|
|
8930
8996
|
const ComboboxOptionSkeleton = props => {
|
|
8931
|
-
const {
|
|
8932
|
-
count = 1,
|
|
8933
|
-
...itemProps
|
|
8934
|
-
} = props;
|
|
8935
8997
|
const {
|
|
8936
8998
|
handle
|
|
8937
8999
|
} = useComboboxContext();
|
|
8938
9000
|
useEffect(() => handle?.registerSkeleton(), [handle]);
|
|
8939
|
-
return
|
|
8940
|
-
|
|
8941
|
-
}
|
|
8942
|
-
...itemProps
|
|
8943
|
-
}, i));
|
|
9001
|
+
return /*#__PURE__*/jsx(ComboboxOptionSkeleton$1, {
|
|
9002
|
+
...props
|
|
9003
|
+
});
|
|
8944
9004
|
};
|
|
8945
9005
|
ComboboxOptionSkeleton.displayName = COMPONENT_NAME$12;
|
|
8946
9006
|
ComboboxOptionSkeleton.className = CLASSNAME$11;
|
|
@@ -8951,6 +9011,10 @@ const COMPONENT_NAME$11 = 'ComboboxPopover';
|
|
|
8951
9011
|
* Component default class name.
|
|
8952
9012
|
*/
|
|
8953
9013
|
const CLASSNAME$10 = 'lumx-combobox-popover';
|
|
9014
|
+
const {
|
|
9015
|
+
block: block$P,
|
|
9016
|
+
element: element$E
|
|
9017
|
+
} = bem(CLASSNAME$10);
|
|
8954
9018
|
|
|
8955
9019
|
/**
|
|
8956
9020
|
* Defines the props for the core ComboboxPopover template.
|
|
@@ -8972,7 +9036,8 @@ const CLASSNAME$10 = 'lumx-combobox-popover';
|
|
|
8972
9036
|
* @return JSX element.
|
|
8973
9037
|
*/
|
|
8974
9038
|
const ComboboxPopover$1 = (props, {
|
|
8975
|
-
Popover
|
|
9039
|
+
Popover,
|
|
9040
|
+
FlexBox
|
|
8976
9041
|
}) => {
|
|
8977
9042
|
const {
|
|
8978
9043
|
children,
|
|
@@ -8990,17 +9055,95 @@ const ComboboxPopover$1 = (props, {
|
|
|
8990
9055
|
...forwardedProps,
|
|
8991
9056
|
placement: placement,
|
|
8992
9057
|
fitToAnchorWidth: fitToAnchorWidth,
|
|
8993
|
-
className:
|
|
9058
|
+
className: block$P([className]),
|
|
8994
9059
|
anchorRef: anchorRef,
|
|
8995
9060
|
isOpen: isOpen,
|
|
8996
9061
|
onClose: handleClose,
|
|
8997
9062
|
closeOnClickAway: closeOnClickAway,
|
|
8998
9063
|
closeOnEscape: closeOnEscape,
|
|
8999
9064
|
closeMode: "hide",
|
|
9000
|
-
children:
|
|
9065
|
+
children: /*#__PURE__*/jsx(FlexBox, {
|
|
9066
|
+
orientation: "vertical",
|
|
9067
|
+
className: element$E('scroll'),
|
|
9068
|
+
children: children
|
|
9069
|
+
})
|
|
9001
9070
|
});
|
|
9002
9071
|
};
|
|
9003
9072
|
|
|
9073
|
+
/**
|
|
9074
|
+
* Defines the props of the component.
|
|
9075
|
+
*/
|
|
9076
|
+
|
|
9077
|
+
/**
|
|
9078
|
+
* Component display name.
|
|
9079
|
+
*/
|
|
9080
|
+
const COMPONENT_NAME$10 = 'FlexBox';
|
|
9081
|
+
|
|
9082
|
+
/**
|
|
9083
|
+
* Component default class name and class prefix.
|
|
9084
|
+
*/
|
|
9085
|
+
const CLASSNAME$$ = 'lumx-flex-box';
|
|
9086
|
+
const {
|
|
9087
|
+
block: block$O
|
|
9088
|
+
} = bem(CLASSNAME$$);
|
|
9089
|
+
|
|
9090
|
+
/**
|
|
9091
|
+
* Get FlexBox component props (className computation).
|
|
9092
|
+
*
|
|
9093
|
+
* @param props Component props.
|
|
9094
|
+
* @return Computed props with className.
|
|
9095
|
+
*/
|
|
9096
|
+
function getFlexBoxProps(props) {
|
|
9097
|
+
const {
|
|
9098
|
+
className,
|
|
9099
|
+
fillSpace,
|
|
9100
|
+
gap,
|
|
9101
|
+
hAlign,
|
|
9102
|
+
marginAuto,
|
|
9103
|
+
noShrink,
|
|
9104
|
+
vAlign,
|
|
9105
|
+
wrap,
|
|
9106
|
+
orientation,
|
|
9107
|
+
...forwardedProps
|
|
9108
|
+
} = props;
|
|
9109
|
+
const adjustedOrientation = orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null);
|
|
9110
|
+
return {
|
|
9111
|
+
...forwardedProps,
|
|
9112
|
+
className: classnames(className, block$O({
|
|
9113
|
+
[`orientation-${adjustedOrientation}`]: Boolean(adjustedOrientation),
|
|
9114
|
+
[`v-align-${vAlign}`]: Boolean(vAlign),
|
|
9115
|
+
[`h-align-${hAlign}`]: Boolean(hAlign),
|
|
9116
|
+
[`gap-${gap}`]: Boolean(gap),
|
|
9117
|
+
wrap: Boolean(wrap),
|
|
9118
|
+
'fill-space': fillSpace,
|
|
9119
|
+
'no-shrink': noShrink,
|
|
9120
|
+
...Object.fromEntries(castArray(marginAuto).filter(Boolean).map(align => [`margin-auto-${align}`, true]))
|
|
9121
|
+
}))
|
|
9122
|
+
};
|
|
9123
|
+
}
|
|
9124
|
+
|
|
9125
|
+
/**
|
|
9126
|
+
* FlexBox component.
|
|
9127
|
+
*
|
|
9128
|
+
* @param props Component props.
|
|
9129
|
+
* @param ref Component ref.
|
|
9130
|
+
* @return React element.
|
|
9131
|
+
*/
|
|
9132
|
+
const FlexBox = forwardRef((props, ref) => {
|
|
9133
|
+
const {
|
|
9134
|
+
as: Component = 'div',
|
|
9135
|
+
children,
|
|
9136
|
+
...forwardedProps
|
|
9137
|
+
} = props;
|
|
9138
|
+
return /*#__PURE__*/jsx(Component, {
|
|
9139
|
+
ref: ref,
|
|
9140
|
+
...getFlexBoxProps(forwardedProps),
|
|
9141
|
+
children: children
|
|
9142
|
+
});
|
|
9143
|
+
});
|
|
9144
|
+
FlexBox.displayName = COMPONENT_NAME$10;
|
|
9145
|
+
FlexBox.className = CLASSNAME$$;
|
|
9146
|
+
|
|
9004
9147
|
/**
|
|
9005
9148
|
* Props for Popover that can be passed to Combobox.Popover.
|
|
9006
9149
|
* Excludes isOpen, anchorRef, children, and onClose which are managed internally.
|
|
@@ -9033,7 +9176,8 @@ const ComboboxPopover = props => {
|
|
|
9033
9176
|
anchorRef: anchorRef,
|
|
9034
9177
|
handleClose: () => setIsOpen(false)
|
|
9035
9178
|
}, {
|
|
9036
|
-
Popover
|
|
9179
|
+
Popover,
|
|
9180
|
+
FlexBox
|
|
9037
9181
|
});
|
|
9038
9182
|
};
|
|
9039
9183
|
ComboboxPopover.displayName = COMPONENT_NAME$11;
|
|
@@ -9071,12 +9215,12 @@ ComboboxProvider.displayName = 'Combobox.Provider';
|
|
|
9071
9215
|
/**
|
|
9072
9216
|
* Component display name.
|
|
9073
9217
|
*/
|
|
9074
|
-
const COMPONENT_NAME
|
|
9218
|
+
const COMPONENT_NAME$$ = 'ComboboxSection';
|
|
9075
9219
|
|
|
9076
9220
|
/**
|
|
9077
9221
|
* Component default class name and class prefix.
|
|
9078
9222
|
*/
|
|
9079
|
-
const CLASSNAME
|
|
9223
|
+
const CLASSNAME$_ = 'lumx-combobox-section';
|
|
9080
9224
|
|
|
9081
9225
|
/**
|
|
9082
9226
|
* ComboboxSection core template.
|
|
@@ -9103,7 +9247,7 @@ const ComboboxSection$1 = (props, {
|
|
|
9103
9247
|
...forwardedProps,
|
|
9104
9248
|
hidden: hidden,
|
|
9105
9249
|
"aria-hidden": ariaHidden || undefined,
|
|
9106
|
-
className: !hidden ? classnames(className, CLASSNAME
|
|
9250
|
+
className: !hidden ? classnames(className, CLASSNAME$_) : undefined,
|
|
9107
9251
|
role: !ariaHidden ? 'none' : undefined,
|
|
9108
9252
|
itemsWrapperProps: {
|
|
9109
9253
|
role: 'group'
|
|
@@ -9112,365 +9256,24 @@ const ComboboxSection$1 = (props, {
|
|
|
9112
9256
|
});
|
|
9113
9257
|
};
|
|
9114
9258
|
|
|
9115
|
-
const INITIAL_INDEX = -1;
|
|
9116
|
-
|
|
9117
9259
|
/**
|
|
9118
|
-
*
|
|
9119
|
-
* a list using the keyboard.
|
|
9120
|
-
*
|
|
9121
|
-
* @param items the list of items that will be navigated using the keyboard.
|
|
9122
|
-
* @param ref A reference to the element that is controlling the navigation.
|
|
9123
|
-
* @param onListItemSelected callback to be executed when the ENTER key is pressed on an item.
|
|
9124
|
-
* @param onListItemNavigated callback to be executed when the Arrow keys are pressed.
|
|
9125
|
-
* @param onEnterPressed callback to be executed when the ENTER key is pressed.
|
|
9126
|
-
* @param onBackspacePressed callback to be executed when the BACKSPACE key is pressed.
|
|
9127
|
-
* @param keepFocusAfterSelection determines whether after selecting an item, the focus should be maintained on the current target or not.
|
|
9128
|
-
* @param initialIndex where should the navigation start from. it defaults to `-1`, so the first item navigated is the item on position `0`.
|
|
9129
|
-
* @param preventTabOnEnteredValue determines whether upon TAB, if there is a value entered, the event is prevented or not.
|
|
9130
|
-
* @return useKeyboardListNavigation helpers.
|
|
9260
|
+
* Component display name.
|
|
9131
9261
|
*/
|
|
9132
|
-
const
|
|
9133
|
-
const [activeItemIndex, setActiveItemIndex] = useState(initialIndex);
|
|
9134
|
-
|
|
9135
|
-
/**
|
|
9136
|
-
* This function calculates the next index in the list to be highlighted
|
|
9137
|
-
* @param key - key code pressed
|
|
9138
|
-
* @return next active index
|
|
9139
|
-
*/
|
|
9140
|
-
const calculateActiveIndex = key => {
|
|
9141
|
-
switch (key) {
|
|
9142
|
-
case 'ArrowDown':
|
|
9143
|
-
return activeItemIndex + 1 < items.length ? activeItemIndex + 1 : 0;
|
|
9144
|
-
case 'ArrowUp':
|
|
9145
|
-
return activeItemIndex - 1 >= 0 ? activeItemIndex - 1 : items.length - 1;
|
|
9146
|
-
default:
|
|
9147
|
-
return initialIndex;
|
|
9148
|
-
}
|
|
9149
|
-
};
|
|
9262
|
+
const COMPONENT_NAME$_ = 'ListSection';
|
|
9150
9263
|
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9264
|
+
/**
|
|
9265
|
+
* Component default class name and class prefix.
|
|
9266
|
+
*/
|
|
9267
|
+
const CLASSNAME$Z = 'lumx-list-section';
|
|
9268
|
+
const {
|
|
9269
|
+
block: block$N,
|
|
9270
|
+
element: element$D
|
|
9271
|
+
} = bem(CLASSNAME$Z);
|
|
9157
9272
|
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
const preventDefaultAndStopPropagation = evt => {
|
|
9163
|
-
evt.preventDefault();
|
|
9164
|
-
evt.stopPropagation();
|
|
9165
|
-
};
|
|
9166
|
-
|
|
9167
|
-
/**
|
|
9168
|
-
* Handles navigation with the arrows using the keyboard
|
|
9169
|
-
* @param evt - key pressed event
|
|
9170
|
-
*/
|
|
9171
|
-
const onArrowPressed = evt => {
|
|
9172
|
-
const {
|
|
9173
|
-
key
|
|
9174
|
-
} = evt;
|
|
9175
|
-
const nextActiveIndex = calculateActiveIndex(key);
|
|
9176
|
-
setActiveItemIndex(nextActiveIndex);
|
|
9177
|
-
preventDefaultAndStopPropagation(evt);
|
|
9178
|
-
if (onListItemNavigated) {
|
|
9179
|
-
const selectedItem = items[nextActiveIndex];
|
|
9180
|
-
onListItemNavigated(selectedItem);
|
|
9181
|
-
}
|
|
9182
|
-
};
|
|
9183
|
-
|
|
9184
|
-
/**
|
|
9185
|
-
* Handles the event when the backspace key is pressed
|
|
9186
|
-
* @param evt - key pressed event
|
|
9187
|
-
*/
|
|
9188
|
-
const onBackspaceKeyPressed = evt => {
|
|
9189
|
-
if (onBackspacePressed) {
|
|
9190
|
-
onBackspacePressed(evt);
|
|
9191
|
-
}
|
|
9192
|
-
};
|
|
9193
|
-
|
|
9194
|
-
/**
|
|
9195
|
-
* Handles when the ENTER key is pressed
|
|
9196
|
-
* @param evt - key pressed event
|
|
9197
|
-
*/
|
|
9198
|
-
const onEnterKeyPressed = evt => {
|
|
9199
|
-
if (!onListItemSelected) {
|
|
9200
|
-
return;
|
|
9201
|
-
}
|
|
9202
|
-
preventDefaultAndStopPropagation(evt);
|
|
9203
|
-
if (!keepFocusAfterSelection) {
|
|
9204
|
-
evt.currentTarget.blur();
|
|
9205
|
-
}
|
|
9206
|
-
const selectedItem = items[activeItemIndex];
|
|
9207
|
-
if (selectedItem) {
|
|
9208
|
-
onListItemSelected(selectedItem);
|
|
9209
|
-
resetActiveIndex();
|
|
9210
|
-
} else if (activeItemIndex === initialIndex && onEnterPressed) {
|
|
9211
|
-
const value = get(evt, 'target.value');
|
|
9212
|
-
onEnterPressed(value);
|
|
9213
|
-
resetActiveIndex();
|
|
9214
|
-
}
|
|
9215
|
-
};
|
|
9216
|
-
|
|
9217
|
-
/**
|
|
9218
|
-
* Handles when the TAB key is pressed
|
|
9219
|
-
* @param evt - key pressed event
|
|
9220
|
-
*/
|
|
9221
|
-
const onTabKeyPressed = evt => {
|
|
9222
|
-
const value = get(evt, 'target.value');
|
|
9223
|
-
if (preventTabOnEnteredValue && value && value.length > 0) {
|
|
9224
|
-
preventDefaultAndStopPropagation(evt);
|
|
9225
|
-
}
|
|
9226
|
-
};
|
|
9227
|
-
|
|
9228
|
-
/**
|
|
9229
|
-
* In order to make it easier in the future to add new events depending on the key
|
|
9230
|
-
* a map was created to add these handlers. In the future, if there is another event
|
|
9231
|
-
* that we need to manage depending on a specific key, we just need to add the key code
|
|
9232
|
-
* here, and as a value, the handler for said key.
|
|
9233
|
-
*/
|
|
9234
|
-
const eventsForKeyPressed = {
|
|
9235
|
-
ArrowDown: onArrowPressed,
|
|
9236
|
-
Tab: onTabKeyPressed,
|
|
9237
|
-
ArrowUp: onArrowPressed,
|
|
9238
|
-
Enter: onEnterKeyPressed,
|
|
9239
|
-
Backspace: onBackspaceKeyPressed
|
|
9240
|
-
};
|
|
9241
|
-
|
|
9242
|
-
/**
|
|
9243
|
-
* Calculates the next active item index depending on the key pressed.
|
|
9244
|
-
* If the key pressed was ENTER, the function executes the callback `onListItemSelected`
|
|
9245
|
-
* and resets the active index, since an item was selected.
|
|
9246
|
-
* @param evt - key pressed or key down event
|
|
9247
|
-
*/
|
|
9248
|
-
const onKeyboardNavigation = evt => {
|
|
9249
|
-
const {
|
|
9250
|
-
key
|
|
9251
|
-
} = evt;
|
|
9252
|
-
const handler = eventsForKeyPressed[key];
|
|
9253
|
-
if (handler) {
|
|
9254
|
-
handler(evt);
|
|
9255
|
-
}
|
|
9256
|
-
};
|
|
9257
|
-
useEffect(() => {
|
|
9258
|
-
const {
|
|
9259
|
-
current: currentElement
|
|
9260
|
-
} = ref;
|
|
9261
|
-
if (!currentElement) {
|
|
9262
|
-
return undefined;
|
|
9263
|
-
}
|
|
9264
|
-
currentElement.addEventListener('focus', resetActiveIndex);
|
|
9265
|
-
currentElement.addEventListener('keydown', onKeyboardNavigation);
|
|
9266
|
-
return () => {
|
|
9267
|
-
currentElement.removeEventListener('focus', resetActiveIndex);
|
|
9268
|
-
currentElement.removeEventListener('keydown', onKeyboardNavigation);
|
|
9269
|
-
};
|
|
9270
|
-
});
|
|
9271
|
-
return {
|
|
9272
|
-
activeItemIndex,
|
|
9273
|
-
onKeyboardNavigation,
|
|
9274
|
-
resetActiveIndex,
|
|
9275
|
-
setActiveItemIndex
|
|
9276
|
-
};
|
|
9277
|
-
};
|
|
9278
|
-
|
|
9279
|
-
/**
|
|
9280
|
-
* Defines the props of the component.
|
|
9281
|
-
*/
|
|
9282
|
-
|
|
9283
|
-
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
9284
|
-
/**
|
|
9285
|
-
* List component.
|
|
9286
|
-
*
|
|
9287
|
-
* @param props Component props.
|
|
9288
|
-
* @param ref Component ref.
|
|
9289
|
-
* @return React element.
|
|
9290
|
-
*/
|
|
9291
|
-
const InternalList = forwardRef((props, ref) => {
|
|
9292
|
-
const {
|
|
9293
|
-
children,
|
|
9294
|
-
isClickable,
|
|
9295
|
-
onListItemSelected,
|
|
9296
|
-
itemPadding,
|
|
9297
|
-
...forwardedProps
|
|
9298
|
-
} = props;
|
|
9299
|
-
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
9300
|
-
return List$1({
|
|
9301
|
-
...forwardedProps,
|
|
9302
|
-
ref,
|
|
9303
|
-
children,
|
|
9304
|
-
itemPadding: adjustedItemPadding
|
|
9305
|
-
});
|
|
9306
|
-
});
|
|
9307
|
-
InternalList.displayName = COMPONENT_NAME$1c;
|
|
9308
|
-
InternalList.className = CLASSNAME$1b;
|
|
9309
|
-
InternalList.defaultProps = DEFAULT_PROPS$Y;
|
|
9310
|
-
const List = Object.assign(InternalList, {
|
|
9311
|
-
useKeyboardListNavigation
|
|
9312
|
-
});
|
|
9313
|
-
|
|
9314
|
-
/**
|
|
9315
|
-
* ListItem.Action props.
|
|
9316
|
-
*/
|
|
9317
|
-
|
|
9318
|
-
/**
|
|
9319
|
-
* ListItem.Action sub-component.
|
|
9320
|
-
*
|
|
9321
|
-
* Renders a button or link with action area classes.
|
|
9322
|
-
* When placed as a child of ListItem, it activates the action area pattern:
|
|
9323
|
-
* the entire list item becomes visually clickable, while other interactive
|
|
9324
|
-
* elements (in `before`/`after` slots) remain independently clickable.
|
|
9325
|
-
*
|
|
9326
|
-
* @param props Component props.
|
|
9327
|
-
* @param ref Component ref.
|
|
9328
|
-
* @return React element.
|
|
9329
|
-
*/
|
|
9330
|
-
const ListItemAction = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
9331
|
-
const {
|
|
9332
|
-
children,
|
|
9333
|
-
onClick,
|
|
9334
|
-
...forwardedProps
|
|
9335
|
-
} = props;
|
|
9336
|
-
return ListItemAction$1({
|
|
9337
|
-
...forwardedProps,
|
|
9338
|
-
handleClick: onClick,
|
|
9339
|
-
ref,
|
|
9340
|
-
children
|
|
9341
|
-
});
|
|
9342
|
-
}), {
|
|
9343
|
-
displayName: COMPONENT_NAME$19,
|
|
9344
|
-
className: CLASSNAME$18,
|
|
9345
|
-
defaultProps: DEFAULT_PROPS$W
|
|
9346
|
-
});
|
|
9347
|
-
|
|
9348
|
-
/**
|
|
9349
|
-
* Defines the props of the component.
|
|
9350
|
-
*/
|
|
9351
|
-
|
|
9352
|
-
/**
|
|
9353
|
-
* ListItem component.
|
|
9354
|
-
*
|
|
9355
|
-
* @param props Component props.
|
|
9356
|
-
* @param ref Component ref.
|
|
9357
|
-
* @return React element.
|
|
9358
|
-
*/
|
|
9359
|
-
const _ListItem = forwardRef((props, ref) => {
|
|
9360
|
-
const {
|
|
9361
|
-
disabledStateProps,
|
|
9362
|
-
otherProps
|
|
9363
|
-
} = useDisableStateProps(props);
|
|
9364
|
-
const {
|
|
9365
|
-
onItemSelected,
|
|
9366
|
-
onClick,
|
|
9367
|
-
linkRef,
|
|
9368
|
-
...forwardedProps
|
|
9369
|
-
} = otherProps;
|
|
9370
|
-
const handleClick = event => {
|
|
9371
|
-
onItemSelected?.(event);
|
|
9372
|
-
onClick?.(event);
|
|
9373
|
-
};
|
|
9374
|
-
return ListItem$1({
|
|
9375
|
-
...forwardedProps,
|
|
9376
|
-
isDisabled: disabledStateProps.disabled,
|
|
9377
|
-
'aria-disabled': disabledStateProps['aria-disabled'],
|
|
9378
|
-
ref,
|
|
9379
|
-
linkRef,
|
|
9380
|
-
handleClick: onItemSelected || props.onClick ? handleClick : undefined
|
|
9381
|
-
});
|
|
9382
|
-
});
|
|
9383
|
-
_ListItem.displayName = COMPONENT_NAME$1a;
|
|
9384
|
-
_ListItem.className = CLASSNAME$19;
|
|
9385
|
-
_ListItem.defaultProps = DEFAULT_PROPS$X;
|
|
9386
|
-
|
|
9387
|
-
/**
|
|
9388
|
-
* ListItem component with Action sub-component.
|
|
9389
|
-
*/
|
|
9390
|
-
const ListItem = Object.assign(_ListItem, {
|
|
9391
|
-
/** Sub-component that renders the default action (button or link) for the action area pattern. */
|
|
9392
|
-
Action: ListItemAction
|
|
9393
|
-
});
|
|
9394
|
-
|
|
9395
|
-
/**
|
|
9396
|
-
* Component display name.
|
|
9397
|
-
*/
|
|
9398
|
-
const COMPONENT_NAME$$ = 'ListDivider';
|
|
9399
|
-
|
|
9400
|
-
/**
|
|
9401
|
-
* Component default class name and class prefix.
|
|
9402
|
-
*/
|
|
9403
|
-
const CLASSNAME$_ = 'lumx-list-divider';
|
|
9404
|
-
|
|
9405
|
-
/**
|
|
9406
|
-
* Component default props.
|
|
9407
|
-
*/
|
|
9408
|
-
const DEFAULT_PROPS$T = {};
|
|
9409
|
-
|
|
9410
|
-
/**
|
|
9411
|
-
* ListDivider component.
|
|
9412
|
-
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9413
|
-
*
|
|
9414
|
-
* @param props Component props.
|
|
9415
|
-
* @return JSX element.
|
|
9416
|
-
*/
|
|
9417
|
-
const ListDivider$1 = props => {
|
|
9418
|
-
const {
|
|
9419
|
-
className,
|
|
9420
|
-
ref,
|
|
9421
|
-
...forwardedProps
|
|
9422
|
-
} = props;
|
|
9423
|
-
return /*#__PURE__*/jsx("li", {
|
|
9424
|
-
ref: ref,
|
|
9425
|
-
role: "none",
|
|
9426
|
-
...forwardedProps,
|
|
9427
|
-
className: classnames(className, CLASSNAME$_)
|
|
9428
|
-
});
|
|
9429
|
-
};
|
|
9430
|
-
ListDivider$1.displayName = COMPONENT_NAME$$;
|
|
9431
|
-
ListDivider$1.className = CLASSNAME$_;
|
|
9432
|
-
ListDivider$1.defaultProps = DEFAULT_PROPS$T;
|
|
9433
|
-
|
|
9434
|
-
/**
|
|
9435
|
-
* Defines the props of the component.
|
|
9436
|
-
*/
|
|
9437
|
-
|
|
9438
|
-
/**
|
|
9439
|
-
* ListDivider component.
|
|
9440
|
-
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9441
|
-
*
|
|
9442
|
-
* @param props Component props.
|
|
9443
|
-
* @param ref Component ref.
|
|
9444
|
-
* @return React element.
|
|
9445
|
-
*/
|
|
9446
|
-
const ListDivider = forwardRef((props, ref) => {
|
|
9447
|
-
return ListDivider$1({
|
|
9448
|
-
...props,
|
|
9449
|
-
ref
|
|
9450
|
-
});
|
|
9451
|
-
});
|
|
9452
|
-
ListDivider.displayName = COMPONENT_NAME$$;
|
|
9453
|
-
ListDivider.className = CLASSNAME$_;
|
|
9454
|
-
ListDivider.defaultProps = DEFAULT_PROPS$T;
|
|
9455
|
-
|
|
9456
|
-
/**
|
|
9457
|
-
* Component display name.
|
|
9458
|
-
*/
|
|
9459
|
-
const COMPONENT_NAME$_ = 'ListSection';
|
|
9460
|
-
|
|
9461
|
-
/**
|
|
9462
|
-
* Component default class name and class prefix.
|
|
9463
|
-
*/
|
|
9464
|
-
const CLASSNAME$Z = 'lumx-list-section';
|
|
9465
|
-
const {
|
|
9466
|
-
block: block$O,
|
|
9467
|
-
element: element$D
|
|
9468
|
-
} = bem(CLASSNAME$Z);
|
|
9469
|
-
|
|
9470
|
-
/**
|
|
9471
|
-
* Component default props.
|
|
9472
|
-
*/
|
|
9473
|
-
const DEFAULT_PROPS$S = {};
|
|
9273
|
+
/**
|
|
9274
|
+
* Component default props.
|
|
9275
|
+
*/
|
|
9276
|
+
const DEFAULT_PROPS$T = {};
|
|
9474
9277
|
|
|
9475
9278
|
/**
|
|
9476
9279
|
* ListSection component.
|
|
@@ -9495,7 +9298,7 @@ const ListSection$1 = props => {
|
|
|
9495
9298
|
return /*#__PURE__*/jsxs("li", {
|
|
9496
9299
|
ref: ref,
|
|
9497
9300
|
...forwardedProps,
|
|
9498
|
-
className: classnames(className, block$
|
|
9301
|
+
className: classnames(className, block$N()),
|
|
9499
9302
|
children: [hasHeader && /*#__PURE__*/jsxs(Text, {
|
|
9500
9303
|
as: "p",
|
|
9501
9304
|
typography: "overline",
|
|
@@ -9514,7 +9317,7 @@ const ListSection$1 = props => {
|
|
|
9514
9317
|
};
|
|
9515
9318
|
ListSection$1.displayName = COMPONENT_NAME$_;
|
|
9516
9319
|
ListSection$1.className = CLASSNAME$Z;
|
|
9517
|
-
ListSection$1.defaultProps = DEFAULT_PROPS$
|
|
9320
|
+
ListSection$1.defaultProps = DEFAULT_PROPS$T;
|
|
9518
9321
|
|
|
9519
9322
|
/**
|
|
9520
9323
|
* Defines the props of the component.
|
|
@@ -9538,41 +9341,7 @@ const ListSection = forwardRef((props, ref) => {
|
|
|
9538
9341
|
});
|
|
9539
9342
|
ListSection.displayName = COMPONENT_NAME$_;
|
|
9540
9343
|
ListSection.className = CLASSNAME$Z;
|
|
9541
|
-
ListSection.defaultProps = DEFAULT_PROPS$
|
|
9542
|
-
|
|
9543
|
-
/**
|
|
9544
|
-
* Component display name.
|
|
9545
|
-
*/
|
|
9546
|
-
const COMPONENT_NAME$Z = 'ListSubheader';
|
|
9547
|
-
|
|
9548
|
-
/**
|
|
9549
|
-
* Component default class name and class prefix.
|
|
9550
|
-
*/
|
|
9551
|
-
const CLASSNAME$Y = 'lumx-list-subheader';
|
|
9552
|
-
|
|
9553
|
-
/**
|
|
9554
|
-
* ListSubheader component.
|
|
9555
|
-
* @deprecated ListSubheader produces improper list structure. use ListSection instead.
|
|
9556
|
-
*
|
|
9557
|
-
* @param props Component props.
|
|
9558
|
-
* @param ref Component ref.
|
|
9559
|
-
* @return React element.
|
|
9560
|
-
*/
|
|
9561
|
-
const ListSubheader = forwardRef((props, ref) => {
|
|
9562
|
-
const {
|
|
9563
|
-
children,
|
|
9564
|
-
className,
|
|
9565
|
-
...forwardedProps
|
|
9566
|
-
} = props;
|
|
9567
|
-
return /*#__PURE__*/jsx("li", {
|
|
9568
|
-
ref: ref,
|
|
9569
|
-
...forwardedProps,
|
|
9570
|
-
className: classNames.join(className, CLASSNAME$Y),
|
|
9571
|
-
children: children
|
|
9572
|
-
});
|
|
9573
|
-
});
|
|
9574
|
-
ListSubheader.displayName = COMPONENT_NAME$Z;
|
|
9575
|
-
ListSubheader.className = CLASSNAME$Y;
|
|
9344
|
+
ListSection.defaultProps = DEFAULT_PROPS$T;
|
|
9576
9345
|
|
|
9577
9346
|
/**
|
|
9578
9347
|
* Props for Combobox.Section component.
|
|
@@ -9620,21 +9389,21 @@ const ComboboxSection = forwardRef((props, ref) => {
|
|
|
9620
9389
|
ListSection
|
|
9621
9390
|
});
|
|
9622
9391
|
});
|
|
9623
|
-
ComboboxSection.displayName = COMPONENT_NAME
|
|
9624
|
-
ComboboxSection.className = CLASSNAME
|
|
9392
|
+
ComboboxSection.displayName = COMPONENT_NAME$$;
|
|
9393
|
+
ComboboxSection.className = CLASSNAME$_;
|
|
9625
9394
|
|
|
9626
9395
|
/**
|
|
9627
9396
|
* Component display name.
|
|
9628
9397
|
*/
|
|
9629
|
-
const COMPONENT_NAME$
|
|
9398
|
+
const COMPONENT_NAME$Z = 'ComboboxState';
|
|
9630
9399
|
|
|
9631
9400
|
/**
|
|
9632
9401
|
* Component default class name and class prefix.
|
|
9633
9402
|
*/
|
|
9634
|
-
const CLASSNAME$
|
|
9403
|
+
const CLASSNAME$Y = 'lumx-combobox-state';
|
|
9635
9404
|
const {
|
|
9636
|
-
block: block$
|
|
9637
|
-
} = bem(CLASSNAME$
|
|
9405
|
+
block: block$M
|
|
9406
|
+
} = bem(CLASSNAME$Y);
|
|
9638
9407
|
|
|
9639
9408
|
/**
|
|
9640
9409
|
* Defines the props for the core ComboboxState template.
|
|
@@ -9689,7 +9458,7 @@ const ComboboxState$1 = (props, {
|
|
|
9689
9458
|
// the popover's closeMode="hide") and revealing it doesn't trigger announcements.
|
|
9690
9459
|
const renderContent = isOpen;
|
|
9691
9460
|
return /*#__PURE__*/jsxs(GenericBlock, {
|
|
9692
|
-
className: classnames(!show && visuallyHidden(), block$
|
|
9461
|
+
className: classnames(!show && visuallyHidden(), block$M(), padding('regular')),
|
|
9693
9462
|
orientation: "vertical",
|
|
9694
9463
|
...alignProps,
|
|
9695
9464
|
role: "status",
|
|
@@ -9796,21 +9565,21 @@ function partitionMulti(elements, predicates) {
|
|
|
9796
9565
|
/**
|
|
9797
9566
|
* Component display name.
|
|
9798
9567
|
*/
|
|
9799
|
-
const COMPONENT_NAME$
|
|
9568
|
+
const COMPONENT_NAME$Y = 'GenericBlock';
|
|
9800
9569
|
|
|
9801
9570
|
/**
|
|
9802
9571
|
* Component default class name and class prefix.
|
|
9803
9572
|
*/
|
|
9804
|
-
const CLASSNAME$
|
|
9573
|
+
const CLASSNAME$X = 'lumx-generic-block';
|
|
9805
9574
|
const {
|
|
9806
|
-
block: block$
|
|
9575
|
+
block: block$L,
|
|
9807
9576
|
element: element$C
|
|
9808
|
-
} = bem(CLASSNAME$
|
|
9577
|
+
} = bem(CLASSNAME$X);
|
|
9809
9578
|
|
|
9810
9579
|
/**
|
|
9811
9580
|
* Component default props.
|
|
9812
9581
|
*/
|
|
9813
|
-
const DEFAULT_PROPS$
|
|
9582
|
+
const DEFAULT_PROPS$S = {
|
|
9814
9583
|
gap: Size.big,
|
|
9815
9584
|
orientation: Orientation.horizontal
|
|
9816
9585
|
};
|
|
@@ -9834,17 +9603,17 @@ const GenericBlock$1 = props => {
|
|
|
9834
9603
|
children,
|
|
9835
9604
|
actions,
|
|
9836
9605
|
actionsProps,
|
|
9837
|
-
gap = DEFAULT_PROPS$
|
|
9606
|
+
gap = DEFAULT_PROPS$S.gap,
|
|
9838
9607
|
ref,
|
|
9839
9608
|
content,
|
|
9840
|
-
orientation = DEFAULT_PROPS$
|
|
9609
|
+
orientation = DEFAULT_PROPS$S.orientation,
|
|
9841
9610
|
contentProps,
|
|
9842
9611
|
FlexBox,
|
|
9843
9612
|
...forwardedProps
|
|
9844
9613
|
} = props;
|
|
9845
9614
|
return /*#__PURE__*/jsxs(FlexBox, {
|
|
9846
9615
|
ref: ref,
|
|
9847
|
-
className: classnames(className, block$
|
|
9616
|
+
className: classnames(className, block$L()),
|
|
9848
9617
|
gap: gap,
|
|
9849
9618
|
orientation: orientation,
|
|
9850
9619
|
...forwardedProps,
|
|
@@ -9947,9 +9716,9 @@ const BaseGenericBlock = forwardRef((props, ref) => {
|
|
|
9947
9716
|
}) : undefined
|
|
9948
9717
|
});
|
|
9949
9718
|
});
|
|
9950
|
-
BaseGenericBlock.displayName = COMPONENT_NAME$
|
|
9951
|
-
BaseGenericBlock.className = CLASSNAME$
|
|
9952
|
-
BaseGenericBlock.defaultProps = DEFAULT_PROPS$
|
|
9719
|
+
BaseGenericBlock.displayName = COMPONENT_NAME$Y;
|
|
9720
|
+
BaseGenericBlock.className = CLASSNAME$X;
|
|
9721
|
+
BaseGenericBlock.defaultProps = DEFAULT_PROPS$S;
|
|
9953
9722
|
const GenericBlock = Object.assign(BaseGenericBlock, {
|
|
9954
9723
|
Figure,
|
|
9955
9724
|
Content,
|
|
@@ -10107,8 +9876,69 @@ const ComboboxState = props => {
|
|
|
10107
9876
|
Text
|
|
10108
9877
|
});
|
|
10109
9878
|
};
|
|
10110
|
-
ComboboxState.displayName = COMPONENT_NAME$
|
|
10111
|
-
ComboboxState.className = CLASSNAME$
|
|
9879
|
+
ComboboxState.displayName = COMPONENT_NAME$Z;
|
|
9880
|
+
ComboboxState.className = CLASSNAME$Y;
|
|
9881
|
+
|
|
9882
|
+
/**
|
|
9883
|
+
* Component display name.
|
|
9884
|
+
*/
|
|
9885
|
+
const COMPONENT_NAME$X = 'ListDivider';
|
|
9886
|
+
|
|
9887
|
+
/**
|
|
9888
|
+
* Component default class name and class prefix.
|
|
9889
|
+
*/
|
|
9890
|
+
const CLASSNAME$W = 'lumx-list-divider';
|
|
9891
|
+
|
|
9892
|
+
/**
|
|
9893
|
+
* Component default props.
|
|
9894
|
+
*/
|
|
9895
|
+
const DEFAULT_PROPS$R = {};
|
|
9896
|
+
|
|
9897
|
+
/**
|
|
9898
|
+
* ListDivider component.
|
|
9899
|
+
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9900
|
+
*
|
|
9901
|
+
* @param props Component props.
|
|
9902
|
+
* @return JSX element.
|
|
9903
|
+
*/
|
|
9904
|
+
const ListDivider$1 = props => {
|
|
9905
|
+
const {
|
|
9906
|
+
className,
|
|
9907
|
+
ref,
|
|
9908
|
+
...forwardedProps
|
|
9909
|
+
} = props;
|
|
9910
|
+
return /*#__PURE__*/jsx("li", {
|
|
9911
|
+
ref: ref,
|
|
9912
|
+
role: "none",
|
|
9913
|
+
...forwardedProps,
|
|
9914
|
+
className: classnames(className, CLASSNAME$W)
|
|
9915
|
+
});
|
|
9916
|
+
};
|
|
9917
|
+
ListDivider$1.displayName = COMPONENT_NAME$X;
|
|
9918
|
+
ListDivider$1.className = CLASSNAME$W;
|
|
9919
|
+
ListDivider$1.defaultProps = DEFAULT_PROPS$R;
|
|
9920
|
+
|
|
9921
|
+
/**
|
|
9922
|
+
* Defines the props of the component.
|
|
9923
|
+
*/
|
|
9924
|
+
|
|
9925
|
+
/**
|
|
9926
|
+
* ListDivider component.
|
|
9927
|
+
* Purely decorative, consider a `ListSection` with label for a better list structure.
|
|
9928
|
+
*
|
|
9929
|
+
* @param props Component props.
|
|
9930
|
+
* @param ref Component ref.
|
|
9931
|
+
* @return React element.
|
|
9932
|
+
*/
|
|
9933
|
+
const ListDivider = forwardRef((props, ref) => {
|
|
9934
|
+
return ListDivider$1({
|
|
9935
|
+
...props,
|
|
9936
|
+
ref
|
|
9937
|
+
});
|
|
9938
|
+
});
|
|
9939
|
+
ListDivider.displayName = COMPONENT_NAME$X;
|
|
9940
|
+
ListDivider.className = CLASSNAME$W;
|
|
9941
|
+
ListDivider.defaultProps = DEFAULT_PROPS$R;
|
|
10112
9942
|
|
|
10113
9943
|
/**
|
|
10114
9944
|
* Combobox compound component namespace.
|
|
@@ -10164,7 +9994,7 @@ const COMPONENT_NAME$W = 'CommentBlock';
|
|
|
10164
9994
|
*/
|
|
10165
9995
|
const CLASSNAME$V = 'lumx-comment-block';
|
|
10166
9996
|
const {
|
|
10167
|
-
block: block$
|
|
9997
|
+
block: block$K,
|
|
10168
9998
|
element: element$B
|
|
10169
9999
|
} = classNames.bem(CLASSNAME$V);
|
|
10170
10000
|
|
|
@@ -10207,7 +10037,7 @@ const CommentBlock = forwardRef((props, ref) => {
|
|
|
10207
10037
|
const hasChildren = Children.count(children) > 0;
|
|
10208
10038
|
return /*#__PURE__*/jsxs("div", {
|
|
10209
10039
|
ref: ref,
|
|
10210
|
-
className: classNames.join(className, block$
|
|
10040
|
+
className: classNames.join(className, block$K({
|
|
10211
10041
|
'has-children': hasChildren && isOpen,
|
|
10212
10042
|
'has-indented-children': hasChildren && variant === CommentBlockVariant.indented,
|
|
10213
10043
|
'has-linear-children': hasChildren && variant === CommentBlockVariant.linear,
|
|
@@ -11166,7 +10996,7 @@ const COMPONENT_NAME$S = 'Dialog';
|
|
|
11166
10996
|
*/
|
|
11167
10997
|
const CLASSNAME$T = 'lumx-dialog';
|
|
11168
10998
|
const {
|
|
11169
|
-
block: block$
|
|
10999
|
+
block: block$J,
|
|
11170
11000
|
element: element$z
|
|
11171
11001
|
} = classNames.bem(CLASSNAME$T);
|
|
11172
11002
|
|
|
@@ -11282,7 +11112,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
11282
11112
|
children: /*#__PURE__*/jsxs("div", {
|
|
11283
11113
|
ref: mergeRefs(rootRef, ref),
|
|
11284
11114
|
...forwardedProps,
|
|
11285
|
-
className: classNames.join(className, block$
|
|
11115
|
+
className: classNames.join(className, block$J({
|
|
11286
11116
|
'is-hidden': !isOpen,
|
|
11287
11117
|
'is-loading': isLoading,
|
|
11288
11118
|
'is-shown': isOpen || isVisible,
|
|
@@ -11363,7 +11193,7 @@ const COMPONENT_NAME$R = 'Divider';
|
|
|
11363
11193
|
*/
|
|
11364
11194
|
const CLASSNAME$S = 'lumx-divider';
|
|
11365
11195
|
const {
|
|
11366
|
-
block: block$
|
|
11196
|
+
block: block$I
|
|
11367
11197
|
} = bem(CLASSNAME$S);
|
|
11368
11198
|
|
|
11369
11199
|
/**
|
|
@@ -11382,7 +11212,7 @@ const Divider$1 = props => {
|
|
|
11382
11212
|
return /*#__PURE__*/jsx("hr", {
|
|
11383
11213
|
ref: ref,
|
|
11384
11214
|
...forwardedProps,
|
|
11385
|
-
className: classnames(className, block$
|
|
11215
|
+
className: classnames(className, block$I({
|
|
11386
11216
|
[`theme-${theme}`]: Boolean(theme)
|
|
11387
11217
|
}))
|
|
11388
11218
|
});
|
|
@@ -11420,77 +11250,276 @@ Divider.displayName = COMPONENT_NAME$R;
|
|
|
11420
11250
|
Divider.className = CLASSNAME$S;
|
|
11421
11251
|
Divider.defaultProps = DEFAULT_PROPS$O;
|
|
11422
11252
|
|
|
11423
|
-
/**
|
|
11424
|
-
* Component display name.
|
|
11425
|
-
*/
|
|
11426
|
-
const COMPONENT_NAME$Q = 'DragHandle';
|
|
11253
|
+
/**
|
|
11254
|
+
* Component display name.
|
|
11255
|
+
*/
|
|
11256
|
+
const COMPONENT_NAME$Q = 'DragHandle';
|
|
11257
|
+
|
|
11258
|
+
/**
|
|
11259
|
+
* Component default class name and class prefix.
|
|
11260
|
+
*/
|
|
11261
|
+
const CLASSNAME$R = 'lumx-drag-handle';
|
|
11262
|
+
const {
|
|
11263
|
+
block: block$H
|
|
11264
|
+
} = bem(CLASSNAME$R);
|
|
11265
|
+
|
|
11266
|
+
/**
|
|
11267
|
+
* DragHandle component.
|
|
11268
|
+
*
|
|
11269
|
+
* @param props Component props.
|
|
11270
|
+
* @return JSX element.
|
|
11271
|
+
*/
|
|
11272
|
+
const DragHandle$1 = props => {
|
|
11273
|
+
const {
|
|
11274
|
+
className,
|
|
11275
|
+
theme,
|
|
11276
|
+
ref,
|
|
11277
|
+
...forwardedProps
|
|
11278
|
+
} = props;
|
|
11279
|
+
return /*#__PURE__*/jsx("div", {
|
|
11280
|
+
ref: ref,
|
|
11281
|
+
...forwardedProps,
|
|
11282
|
+
className: classnames(className, block$H({
|
|
11283
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
11284
|
+
})),
|
|
11285
|
+
children: Icon$1({
|
|
11286
|
+
icon: mdiDragVertical,
|
|
11287
|
+
color: theme === Theme.dark ? ColorPalette.light : ColorPalette.dark,
|
|
11288
|
+
size: Size.xs
|
|
11289
|
+
})
|
|
11290
|
+
});
|
|
11291
|
+
};
|
|
11292
|
+
|
|
11293
|
+
/**
|
|
11294
|
+
* Defines the props of the component.
|
|
11295
|
+
*/
|
|
11296
|
+
|
|
11297
|
+
/**
|
|
11298
|
+
* Component default props.
|
|
11299
|
+
*/
|
|
11300
|
+
const DEFAULT_PROPS$N = {};
|
|
11301
|
+
|
|
11302
|
+
/**
|
|
11303
|
+
* DragHandle component.
|
|
11304
|
+
*
|
|
11305
|
+
* @param props Component props.
|
|
11306
|
+
* @param ref Component ref.
|
|
11307
|
+
* @return React element.
|
|
11308
|
+
*/
|
|
11309
|
+
const DragHandle = forwardRef((props, ref) => {
|
|
11310
|
+
const defaultTheme = useTheme();
|
|
11311
|
+
const {
|
|
11312
|
+
theme = defaultTheme,
|
|
11313
|
+
...otherProps
|
|
11314
|
+
} = props;
|
|
11315
|
+
return DragHandle$1({
|
|
11316
|
+
ref,
|
|
11317
|
+
theme,
|
|
11318
|
+
...otherProps
|
|
11319
|
+
});
|
|
11320
|
+
});
|
|
11321
|
+
DragHandle.displayName = COMPONENT_NAME$Q;
|
|
11322
|
+
DragHandle.className = CLASSNAME$R;
|
|
11323
|
+
DragHandle.defaultProps = DEFAULT_PROPS$N;
|
|
11324
|
+
|
|
11325
|
+
const INITIAL_INDEX = -1;
|
|
11326
|
+
|
|
11327
|
+
/**
|
|
11328
|
+
* This custom hook provides the necessary set of functions and values to properly navigate
|
|
11329
|
+
* a list using the keyboard.
|
|
11330
|
+
*
|
|
11331
|
+
* @param items the list of items that will be navigated using the keyboard.
|
|
11332
|
+
* @param ref A reference to the element that is controlling the navigation.
|
|
11333
|
+
* @param onListItemSelected callback to be executed when the ENTER key is pressed on an item.
|
|
11334
|
+
* @param onListItemNavigated callback to be executed when the Arrow keys are pressed.
|
|
11335
|
+
* @param onEnterPressed callback to be executed when the ENTER key is pressed.
|
|
11336
|
+
* @param onBackspacePressed callback to be executed when the BACKSPACE key is pressed.
|
|
11337
|
+
* @param keepFocusAfterSelection determines whether after selecting an item, the focus should be maintained on the current target or not.
|
|
11338
|
+
* @param initialIndex where should the navigation start from. it defaults to `-1`, so the first item navigated is the item on position `0`.
|
|
11339
|
+
* @param preventTabOnEnteredValue determines whether upon TAB, if there is a value entered, the event is prevented or not.
|
|
11340
|
+
* @return useKeyboardListNavigation helpers.
|
|
11341
|
+
*/
|
|
11342
|
+
const useKeyboardListNavigation = (items, ref, onListItemSelected, onListItemNavigated, onEnterPressed, onBackspacePressed, keepFocusAfterSelection = false, initialIndex = INITIAL_INDEX, preventTabOnEnteredValue = true) => {
|
|
11343
|
+
const [activeItemIndex, setActiveItemIndex] = useState(initialIndex);
|
|
11344
|
+
|
|
11345
|
+
/**
|
|
11346
|
+
* This function calculates the next index in the list to be highlighted
|
|
11347
|
+
* @param key - key code pressed
|
|
11348
|
+
* @return next active index
|
|
11349
|
+
*/
|
|
11350
|
+
const calculateActiveIndex = key => {
|
|
11351
|
+
switch (key) {
|
|
11352
|
+
case 'ArrowDown':
|
|
11353
|
+
return activeItemIndex + 1 < items.length ? activeItemIndex + 1 : 0;
|
|
11354
|
+
case 'ArrowUp':
|
|
11355
|
+
return activeItemIndex - 1 >= 0 ? activeItemIndex - 1 : items.length - 1;
|
|
11356
|
+
default:
|
|
11357
|
+
return initialIndex;
|
|
11358
|
+
}
|
|
11359
|
+
};
|
|
11360
|
+
|
|
11361
|
+
/**
|
|
11362
|
+
* Resets the active index to the initial state
|
|
11363
|
+
*/
|
|
11364
|
+
const resetActiveIndex = () => {
|
|
11365
|
+
setActiveItemIndex(initialIndex);
|
|
11366
|
+
};
|
|
11367
|
+
|
|
11368
|
+
/**
|
|
11369
|
+
* Prevents the default event and stops the propagation of said event
|
|
11370
|
+
* @param evt - key pressed event
|
|
11371
|
+
*/
|
|
11372
|
+
const preventDefaultAndStopPropagation = evt => {
|
|
11373
|
+
evt.preventDefault();
|
|
11374
|
+
evt.stopPropagation();
|
|
11375
|
+
};
|
|
11376
|
+
|
|
11377
|
+
/**
|
|
11378
|
+
* Handles navigation with the arrows using the keyboard
|
|
11379
|
+
* @param evt - key pressed event
|
|
11380
|
+
*/
|
|
11381
|
+
const onArrowPressed = evt => {
|
|
11382
|
+
const {
|
|
11383
|
+
key
|
|
11384
|
+
} = evt;
|
|
11385
|
+
const nextActiveIndex = calculateActiveIndex(key);
|
|
11386
|
+
setActiveItemIndex(nextActiveIndex);
|
|
11387
|
+
preventDefaultAndStopPropagation(evt);
|
|
11388
|
+
if (onListItemNavigated) {
|
|
11389
|
+
const selectedItem = items[nextActiveIndex];
|
|
11390
|
+
onListItemNavigated(selectedItem);
|
|
11391
|
+
}
|
|
11392
|
+
};
|
|
11393
|
+
|
|
11394
|
+
/**
|
|
11395
|
+
* Handles the event when the backspace key is pressed
|
|
11396
|
+
* @param evt - key pressed event
|
|
11397
|
+
*/
|
|
11398
|
+
const onBackspaceKeyPressed = evt => {
|
|
11399
|
+
if (onBackspacePressed) {
|
|
11400
|
+
onBackspacePressed(evt);
|
|
11401
|
+
}
|
|
11402
|
+
};
|
|
11403
|
+
|
|
11404
|
+
/**
|
|
11405
|
+
* Handles when the ENTER key is pressed
|
|
11406
|
+
* @param evt - key pressed event
|
|
11407
|
+
*/
|
|
11408
|
+
const onEnterKeyPressed = evt => {
|
|
11409
|
+
if (!onListItemSelected) {
|
|
11410
|
+
return;
|
|
11411
|
+
}
|
|
11412
|
+
preventDefaultAndStopPropagation(evt);
|
|
11413
|
+
if (!keepFocusAfterSelection) {
|
|
11414
|
+
evt.currentTarget.blur();
|
|
11415
|
+
}
|
|
11416
|
+
const selectedItem = items[activeItemIndex];
|
|
11417
|
+
if (selectedItem) {
|
|
11418
|
+
onListItemSelected(selectedItem);
|
|
11419
|
+
resetActiveIndex();
|
|
11420
|
+
} else if (activeItemIndex === initialIndex && onEnterPressed) {
|
|
11421
|
+
const value = get(evt, 'target.value');
|
|
11422
|
+
onEnterPressed(value);
|
|
11423
|
+
resetActiveIndex();
|
|
11424
|
+
}
|
|
11425
|
+
};
|
|
11427
11426
|
|
|
11428
|
-
/**
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
const {
|
|
11433
|
-
|
|
11434
|
-
|
|
11427
|
+
/**
|
|
11428
|
+
* Handles when the TAB key is pressed
|
|
11429
|
+
* @param evt - key pressed event
|
|
11430
|
+
*/
|
|
11431
|
+
const onTabKeyPressed = evt => {
|
|
11432
|
+
const value = get(evt, 'target.value');
|
|
11433
|
+
if (preventTabOnEnteredValue && value && value.length > 0) {
|
|
11434
|
+
preventDefaultAndStopPropagation(evt);
|
|
11435
|
+
}
|
|
11436
|
+
};
|
|
11435
11437
|
|
|
11436
|
-
/**
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
const
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
}
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
}
|
|
11438
|
+
/**
|
|
11439
|
+
* In order to make it easier in the future to add new events depending on the key
|
|
11440
|
+
* a map was created to add these handlers. In the future, if there is another event
|
|
11441
|
+
* that we need to manage depending on a specific key, we just need to add the key code
|
|
11442
|
+
* here, and as a value, the handler for said key.
|
|
11443
|
+
*/
|
|
11444
|
+
const eventsForKeyPressed = {
|
|
11445
|
+
ArrowDown: onArrowPressed,
|
|
11446
|
+
Tab: onTabKeyPressed,
|
|
11447
|
+
ArrowUp: onArrowPressed,
|
|
11448
|
+
Enter: onEnterKeyPressed,
|
|
11449
|
+
Backspace: onBackspaceKeyPressed
|
|
11450
|
+
};
|
|
11451
|
+
|
|
11452
|
+
/**
|
|
11453
|
+
* Calculates the next active item index depending on the key pressed.
|
|
11454
|
+
* If the key pressed was ENTER, the function executes the callback `onListItemSelected`
|
|
11455
|
+
* and resets the active index, since an item was selected.
|
|
11456
|
+
* @param evt - key pressed or key down event
|
|
11457
|
+
*/
|
|
11458
|
+
const onKeyboardNavigation = evt => {
|
|
11459
|
+
const {
|
|
11460
|
+
key
|
|
11461
|
+
} = evt;
|
|
11462
|
+
const handler = eventsForKeyPressed[key];
|
|
11463
|
+
if (handler) {
|
|
11464
|
+
handler(evt);
|
|
11465
|
+
}
|
|
11466
|
+
};
|
|
11467
|
+
useEffect(() => {
|
|
11468
|
+
const {
|
|
11469
|
+
current: currentElement
|
|
11470
|
+
} = ref;
|
|
11471
|
+
if (!currentElement) {
|
|
11472
|
+
return undefined;
|
|
11473
|
+
}
|
|
11474
|
+
currentElement.addEventListener('focus', resetActiveIndex);
|
|
11475
|
+
currentElement.addEventListener('keydown', onKeyboardNavigation);
|
|
11476
|
+
return () => {
|
|
11477
|
+
currentElement.removeEventListener('focus', resetActiveIndex);
|
|
11478
|
+
currentElement.removeEventListener('keydown', onKeyboardNavigation);
|
|
11479
|
+
};
|
|
11460
11480
|
});
|
|
11481
|
+
return {
|
|
11482
|
+
activeItemIndex,
|
|
11483
|
+
onKeyboardNavigation,
|
|
11484
|
+
resetActiveIndex,
|
|
11485
|
+
setActiveItemIndex
|
|
11486
|
+
};
|
|
11461
11487
|
};
|
|
11462
11488
|
|
|
11463
11489
|
/**
|
|
11464
11490
|
* Defines the props of the component.
|
|
11465
11491
|
*/
|
|
11466
11492
|
|
|
11493
|
+
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
|
11467
11494
|
/**
|
|
11468
|
-
*
|
|
11469
|
-
*/
|
|
11470
|
-
const DEFAULT_PROPS$N = {};
|
|
11471
|
-
|
|
11472
|
-
/**
|
|
11473
|
-
* DragHandle component.
|
|
11495
|
+
* List component.
|
|
11474
11496
|
*
|
|
11475
11497
|
* @param props Component props.
|
|
11476
11498
|
* @param ref Component ref.
|
|
11477
11499
|
* @return React element.
|
|
11478
11500
|
*/
|
|
11479
|
-
const
|
|
11480
|
-
const defaultTheme = useTheme();
|
|
11501
|
+
const InternalList = forwardRef((props, ref) => {
|
|
11481
11502
|
const {
|
|
11482
|
-
|
|
11483
|
-
|
|
11503
|
+
children,
|
|
11504
|
+
isClickable,
|
|
11505
|
+
onListItemSelected,
|
|
11506
|
+
itemPadding,
|
|
11507
|
+
...forwardedProps
|
|
11484
11508
|
} = props;
|
|
11485
|
-
|
|
11509
|
+
const adjustedItemPadding = itemPadding ?? (isClickable ? Size$1.big : undefined);
|
|
11510
|
+
return List$1({
|
|
11511
|
+
...forwardedProps,
|
|
11486
11512
|
ref,
|
|
11487
|
-
|
|
11488
|
-
|
|
11513
|
+
children,
|
|
11514
|
+
itemPadding: adjustedItemPadding
|
|
11489
11515
|
});
|
|
11490
11516
|
});
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11517
|
+
InternalList.displayName = COMPONENT_NAME$1c;
|
|
11518
|
+
InternalList.className = CLASSNAME$1b;
|
|
11519
|
+
InternalList.defaultProps = DEFAULT_PROPS$Y;
|
|
11520
|
+
const List = Object.assign(InternalList, {
|
|
11521
|
+
useKeyboardListNavigation
|
|
11522
|
+
});
|
|
11494
11523
|
|
|
11495
11524
|
// The error margin in px we want to have for triggering infinite scroll
|
|
11496
11525
|
const SCROLL_TRIGGER_MARGIN = 5;
|
|
@@ -11543,7 +11572,7 @@ const COMPONENT_NAME$P = 'Dropdown';
|
|
|
11543
11572
|
*/
|
|
11544
11573
|
const CLASSNAME$Q = 'lumx-dropdown';
|
|
11545
11574
|
const {
|
|
11546
|
-
block: block$
|
|
11575
|
+
block: block$G,
|
|
11547
11576
|
element: element$y
|
|
11548
11577
|
} = classNames.bem(CLASSNAME$Q);
|
|
11549
11578
|
|
|
@@ -11609,7 +11638,7 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
11609
11638
|
...forwardedProps,
|
|
11610
11639
|
focusAnchorOnClose: focusAnchorOnClose,
|
|
11611
11640
|
anchorRef: anchorRef,
|
|
11612
|
-
className: classNames.join(className, block$
|
|
11641
|
+
className: classNames.join(className, block$G()),
|
|
11613
11642
|
elevation: 0,
|
|
11614
11643
|
closeOnClickAway: closeOnClickAway,
|
|
11615
11644
|
closeOnEscape: closeOnEscape,
|
|
@@ -11642,9 +11671,9 @@ const COMPONENT_NAME$O = 'ExpansionPanel';
|
|
|
11642
11671
|
*/
|
|
11643
11672
|
const CLASSNAME$P = 'lumx-expansion-panel';
|
|
11644
11673
|
const {
|
|
11645
|
-
block: block$
|
|
11674
|
+
block: block$F,
|
|
11646
11675
|
element: element$x
|
|
11647
|
-
} =
|
|
11676
|
+
} = bem(CLASSNAME$P);
|
|
11648
11677
|
|
|
11649
11678
|
/**
|
|
11650
11679
|
* Component default props.
|
|
@@ -11652,9 +11681,6 @@ const {
|
|
|
11652
11681
|
const DEFAULT_PROPS$L = {
|
|
11653
11682
|
closeMode: 'unmount'
|
|
11654
11683
|
};
|
|
11655
|
-
const isDragHandle = isComponent(DragHandle);
|
|
11656
|
-
const isHeader = isComponent('header');
|
|
11657
|
-
const isFooter = isComponent('footer');
|
|
11658
11684
|
|
|
11659
11685
|
/**
|
|
11660
11686
|
* ExpansionPanel component.
|
|
@@ -11663,48 +11689,45 @@ const isFooter = isComponent('footer');
|
|
|
11663
11689
|
* @param ref Component ref.
|
|
11664
11690
|
* @return React element.
|
|
11665
11691
|
*/
|
|
11666
|
-
const ExpansionPanel =
|
|
11667
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
11692
|
+
const ExpansionPanel$1 = props => {
|
|
11668
11693
|
const {
|
|
11669
11694
|
className,
|
|
11670
|
-
closeMode = DEFAULT_PROPS$L.closeMode,
|
|
11671
11695
|
children: anyChildren,
|
|
11672
11696
|
hasBackground,
|
|
11697
|
+
ref,
|
|
11673
11698
|
hasHeaderDivider,
|
|
11674
11699
|
isOpen,
|
|
11675
11700
|
label,
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
theme
|
|
11701
|
+
handleClose,
|
|
11702
|
+
handleOpen,
|
|
11703
|
+
handleToggleOpen,
|
|
11704
|
+
theme,
|
|
11680
11705
|
toggleButtonProps,
|
|
11706
|
+
headerProps,
|
|
11707
|
+
headerContent,
|
|
11708
|
+
dragHandle,
|
|
11709
|
+
wrapperRef,
|
|
11710
|
+
content,
|
|
11711
|
+
isChildrenVisible,
|
|
11712
|
+
IconButton,
|
|
11713
|
+
footer,
|
|
11714
|
+
closeMode,
|
|
11681
11715
|
...forwardedProps
|
|
11682
11716
|
} = props;
|
|
11683
|
-
const children = Children.toArray(anyChildren);
|
|
11684
|
-
|
|
11685
|
-
// Partition children by types.
|
|
11686
|
-
const [[dragHandle], [header], [footer], content] = partitionMulti(children, [isDragHandle, isHeader, isFooter]);
|
|
11687
|
-
|
|
11688
|
-
// Either take the header in children or create one with the label.
|
|
11689
|
-
const headerProps = /*#__PURE__*/React__default.isValidElement(header) ? header.props : {};
|
|
11690
|
-
const headerContent = !isEmpty(headerProps.children) ? headerProps.children : /*#__PURE__*/jsx("span", {
|
|
11691
|
-
className: element$x('label'),
|
|
11692
|
-
children: label
|
|
11693
|
-
});
|
|
11694
11717
|
const toggleOpen = event => {
|
|
11695
11718
|
const shouldOpen = !isOpen;
|
|
11696
|
-
if (
|
|
11697
|
-
|
|
11719
|
+
if (handleOpen && shouldOpen) {
|
|
11720
|
+
handleOpen(event);
|
|
11698
11721
|
}
|
|
11699
|
-
if (
|
|
11700
|
-
|
|
11722
|
+
if (handleClose && !shouldOpen) {
|
|
11723
|
+
handleClose(event);
|
|
11701
11724
|
}
|
|
11702
|
-
if (
|
|
11703
|
-
|
|
11725
|
+
if (handleToggleOpen) {
|
|
11726
|
+
handleToggleOpen(shouldOpen, event);
|
|
11704
11727
|
}
|
|
11705
11728
|
};
|
|
11706
|
-
const color = theme === Theme
|
|
11707
|
-
const rootClassName =
|
|
11729
|
+
const color = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
|
|
11730
|
+
const rootClassName = classnames(className, block$F({
|
|
11708
11731
|
'has-background': hasBackground,
|
|
11709
11732
|
'has-header': Boolean(!isEmpty(headerProps.children)),
|
|
11710
11733
|
'has-header-divider': hasHeaderDivider,
|
|
@@ -11713,6 +11736,82 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
11713
11736
|
'is-open': isOpen,
|
|
11714
11737
|
[`theme-${theme}`]: Boolean(theme)
|
|
11715
11738
|
}));
|
|
11739
|
+
return /*#__PURE__*/jsxs("section", {
|
|
11740
|
+
ref: ref,
|
|
11741
|
+
...forwardedProps,
|
|
11742
|
+
className: rootClassName,
|
|
11743
|
+
children: [/*#__PURE__*/jsxs("header", {
|
|
11744
|
+
className: element$x('header'),
|
|
11745
|
+
onClick: toggleOpen,
|
|
11746
|
+
children: [dragHandle && /*#__PURE__*/jsx("div", {
|
|
11747
|
+
className: element$x('header-drag'),
|
|
11748
|
+
children: dragHandle
|
|
11749
|
+
}), /*#__PURE__*/jsx("div", {
|
|
11750
|
+
...headerProps,
|
|
11751
|
+
className: element$x('header-content'),
|
|
11752
|
+
children: headerContent
|
|
11753
|
+
}), /*#__PURE__*/jsx("div", {
|
|
11754
|
+
className: element$x('header-toggle'),
|
|
11755
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
11756
|
+
...toggleButtonProps,
|
|
11757
|
+
color: color,
|
|
11758
|
+
emphasis: Emphasis.low,
|
|
11759
|
+
icon: isOpen ? mdiChevronUp : mdiChevronDown,
|
|
11760
|
+
"aria-expanded": isOpen || 'false'
|
|
11761
|
+
})
|
|
11762
|
+
})]
|
|
11763
|
+
}), /*#__PURE__*/jsx("div", {
|
|
11764
|
+
className: element$x('wrapper'),
|
|
11765
|
+
ref: wrapperRef,
|
|
11766
|
+
children: (isOpen || isChildrenVisible) && /*#__PURE__*/jsxs("div", {
|
|
11767
|
+
className: element$x('container'),
|
|
11768
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
11769
|
+
className: element$x('content'),
|
|
11770
|
+
children: content
|
|
11771
|
+
}), footer && /*#__PURE__*/jsx("div", {
|
|
11772
|
+
className: element$x('footer'),
|
|
11773
|
+
children: footer
|
|
11774
|
+
})]
|
|
11775
|
+
})
|
|
11776
|
+
})]
|
|
11777
|
+
});
|
|
11778
|
+
};
|
|
11779
|
+
|
|
11780
|
+
const isDragHandle = isComponent(DragHandle);
|
|
11781
|
+
const isHeader = isComponent('header');
|
|
11782
|
+
const isFooter = isComponent('footer');
|
|
11783
|
+
|
|
11784
|
+
/**
|
|
11785
|
+
* ExpansionPanel component.
|
|
11786
|
+
*
|
|
11787
|
+
* @param props Component props.
|
|
11788
|
+
* @param ref Component ref.
|
|
11789
|
+
* @return React element.
|
|
11790
|
+
*/
|
|
11791
|
+
const ExpansionPanel = forwardRef((props, ref) => {
|
|
11792
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
11793
|
+
const {
|
|
11794
|
+
closeMode = DEFAULT_PROPS$L.closeMode,
|
|
11795
|
+
children: anyChildren,
|
|
11796
|
+
isOpen,
|
|
11797
|
+
label,
|
|
11798
|
+
onClose,
|
|
11799
|
+
onOpen,
|
|
11800
|
+
onToggleOpen,
|
|
11801
|
+
theme = defaultTheme,
|
|
11802
|
+
...forwardedProps
|
|
11803
|
+
} = props;
|
|
11804
|
+
const children = Children.toArray(anyChildren);
|
|
11805
|
+
|
|
11806
|
+
// Partition children by types.
|
|
11807
|
+
const [[dragHandle], [header], [footer], content] = partitionMulti(children, [isDragHandle, isHeader, isFooter]);
|
|
11808
|
+
|
|
11809
|
+
// Either take the header in children or create one with the label.
|
|
11810
|
+
const headerProps = /*#__PURE__*/React__default.isValidElement(header) ? header.props : {};
|
|
11811
|
+
const headerContent = !isEmpty(headerProps.children) ? headerProps.children : /*#__PURE__*/jsx("span", {
|
|
11812
|
+
className: element$x('label'),
|
|
11813
|
+
children: label
|
|
11814
|
+
});
|
|
11716
11815
|
const wrapperRef = useRef(null);
|
|
11717
11816
|
|
|
11718
11817
|
// Children stay visible while the open/close transition is running
|
|
@@ -11742,44 +11841,25 @@ const ExpansionPanel = forwardRef((props, ref) => {
|
|
|
11742
11841
|
wrapper.addEventListener('transitionend', onTransitionEnd);
|
|
11743
11842
|
return () => wrapper.removeEventListener('transitionend', onTransitionEnd);
|
|
11744
11843
|
}, [closeMode]);
|
|
11745
|
-
return
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
emphasis: Emphasis$1.low,
|
|
11765
|
-
icon: isOpen ? mdiChevronUp : mdiChevronDown,
|
|
11766
|
-
"aria-expanded": isOpen || 'false'
|
|
11767
|
-
})
|
|
11768
|
-
})]
|
|
11769
|
-
}), /*#__PURE__*/jsx("div", {
|
|
11770
|
-
className: element$x('wrapper'),
|
|
11771
|
-
ref: wrapperRef,
|
|
11772
|
-
children: (isOpen || isChildrenVisible) && /*#__PURE__*/jsxs("div", {
|
|
11773
|
-
className: element$x('container'),
|
|
11774
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
11775
|
-
className: element$x('content'),
|
|
11776
|
-
children: content
|
|
11777
|
-
}), footer && /*#__PURE__*/jsx("div", {
|
|
11778
|
-
className: element$x('footer'),
|
|
11779
|
-
children: footer
|
|
11780
|
-
})]
|
|
11781
|
-
})
|
|
11782
|
-
})]
|
|
11844
|
+
return ExpansionPanel$1({
|
|
11845
|
+
content,
|
|
11846
|
+
dragHandle,
|
|
11847
|
+
footer,
|
|
11848
|
+
headerContent,
|
|
11849
|
+
ref,
|
|
11850
|
+
headerProps,
|
|
11851
|
+
wrapperRef,
|
|
11852
|
+
IconButton,
|
|
11853
|
+
isOpen,
|
|
11854
|
+
handleClose: onClose,
|
|
11855
|
+
handleToggleOpen: onToggleOpen,
|
|
11856
|
+
handleOpen: onOpen,
|
|
11857
|
+
theme,
|
|
11858
|
+
isChildrenVisible,
|
|
11859
|
+
children,
|
|
11860
|
+
closeMode,
|
|
11861
|
+
label,
|
|
11862
|
+
...forwardedProps
|
|
11783
11863
|
});
|
|
11784
11864
|
});
|
|
11785
11865
|
ExpansionPanel.displayName = COMPONENT_NAME$O;
|
|
@@ -11790,7 +11870,7 @@ const COMPONENT_NAME$N = 'Flag';
|
|
|
11790
11870
|
const CLASSNAME$O = 'lumx-flag';
|
|
11791
11871
|
const DEFAULT_PROPS$K = {};
|
|
11792
11872
|
const {
|
|
11793
|
-
block: block$
|
|
11873
|
+
block: block$E,
|
|
11794
11874
|
element: element$w
|
|
11795
11875
|
} = bem(CLASSNAME$O);
|
|
11796
11876
|
|
|
@@ -11815,7 +11895,7 @@ const Flag$1 = props => {
|
|
|
11815
11895
|
const isTruncated = !!truncate;
|
|
11816
11896
|
return /*#__PURE__*/jsxs("div", {
|
|
11817
11897
|
...forwardedProps,
|
|
11818
|
-
className: classnames(className, block$
|
|
11898
|
+
className: classnames(className, block$E({
|
|
11819
11899
|
[`color-${flagColor}`]: Boolean(flagColor),
|
|
11820
11900
|
'is-truncated': isTruncated
|
|
11821
11901
|
})),
|
|
@@ -11854,80 +11934,6 @@ Flag.displayName = COMPONENT_NAME$N;
|
|
|
11854
11934
|
Flag.className = CLASSNAME$O;
|
|
11855
11935
|
Flag.defaultProps = DEFAULT_PROPS$K;
|
|
11856
11936
|
|
|
11857
|
-
/**
|
|
11858
|
-
* Defines the props of the component.
|
|
11859
|
-
*/
|
|
11860
|
-
|
|
11861
|
-
/**
|
|
11862
|
-
* Component display name.
|
|
11863
|
-
*/
|
|
11864
|
-
const COMPONENT_NAME$M = 'FlexBox';
|
|
11865
|
-
|
|
11866
|
-
/**
|
|
11867
|
-
* Component default class name and class prefix.
|
|
11868
|
-
*/
|
|
11869
|
-
const CLASSNAME$N = 'lumx-flex-box';
|
|
11870
|
-
const {
|
|
11871
|
-
block: block$E
|
|
11872
|
-
} = bem(CLASSNAME$N);
|
|
11873
|
-
|
|
11874
|
-
/**
|
|
11875
|
-
* Get FlexBox component props (className computation).
|
|
11876
|
-
*
|
|
11877
|
-
* @param props Component props.
|
|
11878
|
-
* @return Computed props with className.
|
|
11879
|
-
*/
|
|
11880
|
-
function getFlexBoxProps(props) {
|
|
11881
|
-
const {
|
|
11882
|
-
className,
|
|
11883
|
-
fillSpace,
|
|
11884
|
-
gap,
|
|
11885
|
-
hAlign,
|
|
11886
|
-
marginAuto,
|
|
11887
|
-
noShrink,
|
|
11888
|
-
vAlign,
|
|
11889
|
-
wrap,
|
|
11890
|
-
orientation,
|
|
11891
|
-
...forwardedProps
|
|
11892
|
-
} = props;
|
|
11893
|
-
const adjustedOrientation = orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null);
|
|
11894
|
-
return {
|
|
11895
|
-
...forwardedProps,
|
|
11896
|
-
className: classnames(className, block$E({
|
|
11897
|
-
[`orientation-${adjustedOrientation}`]: Boolean(adjustedOrientation),
|
|
11898
|
-
[`v-align-${vAlign}`]: Boolean(vAlign),
|
|
11899
|
-
[`h-align-${hAlign}`]: Boolean(hAlign),
|
|
11900
|
-
[`gap-${gap}`]: Boolean(gap),
|
|
11901
|
-
wrap: Boolean(wrap),
|
|
11902
|
-
'fill-space': fillSpace,
|
|
11903
|
-
'no-shrink': noShrink,
|
|
11904
|
-
...Object.fromEntries(castArray(marginAuto).filter(Boolean).map(align => [`margin-auto-${align}`, true]))
|
|
11905
|
-
}))
|
|
11906
|
-
};
|
|
11907
|
-
}
|
|
11908
|
-
|
|
11909
|
-
/**
|
|
11910
|
-
* FlexBox component.
|
|
11911
|
-
*
|
|
11912
|
-
* @param props Component props.
|
|
11913
|
-
* @param ref Component ref.
|
|
11914
|
-
* @return React element.
|
|
11915
|
-
*/
|
|
11916
|
-
const FlexBox = forwardRef((props, ref) => {
|
|
11917
|
-
const {
|
|
11918
|
-
as: Component = 'div',
|
|
11919
|
-
children,
|
|
11920
|
-
...forwardedProps
|
|
11921
|
-
} = props;
|
|
11922
|
-
return /*#__PURE__*/jsx(Component, {
|
|
11923
|
-
ref: ref,
|
|
11924
|
-
...getFlexBoxProps(forwardedProps),
|
|
11925
|
-
children: children
|
|
11926
|
-
});
|
|
11927
|
-
});
|
|
11928
|
-
FlexBox.displayName = COMPONENT_NAME$M;
|
|
11929
|
-
FlexBox.className = CLASSNAME$N;
|
|
11930
|
-
|
|
11931
11937
|
/** The maximum authorized heading level. */
|
|
11932
11938
|
const MAX_HEADING_LEVEL = 6;
|
|
11933
11939
|
|
|
@@ -11954,12 +11960,12 @@ const defaultContext = {
|
|
|
11954
11960
|
/**
|
|
11955
11961
|
* Component display name.
|
|
11956
11962
|
*/
|
|
11957
|
-
const COMPONENT_NAME$
|
|
11963
|
+
const COMPONENT_NAME$M = 'Heading';
|
|
11958
11964
|
|
|
11959
11965
|
/**
|
|
11960
11966
|
* Component default class name and class prefix.
|
|
11961
11967
|
*/
|
|
11962
|
-
const CLASSNAME$
|
|
11968
|
+
const CLASSNAME$N = 'lumx-heading';
|
|
11963
11969
|
|
|
11964
11970
|
/**
|
|
11965
11971
|
* Component default props.
|
|
@@ -11984,7 +11990,7 @@ const getHeadingProps = (props, contextHeadingElement) => {
|
|
|
11984
11990
|
return {
|
|
11985
11991
|
...otherProps,
|
|
11986
11992
|
as: computedHeadingElement,
|
|
11987
|
-
className: classnames(className, CLASSNAME$
|
|
11993
|
+
className: classnames(className, CLASSNAME$N),
|
|
11988
11994
|
typography: typography || DEFAULT_TYPOGRAPHY_BY_LEVEL[computedHeadingElement]
|
|
11989
11995
|
};
|
|
11990
11996
|
};
|
|
@@ -12022,8 +12028,8 @@ const Heading = forwardRef((props, ref) => {
|
|
|
12022
12028
|
children: children
|
|
12023
12029
|
});
|
|
12024
12030
|
});
|
|
12025
|
-
Heading.displayName = COMPONENT_NAME$
|
|
12026
|
-
Heading.className = CLASSNAME$
|
|
12031
|
+
Heading.displayName = COMPONENT_NAME$M;
|
|
12032
|
+
Heading.className = CLASSNAME$N;
|
|
12027
12033
|
Heading.defaultProps = DEFAULT_PROPS$J;
|
|
12028
12034
|
|
|
12029
12035
|
/**
|
|
@@ -12062,15 +12068,15 @@ const HeadingLevelProvider = ({
|
|
|
12062
12068
|
/**
|
|
12063
12069
|
* Component display name.
|
|
12064
12070
|
*/
|
|
12065
|
-
const COMPONENT_NAME$
|
|
12071
|
+
const COMPONENT_NAME$L = 'Grid';
|
|
12066
12072
|
|
|
12067
12073
|
/**
|
|
12068
12074
|
* Component default class name and class prefix.
|
|
12069
12075
|
*/
|
|
12070
|
-
const CLASSNAME$
|
|
12076
|
+
const CLASSNAME$M = 'lumx-grid';
|
|
12071
12077
|
const {
|
|
12072
12078
|
block: block$D
|
|
12073
|
-
} = classNames.bem(CLASSNAME$
|
|
12079
|
+
} = classNames.bem(CLASSNAME$M);
|
|
12074
12080
|
|
|
12075
12081
|
/**
|
|
12076
12082
|
* Component default props.
|
|
@@ -12101,7 +12107,7 @@ const Grid = forwardRef((props, ref) => {
|
|
|
12101
12107
|
return /*#__PURE__*/jsx("div", {
|
|
12102
12108
|
ref: ref,
|
|
12103
12109
|
...forwardedProps,
|
|
12104
|
-
className: classNames.join(className, classNames.bem(`${CLASSNAME$
|
|
12110
|
+
className: classNames.join(className, classNames.bem(`${CLASSNAME$M}-container`).block(), block$D({
|
|
12105
12111
|
[`h-align-${hAlign}`]: Boolean(hAlign),
|
|
12106
12112
|
[`v-align-${vAlign}`]: Boolean(vAlign),
|
|
12107
12113
|
[`orientation-${orientation}`]: Boolean(orientation),
|
|
@@ -12111,22 +12117,22 @@ const Grid = forwardRef((props, ref) => {
|
|
|
12111
12117
|
children: children
|
|
12112
12118
|
});
|
|
12113
12119
|
});
|
|
12114
|
-
Grid.displayName = COMPONENT_NAME$
|
|
12115
|
-
Grid.className = CLASSNAME$
|
|
12120
|
+
Grid.displayName = COMPONENT_NAME$L;
|
|
12121
|
+
Grid.className = CLASSNAME$M;
|
|
12116
12122
|
Grid.defaultProps = DEFAULT_PROPS$I;
|
|
12117
12123
|
|
|
12118
12124
|
/**
|
|
12119
12125
|
* Component display name.
|
|
12120
12126
|
*/
|
|
12121
|
-
const COMPONENT_NAME$
|
|
12127
|
+
const COMPONENT_NAME$K = 'GridItem';
|
|
12122
12128
|
|
|
12123
12129
|
/**
|
|
12124
12130
|
* Component default class name and class prefix.
|
|
12125
12131
|
*/
|
|
12126
|
-
const CLASSNAME$
|
|
12132
|
+
const CLASSNAME$L = 'lumx-grid-item';
|
|
12127
12133
|
const {
|
|
12128
12134
|
block: block$C
|
|
12129
|
-
} = classNames.bem(CLASSNAME$
|
|
12135
|
+
} = classNames.bem(CLASSNAME$L);
|
|
12130
12136
|
|
|
12131
12137
|
/**
|
|
12132
12138
|
* GridItem component.
|
|
@@ -12155,18 +12161,18 @@ const GridItem = forwardRef((props, ref) => {
|
|
|
12155
12161
|
children: children
|
|
12156
12162
|
});
|
|
12157
12163
|
});
|
|
12158
|
-
GridItem.displayName = COMPONENT_NAME$
|
|
12159
|
-
GridItem.className = CLASSNAME$
|
|
12164
|
+
GridItem.displayName = COMPONENT_NAME$K;
|
|
12165
|
+
GridItem.className = CLASSNAME$L;
|
|
12160
12166
|
|
|
12161
12167
|
/**
|
|
12162
12168
|
* Component display name.
|
|
12163
12169
|
*/
|
|
12164
|
-
const COMPONENT_NAME$
|
|
12170
|
+
const COMPONENT_NAME$J = 'GridColumn';
|
|
12165
12171
|
|
|
12166
12172
|
/**
|
|
12167
12173
|
* Component default class name and class prefix.
|
|
12168
12174
|
*/
|
|
12169
|
-
const CLASSNAME$
|
|
12175
|
+
const CLASSNAME$K = 'lumx-grid-column';
|
|
12170
12176
|
|
|
12171
12177
|
/**
|
|
12172
12178
|
* Component default props.
|
|
@@ -12196,7 +12202,7 @@ const GridColumn$1 = props => {
|
|
|
12196
12202
|
return /*#__PURE__*/jsx(Component, {
|
|
12197
12203
|
...forwardedProps,
|
|
12198
12204
|
ref: ref,
|
|
12199
|
-
className: classnames(className, CLASSNAME$
|
|
12205
|
+
className: classnames(className, CLASSNAME$K),
|
|
12200
12206
|
style: {
|
|
12201
12207
|
...style,
|
|
12202
12208
|
['--lumx-grid-column-item-min-width']: isInteger(itemMinWidth) && `${itemMinWidth}px`,
|
|
@@ -12206,8 +12212,8 @@ const GridColumn$1 = props => {
|
|
|
12206
12212
|
children: children
|
|
12207
12213
|
});
|
|
12208
12214
|
};
|
|
12209
|
-
GridColumn$1.displayName = COMPONENT_NAME$
|
|
12210
|
-
GridColumn$1.className = CLASSNAME$
|
|
12215
|
+
GridColumn$1.displayName = COMPONENT_NAME$J;
|
|
12216
|
+
GridColumn$1.className = CLASSNAME$K;
|
|
12211
12217
|
GridColumn$1.defaultProps = DEFAULT_PROPS$H;
|
|
12212
12218
|
|
|
12213
12219
|
/**
|
|
@@ -12236,8 +12242,8 @@ const GridColumn = forwardRef((props, ref) => {
|
|
|
12236
12242
|
...props
|
|
12237
12243
|
});
|
|
12238
12244
|
});
|
|
12239
|
-
GridColumn.displayName = COMPONENT_NAME$
|
|
12240
|
-
GridColumn.className = CLASSNAME$
|
|
12245
|
+
GridColumn.displayName = COMPONENT_NAME$J;
|
|
12246
|
+
GridColumn.className = CLASSNAME$K;
|
|
12241
12247
|
GridColumn.defaultProps = DEFAULT_PROPS$G;
|
|
12242
12248
|
|
|
12243
12249
|
/**
|
|
@@ -12259,12 +12265,117 @@ Icon.displayName = Icon$1.displayName;
|
|
|
12259
12265
|
Icon.className = Icon$1.className;
|
|
12260
12266
|
Icon.defaultProps = Icon$1.defaultProps;
|
|
12261
12267
|
|
|
12268
|
+
/**
|
|
12269
|
+
* Image block variants.
|
|
12270
|
+
*/
|
|
12271
|
+
const ImageBlockCaptionPosition = {
|
|
12272
|
+
below: 'below',
|
|
12273
|
+
over: 'over'
|
|
12274
|
+
};
|
|
12275
|
+
|
|
12276
|
+
/**
|
|
12277
|
+
* Image block sizes.
|
|
12278
|
+
*/
|
|
12279
|
+
|
|
12280
|
+
/**
|
|
12281
|
+
* Defines the props of the component.
|
|
12282
|
+
*/
|
|
12283
|
+
|
|
12284
|
+
/**
|
|
12285
|
+
* Component display name.
|
|
12286
|
+
*/
|
|
12287
|
+
const COMPONENT_NAME$I = 'ImageBlock';
|
|
12288
|
+
|
|
12289
|
+
/**
|
|
12290
|
+
* Component default class name and class prefix.
|
|
12291
|
+
*/
|
|
12292
|
+
const CLASSNAME$J = 'lumx-image-block';
|
|
12293
|
+
const {
|
|
12294
|
+
block: block$B,
|
|
12295
|
+
element: element$v
|
|
12296
|
+
} = bem(CLASSNAME$J);
|
|
12297
|
+
|
|
12298
|
+
/**
|
|
12299
|
+
* Component default props.
|
|
12300
|
+
*/
|
|
12301
|
+
const DEFAULT_PROPS$F = {
|
|
12302
|
+
captionPosition: ImageBlockCaptionPosition.below,
|
|
12303
|
+
align: Alignment.left
|
|
12304
|
+
};
|
|
12305
|
+
|
|
12306
|
+
/**
|
|
12307
|
+
* ImageBlock component.
|
|
12308
|
+
*
|
|
12309
|
+
* @param props Component props.
|
|
12310
|
+
* @param ref Component ref.
|
|
12311
|
+
* @return React element.
|
|
12312
|
+
*/
|
|
12313
|
+
const ImageBlock$1 = props => {
|
|
12314
|
+
const {
|
|
12315
|
+
actions,
|
|
12316
|
+
align = DEFAULT_PROPS$F.align,
|
|
12317
|
+
alt,
|
|
12318
|
+
captionPosition = DEFAULT_PROPS$F.captionPosition,
|
|
12319
|
+
captionStyle,
|
|
12320
|
+
className,
|
|
12321
|
+
description,
|
|
12322
|
+
descriptionProps,
|
|
12323
|
+
fillHeight,
|
|
12324
|
+
image,
|
|
12325
|
+
size,
|
|
12326
|
+
tags,
|
|
12327
|
+
ref,
|
|
12328
|
+
theme,
|
|
12329
|
+
thumbnailProps,
|
|
12330
|
+
title,
|
|
12331
|
+
titleProps,
|
|
12332
|
+
Thumbnail,
|
|
12333
|
+
ImageCaption,
|
|
12334
|
+
...forwardedProps
|
|
12335
|
+
} = props;
|
|
12336
|
+
return /*#__PURE__*/jsxs("figure", {
|
|
12337
|
+
ref: ref,
|
|
12338
|
+
...forwardedProps,
|
|
12339
|
+
className: classnames(className, block$B({
|
|
12340
|
+
[`caption-position-${captionPosition}`]: Boolean(captionPosition),
|
|
12341
|
+
[`align-${align}`]: Boolean(align),
|
|
12342
|
+
[`size-${size}`]: Boolean(size),
|
|
12343
|
+
[`theme-${theme}`]: Boolean(theme),
|
|
12344
|
+
'fill-height': fillHeight
|
|
12345
|
+
})),
|
|
12346
|
+
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
12347
|
+
...thumbnailProps,
|
|
12348
|
+
className: classnames(element$v('image'), thumbnailProps?.className),
|
|
12349
|
+
fillHeight: fillHeight,
|
|
12350
|
+
align: align,
|
|
12351
|
+
image: image,
|
|
12352
|
+
size: size,
|
|
12353
|
+
theme: theme,
|
|
12354
|
+
alt: alt || title
|
|
12355
|
+
}), /*#__PURE__*/jsx(ImageCaption, {
|
|
12356
|
+
as: "figcaption",
|
|
12357
|
+
baseClassName: CLASSNAME$J,
|
|
12358
|
+
theme: theme,
|
|
12359
|
+
title: title,
|
|
12360
|
+
titleProps: titleProps,
|
|
12361
|
+
description: description,
|
|
12362
|
+
descriptionProps: descriptionProps,
|
|
12363
|
+
tags: tags,
|
|
12364
|
+
captionStyle: captionStyle,
|
|
12365
|
+
align: align,
|
|
12366
|
+
truncate: captionPosition === 'over'
|
|
12367
|
+
}), actions && /*#__PURE__*/jsx("div", {
|
|
12368
|
+
className: element$v('actions'),
|
|
12369
|
+
children: actions
|
|
12370
|
+
})]
|
|
12371
|
+
});
|
|
12372
|
+
};
|
|
12373
|
+
|
|
12262
12374
|
/** Internal component used to render image captions */
|
|
12263
|
-
const ImageCaption = props => {
|
|
12264
|
-
const defaultTheme = useTheme();
|
|
12375
|
+
const ImageCaption$1 = props => {
|
|
12265
12376
|
const {
|
|
12266
12377
|
baseClassName,
|
|
12267
|
-
theme
|
|
12378
|
+
theme,
|
|
12268
12379
|
as = 'figcaption',
|
|
12269
12380
|
title,
|
|
12270
12381
|
titleProps,
|
|
@@ -12273,7 +12384,13 @@ const ImageCaption = props => {
|
|
|
12273
12384
|
tags,
|
|
12274
12385
|
captionStyle,
|
|
12275
12386
|
align,
|
|
12276
|
-
truncate
|
|
12387
|
+
truncate,
|
|
12388
|
+
FlexBox,
|
|
12389
|
+
Text,
|
|
12390
|
+
wrapperProps = {
|
|
12391
|
+
vAlign: align,
|
|
12392
|
+
hAlign: align === 'center' ? align : undefined
|
|
12393
|
+
}
|
|
12277
12394
|
} = props;
|
|
12278
12395
|
if (!title && !description && !tags) return null;
|
|
12279
12396
|
const titleColor = {
|
|
@@ -12283,42 +12400,40 @@ const ImageCaption = props => {
|
|
|
12283
12400
|
color: theme === 'dark' ? 'light' : 'dark',
|
|
12284
12401
|
colorVariant: 'L2'
|
|
12285
12402
|
};
|
|
12286
|
-
|
|
12287
|
-
// Display description as string or HTML
|
|
12288
|
-
const descriptionContent = typeof description === 'string' ? {
|
|
12289
|
-
children: description
|
|
12290
|
-
} : {
|
|
12291
|
-
dangerouslySetInnerHTML: description
|
|
12292
|
-
};
|
|
12293
12403
|
return /*#__PURE__*/jsxs(FlexBox, {
|
|
12294
12404
|
as: as,
|
|
12295
|
-
className:
|
|
12405
|
+
className: classnames(baseClassName && `${baseClassName}__wrapper`),
|
|
12296
12406
|
style: captionStyle,
|
|
12297
12407
|
orientation: "vertical",
|
|
12298
|
-
vAlign: align,
|
|
12299
|
-
hAlign: align === 'center' ? align : undefined,
|
|
12300
12408
|
gap: "regular",
|
|
12409
|
+
...wrapperProps,
|
|
12301
12410
|
children: [(title || description) && /*#__PURE__*/jsxs(Text, {
|
|
12302
12411
|
as: "p",
|
|
12303
|
-
className:
|
|
12412
|
+
className: classnames(baseClassName && `${baseClassName}__caption`),
|
|
12304
12413
|
truncate: truncate,
|
|
12305
12414
|
...baseColor,
|
|
12306
12415
|
children: [title && /*#__PURE__*/jsx(Text, {
|
|
12307
12416
|
...titleProps,
|
|
12308
12417
|
as: "span",
|
|
12309
|
-
className:
|
|
12418
|
+
className: classnames(titleProps?.className, baseClassName && `${baseClassName}__title`),
|
|
12310
12419
|
typography: "subtitle1",
|
|
12311
12420
|
...titleColor,
|
|
12312
12421
|
children: title
|
|
12313
|
-
}), ' ', description && /*#__PURE__*/jsx(Text, {
|
|
12422
|
+
}), ' ', description && (typeof description === 'object' && '__html' in description ? /*#__PURE__*/jsx(Text, {
|
|
12314
12423
|
...descriptionProps,
|
|
12315
12424
|
as: "span",
|
|
12316
|
-
className:
|
|
12425
|
+
className: classnames(descriptionProps?.className, baseClassName && `${baseClassName}__description`),
|
|
12317
12426
|
typography: "body1",
|
|
12318
|
-
|
|
12319
|
-
})
|
|
12427
|
+
dangerouslySetInnerHTML: description
|
|
12428
|
+
}) : /*#__PURE__*/jsx(Text, {
|
|
12429
|
+
...descriptionProps,
|
|
12430
|
+
as: "span",
|
|
12431
|
+
className: classnames(descriptionProps?.className, baseClassName && `${baseClassName}__description`),
|
|
12432
|
+
typography: "body1",
|
|
12433
|
+
children: description
|
|
12434
|
+
}))]
|
|
12320
12435
|
}), tags && /*#__PURE__*/jsx(FlexBox, {
|
|
12321
|
-
className:
|
|
12436
|
+
className: classnames(baseClassName && `${baseClassName}__tags`),
|
|
12322
12437
|
orientation: "horizontal",
|
|
12323
12438
|
vAlign: align,
|
|
12324
12439
|
children: tags
|
|
@@ -12326,11 +12441,21 @@ const ImageCaption = props => {
|
|
|
12326
12441
|
});
|
|
12327
12442
|
};
|
|
12328
12443
|
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12444
|
+
/** Internal component used to render image captions */
|
|
12445
|
+
const ImageCaption = props => {
|
|
12446
|
+
const defaultTheme = useTheme();
|
|
12447
|
+
const {
|
|
12448
|
+
theme = defaultTheme,
|
|
12449
|
+
...forwardedProps
|
|
12450
|
+
} = props;
|
|
12451
|
+
return ImageCaption$1({
|
|
12452
|
+
FlexBox,
|
|
12453
|
+
Text,
|
|
12454
|
+
theme,
|
|
12455
|
+
...forwardedProps
|
|
12456
|
+
});
|
|
12457
|
+
};
|
|
12458
|
+
|
|
12334
12459
|
/**
|
|
12335
12460
|
* Image block sizes.
|
|
12336
12461
|
*/
|
|
@@ -12339,28 +12464,6 @@ const ImageBlockCaptionPosition = {
|
|
|
12339
12464
|
* Defines the props of the component.
|
|
12340
12465
|
*/
|
|
12341
12466
|
|
|
12342
|
-
/**
|
|
12343
|
-
* Component display name.
|
|
12344
|
-
*/
|
|
12345
|
-
const COMPONENT_NAME$H = 'ImageBlock';
|
|
12346
|
-
|
|
12347
|
-
/**
|
|
12348
|
-
* Component default class name and class prefix.
|
|
12349
|
-
*/
|
|
12350
|
-
const CLASSNAME$I = 'lumx-image-block';
|
|
12351
|
-
const {
|
|
12352
|
-
block: block$B,
|
|
12353
|
-
element: element$v
|
|
12354
|
-
} = classNames.bem(CLASSNAME$I);
|
|
12355
|
-
|
|
12356
|
-
/**
|
|
12357
|
-
* Component default props.
|
|
12358
|
-
*/
|
|
12359
|
-
const DEFAULT_PROPS$F = {
|
|
12360
|
-
captionPosition: ImageBlockCaptionPosition.below,
|
|
12361
|
-
align: Alignment$1.left
|
|
12362
|
-
};
|
|
12363
|
-
|
|
12364
12467
|
/**
|
|
12365
12468
|
* ImageBlock component.
|
|
12366
12469
|
*
|
|
@@ -12371,74 +12474,30 @@ const DEFAULT_PROPS$F = {
|
|
|
12371
12474
|
const ImageBlock = forwardRef((props, ref) => {
|
|
12372
12475
|
const defaultTheme = useTheme() || Theme$1.light;
|
|
12373
12476
|
const {
|
|
12374
|
-
actions,
|
|
12375
|
-
align = DEFAULT_PROPS$F.align,
|
|
12376
|
-
alt,
|
|
12377
|
-
captionPosition = DEFAULT_PROPS$F.captionPosition,
|
|
12378
|
-
captionStyle,
|
|
12379
|
-
className,
|
|
12380
|
-
description,
|
|
12381
|
-
descriptionProps,
|
|
12382
|
-
fillHeight,
|
|
12383
|
-
image,
|
|
12384
|
-
size,
|
|
12385
|
-
tags,
|
|
12386
12477
|
theme = defaultTheme,
|
|
12387
|
-
thumbnailProps,
|
|
12388
|
-
title,
|
|
12389
|
-
titleProps,
|
|
12390
12478
|
...forwardedProps
|
|
12391
12479
|
} = props;
|
|
12392
|
-
return
|
|
12393
|
-
ref
|
|
12480
|
+
return ImageBlock$1({
|
|
12481
|
+
ref,
|
|
12482
|
+
theme,
|
|
12394
12483
|
...forwardedProps,
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
[`align-${align}`]: Boolean(align),
|
|
12398
|
-
[`size-${size}`]: Boolean(size),
|
|
12399
|
-
[`theme-${theme}`]: Boolean(theme),
|
|
12400
|
-
'fill-height': fillHeight
|
|
12401
|
-
})),
|
|
12402
|
-
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
12403
|
-
...thumbnailProps,
|
|
12404
|
-
className: classNames.join(element$v('image'), thumbnailProps?.className),
|
|
12405
|
-
fillHeight: fillHeight,
|
|
12406
|
-
align: align,
|
|
12407
|
-
image: image,
|
|
12408
|
-
size: size,
|
|
12409
|
-
theme: theme,
|
|
12410
|
-
alt: alt || title
|
|
12411
|
-
}), /*#__PURE__*/jsx(ImageCaption, {
|
|
12412
|
-
as: "figcaption",
|
|
12413
|
-
baseClassName: CLASSNAME$I,
|
|
12414
|
-
theme: theme,
|
|
12415
|
-
title: title,
|
|
12416
|
-
titleProps: titleProps,
|
|
12417
|
-
description: description,
|
|
12418
|
-
descriptionProps: descriptionProps,
|
|
12419
|
-
tags: tags,
|
|
12420
|
-
captionStyle: captionStyle,
|
|
12421
|
-
align: align,
|
|
12422
|
-
truncate: captionPosition === 'over'
|
|
12423
|
-
}), actions && /*#__PURE__*/jsx("div", {
|
|
12424
|
-
className: element$v('actions'),
|
|
12425
|
-
children: actions
|
|
12426
|
-
})]
|
|
12484
|
+
Thumbnail,
|
|
12485
|
+
ImageCaption
|
|
12427
12486
|
});
|
|
12428
12487
|
});
|
|
12429
|
-
ImageBlock.displayName = COMPONENT_NAME$
|
|
12430
|
-
ImageBlock.className = CLASSNAME$
|
|
12488
|
+
ImageBlock.displayName = COMPONENT_NAME$I;
|
|
12489
|
+
ImageBlock.className = CLASSNAME$J;
|
|
12431
12490
|
ImageBlock.defaultProps = DEFAULT_PROPS$F;
|
|
12432
12491
|
|
|
12433
12492
|
/**
|
|
12434
12493
|
* Component display name.
|
|
12435
12494
|
*/
|
|
12436
|
-
const COMPONENT_NAME$
|
|
12495
|
+
const COMPONENT_NAME$H = 'ImageLightbox';
|
|
12437
12496
|
|
|
12438
12497
|
/**
|
|
12439
12498
|
* Component default class name and class prefix.
|
|
12440
12499
|
*/
|
|
12441
|
-
const CLASSNAME$
|
|
12500
|
+
const CLASSNAME$I = 'lumx-image-lightbox';
|
|
12442
12501
|
|
|
12443
12502
|
/**
|
|
12444
12503
|
* Observe element size (only works if it's size depends on the window size).
|
|
@@ -12684,7 +12743,7 @@ function useAnimateScroll(scrollAreaRef) {
|
|
|
12684
12743
|
|
|
12685
12744
|
const {
|
|
12686
12745
|
element: element$u
|
|
12687
|
-
} = classNames.bem(CLASSNAME$
|
|
12746
|
+
} = classNames.bem(CLASSNAME$I);
|
|
12688
12747
|
/** Internal image slide component for ImageLightbox */
|
|
12689
12748
|
const ImageSlide = /*#__PURE__*/React__default.memo(props => {
|
|
12690
12749
|
const {
|
|
@@ -12776,7 +12835,7 @@ const ImageSlide = /*#__PURE__*/React__default.memo(props => {
|
|
|
12776
12835
|
|
|
12777
12836
|
const {
|
|
12778
12837
|
element: element$t
|
|
12779
|
-
} = classNames.bem(CLASSNAME$
|
|
12838
|
+
} = classNames.bem(CLASSNAME$I);
|
|
12780
12839
|
/** Internal image slideshow component for ImageLightbox */
|
|
12781
12840
|
const ImageSlideshow = ({
|
|
12782
12841
|
activeImageIndex,
|
|
@@ -13022,7 +13081,7 @@ function useImageLightbox(props) {
|
|
|
13022
13081
|
viewTransitionName: {
|
|
13023
13082
|
source: currentImageRef,
|
|
13024
13083
|
target: triggerImageRefs[currentIndex],
|
|
13025
|
-
name: CLASSNAME$
|
|
13084
|
+
name: CLASSNAME$I
|
|
13026
13085
|
}
|
|
13027
13086
|
});
|
|
13028
13087
|
}
|
|
@@ -13074,7 +13133,7 @@ function useImageLightbox(props) {
|
|
|
13074
13133
|
viewTransitionName: {
|
|
13075
13134
|
source: triggerImage,
|
|
13076
13135
|
target: currentImageRef,
|
|
13077
|
-
name: CLASSNAME$
|
|
13136
|
+
name: CLASSNAME$I
|
|
13078
13137
|
}
|
|
13079
13138
|
});
|
|
13080
13139
|
}
|
|
@@ -13128,7 +13187,7 @@ const Inner = forwardRef((props, ref) => {
|
|
|
13128
13187
|
}, [onClose]);
|
|
13129
13188
|
return /*#__PURE__*/jsx(Lightbox, {
|
|
13130
13189
|
ref: ref,
|
|
13131
|
-
className: classNames.join(className, CLASSNAME$
|
|
13190
|
+
className: classNames.join(className, CLASSNAME$I),
|
|
13132
13191
|
parentElement: parentElement,
|
|
13133
13192
|
isOpen: isOpen,
|
|
13134
13193
|
onClose: onClose,
|
|
@@ -13157,8 +13216,8 @@ const Inner = forwardRef((props, ref) => {
|
|
|
13157
13216
|
})
|
|
13158
13217
|
});
|
|
13159
13218
|
});
|
|
13160
|
-
Inner.displayName = COMPONENT_NAME$
|
|
13161
|
-
Inner.className = CLASSNAME$
|
|
13219
|
+
Inner.displayName = COMPONENT_NAME$H;
|
|
13220
|
+
Inner.className = CLASSNAME$I;
|
|
13162
13221
|
|
|
13163
13222
|
/**
|
|
13164
13223
|
* ImageLightbox component.
|
|
@@ -13174,16 +13233,16 @@ const ImageLightbox = Object.assign(Inner, {
|
|
|
13174
13233
|
/**
|
|
13175
13234
|
* Component display name.
|
|
13176
13235
|
*/
|
|
13177
|
-
const COMPONENT_NAME$
|
|
13236
|
+
const COMPONENT_NAME$G = 'InlineList';
|
|
13178
13237
|
|
|
13179
13238
|
/**
|
|
13180
13239
|
* Component default class name and class prefix.
|
|
13181
13240
|
*/
|
|
13182
|
-
const CLASSNAME$
|
|
13241
|
+
const CLASSNAME$H = 'lumx-inline-list';
|
|
13183
13242
|
const {
|
|
13184
13243
|
block: block$A,
|
|
13185
13244
|
element: element$s
|
|
13186
|
-
} = bem(CLASSNAME$
|
|
13245
|
+
} = bem(CLASSNAME$H);
|
|
13187
13246
|
|
|
13188
13247
|
/**
|
|
13189
13248
|
* Component default props.
|
|
@@ -13235,8 +13294,8 @@ const InlineList$1 = props => {
|
|
|
13235
13294
|
})
|
|
13236
13295
|
);
|
|
13237
13296
|
};
|
|
13238
|
-
InlineList$1.displayName = COMPONENT_NAME$
|
|
13239
|
-
InlineList$1.className = CLASSNAME$
|
|
13297
|
+
InlineList$1.displayName = COMPONENT_NAME$G;
|
|
13298
|
+
InlineList$1.className = CLASSNAME$H;
|
|
13240
13299
|
InlineList$1.defaultProps = DEFAULT_PROPS$E;
|
|
13241
13300
|
|
|
13242
13301
|
/**
|
|
@@ -13261,8 +13320,8 @@ const InlineList = forwardRef((props, ref) => {
|
|
|
13261
13320
|
items: Children.toArray(children)
|
|
13262
13321
|
});
|
|
13263
13322
|
});
|
|
13264
|
-
InlineList.displayName = COMPONENT_NAME$
|
|
13265
|
-
InlineList.className = CLASSNAME$
|
|
13323
|
+
InlineList.displayName = COMPONENT_NAME$G;
|
|
13324
|
+
InlineList.className = CLASSNAME$H;
|
|
13266
13325
|
InlineList.defaultProps = DEFAULT_PROPS$E;
|
|
13267
13326
|
|
|
13268
13327
|
/**
|
|
@@ -13306,16 +13365,16 @@ InputLabel.defaultProps = InputLabel$1.defaultProps;
|
|
|
13306
13365
|
/**
|
|
13307
13366
|
* Component display name.
|
|
13308
13367
|
*/
|
|
13309
|
-
const COMPONENT_NAME$
|
|
13368
|
+
const COMPONENT_NAME$F = 'Lightbox';
|
|
13310
13369
|
|
|
13311
13370
|
/**
|
|
13312
13371
|
* Component default class name and class prefix.
|
|
13313
13372
|
*/
|
|
13314
|
-
const CLASSNAME$
|
|
13373
|
+
const CLASSNAME$G = 'lumx-lightbox';
|
|
13315
13374
|
const {
|
|
13316
13375
|
block: block$z,
|
|
13317
13376
|
element: element$r
|
|
13318
|
-
} = classNames.bem(CLASSNAME$
|
|
13377
|
+
} = classNames.bem(CLASSNAME$G);
|
|
13319
13378
|
|
|
13320
13379
|
/**
|
|
13321
13380
|
* Lightbox component.
|
|
@@ -13438,8 +13497,8 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
13438
13497
|
})
|
|
13439
13498
|
});
|
|
13440
13499
|
});
|
|
13441
|
-
Lightbox.displayName = COMPONENT_NAME$
|
|
13442
|
-
Lightbox.className = CLASSNAME$
|
|
13500
|
+
Lightbox.displayName = COMPONENT_NAME$F;
|
|
13501
|
+
Lightbox.className = CLASSNAME$G;
|
|
13443
13502
|
|
|
13444
13503
|
/**
|
|
13445
13504
|
* Defines the props of the component.
|
|
@@ -13448,15 +13507,15 @@ Lightbox.className = CLASSNAME$F;
|
|
|
13448
13507
|
/**
|
|
13449
13508
|
* Component display name.
|
|
13450
13509
|
*/
|
|
13451
|
-
const COMPONENT_NAME$
|
|
13510
|
+
const COMPONENT_NAME$E = 'Link';
|
|
13452
13511
|
|
|
13453
13512
|
/**
|
|
13454
13513
|
* Component default class name and class prefix.
|
|
13455
13514
|
*/
|
|
13456
|
-
const CLASSNAME$
|
|
13515
|
+
const CLASSNAME$F = 'lumx-link';
|
|
13457
13516
|
const {
|
|
13458
13517
|
block: block$y
|
|
13459
|
-
} = bem(CLASSNAME$
|
|
13518
|
+
} = bem(CLASSNAME$F);
|
|
13460
13519
|
|
|
13461
13520
|
/**
|
|
13462
13521
|
* Link component.
|
|
@@ -13495,7 +13554,7 @@ const Link$1 = props => {
|
|
|
13495
13554
|
|
|
13496
13555
|
const {
|
|
13497
13556
|
element: element$q
|
|
13498
|
-
} = classNames.bem(CLASSNAME$
|
|
13557
|
+
} = classNames.bem(CLASSNAME$F);
|
|
13499
13558
|
|
|
13500
13559
|
/**
|
|
13501
13560
|
* Defines the props of the component.
|
|
@@ -13541,28 +13600,28 @@ const Link = forwardRef((props, ref) => {
|
|
|
13541
13600
|
}))
|
|
13542
13601
|
});
|
|
13543
13602
|
});
|
|
13544
|
-
Link.displayName = COMPONENT_NAME$
|
|
13545
|
-
Link.className = CLASSNAME$
|
|
13603
|
+
Link.displayName = COMPONENT_NAME$E;
|
|
13604
|
+
Link.className = CLASSNAME$F;
|
|
13546
13605
|
|
|
13547
13606
|
/**
|
|
13548
13607
|
* Component display name.
|
|
13549
13608
|
*/
|
|
13550
|
-
const COMPONENT_NAME$
|
|
13609
|
+
const COMPONENT_NAME$D = 'LinkPreview';
|
|
13551
13610
|
|
|
13552
13611
|
/**
|
|
13553
13612
|
* Component default class name and class prefix.
|
|
13554
13613
|
*/
|
|
13555
|
-
const CLASSNAME$
|
|
13614
|
+
const CLASSNAME$E = 'lumx-link-preview';
|
|
13556
13615
|
const {
|
|
13557
13616
|
block: block$x,
|
|
13558
13617
|
element: element$p
|
|
13559
|
-
} =
|
|
13618
|
+
} = bem(CLASSNAME$E);
|
|
13560
13619
|
|
|
13561
13620
|
/**
|
|
13562
13621
|
* Component default props.
|
|
13563
13622
|
*/
|
|
13564
13623
|
const DEFAULT_PROPS$D = {
|
|
13565
|
-
size: Size
|
|
13624
|
+
size: Size.regular,
|
|
13566
13625
|
titleHeading: 'h2'
|
|
13567
13626
|
};
|
|
13568
13627
|
|
|
@@ -13573,8 +13632,7 @@ const DEFAULT_PROPS$D = {
|
|
|
13573
13632
|
* @param ref Component ref.
|
|
13574
13633
|
* @return React element.
|
|
13575
13634
|
*/
|
|
13576
|
-
const LinkPreview =
|
|
13577
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
13635
|
+
const LinkPreview$1 = props => {
|
|
13578
13636
|
const {
|
|
13579
13637
|
className,
|
|
13580
13638
|
description,
|
|
@@ -13582,19 +13640,21 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
13582
13640
|
linkAs,
|
|
13583
13641
|
linkProps,
|
|
13584
13642
|
size = DEFAULT_PROPS$D.size,
|
|
13585
|
-
theme
|
|
13643
|
+
theme,
|
|
13586
13644
|
thumbnailProps,
|
|
13645
|
+
ref,
|
|
13587
13646
|
title,
|
|
13588
|
-
|
|
13647
|
+
TitleHeading,
|
|
13648
|
+
Link,
|
|
13649
|
+
Thumbnail,
|
|
13589
13650
|
...forwardedProps
|
|
13590
13651
|
} = props;
|
|
13591
13652
|
// Use title heading as title wrapper (see DEFAULT_PROPS for the default value).
|
|
13592
|
-
const
|
|
13593
|
-
const adjustedSize = size === Size$1.big && thumbnailProps ? Size$1.big : Size$1.regular;
|
|
13653
|
+
const adjustedSize = size === Size.big && thumbnailProps ? Size.big : Size.regular;
|
|
13594
13654
|
return /*#__PURE__*/jsx("article", {
|
|
13595
13655
|
ref: ref,
|
|
13596
13656
|
...forwardedProps,
|
|
13597
|
-
className:
|
|
13657
|
+
className: classnames(className, block$x({
|
|
13598
13658
|
[`size-${adjustedSize}`]: Boolean(adjustedSize),
|
|
13599
13659
|
[`theme-${theme}`]: Boolean(theme)
|
|
13600
13660
|
})),
|
|
@@ -13612,7 +13672,7 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
13612
13672
|
// Avoid redundant links in focus order
|
|
13613
13673
|
tabIndex: -1
|
|
13614
13674
|
},
|
|
13615
|
-
aspectRatio: AspectRatio
|
|
13675
|
+
aspectRatio: AspectRatio.free,
|
|
13616
13676
|
fillHeight: true
|
|
13617
13677
|
})
|
|
13618
13678
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -13624,7 +13684,7 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
13624
13684
|
linkAs: linkAs,
|
|
13625
13685
|
target: "_blank",
|
|
13626
13686
|
href: link,
|
|
13627
|
-
color: theme === Theme
|
|
13687
|
+
color: theme === Theme.light ? ColorPalette.dark : ColorPalette.light,
|
|
13628
13688
|
colorVariant: ColorVariant.N,
|
|
13629
13689
|
children: title
|
|
13630
13690
|
})
|
|
@@ -13636,10 +13696,10 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
13636
13696
|
children: /*#__PURE__*/jsx(Link, {
|
|
13637
13697
|
...linkProps,
|
|
13638
13698
|
linkAs: linkAs,
|
|
13639
|
-
className:
|
|
13699
|
+
className: classnames(element$p('link'), linkProps?.className),
|
|
13640
13700
|
target: "_blank",
|
|
13641
13701
|
href: link,
|
|
13642
|
-
color: theme === Theme
|
|
13702
|
+
color: theme === Theme.light ? ColorPalette.primary : ColorPalette.light,
|
|
13643
13703
|
colorVariant: ColorVariant.N
|
|
13644
13704
|
// Avoid redundant links in focus order
|
|
13645
13705
|
,
|
|
@@ -13650,11 +13710,156 @@ const LinkPreview = forwardRef((props, ref) => {
|
|
|
13650
13710
|
})]
|
|
13651
13711
|
})
|
|
13652
13712
|
});
|
|
13713
|
+
};
|
|
13714
|
+
|
|
13715
|
+
/**
|
|
13716
|
+
* Defines the props of the component.
|
|
13717
|
+
*/
|
|
13718
|
+
|
|
13719
|
+
/**
|
|
13720
|
+
* LinkPreview component.
|
|
13721
|
+
*
|
|
13722
|
+
* @param props Component props.
|
|
13723
|
+
* @param ref Component ref.
|
|
13724
|
+
* @return React element.
|
|
13725
|
+
*/
|
|
13726
|
+
const LinkPreview = forwardRef((props, ref) => {
|
|
13727
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
13728
|
+
const {
|
|
13729
|
+
theme = defaultTheme,
|
|
13730
|
+
titleHeading = DEFAULT_PROPS$D.titleHeading,
|
|
13731
|
+
...forwardedProps
|
|
13732
|
+
} = props;
|
|
13733
|
+
// Use title heading as title wrapper (see DEFAULT_PROPS for the default value).
|
|
13734
|
+
const TitleHeading = titleHeading;
|
|
13735
|
+
return LinkPreview$1({
|
|
13736
|
+
theme,
|
|
13737
|
+
TitleHeading,
|
|
13738
|
+
ref,
|
|
13739
|
+
Link,
|
|
13740
|
+
Thumbnail,
|
|
13741
|
+
...forwardedProps
|
|
13742
|
+
});
|
|
13653
13743
|
});
|
|
13654
|
-
LinkPreview.displayName = COMPONENT_NAME$
|
|
13655
|
-
LinkPreview.className = CLASSNAME$
|
|
13744
|
+
LinkPreview.displayName = COMPONENT_NAME$D;
|
|
13745
|
+
LinkPreview.className = CLASSNAME$E;
|
|
13656
13746
|
LinkPreview.defaultProps = DEFAULT_PROPS$D;
|
|
13657
13747
|
|
|
13748
|
+
/**
|
|
13749
|
+
* ListItem.Action props.
|
|
13750
|
+
*/
|
|
13751
|
+
|
|
13752
|
+
/**
|
|
13753
|
+
* ListItem.Action sub-component.
|
|
13754
|
+
*
|
|
13755
|
+
* Renders a button or link with action area classes.
|
|
13756
|
+
* When placed as a child of ListItem, it activates the action area pattern:
|
|
13757
|
+
* the entire list item becomes visually clickable, while other interactive
|
|
13758
|
+
* elements (in `before`/`after` slots) remain independently clickable.
|
|
13759
|
+
*
|
|
13760
|
+
* @param props Component props.
|
|
13761
|
+
* @param ref Component ref.
|
|
13762
|
+
* @return React element.
|
|
13763
|
+
*/
|
|
13764
|
+
const ListItemAction = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
13765
|
+
const {
|
|
13766
|
+
children,
|
|
13767
|
+
onClick,
|
|
13768
|
+
...forwardedProps
|
|
13769
|
+
} = props;
|
|
13770
|
+
return ListItemAction$1({
|
|
13771
|
+
...forwardedProps,
|
|
13772
|
+
handleClick: onClick,
|
|
13773
|
+
ref,
|
|
13774
|
+
children
|
|
13775
|
+
});
|
|
13776
|
+
}), {
|
|
13777
|
+
displayName: COMPONENT_NAME$19,
|
|
13778
|
+
className: CLASSNAME$18,
|
|
13779
|
+
defaultProps: DEFAULT_PROPS$W
|
|
13780
|
+
});
|
|
13781
|
+
|
|
13782
|
+
/**
|
|
13783
|
+
* Defines the props of the component.
|
|
13784
|
+
*/
|
|
13785
|
+
|
|
13786
|
+
/**
|
|
13787
|
+
* ListItem component.
|
|
13788
|
+
*
|
|
13789
|
+
* @param props Component props.
|
|
13790
|
+
* @param ref Component ref.
|
|
13791
|
+
* @return React element.
|
|
13792
|
+
*/
|
|
13793
|
+
const _ListItem = forwardRef((props, ref) => {
|
|
13794
|
+
const {
|
|
13795
|
+
disabledStateProps,
|
|
13796
|
+
otherProps
|
|
13797
|
+
} = useDisableStateProps(props);
|
|
13798
|
+
const {
|
|
13799
|
+
onItemSelected,
|
|
13800
|
+
onClick,
|
|
13801
|
+
linkRef,
|
|
13802
|
+
...forwardedProps
|
|
13803
|
+
} = otherProps;
|
|
13804
|
+
const handleClick = event => {
|
|
13805
|
+
onItemSelected?.(event);
|
|
13806
|
+
onClick?.(event);
|
|
13807
|
+
};
|
|
13808
|
+
return ListItem$1({
|
|
13809
|
+
...forwardedProps,
|
|
13810
|
+
isDisabled: disabledStateProps.disabled,
|
|
13811
|
+
'aria-disabled': disabledStateProps['aria-disabled'],
|
|
13812
|
+
ref,
|
|
13813
|
+
linkRef,
|
|
13814
|
+
handleClick: onItemSelected || props.onClick ? handleClick : undefined
|
|
13815
|
+
});
|
|
13816
|
+
});
|
|
13817
|
+
_ListItem.displayName = COMPONENT_NAME$1a;
|
|
13818
|
+
_ListItem.className = CLASSNAME$19;
|
|
13819
|
+
_ListItem.defaultProps = DEFAULT_PROPS$X;
|
|
13820
|
+
|
|
13821
|
+
/**
|
|
13822
|
+
* ListItem component with Action sub-component.
|
|
13823
|
+
*/
|
|
13824
|
+
const ListItem = Object.assign(_ListItem, {
|
|
13825
|
+
/** Sub-component that renders the default action (button or link) for the action area pattern. */
|
|
13826
|
+
Action: ListItemAction
|
|
13827
|
+
});
|
|
13828
|
+
|
|
13829
|
+
/**
|
|
13830
|
+
* Component display name.
|
|
13831
|
+
*/
|
|
13832
|
+
const COMPONENT_NAME$C = 'ListSubheader';
|
|
13833
|
+
|
|
13834
|
+
/**
|
|
13835
|
+
* Component default class name and class prefix.
|
|
13836
|
+
*/
|
|
13837
|
+
const CLASSNAME$D = 'lumx-list-subheader';
|
|
13838
|
+
|
|
13839
|
+
/**
|
|
13840
|
+
* ListSubheader component.
|
|
13841
|
+
* @deprecated ListSubheader produces improper list structure. use ListSection instead.
|
|
13842
|
+
*
|
|
13843
|
+
* @param props Component props.
|
|
13844
|
+
* @param ref Component ref.
|
|
13845
|
+
* @return React element.
|
|
13846
|
+
*/
|
|
13847
|
+
const ListSubheader = forwardRef((props, ref) => {
|
|
13848
|
+
const {
|
|
13849
|
+
children,
|
|
13850
|
+
className,
|
|
13851
|
+
...forwardedProps
|
|
13852
|
+
} = props;
|
|
13853
|
+
return /*#__PURE__*/jsx("li", {
|
|
13854
|
+
ref: ref,
|
|
13855
|
+
...forwardedProps,
|
|
13856
|
+
className: classNames.join(className, CLASSNAME$D),
|
|
13857
|
+
children: children
|
|
13858
|
+
});
|
|
13859
|
+
});
|
|
13860
|
+
ListSubheader.displayName = COMPONENT_NAME$C;
|
|
13861
|
+
ListSubheader.className = CLASSNAME$D;
|
|
13862
|
+
|
|
13658
13863
|
/**
|
|
13659
13864
|
* Component display name.
|
|
13660
13865
|
*/
|
|
@@ -13772,7 +13977,7 @@ const CLASSNAME$B = 'lumx-mosaic';
|
|
|
13772
13977
|
const {
|
|
13773
13978
|
block: block$v,
|
|
13774
13979
|
element: element$n
|
|
13775
|
-
} =
|
|
13980
|
+
} = bem(CLASSNAME$B);
|
|
13776
13981
|
|
|
13777
13982
|
/**
|
|
13778
13983
|
* Component default props.
|
|
@@ -13786,26 +13991,27 @@ const DEFAULT_PROPS$C = {};
|
|
|
13786
13991
|
* @param ref Component ref.
|
|
13787
13992
|
* @return React element.
|
|
13788
13993
|
*/
|
|
13789
|
-
const Mosaic =
|
|
13790
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
13994
|
+
const Mosaic$1 = props => {
|
|
13791
13995
|
const {
|
|
13792
13996
|
className,
|
|
13793
|
-
theme
|
|
13997
|
+
theme,
|
|
13794
13998
|
thumbnails,
|
|
13795
|
-
|
|
13999
|
+
handleClick,
|
|
14000
|
+
Thumbnail,
|
|
14001
|
+
ref,
|
|
13796
14002
|
...forwardedProps
|
|
13797
14003
|
} = props;
|
|
13798
|
-
const
|
|
13799
|
-
if (!
|
|
14004
|
+
const onImageClick = () => {
|
|
14005
|
+
if (!handleClick) return undefined;
|
|
13800
14006
|
return (index, onClick) => event => {
|
|
13801
14007
|
onClick?.(event);
|
|
13802
|
-
|
|
14008
|
+
handleClick?.(index);
|
|
13803
14009
|
};
|
|
13804
|
-
}
|
|
14010
|
+
};
|
|
13805
14011
|
return /*#__PURE__*/jsx("div", {
|
|
13806
14012
|
ref: ref,
|
|
13807
14013
|
...forwardedProps,
|
|
13808
|
-
className:
|
|
14014
|
+
className: classnames(className, block$v({
|
|
13809
14015
|
[`theme-${theme}`]: Boolean(theme),
|
|
13810
14016
|
'has-1-thumbnail': thumbnails?.length === 1,
|
|
13811
14017
|
'has-2-thumbnails': thumbnails?.length === 2,
|
|
@@ -13825,12 +14031,12 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
13825
14031
|
className: element$n('thumbnail'),
|
|
13826
14032
|
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
13827
14033
|
...thumbnailProps,
|
|
13828
|
-
align: align || Alignment
|
|
14034
|
+
align: align || Alignment.left,
|
|
13829
14035
|
image: image,
|
|
13830
14036
|
theme: theme,
|
|
13831
|
-
aspectRatio: AspectRatio
|
|
14037
|
+
aspectRatio: AspectRatio.free,
|
|
13832
14038
|
fillHeight: true,
|
|
13833
|
-
onClick:
|
|
14039
|
+
onClick: onImageClick()?.(index, onClick) || onClick
|
|
13834
14040
|
}), thumbnails.length > 4 && index === 3 && /*#__PURE__*/jsx("div", {
|
|
13835
14041
|
className: element$n('overlay'),
|
|
13836
14042
|
children: /*#__PURE__*/jsxs("span", {
|
|
@@ -13841,6 +14047,33 @@ const Mosaic = forwardRef((props, ref) => {
|
|
|
13841
14047
|
})
|
|
13842
14048
|
})
|
|
13843
14049
|
});
|
|
14050
|
+
};
|
|
14051
|
+
|
|
14052
|
+
/**
|
|
14053
|
+
* Defines the props of the component.
|
|
14054
|
+
*/
|
|
14055
|
+
|
|
14056
|
+
/**
|
|
14057
|
+
* Mosaic component.
|
|
14058
|
+
*
|
|
14059
|
+
* @param props Component props.
|
|
14060
|
+
* @param ref Component ref.
|
|
14061
|
+
* @return React element.
|
|
14062
|
+
*/
|
|
14063
|
+
const Mosaic = forwardRef((props, ref) => {
|
|
14064
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
14065
|
+
const {
|
|
14066
|
+
theme = defaultTheme,
|
|
14067
|
+
onImageClick,
|
|
14068
|
+
...forwardedProps
|
|
14069
|
+
} = props;
|
|
14070
|
+
return Mosaic$1({
|
|
14071
|
+
ref,
|
|
14072
|
+
theme,
|
|
14073
|
+
Thumbnail,
|
|
14074
|
+
handleClick: onImageClick,
|
|
14075
|
+
...forwardedProps
|
|
14076
|
+
});
|
|
13844
14077
|
});
|
|
13845
14078
|
Mosaic.displayName = COMPONENT_NAME$A;
|
|
13846
14079
|
Mosaic.className = CLASSNAME$B;
|