@muonic/muon 0.0.2-beta.3 → 0.0.2-beta.30
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/CHANGELOG.md +143 -0
- package/components/card/src/card-component.js +1 -0
- package/components/card/src/card-styles.css +3 -3
- package/components/card/src/design-tokens.json +12 -0
- package/components/cta/src/cta-component.js +22 -13
- package/components/cta/src/cta-styles.css +8 -7
- package/components/cta/src/design-tokens.json +22 -0
- package/components/detail/src/detail-component.js +2 -2
- package/components/form/src/form-component.js +8 -4
- package/components/icon/src/icon-component.js +4 -4
- package/components/inputter/src/design-tokens.json +217 -35
- package/components/inputter/src/inputter-component.js +6 -1
- package/components/inputter/src/inputter-extends.css +171 -0
- package/components/inputter/src/inputter-styles-detail.css +13 -10
- package/components/inputter/src/inputter-styles.css +71 -109
- package/components/inputter/src/inputter-styles.slotted.css +150 -2
- package/css/default.css +1 -0
- package/css/global.css +28 -8
- package/css/reset.css +12 -0
- package/directives/svg-loader-directive.js +7 -5
- package/directives/tokens.json +9 -0
- package/muon-element/index.js +52 -37
- package/package.json +38 -34
- package/rollup.config.mjs +4 -1
- package/scripts/rollup-plugins.mjs +102 -36
- package/scripts/style-dictionary.mjs +1 -1
- package/scripts/utils/index.mjs +74 -23
- package/storybook/server.config.mjs +3 -0
- package/storybook/stories.js +3 -4
- package/tests/components/card/__snapshots__/card.test.snap.js +3 -12
- package/tests/components/cta/__snapshots__/cta.test.snap.js +18 -17
- package/tests/components/cta/cta.test.js +31 -5
- package/tests/components/icon/__snapshots__/icon.test.snap.js +6 -12
- package/tests/components/icon/icon.test.js +1 -1
- package/tests/components/image/__snapshots__/image.test.snap.js +13 -52
- package/tests/components/inputter/__snapshots__/inputter.test.snap.js +56 -192
- package/tests/helpers/index.js +12 -3
- package/tests/mixins/__snapshots__/detail.test.snap.js +6 -26
- package/tests/mixins/muon-element.test.js +1 -4
- package/tests/scripts/utils/cta-component.js +17 -0
- package/tests/scripts/utils/font.css.template +4 -0
- package/tests/scripts/utils/muon.config.prefix.no-included.json +12 -0
- package/tests/scripts/utils/muon.config.prefix.override.json +13 -0
- package/tests/scripts/utils/muon.config.style-dictionary.test.json +14 -0
- package/tests/scripts/utils/muon.config.test.json +2 -2
- package/tests/scripts/utils/style-dictionary.config.mjs +32 -0
- package/tests/scripts/utils/utils-test.mjs +112 -11
- package/tokens/theme/font.json +4 -0
- package/tokens/utils/formats/reference.js +17 -13
- package/tokens/utils/transforms/color.js +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,149 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.2-beta.30](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.29...v0.0.2-beta.30) (2023-07-24)
|
|
6
|
+
|
|
7
|
+
### [0.0.2-beta.29](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.28...v0.0.2-beta.29) (2023-07-20)
|
|
8
|
+
|
|
9
|
+
### [0.0.2-beta.28](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.27...v0.0.2-beta.28) (2023-07-14)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* when no type or autocomplete ([480f989](https://github.com/centrica-engineering/muon/commit/480f989ab75a0496758af4af2364484093abded5))
|
|
15
|
+
|
|
16
|
+
### [0.0.2-beta.27](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.26...v0.0.2-beta.27) (2023-07-12)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* inputter wrapper max-width ([194e0f0](https://github.com/centrica-engineering/muon/commit/194e0f0ee326188fb7041c3d7b59661b78fc7112))
|
|
22
|
+
|
|
23
|
+
### [0.0.2-beta.26](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.25...v0.0.2-beta.26) (2023-07-10)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* light dom setup ([531aae1](https://github.com/centrica-engineering/muon/commit/531aae1e85f4cb94c3aa02a857aa4ce354221ace))
|
|
29
|
+
|
|
30
|
+
### [0.0.2-beta.25](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.24...v0.0.2-beta.25) (2023-07-05)
|
|
31
|
+
|
|
32
|
+
### [0.0.2-beta.24](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.23...v0.0.2-beta.24) (2023-07-04)
|
|
33
|
+
|
|
34
|
+
### [0.0.2-beta.23](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.22...v0.0.2-beta.23) (2023-07-04)
|
|
35
|
+
|
|
36
|
+
### [0.0.2-beta.22](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.21...v0.0.2-beta.22) (2023-06-15)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* styles only for boolean attributes ([a0c4de3](https://github.com/centrica-engineering/muon/commit/a0c4de35b78b5e78ae6a9bcba35904cb1e7bc8e1))
|
|
42
|
+
|
|
43
|
+
### [0.0.2-beta.21](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.20...v0.0.2-beta.21) (2023-06-08)
|
|
44
|
+
|
|
45
|
+
### [0.0.2-beta.20](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.19...v0.0.2-beta.20) (2023-06-06)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* pull back width and font default styles ([9afa041](https://github.com/centrica-engineering/muon/commit/9afa0419ebb9475d31506da795e12a8a123291a1))
|
|
51
|
+
|
|
52
|
+
### [0.0.2-beta.19](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.18...v0.0.2-beta.19) (2023-06-05)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* nested import ([a5cb81c](https://github.com/centrica-engineering/muon/commit/a5cb81ca28b041af98728bce26726d3a214c4c28))
|
|
58
|
+
|
|
59
|
+
### [0.0.2-beta.18](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.17...v0.0.2-beta.18) (2023-06-05)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
64
|
+
* finding all component files ([1216b2f](https://github.com/centrica-engineering/muon/commit/1216b2f45347220bd19c521c3dd5c196dba38200))
|
|
65
|
+
|
|
66
|
+
### [0.0.2-beta.17](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.16...v0.0.2-beta.17) (2023-05-31)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* switch to light-dom ([5e1c67b](https://github.com/centrica-engineering/muon/commit/5e1c67bbb9be239a0717103685be0a2e24e51990))
|
|
72
|
+
|
|
73
|
+
### [0.0.2-beta.16](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.15...v0.0.2-beta.16) (2023-05-31)
|
|
74
|
+
|
|
75
|
+
### [0.0.2-beta.15](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.14...v0.0.2-beta.15) (2023-05-24)
|
|
76
|
+
|
|
77
|
+
### [0.0.2-beta.14](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.13...v0.0.2-beta.14) (2023-05-23)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* include lineLength token ([f5d00f9](https://github.com/centrica-engineering/muon/commit/f5d00f94078e7f49d055c9b42da041fa95c788ee))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Bug Fixes
|
|
86
|
+
|
|
87
|
+
* commands ([351c59e](https://github.com/centrica-engineering/muon/commit/351c59e3e98d1aa2181ae3a6e498ee6fcb3ea891))
|
|
88
|
+
* default ([c766154](https://github.com/centrica-engineering/muon/commit/c766154159d7c4c8fcca59ed2d096bdbcf5d94c2))
|
|
89
|
+
* snapshots ([444b5ba](https://github.com/centrica-engineering/muon/commit/444b5bae280c962909088d2abc24b10b18170193))
|
|
90
|
+
|
|
91
|
+
### [0.0.2-beta.13](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.12...v0.0.2-beta.13) (2023-05-15)
|
|
92
|
+
|
|
93
|
+
### [0.0.2-beta.12](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.11...v0.0.2-beta.12) (2023-05-09)
|
|
94
|
+
|
|
95
|
+
### [0.0.2-beta.11](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.10...v0.0.2-beta.11) (2023-05-05)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Bug Fixes
|
|
99
|
+
|
|
100
|
+
* revert dev-storybook ([1b7d07b](https://github.com/centrica-engineering/muon/commit/1b7d07b97456efcbb774ea15da3ae7e3dac52aa2))
|
|
101
|
+
|
|
102
|
+
### [0.0.2-beta.10](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.9...v0.0.2-beta.10) (2023-05-04)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Bug Fixes
|
|
106
|
+
|
|
107
|
+
* move adding lightdom on perform ([41e7843](https://github.com/centrica-engineering/muon/commit/41e7843f57342e84d719a86a34de0ce1862081dc))
|
|
108
|
+
|
|
109
|
+
### [0.0.2-beta.9](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.8...v0.0.2-beta.9) (2023-04-21)
|
|
110
|
+
|
|
111
|
+
### [0.0.2-beta.8](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.7...v0.0.2-beta.8) (2023-04-20)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### Bug Fixes
|
|
115
|
+
|
|
116
|
+
* check if parentElement exists ([2055f37](https://github.com/centrica-engineering/muon/commit/2055f377a03194ebd28fa74f38597dca8e612507))
|
|
117
|
+
* loading and disabled cta ([0569563](https://github.com/centrica-engineering/muon/commit/056956309c202557ac708e17ad4ed5a5760c3887))
|
|
118
|
+
* url state ([023fb86](https://github.com/centrica-engineering/muon/commit/023fb86886cf9d0dbe432fbae1b97e3cb220d5d8))
|
|
119
|
+
|
|
120
|
+
### [0.0.2-beta.7](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.6...v0.0.2-beta.7) (2023-04-04)
|
|
121
|
+
|
|
122
|
+
### [0.0.2-beta.6](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.5...v0.0.2-beta.6) (2023-03-28)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Features
|
|
126
|
+
|
|
127
|
+
* postcss extend ([7608e26](https://github.com/centrica-engineering/muon/commit/7608e26e1f1876abacbca562fb6724bebc0cbf50))
|
|
128
|
+
|
|
129
|
+
### [0.0.2-beta.5](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.4...v0.0.2-beta.5) (2023-02-27)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Features
|
|
133
|
+
|
|
134
|
+
* global styles ([6705c22](https://github.com/centrica-engineering/muon/commit/6705c224f7664e1ab6ad9d7261921474de1bf0fc))
|
|
135
|
+
|
|
136
|
+
### [0.0.2-beta.4](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.3...v0.0.2-beta.4) (2023-02-23)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Features
|
|
140
|
+
|
|
141
|
+
* config extend style dictionary ([70bbdc7](https://github.com/centrica-engineering/muon/commit/70bbdc7d7cae3e103da8420d1699c6143d833c07))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### Bug Fixes
|
|
145
|
+
|
|
146
|
+
* enable style dictionary extension ([d718dd9](https://github.com/centrica-engineering/muon/commit/d718dd93676976d0b4fcb25acb7572b15c5d05c5))
|
|
147
|
+
|
|
5
148
|
### [0.0.2-beta.3](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.2...v0.0.2-beta.3) (2023-02-21)
|
|
6
149
|
|
|
7
150
|
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
& .card {
|
|
7
7
|
background-color: $CARD_BACKGROUND_COLOR;
|
|
8
|
-
border-width:
|
|
9
|
-
border-style:
|
|
8
|
+
border-width: $CARD_BORDER_WIDTH;
|
|
9
|
+
border-style: $CARD_BORDER_STYLE;
|
|
10
10
|
border-color: $CARD_BORDER_COLOR;
|
|
11
|
-
border-radius:
|
|
11
|
+
border-radius: $CARD_BORDER_RADIUS;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
"color": {
|
|
29
29
|
"description": "Border color. Inherits the text color.",
|
|
30
30
|
"value": "{ card.color.value }"
|
|
31
|
+
},
|
|
32
|
+
"width": {
|
|
33
|
+
"description": "Border width.",
|
|
34
|
+
"value": "2px"
|
|
35
|
+
},
|
|
36
|
+
"radius": {
|
|
37
|
+
"description": "Border radius.",
|
|
38
|
+
"value": "0"
|
|
39
|
+
},
|
|
40
|
+
"style": {
|
|
41
|
+
"description": "Border style.",
|
|
42
|
+
"value": "solid"
|
|
31
43
|
}
|
|
32
44
|
}
|
|
33
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MuonElement, html, classMap, styleMap, ScopedElementsMixin, literal, staticHTML
|
|
1
|
+
import { MuonElement, html, classMap, styleMap, ScopedElementsMixin, literal, staticHTML } from '@muonic/muon';
|
|
2
2
|
import { Icon } from '@muon/components/icon';
|
|
3
3
|
import {
|
|
4
4
|
CTA_CONFIG_TYPE,
|
|
@@ -25,9 +25,9 @@ export class Cta extends ScopedElementsMixin(MuonElement) {
|
|
|
25
25
|
|
|
26
26
|
static get properties() {
|
|
27
27
|
return {
|
|
28
|
-
loading: { type: Boolean },
|
|
28
|
+
loading: { type: Boolean, reflect: true },
|
|
29
29
|
loadingMessage: { type: String, attribute: 'loading-message' },
|
|
30
|
-
disabled: { type: Boolean },
|
|
30
|
+
disabled: { type: Boolean, reflect: true },
|
|
31
31
|
icon: { type: String },
|
|
32
32
|
href: { type: String },
|
|
33
33
|
_iconPosition: { type: String, state: true },
|
|
@@ -51,7 +51,7 @@ export class Cta extends ScopedElementsMixin(MuonElement) {
|
|
|
51
51
|
|
|
52
52
|
get classes() {
|
|
53
53
|
const parentElement = this.parentElement;
|
|
54
|
-
const isDisabled = parentElement
|
|
54
|
+
const isDisabled = parentElement?.getAttribute('disabled') || this.disabled;
|
|
55
55
|
|
|
56
56
|
return {
|
|
57
57
|
cta: true,
|
|
@@ -100,7 +100,7 @@ export class Cta extends ScopedElementsMixin(MuonElement) {
|
|
|
100
100
|
const isInLink = parentName === 'A';
|
|
101
101
|
const isInBtn = parentName === 'BUTTON';
|
|
102
102
|
const isInNativeForm = parentName === 'FORM';
|
|
103
|
-
const isDisabled = parentElement
|
|
103
|
+
const isDisabled = parentElement?.getAttribute('disabled') || this.disabled;
|
|
104
104
|
let element = this.href?.length > 0 ? 'a' : 'div';
|
|
105
105
|
|
|
106
106
|
if (
|
|
@@ -109,23 +109,35 @@ export class Cta extends ScopedElementsMixin(MuonElement) {
|
|
|
109
109
|
!isInLink &&
|
|
110
110
|
!isInBtn &&
|
|
111
111
|
!isDisabled &&
|
|
112
|
+
!this.loading &&
|
|
112
113
|
!this._isButton
|
|
113
114
|
) {
|
|
114
115
|
if (!this.getAttribute('role')) {
|
|
115
116
|
this.setAttribute('role', 'button');
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
this.setAttribute('tabindex', '0');
|
|
120
|
-
}
|
|
119
|
+
this.setAttribute('tabindex', '0');
|
|
121
120
|
}
|
|
122
121
|
|
|
123
|
-
if (isDisabled) {
|
|
122
|
+
if (isDisabled || this.loading) {
|
|
124
123
|
if (!this.getAttribute('aria-disabled')) {
|
|
125
124
|
this.setAttribute('aria-disabled', 'true');
|
|
126
125
|
}
|
|
126
|
+
|
|
127
|
+
this.setAttribute('tabindex', '-1');
|
|
127
128
|
} else {
|
|
128
129
|
this.removeAttribute('aria-disabled');
|
|
130
|
+
|
|
131
|
+
if (
|
|
132
|
+
this.getAttribute('tabindex') === '-1' &&
|
|
133
|
+
(this._isButton ||
|
|
134
|
+
isInBtn ||
|
|
135
|
+
isInNativeForm ||
|
|
136
|
+
isInLink ||
|
|
137
|
+
element === 'a')
|
|
138
|
+
) {
|
|
139
|
+
this.removeAttribute('tabindex');
|
|
140
|
+
}
|
|
129
141
|
}
|
|
130
142
|
|
|
131
143
|
if (isInNativeForm || this._isButton) {
|
|
@@ -137,14 +149,11 @@ export class Cta extends ScopedElementsMixin(MuonElement) {
|
|
|
137
149
|
this.removeAttribute('tabindex');
|
|
138
150
|
}
|
|
139
151
|
|
|
140
|
-
// eslint-disable-next-line no-nested-ternary
|
|
141
|
-
const tabIndex = isInLink ? -1 : element !== 'div' ? 0 : undefined;
|
|
142
|
-
|
|
143
152
|
// eslint-disable-next-line no-nested-ternary
|
|
144
153
|
const elementTag = element === 'button' ? literal`button` : element === 'a' ? literal`a` : literal`div`;
|
|
145
154
|
|
|
146
155
|
return staticHTML`
|
|
147
|
-
<${elementTag} .href=${element === 'a' && this.href} ?disabled=${element === 'button' && (this.loading || this.disabled)}
|
|
156
|
+
<${elementTag} .href=${element === 'a' && this.href} ?disabled=${element === 'button' && (this.loading || this.disabled)} aria-label="${this.textContent}" class=${classMap(this.classes)} style=${styleMap(this.inlineStyles)}>
|
|
148
157
|
${content}
|
|
149
158
|
</${elementTag}>
|
|
150
159
|
`;
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
background-color: $CTA_BACKGROUND_COLOR;
|
|
38
38
|
color: $CTA_COLOR;
|
|
39
39
|
border-color: $CTA_BORDER_COLOR;
|
|
40
|
-
border-width:
|
|
41
|
-
border-style:
|
|
42
|
-
border-radius:
|
|
40
|
+
border-width: $CTA_BORDER_WIDTH;
|
|
41
|
+
border-style: $CTA_BORDER_STYLE;
|
|
42
|
+
border-radius: $CTA_BORDER_RADIUS;
|
|
43
43
|
|
|
44
44
|
&:hover {
|
|
45
45
|
background-color: $CTA_HOVER_BACKGROUND_COLOR;
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
& .label-holder {
|
|
85
|
-
min-inline-size:
|
|
86
|
-
max-inline-size:
|
|
85
|
+
min-inline-size: $CTA_LABEL_MIN_WIDTH;
|
|
86
|
+
max-inline-size: $CTA_LABEL_MAX_WIDTH;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
& .icon {
|
|
@@ -96,9 +96,10 @@
|
|
|
96
96
|
|
|
97
97
|
/* TODO: move these `[disabled]` and `[loading]` styles to default.css */
|
|
98
98
|
|
|
99
|
+
/* NOTE: We add `=""` to enforce styles only for booleans */
|
|
99
100
|
/* stylelint-disable no-descending-specificity */
|
|
100
|
-
:host([disabled]),
|
|
101
|
-
:host([loading]) {
|
|
101
|
+
:host([disabled=""]),
|
|
102
|
+
:host([loading=""]) {
|
|
102
103
|
cursor: auto;
|
|
103
104
|
pointer-events: none;
|
|
104
105
|
}
|
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
"color": {
|
|
29
29
|
"description": "Border color. Inherits the background color.",
|
|
30
30
|
"value": "{ cta.background.color.value }"
|
|
31
|
+
},
|
|
32
|
+
"width": {
|
|
33
|
+
"description": "Border width.",
|
|
34
|
+
"value": "2px"
|
|
35
|
+
},
|
|
36
|
+
"radius": {
|
|
37
|
+
"description": "Border radius.",
|
|
38
|
+
"value": "10px"
|
|
39
|
+
},
|
|
40
|
+
"style": {
|
|
41
|
+
"description": "Border style.",
|
|
42
|
+
"value": "solid"
|
|
31
43
|
}
|
|
32
44
|
},
|
|
33
45
|
"loading": {
|
|
@@ -72,6 +84,16 @@
|
|
|
72
84
|
"value": "{ theme.size.md.value }"
|
|
73
85
|
}
|
|
74
86
|
},
|
|
87
|
+
"label": {
|
|
88
|
+
"minWidth": {
|
|
89
|
+
"description": "The minimum width of the label.",
|
|
90
|
+
"value": "15ch"
|
|
91
|
+
},
|
|
92
|
+
"maxWidth": {
|
|
93
|
+
"description": "The maximum width of the label.",
|
|
94
|
+
"value": "{ theme.font.lineLength.value }"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
75
97
|
"font": {
|
|
76
98
|
"family": {
|
|
77
99
|
"description": "Font family which defaults to sans-serif.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MuonElement
|
|
1
|
+
import { MuonElement } from '@muonic/muon';
|
|
2
2
|
import { DetailMixin } from '@muon/mixins/detail-mixin';
|
|
3
3
|
import styles from './detail-styles.css';
|
|
4
4
|
import {
|
|
@@ -22,6 +22,6 @@ export class Detail extends DetailMixin(MuonElement) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
static get styles() {
|
|
25
|
-
return
|
|
25
|
+
return styles;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, MuonElement
|
|
1
|
+
import { html, MuonElement } from '@muonic/muon';
|
|
2
2
|
import scrollTo from '@muon/utils/scroll';
|
|
3
3
|
import styles from './form-styles.css';
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ export class Form extends MuonElement {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
static get styles() {
|
|
20
|
-
return
|
|
20
|
+
return styles;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
connectedCallback() {
|
|
@@ -73,7 +73,7 @@ export class Form extends MuonElement {
|
|
|
73
73
|
!this._resetButton.loading
|
|
74
74
|
) {
|
|
75
75
|
this._nativeForm.reset();
|
|
76
|
-
Array.from(this.
|
|
76
|
+
Array.from(this._elements).forEach((element) => {
|
|
77
77
|
const componentElement = this._findInputElement(element);
|
|
78
78
|
if (componentElement !== element) {
|
|
79
79
|
componentElement.reset?.();
|
|
@@ -111,6 +111,10 @@ export class Form extends MuonElement {
|
|
|
111
111
|
return validity.isValid;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
get _elements() {
|
|
115
|
+
return this._nativeForm.elements;
|
|
116
|
+
}
|
|
117
|
+
|
|
114
118
|
get _nativeForm() {
|
|
115
119
|
return this.querySelector('form');
|
|
116
120
|
}
|
|
@@ -142,7 +146,7 @@ export class Form extends MuonElement {
|
|
|
142
146
|
validate() {
|
|
143
147
|
let isValid = true;
|
|
144
148
|
// @TODO: Check how this works with form associated
|
|
145
|
-
const validationStates = Array.from(this.
|
|
149
|
+
const validationStates = Array.from(this._elements).reduce((acc, element) => {
|
|
146
150
|
element = this._findInputElement(element);
|
|
147
151
|
const { name } = element;
|
|
148
152
|
const hasBeenSet = acc.filter((el) => el.name === name).length > 0;
|
|
@@ -24,7 +24,7 @@ export class Icon extends MuonElement {
|
|
|
24
24
|
describe: { type: String },
|
|
25
25
|
size: { type: Number },
|
|
26
26
|
category: { type: String },
|
|
27
|
-
|
|
27
|
+
_url: { type: String, state: true }
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -39,14 +39,14 @@ export class Icon extends MuonElement {
|
|
|
39
39
|
this.name = ICON_CONFIG_NAME;
|
|
40
40
|
this.category = ICON_CONFIG_CATEGORY;
|
|
41
41
|
this.allSizes = ICON_CONFIG_SIZES;
|
|
42
|
-
this.
|
|
42
|
+
this._url = ICON_CONFIG_URL;
|
|
43
43
|
this.describe = '';
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
get classes() {
|
|
47
47
|
return {
|
|
48
48
|
icon: true,
|
|
49
|
-
[this.
|
|
49
|
+
[this.name]: true
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -81,7 +81,7 @@ export class Icon extends MuonElement {
|
|
|
81
81
|
|
|
82
82
|
return html`
|
|
83
83
|
<div aria-hidden=${ifDefined(hidden)} role=${ifDefined(role)} aria-label=${ifDefined(role && this.describe)} class=${classMap(this.classes)} style=${styleMap(this.inlineStyles)}>
|
|
84
|
-
${svgLoader({ name: this.name, category: this.category, path: this.
|
|
84
|
+
${svgLoader({ name: this.name, category: this.category, path: this._url })}
|
|
85
85
|
</div>
|
|
86
86
|
`;
|
|
87
87
|
}
|