@lumx/core 4.25.1-next.2 → 4.26.0-next.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.
@@ -5076,6 +5076,13 @@ table {
5076
5076
  .lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
5077
5077
  width: min(55%, 170px);
5078
5078
  }
5079
+ .lumx-combobox-option__selection-icon {
5080
+ margin: auto;
5081
+ }
5082
+ .lumx-combobox-option .lumx-list-item__wrapper,
5083
+ .lumx-combobox-option .lumx-list-item__content {
5084
+ min-width: 0;
5085
+ }
5079
5086
  .lumx-combobox-option .lumx-list-item__content {
5080
5087
  display: flex;
5081
5088
  flex-direction: column;
@@ -8123,6 +8130,7 @@ table {
8123
8130
  display: flex;
8124
8131
  flex-shrink: 0;
8125
8132
  justify-content: center;
8133
+ gap: 4px;
8126
8134
  width: 24px;
8127
8135
  margin-right: 8px;
8128
8136
  }
@@ -8130,6 +8138,7 @@ table {
8130
8138
  display: flex;
8131
8139
  flex-shrink: 0;
8132
8140
  justify-content: center;
8141
+ gap: 4px;
8133
8142
  margin-left: 8px;
8134
8143
  }
8135
8144
 
@@ -8147,6 +8156,7 @@ table {
8147
8156
  display: flex;
8148
8157
  flex-shrink: 0;
8149
8158
  justify-content: center;
8159
+ gap: 4px;
8150
8160
  width: 36px;
8151
8161
  margin-right: 16px;
8152
8162
  }
@@ -8154,6 +8164,7 @@ table {
8154
8164
  display: flex;
8155
8165
  flex-shrink: 0;
8156
8166
  justify-content: center;
8167
+ gap: 4px;
8157
8168
  margin-left: 16px;
8158
8169
  }
8159
8170
 
@@ -8171,6 +8182,7 @@ table {
8171
8182
  display: flex;
8172
8183
  flex-shrink: 0;
8173
8184
  justify-content: center;
8185
+ gap: 4px;
8174
8186
  width: 36px;
8175
8187
  margin-right: 16px;
8176
8188
  }
@@ -8178,6 +8190,7 @@ table {
8178
8190
  display: flex;
8179
8191
  flex-shrink: 0;
8180
8192
  justify-content: center;
8193
+ gap: 4px;
8181
8194
  margin-left: 16px;
8182
8195
  }
8183
8196
 
@@ -8194,6 +8207,7 @@ table {
8194
8207
  display: flex;
8195
8208
  flex-shrink: 0;
8196
8209
  justify-content: center;
8210
+ gap: 4px;
8197
8211
  width: 36px;
8198
8212
  margin-right: 16px;
8199
8213
  }
@@ -8201,6 +8215,7 @@ table {
8201
8215
  display: flex;
8202
8216
  flex-shrink: 0;
8203
8217
  justify-content: center;
8218
+ gap: 4px;
8204
8219
  margin-left: 16px;
8205
8220
  }
8206
8221
 
@@ -8255,17 +8270,17 @@ table {
8255
8270
  .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
8256
8271
  background-color: var(--lumx-color-primary-L3);
8257
8272
  }
8258
- .lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
8273
+ .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 {
8259
8274
  background-color: var(--lumx-color-primary-L5);
8260
8275
  }
8261
- .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 {
8276
+ .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 {
8262
8277
  background-color: var(--lumx-color-primary-L4);
8263
8278
  }
8264
8279
  @media (hover: hover) {
8265
- .lumx-list-item .lumx-action-area__action[aria-selected=true]:hover::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:hover::before {
8280
+ .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 {
8266
8281
  background-color: var(--lumx-color-primary-L4);
8267
8282
  }}
8268
- .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 {
8283
+ .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 {
8269
8284
  background-color: var(--lumx-color-primary-L3);
8270
8285
  }
8271
8286
  .lumx-list-item__link--is-disabled, .lumx-list-item__link[aria-disabled=true], .lumx-list-item:has(.lumx-action-area__action[aria-disabled=true]) {
@@ -17,6 +17,11 @@ export interface ComboboxListProps 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 ComboboxOption elements). */
21
26
  children?: JSXElement;
22
27
  /** The ID of the listbox element. */
@@ -9,7 +9,7 @@ type RenderResult = {
9
9
  */
10
10
  export interface ComboboxOptionTestSetup {
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.
@@ -0,0 +1,13 @@
1
+ export interface ComboboxSelectionIconProps {
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 ComboboxSelectionIcon: ({ selectionType, isSelected }: ComboboxSelectionIconProps) => import("react").JSX.Element | null;
@@ -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
  };
@@ -9,6 +9,7 @@ export interface ComboboxNamespace {
9
9
  OptionAction: any;
10
10
  OptionMoreInfo: any;
11
11
  OptionSkeleton: any;
12
+ SelectionIcon: any;
12
13
  Popover: any;
13
14
  Section: any;
14
15
  State: any;
@@ -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
  *
@@ -74,6 +75,7 @@ export interface BaseSelectComponents {
74
75
  Option: any;
75
76
  State: any;
76
77
  OptionSkeleton: any;
78
+ SelectionIcon: any;
77
79
  };
78
80
  /** Framework-specific InfiniteScroll component (handles IntersectionObserver lifecycle). */
79
81
  InfiniteScroll?: any;
@@ -237,6 +239,8 @@ export interface BaseSelectTextFieldWrapperProps<O> extends Pick<BaseSelectProps
237
239
  maxLength?: number;
238
240
  /** Accessible label for the input element (overrides the visual label for screen readers). */
239
241
  ariaLabel?: string;
242
+ /** Additional props forwarded to the field label (e.g. `className: 'visually-hidden'`, `typography`). */
243
+ labelProps?: Partial<Omit<InputLabelProps, 'children' | 'htmlFor' | 'id'>>;
240
244
  /** Additional props forwarded to the Combobox.Input (and ultimately to TextField). */
241
245
  inputProps?: Record<string, any>;
242
246
  /** Props forwarded to the Combobox.Popover. */
package/lumx.css CHANGED
@@ -5757,6 +5757,13 @@ table {
5757
5757
  .lumx-combobox-option-skeleton:nth-child(3n+2) .lumx-skeleton-typography {
5758
5758
  width: min(55%, 170px);
5759
5759
  }
5760
+ .lumx-combobox-option__selection-icon {
5761
+ margin: auto;
5762
+ }
5763
+ .lumx-combobox-option .lumx-list-item__wrapper,
5764
+ .lumx-combobox-option .lumx-list-item__content {
5765
+ min-width: 0;
5766
+ }
5760
5767
  .lumx-combobox-option .lumx-list-item__content {
5761
5768
  display: flex;
5762
5769
  flex-direction: column;
@@ -8804,6 +8811,7 @@ table {
8804
8811
  display: flex;
8805
8812
  flex-shrink: 0;
8806
8813
  justify-content: center;
8814
+ gap: 4px;
8807
8815
  width: 24px;
8808
8816
  margin-right: 8px;
8809
8817
  }
@@ -8811,6 +8819,7 @@ table {
8811
8819
  display: flex;
8812
8820
  flex-shrink: 0;
8813
8821
  justify-content: center;
8822
+ gap: 4px;
8814
8823
  margin-left: 8px;
8815
8824
  }
8816
8825
 
@@ -8828,6 +8837,7 @@ table {
8828
8837
  display: flex;
8829
8838
  flex-shrink: 0;
8830
8839
  justify-content: center;
8840
+ gap: 4px;
8831
8841
  width: 36px;
8832
8842
  margin-right: 16px;
8833
8843
  }
@@ -8835,6 +8845,7 @@ table {
8835
8845
  display: flex;
8836
8846
  flex-shrink: 0;
8837
8847
  justify-content: center;
8848
+ gap: 4px;
8838
8849
  margin-left: 16px;
8839
8850
  }
8840
8851
 
@@ -8852,6 +8863,7 @@ table {
8852
8863
  display: flex;
8853
8864
  flex-shrink: 0;
8854
8865
  justify-content: center;
8866
+ gap: 4px;
8855
8867
  width: 36px;
8856
8868
  margin-right: 16px;
8857
8869
  }
@@ -8859,6 +8871,7 @@ table {
8859
8871
  display: flex;
8860
8872
  flex-shrink: 0;
8861
8873
  justify-content: center;
8874
+ gap: 4px;
8862
8875
  margin-left: 16px;
8863
8876
  }
8864
8877
 
@@ -8875,6 +8888,7 @@ table {
8875
8888
  display: flex;
8876
8889
  flex-shrink: 0;
8877
8890
  justify-content: center;
8891
+ gap: 4px;
8878
8892
  width: 36px;
8879
8893
  margin-right: 16px;
8880
8894
  }
@@ -8882,6 +8896,7 @@ table {
8882
8896
  display: flex;
8883
8897
  flex-shrink: 0;
8884
8898
  justify-content: center;
8899
+ gap: 4px;
8885
8900
  margin-left: 16px;
8886
8901
  }
8887
8902
 
@@ -8936,17 +8951,17 @@ table {
8936
8951
  .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
8937
8952
  background-color: var(--lumx-color-primary-L3);
8938
8953
  }
8939
- .lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
8954
+ .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 {
8940
8955
  background-color: var(--lumx-color-primary-L5);
8941
8956
  }
8942
- .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 {
8957
+ .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 {
8943
8958
  background-color: var(--lumx-color-primary-L4);
8944
8959
  }
8945
8960
  @media (hover: hover) {
8946
- .lumx-list-item .lumx-action-area__action[aria-selected=true]:hover::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action:hover::before {
8961
+ .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 {
8947
8962
  background-color: var(--lumx-color-primary-L4);
8948
8963
  }}
8949
- .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 {
8964
+ .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 {
8950
8965
  background-color: var(--lumx-color-primary-L3);
8951
8966
  }
8952
8967
  .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-next.2",
10
+ "@lumx/icons": "^4.26.0-next.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.1-next.2",
69
+ "version": "4.26.0-next.1",
70
70
  "devDependencies": {
71
71
  "@rollup/plugin-typescript": "^12.3.0",
72
72
  "@testing-library/dom": "^10.4.1",
@@ -70,6 +70,17 @@
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
+
78
+ // Allow flex items to shrink below their content width so `truncate` text shows an ellipsis
79
+ .#{$lumx-base-prefix}-list-item__wrapper,
80
+ .#{$lumx-base-prefix}-list-item__content {
81
+ min-width: 0;
82
+ }
83
+
73
84
  // Center option content
74
85
  .#{$lumx-base-prefix}-list-item__content {
75
86
  display: flex;
@@ -45,9 +45,11 @@
45
45
  @include lumx-list-item-selected;
46
46
  }
47
47
 
48
- // Selected action: from `aria-selected` on the action (ex: combobox option) or from `isSelected` on the list item.
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");
@@ -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) {