@muonic/muon 0.0.2-beta.0 → 0.0.2-beta.2
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 +14 -0
- package/README.md +38 -0
- package/components/card/story.js +3 -3
- package/components/cta/story.js +2 -2
- package/components/detail/story.js +2 -2
- package/components/form/story.js +4 -4
- package/components/icon/story.js +1 -1
- package/components/image/story.js +1 -1
- package/components/inputter/story.js +2 -2
- package/package.json +1 -1
- package/rollup.config.mjs +2 -2
- package/storybook/stories.js +1 -4
- package/tests/components/card/card.test.js +1 -1
- package/tests/components/cta/cta.test.js +1 -1
- package/tests/components/form/form.test.js +1 -1
- package/tests/components/icon/icon.test.js +1 -1
- package/tests/components/image/image.test.js +1 -1
- package/tests/components/inputter/inputter.test.js +1 -1
- package/tests/mixins/detail.test.js +2 -2
- package/tests/mixins/form-element.test.js +2 -2
- package/tests/mixins/mask.test.js +1 -1
- package/tests/mixins/validation.test.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.2](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.1...v0.0.2-beta.2) (2023-02-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* rename package to alias ([a9e41bc](https://github.com/centrica-engineering/muon/commit/a9e41bccb73188ba931bec65f9f51ff74b27169c))
|
|
11
|
+
|
|
12
|
+
### [0.0.2-beta.1](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.0...v0.0.2-beta.1) (2022-10-31)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* array arg type ([1dd2131](https://github.com/centrica-engineering/muon/commit/1dd213106ec8aec21d62c795e8af332d4f550aac))
|
|
18
|
+
|
|
5
19
|
### [0.0.2-beta.0](https://github.com/centrica-engineering/muon/compare/v0.0.2-alpha.2...v0.0.2-beta.0) (2022-10-04)
|
|
6
20
|
|
|
7
21
|
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Muon
|
|
2
|
+
|
|
3
|
+
> ⚠️ Experimental. Use at your own risk. Things might change and break.
|
|
4
|
+
|
|
5
|
+
Muon is a versatile token based pattern library using webcomponents for Design Systems. It provides a foundation for building a Design System and a set of components to get you started. Unlike other pattern libraries we don't provide a set of styles, we provide a set of tokens that can be used to build your own styles.
|
|
6
|
+
|
|
7
|
+
This means you can quickly get your own branded components up and running without having to write any CSS or JavaScript.
|
|
8
|
+
|
|
9
|
+
## Useful links
|
|
10
|
+
|
|
11
|
+
- [Component documentation](https://centrica-engineering.github.io/muon/)
|
|
12
|
+
- [Storybook](https://main--61dd6b0ee46d9a004ac27873.chromatic.com/)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install --save @muonic/muon
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Create a new project
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm init muon
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Changelog
|
|
27
|
+
|
|
28
|
+
See [CHANGELOG.md](CHANGELOG.md)
|
|
29
|
+
|
|
30
|
+
## Design tokens and themes
|
|
31
|
+
|
|
32
|
+
Muon uses design tokens to provide a consistent look and feel across all components. Tokens are defined in a JSON file and can be used to build your own styles. Muon provides a default theme that can be used as a starting point for your own theme.
|
|
33
|
+
|
|
34
|
+
[MORE TO EXPLAIN HERE]
|
|
35
|
+
|
|
36
|
+
## Creating a new component
|
|
37
|
+
|
|
38
|
+
[MORE TO EXPLAIN HERE]
|
package/components/card/story.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Card } from '@muonic/muon/components/card';
|
|
2
|
-
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
-
import { StandardLink as CTALink } from '../cta/story';
|
|
4
1
|
import { staticHTML, unsafeStatic } from '@muonic/muon';
|
|
2
|
+
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
+
import { Card } from '@muon/components/card';
|
|
4
|
+
import { StandardLink as CTALink } from '@muon/components/cta/story';
|
|
5
5
|
|
|
6
6
|
const details = setup('card', Card);
|
|
7
7
|
|
package/components/cta/story.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Cta } from '@muonic/muon/components/cta';
|
|
2
|
-
import setup from '@muonic/muon/storybook/stories';
|
|
3
1
|
import { staticHTML } from '@muonic/muon';
|
|
2
|
+
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
+
import { Cta } from '@muon/components/cta';
|
|
4
4
|
|
|
5
5
|
const details = setup('cta', Cta);
|
|
6
6
|
const tag = details.getTagEl();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Detail } from '@muonic/muon/components/detail';
|
|
2
|
-
import setup from '@muonic/muon/storybook/stories';
|
|
3
1
|
import { staticHTML, unsafeStatic } from '@muonic/muon';
|
|
2
|
+
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
+
import { Detail } from '@muon/components/detail';
|
|
4
4
|
|
|
5
5
|
const details = setup('detail', Detail);
|
|
6
6
|
|
package/components/form/story.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Form } from '@muonic/muon/components/form';
|
|
2
|
-
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
-
import * as InputterStories from '../inputter/story';
|
|
4
|
-
import { Standard as SubmitCTA } from '../cta/story';
|
|
5
1
|
import { staticHTML } from '@muonic/muon';
|
|
2
|
+
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
+
import { Form } from '@muon/components/form';
|
|
4
|
+
import * as InputterStories from '@muon/components/inputter/story';
|
|
5
|
+
import { Standard as SubmitCTA } from '@muon/components/cta/story';
|
|
6
6
|
|
|
7
7
|
const details = setup('form', Form);
|
|
8
8
|
|
package/components/icon/story.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Image } from '@muonic/muon/components/image';
|
|
2
1
|
import setup from '@muonic/muon/storybook/stories';
|
|
2
|
+
import { Image } from '@muon/components/image';
|
|
3
3
|
import { IMAGE_CONFIG_RATIOS } from '@muonic/muon/build/tokens/es6/muon-tokens.mjs';
|
|
4
4
|
|
|
5
5
|
const details = setup('image', Image);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { staticHTML, unsafeStatic } from '@muonic/muon';
|
|
2
2
|
import setup from '@muonic/muon/storybook/stories';
|
|
3
|
+
import { Inputter } from '@muon/components/inputter';
|
|
3
4
|
import customValidation from '@muon/utils/validation/index.js';
|
|
4
|
-
import { staticHTML, unsafeStatic } from '@muonic/muon';
|
|
5
5
|
|
|
6
6
|
const details = setup('inputter', Inputter);
|
|
7
7
|
|
package/package.json
CHANGED
package/rollup.config.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import merge from 'deepmerge';
|
|
2
|
-
import { rollupPlugins } from '@muonic/muon/scripts/rollup-plugins.mjs';
|
|
3
2
|
import virtual from '@rollup/plugin-virtual';
|
|
4
3
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
5
4
|
import { createBasicConfig } from '@open-wc/building-rollup';
|
|
6
|
-
import { componentDefiner, getDestination } from '@muonic/muon/scripts/utils/index.mjs';
|
|
7
5
|
import path from 'path';
|
|
6
|
+
import { componentDefiner, getDestination } from '@muonic/muon/scripts/utils/index.mjs';
|
|
7
|
+
import { rollupPlugins } from '@muonic/muon/scripts/rollup-plugins.mjs';
|
|
8
8
|
|
|
9
9
|
const config = createBasicConfig();
|
|
10
10
|
const input = 'index.js';
|
package/storybook/stories.js
CHANGED
|
@@ -55,10 +55,7 @@ export default (name, el) => {
|
|
|
55
55
|
} else if (typeof args[arg] === 'number') {
|
|
56
56
|
return `${arg}=${args[arg]}`;
|
|
57
57
|
} else if (Array.isArray(args[arg])) {
|
|
58
|
-
|
|
59
|
-
return `"${arrayVal}"`;
|
|
60
|
-
});
|
|
61
|
-
return `${arg}=[${arrayArgs}]`;
|
|
58
|
+
return `${arg}='${JSON.stringify(args[arg])}'`;
|
|
62
59
|
} else {
|
|
63
60
|
return `${arg}="${args[arg]}"`;
|
|
64
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
|
-
import { defaultChecks } from '../../helpers';
|
|
4
3
|
import { Card } from '@muonic/muon/components/card';
|
|
4
|
+
import { defaultChecks } from '../../helpers';
|
|
5
5
|
|
|
6
6
|
const tag = unsafeStatic(defineCE(Card));
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
|
-
import { defaultChecks } from '../../helpers';
|
|
4
3
|
import { Cta } from '@muonic/muon/components/cta';
|
|
4
|
+
import { defaultChecks } from '../../helpers';
|
|
5
5
|
|
|
6
6
|
const tagName = defineCE(Cta);
|
|
7
7
|
const tag = unsafeStatic(tagName);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
3
|
import sinon from 'sinon';
|
|
4
|
-
import { defaultChecks } from '../../helpers';
|
|
5
4
|
import { Form } from '@muonic/muon/components/form';
|
|
6
5
|
import { Inputter } from '@muonic/muon/components/inputter';
|
|
7
6
|
import { Cta } from '@muonic/muon/components/cta';
|
|
7
|
+
import { defaultChecks } from '../../helpers';
|
|
8
8
|
|
|
9
9
|
const tagName = defineCE(Form);
|
|
10
10
|
const tag = unsafeStatic(tagName);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
3
|
import sinon from 'sinon';
|
|
4
|
-
import { defaultChecks } from '../../helpers';
|
|
5
4
|
import { Icon } from '@muonic/muon/components/icon';
|
|
5
|
+
import { defaultChecks } from '../../helpers';
|
|
6
6
|
|
|
7
7
|
const tagName = defineCE(Icon);
|
|
8
8
|
const tag = unsafeStatic(tagName);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic, nextFrame } from '@open-wc/testing';
|
|
3
3
|
import sinon from 'sinon';
|
|
4
|
-
import { defaultChecks } from '../../helpers';
|
|
5
4
|
import { Image } from '@muonic/muon/components/image';
|
|
5
|
+
import { defaultChecks } from '../../helpers';
|
|
6
6
|
|
|
7
7
|
const tagName = defineCE(Image);
|
|
8
8
|
const tag = unsafeStatic(tagName);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
|
+
import sinon from 'sinon';
|
|
3
4
|
import { Inputter } from '@muonic/muon/components/inputter';
|
|
4
5
|
import { defaultChecks, fillIn } from '../../helpers';
|
|
5
|
-
import sinon from 'sinon';
|
|
6
6
|
|
|
7
7
|
const tagName = defineCE(Inputter);
|
|
8
8
|
const tag = unsafeStatic(tagName);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic, waitUntil } from '@open-wc/testing';
|
|
3
|
-
import { MuonElement } from '@muonic/muon';
|
|
4
3
|
import sinon from 'sinon';
|
|
5
|
-
import {
|
|
4
|
+
import { MuonElement } from '@muonic/muon';
|
|
6
5
|
import { DetailMixin } from '@muonic/muon/mixins/detail-mixin';
|
|
7
6
|
import { Detail } from '@muonic/muon/components/detail';
|
|
7
|
+
import { defaultChecks } from '../helpers';
|
|
8
8
|
|
|
9
9
|
const MuonDetailElement = class extends DetailMixin(MuonElement) {};
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
|
-
import { FormElementMixin } from '@muonic/muon/mixins/form-element-mixin';
|
|
4
|
-
import { MuonElement, classMap } from '@muonic/muon';
|
|
5
3
|
import sinon from 'sinon';
|
|
4
|
+
import { MuonElement, classMap } from '@muonic/muon';
|
|
5
|
+
import { FormElementMixin } from '@muonic/muon/mixins/form-element-mixin';
|
|
6
6
|
import { defaultChecks, fillIn, selectEvent } from '../helpers';
|
|
7
7
|
|
|
8
8
|
const MuonFormElement = class extends FormElementMixin(MuonElement) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic, waitUntil } from '@open-wc/testing';
|
|
3
|
+
import sinon from 'sinon';
|
|
3
4
|
import { MuonElement } from '@muonic/muon';
|
|
4
5
|
import { MaskMixin } from '@muonic/muon/mixins/mask-mixin';
|
|
5
6
|
import { defaultChecks, fillIn } from '../helpers';
|
|
6
|
-
import sinon from 'sinon';
|
|
7
7
|
|
|
8
8
|
const Inputter = class extends MaskMixin(MuonElement) {
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';
|
|
3
|
-
import { MuonElement } from '@muonic/muon';
|
|
4
3
|
import sinon from 'sinon';
|
|
5
|
-
import {
|
|
4
|
+
import { MuonElement } from '@muonic/muon';
|
|
6
5
|
import { ValidationMixin } from '@muonic/muon/mixins/validation-mixin';
|
|
6
|
+
import { defaultChecks, fillIn, selectEvent } from '../helpers';
|
|
7
7
|
|
|
8
8
|
const MuonValidationElement = class extends ValidationMixin(MuonElement) {
|
|
9
9
|
|