@momentum-design/components 0.1.5 → 0.1.6

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.
@@ -5,7 +5,6 @@ import { AvatarType } from './avatar.types';
5
5
  *
6
6
  * @summary This is MyElement
7
7
  *
8
- * @tag mdc-avatar
9
8
  * @tagname mdc-avatar
10
9
  */
11
10
  declare class Avatar extends Component {
@@ -12,7 +12,6 @@ const avatar_constants_1 = require("./avatar.constants");
12
12
  *
13
13
  * @summary This is MyElement
14
14
  *
15
- * @tag mdc-avatar
16
15
  * @tagname mdc-avatar
17
16
  */
18
17
  class Avatar extends models_1.Component {
@@ -5,7 +5,6 @@ import type { BadgeType } from './badge.types';
5
5
  *
6
6
  * @summary This is MyElement
7
7
  *
8
- * @tag mdc-badge
9
8
  * @tagname mdc-badge
10
9
  */
11
10
  declare class Badge extends Component {
@@ -13,7 +13,6 @@ const badge_styles_1 = tslib_1.__importDefault(require("./badge.styles"));
13
13
  *
14
14
  * @summary This is MyElement
15
15
  *
16
- * @tag mdc-badge
17
16
  * @tagname mdc-badge
18
17
  */
19
18
  class Badge extends models_1.Component {
@@ -18,7 +18,6 @@ import { Component } from '../../models';
18
18
  *
19
19
  * For accessibility the `role` and `aria-label` of the icon can be set.
20
20
  *
21
- * @tag mdc-icon
22
21
  * @tagname mdc-icon
23
22
  */
24
23
  declare class Icon extends Component {
@@ -28,7 +28,6 @@ const icon_constants_1 = require("./icon.constants");
28
28
  *
29
29
  * For accessibility the `role` and `aria-label` of the icon can be set.
30
30
  *
31
- * @tag mdc-icon
32
31
  * @tagname mdc-icon
33
32
  */
34
33
  class Icon extends models_1.Component {
@@ -8,7 +8,6 @@ import IconProviderContext from './iconprovider.context';
8
8
  * that only a url has to be passed in from which the icons will be
9
9
  * fetched.
10
10
  *
11
- * @tag mdc-iconprovider
12
11
  * @tagname mdc-iconprovider
13
12
  */
14
13
  declare class IconProvider extends Provider<IconProviderContext> {
@@ -13,7 +13,6 @@ const iconprovider_constants_1 = require("./iconprovider.constants");
13
13
  * that only a url has to be passed in from which the icons will be
14
14
  * fetched.
15
15
  *
16
- * @tag mdc-iconprovider
17
16
  * @tagname mdc-iconprovider
18
17
  */
19
18
  class IconProvider extends models_1.Provider {
@@ -45,22 +44,28 @@ class IconProvider extends models_1.Provider {
45
44
  if (this.fileExtension && iconprovider_constants_1.ALLOWED_FILE_EXTENSIONS.includes(this.fileExtension)) {
46
45
  this.context.value.fileExtension = this.fileExtension;
47
46
  }
47
+ else {
48
+ // Ensure both fileExtension and context are updated to the default if its not an allowed fileExtension
49
+ this.fileExtension = iconprovider_constants_1.DEFAULTS.FILE_EXTENSION;
50
+ this.context.value.fileExtension = iconprovider_constants_1.DEFAULTS.FILE_EXTENSION;
51
+ }
48
52
  this.context.value.url = this.url;
53
+ this.context.value.size = this.size;
49
54
  if (this.lengthUnit && iconprovider_constants_1.ALLOWED_LENGTH_UNITS.includes(this.lengthUnit)) {
50
55
  this.context.value.lengthUnit = this.lengthUnit;
51
56
  }
52
- this.context.value.size = this.size;
57
+ else {
58
+ // Ensure both lengthUnit and context are updated to the default if its not an allowed lengthUnit
59
+ this.lengthUnit = iconprovider_constants_1.DEFAULTS.LENGTH_UNIT;
60
+ this.context.value.lengthUnit = iconprovider_constants_1.DEFAULTS.LENGTH_UNIT;
61
+ }
53
62
  }
54
63
  updateContext() {
55
- let shouldUpdateConsumers = false;
56
64
  if (this.context.value.fileExtension !== this.fileExtension
57
65
  || this.context.value.url !== this.url
58
66
  || this.context.value.lengthUnit !== this.lengthUnit
59
67
  || this.context.value.size !== this.size) {
60
68
  this.updateValuesInContext();
61
- shouldUpdateConsumers = true;
62
- }
63
- if (shouldUpdateConsumers) {
64
69
  this.context.updateObservers();
65
70
  }
66
71
  }
@@ -9,7 +9,6 @@ import type { FontType } from './text.types';
9
9
  * For accessibility the `role` and `aria-level` on the component are going to be set
10
10
  * automatically based on the type e.g. heading-1 will lead to `role="heading"` and `aria-level=1`.
11
11
  *
12
- * @tag mdc-text
13
12
  * @tagname mdc-text
14
13
  */
15
14
  declare class Text extends Component {
@@ -15,7 +15,6 @@ const text_utils_1 = require("./text.utils");
15
15
  * For accessibility the `role` and `aria-level` on the component are going to be set
16
16
  * automatically based on the type e.g. heading-1 will lead to `role="heading"` and `aria-level=1`.
17
17
  *
18
- * @tag mdc-text
19
18
  * @tagname mdc-text
20
19
  */
21
20
  class Text extends models_1.Component {
@@ -99,7 +99,7 @@
99
99
  },
100
100
  "tagName": "mdc-avatar",
101
101
  "summary": "This is MyElement",
102
- "jsDoc": "/**\n * @slot - This is a default/unnamed slot\n *\n * @summary This is MyElement\n *\n * @tag mdc-avatar\n * @tagname mdc-avatar\n */",
102
+ "jsDoc": "/**\n * @slot - This is a default/unnamed slot\n *\n * @summary This is MyElement\n *\n * @tagname mdc-avatar\n */",
103
103
  "customElement": true
104
104
  }
105
105
  ],
@@ -241,7 +241,7 @@
241
241
  },
242
242
  "tagName": "mdc-badge",
243
243
  "summary": "This is MyElement",
244
- "jsDoc": "/**\n * @slot - This is a default/unnamed slot\n *\n * @summary This is MyElement\n *\n * @tag mdc-badge\n * @tagname mdc-badge\n */",
244
+ "jsDoc": "/**\n * @slot - This is a default/unnamed slot\n *\n * @summary This is MyElement\n *\n * @tagname mdc-badge\n */",
245
245
  "customElement": true
246
246
  }
247
247
  ],
@@ -421,7 +421,7 @@
421
421
  "module": "/src/models"
422
422
  },
423
423
  "tagName": "mdc-icon",
424
- "jsDoc": "/**\n * Icon component, which has to be mounted inside of a `IconProvider`\n * component.\n *\n * The `IconProvider` component defines where icons should be consumed from (`url`).\n * This `Icon` component accepts the `name` attribute, which will be\n * the file name of the icon to be loaded from the given `url`.\n *\n * Once fetched, the icon will be mounted. If fetching wasn't successful,\n * nothing will be shown.\n *\n * The `size` attribute allows sizing the icon based on the provided\n * `length-unit` attribute (which will either come from the IconProvider or\n * could be overridden per icon). For example:\n * if `size = 1` and `length-unit = 'em'`, the size of the icon will be\n * `width: 1em; height: 1em`.\n *\n * For accessibility the `role` and `aria-label` of the icon can be set.\n *\n * @tag mdc-icon\n * @tagname mdc-icon\n */",
424
+ "jsDoc": "/**\n * Icon component, which has to be mounted inside of a `IconProvider`\n * component.\n *\n * The `IconProvider` component defines where icons should be consumed from (`url`).\n * This `Icon` component accepts the `name` attribute, which will be\n * the file name of the icon to be loaded from the given `url`.\n *\n * Once fetched, the icon will be mounted. If fetching wasn't successful,\n * nothing will be shown.\n *\n * The `size` attribute allows sizing the icon based on the provided\n * `length-unit` attribute (which will either come from the IconProvider or\n * could be overridden per icon). For example:\n * if `size = 1` and `length-unit = 'em'`, the size of the icon will be\n * `width: 1em; height: 1em`.\n *\n * For accessibility the `role` and `aria-label` of the icon can be set.\n *\n * @tagname mdc-icon\n */",
425
425
  "customElement": true
426
426
  }
427
427
  ],
@@ -548,7 +548,7 @@
548
548
  "module": "/src/models"
549
549
  },
