@lumx/core 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/components-and-utils.css +42 -34
- package/js/components/Combobox/ComboboxOptionTests.d.ts +1 -1
- package/js/components/Combobox/Stories.d.ts +32 -1
- package/js/components/Combobox/Tests.d.ts +1 -0
- package/js/components/Listbox/ListboxList.d.ts +12 -1
- package/js/components/Listbox/ListboxOption.d.ts +8 -2
- package/js/components/Listbox/ListboxOptionAction.d.ts +7 -1
- package/js/components/Listbox/ListboxOptionMoreInfo.d.ts +7 -1
- package/js/{utils/select/SelectionIcon.d.ts → components/Listbox/ListboxOptionSelectionIcon.d.ts} +2 -2
- package/js/components/Listbox/ListboxOptionSkeleton.d.ts +7 -1
- package/js/components/Listbox/ListboxSection.d.ts +7 -1
- package/js/components/Listbox/ListboxState.d.ts +7 -1
- package/js/components/Listbox/Tests.d.ts +1 -0
- package/js/utils/select/types.d.ts +4 -6
- package/lumx.css +42 -34
- package/package.json +2 -2
- package/scss/_components_classes.scss +1 -0
- package/scss/components/combobox/_index.scss +5 -51
- package/scss/components/list/_index.scss +3 -1
- package/scss/components/list-box/_index.scss +69 -0
package/components-and-utils.css
CHANGED
|
@@ -5056,39 +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__content {
|
|
5083
|
-
display: flex;
|
|
5084
|
-
flex-direction: column;
|
|
5085
|
-
justify-items: center;
|
|
5086
|
-
}
|
|
5087
|
-
.lumx-combobox-option-more-info__popover {
|
|
5088
|
-
max-width: 256px;
|
|
5089
|
-
padding: 16px;
|
|
5090
|
-
}
|
|
5091
|
-
|
|
5092
5063
|
/* ==========================================================================
|
|
5093
5064
|
Comment block
|
|
5094
5065
|
========================================================================== */
|
|
@@ -7458,6 +7429,43 @@ table {
|
|
|
7458
7429
|
opacity: 1;
|
|
7459
7430
|
}
|
|
7460
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
|
+
|
|
7461
7469
|
/* ==========================================================================
|
|
7462
7470
|
Index
|
|
7463
7471
|
========================================================================== */
|
|
@@ -8266,17 +8274,17 @@ table {
|
|
|
8266
8274
|
.lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
|
|
8267
8275
|
background-color: var(--lumx-color-primary-L3);
|
|
8268
8276
|
}
|
|
8269
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
|
|
8277
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
|
|
8270
8278
|
background-color: var(--lumx-color-primary-L5);
|
|
8271
8279
|
}
|
|
8272
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-hover]::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-focus-visible-added]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-hover]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-focus-visible-added]::before {
|
|
8280
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-hover]::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-focus-visible-added]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])[data-lumx-hover]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])[data-focus-visible-added]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-hover]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-focus-visible-added]::before {
|
|
8273
8281
|
background-color: var(--lumx-color-primary-L4);
|
|
8274
8282
|
}
|
|
8275
8283
|
@media (hover: hover) {
|
|
8276
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true]:hover::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:hover::before {
|
|
8284
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true]:hover::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""]):hover::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:hover::before {
|
|
8277
8285
|
background-color: var(--lumx-color-primary-L4);
|
|
8278
8286
|
}}
|
|
8279
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true]:active::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-active]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:active::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-active]::before {
|
|
8287
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true]:active::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-active]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""]):active::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])[data-lumx-active]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:active::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-active]::before {
|
|
8280
8288
|
background-color: var(--lumx-color-primary-L3);
|
|
8281
8289
|
}
|
|
8282
8290
|
.lumx-list-item__link--is-disabled, .lumx-list-item__link[aria-disabled=true], .lumx-list-item:has(.lumx-action-area__action[aria-disabled=true]) {
|
|
@@ -9,7 +9,7 @@ type RenderResult = {
|
|
|
9
9
|
*/
|
|
10
10
|
export interface ListboxOptionTestSetup {
|
|
11
11
|
/** Combobox compound component namespace */
|
|
12
|
-
Combobox: Pick<ComboboxNamespace, 'Provider' | 'Input' | 'List' | 'Option'>;
|
|
12
|
+
Combobox: Pick<ComboboxNamespace, 'Provider' | 'Input' | 'List' | 'Option' | 'SelectionIcon'>;
|
|
13
13
|
/**
|
|
14
14
|
* Render a JSX template and return a result with a container.
|
|
15
15
|
* The template is a zero-argument function returning a JSX element.
|
|
@@ -4,12 +4,13 @@ import type { ComboboxNamespace } from './Tests';
|
|
|
4
4
|
* Setup Combobox demo stories for a specific framework (React or Vue).
|
|
5
5
|
* Framework-specific components and hooks are injected via options.
|
|
6
6
|
*/
|
|
7
|
-
export declare function setup({ components: { Combobox, IconButton, Avatar, SkeletonCircle }, decorators: { withValueOnChange }, }: SetupStoriesOptions<{
|
|
7
|
+
export declare function setup({ components: { Combobox, IconButton, Avatar, SkeletonCircle, Text }, decorators: { withValueOnChange }, }: SetupStoriesOptions<{
|
|
8
8
|
components: {
|
|
9
9
|
Combobox: ComboboxNamespace;
|
|
10
10
|
IconButton: any;
|
|
11
11
|
Avatar: any;
|
|
12
12
|
SkeletonCircle: any;
|
|
13
|
+
Text: any;
|
|
13
14
|
};
|
|
14
15
|
decorators: 'withValueOnChange';
|
|
15
16
|
}>): {
|
|
@@ -79,6 +80,26 @@ export declare function setup({ components: { Combobox, IconButton, Avatar, Skel
|
|
|
79
80
|
onChange: (v: string) => void;
|
|
80
81
|
}) => import("react").JSX.Element;
|
|
81
82
|
};
|
|
83
|
+
ComboboxWithSelectionIconSingle: {
|
|
84
|
+
args: {
|
|
85
|
+
value: string;
|
|
86
|
+
};
|
|
87
|
+
decorators: ((story: any, context: any) => any)[];
|
|
88
|
+
render: ({ value, onChange }: {
|
|
89
|
+
value: string;
|
|
90
|
+
onChange: (v: string) => void;
|
|
91
|
+
}) => import("react").JSX.Element;
|
|
92
|
+
};
|
|
93
|
+
ComboboxWithSelectionIconMultiple: {
|
|
94
|
+
args: {
|
|
95
|
+
value: string;
|
|
96
|
+
};
|
|
97
|
+
decorators: ((story: any, context: any) => any)[];
|
|
98
|
+
render: ({ value, onChange }: {
|
|
99
|
+
value: string;
|
|
100
|
+
onChange: (v: string) => void;
|
|
101
|
+
}) => import("react").JSX.Element;
|
|
102
|
+
};
|
|
82
103
|
GridComboboxWithInput: {
|
|
83
104
|
args: {
|
|
84
105
|
value: string;
|
|
@@ -174,4 +195,14 @@ export declare function setup({ components: { Combobox, IconButton, Avatar, Skel
|
|
|
174
195
|
onChange: (v: string) => void;
|
|
175
196
|
}) => import("react").JSX.Element;
|
|
176
197
|
};
|
|
198
|
+
ComboboxWithTruncatedOption: {
|
|
199
|
+
args: {
|
|
200
|
+
value: string;
|
|
201
|
+
};
|
|
202
|
+
decorators: ((story: any, context: any) => any)[];
|
|
203
|
+
render: ({ value, onChange }: {
|
|
204
|
+
value: string;
|
|
205
|
+
onChange: (v: string) => void;
|
|
206
|
+
}) => import("react").JSX.Element;
|
|
207
|
+
};
|
|
177
208
|
};
|
|
@@ -17,6 +17,11 @@ export interface ListboxListProps extends HasClassName {
|
|
|
17
17
|
* Omit (or set to `undefined`) when not loading — the attribute is not rendered as `"false"`.
|
|
18
18
|
*/
|
|
19
19
|
'aria-busy'?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Allow selecting several options (`aria-multiselectable`).
|
|
22
|
+
* Also read by `Combobox.SelectionIcon` to pick the checkbox icons.
|
|
23
|
+
*/
|
|
24
|
+
'aria-multiselectable'?: boolean | 'true' | 'false';
|
|
20
25
|
/** Content (should be ListboxOption elements). */
|
|
21
26
|
children?: JSXElement;
|
|
22
27
|
/** The ID of the listbox element. */
|
|
@@ -32,11 +37,17 @@ export interface ListboxListProps extends HasClassName {
|
|
|
32
37
|
/**
|
|
33
38
|
* Component display name.
|
|
34
39
|
*/
|
|
35
|
-
export declare const COMPONENT_NAME = "
|
|
40
|
+
export declare const COMPONENT_NAME = "ListboxList";
|
|
36
41
|
/**
|
|
37
42
|
* Component default class name and class prefix.
|
|
38
43
|
*/
|
|
39
44
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
45
|
+
/**
|
|
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";
|
|
40
51
|
/**
|
|
41
52
|
* ListboxList core template.
|
|
42
53
|
* Renders a List with combobox-specific ARIA attributes and styling.
|
|
@@ -35,7 +35,7 @@ export interface ListboxOptionProps 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;
|
|
@@ -56,11 +56,17 @@ export type ListboxOptionPropsToOverride = 'before' | 'after' | 'children' | 'to
|
|
|
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
|
+
/**
|
|
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";
|
|
64
70
|
/**
|
|
65
71
|
* ListboxOption core template.
|
|
66
72
|
* Renders a ListItem with combobox-specific ARIA attributes and structure.
|
|
@@ -18,11 +18,17 @@ export type ListboxOptionActionProps<E extends ClickableElement = 'button'> = Ha
|
|
|
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
|
+
/**
|
|
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";
|
|
26
32
|
/**
|
|
27
33
|
* ListboxOptionAction core template.
|
|
28
34
|
* Renders a secondary action button within a combobox option row (grid mode).
|
|
@@ -34,11 +34,17 @@ export interface ListboxOptionMoreInfoComponents {
|
|
|
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
|
+
/**
|
|
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";
|
|
42
48
|
/**
|
|
43
49
|
* ListboxOptionMoreInfo core template.
|
|
44
50
|
* Renders an info icon button with a popover that shows additional details about a combobox option.
|
package/js/{utils/select/SelectionIcon.d.ts → components/Listbox/ListboxOptionSelectionIcon.d.ts}
RENAMED
|
@@ -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 SelectionIconProps {
|
|
|
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;
|
|
@@ -28,11 +28,17 @@ export type ListboxOptionSkeletonPropsToOverride = 'before' | 'after' | 'childre
|
|
|
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
|
+
/**
|
|
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";
|
|
36
42
|
/**
|
|
37
43
|
* ListboxOptionSkeleton core template.
|
|
38
44
|
* Renders a skeleton placeholder `<li>` inside a combobox list, styled to match
|
|
@@ -39,11 +39,17 @@ export interface ListboxSectionComponents {
|
|
|
39
39
|
/**
|
|
40
40
|
* Component display name.
|
|
41
41
|
*/
|
|
42
|
-
export declare const COMPONENT_NAME = "
|
|
42
|
+
export declare const COMPONENT_NAME = "ListboxSection";
|
|
43
43
|
/**
|
|
44
44
|
* Component default class name and class prefix.
|
|
45
45
|
*/
|
|
46
46
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
47
|
+
/**
|
|
48
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
51
|
+
*/
|
|
52
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-section";
|
|
47
53
|
/**
|
|
48
54
|
* ListboxSection core template.
|
|
49
55
|
* Renders a ListSection with combobox-specific ARIA roles.
|
|
@@ -3,11 +3,17 @@ import type { TextProps } from '../Text';
|
|
|
3
3
|
/**
|
|
4
4
|
* Component display name.
|
|
5
5
|
*/
|
|
6
|
-
export declare const COMPONENT_NAME = "
|
|
6
|
+
export declare const COMPONENT_NAME = "ListboxState";
|
|
7
7
|
/**
|
|
8
8
|
* Component default class name and class prefix.
|
|
9
9
|
*/
|
|
10
10
|
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
11
|
+
/**
|
|
12
|
+
* Legacy class name, emitted next to `CLASSNAME` for backward compatibility.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated Use `CLASSNAME` (`lumx-listbox-*`). The legacy `lumx-combobox-*` class will be removed in the next major version.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LEGACY_CLASSNAME = "lumx-combobox-state";
|
|
11
17
|
/**
|
|
12
18
|
* Defines the props for the core ListboxState template.
|
|
13
19
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HasAriaDisabled } from '../../types/HasAriaDisabled';
|
|
2
2
|
import type { HasTheme } from '../../types/HasTheme';
|
|
3
3
|
import type { JSXElement, Selector } from '../../types';
|
|
4
|
+
import type { InputLabelProps } from '../../components/InputLabel';
|
|
4
5
|
/**
|
|
5
6
|
* Status of the select dropdown list.
|
|
6
7
|
*
|
|
@@ -80,6 +81,7 @@ export interface BaseSelectComponents {
|
|
|
80
81
|
Option: any;
|
|
81
82
|
State: any;
|
|
82
83
|
OptionSkeleton: any;
|
|
84
|
+
SelectionIcon: any;
|
|
83
85
|
};
|
|
84
86
|
/** Framework-specific InfiniteScroll component (handles IntersectionObserver lifecycle). */
|
|
85
87
|
InfiniteScroll?: any;
|
|
@@ -90,12 +92,6 @@ export interface BaseSelectComponents {
|
|
|
90
92
|
export interface RenderSelectOptionsProps<O> extends BaseSelectProps<O> {
|
|
91
93
|
/** Selected option (single) or options (multiple). */
|
|
92
94
|
selected?: O | O[];
|
|
93
|
-
/**
|
|
94
|
-
* Selection type, drives the selection state icons:
|
|
95
|
-
* - `'single'` (default): a check circle icon (selected) or blank radio icon after the label of every option.
|
|
96
|
-
* - `'multiple'`: a checkbox icon (marked or blank) after the label of every option.
|
|
97
|
-
*/
|
|
98
|
-
selectionType?: 'single' | 'multiple';
|
|
99
95
|
}
|
|
100
96
|
/**
|
|
101
97
|
* Shared translation labels for SelectTextField wrappers (React and Vue).
|
|
@@ -249,6 +245,8 @@ export interface BaseSelectTextFieldWrapperProps<O> extends Pick<BaseSelectProps
|
|
|
249
245
|
maxLength?: number;
|
|
250
246
|
/** Accessible label for the input element (overrides the visual label for screen readers). */
|
|
251
247
|
ariaLabel?: string;
|
|
248
|
+
/** Additional props forwarded to the field label (e.g. `className: 'visually-hidden'`, `typography`). */
|
|
249
|
+
labelProps?: Partial<Omit<InputLabelProps, 'children' | 'htmlFor' | 'id'>>;
|
|
252
250
|
/** Additional props forwarded to the Combobox.Input (and ultimately to TextField). */
|
|
253
251
|
inputProps?: Record<string, any>;
|
|
254
252
|
/** Props forwarded to the Combobox.Popover. */
|
package/lumx.css
CHANGED
|
@@ -5737,39 +5737,10 @@ table {
|
|
|
5737
5737
|
display: block;
|
|
5738
5738
|
scroll-snap-align: end;
|
|
5739
5739
|
}
|
|
5740
|
-
|
|
5741
|
-
.lumx-combobox-popover:empty, .lumx-combobox-popover:not(:has(.lumx-combobox-option)):not(:has(.lumx-combobox-state)):not(:has(.lumx-combobox-option-skeleton)),
|
|
5742
|
-
.lumx-combobox-list:empty,
|
|
5743
|
-
.lumx-combobox-list:not(:has(.lumx-combobox-option)):not(:has(.lumx-combobox-state)):not(:has(.lumx-combobox-option-skeleton)) {
|
|
5740
|
+
.lumx-combobox-popover:empty, .lumx-combobox-popover:not(:has(.lumx-listbox-option)):not(:has(.lumx-listbox-state)):not(:has(.lumx-listbox-option-skeleton)) {
|
|
5744
5741
|
display: none;
|
|
5745
5742
|
}
|
|
5746
5743
|
|
|
5747
|
-
.lumx-combobox-state {
|
|
5748
|
-
text-align: center;
|
|
5749
|
-
}
|
|
5750
|
-
|
|
5751
|
-
.lumx-combobox-option-skeleton .lumx-skeleton-typography {
|
|
5752
|
-
width: min(65%, 200px);
|
|
5753
|
-
}
|
|
5754
|
-
.lumx-combobox-option-skeleton:nth-child(3n+1) .lumx-skeleton-typography {
|
|
5755
|
-
width: min(70%, 230px);
|
|
5756
|
-
}
|
|
5757
|
-
.lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
|
|
5758
|
-
width: min(55%, 170px);
|
|
5759
|
-
}
|
|
5760
|
-
.lumx-combobox-option__selection-icon {
|
|
5761
|
-
margin: auto;
|
|
5762
|
-
}
|
|
5763
|
-
.lumx-combobox-option .lumx-list-item__content {
|
|
5764
|
-
display: flex;
|
|
5765
|
-
flex-direction: column;
|
|
5766
|
-
justify-items: center;
|
|
5767
|
-
}
|
|
5768
|
-
.lumx-combobox-option-more-info__popover {
|
|
5769
|
-
max-width: 256px;
|
|
5770
|
-
padding: 16px;
|
|
5771
|
-
}
|
|
5772
|
-
|
|
5773
5744
|
/* ==========================================================================
|
|
5774
5745
|
Comment block
|
|
5775
5746
|
========================================================================== */
|
|
@@ -8139,6 +8110,43 @@ table {
|
|
|
8139
8110
|
opacity: 1;
|
|
8140
8111
|
}
|
|
8141
8112
|
}
|
|
8113
|
+
/* ==========================================================================
|
|
8114
|
+
Listbox
|
|
8115
|
+
========================================================================== */
|
|
8116
|
+
.lumx-listbox-list:empty, .lumx-listbox-list:not(:has(.lumx-listbox-option)):not(:has(.lumx-listbox-state)):not(:has(.lumx-listbox-option-skeleton)) {
|
|
8117
|
+
display: none;
|
|
8118
|
+
}
|
|
8119
|
+
|
|
8120
|
+
.lumx-listbox-state {
|
|
8121
|
+
text-align: center;
|
|
8122
|
+
}
|
|
8123
|
+
|
|
8124
|
+
.lumx-listbox-option-skeleton .lumx-skeleton-typography {
|
|
8125
|
+
width: min(65%, 200px);
|
|
8126
|
+
}
|
|
8127
|
+
.lumx-listbox-option-skeleton:nth-child(3n+1) .lumx-skeleton-typography {
|
|
8128
|
+
width: min(70%, 230px);
|
|
8129
|
+
}
|
|
8130
|
+
.lumx-listbox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
|
|
8131
|
+
width: min(55%, 170px);
|
|
8132
|
+
}
|
|
8133
|
+
.lumx-listbox-option__selection-icon {
|
|
8134
|
+
margin: auto;
|
|
8135
|
+
}
|
|
8136
|
+
.lumx-listbox-option .lumx-list-item__wrapper,
|
|
8137
|
+
.lumx-listbox-option .lumx-list-item__content {
|
|
8138
|
+
min-width: 0;
|
|
8139
|
+
}
|
|
8140
|
+
.lumx-listbox-option .lumx-list-item__content {
|
|
8141
|
+
display: flex;
|
|
8142
|
+
flex-direction: column;
|
|
8143
|
+
justify-items: center;
|
|
8144
|
+
}
|
|
8145
|
+
.lumx-listbox-option-more-info__popover {
|
|
8146
|
+
max-width: 256px;
|
|
8147
|
+
padding: 16px;
|
|
8148
|
+
}
|
|
8149
|
+
|
|
8142
8150
|
/* ==========================================================================
|
|
8143
8151
|
Index
|
|
8144
8152
|
========================================================================== */
|
|
@@ -8947,17 +8955,17 @@ table {
|
|
|
8947
8955
|
.lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
|
|
8948
8956
|
background-color: var(--lumx-color-primary-L3);
|
|
8949
8957
|
}
|
|
8950
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
|
|
8958
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
|
|
8951
8959
|
background-color: var(--lumx-color-primary-L5);
|
|
8952
8960
|
}
|
|
8953
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-hover]::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-focus-visible-added]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-hover]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-focus-visible-added]::before {
|
|
8961
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-hover]::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-focus-visible-added]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])[data-lumx-hover]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])[data-focus-visible-added]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-hover]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-focus-visible-added]::before {
|
|
8954
8962
|
background-color: var(--lumx-color-primary-L4);
|
|
8955
8963
|
}
|
|
8956
8964
|
@media (hover: hover) {
|
|
8957
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true]:hover::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:hover::before {
|
|
8965
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true]:hover::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""]):hover::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:hover::before {
|
|
8958
8966
|
background-color: var(--lumx-color-primary-L4);
|
|
8959
8967
|
}}
|
|
8960
|
-
.lumx-list-item .lumx-action-area__action[aria-selected=true]:active::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-active]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:active::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-active]::before {
|
|
8968
|
+
.lumx-list-item .lumx-action-area__action[aria-selected=true]:active::before, .lumx-list-item .lumx-action-area__action[aria-selected=true][data-lumx-active]::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""]):active::before, .lumx-list-item .lumx-action-area__action[aria-current]:not([aria-current=false]):not([aria-current=""])[data-lumx-active]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:active::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action[data-lumx-active]::before {
|
|
8961
8969
|
background-color: var(--lumx-color-primary-L3);
|
|
8962
8970
|
}
|
|
8963
8971
|
.lumx-list-item__link--is-disabled, .lumx-list-item__link[aria-disabled=true], .lumx-list-item:has(.lumx-action-area__action[aria-disabled=true]) {
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.25.1-alpha.
|
|
10
|
+
"@lumx/icons": "^4.25.1-alpha.4",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "4.25.1-alpha.
|
|
69
|
+
"version": "4.25.1-alpha.4",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
@import "./components/input-label/index";
|
|
26
26
|
@import "./components/input-required-legend/index";
|
|
27
27
|
@import "./components/lightbox/index";
|
|
28
|
+
@import "./components/list-box/index";
|
|
28
29
|
@import "./components/link/index";
|
|
29
30
|
@import "./components/link-preview/index";
|
|
30
31
|
@import "./components/list/index";
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Combobox
|
|
3
3
|
========================================================================== */
|
|
4
4
|
|
|
5
|
+
// NB: list, option, section and state styles live in `components/list-box`.
|
|
6
|
+
|
|
5
7
|
// ---- Input -----------------------
|
|
6
8
|
.#{$lumx-base-prefix}-combobox-input {
|
|
7
9
|
.#{$lumx-base-prefix}-text-field__chips {
|
|
@@ -33,60 +35,12 @@
|
|
|
33
35
|
scroll-snap-align: end;
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
|
-
}
|
|
37
38
|
|
|
38
|
-
// Hide popover
|
|
39
|
-
.#{$lumx-base-prefix}-combobox-popover,
|
|
40
|
-
.#{$lumx-base-prefix}-combobox-list {
|
|
39
|
+
// Hide popover when there is no option, no state, and no skeleton
|
|
41
40
|
&:empty,
|
|
42
|
-
&:not(:has(.#{$lumx-base-prefix}-
|
|
43
|
-
:has(.#{$lumx-base-prefix}-
|
|
41
|
+
&:not(:has(.#{$lumx-base-prefix}-listbox-option)):not(:has(.#{$lumx-base-prefix}-listbox-state)):not(
|
|
42
|
+
:has(.#{$lumx-base-prefix}-listbox-option-skeleton)
|
|
44
43
|
) {
|
|
45
44
|
display: none;
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
// ---- State -----------------------
|
|
50
|
-
|
|
51
|
-
.#{$lumx-base-prefix}-combobox-state {
|
|
52
|
-
text-align: center;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ---- Option -----------------------
|
|
56
|
-
|
|
57
|
-
.#{$lumx-base-prefix}-combobox-option {
|
|
58
|
-
// Skeleton option placeholders — width variation via :nth-child cycling
|
|
59
|
-
&-skeleton {
|
|
60
|
-
.#{$lumx-base-prefix}-skeleton-typography {
|
|
61
|
-
width: min(65%, 200px);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&:nth-child(3n + 1) .#{$lumx-base-prefix}-skeleton-typography {
|
|
65
|
-
width: min(70%, 230px);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&:nth-child(3n + 2) .#{$lumx-base-prefix}-skeleton-typography {
|
|
69
|
-
width: min(55%, 170px);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Selection state icon (select options), centered in the `after` slot
|
|
74
|
-
&__selection-icon {
|
|
75
|
-
margin: auto;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Center option content
|
|
79
|
-
.#{$lumx-base-prefix}-list-item__content {
|
|
80
|
-
display: flex;
|
|
81
|
-
flex-direction: column;
|
|
82
|
-
justify-items: center;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Option more info popover sizing
|
|
86
|
-
&-more-info {
|
|
87
|
-
&__popover {
|
|
88
|
-
max-width: $lumx-size-xxl;
|
|
89
|
-
padding: $lumx-spacing-unit-big;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -45,9 +45,11 @@
|
|
|
45
45
|
@include lumx-list-item-selected;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
// Selected action: from `aria-selected`
|
|
48
|
+
// Selected action: from `aria-selected` (ex: combobox option) or `aria-current` (ex: nav link) on the action,
|
|
49
|
+
// or from `isSelected` on the list item.
|
|
49
50
|
// (the background is on the action overlay `::before`, so the state selectors must come before `::before`)
|
|
50
51
|
& .#{$lumx-base-prefix}-action-area__action[aria-selected="true"],
|
|
52
|
+
& .#{$lumx-base-prefix}-action-area__action[aria-current]:not([aria-current="false"]):not([aria-current=""]),
|
|
51
53
|
&__wrapper--is-selected .#{$lumx-base-prefix}-action-area__action {
|
|
52
54
|
&::before {
|
|
53
55
|
background-color: lumx-color-variant("primary", "L5");
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Listbox
|
|
3
|
+
========================================================================== */
|
|
4
|
+
|
|
5
|
+
// NB: elements also carry the legacy `lumx-combobox-*` class names for backward compatibility.
|
|
6
|
+
// Styles target the `lumx-listbox-*` class names only.
|
|
7
|
+
|
|
8
|
+
// ---- List -----------------------
|
|
9
|
+
|
|
10
|
+
// Hide list when there is no option, no state, and no skeleton
|
|
11
|
+
.#{$lumx-base-prefix}-listbox-list {
|
|
12
|
+
&:empty,
|
|
13
|
+
&:not(:has(.#{$lumx-base-prefix}-listbox-option)):not(:has(.#{$lumx-base-prefix}-listbox-state)):not(
|
|
14
|
+
:has(.#{$lumx-base-prefix}-listbox-option-skeleton)
|
|
15
|
+
) {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ---- State -----------------------
|
|
21
|
+
|
|
22
|
+
.#{$lumx-base-prefix}-listbox-state {
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ---- Option -----------------------
|
|
27
|
+
|
|
28
|
+
.#{$lumx-base-prefix}-listbox-option {
|
|
29
|
+
// Skeleton option placeholders — width variation via :nth-child cycling
|
|
30
|
+
&-skeleton {
|
|
31
|
+
.#{$lumx-base-prefix}-skeleton-typography {
|
|
32
|
+
width: min(65%, 200px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:nth-child(3n + 1) .#{$lumx-base-prefix}-skeleton-typography {
|
|
36
|
+
width: min(70%, 230px);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:nth-child(3n + 2) .#{$lumx-base-prefix}-skeleton-typography {
|
|
40
|
+
width: min(55%, 170px);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Selection state icon (select options), centered in the `after` slot
|
|
45
|
+
&__selection-icon {
|
|
46
|
+
margin: auto;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Allow flex items to shrink below their content width so `truncate` text shows an ellipsis
|
|
50
|
+
.#{$lumx-base-prefix}-list-item__wrapper,
|
|
51
|
+
.#{$lumx-base-prefix}-list-item__content {
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Center option content
|
|
56
|
+
.#{$lumx-base-prefix}-list-item__content {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
justify-items: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Option more info popover sizing
|
|
63
|
+
&-more-info {
|
|
64
|
+
&__popover {
|
|
65
|
+
max-width: $lumx-size-xxl;
|
|
66
|
+
padding: $lumx-spacing-unit-big;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|