@lumx/core 4.25.0 → 4.25.1-alpha.1

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.
@@ -4,6 +4,9 @@
4
4
  * Do not edit directly
5
5
  * Generated on Mon, 13 Jan 2025 09:24:38 GMT
6
6
  */
7
+ /* ==========================================================================
8
+ Action area
9
+ ========================================================================== */
7
10
  /* stylelint-disable custom-property-pattern */
8
11
  /** @deprecated: replaced with $lumx-progress-circular-size-map */
9
12
  /**
@@ -418,6 +421,10 @@ table {
418
421
  .lumx-action-area {
419
422
  position: relative;
420
423
  }
424
+ :where(.lumx-action-area) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
425
+ position: relative;
426
+ z-index: 1;
427
+ }
421
428
 
422
429
  /* Action element
423
430
  ========================================================================== */
@@ -5069,6 +5076,9 @@ table {
5069
5076
  .lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
5070
5077
  width: min(55%, 170px);
5071
5078
  }
5079
+ .lumx-combobox-option__selection-icon {
5080
+ margin: auto;
5081
+ }
5072
5082
  .lumx-combobox-option .lumx-list-item__content {
5073
5083
  display: flex;
5074
5084
  flex-direction: column;
@@ -8116,6 +8126,7 @@ table {
8116
8126
  display: flex;
8117
8127
  flex-shrink: 0;
8118
8128
  justify-content: center;
8129
+ gap: 4px;
8119
8130
  width: 24px;
8120
8131
  margin-right: 8px;
8121
8132
  }
@@ -8123,6 +8134,7 @@ table {
8123
8134
  display: flex;
8124
8135
  flex-shrink: 0;
8125
8136
  justify-content: center;
8137
+ gap: 4px;
8126
8138
  margin-left: 8px;
8127
8139
  }
8128
8140
 
@@ -8140,6 +8152,7 @@ table {
8140
8152
  display: flex;
8141
8153
  flex-shrink: 0;
8142
8154
  justify-content: center;
8155
+ gap: 4px;
8143
8156
  width: 36px;
8144
8157
  margin-right: 16px;
8145
8158
  }
@@ -8147,6 +8160,7 @@ table {
8147
8160
  display: flex;
8148
8161
  flex-shrink: 0;
8149
8162
  justify-content: center;
8163
+ gap: 4px;
8150
8164
  margin-left: 16px;
8151
8165
  }
8152
8166
 
@@ -8164,6 +8178,7 @@ table {
8164
8178
  display: flex;
8165
8179
  flex-shrink: 0;
8166
8180
  justify-content: center;
8181
+ gap: 4px;
8167
8182
  width: 36px;
8168
8183
  margin-right: 16px;
8169
8184
  }
@@ -8171,6 +8186,7 @@ table {
8171
8186
  display: flex;
8172
8187
  flex-shrink: 0;
8173
8188
  justify-content: center;
8189
+ gap: 4px;
8174
8190
  margin-left: 16px;
8175
8191
  }
8176
8192
 
@@ -8187,6 +8203,7 @@ table {
8187
8203
  display: flex;
8188
8204
  flex-shrink: 0;
8189
8205
  justify-content: center;
8206
+ gap: 4px;
8190
8207
  width: 36px;
8191
8208
  margin-right: 16px;
8192
8209
  }
@@ -8194,6 +8211,7 @@ table {
8194
8211
  display: flex;
8195
8212
  flex-shrink: 0;
8196
8213
  justify-content: center;
8214
+ gap: 4px;
8197
8215
  margin-left: 16px;
8198
8216
  }
8199
8217
 
@@ -8234,25 +8252,41 @@ table {
8234
8252
  .lumx-list-item__link--is-highlighted:active {
8235
8253
  background-color: var(--lumx-color-dark-L4);
8236
8254
  }
8237
- .lumx-list-item__link--is-selected, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before {
8255
+ .lumx-list-item__link--is-selected {
8238
8256
  color: var(--lumx-color-primary-D2);
8239
8257
  background-color: var(--lumx-color-primary-L5);
8240
8258
  }
8241
- .lumx-list-item__link--is-selected[data-lumx-hover], .lumx-list-item__link--is-selected[data-focus-visible-added], .lumx-list-item .lumx-action-area__action[aria-selected=true]::before[data-lumx-hover], .lumx-list-item .lumx-action-area__action[aria-selected=true]::before[data-focus-visible-added] {
8259
+ .lumx-list-item__link--is-selected[data-lumx-hover], .lumx-list-item__link--is-selected[data-focus-visible-added] {
8242
8260
  background-color: var(--lumx-color-primary-L4);
8243
8261
  }
8244
8262
  @media (hover: hover) {
8245
- .lumx-list-item__link--is-selected:hover, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before:hover {
8263
+ .lumx-list-item__link--is-selected:hover {
8246
8264
  background-color: var(--lumx-color-primary-L4);
8247
8265
  }}
8248
- .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active], .lumx-list-item .lumx-action-area__action[aria-selected=true]::before:active, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before[data-lumx-active] {
8266
+ .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
8267
+ background-color: var(--lumx-color-primary-L3);
8268
+ }
8269
+ .lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
8270
+ background-color: var(--lumx-color-primary-L5);
8271
+ }
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 {
8273
+ background-color: var(--lumx-color-primary-L4);
8274
+ }
8275
+ @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 {
8277
+ background-color: var(--lumx-color-primary-L4);
8278
+ }}
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 {
8249
8280
  background-color: var(--lumx-color-primary-L3);
8250
8281
  }
8251
8282
  .lumx-list-item__link--is-disabled, .lumx-list-item__link[aria-disabled=true], .lumx-list-item:has(.lumx-action-area__action[aria-disabled=true]) {
8252
8283
  opacity: 0.5;
8253
8284
  cursor: default;
8254
8285
  }
8255
- .lumx-list-item__before, .lumx-list-item__after {
8286
+ .lumx-list-item:has(.lumx-action-area__action) {
8287
+ position: relative;
8288
+ }
8289
+ :where(.lumx-list-item:has(.lumx-action-area__action)) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
8256
8290
  position: relative;
8257
8291
  z-index: 1;
8258
8292
  }
@@ -164,4 +164,14 @@ export declare function setup({ components: { Combobox, IconButton, Avatar, Skel
164
164
  onChange: (v: string) => void;
165
165
  }) => import("react").JSX.Element;
166
166
  };
167
+ ComboboxWithOptionTooltips: {
168
+ args: {
169
+ value: string;
170
+ };
171
+ decorators: ((story: any, context: any) => any)[];
172
+ render: ({ value, onChange }: {
173
+ value: string;
174
+ onChange: (v: string) => void;
175
+ }) => import("react").JSX.Element;
176
+ };
167
177
  };
@@ -1,3 +1,7 @@
1
1
  import { VHSize } from '../../utils/browser/css/types';
2
+ import { OptionActiveEvent } from './types';
2
3
  export declare const DEFAULT_COMBOBOX_POPOVER_MAX_HEIGHT: VHSize;
3
4
  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;
@@ -14,6 +14,8 @@ export interface OptionRegistration {
14
14
  callback: (isFiltered: boolean) => void;
15
15
  lastFiltered: boolean;
16
16
  }
17
+ /** Event name for the active state of one option. */
18
+ export type OptionActiveEvent = `optionActive:${string}`;
17
19
  /** Map of combobox event names to their payload types. */
18
20
  export interface ComboboxEventMap {
19
21
  /** Fired when the combobox open state changes. Payload: whether the combobox is open. */
@@ -38,7 +40,15 @@ export interface ComboboxEventMap {
38
40
  * Used to control the loading message text in the live region (ComboboxState).
39
41
  */
40
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;
41
49
  }
50
+ /** Callback provided in events subscriptions */
51
+ export type SubscriptionCallback<T extends keyof ComboboxEventMap = keyof ComboboxEventMap> = (value: ComboboxEventMap[T]) => void;
42
52
  /** Callbacks provided by the consumer (React/Vue) to react to combobox state changes. */
43
53
  export interface ComboboxCallbacks {
44
54
  /** Called when an option is selected (click or keyboard). */
@@ -92,7 +102,7 @@ export interface ComboboxHandle {
92
102
  /** Tear down all listeners and state. */
93
103
  destroy(): void;
94
104
  /** Subscribe to a combobox event. Returns an unsubscribe function. */
95
- subscribe<K extends keyof ComboboxEventMap>(event: K, callback: (value: ComboboxEventMap[K]) => void): () => void;
105
+ subscribe<K extends keyof ComboboxEventMap>(event: K, callback: SubscriptionCallback<K>): () => void;
96
106
  /**
97
107
  * Read the last dispatched value of an event synchronously, for pull-based subscribers such as
98
108
  * React's `useSyncExternalStore`. Returns `undefined` until the event has fired at least once.
@@ -0,0 +1,45 @@
1
+ import type { SetupStoriesOptions } from '@lumx/core/stories/types';
2
+ /**
3
+ * Setup ListItem test stories for a specific framework (React or Vue).
4
+ */
5
+ export declare function setup({ component, render: ListItem, components: { List, ListItemAction, Button }, }: SetupStoriesOptions<{
6
+ components: {
7
+ List: any;
8
+ ListItemAction: any;
9
+ Button: any;
10
+ };
11
+ }>): {
12
+ meta: {
13
+ component: any;
14
+ tags: string[];
15
+ parameters: {
16
+ chromatic: {
17
+ disable: boolean;
18
+ };
19
+ };
20
+ };
21
+ ClickOnBeforeSlotTriggersAction: {
22
+ play: ({ args }: any) => Promise<void>;
23
+ args: {
24
+ onActionClick: import("storybook/test").Mock<(...args: any[]) => any>;
25
+ onSecondaryClick: import("storybook/test").Mock<(...args: any[]) => any>;
26
+ };
27
+ render: ({ onActionClick, onSecondaryClick }: any) => import("react").JSX.Element;
28
+ };
29
+ ClickOnAfterSlotTriggersAction: {
30
+ play: ({ args }: any) => Promise<void>;
31
+ args: {
32
+ onActionClick: import("storybook/test").Mock<(...args: any[]) => any>;
33
+ onSecondaryClick: import("storybook/test").Mock<(...args: any[]) => any>;
34
+ };
35
+ render: ({ onActionClick, onSecondaryClick }: any) => import("react").JSX.Element;
36
+ };
37
+ ClickOnSlotButtonTriggersButton: {
38
+ play: ({ args }: any) => Promise<void>;
39
+ args: {
40
+ onActionClick: import("storybook/test").Mock<(...args: any[]) => any>;
41
+ onSecondaryClick: import("storybook/test").Mock<(...args: any[]) => any>;
42
+ };
43
+ render: ({ onActionClick, onSecondaryClick }: any) => import("react").JSX.Element;
44
+ };
45
+ };
@@ -0,0 +1,13 @@
1
+ export interface SelectionIconProps {
2
+ /** Selection type of the select (`undefined` renders nothing). */
3
+ selectionType: 'single' | 'multiple' | undefined;
4
+ /** Whether the option is selected. */
5
+ isSelected: boolean;
6
+ }
7
+ /**
8
+ * Selection state icon of an option. The icon is always rendered after the label.
9
+ *
10
+ * - `single`: a check circle icon when selected, a blank radio icon otherwise.
11
+ * - `multiple`: a checkbox icon, marked or blank.
12
+ */
13
+ export declare const SelectionIcon: ({ selectionType, isSelected }: SelectionIconProps) => import("react").JSX.Element | null;
@@ -25,6 +25,12 @@ export interface RenderOptionContext {
25
25
  isSelected: boolean;
26
26
  /** Resolved description string (from `getOptionDescription`), if any. Should be forwarded as `description`. */
27
27
  description?: string | null;
28
+ /**
29
+ * Selection state icon to render after the option label
30
+ * (single selection: check circle when selected, blank radio otherwise; multiple selection: checkbox).
31
+ * Should be forwarded as `after` (appended after any custom `after` content).
32
+ */
33
+ after?: JSXElement;
28
34
  }
29
35
  export interface BaseSelectProps<O> {
30
36
  /** List of option objects. */
@@ -84,6 +90,12 @@ export interface BaseSelectComponents {
84
90
  export interface RenderSelectOptionsProps<O> extends BaseSelectProps<O> {
85
91
  /** Selected option (single) or options (multiple). */
86
92
  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';
87
99
  }
88
100
  /**
89
101
  * Shared translation labels for SelectTextField wrappers (React and Vue).
package/lumx.css CHANGED
@@ -685,6 +685,9 @@
685
685
  * List of deprecated v2 variables that have been removed or renamed.
686
686
  * Warning: These will be removed in the next major version.
687
687
  */
688
+ /* ==========================================================================
689
+ Action area
690
+ ========================================================================== */
688
691
  /* stylelint-disable custom-property-pattern */
689
692
  /** @deprecated: replaced with $lumx-progress-circular-size-map */
690
693
  /**
@@ -1099,6 +1102,10 @@ table {
1099
1102
  .lumx-action-area {
1100
1103
  position: relative;
1101
1104
  }
1105
+ :where(.lumx-action-area) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
1106
+ position: relative;
1107
+ z-index: 1;
1108
+ }
1102
1109
 
1103
1110
  /* Action element
1104
1111
  ========================================================================== */
@@ -5750,6 +5757,9 @@ table {
5750
5757
  .lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
5751
5758
  width: min(55%, 170px);
5752
5759
  }
5760
+ .lumx-combobox-option__selection-icon {
5761
+ margin: auto;
5762
+ }
5753
5763
  .lumx-combobox-option .lumx-list-item__content {
5754
5764
  display: flex;
5755
5765
  flex-direction: column;
@@ -8797,6 +8807,7 @@ table {
8797
8807
  display: flex;
8798
8808
  flex-shrink: 0;
8799
8809
  justify-content: center;
8810
+ gap: 4px;
8800
8811
  width: 24px;
8801
8812
  margin-right: 8px;
8802
8813
  }
@@ -8804,6 +8815,7 @@ table {
8804
8815
  display: flex;
8805
8816
  flex-shrink: 0;
8806
8817
  justify-content: center;
8818
+ gap: 4px;
8807
8819
  margin-left: 8px;
8808
8820
  }
8809
8821
 
@@ -8821,6 +8833,7 @@ table {
8821
8833
  display: flex;
8822
8834
  flex-shrink: 0;
8823
8835
  justify-content: center;
8836
+ gap: 4px;
8824
8837
  width: 36px;
8825
8838
  margin-right: 16px;
8826
8839
  }
@@ -8828,6 +8841,7 @@ table {
8828
8841
  display: flex;
8829
8842
  flex-shrink: 0;
8830
8843
  justify-content: center;
8844
+ gap: 4px;
8831
8845
  margin-left: 16px;
8832
8846
  }
8833
8847
 
@@ -8845,6 +8859,7 @@ table {
8845
8859
  display: flex;
8846
8860
  flex-shrink: 0;
8847
8861
  justify-content: center;
8862
+ gap: 4px;
8848
8863
  width: 36px;
8849
8864
  margin-right: 16px;
8850
8865
  }
@@ -8852,6 +8867,7 @@ table {
8852
8867
  display: flex;
8853
8868
  flex-shrink: 0;
8854
8869
  justify-content: center;
8870
+ gap: 4px;
8855
8871
  margin-left: 16px;
8856
8872
  }
8857
8873
 
@@ -8868,6 +8884,7 @@ table {
8868
8884
  display: flex;
8869
8885
  flex-shrink: 0;
8870
8886
  justify-content: center;
8887
+ gap: 4px;
8871
8888
  width: 36px;
8872
8889
  margin-right: 16px;
8873
8890
  }
@@ -8875,6 +8892,7 @@ table {
8875
8892
  display: flex;
8876
8893
  flex-shrink: 0;
8877
8894
  justify-content: center;
8895
+ gap: 4px;
8878
8896
  margin-left: 16px;
8879
8897
  }
8880
8898
 
@@ -8915,25 +8933,41 @@ table {
8915
8933
  .lumx-list-item__link--is-highlighted:active {
8916
8934
  background-color: var(--lumx-color-dark-L4);
8917
8935
  }
8918
- .lumx-list-item__link--is-selected, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before {
8936
+ .lumx-list-item__link--is-selected {
8919
8937
  color: var(--lumx-color-primary-D2);
8920
8938
  background-color: var(--lumx-color-primary-L5);
8921
8939
  }
8922
- .lumx-list-item__link--is-selected[data-lumx-hover], .lumx-list-item__link--is-selected[data-focus-visible-added], .lumx-list-item .lumx-action-area__action[aria-selected=true]::before[data-lumx-hover], .lumx-list-item .lumx-action-area__action[aria-selected=true]::before[data-focus-visible-added] {
8940
+ .lumx-list-item__link--is-selected[data-lumx-hover], .lumx-list-item__link--is-selected[data-focus-visible-added] {
8923
8941
  background-color: var(--lumx-color-primary-L4);
8924
8942
  }
8925
8943
  @media (hover: hover) {
8926
- .lumx-list-item__link--is-selected:hover, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before:hover {
8944
+ .lumx-list-item__link--is-selected:hover {
8927
8945
  background-color: var(--lumx-color-primary-L4);
8928
8946
  }}
8929
- .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active], .lumx-list-item .lumx-action-area__action[aria-selected=true]::before:active, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before[data-lumx-active] {
8947
+ .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
8948
+ background-color: var(--lumx-color-primary-L3);
8949
+ }
8950
+ .lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
8951
+ background-color: var(--lumx-color-primary-L5);
8952
+ }
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 {
8954
+ background-color: var(--lumx-color-primary-L4);
8955
+ }
8956
+ @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 {
8958
+ background-color: var(--lumx-color-primary-L4);
8959
+ }}
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 {
8930
8961
  background-color: var(--lumx-color-primary-L3);
8931
8962
  }
8932
8963
  .lumx-list-item__link--is-disabled, .lumx-list-item__link[aria-disabled=true], .lumx-list-item:has(.lumx-action-area__action[aria-disabled=true]) {
8933
8964
  opacity: 0.5;
8934
8965
  cursor: default;
8935
8966
  }
8936
- .lumx-list-item__before, .lumx-list-item__after {
8967
+ .lumx-list-item:has(.lumx-action-area__action) {
8968
+ position: relative;
8969
+ }
8970
+ :where(.lumx-list-item:has(.lumx-action-area__action)) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
8937
8971
  position: relative;
8938
8972
  z-index: 1;
8939
8973
  }
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.0",
10
+ "@lumx/icons": "^4.25.1-alpha.1",
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.0",
69
+ "version": "4.25.1-alpha.1",
70
70
  "devDependencies": {
71
71
  "@rollup/plugin-typescript": "^12.3.0",
72
72
  "@testing-library/dom": "^10.4.1",
@@ -89,5 +89,6 @@
89
89
  "vite": "^7.3.5",
90
90
  "vite-tsconfig-paths": "^5.1.4",
91
91
  "vitest": "^4.1.11"
92
- }
92
+ },
93
+ "stableVersion": "4.25.0"
93
94
  }
package/scss/_core.scss CHANGED
@@ -6,6 +6,7 @@
6
6
  @import "./core/spacing/variables";
7
7
  @import "./core/state/variables";
8
8
  @import "./core/state/mixins";
9
+ @import "./core/action-area/mixins";
9
10
  @import "./core/color/variables";
10
11
  @import "./core/color/functions";
11
12
  @import "./core/typography/variables";
@@ -70,6 +70,11 @@
70
70
  }
71
71
  }
72
72
 
73
+ // Selection state icon (select options), centered in the `after` slot
74
+ &__selection-icon {
75
+ margin: auto;
76
+ }
77
+
73
78
  // Center option content
74
79
  .#{$lumx-base-prefix}-list-item__content {
75
80
  display: flex;
@@ -41,22 +41,39 @@
41
41
  @include lumx-list-item-highlighted;
42
42
  }
43
43
 
44
- &__link--is-selected,
45
- & .lumx-action-area__action[aria-selected="true"]::before {
44
+ &__link--is-selected {
46
45
  @include lumx-list-item-selected;
47
46
  }
48
47
 
48
+ // Selected action: from `aria-selected` on the action (ex: combobox option) or from `isSelected` on the list item.
49
+ // (the background is on the action overlay `::before`, so the state selectors must come before `::before`)
50
+ & .#{$lumx-base-prefix}-action-area__action[aria-selected="true"],
51
+ &__wrapper--is-selected .#{$lumx-base-prefix}-action-area__action {
52
+ &::before {
53
+ background-color: lumx-color-variant("primary", "L5");
54
+ }
55
+
56
+ &:hover::before,
57
+ &[data-lumx-hover]::before,
58
+ &[data-focus-visible-added]::before {
59
+ background-color: lumx-color-variant("primary", "L4");
60
+ }
61
+
62
+ &:active::before,
63
+ &[data-lumx-active]::before {
64
+ background-color: lumx-color-variant("primary", "L3");
65
+ }
66
+ }
67
+
49
68
  &__link--is-disabled,
50
69
  &__link[aria-disabled="true"],
51
70
  &:has(.lumx-action-area__action[aria-disabled="true"]) {
52
71
  @include lumx-state-disabled-input;
53
72
  }
54
73
 
55
- // Elevate before/after slots above the action area overlay.
56
- &__before,
57
- &__after {
58
- position: relative;
59
- z-index: 1;
74
+ // With an action, the list item is an action area container.
75
+ &:has(.lumx-action-area__action) {
76
+ @include lumx-action-area;
60
77
  }
61
78
  }
62
79
 
@@ -89,6 +89,7 @@
89
89
  display: flex;
90
90
  flex-shrink: 0;
91
91
  justify-content: center;
92
+ gap: $lumx-spacing-unit-tiny;
92
93
  }
93
94
 
94
95
  @mixin lumx-list-item-before($size) {
@@ -3,7 +3,7 @@
3
3
  ========================================================================== */
4
4
 
5
5
  .lumx-action-area {
6
- position: relative;
6
+ @include lumx-action-area;
7
7
  }
8
8
 
9
9
  /* Action element
@@ -0,0 +1,18 @@
1
+ $interactive: 'a, button, input, select, textarea, label, [tabindex]';
2
+
3
+ /* ==========================================================================
4
+ Action area
5
+ ========================================================================== */
6
+
7
+ // Action area container: positioning context for the action overlay.
8
+ // Nested interactive elements are elevated above the overlay so they stay independently clickable,
9
+ // while clicks on any other content fall through to the action.
10
+ // (zero specificity so that components can still set their own `position` and `z-index`)
11
+ @mixin lumx-action-area {
12
+ position: relative;
13
+
14
+ @at-root :where(#{&}) :where(#{$interactive}):not(:where(.lumx-action-area__action)) {
15
+ position: relative;
16
+ z-index: 1;
17
+ }
18
+ }