@muonic/muon 0.0.2-experimental-176-bef4daf.0 → 0.0.2-experimental-178-7990088.0
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 +2 -0
- package/components/card/src/card-component.js +1 -0
- package/components/inputter/src/inputter-styles.slotted.css +1 -1
- package/muon-element/index.js +6 -5
- package/package.json +35 -35
- package/scripts/utils/index.mjs +1 -1
- package/tests/components/inputter/__snapshots__/inputter.test.snap.js +53 -144
- package/tests/mixins/muon-element.test.js +1 -1
- package/tests/scripts/utils/utils-test.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.9](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.8...v0.0.2-beta.9) (2023-04-21)
|
|
6
|
+
|
|
5
7
|
### [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)
|
|
6
8
|
|
|
7
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/* NOTE: targeting Safari only */
|
|
3
|
-
@media not all and (min-resolution: 0.001dpcm) {
|
|
3
|
+
@media not all and (min-resolution: 0.001dpcm) { /* stylelint-disable-line media-feature-range-notation */
|
|
4
4
|
/*
|
|
5
5
|
NOTE: These styles are duplicated from inputter-styles.css
|
|
6
6
|
due to this bug in Webkit: https://bugs.webkit.org/show_bug.cgi?id=223814
|
package/muon-element/index.js
CHANGED
|
@@ -16,9 +16,12 @@ export const MuonElementMixin = (superClass) => class extends superClass {
|
|
|
16
16
|
super();
|
|
17
17
|
|
|
18
18
|
this.type = 'standard';
|
|
19
|
+
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
performUpdate() {
|
|
22
|
+
super.performUpdate();
|
|
21
23
|
|
|
24
|
+
this.__addLightDOM();
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
/**
|
|
@@ -26,7 +29,6 @@ export const MuonElementMixin = (superClass) => class extends superClass {
|
|
|
26
29
|
* This currently has some limitations:
|
|
27
30
|
* - Cannot easily target the element with attributes.
|
|
28
31
|
* - With this implementation CSS can be written outside of host, leaking styles.
|
|
29
|
-
* - :host might not be the right use here as users might believe they can use its other features.
|
|
30
32
|
*
|
|
31
33
|
* @returns {CSSResultOrNative} - Return modified css that is injected.
|
|
32
34
|
* @private
|
|
@@ -46,14 +48,13 @@ export const MuonElementMixin = (superClass) => class extends superClass {
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
const clonedCSS = Object.assign({}, css);
|
|
49
|
-
|
|
50
51
|
const nodeName = this.nodeName.toLowerCase();
|
|
51
52
|
const parentNode = this.getRootNode();
|
|
52
53
|
const parentNodeType = parentNode.nodeName;
|
|
53
54
|
const styleName = `${nodeName}-styles`;
|
|
54
55
|
|
|
55
|
-
// First need to replace
|
|
56
|
-
clonedCSS.cssText = clonedCSS.cssText.replace(
|
|
56
|
+
// First need to replace `light-dom` with the component name
|
|
57
|
+
clonedCSS.cssText = clonedCSS.cssText.replace(/light-dom/g, nodeName);
|
|
57
58
|
|
|
58
59
|
// How we add the styles depends on where it is being added, HTMLDocument or another ShadowDom.
|
|
59
60
|
// If the Document we don't want to add multiple times
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muonic/muon",
|
|
3
|
-
"version": "0.0.2-experimental-
|
|
3
|
+
"version": "0.0.2-experimental-178-7990088.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,51 +17,51 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@open-wc/building-rollup": "2.
|
|
21
|
-
"@open-wc/scoped-elements": "2.1.
|
|
22
|
-
"@rollup/plugin-alias": "
|
|
23
|
-
"@rollup/plugin-json": "
|
|
24
|
-
"@rollup/plugin-node-resolve": "
|
|
25
|
-
"@rollup/plugin-replace": "
|
|
26
|
-
"@rollup/plugin-virtual": "
|
|
27
|
-
"@web/dev-server": "0.1
|
|
28
|
-
"@web/dev-server-rollup": "0.
|
|
29
|
-
"@web/dev-server-storybook": "0.
|
|
20
|
+
"@open-wc/building-rollup": "2.2.3",
|
|
21
|
+
"@open-wc/scoped-elements": "2.1.5",
|
|
22
|
+
"@rollup/plugin-alias": "5.0.0",
|
|
23
|
+
"@rollup/plugin-json": "6.0.0",
|
|
24
|
+
"@rollup/plugin-node-resolve": "15.0.2",
|
|
25
|
+
"@rollup/plugin-replace": "5.0.2",
|
|
26
|
+
"@rollup/plugin-virtual": "3.0.1",
|
|
27
|
+
"@web/dev-server": "0.2.1",
|
|
28
|
+
"@web/dev-server-rollup": "0.5.0",
|
|
29
|
+
"@web/dev-server-storybook": "0.7.1",
|
|
30
30
|
"@web/storybook-prebuilt": "0.1.34",
|
|
31
|
-
"@webcomponents/scoped-custom-element-registry": "0.0.
|
|
32
|
-
"app-root-path": "3.
|
|
33
|
-
"autoprefixer": "10.4.
|
|
31
|
+
"@webcomponents/scoped-custom-element-registry": "0.0.9",
|
|
32
|
+
"app-root-path": "3.1.0",
|
|
33
|
+
"autoprefixer": "10.4.14",
|
|
34
34
|
"chokidar": "3.5.3",
|
|
35
35
|
"chroma-js": "2.4.2",
|
|
36
36
|
"command-line-args": "5.2.1",
|
|
37
|
-
"deepmerge": "4.
|
|
38
|
-
"glob": "
|
|
37
|
+
"deepmerge": "4.3.1",
|
|
38
|
+
"glob": "10.2.2",
|
|
39
39
|
"glob-to-regexp": "0.4.1",
|
|
40
|
-
"lit": "2.7.
|
|
40
|
+
"lit": "2.7.3",
|
|
41
41
|
"lodash": "4.17.21",
|
|
42
42
|
"path-is-inside": "1.0.2",
|
|
43
|
-
"postcss": "8.4.
|
|
43
|
+
"postcss": "8.4.23",
|
|
44
44
|
"postcss-clean": "1.2.2",
|
|
45
|
-
"postcss-extend-rule": "
|
|
46
|
-
"postcss-import": "
|
|
47
|
-
"postcss-preset-env": "
|
|
48
|
-
"postcss-simple-vars": "
|
|
49
|
-
"rollup-plugin-lit-css": "4.0.
|
|
45
|
+
"postcss-extend-rule": "4.0.0",
|
|
46
|
+
"postcss-import": "15.1.0",
|
|
47
|
+
"postcss-preset-env": "8.3.2",
|
|
48
|
+
"postcss-simple-vars": "7.0.1",
|
|
49
|
+
"rollup-plugin-lit-css": "4.0.1",
|
|
50
50
|
"rollup-plugin-styles": "4.0.0",
|
|
51
|
-
"style-dictionary": "3.
|
|
52
|
-
"typescript": "
|
|
53
|
-
"web-component-analyzer": "1.1.
|
|
51
|
+
"style-dictionary": "3.8.0",
|
|
52
|
+
"typescript": "5.0.4",
|
|
53
|
+
"web-component-analyzer": "1.1.7"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@open-wc/testing": "3.1.
|
|
57
|
-
"@web/dev-server-esbuild": "0.
|
|
58
|
-
"@web/test-runner": "0.
|
|
59
|
-
"@web/test-runner-browserstack": "0.
|
|
60
|
-
"@web/test-runner-playwright": "0.
|
|
61
|
-
"ava": "
|
|
62
|
-
"c8": "
|
|
63
|
-
"esmock": "
|
|
64
|
-
"sinon": "
|
|
56
|
+
"@open-wc/testing": "3.1.8",
|
|
57
|
+
"@web/dev-server-esbuild": "0.4.1",
|
|
58
|
+
"@web/test-runner": "0.16.1",
|
|
59
|
+
"@web/test-runner-browserstack": "0.6.1",
|
|
60
|
+
"@web/test-runner-playwright": "0.10.0",
|
|
61
|
+
"ava": "5.2.0",
|
|
62
|
+
"c8": "7.13.0",
|
|
63
|
+
"esmock": "2.2.1",
|
|
64
|
+
"sinon": "15.0.4"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=16.13.0"
|
package/scripts/utils/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import StyleDictionary from 'style-dictionary';
|
|
|
4
4
|
import formatHelpers from 'style-dictionary/lib/common/formatHelpers/index.js';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import appRoot from 'app-root-path';
|
|
7
|
-
import glob from 'glob';
|
|
7
|
+
import { glob } from 'glob';
|
|
8
8
|
import globToRegExp from 'glob-to-regexp';
|
|
9
9
|
import fs from 'fs';
|
|
10
10
|
import path from 'path';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* @web/test-runner snapshot v1 */
|
|
2
2
|
export const snapshots = {};
|
|
3
|
+
|
|
3
4
|
snapshots["Inputter standard default"] =
|
|
4
5
|
`<div
|
|
5
6
|
class="inputter"
|
|
@@ -77,6 +78,21 @@ snapshots["Inputter helper detail open"] =
|
|
|
77
78
|
`;
|
|
78
79
|
/* end snapshot Inputter helper detail open */
|
|
79
80
|
|
|
81
|
+
snapshots["Inputter text disabled"] =
|
|
82
|
+
`<div
|
|
83
|
+
class="has-disabled inputter"
|
|
84
|
+
style=""
|
|
85
|
+
>
|
|
86
|
+
<slot name="label">
|
|
87
|
+
</slot>
|
|
88
|
+
<div class="wrapper">
|
|
89
|
+
<slot>
|
|
90
|
+
</slot>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
`;
|
|
94
|
+
/* end snapshot Inputter text disabled */
|
|
95
|
+
|
|
80
96
|
snapshots["Inputter text mask text"] =
|
|
81
97
|
`<div
|
|
82
98
|
class="has-mask inputter"
|
|
@@ -98,7 +114,7 @@ snapshots["Inputter text mask text"] =
|
|
|
98
114
|
`;
|
|
99
115
|
/* end snapshot Inputter text mask text */
|
|
100
116
|
|
|
101
|
-
snapshots["Inputter text validation"] =
|
|
117
|
+
snapshots["Inputter text validation on input"] =
|
|
102
118
|
`<div
|
|
103
119
|
class="inputter"
|
|
104
120
|
style=""
|
|
@@ -111,100 +127,91 @@ snapshots["Inputter text validation"] =
|
|
|
111
127
|
</div>
|
|
112
128
|
</div>
|
|
113
129
|
`;
|
|
114
|
-
/* end snapshot Inputter text validation */
|
|
130
|
+
/* end snapshot Inputter text validation on input */
|
|
115
131
|
|
|
116
|
-
snapshots["Inputter
|
|
132
|
+
snapshots["Inputter text validation on change"] =
|
|
117
133
|
`<div
|
|
118
|
-
class="inputter
|
|
134
|
+
class="inputter"
|
|
119
135
|
style=""
|
|
120
136
|
>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
</span>
|
|
137
|
+
<slot name="label">
|
|
138
|
+
</slot>
|
|
124
139
|
<div class="wrapper">
|
|
125
140
|
<slot>
|
|
126
141
|
</slot>
|
|
127
142
|
</div>
|
|
128
143
|
</div>
|
|
129
144
|
`;
|
|
130
|
-
/* end snapshot Inputter
|
|
145
|
+
/* end snapshot Inputter text validation on change */
|
|
131
146
|
|
|
132
|
-
snapshots["Inputter
|
|
147
|
+
snapshots["Inputter text mask & validation"] =
|
|
133
148
|
`<div
|
|
134
|
-
class="inputter"
|
|
135
|
-
style=""
|
|
149
|
+
class="has-mask inputter"
|
|
150
|
+
style="--maxlength:4;"
|
|
136
151
|
>
|
|
137
152
|
<slot name="label">
|
|
138
153
|
</slot>
|
|
139
154
|
<div class="wrapper">
|
|
140
155
|
<slot>
|
|
141
156
|
</slot>
|
|
157
|
+
<div
|
|
158
|
+
aria-hidden="true"
|
|
159
|
+
class="input-mask"
|
|
160
|
+
>
|
|
161
|
+
0000
|
|
162
|
+
</div>
|
|
142
163
|
</div>
|
|
143
164
|
</div>
|
|
144
165
|
`;
|
|
145
|
-
/* end snapshot Inputter
|
|
166
|
+
/* end snapshot Inputter text mask & validation */
|
|
146
167
|
|
|
147
|
-
snapshots["Inputter
|
|
168
|
+
snapshots["Inputter radio standard radio"] =
|
|
148
169
|
`<div
|
|
149
|
-
class="inputter"
|
|
170
|
+
class="inputter radio"
|
|
150
171
|
style=""
|
|
151
172
|
>
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
What is this?
|
|
156
|
-
</div>
|
|
173
|
+
<span class="input-heading">
|
|
174
|
+
What is your heating source?
|
|
175
|
+
</span>
|
|
157
176
|
<div class="wrapper">
|
|
158
177
|
<slot>
|
|
159
178
|
</slot>
|
|
160
179
|
</div>
|
|
161
180
|
</div>
|
|
162
181
|
`;
|
|
163
|
-
/* end snapshot Inputter
|
|
182
|
+
/* end snapshot Inputter radio standard radio */
|
|
164
183
|
|
|
165
|
-
snapshots["Inputter
|
|
184
|
+
snapshots["Inputter radio radio mask"] =
|
|
166
185
|
`<div
|
|
167
|
-
class="inputter"
|
|
168
|
-
style=""
|
|
186
|
+
class="has-mask inputter radio"
|
|
187
|
+
style="--maxlength:3;"
|
|
169
188
|
>
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<div slot="heading">
|
|
174
|
-
What is this?
|
|
175
|
-
</div>
|
|
176
|
-
<slot name="tip-details">
|
|
177
|
-
</slot>
|
|
178
|
-
</inputter-detail>
|
|
189
|
+
<span class="input-heading">
|
|
190
|
+
What is your heating source?
|
|
191
|
+
</span>
|
|
179
192
|
<div class="wrapper">
|
|
180
193
|
<slot>
|
|
181
194
|
</slot>
|
|
182
195
|
</div>
|
|
183
196
|
</div>
|
|
184
197
|
`;
|
|
185
|
-
/* end snapshot Inputter
|
|
198
|
+
/* end snapshot Inputter radio radio mask */
|
|
186
199
|
|
|
187
|
-
snapshots["Inputter
|
|
200
|
+
snapshots["Inputter radio radio mask validation"] =
|
|
188
201
|
`<div
|
|
189
|
-
class="inputter"
|
|
190
|
-
style=""
|
|
202
|
+
class="has-mask inputter radio"
|
|
203
|
+
style="--maxlength:3;"
|
|
191
204
|
>
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
<div slot="heading">
|
|
196
|
-
What is this?
|
|
197
|
-
</div>
|
|
198
|
-
<slot name="tip-details">
|
|
199
|
-
</slot>
|
|
200
|
-
</inputter-detail>
|
|
205
|
+
<span class="input-heading">
|
|
206
|
+
What is your heating source?
|
|
207
|
+
</span>
|
|
201
208
|
<div class="wrapper">
|
|
202
209
|
<slot>
|
|
203
210
|
</slot>
|
|
204
211
|
</div>
|
|
205
212
|
</div>
|
|
206
213
|
`;
|
|
207
|
-
/* end snapshot Inputter
|
|
214
|
+
/* end snapshot Inputter radio radio mask validation */
|
|
208
215
|
|
|
209
216
|
snapshots["Inputter select standard select"] =
|
|
210
217
|
`<div
|
|
@@ -257,101 +264,3 @@ snapshots["Inputter date standard date"] =
|
|
|
257
264
|
`;
|
|
258
265
|
/* end snapshot Inputter date standard date */
|
|
259
266
|
|
|
260
|
-
snapshots["Inputter text disabled"] =
|
|
261
|
-
`<div
|
|
262
|
-
class="has-disabled inputter"
|
|
263
|
-
style=""
|
|
264
|
-
>
|
|
265
|
-
<slot name="label">
|
|
266
|
-
</slot>
|
|
267
|
-
<div class="wrapper">
|
|
268
|
-
<slot>
|
|
269
|
-
</slot>
|
|
270
|
-
</div>
|
|
271
|
-
</div>
|
|
272
|
-
`;
|
|
273
|
-
/* end snapshot Inputter text disabled */
|
|
274
|
-
|
|
275
|
-
snapshots["Inputter text mask & validation"] =
|
|
276
|
-
`<div
|
|
277
|
-
class="has-mask inputter"
|
|
278
|
-
style="--maxlength:4;"
|
|
279
|
-
>
|
|
280
|
-
<slot name="label">
|
|
281
|
-
</slot>
|
|
282
|
-
<div class="wrapper">
|
|
283
|
-
<slot>
|
|
284
|
-
</slot>
|
|
285
|
-
<div
|
|
286
|
-
aria-hidden="true"
|
|
287
|
-
class="input-mask"
|
|
288
|
-
>
|
|
289
|
-
0000
|
|
290
|
-
</div>
|
|
291
|
-
</div>
|
|
292
|
-
</div>
|
|
293
|
-
`;
|
|
294
|
-
/* end snapshot Inputter text mask & validation */
|
|
295
|
-
|
|
296
|
-
snapshots["Inputter radio radio mask"] =
|
|
297
|
-
`<div
|
|
298
|
-
class="has-mask inputter radio"
|
|
299
|
-
style="--maxlength:3;"
|
|
300
|
-
>
|
|
301
|
-
<span class="input-heading">
|
|
302
|
-
What is your heating source?
|
|
303
|
-
</span>
|
|
304
|
-
<div class="wrapper">
|
|
305
|
-
<slot>
|
|
306
|
-
</slot>
|
|
307
|
-
</div>
|
|
308
|
-
</div>
|
|
309
|
-
`;
|
|
310
|
-
/* end snapshot Inputter radio radio mask */
|
|
311
|
-
|
|
312
|
-
snapshots["Inputter radio radio mask validation"] =
|
|
313
|
-
`<div
|
|
314
|
-
class="has-mask inputter radio"
|
|
315
|
-
style="--maxlength:3;"
|
|
316
|
-
>
|
|
317
|
-
<span class="input-heading">
|
|
318
|
-
What is your heating source?
|
|
319
|
-
</span>
|
|
320
|
-
<div class="wrapper">
|
|
321
|
-
<slot>
|
|
322
|
-
</slot>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
`;
|
|
326
|
-
/* end snapshot Inputter radio radio mask validation */
|
|
327
|
-
|
|
328
|
-
snapshots["Inputter text validation on input"] =
|
|
329
|
-
`<div
|
|
330
|
-
class="inputter"
|
|
331
|
-
style=""
|
|
332
|
-
>
|
|
333
|
-
<slot name="label">
|
|
334
|
-
</slot>
|
|
335
|
-
<div class="wrapper">
|
|
336
|
-
<slot>
|
|
337
|
-
</slot>
|
|
338
|
-
</div>
|
|
339
|
-
</div>
|
|
340
|
-
`;
|
|
341
|
-
/* end snapshot Inputter text validation on input */
|
|
342
|
-
|
|
343
|
-
snapshots["Inputter text validation on change"] =
|
|
344
|
-
`<div
|
|
345
|
-
class="inputter"
|
|
346
|
-
style=""
|
|
347
|
-
>
|
|
348
|
-
<slot name="label">
|
|
349
|
-
</slot>
|
|
350
|
-
<div class="wrapper">
|
|
351
|
-
<slot>
|
|
352
|
-
</slot>
|
|
353
|
-
</div>
|
|
354
|
-
</div>
|
|
355
|
-
`;
|
|
356
|
-
/* end snapshot Inputter text validation on change */
|
|
357
|
-
|
|
@@ -190,7 +190,7 @@ testRunner('sourceFilesAnalyzer', async (t) => {
|
|
|
190
190
|
inputter: ['helper', 'classes', 'inlineStyles', 'slottedStyles', 'isHelperOpen', 'isPristine', 'isDirty', 'validity', 'validationMessage', 'validation', 'disableNative', 'showMessage', 'name', 'value', 'labelID', 'heading', 'mask', 'separator', 'type'],
|
|
191
191
|
'inputter-detail': ['icon', 'classes', 'inlineStyles', 'standardTemplate', 'open', 'type']
|
|
192
192
|
};
|
|
193
|
-
t.deepEqual(jsonResult.tags?.map((tag) => tag.name), components);
|
|
193
|
+
t.deepEqual(jsonResult.tags?.map((tag) => tag.name).sort(), components.sort());
|
|
194
194
|
|
|
195
195
|
components.forEach((component) => {
|
|
196
196
|
t.deepEqual(jsonResult.tags.filter((tag) => tag.name === component)[0].properties?.map(
|