550
550
  "tagName": "mdc-iconprovider",
551
- "jsDoc": "/**\n * IconProvider component, which allows to be consumed from sub components\n * (see `providerUtils.consume` for how to consume)\n *\n * Bundling icons will be up to the consumer of this component, such\n * that only a url has to be passed in from which the icons will be\n * fetched.\n *\n * @tag mdc-iconprovider\n * @tagname mdc-iconprovider\n */",
551
+ "jsDoc": "/**\n * IconProvider component, which allows to be consumed from sub components\n * (see `providerUtils.consume` for how to consume)\n *\n * Bundling icons will be up to the consumer of this component, such\n * that only a url has to be passed in from which the icons will be\n * fetched.\n *\n * @tagname mdc-iconprovider\n */",
552
552
  "customElement": true
553
553
  }
554
554
  ],
@@ -609,7 +609,7 @@
609
609
  "module": "/src/models"
610
610
  },
611
611
  "tagName": "mdc-text",
612
- "jsDoc": "/**\n * Text component, which helps creating a text element aligning with\n * styling.\n *\n * The `type` attribute allows changing the type of text, like `heading-1`, etc.\n *\n * For accessibility the `role` and `aria-level` on the component are going to be set\n * automatically based on the type e.g. heading-1 will lead to `role=\"heading\"` and `aria-level=1`.\n *\n * @tag mdc-text\n * @tagname mdc-text\n */",
612
+ "jsDoc": "/**\n * Text component, which helps creating a text element aligning with\n * styling.\n *\n * The `type` attribute allows changing the type of text, like `heading-1`, etc.\n *\n * For accessibility the `role` and `aria-level` on the component are going to be set\n * automatically based on the type e.g. heading-1 will lead to `role=\"heading\"` and `aria-level=1`.\n *\n * @tagname mdc-text\n */",
613
613
  "customElement": true
