@lumx/core 4.19.1-next.0 → 4.20.0-next.0

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.
@@ -11121,7 +11121,10 @@ table {
11121
11121
  position: relative;
11122
11122
  display: flex;
11123
11123
  }
11124
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) {
11124
+ .lumx-tabs__link {
11125
+ text-decoration: none;
11126
+ }
11127
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) {
11125
11128
  position: relative;
11126
11129
  display: flex;
11127
11130
  align-items: center;
@@ -11135,7 +11138,7 @@ table {
11135
11138
  transition-duration: 150ms;
11136
11139
  transition-property: border-radius, background-color, color;
11137
11140
  }
11138
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)::after {
11141
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)::after {
11139
11142
  position: absolute;
11140
11143
  top: 0;
11141
11144
  right: 0;
@@ -11150,76 +11153,76 @@ table {
11150
11153
  transition-property: border-radius, border-width, border-color;
11151
11154
  }
11152
11155
  @media (hover: hover) {
11153
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover::after {
11156
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover::after {
11154
11157
  border-width: var(--lumx-tabs-link-emphasis-low-state-hover-border-top-width) var(--lumx-tabs-link-emphasis-low-state-hover-border-right-width) var(--lumx-tabs-link-emphasis-low-state-hover-border-bottom-width) var(--lumx-tabs-link-emphasis-low-state-hover-border-left-width);
11155
11158
  }}
11156
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active::after {
11159
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active::after {
11157
11160
  border-width: var(--lumx-tabs-link-emphasis-low-state-active-border-top-width) var(--lumx-tabs-link-emphasis-low-state-active-border-right-width) var(--lumx-tabs-link-emphasis-low-state-active-border-bottom-width) var(--lumx-tabs-link-emphasis-low-state-active-border-left-width);
11158
11161
  }
11159
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) i {
11162
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) i {
11160
11163
  margin-right: 8px;
11161
11164
  }
11162
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) span {
11165
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) span {
11163
11166
  font-family: var(--lumx-typography-custom-button-size-m-font-family);
11164
11167
  font-size: var(--lumx-typography-custom-button-size-m-font-size);
11165
11168
  font-weight: var(--lumx-typography-custom-button-size-m-font-weight);
11166
11169
  text-transform: var(--lumx-material-button-text-transform);
11167
11170
  }
11168
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) {
11171
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) {
11169
11172
  color: var(--lumx-tabs-link-emphasis-low-state-default-theme-light-color);
11170
11173
  background-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-light-background-color);
11171
11174
  }
11172
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)::after {
11175
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)::after {
11173
11176
  border-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-light-border-color);
11174
11177
  }
11175
11178
  @media (hover: hover) {
11176
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover {
11179
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover {
11177
11180
  color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-light-color);
11178
11181
  background-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-light-background-color);
11179
11182
  }}
11180
11183
  @media (hover: hover) {
11181
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover::after {
11184
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover::after {
11182
11185
  border-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-light-border-color);
11183
11186
  }}
11184
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active {
11187
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active {
11185
11188
  color: var(--lumx-tabs-link-emphasis-low-state-active-theme-light-color);
11186
11189
  background-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-light-background-color);
11187
11190
  }
11188
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active::after {
11191
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active::after {
11189
11192
  border-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-light-border-color);
11190
11193
  }
11191
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11194
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11192
11195
  outline: 2px solid var(--lumx-color-dark-N);
11193
11196
  outline-offset: 2px;
11194
11197
  }
11195
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) {
11198
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) {
11196
11199
  color: var(--lumx-tabs-link-emphasis-low-state-default-theme-dark-color);
11197
11200
  background-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-dark-background-color);
11198
11201
  }
11199
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)::after {
11202
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)::after {
11200
11203
  border-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-dark-border-color);
11201
11204
  }
11202
11205
  @media (hover: hover) {
11203
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover {
11206
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover {
11204
11207
  color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-dark-color);
11205
11208
  background-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-dark-background-color);
11206
11209
  }}
