@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.
- package/dist/browser/index.js +11 -11
- package/dist/browser/index.js.map +3 -3
- package/dist/components/avatar/avatar.component.d.ts +0 -1
- package/dist/components/avatar/avatar.component.js +0 -1
- package/dist/components/badge/badge.component.d.ts +0 -1
- package/dist/components/badge/badge.component.js +0 -1
- package/dist/components/icon/icon.component.d.ts +0 -1
- package/dist/components/icon/icon.component.js +0 -1
- package/dist/components/iconprovider/iconprovider.component.d.ts +0 -1
- package/dist/components/iconprovider/iconprovider.component.js +11 -6
- package/dist/components/text/text.component.d.ts +0 -1
- package/dist/components/text/text.component.js +0 -1
- package/dist/custom-elements.json +5 -5
- package/dist/react/avatar/index.d.ts +0 -1
- package/dist/react/avatar/index.js +0 -1
- package/dist/react/badge/index.d.ts +0 -1
- package/dist/react/badge/index.js +0 -1
- package/dist/react/icon/index.d.ts +0 -1
- package/dist/react/icon/index.js +0 -1
- package/dist/react/iconprovider/index.d.ts +0 -1
- package/dist/react/iconprovider/index.js +0 -1
- package/dist/react/text/index.d.ts +0 -1
- package/dist/react/text/index.js +0 -1
- package/package.json +1 -1
@@ -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
|
-
|
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 * @
|
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 * @
|
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 * @
|
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 * @
|
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 * @
|
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
|
],
|
@@ -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, {}>;
|
package/dist/react/icon/index.js
CHANGED
@@ -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, {}>;
|
package/dist/react/text/index.js
CHANGED
@@ -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