@lumx/core 4.25.1-next.0 → 4.25.1-next.2

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
  ========================================================================== */
@@ -8234,25 +8241,41 @@ table {
8234
8241
  .lumx-list-item__link--is-highlighted:active {
8235
8242
  background-color: var(--lumx-color-dark-L4);
8236
8243
  }
8237
- .lumx-list-item__link--is-selected, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before {
8244
+ .lumx-list-item__link--is-selected {
8238
8245
  color: var(--lumx-color-primary-D2);
8239
8246
  background-color: var(--lumx-color-primary-L5);
8240
8247
  }
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] {
8248
+ .lumx-list-item__link--is-selected[data-lumx-hover], .lumx-list-item__link--is-selected[data-focus-visible-added] {
8242
8249
  background-color: var(--lumx-color-primary-L4);
8243
8250
  }
8244
8251
  @media (hover: hover) {
8245
- .lumx-list-item__link--is-selected:hover, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before:hover {
8252
+ .lumx-list-item__link--is-selected:hover {
8246
8253
  background-color: var(--lumx-color-primary-L4);
8247
8254
  }}
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] {
8255
+ .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
8256
+ background-color: var(--lumx-color-primary-L3);
8257
+ }
8258
+ .lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
8259
+ background-color: var(--lumx-color-primary-L5);
8260
+ }
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 {
8262
+ background-color: var(--lumx-color-primary-L4);
8263
+ }
8264
+ @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 {
8266
+ background-color: var(--lumx-color-primary-L4);
8267
+ }}
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 {
8249
8269
  background-color: var(--lumx-color-primary-L3);
8250
8270
  }
8251
8271
  .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
8272
  opacity: 0.5;
8253
8273
  cursor: default;
8254
8274
  }
8255
- .lumx-list-item__before, .lumx-list-item__after {
8275
+ .lumx-list-item:has(.lumx-action-area__action) {
8276
+ position: relative;
8277
+ }
8278
+ :where(.lumx-list-item:has(.lumx-action-area__action)) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
8256
8279
  position: relative;
8257
8280
  z-index: 1;
8258
8281
  }
@@ -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
+ };
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
  ========================================================================== */
@@ -8915,25 +8922,41 @@ table {
8915
8922
  .lumx-list-item__link--is-highlighted:active {
8916
8923
  background-color: var(--lumx-color-dark-L4);
8917
8924
  }
8918
- .lumx-list-item__link--is-selected, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before {
8925
+ .lumx-list-item__link--is-selected {
8919
8926
  color: var(--lumx-color-primary-D2);
8920
8927
  background-color: var(--lumx-color-primary-L5);
8921
8928
  }
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] {
8929
+ .lumx-list-item__link--is-selected[data-lumx-hover], .lumx-list-item__link--is-selected[data-focus-visible-added] {
8923
8930
  background-color: var(--lumx-color-primary-L4);
8924
8931
  }
8925
8932
  @media (hover: hover) {
8926
- .lumx-list-item__link--is-selected:hover, .lumx-list-item .lumx-action-area__action[aria-selected=true]::before:hover {
8933
+ .lumx-list-item__link--is-selected:hover {
8927
8934
  background-color: var(--lumx-color-primary-L4);
8928
8935
  }}
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] {
8936
+ .lumx-list-item__link--is-selected:active, .lumx-list-item__link--is-selected[data-lumx-active] {
8937
+ background-color: var(--lumx-color-primary-L3);
8938
+ }
8939
+ .lumx-list-item .lumx-action-area__action[aria-selected=true]::before, .lumx-list-item__wrapper--is-selected .lumx-action-area__action::before {
8940
+ background-color: var(--lumx-color-primary-L5);
8941
+ }
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 {
8943
+ background-color: var(--lumx-color-primary-L4);
8944
+ }
8945
+ @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 {
8947
+ background-color: var(--lumx-color-primary-L4);
8948
+ }}
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 {
8930
8950
  background-color: var(--lumx-color-primary-L3);
8931
8951
  }
8932
8952
  .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
8953
  opacity: 0.5;
8934
8954
  cursor: default;
8935
8955
  }
8936
- .lumx-list-item__before, .lumx-list-item__after {
8956
+ .lumx-list-item:has(.lumx-action-area__action) {
8957
+ position: relative;
8958
+ }
8959
+ :where(.lumx-list-item:has(.lumx-action-area__action)) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
8937
8960
  position: relative;
8938
8961
  z-index: 1;
8939
8962
  }
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.0",
10
+ "@lumx/icons": "^4.25.1-next.2",
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.0",
69
+ "version": "4.25.1-next.2",
70
70
  "devDependencies": {
71
71
  "@rollup/plugin-typescript": "^12.3.0",
72
72
  "@testing-library/dom": "^10.4.1",
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";
@@ -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
 
@@ -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
+ }