11207
11210
  @media (hover: hover) {
11208
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover::after {
11211
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover::after {
11209
11212
  border-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-dark-border-color);
11210
11213
  }}
11211
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active {
11214
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active {
11212
11215
  color: var(--lumx-tabs-link-emphasis-low-state-active-theme-dark-color);
11213
11216
  background-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-dark-background-color);
11214
11217
  }
11215
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active::after {
11218
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active::after {
11216
11219
  border-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-dark-border-color);
11217
11220
  }
11218
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11221
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11219
11222
  outline: 2px solid var(--lumx-color-light-N);
11220
11223
  outline-offset: 2px;
11221
11224
  }
11222
- .lumx-tabs__link--is-active {
11225
+ .lumx-tabs__link--is-active, .lumx-tabs__link[aria-current=page] {
11223
11226
  position: relative;
11224
11227
  display: flex;
11225
11228
  align-items: center;
@@ -11233,7 +11236,7 @@ table {
11233
11236
  transition-duration: 150ms;
11234
11237
  transition-property: border-radius, background-color, color;
11235
11238
  }
11236
- .lumx-tabs__link--is-active::after {
11239
+ .lumx-tabs__link--is-active::after, .lumx-tabs__link[aria-current=page]::after {
11237
11240
  position: absolute;
11238
11241
  top: 0;
11239
11242
  right: 0;
@@ -11248,72 +11251,72 @@ table {
11248
11251
  transition-property: border-radius, border-width, border-color;
11249
11252
  }
11250
11253
  @media (hover: hover) {
11251
- .lumx-tabs__link--is-active:hover::after {
11254
+ .lumx-tabs__link--is-active:hover::after, .lumx-tabs__link[aria-current=page]:hover::after {
11252
11255
  border-width: var(--lumx-tabs-link-emphasis-selected-state-hover-border-top-width) var(--lumx-tabs-link-emphasis-selected-state-hover-border-right-width) var(--lumx-tabs-link-emphasis-selected-state-hover-border-bottom-width) var(--lumx-tabs-link-emphasis-selected-state-hover-border-left-width);
11253
11256
  }}
11254
- .lumx-tabs__link--is-active:active::after {
11257
+ .lumx-tabs__link--is-active:active::after, .lumx-tabs__link[aria-current=page]:active::after {
11255
11258
  border-width: var(--lumx-tabs-link-emphasis-selected-state-active-border-top-width) var(--lumx-tabs-link-emphasis-selected-state-active-border-right-width) var(--lumx-tabs-link-emphasis-selected-state-active-border-bottom-width) var(--lumx-tabs-link-emphasis-selected-state-active-border-left-width);
11256
11259
  }
11257
- .lumx-tabs__link--is-active i {
11260
+ .lumx-tabs__link--is-active i, .lumx-tabs__link[aria-current=page] i {
11258
11261
  margin-right: 8px;
11259
11262
  }
11260
- .lumx-tabs__link--is-active span {
11263
+ .lumx-tabs__link--is-active span, .lumx-tabs__link[aria-current=page] span {
11261
11264
  font-family: var(--lumx-typography-custom-button-size-m-font-family);
11262
11265
  font-size: var(--lumx-typography-custom-button-size-m-font-size);
11263
11266
  font-weight: var(--lumx-typography-custom-button-size-m-font-weight);
11264
11267
  text-transform: var(--lumx-material-button-text-transform);
11265
11268
  }
11266
- .lumx-tabs--theme-light .lumx-tabs__link--is-active {
11269
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page] {
11267
11270
  color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-light-color);
11268
11271
  background-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-light-background-color);
11269
11272
  }
11270
- .lumx-tabs--theme-light .lumx-tabs__link--is-active::after {
11273
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active::after, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]::after {
11271
11274
  border-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-light-border-color);
11272
11275
  }
11273
11276
  @media (hover: hover) {
11274
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover {
11277
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:hover {
11275
11278
  color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-light-color);
11276
11279
  background-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-light-background-color);
11277
11280
  }}
11278
11281
  @media (hover: hover) {
11279
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover::after {
11282
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover::after, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:hover::after {
11280
11283
  border-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-light-border-color);
11281
11284
  }}
11282
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:active {
11285
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:active, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:active {
11283
11286
  color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-light-color);
11284
11287
  background-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-light-background-color);
11285
11288
  }
11286
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:active::after {
11289
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:active::after, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:active::after {
11287
11290
  border-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-light-border-color);
11288
11291
  }
11289
- .lumx-tabs--theme-light .lumx-tabs__link--is-active[data-focus-visible-added] {
11292
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active[data-focus-visible-added], .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page][data-focus-visible-added] {
11290
11293
  outline: 2px solid var(--lumx-color-dark-N);
11291
11294
  outline-offset: 2px;
11292
11295
  }
11293
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active {
11296
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page] {
11294
11297
  color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-dark-color);
11295
11298
  background-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-dark-background-color);
11296
11299
  }
11297
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active::after {
11300
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active::after, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]::after {
11298
11301
  border-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-dark-border-color);
11299
11302
  }
