@momentum-design/components 0.28.3 → 0.28.4

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.
@@ -74,7 +74,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
74
74
  }
75
75
  if (this.presence) {
76
76
  return html `
77
- <mdc-presence class="presence" type="${this.presence}" size="${getPresenceSize(this.size)}"></mdc-presence>
77
+ <mdc-presence part="presence" type="${this.presence}" size="${getPresenceSize(this.size)}"></mdc-presence>
78
78
  `;
79
79
  }
80
80
  return nothing;
@@ -112,7 +112,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
112
112
  photoTemplate() {
113
113
  return html `
114
114
  <img
115
- class="photo"
115
+ part="photo"
116
116
  src="${ifDefined(this.src)}"
117
117
  aria-hidden="true"
118
118
  ?hidden="${!this.isPhotoLoaded}"
@@ -262,7 +262,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
262
262
  if (!this.isTyping) {
263
263
  return nothing;
264
264
  }
265
- return html `<div class="loading__wrapper"><div class="loader"></div></div>`;
265
+ return html `<div part="loading-wrapper"><div part="loader"></div></div>`;
266
266
  }
267
267
  /**
268
268
  * @internal
@@ -297,7 +297,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
297
297
  render() {
298
298
  const type = this.getTypeBasedOnInputs();
299
299
  return html `
300
- <div class="content" aria-hidden="true">
300
+ <div part="content" aria-hidden="true">
301
301
  ${this.getPhotoPlaceHolderContent(type)}
302
302
  ${this.getTemplateBasedOnType(type)}
303
303
  ${this.getLoadingContent()}
@@ -8,54 +8,54 @@ const styles = [hostFitContentStyles, css `
8
8
  --mdc-avatar-loading-indicator-foreground-color: var(--mdc-avatar-default-foreground-color);
9
9
  --mdc-avatar-loading-overlay-background-color: var(--mds-color-theme-common-overlays-secondary-normal);
10
10
  }
11
- :host([size="124"]) .content {
11
+ :host([size="124"])::part(content) {
12
12
  width: 7.75rem;
13
13
  height: 7.75rem;
14
14
  }
15
- :host([size="88"]) .content {
15
+ :host([size="88"])::part(content) {
16
16
  width: 5.5rem;
17
17
  height: 5.5rem;
18
18
  }
19
- :host([size="72"]) .content {
19
+ :host([size="72"])::part(content) {
20
20
  width: 4.5rem;
21
21
  height: 4.5rem;
22
22
  }
23
- :host([size="64"]) .content {
23
+ :host([size="64"])::part(content) {
24
24
  width: 4rem;
25
25
  height: 4rem;
26
26
  }
27
- :host([size="48"]) .content {
27
+ :host([size="48"])::part(content) {
28
28
  width: 3rem;
29
29
  height: 3rem;
30
30
  }
31
- :host([size="32"]) .content {
31
+ :host([size="32"])::part(content) {
32
32
  width: 2rem;
33
33
  height: 2rem;
34
34
  }
35
- :host([size="24"]) .content {
35
+ :host([size="24"])::part(content) {
36
36
  width: 1.5rem;
37
37
  height: 1.5rem;
38
38
  }
39
- :host([size="124"]) .content > .loading__wrapper > .loader {
39
+ :host([size="124"])::part(loader) {
40
40
  transform: scale(1.5);
41
41
  }
42
- :host([size="88"]) .content > .loading__wrapper > .loader {
42
+ :host([size="88"])::part(loader) {
43
43
  transform: scale(1.2);
44
44
  }
45
- :host([size="72"]) .content > .loading__wrapper > .loader,
46
- :host([size="64"]) .content > .loading__wrapper > .loader {
45
+ :host([size="72"])::part(loader),
46
+ :host([size="64"])::part(loader) {
47
47
  transform: scale(0.8);
48
48
  }
49
- :host([size="48"]) .content > .loading__wrapper > .loader {
49
+ :host([size="48"])::part(loader) {
50
50
  transform: scale(0.6);
51
51
  }
52
- :host([size="32"]) .content > .loading__wrapper > .loader {
52
+ :host([size="32"])::part(loader) {
53
53
  transform: scale(0.4);
54
54
  }
55
- :host([size="24"]) .content > .loading__wrapper > .loader {
55
+ :host([size="24"])::part(loader) {
56
56
  transform: scale(0.3);
57
57
  }
58
- .content {
58
+ :host::part(content) {
59
59
  width: 2rem;
60
60
  height: 2rem;
61
61
  background-color: var(--mdc-avatar-default-background-color);
@@ -65,19 +65,19 @@ const styles = [hostFitContentStyles, css `
65
65
  display: grid;
66
66
  place-items: center;
67
67
  }
68
- .photo {
68
+ :host::part(photo) {
69
69
  border-radius: 100vh;
70
70
  height: 100%;
71
71
  width: 100%;
72
72
  object-fit: cover;
73
73
  overflow: hidden;
74
74
  }
75
- .presence {
75
+ :host::part(presence) {
76
76
  position: absolute;
77
77
  bottom: 0;
78
78
  right: 0;
79
79
  }
80
- .loading__wrapper {
80
+ :host::part(loading-wrapper) {
81
81
  position: absolute;
82
82
  border-radius: 100vh;
83
83
  width: 100%;
@@ -86,7 +86,7 @@ const styles = [hostFitContentStyles, css `
86
86
  display: grid;
87
87
  place-items: center;
88
88
  }
89
- .loader {
89
+ :host::part(loader) {
90
90
  position: absolute;
91
91
  width: 1rem;
92
92
  transform: scale(0.4);
@@ -119,7 +119,7 @@ const styles = [hostFitContentStyles, css `
119
119
 
120
120
  /* High Contrast Mode */
121
121
  @media (forced-colors: active) {
122
- .content:not(.photo) {
122
+ :host::part(content) {
123
123
  outline: 0.125rem solid;
124
124
  }
125
125
  }
@@ -104,7 +104,7 @@ class VirtualizedList extends Component {
104
104
  this.setlistdata({ virtualItems, measureElement, listStyle });
105
105
  }
106
106
  return html `<div
107
- class="mdc-virtualizedlist-container"
107
+ part="container"
108
108
  style="height: ${getTotalSize()}px;"
109
109
  >
110
110
  <slot></slot>
@@ -113,7 +113,7 @@ class VirtualizedList extends Component {
113
113
  render() {
114
114
  return html `<div
115
115
  ${ref(this.scrollElementRef)}
116
- class="mdc-virtualizedlist-scroll"
116
+ part="scroll"
117
117
  @scroll=${this.onscroll && this.onscroll}
118
118
  >
119
119
  ${this.virtualizerController ? this.getVirtualizedListWrapper(this.virtualizerController) : html ``}
@@ -1,17 +1,15 @@
1
1
  import { css } from 'lit';
2
2
  const styles = [
3
3
  css `
4
- :host {
5
- .mdc-virtualizedlist-scroll {
6
- height: 100%;
7
- width: 100%;
8
- overflow-y: auto;
9
- }
10
- .mdc-virtualizedlist-container {
11
- position: relative;
12
- width: 100%;
13
- }
14
- }
4
+ :host::part(scroll) {
5
+ height: 100%;
6
+ width: 100%;
7
+ overflow-y: auto;
8
+ }
9
+ :host::part(container) {
10
+ position: relative;
11
+ width: 100%;
12
+ }
15
13
  `,
16
14
  ];
17
15
  export default styles;
@@ -9518,124 +9518,6 @@
9518
9518
  }
9519
9519
  ]
9520
9520
  },
9521
- {
9522
- "kind": "javascript-module",
9523
- "path": "components/themeprovider/themeprovider.component.js",
9524
- "declarations": [
9525
- {
9526
- "kind": "class",
9527
- "description": "ThemeProvider component, which sets the passed in themeclass as class.\nIf the themeclass switches, the existing themeclass will be removed as a class\nand the new themeclass will be added.\n\nCSS variables defined in the themeclass will be used for the styling of child dom nodes.\n\nThemeclass context can be be consumed from Lit child components\n(see providerUtils.consume for how to consume)\n\nThemeProvider also includes basic font defaults for text.",
9528
- "name": "ThemeProvider",
9529
- "cssProperties": [
9530
- {
9531
- "description": "Option to override the default color, default: color-theme-text-primary-normal",
9532
- "name": "--mdc-themeprovider-color-default"
9533
- },
9534
- {
9535
- "description": "Option to override the font family, default: `Momentum` (from momentum-design/fonts)",
9536
- "name": "--mdc-themeprovider-font-family"
9537
- },
9538
- {
9539
- "description": "Option to override the font weight, default: `400`",
9540
- "name": "--mdc-themeprovider-font-weight"
9541
- },
9542
- {
9543
- "description": "Option to override the default letter-spacing, default: `-0.25px` (this is to match the old CiscoSans)",
9544
- "name": "--mdc-themeprovider-letter-spacing-adjustment"
9545
- },
9546
- {
9547
- "description": "Option to override the font feature settings, default: `\"ss02\" on`",
9548
- "name": "--mdc-themeprovider-font-feature-settings"
9549
- },
9550
- {
9551
- "description": "Option to override the color of the scrollbar track.",
9552
- "name": "--mdc-themeprovider-scrollbar-track-color"
9553
- },
9554
- {
9555
- "description": "Option to override the color of the scrollbar thumb.",
9556
- "name": "--mdc-themeprovider-scrollbar-thumb-color"
9557
- },
9558
- {
9559
- "description": "Option to override the color of the scrollbar thumb on hover. Applicable only on webkit browsers.",
9560
- "name": "--mdc-themeprovider-scrollbar-thumb-hover-color"
9561
- },
9562
- {
9563
- "description": "Option to override the color of the scrollbar thumb on press. Applicable only on webkit browsers.",
9564
- "name": "--mdc-themeprovider-scrollbar-thumb-active-color"
9565
- }
9566
- ],
9567
- "slots": [
9568
- {
9569
- "description": "children",
9570
- "name": ""
9571
- }
9572
- ],
9573
- "members": [
9574
- {
9575
- "kind": "field",
9576
- "name": "Context",
9577
- "privacy": "public",
9578
- "static": true,
9579
- "description": "Context object of the ThemeProvider, to be consumed by child components",
9580
- "readonly": true
9581
- },
9582
- {
9583
- "kind": "field",
9584
- "name": "themeclass",
9585
- "type": {
9586
- "text": "string"
9587
- },
9588
- "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
9589
- "attribute": "themeclass"
9590
- },
9591
- {
9592
- "kind": "method",
9593
- "name": "updateContext",
9594
- "privacy": "protected",
9595
- "return": {
9596
- "type": {
9597
- "text": "void"
9598
- }
9599
- },
9600
- "description": "Update all observing components of this\nprovider to update the themeclass\n\nIs called on every re-render, see Provider class"
9601
- },
9602
- {
9603
- "kind": "method",
9604
- "name": "setThemeInClassList",
9605
- "privacy": "private",
9606
- "description": "Function to update the active theme classnames to update the theme tokens\nas CSS variables on the web component."
9607
- }
9608
- ],
9609
- "attributes": [
9610
- {
9611
- "name": "themeclass",
9612
- "type": {
9613
- "text": "string"
9614
- },
9615
- "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
9616
- "fieldName": "themeclass"
9617
- }
9618
- ],
9619
- "superclass": {
9620
- "name": "Provider",
9621
- "module": "/src/models"
9622
- },
9623
- "tagName": "mdc-themeprovider",
9624
- "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 * 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 * @cssproperty --mdc-themeprovider-letter-spacing-adjustment - Option to override the default letter-spacing,\n * default: `-0.25px` (this is to match the old CiscoSans)\n * @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,\n * default: `\"ss02\" on`\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 * @cssproperty --mdc-themeprovider-scrollbar-thumb-hover-color - Option to override the color of the\n * scrollbar thumb on hover. Applicable only on webkit browsers.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-active-color - Option to override the color of the\n * scrollbar thumb on press. Applicable only on webkit browsers.\n */",
9625
- "customElement": true
9626
- }
9627
- ],
9628
- "exports": [
9629
- {
9630
- "kind": "js",
9631
- "name": "default",
9632
- "declaration": {
9633
- "name": "ThemeProvider",
9634
- "module": "components/themeprovider/themeprovider.component.js"
9635
- }
9636
- }
9637
- ]
9638
- },
9639
9521
  {
9640
9522
  "kind": "javascript-module",
9641
9523
  "path": "components/toggle/toggle.component.js",
@@ -10319,6 +10201,124 @@
10319
10201
  }
10320
10202
  ]
10321
10203
  },
10204
+ {
10205
+ "kind": "javascript-module",
10206
+ "path": "components/themeprovider/themeprovider.component.js",
10207
+ "declarations": [
10208
+ {
10209
+ "kind": "class",
10210
+ "description": "ThemeProvider component, which sets the passed in themeclass as class.\nIf the themeclass switches, the existing themeclass will be removed as a class\nand the new themeclass will be added.\n\nCSS variables defined in the themeclass will be used for the styling of child dom nodes.\n\nThemeclass context can be be consumed from Lit child components\n(see providerUtils.consume for how to consume)\n\nThemeProvider also includes basic font defaults for text.",
10211
+ "name": "ThemeProvider",
10212
+ "cssProperties": [
10213
+ {
10214
+ "description": "Option to override the default color, default: color-theme-text-primary-normal",
10215
+ "name": "--mdc-themeprovider-color-default"
10216
+ },
10217
+ {
10218
+ "description": "Option to override the font family, default: `Momentum` (from momentum-design/fonts)",
10219
+ "name": "--mdc-themeprovider-font-family"
10220
+ },
10221
+ {
10222
+ "description": "Option to override the font weight, default: `400`",
10223
+ "name": "--mdc-themeprovider-font-weight"
10224
+ },
10225
+ {
10226
+ "description": "Option to override the default letter-spacing, default: `-0.25px` (this is to match the old CiscoSans)",
10227
+ "name": "--mdc-themeprovider-letter-spacing-adjustment"
10228
+ },
10229
+ {
10230
+ "description": "Option to override the font feature settings, default: `\"ss02\" on`",
10231
+ "name": "--mdc-themeprovider-font-feature-settings"
10232
+ },
10233
+ {
10234
+ "description": "Option to override the color of the scrollbar track.",
10235
+ "name": "--mdc-themeprovider-scrollbar-track-color"
10236
+ },
10237
+ {
10238
+ "description": "Option to override the color of the scrollbar thumb.",
10239
+ "name": "--mdc-themeprovider-scrollbar-thumb-color"
10240
+ },
10241
+ {
10242
+ "description": "Option to override the color of the scrollbar thumb on hover. Applicable only on webkit browsers.",
10243
+ "name": "--mdc-themeprovider-scrollbar-thumb-hover-color"
10244
+ },
10245
+ {
10246
+ "description": "Option to override the color of the scrollbar thumb on press. Applicable only on webkit browsers.",
10247
+ "name": "--mdc-themeprovider-scrollbar-thumb-active-color"
10248
+ }
10249
+ ],
10250
+ "slots": [
10251
+ {
10252
+ "description": "children",
10253
+ "name": ""
10254
+ }
10255
+ ],
10256
+ "members": [
10257
+ {
10258
+ "kind": "field",
10259
+ "name": "Context",
10260
+ "privacy": "public",
10261
+ "static": true,
10262
+ "description": "Context object of the ThemeProvider, to be consumed by child components",
10263
+ "readonly": true
10264
+ },
10265
+ {
10266
+ "kind": "field",
10267
+ "name": "themeclass",
10268
+ "type": {
10269
+ "text": "string"
10270
+ },
10271
+ "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
10272
+ "attribute": "themeclass"
10273
+ },
10274
+ {
10275
+ "kind": "method",
10276
+ "name": "updateContext",
10277
+ "privacy": "protected",
10278
+ "return": {
10279
+ "type": {
10280
+ "text": "void"
10281
+ }
10282
+ },
10283
+ "description": "Update all observing components of this\nprovider to update the themeclass\n\nIs called on every re-render, see Provider class"
10284
+ },
10285
+ {
10286
+ "kind": "method",
10287
+ "name": "setThemeInClassList",
10288
+ "privacy": "private",
10289
+ "description": "Function to update the active theme classnames to update the theme tokens\nas CSS variables on the web component."
10290
+ }
10291
+ ],
10292
+ "attributes": [
10293
+ {
10294
+ "name": "themeclass",
10295
+ "type": {
10296
+ "text": "string"
10297
+ },
10298
+ "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
10299
+ "fieldName": "themeclass"
10300
+ }
10301
+ ],
10302
+ "superclass": {
10303
+ "name": "Provider",
10304
+ "module": "/src/models"
10305
+ },
10306
+ "tagName": "mdc-themeprovider",
10307
+ "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 * 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 * @cssproperty --mdc-themeprovider-letter-spacing-adjustment - Option to override the default letter-spacing,\n * default: `-0.25px` (this is to match the old CiscoSans)\n * @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,\n * default: `\"ss02\" on`\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 * @cssproperty --mdc-themeprovider-scrollbar-thumb-hover-color - Option to override the color of the\n * scrollbar thumb on hover. Applicable only on webkit browsers.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-active-color - Option to override the color of the\n * scrollbar thumb on press. Applicable only on webkit browsers.\n */",
10308
+ "customElement": true
10309
+ }
10310
+ ],
10311
+ "exports": [
10312
+ {
10313
+ "kind": "js",
10314
+ "name": "default",
10315
+ "declaration": {
10316
+ "name": "ThemeProvider",
10317
+ "module": "components/themeprovider/themeprovider.component.js"
10318
+ }
10319
+ }
10320
+ ]
10321
+ },
10322
10322
  {
10323
10323
  "kind": "javascript-module",
10324
10324
  "path": "components/virtualizedlist/virtualizedlist.component.js",
@@ -21,6 +21,6 @@ export { default as RadioGroup } from './radiogroup';
21
21
  export { default as Spinner } from './spinner';
22
22
  export { default as Tab } from './tab';
23
23
  export { default as Text } from './text';
24
- export { default as ThemeProvider } from './themeprovider';
25
24
  export { default as Toggle } from './toggle';
25
+ export { default as ThemeProvider } from './themeprovider';
26
26
  export { default as VirtualizedList } from './virtualizedlist';
@@ -21,6 +21,6 @@ export { default as RadioGroup } from './radiogroup';
21
21
  export { default as Spinner } from './spinner';
22
22
  export { default as Tab } from './tab';
23
23
  export { default as Text } from './text';
24
- export { default as ThemeProvider } from './themeprovider';
25
24
  export { default as Toggle } from './toggle';
25
+ export { default as ThemeProvider } from './themeprovider';
26
26
  export { default as VirtualizedList } from './virtualizedlist';
package/package.json CHANGED
@@ -38,5 +38,5 @@
38
38
  "lit": "^3.2.0",
39
39
  "uuid": "^11.0.5"
40
40
  },
41
- "version": "0.28.3"
41
+ "version": "0.28.4"
42
42
  }