@lumx/react 4.25.1-alpha.2 → 4.25.1-alpha.4
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 +19 -7
- package/index.js +128 -70
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1933,6 +1933,11 @@ interface ListboxListProps$1 extends HasClassName {
|
|
|
1933
1933
|
* Omit (or set to `undefined`) when not loading — the attribute is not rendered as `"false"`.
|
|
1934
1934
|
*/
|
|
1935
1935
|
'aria-busy'?: boolean;
|
|
1936
|
+
/**
|
|
1937
|
+
* Allow selecting several options (`aria-multiselectable`).
|
|
1938
|
+
* Also read by `Combobox.SelectionIcon` to pick the checkbox icons.
|
|
1939
|
+
*/
|
|
1940
|
+
'aria-multiselectable'?: boolean | 'true' | 'false';
|
|
1936
1941
|
/** Content (should be ListboxOption elements). */
|
|
1937
1942
|
children?: JSXElement;
|
|
1938
1943
|
/** The ID of the listbox element. */
|
|
@@ -1979,7 +1984,7 @@ interface ListboxOptionProps$1 extends HasClassName {
|
|
|
1979
1984
|
* When true, renders a bare `<li hidden>` with only the children text — no ARIA roles,
|
|
1980
1985
|
* no classes, no visual structure. This keeps the element in the DOM so its textContent
|
|
1981
1986
|
* can be read for future filter evaluations, while naturally excluding it from
|
|
1982
|
-
* `[role="option"]` queries (focus navigation) and `.lumx-
|
|
1987
|
+
* `[role="option"]` queries (focus navigation) and `.lumx-listbox-option` CSS rules
|
|
1983
1988
|
* (section/popover auto-hide).
|
|
1984
1989
|
*/
|
|
1985
1990
|
hidden?: boolean;
|
|
@@ -2291,19 +2296,24 @@ declare const Combobox: {
|
|
|
2291
2296
|
ref?: ComponentRef<E> | undefined;
|
|
2292
2297
|
}) => React.JSX.Element) & {
|
|
2293
2298
|
displayName: string;
|
|
2294
|
-
className: "lumx-
|
|
2299
|
+
className: "lumx-listbox-option-action";
|
|
2295
2300
|
};
|
|
2296
2301
|
/** Info button on an option that shows a popover on hover or keyboard highlight. */
|
|
2297
2302
|
OptionMoreInfo: {
|
|
2298
2303
|
(props: ListboxOptionMoreInfoProps): react_jsx_runtime.JSX.Element;
|
|
2299
2304
|
displayName: string;
|
|
2300
|
-
className: "lumx-
|
|
2305
|
+
className: "lumx-listbox-option-more-info";
|
|
2301
2306
|
};
|
|
2302
2307
|
/** Loading placeholder skeleton(s) that auto-register loading state with the combobox handle. */
|
|
2303
2308
|
OptionSkeleton: {
|
|
2304
2309
|
(props: ListboxOptionSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
2305
2310
|
displayName: string;
|
|
2306
|
-
className: "lumx-
|
|
2311
|
+
className: "lumx-listbox-option-skeleton";
|
|
2312
|
+
};
|
|
2313
|
+
/** Selection state icon (check circle / radio, or checkbox in multiple lists) for the `after` slot of an option. Reads the option `isSelected` and the list `aria-multiselectable`. */
|
|
2314
|
+
SelectionIcon: {
|
|
2315
|
+
(): react_jsx_runtime.JSX.Element;
|
|
2316
|
+
displayName: string;
|
|
2307
2317
|
};
|
|
2308
2318
|
/** Floating popover container that auto-binds to the combobox anchor and open/close state. */
|
|
2309
2319
|
Popover: {
|
|
@@ -2317,7 +2327,7 @@ declare const Combobox: {
|
|
|
2317
2327
|
State: {
|
|
2318
2328
|
(props: ListboxStateProps): react_jsx_runtime.JSX.Element;
|
|
2319
2329
|
displayName: string;
|
|
2320
|
-
className: "lumx-
|
|
2330
|
+
className: "lumx-listbox-state";
|
|
2321
2331
|
};
|
|
2322
2332
|
/** Visual separator between option groups (alias for ListDivider). Purely decorative — invisible to screen readers. */
|
|
2323
2333
|
Divider: Comp<ListDividerProps, HTMLLIElement>;
|
|
@@ -4486,6 +4496,8 @@ interface BaseSelectTextFieldWrapperProps<O> extends Pick<BaseSelectProps<O>, 'o
|
|
|
4486
4496
|
maxLength?: number;
|
|
4487
4497
|
/** Accessible label for the input element (overrides the visual label for screen readers). */
|
|
4488
4498
|
ariaLabel?: string;
|
|
4499
|
+
/** Additional props forwarded to the field label (e.g. `className: 'visually-hidden'`, `typography`). */
|
|
4500
|
+
labelProps?: Partial<Omit<InputLabelProps$1, 'children' | 'htmlFor' | 'id'>>;
|
|
4489
4501
|
/** Additional props forwarded to the Combobox.Input (and ultimately to TextField). */
|
|
4490
4502
|
inputProps?: Record<string, any>;
|
|
4491
4503
|
/** Props forwarded to the Combobox.Popover. */
|
|
@@ -4733,13 +4745,13 @@ declare const SelectTextField: {
|
|
|
4733
4745
|
OptionMoreInfo: {
|
|
4734
4746
|
(props: ListboxOptionMoreInfoProps): react_jsx_runtime.JSX.Element;
|
|
4735
4747
|
displayName: string;
|
|
4736
|
-
className: "lumx-
|
|
4748
|
+
className: "lumx-listbox-option-more-info";
|
|
4737
4749
|
};
|
|
4738
4750
|
/** Skeleton loading placeholder for options being fetched. */
|
|
4739
4751
|
OptionSkeleton: {
|
|
4740
4752
|
(props: ListboxOptionSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
4741
4753
|
displayName: string;
|
|
4742
|
-
className: "lumx-
|
|
4754
|
+
className: "lumx-listbox-option-skeleton";
|
|
4743
4755
|
};
|
|
4744
4756
|
/** Visual separator between option groups (alias for ListDivider). Purely decorative — invisible to screen readers. */
|
|
4745
4757
|
Divider: Comp<ListDividerProps, HTMLLIElement>;
|
package/index.js
CHANGED
|
@@ -13,6 +13,10 @@ import { u as useDisabledStateContext, P as Portal, C as ClickAwayProvider, I as
|
|
|
13
13
|
import { getDisabledState as getDisabledState$1 } from '@lumx/core/js/utils/disabledState';
|
|
14
14
|
import { mdiInformationOutline } from '@lumx/icons/esm/information-outline.js';
|
|
15
15
|
import { mdiAlertCircle } from '@lumx/icons/esm/alert-circle.js';
|
|
16
|
+
import { mdiCheckboxBlankOutline } from '@lumx/icons/esm/checkbox-blank-outline.js';
|
|
17
|
+
import { mdiCheckboxMarked } from '@lumx/icons/esm/checkbox-marked.js';
|
|
18
|
+
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle.js';
|
|
19
|
+
import { mdiRadioboxBlank } from '@lumx/icons/esm/radiobox-blank.js';
|
|
16
20
|
import get from 'lodash/get.js';
|
|
17
21
|
import isEmpty from 'lodash/isEmpty.js';
|
|
18
22
|
import noop$1 from 'lodash/noop.js';
|
|
@@ -23,12 +27,8 @@ import reduce from 'lodash/reduce.js';
|
|
|
23
27
|
import castArray from 'lodash/castArray.js';
|
|
24
28
|
import { mdiChevronUp } from '@lumx/icons/esm/chevron-up.js';
|
|
25
29
|
import { mdiChevronDown } from '@lumx/icons/esm/chevron-down.js';
|
|
26
|
-
import { mdiCheckCircle } from '@lumx/icons/esm/check-circle.js';
|
|
27
30
|
import { mdiCloseCircle } from '@lumx/icons/esm/close-circle.js';
|
|
28
31
|
import { mdiMenuDown } from '@lumx/icons/esm/menu-down.js';
|
|
29
|
-
import { mdiCheckboxBlankOutline } from '@lumx/icons/esm/checkbox-blank-outline.js';
|
|
30
|
-
import { mdiCheckboxMarked } from '@lumx/icons/esm/checkbox-marked.js';
|
|
31
|
-
import { mdiRadioboxBlank } from '@lumx/icons/esm/radiobox-blank.js';
|
|
32
32
|
import { mdiClose } from '@lumx/icons/esm/close.js';
|
|
33
33
|
import isFunction from 'lodash/isFunction.js';
|
|
34
34
|
import { mdiAlert } from '@lumx/icons/esm/alert.js';
|
|
@@ -6457,12 +6457,18 @@ List$1.defaultProps = DEFAULT_PROPS$13;
|
|
|
6457
6457
|
/**
|
|
6458
6458
|
* Component display name.
|
|
6459
6459
|
*/
|
|
6460
|
-
const COMPONENT_NAME$1m = '
|
|
6460
|
+
const COMPONENT_NAME$1m = 'ListboxList';
|
|
6461
6461
|
|
|
6462
6462
|
/**
|
|
6463
6463
|
* Component default class name and class prefix.
|
|
6464
6464
|
*/
|
|
6465
|
-
const CLASSNAME$1j = 'lumx-
|
|
6465
|
+
const CLASSNAME$1j = 'lumx-listbox-list';
|
|
6466
|
+
/**
|
|
6467
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
6468
|
+
*
|
|
6469
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
6470
|
+
*/
|
|
6471
|
+
const LEGACY_CLASSNAME$6 = 'lumx-combobox-list';
|
|
6466
6472
|
|
|
6467
6473
|
/**
|
|
6468
6474
|
* ListboxList core template.
|
|
@@ -6484,7 +6490,7 @@ const ListboxList$1 = props => {
|
|
|
6484
6490
|
} = props;
|
|
6485
6491
|
return List$1({
|
|
6486
6492
|
...forwardedProps,
|
|
6487
|
-
className: classnames(className, CLASSNAME$1j),
|
|
6493
|
+
className: classnames(className, CLASSNAME$1j, LEGACY_CLASSNAME$6),
|
|
6488
6494
|
ref,
|
|
6489
6495
|
itemPadding: 'big',
|
|
6490
6496
|
id,
|
|
@@ -6767,11 +6773,13 @@ const ListboxList = forwardRef((props, ref) => {
|
|
|
6767
6773
|
} = useListboxContext();
|
|
6768
6774
|
const internalRef = useRef(null);
|
|
6769
6775
|
const mergedRef = useMergeRefs(ref, internalRef);
|
|
6776
|
+
const selectionType = String(forwardedProps['aria-multiselectable']) === 'true' ? 'multiple' : 'single';
|
|
6770
6777
|
const contextValue = useMemo(() => ({
|
|
6771
6778
|
list,
|
|
6772
6779
|
listboxId,
|
|
6773
|
-
type
|
|
6774
|
-
|
|
6780
|
+
type,
|
|
6781
|
+
selectionType
|
|
6782
|
+
}), [list, listboxId, type, selectionType]);
|
|
6775
6783
|
|
|
6776
6784
|
// Options are rendered only while visible (standalone: always; combobox: while open).
|
|
6777
6785
|
const isOpen = useListboxEvent(list, 'open', false);
|
|
@@ -6940,16 +6948,23 @@ const ListItemAction$1 = props => {
|
|
|
6940
6948
|
/**
|
|
6941
6949
|
* Component display name.
|
|
6942
6950
|
*/
|
|
6943
|
-
const COMPONENT_NAME$1j = '
|
|
6951
|
+
const COMPONENT_NAME$1j = 'ListboxOption';
|
|
6944
6952
|
|
|
6945
6953
|
/**
|
|
6946
6954
|
* Component default class name and class prefix.
|
|
6947
6955
|
*/
|
|
6948
|
-
const CLASSNAME$1g = 'lumx-
|
|
6956
|
+
const CLASSNAME$1g = 'lumx-listbox-option';
|
|
6957
|
+
/**
|
|
6958
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
6959
|
+
*
|
|
6960
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
6961
|
+
*/
|
|
6962
|
+
const LEGACY_CLASSNAME$5 = 'lumx-combobox-option';
|
|
6949
6963
|
const {
|
|
6950
6964
|
block: block$_,
|
|
6951
6965
|
element: element$M
|
|
6952
6966
|
} = bem(CLASSNAME$1g);
|
|
6967
|
+
const legacy$1 = bem(LEGACY_CLASSNAME$5);
|
|
6953
6968
|
|
|
6954
6969
|
/**
|
|
6955
6970
|
* ListboxOption core template.
|
|
@@ -6995,7 +7010,7 @@ const ListboxOption$1 = (props, {
|
|
|
6995
7010
|
// Focus stays on the focus owner (combobox trigger or standalone listbox), never on the option.
|
|
6996
7011
|
tabIndex: -1,
|
|
6997
7012
|
id,
|
|
6998
|
-
className: element$M('action'),
|
|
7013
|
+
className: classnames(element$M('action'), legacy$1.element('action')),
|
|
6999
7014
|
handleClick,
|
|
7000
7015
|
'aria-selected': isSelected ? 'true' : 'false',
|
|
7001
7016
|
'data-value': value,
|
|
@@ -7013,7 +7028,7 @@ const ListboxOption$1 = (props, {
|
|
|
7013
7028
|
size: 'tiny',
|
|
7014
7029
|
...forwardedProps,
|
|
7015
7030
|
hidden,
|
|
7016
|
-
className: !hidden ? classnames(className, block$_()) : undefined,
|
|
7031
|
+
className: !hidden ? classnames(className, block$_(), legacy$1.block()) : undefined,
|
|
7017
7032
|
before,
|
|
7018
7033
|
after,
|
|
7019
7034
|
role: itemRole,
|
|
@@ -7021,7 +7036,7 @@ const ListboxOption$1 = (props, {
|
|
|
7021
7036
|
children: [wrappedAction, description && /*#__PURE__*/jsx("p", {
|
|
7022
7037
|
id: descriptionId,
|
|
7023
7038
|
...getTextProps({
|
|
7024
|
-
className: element$M('description'),
|
|
7039
|
+
className: classnames(element$M('description'), legacy$1.element('description')),
|
|
7025
7040
|
typography: 'caption',
|
|
7026
7041
|
color: 'dark-L2'
|
|
7027
7042
|
}),
|
|
@@ -7048,7 +7063,7 @@ const ListboxOptionContext = /*#__PURE__*/createContext(undefined);
|
|
|
7048
7063
|
function useListboxOptionContext() {
|
|
7049
7064
|
const context = useContext(ListboxOptionContext);
|
|
7050
7065
|
if (!context) {
|
|
7051
|
-
throw new Error('Combobox.
|
|
7066
|
+
throw new Error('Combobox.Option sub-components must be used within a Combobox.Option `after` slot');
|
|
7052
7067
|
}
|
|
7053
7068
|
return context;
|
|
7054
7069
|
}
|
|
@@ -7113,8 +7128,9 @@ const ListboxOption = forwardRef((props, ref) => {
|
|
|
7113
7128
|
// Wrap `after` content in an option context so sub-components (e.g. OptionMoreInfo)
|
|
7114
7129
|
// can access the parent option's ID for keyboard highlight detection.
|
|
7115
7130
|
const optionContextValue = useMemo(() => ({
|
|
7116
|
-
optionId
|
|
7117
|
-
|
|
7131
|
+
optionId,
|
|
7132
|
+
isSelected: Boolean(isSelected)
|
|
7133
|
+
}), [optionId, isSelected]);
|
|
7118
7134
|
const wrappedAfter = after ? /*#__PURE__*/jsx(ListboxOptionContext.Provider, {
|
|
7119
7135
|
value: optionContextValue,
|
|
7120
7136
|
children: after
|
|
@@ -7153,12 +7169,18 @@ ListboxOption.className = CLASSNAME$1g;
|
|
|
7153
7169
|
/**
|
|
7154
7170
|
* Component display name.
|
|
7155
7171
|
*/
|
|
7156
|
-
const COMPONENT_NAME$1i = '
|
|
7172
|
+
const COMPONENT_NAME$1i = 'ListboxOptionAction';
|
|
7157
7173
|
|
|
7158
7174
|
/**
|
|
7159
7175
|
* Component default class name and class prefix.
|
|
7160
7176
|
*/
|
|
7161
|
-
const CLASSNAME$1f = 'lumx-
|
|
7177
|
+
const CLASSNAME$1f = 'lumx-listbox-option-action';
|
|
7178
|
+
/**
|
|
7179
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
7180
|
+
*
|
|
7181
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
7182
|
+
*/
|
|
7183
|
+
const LEGACY_CLASSNAME$4 = 'lumx-combobox-option-action';
|
|
7162
7184
|
|
|
7163
7185
|
/**
|
|
7164
7186
|
* ListboxOptionAction core template.
|
|
@@ -7181,7 +7203,7 @@ const ListboxOptionAction$1 = props => {
|
|
|
7181
7203
|
as: Element,
|
|
7182
7204
|
...forwardedProps,
|
|
7183
7205
|
role: 'gridcell',
|
|
7184
|
-
className: classnames(className, CLASSNAME$1f),
|
|
7206
|
+
className: classnames(className, CLASSNAME$1f, LEGACY_CLASSNAME$4),
|
|
7185
7207
|
handleClick,
|
|
7186
7208
|
children
|
|
7187
7209
|
});
|
|
@@ -7251,16 +7273,23 @@ const ListboxOptionAction = Object.assign(forwardRefPolymorphic((props, ref) =>
|
|
|
7251
7273
|
/**
|
|
7252
7274
|
* Component display name.
|
|
7253
7275
|
*/
|
|
7254
|
-
const COMPONENT_NAME$1h = '
|
|
7276
|
+
const COMPONENT_NAME$1h = 'ListboxOptionMoreInfo';
|
|
7255
7277
|
|
|
7256
7278
|
/**
|
|
7257
7279
|
* Component default class name and class prefix.
|
|
7258
7280
|
*/
|
|
7259
|
-
const CLASSNAME$1e = 'lumx-
|
|
7281
|
+
const CLASSNAME$1e = 'lumx-listbox-option-more-info';
|
|
7282
|
+
/**
|
|
7283
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
7284
|
+
*
|
|
7285
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
7286
|
+
*/
|
|
7287
|
+
const LEGACY_CLASSNAME$3 = 'lumx-combobox-option-more-info';
|
|
7260
7288
|
const {
|
|
7261
7289
|
block: block$Z,
|
|
7262
7290
|
element: element$L
|
|
7263
7291
|
} = bem(CLASSNAME$1e);
|
|
7292
|
+
const legacy = bem(LEGACY_CLASSNAME$3);
|
|
7264
7293
|
|
|
7265
7294
|
/**
|
|
7266
7295
|
* ListboxOptionMoreInfo core template.
|
|
@@ -7294,7 +7323,7 @@ const ListboxOptionMoreInfo$1 = (props, {
|
|
|
7294
7323
|
icon: mdiInformationOutline,
|
|
7295
7324
|
size: "s",
|
|
7296
7325
|
...buttonProps,
|
|
7297
|
-
className: block$Z([className, buttonProps?.className]),
|
|
7326
|
+
className: block$Z([className, buttonProps?.className, LEGACY_CLASSNAME$3]),
|
|
7298
7327
|
emphasis: "low",
|
|
7299
7328
|
onMouseEnter: onMouseEnter,
|
|
7300
7329
|
onMouseLeave: onMouseLeave
|
|
@@ -7305,7 +7334,7 @@ const ListboxOptionMoreInfo$1 = (props, {
|
|
|
7305
7334
|
label: ""
|
|
7306
7335
|
}), /*#__PURE__*/jsx(Popover, {
|
|
7307
7336
|
id: popoverId,
|
|
7308
|
-
className: element$L('popover'),
|
|
7337
|
+
className: classnames(element$L('popover'), legacy.element('popover')),
|
|
7309
7338
|
anchorRef: ref,
|
|
7310
7339
|
isOpen: isOpen,
|
|
7311
7340
|
closeMode: "unmount",
|
|
@@ -8257,12 +8286,18 @@ const SkeletonTypography$1 = props => {
|
|
|
8257
8286
|
/**
|
|
8258
8287
|
* Component display name.
|
|
8259
8288
|
*/
|
|
8260
|
-
const COMPONENT_NAME$1e = '
|
|
8289
|
+
const COMPONENT_NAME$1e = 'ListboxOptionSkeleton';
|
|
8261
8290
|
|
|
8262
8291
|
/**
|
|
8263
8292
|
* Component default class name and class prefix.
|
|
8264
8293
|
*/
|
|
8265
|
-
const CLASSNAME$1b = 'lumx-
|
|
8294
|
+
const CLASSNAME$1b = 'lumx-listbox-option-skeleton';
|
|
8295
|
+
/**
|
|
8296
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
8297
|
+
*
|
|
8298
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
8299
|
+
*/
|
|
8300
|
+
const LEGACY_CLASSNAME$2 = 'lumx-combobox-option-skeleton';
|
|
8266
8301
|
|
|
8267
8302
|
/**
|
|
8268
8303
|
* ListboxOptionSkeleton core template.
|
|
@@ -8289,7 +8324,7 @@ const ListboxOptionSkeleton$1 = props => {
|
|
|
8289
8324
|
size: 'tiny',
|
|
8290
8325
|
role: 'none',
|
|
8291
8326
|
...forwardedProps,
|
|
8292
|
-
className: classnames(className, CLASSNAME$1b),
|
|
8327
|
+
className: classnames(className, CLASSNAME$1b, LEGACY_CLASSNAME$2),
|
|
8293
8328
|
children: children || /*#__PURE__*/jsxs(Fragment, {
|
|
8294
8329
|
children: [/*#__PURE__*/jsx(SkeletonTypography$1, {
|
|
8295
8330
|
typography: "body1",
|
|
@@ -8345,15 +8380,60 @@ const ListboxOptionSkeleton = props => {
|
|
|
8345
8380
|
ListboxOptionSkeleton.displayName = COMPONENT_NAME$1e;
|
|
8346
8381
|
ListboxOptionSkeleton.className = CLASSNAME$1b;
|
|
8347
8382
|
|
|
8383
|
+
/**
|
|
8384
|
+
* Selection state icon of an option. The icon is always rendered after the label.
|
|
8385
|
+
*
|
|
8386
|
+
* - `single`: a check circle icon when selected, a blank radio icon otherwise.
|
|
8387
|
+
* - `multiple`: a checkbox icon, marked or blank.
|
|
8388
|
+
*/
|
|
8389
|
+
const ListboxOptionSelectionIcon$1 = ({
|
|
8390
|
+
selectionType,
|
|
8391
|
+
isSelected
|
|
8392
|
+
}) => {
|
|
8393
|
+
let icon;
|
|
8394
|
+
if (selectionType === 'multiple') {
|
|
8395
|
+
icon = isSelected ? mdiCheckboxMarked : mdiCheckboxBlankOutline;
|
|
8396
|
+
} else if (selectionType === 'single') {
|
|
8397
|
+
icon = isSelected ? mdiCheckCircle : mdiRadioboxBlank;
|
|
8398
|
+
} else {
|
|
8399
|
+
return null;
|
|
8400
|
+
}
|
|
8401
|
+
return /*#__PURE__*/jsx(Icon$1, {
|
|
8402
|
+
icon: icon,
|
|
8403
|
+
color: isSelected ? 'primary' : undefined,
|
|
8404
|
+
className: "lumx-listbox-option__selection-icon lumx-combobox-option__selection-icon"
|
|
8405
|
+
});
|
|
8406
|
+
};
|
|
8407
|
+
|
|
8408
|
+
const ListboxOptionSelectionIcon = () => {
|
|
8409
|
+
const {
|
|
8410
|
+
isSelected
|
|
8411
|
+
} = useListboxOptionContext();
|
|
8412
|
+
const {
|
|
8413
|
+
selectionType
|
|
8414
|
+
} = useListboxContext();
|
|
8415
|
+
return /*#__PURE__*/jsx(ListboxOptionSelectionIcon$1, {
|
|
8416
|
+
selectionType: selectionType,
|
|
8417
|
+
isSelected: isSelected
|
|
8418
|
+
});
|
|
8419
|
+
};
|
|
8420
|
+
ListboxOptionSelectionIcon.displayName = 'ComboboxSelectionIcon';
|
|
8421
|
+
|
|
8348
8422
|
/**
|
|
8349
8423
|
* Component display name.
|
|
8350
8424
|
*/
|
|
8351
|
-
const COMPONENT_NAME$1d = '
|
|
8425
|
+
const COMPONENT_NAME$1d = 'ListboxSection';
|
|
8352
8426
|
|
|
8353
8427
|
/**
|
|
8354
8428
|
* Component default class name and class prefix.
|
|
8355
8429
|
*/
|
|
8356
|
-
const CLASSNAME$1a = 'lumx-
|
|
8430
|
+
const CLASSNAME$1a = 'lumx-listbox-section';
|
|
8431
|
+
/**
|
|
8432
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
8433
|
+
*
|
|
8434
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
8435
|
+
*/
|
|
8436
|
+
const LEGACY_CLASSNAME$1 = 'lumx-combobox-section';
|
|
8357
8437
|
|
|
8358
8438
|
/**
|
|
8359
8439
|
* ListboxSection core template.
|
|
@@ -8380,7 +8460,7 @@ const ListboxSection$1 = (props, {
|
|
|
8380
8460
|
...forwardedProps,
|
|
8381
8461
|
hidden: hidden,
|
|
8382
8462
|
"aria-hidden": ariaHidden || undefined,
|
|
8383
|
-
className: !hidden ? classnames(className, CLASSNAME$1a) : undefined,
|
|
8463
|
+
className: !hidden ? classnames(className, CLASSNAME$1a, LEGACY_CLASSNAME$1) : undefined,
|
|
8384
8464
|
role: !ariaHidden ? 'none' : undefined,
|
|
8385
8465
|
itemsWrapperProps: {
|
|
8386
8466
|
role: 'group'
|
|
@@ -8528,12 +8608,18 @@ ListboxSection.className = CLASSNAME$1a;
|
|
|
8528
8608
|
/**
|
|
8529
8609
|
* Component display name.
|
|
8530
8610
|
*/
|
|
8531
|
-
const COMPONENT_NAME$1b = '
|
|
8611
|
+
const COMPONENT_NAME$1b = 'ListboxState';
|
|
8532
8612
|
|
|
8533
8613
|
/**
|
|
8534
8614
|
* Component default class name and class prefix.
|
|
8535
8615
|
*/
|
|
8536
|
-
const CLASSNAME$18 = 'lumx-
|
|
8616
|
+
const CLASSNAME$18 = 'lumx-listbox-state';
|
|
8617
|
+
/**
|
|
8618
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
8619
|
+
*
|
|
8620
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
8621
|
+
*/
|
|
8622
|
+
const LEGACY_CLASSNAME = 'lumx-combobox-state';
|
|
8537
8623
|
const {
|
|
8538
8624
|
block: block$V
|
|
8539
8625
|
} = bem(CLASSNAME$18);
|
|
@@ -8597,7 +8683,7 @@ const ListboxState$1 = (props, {
|
|
|
8597
8683
|
// the popover's closeMode="hide") and revealing it doesn't trigger announcements.
|
|
8598
8684
|
const renderContent = isOpen;
|
|
8599
8685
|
return /*#__PURE__*/jsxs(GenericBlock, {
|
|
8600
|
-
className: classnames(!show && visuallyHidden(), block$V(), padding('regular')),
|
|
8686
|
+
className: classnames(!show && visuallyHidden(), block$V(), LEGACY_CLASSNAME, padding('regular')),
|
|
8601
8687
|
orientation: "vertical",
|
|
8602
8688
|
...alignProps,
|
|
8603
8689
|
role: "status",
|
|
@@ -10579,7 +10665,7 @@ const TextField$1 = props => {
|
|
|
10579
10665
|
...labelProps,
|
|
10580
10666
|
id: labelId,
|
|
10581
10667
|
htmlFor: textFieldId,
|
|
10582
|
-
className: element$G('label'),
|
|
10668
|
+
className: classnames(labelProps?.className, element$G('label')),
|
|
10583
10669
|
isRequired,
|
|
10584
10670
|
theme,
|
|
10585
10671
|
children: [label, charCounter]
|
|
@@ -11350,6 +11436,8 @@ const Combobox = {
|
|
|
11350
11436
|
OptionMoreInfo: ListboxOptionMoreInfo,
|
|
11351
11437
|
/** Loading placeholder skeleton(s) that auto-register loading state with the combobox handle. */
|
|
11352
11438
|
OptionSkeleton: ListboxOptionSkeleton,
|
|
11439
|
+
/** Selection state icon (check circle / radio, or checkbox in multiple lists) for the `after` slot of an option. Reads the option `isSelected` and the list `aria-multiselectable`. */
|
|
11440
|
+
SelectionIcon: ListboxOptionSelectionIcon,
|
|
11353
11441
|
/** Floating popover container that auto-binds to the combobox anchor and open/close state. */
|
|
11354
11442
|
Popover: ComboboxPopover,
|
|
11355
11443
|
/** Labelled group of options that auto-hides when all its child options are filtered out. */
|
|
@@ -18761,31 +18849,6 @@ function getOptionDisplayName(value, getOptionName, getOptionId) {
|
|
|
18761
18849
|
return '';
|
|
18762
18850
|
}
|
|
18763
18851
|
|
|
18764
|
-
/**
|
|
18765
|
-
* Selection state icon of an option. The icon is always rendered after the label.
|
|
18766
|
-
*
|
|
18767
|
-
* - `single`: a check circle icon when selected, a blank radio icon otherwise.
|
|
18768
|
-
* - `multiple`: a checkbox icon, marked or blank.
|
|
18769
|
-
*/
|
|
18770
|
-
const SelectionIcon = ({
|
|
18771
|
-
selectionType,
|
|
18772
|
-
isSelected
|
|
18773
|
-
}) => {
|
|
18774
|
-
let icon;
|
|
18775
|
-
if (selectionType === 'multiple') {
|
|
18776
|
-
icon = isSelected ? mdiCheckboxMarked : mdiCheckboxBlankOutline;
|
|
18777
|
-
} else if (selectionType === 'single') {
|
|
18778
|
-
icon = isSelected ? mdiCheckCircle : mdiRadioboxBlank;
|
|
18779
|
-
} else {
|
|
18780
|
-
return null;
|
|
18781
|
-
}
|
|
18782
|
-
return /*#__PURE__*/jsx(Icon$1, {
|
|
18783
|
-
icon: icon,
|
|
18784
|
-
color: isSelected ? 'primary' : undefined,
|
|
18785
|
-
className: "lumx-combobox-option__selection-icon"
|
|
18786
|
-
});
|
|
18787
|
-
};
|
|
18788
|
-
|
|
18789
18852
|
/**
|
|
18790
18853
|
* Render options as ListboxOption elements.
|
|
18791
18854
|
* Framework-specific components are passed as a second argument.
|
|
@@ -18798,7 +18861,6 @@ function renderSelectOptions(props, components) {
|
|
|
18798
18861
|
getOptionDescription,
|
|
18799
18862
|
renderOption,
|
|
18800
18863
|
selected,
|
|
18801
|
-
selectionType,
|
|
18802
18864
|
getSectionId,
|
|
18803
18865
|
renderSectionTitle
|
|
18804
18866
|
} = props;
|
|
@@ -18820,8 +18882,7 @@ function renderSelectOptions(props, components) {
|
|
|
18820
18882
|
getOptionName,
|
|
18821
18883
|
getOptionDescription,
|
|
18822
18884
|
renderOption,
|
|
18823
|
-
selected
|
|
18824
|
-
selectionType
|
|
18885
|
+
selected
|
|
18825
18886
|
// getSectionId intentionally omitted to render flat options inside.
|
|
18826
18887
|
}, components)
|
|
18827
18888
|
}, sectionId);
|
|
@@ -18835,10 +18896,7 @@ function renderSelectOptions(props, components) {
|
|
|
18835
18896
|
const name = getWithSelector(getOptionName || getOptionId, item) || id;
|
|
18836
18897
|
const description = getOptionDescription && getWithSelector(getOptionDescription, item);
|
|
18837
18898
|
const isSelected = selectedIds?.has(id) ?? false;
|
|
18838
|
-
const after = /*#__PURE__*/jsx(SelectionIcon, {
|
|
18839
|
-
selectionType: selectionType,
|
|
18840
|
-
isSelected: isSelected
|
|
18841
|
-
});
|
|
18899
|
+
const after = /*#__PURE__*/jsx(Combobox.SelectionIcon, {});
|
|
18842
18900
|
|
|
18843
18901
|
// Delegate to the consumer's render function when provided.
|
|
18844
18902
|
// The consumer receives core-computed context and is responsible for rendering
|
|
@@ -18956,8 +19014,7 @@ const SelectButton$2 = (props, {
|
|
|
18956
19014
|
renderOption,
|
|
18957
19015
|
getSectionId,
|
|
18958
19016
|
renderSectionTitle,
|
|
18959
|
-
selected: value
|
|
18960
|
-
selectionType
|
|
19017
|
+
selected: value
|
|
18961
19018
|
}, {
|
|
18962
19019
|
Combobox
|
|
18963
19020
|
}), onLoadMore && InfiniteScroll && /*#__PURE__*/jsx(InfiniteScroll, {
|
|
@@ -19259,8 +19316,7 @@ const SelectTextField$2 = (props, {
|
|
|
19259
19316
|
renderOption,
|
|
19260
19317
|
getSectionId,
|
|
19261
19318
|
renderSectionTitle,
|
|
19262
|
-
selected
|
|
19263
|
-
selectionType: isMultiselectable ? 'multiple' : 'single'
|
|
19319
|
+
selected
|
|
19264
19320
|
}, {
|
|
19265
19321
|
Combobox
|
|
19266
19322
|
}), afterOptions, onLoadMore && InfiniteScroll && /*#__PURE__*/jsx(InfiniteScroll, {
|
|
@@ -19312,6 +19368,7 @@ const SelectTextField$1 = props => {
|
|
|
19312
19368
|
// Text field
|
|
19313
19369
|
className,
|
|
19314
19370
|
label,
|
|
19371
|
+
labelProps,
|
|
19315
19372
|
placeholder,
|
|
19316
19373
|
icon,
|
|
19317
19374
|
isDisabled,
|
|
@@ -19469,6 +19526,7 @@ const SelectTextField$1 = props => {
|
|
|
19469
19526
|
errorTryReloadMessage: translations.errorTryReloadMessage,
|
|
19470
19527
|
inputProps: {
|
|
19471
19528
|
...consumerInputProps,
|
|
19529
|
+
labelProps: labelProps ?? consumerInputProps?.labelProps,
|
|
19472
19530
|
placeholder,
|
|
19473
19531
|
icon,
|
|
19474
19532
|
value: displayValue,
|