11300
11303
  @media (hover: hover) {
11301
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover {
11304
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:hover {
11302
11305
  color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-dark-color);
11303
11306
  background-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-dark-background-color);
11304
11307
  }}
11305
11308
  @media (hover: hover) {
11306
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover::after {
11309
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover::after, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:hover::after {
11307
11310
  border-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-dark-border-color);
11308
11311
  }}
11309
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active {
11312
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:active {
11310
11313
  color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-dark-color);
11311
11314
  background-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-dark-background-color);
11312
11315
  }
11313
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active::after {
11316
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active::after, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:active::after {
11314
11317
  border-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-dark-border-color);
11315
11318
  }
11316
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active[data-focus-visible-added] {
11319
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active[data-focus-visible-added], .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page][data-focus-visible-added] {
11317
11320
  outline: 2px solid var(--lumx-color-light-N);
11318
11321
  outline-offset: 2px;
11319
11322
  }
@@ -1,9 +1,14 @@
1
- import { CommonRef, HasClassName, JSXElement } from '../../types';
1
+ import { CommonRef, ElementType, HasClassName, HasRequiredLinkHref, JSXElement } from '../../types';
2
2
  import { IconProps } from '../Icon';
3
3
  /**
4
- * Defines the props of the component.
4
+ * Element a `Tab` can render as: `'button'` (default, classic tab), `'a'` (nav-link, `href`
5
+ * required via {@link HasRequiredLinkHref}), or any `ElementType` (nav-link, e.g. a router `Link`).
5
6
  */
