@momentum-design/components 0.133.37 → 0.133.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +138 -142
- package/dist/browser/index.js.map +3 -3
- package/dist/components/tablist/tablist.component.d.ts +14 -0
- package/dist/components/tablist/tablist.component.js +17 -1
- package/dist/components/themeprovider/themeprovider.component.d.ts +0 -2
- package/dist/components/themeprovider/themeprovider.component.js +0 -2
- package/dist/components/themeprovider/themeprovider.styles.js +0 -4
- package/dist/custom-elements.json +30 -5
- package/dist/react/themeprovider/index.d.ts +0 -2
- package/dist/react/themeprovider/index.js +0 -2
- package/package.json +1 -1
|
@@ -121,6 +121,12 @@ declare class TabList extends TabList_base {
|
|
|
121
121
|
*/
|
|
122
122
|
protected firstUpdated(): Promise<void>;
|
|
123
123
|
disconnectedCallback(): void;
|
|
124
|
+
/**
|
|
125
|
+
* Override focus to delegate to the active tab.
|
|
126
|
+
* When a dialog focus-trap or any other caller invokes `.focus()` on the tablist host,
|
|
127
|
+
* focus is forwarded directly to the active tab instead of landing on the shadow host.
|
|
128
|
+
*/
|
|
129
|
+
focus(options?: FocusOptions): void;
|
|
124
130
|
/**
|
|
125
131
|
* When the tablist receives focus, then focus the active tab.
|
|
126
132
|
*
|
|
@@ -160,5 +166,13 @@ declare class TabList extends TabList_base {
|
|
|
160
166
|
private scrollTabs;
|
|
161
167
|
render(): import("lit-html").TemplateResult<1>;
|
|
162
168
|
static styles: Array<CSSResult>;
|
|
169
|
+
static shadowRootOptions: {
|
|
170
|
+
delegatesFocus: boolean;
|
|
171
|
+
clonable?: boolean;
|
|
172
|
+
customElementRegistry?: CustomElementRegistry;
|
|
173
|
+
mode: ShadowRootMode;
|
|
174
|
+
serializable?: boolean;
|
|
175
|
+
slotAssignment?: SlotAssignmentMode;
|
|
176
|
+
};
|
|
163
177
|
}
|
|
164
178
|
export default TabList;
|
|
@@ -199,6 +199,20 @@ class TabList extends ListNavigationMixin(CaptureDestroyEventForChildElement(Key
|
|
|
199
199
|
super.disconnectedCallback();
|
|
200
200
|
(_a = this.tabsContainer) === null || _a === void 0 ? void 0 : _a.removeEventListener('focusin', this.handleFocus);
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Override focus to delegate to the active tab.
|
|
204
|
+
* When a dialog focus-trap or any other caller invokes `.focus()` on the tablist host,
|
|
205
|
+
* focus is forwarded directly to the active tab instead of landing on the shadow host.
|
|
206
|
+
*/
|
|
207
|
+
focus(options) {
|
|
208
|
+
const activeTab = getActiveTab(this.navItems);
|
|
209
|
+
if (activeTab) {
|
|
210
|
+
activeTab.focus(options);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
super.focus(options);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
202
216
|
/**
|
|
203
217
|
* When the tablist receives focus, then focus the active tab.
|
|
204
218
|
*
|
|
@@ -208,7 +222,8 @@ class TabList extends ListNavigationMixin(CaptureDestroyEventForChildElement(Key
|
|
|
208
222
|
async handleFocus(event) {
|
|
209
223
|
/**
|
|
210
224
|
* If the element losing focus is a tab, do nothing.
|
|
211
|
-
* If the element gaining focus is not a tab
|
|
225
|
+
* If the element gaining focus is not a tab or the container itself (e.g., via delegatesFocus
|
|
226
|
+
* or a click on the container), do nothing — the focus() override handles the programmatic case.
|
|
212
227
|
* This also covers the case when previous focus was on a tab that belongs to another tablist.
|
|
213
228
|
*/
|
|
214
229
|
if (event.relatedTarget instanceof Tab || !(event.target instanceof Tab)) {
|
|
@@ -354,6 +369,7 @@ class TabList extends ListNavigationMixin(CaptureDestroyEventForChildElement(Key
|
|
|
354
369
|
}
|
|
355
370
|
}
|
|
356
371
|
TabList.styles = [...Component.styles, ...styles];
|
|
372
|
+
TabList.shadowRootOptions = { ...Component.shadowRootOptions, delegatesFocus: true };
|
|
357
373
|
__decorate([
|
|
358
374
|
property({ type: String, attribute: 'data-aria-label' }),
|
|
359
375
|
__metadata("design:type", String)
|
|
@@ -37,8 +37,6 @@ import ThemeProviderContext from './themeprovider.context';
|
|
|
37
37
|
* default: `Momentum` (from momentum-design/fonts)
|
|
38
38
|
* @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`
|
|
39
39
|
* default: `-0.25px` (this is to match the old CiscoSans)
|
|
40
|
-
* @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,
|
|
41
|
-
* default: `"ss02" on`
|
|
42
40
|
* @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.
|
|
43
41
|
* @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.
|
|
44
42
|
*/
|
|
@@ -48,8 +48,6 @@ import styles from './themeprovider.styles';
|
|
|
48
48
|
* default: `Momentum` (from momentum-design/fonts)
|
|
49
49
|
* @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`
|
|
50
50
|
* default: `-0.25px` (this is to match the old CiscoSans)
|
|
51
|
-
* @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,
|
|
52
|
-
* default: `"ss02" on`
|
|
53
51
|
* @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.
|
|
54
52
|
* @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.
|
|
55
53
|
*/
|
|
@@ -4,8 +4,6 @@ const styles = css `
|
|
|
4
4
|
--mdc-themeprovider-color-default: var(--mds-color-theme-text-primary-normal);
|
|
5
5
|
--mdc-themeprovider-font-family: var(--mds-font-family-primary);
|
|
6
6
|
--mdc-themeprovider-font-weight: 400;
|
|
7
|
-
/* Adjusting font feature settings for accessibility reasons */
|
|
8
|
-
--mdc-themeprovider-font-feature-settings: 'ss02' on;
|
|
9
7
|
|
|
10
8
|
/* Custom scrollbar variables */
|
|
11
9
|
--mdc-themeprovider-scrollbar-track-color: transparent;
|
|
@@ -14,8 +12,6 @@ const styles = css `
|
|
|
14
12
|
color: var(--mdc-themeprovider-color-default);
|
|
15
13
|
font-family: var(--mdc-themeprovider-font-family);
|
|
16
14
|
font-weight: var(--mdc-themeprovider-font-weight);
|
|
17
|
-
|
|
18
|
-
font-feature-settings: var(--mdc-themeprovider-font-feature-settings);
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
/** Scrollbar Theme for Chrome, Edge, and Firefox. This has limited support on other browsers.
|
|
@@ -46644,6 +46644,26 @@
|
|
|
46644
46644
|
"description": "Label for the tablist.\nThis is used when the tablist does not have a visible label.",
|
|
46645
46645
|
"attribute": "data-aria-label"
|
|
46646
46646
|
},
|
|
46647
|
+
{
|
|
46648
|
+
"kind": "method",
|
|
46649
|
+
"name": "focus",
|
|
46650
|
+
"privacy": "public",
|
|
46651
|
+
"return": {
|
|
46652
|
+
"type": {
|
|
46653
|
+
"text": "void"
|
|
46654
|
+
}
|
|
46655
|
+
},
|
|
46656
|
+
"parameters": [
|
|
46657
|
+
{
|
|
46658
|
+
"name": "options",
|
|
46659
|
+
"optional": true,
|
|
46660
|
+
"type": {
|
|
46661
|
+
"text": "FocusOptions"
|
|
46662
|
+
}
|
|
46663
|
+
}
|
|
46664
|
+
],
|
|
46665
|
+
"description": "Override focus to delegate to the active tab.\nWhen a dialog focus-trap or any other caller invokes `.focus()` on the tablist host,\nfocus is forwarded directly to the active tab instead of landing on the shadow host."
|
|
46666
|
+
},
|
|
46647
46667
|
{
|
|
46648
46668
|
"kind": "method",
|
|
46649
46669
|
"name": "getCurrentIndex",
|
|
@@ -46748,6 +46768,15 @@
|
|
|
46748
46768
|
"module": "utils/mixins/ListNavigationMixin.js"
|
|
46749
46769
|
}
|
|
46750
46770
|
},
|
|
46771
|
+
{
|
|
46772
|
+
"kind": "field",
|
|
46773
|
+
"name": "shadowRootOptions",
|
|
46774
|
+
"type": {
|
|
46775
|
+
"text": "object"
|
|
46776
|
+
},
|
|
46777
|
+
"static": true,
|
|
46778
|
+
"default": "{ ...Component.shadowRootOptions, delegatesFocus: true }"
|
|
46779
|
+
},
|
|
46751
46780
|
{
|
|
46752
46781
|
"kind": "method",
|
|
46753
46782
|
"name": "shouldLoop",
|
|
@@ -48211,10 +48240,6 @@
|
|
|
48211
48240
|
"description": "Option to override the font weight, default: `400` default: `-0.25px` (this is to match the old CiscoSans)",
|
|
48212
48241
|
"name": "--mdc-themeprovider-font-weight"
|
|
48213
48242
|
},
|
|
48214
|
-
{
|
|
48215
|
-
"description": "Option to override the font feature settings, default: `\"ss02\" on`",
|
|
48216
|
-
"name": "--mdc-themeprovider-font-feature-settings"
|
|
48217
|
-
},
|
|
48218
48243
|
{
|
|
48219
48244
|
"description": "Option to override the color of the scrollbar track.",
|
|
48220
48245
|
"name": "--mdc-themeprovider-scrollbar-track-color"
|
|
@@ -48281,7 +48306,7 @@
|
|
|
48281
48306
|
"module": "/src/models"
|
|
48282
48307
|
},
|
|
48283
48308
|
"tagName": "mdc-themeprovider",
|
|
48284
|
-
"jsDoc": "/**\n * ThemeProvider component, which sets the passed in themeclass as class.\n * If the themeclass switches, the existing themeclass will be removed as a class\n * and the new themeclass will be added.\n *\n * CSS variables defined in the themeclass will be used for the styling of child dom nodes.\n *\n * Available Momentum theme classes:\n *\n * `mds-theme-stable-darkWebex`, `mds-theme-stable-lightWebex`\n *\n * `mds-theme-stable-darkBronzeWebex`, `mds-theme-stable-lightBronzeWebex`\n *\n * `mds-theme-stable-darkIndigoWebex`, `mds-theme-stable-lightIndigoWebex`\n *\n * `mds-theme-stable-darkJadeWebex`, `mds-theme-stable-lightJadeWebex`\n *\n * `mds-theme-stable-darkLavenderWebex`, `mds-theme-stable-lightLavenderWebex`\n *\n * `mds-theme-stable-darkRoseWebex`, `mds-theme-stable-lightRoseWebex`\n *\n * Themeclass context can be be consumed from Lit child components\n * (see providerUtils.consume for how to consume)\n *\n * ThemeProvider also includes basic font defaults for text.\n *\n * @tagname mdc-themeprovider\n *\n * @slot - children\n *\n * @cssproperty --mdc-themeprovider-color-default - Option to override the default color,\n * default: color-theme-text-primary-normal\n * @cssproperty --mdc-themeprovider-font-family - Option to override the font family,\n * default: `Momentum` (from momentum-design/fonts)\n * @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`\n * default: `-0.25px` (this is to match the old CiscoSans)\n * @cssproperty --mdc-themeprovider-
|
|
48309
|
+
"jsDoc": "/**\n * ThemeProvider component, which sets the passed in themeclass as class.\n * If the themeclass switches, the existing themeclass will be removed as a class\n * and the new themeclass will be added.\n *\n * CSS variables defined in the themeclass will be used for the styling of child dom nodes.\n *\n * Available Momentum theme classes:\n *\n * `mds-theme-stable-darkWebex`, `mds-theme-stable-lightWebex`\n *\n * `mds-theme-stable-darkBronzeWebex`, `mds-theme-stable-lightBronzeWebex`\n *\n * `mds-theme-stable-darkIndigoWebex`, `mds-theme-stable-lightIndigoWebex`\n *\n * `mds-theme-stable-darkJadeWebex`, `mds-theme-stable-lightJadeWebex`\n *\n * `mds-theme-stable-darkLavenderWebex`, `mds-theme-stable-lightLavenderWebex`\n *\n * `mds-theme-stable-darkRoseWebex`, `mds-theme-stable-lightRoseWebex`\n *\n * Themeclass context can be be consumed from Lit child components\n * (see providerUtils.consume for how to consume)\n *\n * ThemeProvider also includes basic font defaults for text.\n *\n * @tagname mdc-themeprovider\n *\n * @slot - children\n *\n * @cssproperty --mdc-themeprovider-color-default - Option to override the default color,\n * default: color-theme-text-primary-normal\n * @cssproperty --mdc-themeprovider-font-family - Option to override the font family,\n * default: `Momentum` (from momentum-design/fonts)\n * @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`\n * default: `-0.25px` (this is to match the old CiscoSans)\n * @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.\n */",
|
|
48285
48310
|
"customElement": true
|
|
48286
48311
|
}
|
|
48287
48312
|
],
|
|
@@ -35,8 +35,6 @@ import Component from '../../components/themeprovider';
|
|
|
35
35
|
* default: `Momentum` (from momentum-design/fonts)
|
|
36
36
|
* @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`
|
|
37
37
|
* default: `-0.25px` (this is to match the old CiscoSans)
|
|
38
|
-
* @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,
|
|
39
|
-
* default: `"ss02" on`
|
|
40
38
|
* @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.
|
|
41
39
|
* @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.
|
|
42
40
|
*/
|
|
@@ -38,8 +38,6 @@ import { TAG_NAME } from '../../components/themeprovider/themeprovider.constants
|
|
|
38
38
|
* default: `Momentum` (from momentum-design/fonts)
|
|
39
39
|
* @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`
|
|
40
40
|
* default: `-0.25px` (this is to match the old CiscoSans)
|
|
41
|
-
* @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,
|
|
42
|
-
* default: `"ss02" on`
|
|
43
41
|
* @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.
|
|
44
42
|
* @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.
|
|
45
43
|
*/
|