@lumx/core 4.9.0-next.3 → 4.9.0-next.5
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 +36 -4
- package/js/components/Combobox/ComboboxButton.d.ts +54 -0
- package/js/components/Combobox/ComboboxInput.d.ts +49 -0
- package/js/components/Combobox/ComboboxList.d.ts +47 -0
- package/js/components/Combobox/ComboboxOption.d.ts +72 -0
- package/js/components/Combobox/ComboboxOptionAction.d.ts +35 -0
- package/js/components/Combobox/ComboboxOptionMoreInfo.d.ts +52 -0
- package/js/components/Combobox/ComboboxOptionSkeleton.d.ts +41 -0
- package/js/components/Combobox/ComboboxPopover.d.ts +50 -0
- package/js/components/Combobox/ComboboxSection.d.ts +58 -0
- package/js/components/Combobox/ComboboxState.d.ts +84 -0
- package/js/components/Combobox/index.d.ts +23 -0
- package/js/components/Combobox/setupCombobox.d.ts +24 -0
- package/js/components/Combobox/setupComboboxButton.d.ts +16 -0
- package/js/components/Combobox/setupComboboxInput.d.ts +29 -0
- package/js/components/Combobox/setupListbox.d.ts +21 -0
- package/js/components/Combobox/types.d.ts +124 -0
- package/js/components/Combobox/utils.d.ts +27 -0
- package/js/components/List/ListItem.d.ts +58 -0
- package/js/components/List/ListItemAction.d.ts +24 -0
- package/js/components/List/index.d.ts +39 -0
- package/js/components/Text/index.d.ts +1 -1
- package/js/utils/browser/createSelectorTreeWalker.d.ts +13 -0
- package/js/utils/focusNavigation/createGridFocusNavigation.d.ts +13 -0
- package/js/utils/focusNavigation/index.d.ts +2 -1
- package/js/utils/focusNavigation/types.d.ts +28 -7
- package/js/utils/typeahead/index.d.ts +29 -0
- package/lumx.css +36 -4
- package/package.json +2 -2
- package/scss/_components_classes.scss +2 -1
- package/scss/components/combobox/_index.scss +44 -0
- package/scss/components/list/_mixins.scss +44 -32
- package/stories/types.d.ts +2 -0
package/components-and-utils.css
CHANGED
|
@@ -5005,6 +5005,38 @@ table {
|
|
|
5005
5005
|
text-overflow: ellipsis;
|
|
5006
5006
|
}
|
|
5007
5007
|
|
|
5008
|
+
/* ==========================================================================
|
|
5009
|
+
Combobox
|
|
5010
|
+
========================================================================== */
|
|
5011
|
+
.lumx-combobox-popover {
|
|
5012
|
+
overflow-y: auto;
|
|
5013
|
+
}
|
|
5014
|
+
|
|
5015
|
+
.lumx-combobox-popover:empty, .lumx-combobox-popover:not(:has(.lumx-combobox-option)):not(:has(.lumx-combobox-state)):not(:has(.lumx-combobox-option-skeleton)),
|
|
5016
|
+
.lumx-combobox-list:empty,
|
|
5017
|
+
.lumx-combobox-list:not(:has(.lumx-combobox-option)):not(:has(.lumx-combobox-state)):not(:has(.lumx-combobox-option-skeleton)) {
|
|
5018
|
+
display: none;
|
|
5019
|
+
}
|
|
5020
|
+
|
|
5021
|
+
.lumx-combobox-state {
|
|
5022
|
+
text-align: center;
|
|
5023
|
+
}
|
|
5024
|
+
|
|
5025
|
+
.lumx-combobox-option-skeleton .lumx-skeleton-typography {
|
|
5026
|
+
width: min(65%, 200px);
|
|
5027
|
+
}
|
|
5028
|
+
.lumx-combobox-option-skeleton:nth-child(3n+1) .lumx-skeleton-typography {
|
|
5029
|
+
width: min(70%, 230px);
|
|
5030
|
+
}
|
|
5031
|
+
.lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
|
|
5032
|
+
width: min(55%, 170px);
|
|
5033
|
+
}
|
|
5034
|
+
|
|
5035
|
+
.lumx-combobox-option-more-info__popover {
|
|
5036
|
+
max-width: 256px;
|
|
5037
|
+
padding: 16px;
|
|
5038
|
+
}
|
|
5039
|
+
|
|
5008
5040
|
/* ==========================================================================
|
|
5009
5041
|
Comment block
|
|
5010
5042
|
========================================================================== */
|
|
@@ -8104,7 +8136,7 @@ table {
|
|
|
8104
8136
|
color: var(--lumx-color-dark-N);
|
|
8105
8137
|
background-color: transparent;
|
|
8106
8138
|
}
|
|
8107
|
-
.lumx-list-item__link[data-focus-visible-added] {
|
|
8139
|
+
.lumx-list-item__link[data-focus-visible-added], .lumx-list-item__link:has([data-focus-visible-added]) {
|
|
8108
8140
|
outline: 2px solid var(--lumx-color-dark-N);
|
|
8109
8141
|
outline-offset: -2px;
|
|
8110
8142
|
}
|
|
@@ -8201,14 +8233,14 @@ table {
|
|
|
8201
8233
|
|
|
8202
8234
|
/* Section
|
|
8203
8235
|
========================================================================== */
|
|
8204
|
-
.lumx-list-section:not(:first-child):not(.lumx-list-section + .lumx-list-section):not(.lumx-list-divider + .lumx-list-section)::before {
|
|
8236
|
+
.lumx-list-section:not(:first-child):not(.lumx-list-section:not([hidden]) + .lumx-list-section):not(.lumx-list-divider + .lumx-list-section)::before {
|
|
8205
8237
|
content: "";
|
|
8206
8238
|
display: block;
|
|
8207
8239
|
height: 1px;
|
|
8208
8240
|
margin: 8px 0;
|
|
8209
8241
|
background-color: var(--lumx-color-dark-L5);
|
|
8210
8242
|
}
|
|
8211
|
-
.lumx-list-section:not(:last-child):not(:has(+ .lumx-list-divider))::after {
|
|
8243
|
+
.lumx-list-section:not(:last-child):not(:has(+ .lumx-list-divider)):not(:has(+ [hidden]))::after {
|
|
8212
8244
|
content: "";
|
|
8213
8245
|
display: block;
|
|
8214
8246
|
height: 1px;
|
|
@@ -9855,7 +9887,7 @@ table {
|
|
|
9855
9887
|
color: var(--lumx-color-dark-N);
|
|
9856
9888
|
background-color: transparent;
|
|
9857
9889
|
}
|
|
9858
|
-
.lumx-side-navigation-item__link[data-focus-visible-added] {
|
|
9890
|
+
.lumx-side-navigation-item__link[data-focus-visible-added], .lumx-side-navigation-item__link:has([data-focus-visible-added]) {
|
|
9859
9891
|
outline: 2px solid var(--lumx-color-dark-N);
|
|
9860
9892
|
outline-offset: -2px;
|
|
9861
9893
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Label display mode for the ComboboxButton.
|
|
4
|
+
* - `'show-selection'`: Show the selected value if available, otherwise the label.
|
|
5
|
+
* - `'show-label'`: Always show the label.
|
|
6
|
+
* - `'show-tooltip'`: Show nothing in the button; label appears only in tooltip.
|
|
7
|
+
*/
|
|
8
|
+
export type ComboboxButtonLabelDisplayMode = 'show-selection' | 'show-label' | 'show-tooltip';
|
|
9
|
+
/**
|
|
10
|
+
* Defines the props for the core ComboboxButton template.
|
|
11
|
+
*/
|
|
12
|
+
export interface ComboboxButtonProps extends HasClassName {
|
|
13
|
+
/** The label for the button (used for ARIA and tooltip). */
|
|
14
|
+
label: string;
|
|
15
|
+
/** The currently selected value to display. */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Controls how the label/value is displayed. */
|
|
18
|
+
labelDisplayMode?: ComboboxButtonLabelDisplayMode;
|
|
19
|
+
/** The ID of the listbox element (for aria-controls). */
|
|
20
|
+
listboxId?: string;
|
|
21
|
+
/** Whether the combobox is open. */
|
|
22
|
+
isOpen?: boolean;
|
|
23
|
+
/** ref to the root button element. */
|
|
24
|
+
ref?: CommonRef;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Injected framework-specific components for ComboboxButton rendering.
|
|
28
|
+
*/
|
|
29
|
+
export interface ComboboxButtonComponents {
|
|
30
|
+
/** Button component (framework-specific, e.g. React Button with theme/disabled handling). */
|
|
31
|
+
Button: any;
|
|
32
|
+
/** Tooltip wrapper component. */
|
|
33
|
+
Tooltip: any;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Component display name.
|
|
37
|
+
*/
|
|
38
|
+
export declare const COMPONENT_NAME = "ComboboxButton";
|
|
39
|
+
/**
|
|
40
|
+
* Component default class name and class prefix.
|
|
41
|
+
*/
|
|
42
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
43
|
+
/**
|
|
44
|
+
* ComboboxButton core template.
|
|
45
|
+
* Renders a Button with combobox ARIA attributes, wrapped in a Tooltip.
|
|
46
|
+
*
|
|
47
|
+
* Framework-specific components (Tooltip) are passed as a second argument
|
|
48
|
+
* by the React/Vue wrappers.
|
|
49
|
+
*
|
|
50
|
+
* @param props Component props.
|
|
51
|
+
* @param components Injected framework-specific components.
|
|
52
|
+
* @return JSX element.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ComboboxButton: (props: ComboboxButtonProps, { Button, Tooltip }: ComboboxButtonComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props for the core ComboboxInput template.
|
|
4
|
+
*/
|
|
5
|
+
export interface ComboboxInputProps extends HasClassName {
|
|
6
|
+
/** The ID of the listbox element (for aria-controls). */
|
|
7
|
+
listboxId?: string;
|
|
8
|
+
/** Whether the combobox is open. */
|
|
9
|
+
isOpen?: boolean;
|
|
10
|
+
/** ref to the root element. */
|
|
11
|
+
ref?: CommonRef;
|
|
12
|
+
/** Reference to the input element. */
|
|
13
|
+
inputRef?: CommonRef;
|
|
14
|
+
/** Reference to the text field wrapper element. */
|
|
15
|
+
textFieldRef?: CommonRef;
|
|
16
|
+
/** Props for the toggle button (when provided, a chevron button is rendered). */
|
|
17
|
+
toggleButtonProps?: Record<string, any>;
|
|
18
|
+
/** Toggle callback for the chevron button. */
|
|
19
|
+
handleToggle?(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Injected framework-specific components for ComboboxInput rendering.
|
|
23
|
+
*/
|
|
24
|
+
export interface ComboboxInputComponents {
|
|
25
|
+
/** TextField component (framework-specific, e.g. React TextField with controlled input). */
|
|
26
|
+
TextField: any;
|
|
27
|
+
/** IconButton component (framework-specific, e.g. React IconButton with theme/disabled). */
|
|
28
|
+
IconButton: any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Component display name.
|
|
32
|
+
*/
|
|
33
|
+
export declare const COMPONENT_NAME = "ComboboxInput";
|
|
34
|
+
/**
|
|
35
|
+
* Component default class name and class prefix.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
38
|
+
/**
|
|
39
|
+
* ComboboxInput core template.
|
|
40
|
+
* Renders a TextField with combobox ARIA attributes and an optional toggle button.
|
|
41
|
+
*
|
|
42
|
+
* Framework-specific components (TextField, IconButton) are passed as a second argument
|
|
43
|
+
* by the React/Vue wrappers.
|
|
44
|
+
*
|
|
45
|
+
* @param props Component props.
|
|
46
|
+
* @param components Injected framework-specific components.
|
|
47
|
+
* @return JSX element.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ComboboxInput: (props: ComboboxInputProps, { TextField, IconButton }: ComboboxInputComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Popup type for the combobox listbox.
|
|
4
|
+
* - `'listbox'`: Standard listbox with `role="listbox"` and `role="option"` items.
|
|
5
|
+
* - `'grid'`: Grid mode with `role="grid"` and `role="gridcell"` items, enabling 2D keyboard navigation.
|
|
6
|
+
*/
|
|
7
|
+
export type ComboboxListType = 'listbox' | 'grid';
|
|
8
|
+
/**
|
|
9
|
+
* Defines the props for the core ComboboxList template.
|
|
10
|
+
*/
|
|
11
|
+
export interface ComboboxListProps extends HasClassName {
|
|
12
|
+
/** Accessible label for the listbox (required for accessibility). */
|
|
13
|
+
'aria-label': string;
|
|
14
|
+
/**
|
|
15
|
+
* Indicates that the listbox content is incomplete (loading).
|
|
16
|
+
* Set to `true` when skeleton placeholders are present and no real options have loaded yet.
|
|
17
|
+
* Omit (or set to `undefined`) when not loading — the attribute is not rendered as `"false"`.
|
|
18
|
+
*/
|
|
19
|
+
'aria-busy'?: boolean;
|
|
20
|
+
/** Content (should be ComboboxOption elements). */
|
|
21
|
+
children?: JSXElement;
|
|
22
|
+
/** The ID of the listbox element. */
|
|
23
|
+
id?: string;
|
|
24
|
+
/** ref to the root element */
|
|
25
|
+
ref?: CommonRef;
|
|
26
|
+
/**
|
|
27
|
+
* The popup type. Set to "grid" when options have action buttons.
|
|
28
|
+
* @default 'listbox'
|
|
29
|
+
*/
|
|
30
|
+
type?: ComboboxListType;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Component display name.
|
|
34
|
+
*/
|
|
35
|
+
export declare const COMPONENT_NAME = "ComboboxList";
|
|
36
|
+
/**
|
|
37
|
+
* Component default class name and class prefix.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
40
|
+
/**
|
|
41
|
+
* ComboboxList core template.
|
|
42
|
+
* Renders a List with combobox-specific ARIA attributes and styling.
|
|
43
|
+
*
|
|
44
|
+
* @param props Component props.
|
|
45
|
+
* @return JSX element.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ComboboxList: (props: ComboboxListProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Injected framework-specific components for ComboboxOption rendering.
|
|
4
|
+
*/
|
|
5
|
+
export interface ComboboxOptionComponents {
|
|
6
|
+
/** Tooltip wrapper component (optional). Used when `tooltipProps` is provided. */
|
|
7
|
+
Tooltip?: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Defines the props for the core ComboboxOption template.
|
|
11
|
+
*/
|
|
12
|
+
export interface ComboboxOptionProps extends HasClassName {
|
|
13
|
+
/** A component to be rendered before the content (e.g. an icon or avatar). */
|
|
14
|
+
before?: JSXElement;
|
|
15
|
+
/** A component to be rendered after the content (e.g. ComboboxOptionAction elements). */
|
|
16
|
+
after?: JSXElement;
|
|
17
|
+
/** Content (option label). */
|
|
18
|
+
children?: JSXElement;
|
|
19
|
+
/** Props forwarded to a Tooltip wrapping the role="option" / role="gridcell" element. */
|
|
20
|
+
tooltipProps?: Record<string, any>;
|
|
21
|
+
/** Helper description. */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Unique ID for the option element. */
|
|
24
|
+
id?: string;
|
|
25
|
+
/** Unique ID for the description element (for aria-describedby). */
|
|
26
|
+
descriptionId?: string;
|
|
27
|
+
/** Whether the option is disabled. */
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
/** Whether the option is selected. */
|
|
30
|
+
isSelected?: boolean;
|
|
31
|
+
/** Whether the parent list is in grid mode. */
|
|
32
|
+
isGrid?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the option is hidden (filtered out by auto-filter).
|
|
35
|
+
* When true, renders a bare `<li hidden>` with only the children text — no ARIA roles,
|
|
36
|
+
* no classes, no visual structure. This keeps the element in the DOM so its textContent
|
|
37
|
+
* can be read for future filter evaluations, while naturally excluding it from
|
|
38
|
+
* `[role="option"]` queries (focus navigation) and `.lumx-combobox-option` CSS rules
|
|
39
|
+
* (section/popover auto-hide).
|
|
40
|
+
*/
|
|
41
|
+
hidden?: boolean;
|
|
42
|
+
/** On click callback. */
|
|
43
|
+
handleClick?(): void;
|
|
44
|
+
/** ref to the root <li> element. */
|
|
45
|
+
ref?: CommonRef;
|
|
46
|
+
/** The value for this option (used for selection). */
|
|
47
|
+
value?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
51
|
+
* Used by `ReactToJSX<ComboboxOptionProps, ComboboxOptionPropsToOverride>`.
|
|
52
|
+
*/
|
|
53
|
+
export type ComboboxOptionPropsToOverride = 'before' | 'after' | 'children' | 'tooltipProps';
|
|
54
|
+
/**
|
|
55
|
+
* Component display name.
|
|
56
|
+
*/
|
|
57
|
+
export declare const COMPONENT_NAME = "ComboboxOption";
|
|
58
|
+
/**
|
|
59
|
+
* Component default class name and class prefix.
|
|
60
|
+
*/
|
|
61
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
62
|
+
/**
|
|
63
|
+
* ComboboxOption core template.
|
|
64
|
+
* Renders a ListItem with combobox-specific ARIA attributes and structure.
|
|
65
|
+
*
|
|
66
|
+
* In grid mode, the ListItem renders with `role="row"` and the option content
|
|
67
|
+
* uses `role="gridcell"` instead of `role="option"`.
|
|
68
|
+
*
|
|
69
|
+
* @param props Component props.
|
|
70
|
+
* @return JSX element.
|
|
71
|
+
*/
|
|
72
|
+
export declare const ComboboxOption: (props: ComboboxOptionProps, { Tooltip }?: ComboboxOptionComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, HasPolymorphicAs, HasRequiredLinkHref, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
import { ClickableElement } from '../RawClickable';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the props for the core ComboboxOptionAction template.
|
|
5
|
+
*/
|
|
6
|
+
export type ComboboxOptionActionProps<E extends ClickableElement = 'button'> = HasPolymorphicAs<E> & HasClassName & HasRequiredLinkHref<E> & {
|
|
7
|
+
/** Content of the action (icon, label, etc.). */
|
|
8
|
+
children?: JSXElement;
|
|
9
|
+
/** Unique ID for the action element. */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** Whether the action is disabled. */
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
/** On click callback. */
|
|
14
|
+
handleClick?(evt: any): void;
|
|
15
|
+
/** ref to the root element. */
|
|
16
|
+
ref?: CommonRef;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Component display name.
|
|
20
|
+
*/
|
|
21
|
+
export declare const COMPONENT_NAME = "ComboboxOptionAction";
|
|
22
|
+
/**
|
|
23
|
+
* Component default class name and class prefix.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
26
|
+
/**
|
|
27
|
+
* ComboboxOptionAction core template.
|
|
28
|
+
* Renders a secondary action button within a combobox option row (grid mode).
|
|
29
|
+
* Each action renders as a `role="gridcell"` element, enabling 2D keyboard
|
|
30
|
+
* navigation (ArrowLeft/Right to move between the option and its actions).
|
|
31
|
+
*
|
|
32
|
+
* @param props Component props.
|
|
33
|
+
* @return JSX element.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ComboboxOptionAction: <E extends ClickableElement = "button">(props: ComboboxOptionActionProps<E>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props for the core ComboboxOptionMoreInfo template.
|
|
4
|
+
*/
|
|
5
|
+
export interface ComboboxOptionMoreInfoProps extends HasClassName {
|
|
6
|
+
/** Popover content (additional details about the option). */
|
|
7
|
+
children?: JSXElement;
|
|
8
|
+
/** Whether the popover is open. */
|
|
9
|
+
isOpen?: boolean;
|
|
10
|
+
/** ID for the popover element (used for aria-describedby on the parent option). */
|
|
11
|
+
popoverId: string;
|
|
12
|
+
/** Ref for the anchor element (icon button). */
|
|
13
|
+
ref?: CommonRef;
|
|
14
|
+
/** Mouse enter callback. */
|
|
15
|
+
onMouseEnter?(): void;
|
|
16
|
+
/** Mouse leave callback. */
|
|
17
|
+
onMouseLeave?(): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
21
|
+
*/
|
|
22
|
+
export type ComboboxOptionMoreInfoPropsToOverride = 'children' | 'popoverId' | 'isOpen';
|
|
23
|
+
/**
|
|
24
|
+
* Injected framework-specific components for ComboboxOptionMoreInfo rendering.
|
|
25
|
+
*/
|
|
26
|
+
export interface ComboboxOptionMoreInfoComponents {
|
|
27
|
+
/** IconButton component (framework-specific). */
|
|
28
|
+
IconButton: any;
|
|
29
|
+
/** Popover component (framework-specific). */
|
|
30
|
+
Popover: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Component display name.
|
|
34
|
+
*/
|
|
35
|
+
export declare const COMPONENT_NAME = "ComboboxOptionMoreInfo";
|
|
36
|
+
/**
|
|
37
|
+
* Component default class name and class prefix.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
40
|
+
/**
|
|
41
|
+
* ComboboxOptionMoreInfo core template.
|
|
42
|
+
* Renders an info icon button with a popover that shows additional details about a combobox option.
|
|
43
|
+
* The popover opens on mouse hover or when the parent option is keyboard-highlighted.
|
|
44
|
+
*
|
|
45
|
+
* Framework-specific components (IconButton, Popover) are passed as a second argument
|
|
46
|
+
* by the React/Vue wrappers.
|
|
47
|
+
*
|
|
48
|
+
* @param props Component props.
|
|
49
|
+
* @param components Injected framework-specific components.
|
|
50
|
+
* @return JSX element.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ComboboxOptionMoreInfo: (props: ComboboxOptionMoreInfoProps, { IconButton, Popover }: ComboboxOptionMoreInfoComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props for the core ComboboxOptionSkeleton template.
|
|
4
|
+
*/
|
|
5
|
+
export interface ComboboxOptionSkeletonProps extends HasClassName {
|
|
6
|
+
/** Content rendered before the skeleton text (e.g. SkeletonCircle for avatar placeholders). */
|
|
7
|
+
before?: JSXElement;
|
|
8
|
+
/** Content rendered after the skeleton text. */
|
|
9
|
+
after?: JSXElement;
|
|
10
|
+
/** Show a secondary skeleton line (mirrors ComboboxOption's `description` prop). */
|
|
11
|
+
hasDescription?: boolean;
|
|
12
|
+
/** Override the default SkeletonTypography content entirely. */
|
|
13
|
+
children?: JSXElement;
|
|
14
|
+
/** ref to the root <li> element. */
|
|
15
|
+
ref?: CommonRef;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
19
|
+
* Used by `ReactToJSX<ComboboxOptionSkeletonProps, ComboboxOptionSkeletonPropsToOverride>`.
|
|
20
|
+
*/
|
|
21
|
+
export type ComboboxOptionSkeletonPropsToOverride = 'before' | 'after' | 'children';
|
|
22
|
+
/**
|
|
23
|
+
* Component display name.
|
|
24
|
+
*/
|
|
25
|
+
export declare const COMPONENT_NAME = "ComboboxOptionSkeleton";
|
|
26
|
+
/**
|
|
27
|
+
* Component default class name and class prefix.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
30
|
+
/**
|
|
31
|
+
* ComboboxOptionSkeleton core template.
|
|
32
|
+
* Renders a skeleton placeholder `<li>` inside a combobox list, styled to match
|
|
33
|
+
* option dimensions. Uses `role="none"` so screen readers ignore it.
|
|
34
|
+
*
|
|
35
|
+
* Width variation across sibling skeletons is handled by SCSS `:nth-child` rules,
|
|
36
|
+
* not by props — the component itself does not need a `width` prop.
|
|
37
|
+
*
|
|
38
|
+
* @param props Component props.
|
|
39
|
+
* @return JSX element.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ComboboxOptionSkeleton: (props: ComboboxOptionSkeletonProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
import type { FitAnchorWidth, Placement } from '../Popover/constants';
|
|
3
|
+
/**
|
|
4
|
+
* Component display name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const COMPONENT_NAME = "ComboboxPopover";
|
|
7
|
+
/**
|
|
8
|
+
* Component default class name.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
11
|
+
/**
|
|
12
|
+
* Defines the props for the core ComboboxPopover template.
|
|
13
|
+
*/
|
|
14
|
+
export interface ComboboxPopoverProps extends HasClassName {
|
|
15
|
+
/** Content (should contain a ComboboxList). */
|
|
16
|
+
children?: JSXElement;
|
|
17
|
+
/** Whether a click anywhere out of the popover would close it. */
|
|
18
|
+
closeOnClickAway?: boolean;
|
|
19
|
+
/** Whether an escape key press would close the popover. */
|
|
20
|
+
closeOnEscape?: boolean;
|
|
21
|
+
/** Manage popover width relative to anchor. Defaults to `true` (minWidth). */
|
|
22
|
+
fitToAnchorWidth?: FitAnchorWidth | boolean;
|
|
23
|
+
/** Whether the combobox is open. */
|
|
24
|
+
isOpen?: boolean;
|
|
25
|
+
/** Placement relative to anchor. Defaults to `'bottom-start'`. */
|
|
26
|
+
placement?: Placement;
|
|
27
|
+
/** Reference to the anchor element for popover positioning. */
|
|
28
|
+
anchorRef?: CommonRef;
|
|
29
|
+
/** Callback invoked when the popover requests to close (click away, escape). */
|
|
30
|
+
handleClose?(): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Injected framework-specific components for ComboboxPopover rendering.
|
|
34
|
+
*/
|
|
35
|
+
export interface ComboboxPopoverComponents {
|
|
36
|
+
/** Popover component (framework-specific). */
|
|
37
|
+
Popover: any;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ComboboxPopover core template.
|
|
41
|
+
* Renders a Popover with combobox-specific defaults (className, closeMode, closeOnClickAway, closeOnEscape).
|
|
42
|
+
*
|
|
43
|
+
* Framework-specific components (Popover) are passed as a second argument
|
|
44
|
+
* by the React/Vue wrappers.
|
|
45
|
+
*
|
|
46
|
+
* @param props Component props.
|
|
47
|
+
* @param components Injected framework-specific components.
|
|
48
|
+
* @return JSX element.
|
|
49
|
+
*/
|
|
50
|
+
export declare const ComboboxPopover: (props: ComboboxPopoverProps, { Popover }: ComboboxPopoverComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the props for the core ComboboxSection template.
|
|
4
|
+
*/
|
|
5
|
+
export interface ComboboxSectionProps extends HasClassName {
|
|
6
|
+
/** Section label displayed as the group title. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Section icon */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Section content (should be ComboboxOption elements). */
|
|
11
|
+
children: JSXElement;
|
|
12
|
+
/** ref to the root element. */
|
|
13
|
+
ref?: CommonRef;
|
|
14
|
+
/**
|
|
15
|
+
* When true, the section renders as a bare `<li hidden>` wrapper, keeping children
|
|
16
|
+
* mounted (so option registrations stay alive) but invisible to the user and screen readers.
|
|
17
|
+
* Set automatically by the React/Vue wrapper when all child options are filtered out.
|
|
18
|
+
*/
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* When true, the section is visually rendered (label + content) but hidden from assistive
|
|
22
|
+
* technology. Used for skeleton-only sections: the visual skeleton provides feedback to
|
|
23
|
+
* sighted users, while the live region (`ComboboxState`) handles the loading announcement.
|
|
24
|
+
*/
|
|
25
|
+
'aria-hidden'?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props that React/Vue wrappers need to re-declare with framework-specific types.
|
|
29
|
+
* Used by `ReactToJSX<ComboboxSectionProps, ComboboxSectionPropsToOverride>`.
|
|
30
|
+
*/
|
|
31
|
+
export type ComboboxSectionPropsToOverride = 'children';
|
|
32
|
+
/**
|
|
33
|
+
* Injected framework-specific components for ComboboxSection rendering.
|
|
34
|
+
*/
|
|
35
|
+
export interface ComboboxSectionComponents {
|
|
36
|
+
/** ListSection component (framework-specific). */
|
|
37
|
+
ListSection: any;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Component display name.
|
|
41
|
+
*/
|
|
42
|
+
export declare const COMPONENT_NAME = "ComboboxSection";
|
|
43
|
+
/**
|
|
44
|
+
* Component default class name and class prefix.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
47
|
+
/**
|
|
48
|
+
* ComboboxSection core template.
|
|
49
|
+
* Renders a ListSection with combobox-specific ARIA roles.
|
|
50
|
+
*
|
|
51
|
+
* Framework-specific components (ListSection) are passed as a second argument
|
|
52
|
+
* by the React/Vue wrappers.
|
|
53
|
+
*
|
|
54
|
+
* @param props Component props.
|
|
55
|
+
* @param components Injected framework-specific components.
|
|
56
|
+
* @return JSX element.
|
|
57
|
+
*/
|
|
58
|
+
export declare const ComboboxSection: (props: ComboboxSectionProps, { ListSection }: ComboboxSectionComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { LumxClassName } from '../../types';
|
|
2
|
+
import type { TextProps } from '../Text';
|
|
3
|
+
/**
|
|
4
|
+
* Component display name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const COMPONENT_NAME = "ComboboxState";
|
|
7
|
+
/**
|
|
8
|
+
* Component default class name and class prefix.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
11
|
+
/**
|
|
12
|
+
* Defines the props for the core ComboboxState template.
|
|
13
|
+
*/
|
|
14
|
+
export interface ComboboxStateProps {
|
|
15
|
+
/**
|
|
16
|
+
* Message to display when the list has no visible options.
|
|
17
|
+
* Can be a plain string or a function receiving the current input value (for dynamic messages).
|
|
18
|
+
* When omitted, the empty state is not shown.
|
|
19
|
+
*/
|
|
20
|
+
emptyMessage?: string | ((inputValue: string) => string);
|
|
21
|
+
/**
|
|
22
|
+
* Error state title message.
|
|
23
|
+
* When provided, the error state is active (takes priority over the empty state).
|
|
24
|
+
* When omitted, the error state is not shown.
|
|
25
|
+
*/
|
|
26
|
+
errorMessage?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Secondary error message (e.g. "Please try again").
|
|
29
|
+
* Only rendered when `errorMessage` is provided.
|
|
30
|
+
*/
|
|
31
|
+
errorTryReloadMessage?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Message to announce when loading persists (after a 500ms debounce).
|
|
34
|
+
* When omitted, no loading announcement is made.
|
|
35
|
+
*/
|
|
36
|
+
loadingMessage?: string;
|
|
37
|
+
/**
|
|
38
|
+
* List state
|
|
39
|
+
*/
|
|
40
|
+
state?: {
|
|
41
|
+
/**
|
|
42
|
+
* Whether the list currently has no visible options.
|
|
43
|
+
* Driven by the framework wrapper via the combobox handle's `emptyChange` event.
|
|
44
|
+
*/
|
|
45
|
+
isEmpty?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The current value of the combobox input.
|
|
48
|
+
* Passed to `emptyMessage` when it is a function.
|
|
49
|
+
*/
|
|
50
|
+
inputValue?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether loading is active (immediate, from `loadingChange` event).
|
|
53
|
+
* Used to suppress false "empty" state while data is loading.
|
|
54
|
+
*/
|
|
55
|
+
isLoading?: boolean;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Components injected by the framework wrapper (dependency injection).
|
|
60
|
+
*/
|
|
61
|
+
export interface ComboboxStateComponents {
|
|
62
|
+
/**
|
|
63
|
+
* GenericBlock component (framework-specific, e.g. React GenericBlock with FlexBox handling).
|
|
64
|
+
*/
|
|
65
|
+
GenericBlock: any;
|
|
66
|
+
/**
|
|
67
|
+
* Text component (framework-specific, e.g. React Text or Vue Text).
|
|
68
|
+
*/
|
|
69
|
+
Text: (props: TextProps) => any;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* ComboboxState core template.
|
|
73
|
+
* Renders empty/error state messages inside the combobox popover.
|
|
74
|
+
* The block itself acts as a screen reader live region (`role="status" aria-live="polite"`).
|
|
75
|
+
*
|
|
76
|
+
* Activation rules:
|
|
77
|
+
* - Error state: active when `errorMessage` is provided (presence-based).
|
|
78
|
+
* - Empty state: active when `isEmpty` is true and `emptyMessage` is provided, and there is no error.
|
|
79
|
+
*
|
|
80
|
+
* @param props Component props.
|
|
81
|
+
* @param components Injected framework-specific components.
|
|
82
|
+
* @return JSX element or null when no state is active.
|
|
83
|
+
*/
|
|
84
|
+
export declare const ComboboxState: (props: ComboboxStateProps, { GenericBlock, Text }: ComboboxStateComponents) => import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { setupComboboxInput } from './setupComboboxInput';
|
|
2
|
+
export { setupComboboxButton } from './setupComboboxButton';
|
|
3
|
+
export type { ComboboxCallbacks, ComboboxHandle } from './types';
|
|
4
|
+
export { ComboboxList } from './ComboboxList';
|
|
5
|
+
export type { ComboboxListProps, ComboboxListType } from './ComboboxList';
|
|
6
|
+
export { ComboboxPopover } from './ComboboxPopover';
|
|
7
|
+
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
|
+
export { ComboboxButton } from './ComboboxButton';
|
|
17
|
+
export type { ComboboxButtonProps, ComboboxButtonComponents, ComboboxButtonLabelDisplayMode } from './ComboboxButton';
|
|
18
|
+
export { ComboboxInput } from './ComboboxInput';
|
|
19
|
+
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';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComboboxCallbacks, ComboboxHandle, OnTriggerAttach } from './types';
|
|
2
|
+
/** Options for configuring the shared combobox behavior. */
|
|
3
|
+
interface ComboboxOptions {
|
|
4
|
+
/** When true, ArrowDown/ArrowUp wrap around in listbox mode (input pattern). Default: false. */
|
|
5
|
+
wrapNavigation?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Set up combobox behavior (WAI-ARIA combobox pattern) on a trigger + listbox pair.
|
|
9
|
+
*
|
|
10
|
+
* The trigger and listbox are registered separately via the returned handle,
|
|
11
|
+
* allowing framework components to register them on mount. The behavior is
|
|
12
|
+
* fully attached once both are registered.
|
|
13
|
+
*
|
|
14
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
15
|
+
*
|
|
16
|
+
* @param callbacks Callbacks for select and open/close events.
|
|
17
|
+
* @param options Options for configuring the shared combobox behavior.
|
|
18
|
+
* @param onTriggerAttach Optional callback invoked when the trigger is registered and the signal is ready.
|
|
19
|
+
* Used by mode-specific wrappers (setupComboboxInput/Button) to automatically
|
|
20
|
+
* attach the appropriate controller.
|
|
21
|
+
* @returns A ComboboxHandle for interacting with the combobox.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setupCombobox(callbacks: ComboboxCallbacks, options?: ComboboxOptions, onTriggerAttach?: OnTriggerAttach): ComboboxHandle;
|
|
24
|
+
export {};
|