6
- export interface TabProps extends HasClassName {
7
+ export type TabElement = 'a' | 'button' | ElementType;
8
+ /**
9
+ * Defines the props of the component (independent of the `as` element).
10
+ */
11
+ export interface CommonTabProps extends HasClassName {
7
12
  /** Children are not supported. */
8
13
  children?: never;
9
14
  /** Icon (SVG path). */
@@ -14,6 +19,11 @@ export interface TabProps extends HasClassName {
14
19
  id?: string;
15
20
  /** Whether the tab is active or not. */
16
21
  isActive?: boolean;
22
+ /**
23
+ * WAI-ARIA `tab` role, resolved by the framework wrapper from `TabProvider` presence:
24
+ * `'tab'` inside a provider (classic tab mode), `undefined` outside (nav-link mode).
25
+ */
26
+ role?: 'tab';
17
27
  /** Whether the component is disabled or not. */
18
28
  isDisabled?: boolean;
19
29
  /** Label content. */
@@ -34,18 +44,31 @@ export interface TabProps extends HasClassName {
34
44
  tabIndexProp?: string;
35
45
  /** Name of the prop used to attach the keypress event (framework-dependent). */
36
46
  keyPressProp?: string;
37
- /** ID applied to the tab button element (for aria-labelledby on the panel). */
38
- tabId?: string;
39
47
  /** ID of the associated tab panel (for aria-controls). */
40
48
  tabPanelId?: string;
41
49
  /** Icon component injected by the framework wrapper. */
42
50
  Icon: any;
43
51
  /** Text component injected by the framework wrapper. */
44
52
  Text: any;
45
- /** Forward ref to the underlying button element. */
53
+ /** Forward ref to the underlying element. */
46
54
  ref?: CommonRef;
47
55
  }
48
- export type TabPropsToOverride = 'isAnyDisabled' | 'shouldActivateOnFocus' | 'changeToTab' | 'tabIndex' | 'tabIndexProp' | 'keyPressProp' | 'tabId' | 'tabPanelId' | 'Icon' | 'Text';
56
+ /**
57
+ * Polymorphic `as` surface for `Tab`. Not `HasPolymorphicAs<E>`: core JSX is type-checked under
58
+ * both the React and Vue namespaces, so spreading React DOM prop types would break the Vue
59
+ * cross-check. `href` is required at compile time when `as === 'a'` (via {@link HasRequiredLinkHref}).
60
+ */
61
+ export type TabAsProps<E extends TabElement = 'button'> = {
62
+ as?: E;
63
+ } & (E extends 'a' ? HasRequiredLinkHref<'a'> : unknown);
64
+ /**
65
+ * Props of the `Tab` component. Polymorphic on `as` (element selection only): `as` picks the
66
+ * rendered element, while **mode is driven by `TabProvider` presence** (via the wrapper-resolved
67
+ * `role`), not by `as`. The `href` conditional's false branch is `unknown` (not a record) to avoid
68
+ * widening `keyof TabProps`.
69
+ */
70
+ export type TabProps<E extends TabElement = 'button'> = CommonTabProps & TabAsProps<E>;
71
+ export type TabPropsToOverride = 'as' | 'role' | 'isAnyDisabled' | 'shouldActivateOnFocus' | 'changeToTab' | 'tabIndex' | 'tabIndexProp' | 'keyPressProp' | 'tabPanelId' | 'Icon' | 'Text';
49
72
  /**
50
73
  * Component display name.
51
74
  */
@@ -59,12 +82,14 @@ export declare const DEFAULT_PROPS: Partial<TabProps>;
59
82
  */
60
83
  export declare const CLASSNAME = "lumx-tabs__link";
61
84
  /**
62
- * Tab component.
63
- *
64
- * Implements WAI-ARIA `tab` role {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label}
85
+ * Tab component. Two modes keyed on `TabProvider` presence (via the wrapper-resolved `role`):
86
+ * tab mode (`role === 'tab'`, inside a provider) implements the WAI-ARIA `tab` role
87
+ * {@see https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-1/tabs.html#rps_label};
88
+ * nav-link mode (no provider) renders plain link semantics (`aria-current`, no tab role/aria).
89
+ * `as` only selects the rendered element and applies in both modes.
65
90
  *
66
91
  * @param props Component props.
67
92
  * @param ref Component ref.
68
93
  * @return React element.
69
94
  */
70
- export declare const Tab: (props: TabProps) => import("react").JSX.Element;
95
+ export declare const Tab: <E extends TabElement = "button">(props: TabProps<E>) => import("react").JSX.Element;
@@ -16,9 +16,12 @@ export interface TabListProps extends HasClassName, HasTheme {
16
16
  layout?: TabListLayout;
17
17
  /** Position of the tabs in the list (requires 'clustered' layout). */
18
18
  position?: Alignment;
19
+ /** `role` applied to the inner `__links` container */
20
+ role?: 'navigation' | 'tablist';
19
21
  /** ref to the wrapper element */
20
22
  ref?: CommonRef;
21
23
  }
24
+ export type TabListPropsToOverride = 'role';
22
25
  /**
23
26
  * Component display name.
24
27
  */
package/lumx.css CHANGED
@@ -11802,7 +11802,10 @@ table {
11802
11802
  position: relative;
11803
11803
  display: flex;
11804
11804
  }
11805
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) {
11805
+ .lumx-tabs__link {
11806
+ text-decoration: none;
11807
+ }
11808
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) {
11806
11809
  position: relative;
11807
11810
  display: flex;
11808
11811
  align-items: center;
@@ -11816,7 +11819,7 @@ table {
11816
11819
  transition-duration: 150ms;
11817
11820
  transition-property: border-radius, background-color, color;
11818
11821
  }
11819
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)::after {
11822
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)::after {
11820
11823
  position: absolute;
11821
11824
  top: 0;
11822
11825
  right: 0;
@@ -11831,76 +11834,76 @@ table {
11831
11834
  transition-property: border-radius, border-width, border-color;
11832
11835
  }
11833
11836
  @media (hover: hover) {
11834
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover::after {
11837
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover::after {
11835
11838
  border-width: var(--lumx-tabs-link-emphasis-low-state-hover-border-top-width) var(--lumx-tabs-link-emphasis-low-state-hover-border-right-width) var(--lumx-tabs-link-emphasis-low-state-hover-border-bottom-width) var(--lumx-tabs-link-emphasis-low-state-hover-border-left-width);
11836
11839
  }}
11837
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active::after {
11840
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active::after {
11838
11841
  border-width: var(--lumx-tabs-link-emphasis-low-state-active-border-top-width) var(--lumx-tabs-link-emphasis-low-state-active-border-right-width) var(--lumx-tabs-link-emphasis-low-state-active-border-bottom-width) var(--lumx-tabs-link-emphasis-low-state-active-border-left-width);
11839
11842
  }
11840
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) i {
11843
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) i {
11841
11844
  margin-right: 8px;
11842
11845
  }
11843
- .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) span {
11846
+ .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) span {
11844
11847
  font-family: var(--lumx-typography-custom-button-size-m-font-family);
11845
11848
  font-size: var(--lumx-typography-custom-button-size-m-font-size);
11846
11849
  font-weight: var(--lumx-typography-custom-button-size-m-font-weight);
11847
11850
  text-transform: var(--lumx-material-button-text-transform);
11848
11851
  }
11849
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) {
11852
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) {
11850
11853
  color: var(--lumx-tabs-link-emphasis-low-state-default-theme-light-color);
11851
11854
  background-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-light-background-color);
11852
11855
  }
11853
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)::after {
11856
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)::after {
11854
11857
  border-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-light-border-color);