614
614
  }
615
615
  ],
@@ -4,7 +4,6 @@ import Component from '../../components/avatar';
4
4
  *
5
5
  * @summary This is MyElement
6
6
  *
7
- * @tag mdc-avatar
8
7
  * @tagname mdc-avatar
9
8
  */
10
9
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
@@ -10,7 +10,6 @@ const avatar_constants_1 = require("../../components/avatar/avatar.constants");
10
10
  *
11
11
  * @summary This is MyElement
12
12
  *
13
- * @tag mdc-avatar
14
13
  * @tagname mdc-avatar
15
14
  */
16
15
  const reactWrapper = (0, react_1.createComponent)({
@@ -4,7 +4,6 @@ import Component from '../../components/badge';
4
4
  *
5
5
  * @summary This is MyElement
6
6
  *
7
- * @tag mdc-badge
8
7
  * @tagname mdc-badge
9
8
  */
10
9
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
@@ -10,7 +10,6 @@ const badge_constants_1 = require("../../components/badge/badge.constants");
10
10
  *
11
11
  * @summary This is MyElement
12
12
  *
13
- * @tag mdc-badge
14
13
  * @tagname mdc-badge
15
14
  */
16
15
  const reactWrapper = (0, react_1.createComponent)({
@@ -18,7 +18,6 @@ import Component from '../../components/icon';
18
18
  *
19
19
  * For accessibility the `role` and `aria-label` of the icon can be set.
20
20
  *
21
- * @tag mdc-icon
22
21
  * @tagname mdc-icon
23
22
  */
24
23
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
@@ -24,7 +24,6 @@ const icon_constants_1 = require("../../components/icon/icon.constants");
24
24
  *
25
25
  * For accessibility the `role` and `aria-label` of the icon can be set.
26
26
  *
27
- * @tag mdc-icon
28
27
  * @tagname mdc-icon
29
28
  */
30
29
  const reactWrapper = (0, react_1.createComponent)({
@@ -7,7 +7,6 @@ import Component from '../../components/iconprovider';
7
7
  * that only a url has to be passed in from which the icons will be
8
8
  * fetched.
9
9
  *
10
- * @tag mdc-iconprovider
11
10
  * @tagname mdc-iconprovider
12
11
  */
13
12
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
@@ -13,7 +13,6 @@ const iconprovider_constants_1 = require("../../components/iconprovider/iconprov
13
13
  * that only a url has to be passed in from which the icons will be
14
14
  * fetched.
15
15
  *
16
- * @tag mdc-iconprovider
17
16
  * @tagname mdc-iconprovider
18
17
  */
19
18
  const reactWrapper = (0, react_1.createComponent)({
@@ -8,7 +8,6 @@ import Component from '../../components/text';
8
8
  * For accessibility the `role` and `aria-level` on the component are going to be set
9
9
  * automatically based on the type e.g. heading-1 will lead to `role="heading"` and `aria-level=1`.
10
10
  *
11
- * @tag mdc-text
12
11
  * @tagname mdc-text
13
12
  */
14
13
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
@@ -14,7 +14,6 @@ const text_constants_1 = require("../../components/text/text.constants");
14
14
  * For accessibility the `role` and `aria-level` on the component are going to be set
15
15
  * automatically based on the type e.g. heading-1 will lead to `role="heading"` and `aria-level=1`.
16
16
  *
17
- * @tag mdc-text
18
17
  * @tagname mdc-text
19
18
  */
20
19
  const reactWrapper = (0, react_1.createComponent)({
package/package.json CHANGED
@@ -37,5 +37,5 @@
37
37
  "@momentum-design/icons": "*",
38
38
  "@momentum-design/tokens": "*"
39
39
  },
40
- "version": "0.1.5"
40
+ "version": "0.1.6"
41
41
  }