@lumx/core 4.26.0-next.1 → 4.26.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/components-and-utils.css +39 -35
- package/js/components/Combobox/ComboboxOptionTests.d.ts +3 -3
- package/js/components/Combobox/ComboboxPopover.d.ts +1 -1
- package/js/components/Combobox/constants.d.ts +0 -4
- package/js/components/Combobox/index.d.ts +0 -16
- package/js/components/Combobox/setupCombobox.d.ts +2 -2
- package/js/components/Combobox/setupComboboxButton.d.ts +4 -3
- package/js/components/Combobox/setupComboboxInput.d.ts +1 -1
- package/js/components/Combobox/types.d.ts +14 -127
- package/js/components/{Combobox/ComboboxList.d.ts → Listbox/ListboxList.d.ts} +14 -8
- package/js/components/{Combobox/ComboboxOption.d.ts → Listbox/ListboxOption.d.ts} +17 -11
- package/js/components/{Combobox/ComboboxOptionAction.d.ts → Listbox/ListboxOptionAction.d.ts} +11 -5
- package/js/components/{Combobox/ComboboxOptionMoreInfo.d.ts → Listbox/ListboxOptionMoreInfo.d.ts} +14 -8
- package/js/components/{Combobox/ComboboxSelectionIcon.d.ts → Listbox/ListboxOptionSelectionIcon.d.ts} +2 -2
- package/js/components/{Combobox/ComboboxOptionSkeleton.d.ts → Listbox/ListboxOptionSkeleton.d.ts} +14 -8
- package/js/components/{Combobox/ComboboxSection.d.ts → Listbox/ListboxSection.d.ts} +17 -11
- package/js/components/{Combobox/ComboboxState.d.ts → Listbox/ListboxState.d.ts} +12 -6
- package/js/components/Listbox/Tests.d.ts +43 -0
- package/js/components/Listbox/constants.d.ts +4 -0
- package/js/components/Listbox/index.d.ts +18 -0
- package/js/components/Listbox/navigation.d.ts +40 -0
- package/js/components/Listbox/setupListbox.d.ts +17 -0
- package/js/components/Listbox/subscribeListboxState.d.ts +24 -0
- package/js/components/Listbox/types.d.ts +146 -0
- package/js/components/{Combobox → Listbox}/utils.d.ts +2 -2
- package/js/components/Popover/Stories.d.ts +2 -2
- package/js/components/TimePickerField/index.d.ts +4 -4
- package/js/utils/select/renderSelectOptions.d.ts +1 -1
- package/lumx.css +39 -35
- package/package.json +3 -4
- package/scss/_components_classes.scss +1 -0
- package/scss/components/combobox/_index.scss +5 -57
- package/scss/components/list/_mixins.scss +5 -4
- package/scss/components/list-box/_index.scss +69 -0
- package/js/components/Combobox/setupListbox.d.ts +0 -23
- package/js/components/Combobox/subscribeComboboxState.d.ts +0 -23
package/components-and-utils.css
CHANGED
|
@@ -5056,43 +5056,10 @@ table {
|
|
|
5056
5056
|
display: block;
|
|
5057
5057
|
scroll-snap-align: end;
|
|
5058
5058
|
}
|
|
5059
|
-
|
|
5060
|
-
.lumx-combobox-popover:empty, .lumx-combobox-popover:not(:has(.lumx-combobox-option)):not(:has(.lumx-combobox-state)):not(:has(.lumx-combobox-option-skeleton)),
|
|
5061
|
-
.lumx-combobox-list:empty,
|
|
5062
|
-
.lumx-combobox-list:not(:has(.lumx-combobox-option)):not(:has(.lumx-combobox-state)):not(:has(.lumx-combobox-option-skeleton)) {
|
|
5059
|
+
.lumx-combobox-popover:empty, .lumx-combobox-popover:not(:has(.lumx-listbox-option)):not(:has(.lumx-listbox-state)):not(:has(.lumx-listbox-option-skeleton)) {
|
|
5063
5060
|
display: none;
|
|
5064
5061
|
}
|
|
5065
5062
|
|
|
5066
|
-
.lumx-combobox-state {
|
|
5067
|
-
text-align: center;
|
|
5068
|
-
}
|
|
5069
|
-
|
|
5070
|
-
.lumx-combobox-option-skeleton .lumx-skeleton-typography {
|
|
5071
|
-
width: min(65%, 200px);
|
|
5072
|
-
}
|
|
5073
|
-
.lumx-combobox-option-skeleton:nth-child(3n+1) .lumx-skeleton-typography {
|
|
5074
|
-
width: min(70%, 230px);
|
|
5075
|
-
}
|
|
5076
|
-
.lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
|
|
5077
|
-
width: min(55%, 170px);
|
|
5078
|
-
}
|
|
5079
|
-
.lumx-combobox-option__selection-icon {
|
|
5080
|
-
margin: auto;
|
|
5081
|
-
}
|
|
5082
|
-
.lumx-combobox-option .lumx-list-item__wrapper,
|
|
5083
|
-
.lumx-combobox-option .lumx-list-item__content {
|
|
5084
|
-
min-width: 0;
|
|
5085
|
-
}
|
|
5086
|
-
.lumx-combobox-option .lumx-list-item__content {
|
|
5087
|
-
display: flex;
|
|
5088
|
-
flex-direction: column;
|
|
5089
|
-
justify-items: center;
|
|
5090
|
-
}
|
|
5091
|
-
.lumx-combobox-option-more-info__popover {
|
|
5092
|
-
max-width: 256px;
|
|
5093
|
-
padding: 16px;
|
|
5094
|
-
}
|
|
5095
|
-
|
|
5096
5063
|
/* ==========================================================================
|
|
5097
5064
|
Comment block
|
|
5098
5065
|
========================================================================== */
|
|
@@ -7462,6 +7429,43 @@ table {
|
|
|
7462
7429
|
opacity: 1;
|
|
7463
7430
|
}
|
|
7464
7431
|
}
|
|
7432
|
+
/* ==========================================================================
|
|
7433
|
+
Listbox
|
|
7434
|
+
========================================================================== */
|
|
7435
|
+
.lumx-listbox-list:empty, .lumx-listbox-list:not(:has(.lumx-listbox-option)):not(:has(.lumx-listbox-state)):not(:has(.lumx-listbox-option-skeleton)) {
|
|
7436
|
+
display: none;
|
|
7437
|
+
}
|
|
7438
|
+
|
|
7439
|
+
.lumx-listbox-state {
|
|
7440
|
+
text-align: center;
|
|
7441
|
+
}
|
|
7442
|
+
|
|
7443
|
+
.lumx-listbox-option-skeleton .lumx-skeleton-typography {
|
|
7444
|
+
width: min(65%, 200px);
|
|
7445
|
+
}
|
|
7446
|
+
.lumx-listbox-option-skeleton:nth-child(3n+1) .lumx-skeleton-typography {
|
|
7447
|
+
width: min(70%, 230px);
|
|
7448
|
+
}
|
|
7449
|
+
.lumx-listbox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
|
|
7450
|
+
width: min(55%, 170px);
|
|
7451
|
+
}
|
|
7452
|
+
.lumx-listbox-option__selection-icon {
|
|
7453
|
+
margin: auto;
|
|
7454
|
+
}
|
|
7455
|
+
.lumx-listbox-option .lumx-list-item__wrapper,
|
|
7456
|
+
.lumx-listbox-option .lumx-list-item__content {
|
|
7457
|
+
min-width: 0;
|
|
7458
|
+
}
|
|
7459
|
+
.lumx-listbox-option .lumx-list-item__content {
|
|
7460
|
+
display: flex;
|
|
7461
|
+
flex-direction: column;
|
|
7462
|
+
justify-items: center;
|
|
7463
|
+
}
|
|
7464
|
+
.lumx-listbox-option-more-info__popover {
|
|
7465
|
+
max-width: 256px;
|
|
7466
|
+
padding: 16px;
|
|
7467
|
+
}
|
|
7468
|
+
|
|
7465
7469
|
/* ==========================================================================
|
|
7466
7470
|
Index
|
|
7467
7471
|
========================================================================== */
|
|
@@ -8355,7 +8359,7 @@ table {
|
|
|
8355
8359
|
margin: 8px 0;
|
|
8356
8360
|
background-color: var(--lumx-color-dark-L5);
|
|
8357
8361
|
}
|
|
8358
|
-
.lumx-list-section:
|
|
8362
|
+
.lumx-list-section:has(+ :not(.lumx-list-divider, [hidden], :empty))::after {
|
|
8359
8363
|
content: "";
|
|
8360
8364
|
display: block;
|
|
8361
8365
|
height: 1px;
|
|
@@ -4,10 +4,10 @@ type RenderResult = {
|
|
|
4
4
|
container: HTMLElement;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* Options to set up the
|
|
7
|
+
* Options to set up the ListboxOption test suite.
|
|
8
8
|
* Injected by the framework-specific test file (React or Vue).
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface ListboxOptionTestSetup {
|
|
11
11
|
/** Combobox compound component namespace */
|
|
12
12
|
Combobox: Pick<ComboboxNamespace, 'Provider' | 'Input' | 'List' | 'Option' | 'SelectionIcon'>;
|
|
13
13
|
/**
|
|
@@ -20,5 +20,5 @@ export interface ComboboxOptionTestSetup {
|
|
|
20
20
|
* Shared Combobox.Option test suite — covers DOM shape and ARIA correctness.
|
|
21
21
|
* Runs the same assertions against both React and Vue wrappers.
|
|
22
22
|
*/
|
|
23
|
-
export default function
|
|
23
|
+
export default function listboxOptionTests({ Combobox, render }: ListboxOptionTestSetup): void;
|
|
24
24
|
export {};
|
|
@@ -14,7 +14,7 @@ type InheritedPopoverProps = Pick<PopoverProps, 'closeOnClickAway' | 'closeOnEsc
|
|
|
14
14
|
* Defines the props for the core ComboboxPopover template.
|
|
15
15
|
*/
|
|
16
16
|
export interface ComboboxPopoverProps extends HasClassName, InheritedPopoverProps {
|
|
17
|
-
/** Content (should contain a
|
|
17
|
+
/** Content (should contain a ListboxList). */
|
|
18
18
|
children?: JSXElement;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { VHSize } from '../../utils/browser/css/types';
|
|
2
|
-
import { OptionActiveEvent } from './types';
|
|
3
2
|
export declare const DEFAULT_COMBOBOX_POPOVER_MAX_HEIGHT: VHSize;
|
|
4
3
|
export declare const COMBOBOX_PROVIDER_COMPONENT_NAME = "ComboboxProvider";
|
|
5
|
-
export declare const OPTION_ACTIVE_EVENT_PREFIX: "optionActive:";
|
|
6
|
-
export declare const optionActiveEvent: (optionId: string) => OptionActiveEvent;
|
|
7
|
-
export declare const isOptionActiveEvent: (event: string) => event is OptionActiveEvent;
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
export { setupComboboxInput } from './setupComboboxInput';
|
|
2
2
|
export { setupComboboxButton } from './setupComboboxButton';
|
|
3
3
|
export type { ComboboxCallbacks, ComboboxHandle } from './types';
|
|
4
|
-
export { ComboboxList } from './ComboboxList';
|
|
5
|
-
export type { ComboboxListProps, ComboboxListType } from './ComboboxList';
|
|
6
4
|
export { ComboboxPopover } from './ComboboxPopover';
|
|
7
5
|
export type { ComboboxPopoverProps, ComboboxPopoverComponents } from './ComboboxPopover';
|
|
8
|
-
export { ComboboxOption } from './ComboboxOption';
|
|
9
|
-
export type { ComboboxOptionProps, ComboboxOptionPropsToOverride } from './ComboboxOption';
|
|
10
|
-
export { ComboboxOptionAction } from './ComboboxOptionAction';
|
|
11
|
-
export type { ComboboxOptionActionProps } from './ComboboxOptionAction';
|
|
12
|
-
export { ComboboxOptionSkeleton } from './ComboboxOptionSkeleton';
|
|
13
|
-
export type { ComboboxOptionSkeletonProps, ComboboxOptionSkeletonPropsToOverride } from './ComboboxOptionSkeleton';
|
|
14
|
-
export { ComboboxOptionMoreInfo } from './ComboboxOptionMoreInfo';
|
|
15
|
-
export type { ComboboxOptionMoreInfoProps, ComboboxOptionMoreInfoPropsToOverride, ComboboxOptionMoreInfoComponents, } from './ComboboxOptionMoreInfo';
|
|
16
6
|
export { ComboboxButton } from './ComboboxButton';
|
|
17
7
|
export type { ComboboxButtonProps, ComboboxButtonComponents, ComboboxButtonLabelDisplayMode } from './ComboboxButton';
|
|
18
8
|
export { ComboboxInput } from './ComboboxInput';
|
|
19
9
|
export type { ComboboxInputProps, ComboboxInputComponents } from './ComboboxInput';
|
|
20
|
-
export { ComboboxSection } from './ComboboxSection';
|
|
21
|
-
export type { ComboboxSectionProps, ComboboxSectionPropsToOverride, ComboboxSectionComponents, } from './ComboboxSection';
|
|
22
|
-
export { ComboboxState } from './ComboboxState';
|
|
23
|
-
export type { ComboboxStateProps } from './ComboboxState';
|
|
24
|
-
export { subscribeComboboxState } from './subscribeComboboxState';
|
|
25
|
-
export type { ComboboxStateSetters } from './subscribeComboboxState';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComboboxCallbacks, ComboboxHandle, OnTriggerAttach } from './types';
|
|
2
2
|
/** Options for configuring the shared combobox behavior. */
|
|
3
|
-
interface
|
|
3
|
+
interface ListboxOptions {
|
|
4
4
|
/** When true, ArrowDown/ArrowUp wrap around in listbox mode (input pattern). Default: false. */
|
|
5
5
|
wrapNavigation?: boolean;
|
|
6
6
|
}
|
|
@@ -20,5 +20,5 @@ interface ComboboxOptions {
|
|
|
20
20
|
* attach the appropriate controller.
|
|
21
21
|
* @returns A ComboboxHandle for interacting with the combobox.
|
|
22
22
|
*/
|
|
23
|
-
export declare function setupCombobox(callbacks: ComboboxCallbacks, options?:
|
|
23
|
+
export declare function setupCombobox(callbacks: ComboboxCallbacks, options?: ListboxOptions, onTriggerAttach?: OnTriggerAttach): ComboboxHandle;
|
|
24
24
|
export {};
|
|
@@ -4,10 +4,11 @@ import type { ComboboxCallbacks, ComboboxHandle } from './types';
|
|
|
4
4
|
*
|
|
5
5
|
* Creates a full combobox handle with the button-mode controller automatically
|
|
6
6
|
* wired in and the trigger registered. The consumer only needs to call
|
|
7
|
-
* `handle.
|
|
7
|
+
* `handle.list.mount(listbox)`.
|
|
8
8
|
*
|
|
9
|
-
* Handles: Space (
|
|
10
|
-
*
|
|
9
|
+
* Handles what is button-specific: click (toggle), Space (open), Tab and Alt+ArrowUp (select),
|
|
10
|
+
* and "open first" for Home/End, ArrowLeft/Right and typeahead. The navigation itself is
|
|
11
|
+
* delegated to `list.handleKeydown`.
|
|
11
12
|
*
|
|
12
13
|
* @param button The button element to use as the combobox trigger.
|
|
13
14
|
* @param callbacks Callbacks for select and open/close events.
|
|
@@ -21,7 +21,7 @@ export interface SetupComboboxInputOptions extends ComboboxCallbacks, ComboboxIn
|
|
|
21
21
|
*
|
|
22
22
|
* Creates a full combobox handle with the input-mode controller automatically
|
|
23
23
|
* wired in and the trigger registered. The consumer only needs to call
|
|
24
|
-
* `handle.
|
|
24
|
+
* `handle.list.mount(listbox)`.
|
|
25
25
|
*
|
|
26
26
|
* Handles: Home/End (text cursor), ArrowLeft/Right (clear active descendant),
|
|
27
27
|
* filtering (on input and on open), and focus behavior.
|
|
@@ -1,54 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export interface SectionState {
|
|
4
|
-
hidden: boolean;
|
|
5
|
-
'aria-hidden': boolean;
|
|
6
|
-
}
|
|
7
|
-
/** Registration entry for a section element. */
|
|
8
|
-
export interface SectionRegistration {
|
|
9
|
-
callback: (state: SectionState) => void;
|
|
10
|
-
last: SectionState;
|
|
11
|
-
}
|
|
12
|
-
/** Registration entry for an option element. */
|
|
13
|
-
export interface OptionRegistration {
|
|
14
|
-
callback: (isFiltered: boolean) => void;
|
|
15
|
-
lastFiltered: boolean;
|
|
16
|
-
}
|
|
17
|
-
/** Event name for the active state of one option. */
|
|
18
|
-
export type OptionActiveEvent = `optionActive:${string}`;
|
|
19
|
-
/** Map of combobox event names to their payload types. */
|
|
20
|
-
export interface ComboboxEventMap {
|
|
21
|
-
/** Fired when the combobox open state changes. Payload: whether the combobox is open. */
|
|
22
|
-
open: boolean;
|
|
23
|
-
/** Fired when the active descendant changes (visual focus). Payload: the option id or null. */
|
|
24
|
-
activeDescendantChange: string | null;
|
|
25
|
-
/**
|
|
26
|
-
* Fired when the visible option count changes.
|
|
27
|
-
* Payload: the number of visible options plus the current input value.
|
|
28
|
-
*/
|
|
29
|
-
optionsChange: {
|
|
30
|
-
optionsLength: number;
|
|
31
|
-
inputValue?: string;
|
|
32
|
-
} | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Fired immediately when the aggregate loading state changes (skeleton count transitions
|
|
35
|
-
* between 0 and >0). Used for empty suppression in ComboboxState and for aria-busy on the listbox.
|
|
36
|
-
*/
|
|
37
|
-
loadingChange: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Fired after a 500ms debounce when loading persists, or immediately when loading ends.
|
|
40
|
-
* Used to control the loading message text in the live region (ComboboxState).
|
|
41
|
-
*/
|
|
42
|
-
loadingAnnouncement: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Fired only when this option becomes the active descendant (true)
|
|
45
|
-
* or stops being the active descendant (false).
|
|
46
|
-
* Build the key with optionActiveEvent(optionId).
|
|
47
|
-
*/
|
|
48
|
-
[event: OptionActiveEvent]: boolean;
|
|
49
|
-
}
|
|
50
|
-
/** Callback provided in events subscriptions */
|
|
51
|
-
export type SubscriptionCallback<T extends keyof ComboboxEventMap = keyof ComboboxEventMap> = (value: ComboboxEventMap[T]) => void;
|
|
1
|
+
import type { ListboxHandle } from '../Listbox/types';
|
|
2
|
+
export type { SectionState, SectionRegistration, OptionRegistration, OptionActiveEvent } from '../Listbox/types';
|
|
52
3
|
/** Callbacks provided by the consumer (React/Vue) to react to combobox state changes. */
|
|
53
4
|
export interface ComboboxCallbacks {
|
|
54
5
|
/** Called when an option is selected (click or keyboard). */
|
|
@@ -93,91 +44,27 @@ export interface ComboboxInputOptions {
|
|
|
93
44
|
*/
|
|
94
45
|
selectionMode?: 'fill' | 'keep' | 'clear';
|
|
95
46
|
}
|
|
96
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Handle returned by `setupCombobox`. Used by framework wrappers and mode controllers.
|
|
49
|
+
*
|
|
50
|
+
* The combobox owns the trigger. Everything else (the open state, the option registry, the filter,
|
|
51
|
+
* the focus navigation, the selection, the loading state and all the events) is on the
|
|
52
|
+
* {@link ListboxHandle} exposed as `list`: the listbox element is mounted with `list.mount(element)`.
|
|
53
|
+
* The combobox open state is the listbox `open` event.
|
|
54
|
+
*/
|
|
97
55
|
export interface ComboboxHandle {
|
|
98
56
|
/** Register the trigger element. Returns a cleanup function. */
|
|
99
57
|
registerTrigger(trigger: HTMLInputElement | HTMLButtonElement): () => void;
|
|
100
|
-
/** Register the listbox/grid element. Returns a cleanup function. */
|
|
101
|
-
registerListbox(listbox: HTMLElement): () => void;
|
|
102
58
|
/** Tear down all listeners and state. */
|
|
103
59
|
destroy(): void;
|
|
104
|
-
/** Subscribe to a combobox event. Returns an unsubscribe function. */
|
|
105
|
-
subscribe<K extends keyof ComboboxEventMap>(event: K, callback: SubscriptionCallback<K>): () => void;
|
|
106
|
-
/**
|
|
107
|
-
* Read the last dispatched value of an event synchronously, for pull-based subscribers such as
|
|
108
|
-
* React's `useSyncExternalStore`. Returns `undefined` until the event has fired at least once.
|
|
109
|
-
*/
|
|
110
|
-
getSnapshot<K extends keyof ComboboxEventMap>(event: K): ComboboxEventMap[K] | undefined;
|
|
111
60
|
/** The current trigger element (may be null before registration). */
|
|
112
61
|
readonly trigger: HTMLInputElement | HTMLButtonElement | null;
|
|
113
|
-
/** The
|
|
114
|
-
readonly
|
|
115
|
-
/**
|
|
116
|
-
readonly focusNav: FocusNavigationController | null;
|
|
117
|
-
/** Whether the popup is open. */
|
|
62
|
+
/** The listbox handle (option registry, filter, focus navigation, selection, listbox events). */
|
|
63
|
+
readonly list: ListboxHandle;
|
|
64
|
+
/** Whether the popup is open (same as `list.isOpen`). */
|
|
118
65
|
readonly isOpen: boolean;
|
|
119
|
-
/**
|
|
120
|
-
readonly isMultiSelect: boolean;
|
|
121
|
-
/** Whether any skeleton placeholders are currently registered (loading). */
|
|
122
|
-
readonly isLoading: boolean;
|
|
123
|
-
/** Set the open state, update ARIA, fire callback. */
|
|
66
|
+
/** Set the open state and update ARIA. Subscribe to `list` `open` to observe it. */
|
|
124
67
|
setIsOpen(isOpen: boolean): void;
|
|
125
|
-
/** Select an option (or null to clear), fire callback. */
|
|
126
|
-
select(option: HTMLElement | null): void;
|
|
127
|
-
/**
|
|
128
|
-
* Replay the pending navigation intent stored on the focus navigation controller via
|
|
129
|
-
* its `goTo` resolver. Called by the framework wrapper after the option children
|
|
130
|
-
* commit (keyboard opens from the closed state defer navigation until then). No-op
|
|
131
|
-
* when nothing is pending.
|
|
132
|
-
*/
|
|
133
|
-
flushPendingNavigation(): void;
|
|
134
|
-
/**
|
|
135
|
-
* Register an option DOM element for filter notifications.
|
|
136
|
-
* The element's textContent is used as the searchable text.
|
|
137
|
-
* The callback is invoked immediately with the current filter state,
|
|
138
|
-
* and again whenever the filter changes.
|
|
139
|
-
* Returns a cleanup function that unregisters the option.
|
|
140
|
-
*/
|
|
141
|
-
registerOption(element: HTMLElement, onFilterChange: (isFiltered: boolean) => void): () => void;
|
|
142
|
-
/**
|
|
143
|
-
* Set the current filter value and notify all registered options of their match state.
|
|
144
|
-
* Options whose text does not start with the filter value are notified with isFiltered=true.
|
|
145
|
-
* An empty filter value clears filtering (all options become visible).
|
|
146
|
-
*/
|
|
147
|
-
setFilter(filterValue: string): void;
|
|
148
|
-
/**
|
|
149
|
-
* Re-evaluate the filter state of a single registered option.
|
|
150
|
-
* Call this after the option's `data-value` or textContent has been updated
|
|
151
|
-
* (e.g. after a framework re-render) to ensure its filtered/visible state
|
|
152
|
-
* is consistent with the current filter value.
|
|
153
|
-
*/
|
|
154
|
-
refilterOption(element: HTMLElement): void;
|
|
155
|
-
/**
|
|
156
|
-
* Register a section DOM element for state notifications.
|
|
157
|
-
* The callback is invoked immediately with the current state, and again whenever
|
|
158
|
-
* the state changes after a filter update or option un/registration.
|
|
159
|
-
*
|
|
160
|
-
* - `hidden`: true when all registered options are filtered out (keeps children mounted
|
|
161
|
-
* but invisible to the user and screen readers).
|
|
162
|
-
* - `aria-hidden`: true when the section has no registered options at all (skeleton-only).
|
|
163
|
-
* The section stays visually rendered but is hidden from assistive technology —
|
|
164
|
-
* the live region (`ComboboxState`) handles the loading announcement instead.
|
|
165
|
-
*
|
|
166
|
-
* At most one of `hidden` / `aria-hidden` is true at a time.
|
|
167
|
-
*
|
|
168
|
-
* Returns a cleanup function that unregisters the section.
|
|
169
|
-
*/
|
|
170
|
-
registerSection(element: HTMLElement, onChange: (state: {
|
|
171
|
-
hidden: boolean;
|
|
172
|
-
'aria-hidden': boolean;
|
|
173
|
-
}) => void): () => void;
|
|
174
|
-
/**
|
|
175
|
-
* Register a skeleton placeholder. Increments the internal skeleton counter.
|
|
176
|
-
* When the counter transitions from 0 to >0, fires `loadingChange` immediately
|
|
177
|
-
* and schedules `loadingAnnouncement` after 500ms. Returns a cleanup function
|
|
178
|
-
* that decrements the counter (and fires the reverse transitions when reaching 0).
|
|
179
|
-
*/
|
|
180
|
-
registerSkeleton(): () => void;
|
|
181
68
|
}
|
|
182
69
|
/**
|
|
183
70
|
* Callback invoked when the trigger is attached and the abort controller is ready.
|
|
@@ -4,11 +4,11 @@ import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../t
|
|
|
4
4
|
* - `'listbox'`: Standard listbox with `role="listbox"` and `role="option"` items.
|
|
5
5
|
* - `'grid'`: Grid mode with `role="grid"` and `role="gridcell"` items, enabling 2D keyboard navigation.
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
7
|
+
export type ListboxListType = 'listbox' | 'grid';
|
|
8
8
|
/**
|
|
9
|
-
* Defines the props for the core
|
|
9
|
+
* Defines the props for the core ListboxList template.
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
11
|
+
export interface ListboxListProps extends HasClassName {
|
|
12
12
|
/** Accessible label for the listbox (required for accessibility). */
|
|
13
13
|
'aria-label'?: string;
|
|
14
14
|
/**
|
|
@@ -22,7 +22,7 @@ export interface ComboboxListProps extends HasClassName {
|
|
|
22
22
|
* Also read by `Combobox.SelectionIcon` to pick the checkbox icons.
|
|
23
23
|
*/
|
|
24
24
|
'aria-multiselectable'?: boolean | 'true' | 'false';
|
|
25
|
-
/** Content (should be
|
|
25
|
+
/** Content (should be ListboxOption elements). */
|
|
26
26
|
children?: JSXElement;
|
|
27
27
|
/** The ID of the listbox element. */
|
|
28
28
|
id?: string;
|
|
@@ -32,21 +32,27 @@ export interface ComboboxListProps extends HasClassName {
|
|
|
32
32
|
* The popup type. Set to "grid" when options have action buttons.
|
|
33
33
|
* @default 'listbox'
|
|
34
34
|
*/
|
|
35
|
-
type?:
|
|
35
|
+
type?: ListboxListType;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Component display name.
|
|
39
39
|
*/
|
|
40
|
-
export declare const COMPONENT_NAME = "
|
|
40
|
+
export declare const COMPONENT_NAME = "ListboxList";
|
|
41
41
|
/**
|
|
42
42
|
* Component default class name and class prefix.
|
|
43
43
|
*/
|
|
44
44
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
49
|
+
*/
|
|
50
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-list";
|
|
51
|
+
/**
|
|
52
|
+
* ListboxList core template.
|
|
47
53
|
* Renders a List with combobox-specific ARIA attributes and styling.
|
|
48
54
|
*
|
|
49
55
|
* @param props Component props.
|
|
50
56
|
* @return JSX element.
|
|
51
57
|
*/
|
|
52
|
-
export declare const
|
|
58
|
+
export declare const ListboxList: (props: ListboxListProps) => import("react").JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
* Injected framework-specific components for
|
|
3
|
+
* Injected framework-specific components for ListboxOption rendering.
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface ListboxOptionComponents {
|
|
6
6
|
/** Tooltip wrapper component (optional). Used when `tooltipProps` is provided. */
|
|
7
7
|
Tooltip?: any;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Defines the props for the core
|
|
10
|
+
* Defines the props for the core ListboxOption template.
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
12
|
+
export interface ListboxOptionProps extends HasClassName {
|
|
13
13
|
/** A component to be rendered before the content (e.g. an icon or avatar). */
|
|
14
14
|
before?: JSXElement;
|
|
15
|
-
/** A component to be rendered after the content (e.g.
|
|
15
|
+
/** A component to be rendered after the content (e.g. ListboxOptionAction elements). */
|
|
16
16
|
after?: JSXElement;
|
|
17
17
|
/** Content (option label). */
|
|
18
18
|
children?: JSXElement;
|
|
@@ -35,7 +35,7 @@ export interface ComboboxOptionProps extends HasClassName {
|
|
|
35
35
|
* When true, renders a bare `<li hidden>` with only the children text — no ARIA roles,
|
|
36
36
|
* no classes, no visual structure. This keeps the element in the DOM so its textContent
|
|
37
37
|
* can be read for future filter evaluations, while naturally excluding it from
|
|
38
|
-
* `[role="option"]` queries (focus navigation) and `.lumx-
|
|
38
|
+
* `[role="option"]` queries (focus navigation) and `.lumx-listbox-option` CSS rules
|
|
39
39
|
* (section/popover auto-hide).
|
|
40
40
|
*/
|
|
41
41
|
hidden?: boolean;
|
|
@@ -50,19 +50,25 @@ export interface ComboboxOptionProps extends HasClassName {
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
53
|
-
* Used by `ReactToJSX<
|
|
53
|
+
* Used by `ReactToJSX<ListboxOptionProps, ListboxOptionPropsToOverride>`.
|
|
54
54
|
*/
|
|
55
|
-
export type
|
|
55
|
+
export type ListboxOptionPropsToOverride = 'before' | 'after' | 'children' | 'tooltipProps' | 'actionProps';
|
|
56
56
|
/**
|
|
57
57
|
* Component display name.
|
|
58
58
|
*/
|
|
59
|
-
export declare const COMPONENT_NAME = "
|
|
59
|
+
export declare const COMPONENT_NAME = "ListboxOption";
|
|
60
60
|
/**
|
|
61
61
|
* Component default class name and class prefix.
|
|
62
62
|
*/
|
|
63
63
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
66
|
+
*
|
|
67
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
68
|
+
*/
|
|
69
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-option";
|
|
70
|
+
/**
|
|
71
|
+
* ListboxOption core template.
|
|
66
72
|
* Renders a ListItem with combobox-specific ARIA attributes and structure.
|
|
67
73
|
*
|
|
68
74
|
* In grid mode, the ListItem renders with `role="row"` and the option content
|
|
@@ -71,4 +77,4 @@ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
|
71
77
|
* @param props Component props.
|
|
72
78
|
* @return JSX element.
|
|
73
79
|
*/
|
|
74
|
-
export declare const
|
|
80
|
+
export declare const ListboxOption: (props: ListboxOptionProps, { Tooltip }?: ListboxOptionComponents) => import("react").JSX.Element;
|
package/js/components/{Combobox/ComboboxOptionAction.d.ts → Listbox/ListboxOptionAction.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CommonRef, HasClassName, HasPolymorphicAs, HasRequiredLinkHref, JSXElement, LumxClassName } from '../../types';
|
|
2
2
|
import { ClickableElement } from '../RawClickable';
|
|
3
3
|
/**
|
|
4
|
-
* Defines the props for the core
|
|
4
|
+
* Defines the props for the core ListboxOptionAction template.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type ListboxOptionActionProps<E extends ClickableElement = 'button'> = HasPolymorphicAs<E> & HasClassName & HasRequiredLinkHref<E> & {
|
|
7
7
|
/** Content of the action (icon, label, etc.). */
|
|
8
8
|
children?: JSXElement;
|
|
9
9
|
/** Unique ID for the action element. */
|
|
@@ -18,13 +18,19 @@ export type ComboboxOptionActionProps<E extends ClickableElement = 'button'> = H
|
|
|
18
18
|
/**
|
|
19
19
|
* Component display name.
|
|
20
20
|
*/
|
|
21
|
-
export declare const COMPONENT_NAME = "
|
|
21
|
+
export declare const COMPONENT_NAME = "ListboxOptionAction";
|
|
22
22
|
/**
|
|
23
23
|
* Component default class name and class prefix.
|
|
24
24
|
*/
|
|
25
25
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
30
|
+
*/
|
|
31
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-option-action";
|
|
32
|
+
/**
|
|
33
|
+
* ListboxOptionAction core template.
|
|
28
34
|
* Renders a secondary action button within a combobox option row (grid mode).
|
|
29
35
|
* Each action renders as a `role="gridcell"` element, enabling 2D keyboard
|
|
30
36
|
* navigation (ArrowLeft/Right to move between the option and its actions).
|
|
@@ -32,4 +38,4 @@ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
|
32
38
|
* @param props Component props.
|
|
33
39
|
* @return JSX element.
|
|
34
40
|
*/
|
|
35
|
-
export declare const
|
|
41
|
+
export declare const ListboxOptionAction: <E extends ClickableElement = "button">(props: ListboxOptionActionProps<E>) => import("react").JSX.Element;
|
package/js/components/{Combobox/ComboboxOptionMoreInfo.d.ts → Listbox/ListboxOptionMoreInfo.d.ts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
* Defines the props for the core
|
|
3
|
+
* Defines the props for the core ListboxOptionMoreInfo template.
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface ListboxOptionMoreInfoProps extends HasClassName {
|
|
6
6
|
/** Popover content (additional details about the option). */
|
|
7
7
|
children?: JSXElement;
|
|
8
8
|
/** Whether the popover is open. */
|
|
@@ -21,11 +21,11 @@ export interface ComboboxOptionMoreInfoProps extends HasClassName {
|
|
|
21
21
|
/**
|
|
22
22
|
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
23
23
|
*/
|
|
24
|
-
export type
|
|
24
|
+
export type ListboxOptionMoreInfoPropsToOverride = 'children' | 'popoverId' | 'isOpen';
|
|
25
25
|
/**
|
|
26
|
-
* Injected framework-specific components for
|
|
26
|
+
* Injected framework-specific components for ListboxOptionMoreInfo rendering.
|
|
27
27
|
*/
|
|
28
|
-
export interface
|
|
28
|
+
export interface ListboxOptionMoreInfoComponents {
|
|
29
29
|
/** IconButton component (framework-specific). */
|
|
30
30
|
IconButton: any;
|
|
31
31
|
/** Popover component (framework-specific). */
|
|
@@ -34,13 +34,19 @@ export interface ComboboxOptionMoreInfoComponents {
|
|
|
34
34
|
/**
|
|
35
35
|
* Component display name.
|
|
36
36
|
*/
|
|
37
|
-
export declare const COMPONENT_NAME = "
|
|
37
|
+
export declare const COMPONENT_NAME = "ListboxOptionMoreInfo";
|
|
38
38
|
/**
|
|
39
39
|
* Component default class name and class prefix.
|
|
40
40
|
*/
|
|
41
41
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
46
|
+
*/
|
|
47
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-option-more-info";
|
|
48
|
+
/**
|
|
49
|
+
* ListboxOptionMoreInfo core template.
|
|
44
50
|
* Renders an info icon button with a popover that shows additional details about a combobox option.
|
|
45
51
|
* The popover opens on mouse hover or when the parent option is keyboard-highlighted.
|
|
46
52
|
*
|
|
@@ -51,4 +57,4 @@ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
|
51
57
|
* @param components Injected framework-specific components.
|
|
52
58
|
* @return JSX element.
|
|
53
59
|
*/
|
|
54
|
-
export declare const
|
|
60
|
+
export declare const ListboxOptionMoreInfo: (props: ListboxOptionMoreInfoProps, { IconButton, Popover }: ListboxOptionMoreInfoComponents) => import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ListboxOptionSelectionIconProps {
|
|
2
2
|
/** Selection type of the select (`undefined` renders nothing). */
|
|
3
3
|
selectionType: 'single' | 'multiple' | undefined;
|
|
4
4
|
/** Whether the option is selected. */
|
|
@@ -10,4 +10,4 @@ export interface ComboboxSelectionIconProps {
|
|
|
10
10
|
* - `single`: a check circle icon when selected, a blank radio icon otherwise.
|
|
11
11
|
* - `multiple`: a checkbox icon, marked or blank.
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const ListboxOptionSelectionIcon: ({ selectionType, isSelected }: ListboxOptionSelectionIconProps) => import("react").JSX.Element | null;
|
package/js/components/{Combobox/ComboboxOptionSkeleton.d.ts → Listbox/ListboxOptionSkeleton.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
* Defines the props for the core
|
|
3
|
+
* Defines the props for the core ListboxOptionSkeleton template.
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface ListboxOptionSkeletonProps extends HasClassName {
|
|
6
6
|
/** Content rendered before the skeleton text (e.g. SkeletonCircle for avatar placeholders). */
|
|
7
7
|
before?: JSXElement;
|
|
8
8
|
/** Content rendered after the skeleton text. */
|
|
9
9
|
after?: JSXElement;
|
|
10
|
-
/** Show a secondary skeleton line (mirrors
|
|
10
|
+
/** Show a secondary skeleton line (mirrors ListboxOption's `description` prop). */
|
|
11
11
|
hasDescription?: boolean;
|
|
12
12
|
/** Override the default SkeletonTypography content entirely. */
|
|
13
13
|
children?: JSXElement;
|
|
@@ -22,19 +22,25 @@ export interface ComboboxOptionSkeletonProps extends HasClassName {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
25
|
-
* Used by `ReactToJSX<
|
|
25
|
+
* Used by `ReactToJSX<ListboxOptionSkeletonProps, ListboxOptionSkeletonPropsToOverride>`.
|
|
26
26
|
*/
|
|
27
|
-
export type
|
|
27
|
+
export type ListboxOptionSkeletonPropsToOverride = 'before' | 'after' | 'children';
|
|
28
28
|
/**
|
|
29
29
|
* Component display name.
|
|
30
30
|
*/
|
|
31
|
-
export declare const COMPONENT_NAME = "
|
|
31
|
+
export declare const COMPONENT_NAME = "ListboxOptionSkeleton";
|
|
32
32
|
/**
|
|
33
33
|
* Component default class name and class prefix.
|
|
34
34
|
*/
|
|
35
35
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
40
|
+
*/
|
|
41
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-option-skeleton";
|
|
42
|
+
/**
|
|
43
|
+
* ListboxOptionSkeleton core template.
|
|
38
44
|
* Renders a skeleton placeholder `<li>` inside a combobox list, styled to match
|
|
39
45
|
* option dimensions. Uses `role="none"` so screen readers ignore it.
|
|
40
46
|
*
|
|
@@ -44,4 +50,4 @@ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
|
44
50
|
* @param props Component props.
|
|
45
51
|
* @return JSX element.
|
|
46
52
|
*/
|
|
47
|
-
export declare const
|
|
53
|
+
export declare const ListboxOptionSkeleton: (props: ListboxOptionSkeletonProps) => import("react").JSX.Element;
|