11855
11858
  }
11856
11859
  @media (hover: hover) {
11857
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover {
11860
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover {
11858
11861
  color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-light-color);
11859
11862
  background-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-light-background-color);
11860
11863
  }}
11861
11864
  @media (hover: hover) {
11862
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover::after {
11865
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover::after {
11863
11866
  border-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-light-border-color);
11864
11867
  }}
11865
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active {
11868
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active {
11866
11869
  color: var(--lumx-tabs-link-emphasis-low-state-active-theme-light-color);
11867
11870
  background-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-light-background-color);
11868
11871
  }
11869
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active::after {
11872
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active::after {
11870
11873
  border-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-light-border-color);
11871
11874
  }
11872
- .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11875
+ .lumx-tabs--theme-light .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11873
11876
  outline: 2px solid var(--lumx-color-dark-N);
11874
11877
  outline-offset: 2px;
11875
11878
  }
11876
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled) {
11879
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled) {
11877
11880
  color: var(--lumx-tabs-link-emphasis-low-state-default-theme-dark-color);
11878
11881
  background-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-dark-background-color);
11879
11882
  }
11880
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)::after {
11883
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)::after {
11881
11884
  border-color: var(--lumx-tabs-link-emphasis-low-state-default-theme-dark-border-color);
11882
11885
  }
11883
11886
  @media (hover: hover) {
11884
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover {
11887
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover {
11885
11888
  color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-dark-color);
11886
11889
  background-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-dark-background-color);
11887
11890
  }}
11888
11891
  @media (hover: hover) {
11889
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):hover::after {
11892
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):hover::after {
11890
11893
  border-color: var(--lumx-tabs-link-emphasis-low-state-hover-theme-dark-border-color);
11891
11894
  }}
11892
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active {
11895
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active {
11893
11896
  color: var(--lumx-tabs-link-emphasis-low-state-active-theme-dark-color);
11894
11897
  background-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-dark-background-color);
11895
11898
  }
11896
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled):active::after {
11899
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled):active::after {
11897
11900
  border-color: var(--lumx-tabs-link-emphasis-low-state-active-theme-dark-border-color);
11898
11901
  }
11899
- .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11902
+ .lumx-tabs--theme-dark .lumx-tabs__link:not(.lumx-tabs__link--is-active):not([aria-current=page]):not(.lumx-tabs__link--is-disabled)[data-focus-visible-added] {
11900
11903
  outline: 2px solid var(--lumx-color-light-N);
11901
11904
  outline-offset: 2px;
11902
11905
  }
11903
- .lumx-tabs__link--is-active {
11906
+ .lumx-tabs__link--is-active, .lumx-tabs__link[aria-current=page] {
11904
11907
  position: relative;
11905
11908
  display: flex;
11906
11909
  align-items: center;
@@ -11914,7 +11917,7 @@ table {
11914
11917
  transition-duration: 150ms;
11915
11918
  transition-property: border-radius, background-color, color;
11916
11919
  }
11917
- .lumx-tabs__link--is-active::after {
11920
+ .lumx-tabs__link--is-active::after, .lumx-tabs__link[aria-current=page]::after {
11918
11921
  position: absolute;
11919
11922
  top: 0;
11920
11923
  right: 0;
@@ -11929,72 +11932,72 @@ table {
11929
11932
  transition-property: border-radius, border-width, border-color;
11930
11933
  }
11931
11934
  @media (hover: hover) {
11932
- .lumx-tabs__link--is-active:hover::after {
11935
+ .lumx-tabs__link--is-active:hover::after, .lumx-tabs__link[aria-current=page]:hover::after {
11933
11936
  border-width: var(--lumx-tabs-link-emphasis-selected-state-hover-border-top-width) var(--lumx-tabs-link-emphasis-selected-state-hover-border-right-width) var(--lumx-tabs-link-emphasis-selected-state-hover-border-bottom-width) var(--lumx-tabs-link-emphasis-selected-state-hover-border-left-width);
11934
11937
  }}
11935
- .lumx-tabs__link--is-active:active::after {
11938
+ .lumx-tabs__link--is-active:active::after, .lumx-tabs__link[aria-current=page]:active::after {
11936
11939
  border-width: var(--lumx-tabs-link-emphasis-selected-state-active-border-top-width) var(--lumx-tabs-link-emphasis-selected-state-active-border-right-width) var(--lumx-tabs-link-emphasis-selected-state-active-border-bottom-width) var(--lumx-tabs-link-emphasis-selected-state-active-border-left-width);
11937
11940
  }
11938
- .lumx-tabs__link--is-active i {
11941
+ .lumx-tabs__link--is-active i, .lumx-tabs__link[aria-current=page] i {
11939
11942
  margin-right: 8px;
11940
11943
  }
11941
- .lumx-tabs__link--is-active span {
11944
+ .lumx-tabs__link--is-active span, .lumx-tabs__link[aria-current=page] span {
11942
11945
  font-family: var(--lumx-typography-custom-button-size-m-font-family);
11943
11946
  font-size: var(--lumx-typography-custom-button-size-m-font-size);
11944
11947
  font-weight: var(--lumx-typography-custom-button-size-m-font-weight);
11945
11948
  text-transform: var(--lumx-material-button-text-transform);
11946
11949
  }
11947
- .lumx-tabs--theme-light .lumx-tabs__link--is-active {
11950
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page] {
11948
11951
  color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-light-color);
11949
11952
  background-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-light-background-color);
11950
11953
  }
11951
- .lumx-tabs--theme-light .lumx-tabs__link--is-active::after {
11954
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active::after, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]::after {
11952
11955
  border-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-light-border-color);
11953
11956
  }
11954
11957
  @media (hover: hover) {
11955
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover {
11958
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:hover {
11956
11959
  color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-light-color);
11957
11960
  background-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-light-background-color);
11958
11961
  }}
11959
11962
  @media (hover: hover) {
11960
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover::after {
11963
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:hover::after, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:hover::after {
11961
11964
  border-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-light-border-color);
11962
11965
  }}
11963
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:active {
11966
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:active, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:active {
11964
11967
  color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-light-color);
11965
11968
  background-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-light-background-color);
11966
11969
  }
11967
- .lumx-tabs--theme-light .lumx-tabs__link--is-active:active::after {
11970
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active:active::after, .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page]:active::after {
11968
11971
  border-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-light-border-color);
11969
11972
  }
11970
- .lumx-tabs--theme-light .lumx-tabs__link--is-active[data-focus-visible-added] {
11973
+ .lumx-tabs--theme-light .lumx-tabs__link--is-active[data-focus-visible-added], .lumx-tabs--theme-light .lumx-tabs__link[aria-current=page][data-focus-visible-added] {
11971
11974
  outline: 2px solid var(--lumx-color-dark-N);
11972
11975
  outline-offset: 2px;
11973
11976
  }
11974
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active {
11977
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page] {
11975
11978
  color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-dark-color);
11976
11979
  background-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-dark-background-color);
11977
11980
  }
11978
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active::after {
11981
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active::after, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]::after {
11979
11982
  border-color: var(--lumx-tabs-link-emphasis-selected-state-default-theme-dark-border-color);
11980
11983
  }
11981
11984
  @media (hover: hover) {
11982
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover {
11985
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:hover {
11983
11986
  color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-dark-color);
11984
11987
  background-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-dark-background-color);
11985
11988
  }}
11986
11989
  @media (hover: hover) {
11987
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover::after {
11990
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:hover::after, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:hover::after {
11988
11991
  border-color: var(--lumx-tabs-link-emphasis-selected-state-hover-theme-dark-border-color);
11989
11992
  }}
11990
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active {
11993
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:active {
11991
11994
  color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-dark-color);
11992
11995
  background-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-dark-background-color);
11993
11996
  }
11994
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active::after {
11997
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active:active::after, .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page]:active::after {
11995
11998
  border-color: var(--lumx-tabs-link-emphasis-selected-state-active-theme-dark-border-color);
11996
11999
  }
11997
- .lumx-tabs--theme-dark .lumx-tabs__link--is-active[data-focus-visible-added] {
12000
+ .lumx-tabs--theme-dark .lumx-tabs__link--is-active[data-focus-visible-added], .lumx-tabs--theme-dark .lumx-tabs__link[aria-current=page][data-focus-visible-added] {
11998
12001
  outline: 2px solid var(--lumx-color-light-N);
11999
12002
  outline-offset: 2px;
12000
12003
  }
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.19.1-next.0",
10
+ "@lumx/icons": "^4.20.0-next.0",
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.19.1-next.0",
69
+ "version": "4.20.0-next.0",
70
70
  "devDependencies": {
71
71
  "@rollup/plugin-typescript": "^12.3.0",
72
72
  "@testing-library/dom": "^10.4.1",
@@ -16,7 +16,9 @@
16
16
  }
17
17
 
18
18
  &__link {
19
- &:not(&--is-active):not(&--is-disabled) {
19
+ text-decoration: none;
20
+
21
+ &:not(&--is-active):not([aria-current="page"]):not(&--is-disabled) {
20
22
  @include lumx-tabs-link(lumx-base-const("emphasis", "LOW"));
21
23
 
22
24
  #{$self}--theme-light & {
@@ -28,7 +30,8 @@
28
30
  }
29
31
  }
30
32
 
31
- &--is-active {
33
+ &--is-active,
34
+ &[aria-current="page"] {
32
35
  @include lumx-tabs-link(lumx-base-const("emphasis", "SELECTED"));
33
36
 
34
37
  #{$self}--theme-light & {