@rak200/ui 0.2.0 → 0.2.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/README.md +6 -0
- package/dist/field.d.ts +39 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +160 -0
- package/dist/field.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +2 -0
- package/dist/tokens.js.map +1 -1
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -28,6 +28,12 @@ npm install @rak200/ui
|
|
|
28
28
|
import '@rak200/ui';
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
+
<ui-field>
|
|
32
|
+
<label slot="label">Amount</label>
|
|
33
|
+
<input type="number" />
|
|
34
|
+
<span slot="help">In BRL, two decimals.</span>
|
|
35
|
+
</ui-field>
|
|
36
|
+
|
|
31
37
|
<ui-button>Save</ui-button>
|
|
32
38
|
<ui-button variant="secondary">Cancel</ui-button>
|
|
33
39
|
<ui-button disabled>Unavailable</ui-button>
|
package/dist/field.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Form plumbing: a label bound to a control, help and error text bound through
|
|
4
|
+
* `aria-describedby`, and `aria-invalid` while the field is in error.
|
|
5
|
+
*
|
|
6
|
+
* Written once here rather than per control. Every form component in the v0 cut needs the
|
|
7
|
+
* same wiring, and five copies of it are five chances to get one subtly wrong.
|
|
8
|
+
*
|
|
9
|
+
* **Everything is slotted, and that is forced rather than chosen.** An ARIA relationship
|
|
10
|
+
* by IDREF does not cross a shadow boundary: a `<label for>` rendered in this element's
|
|
11
|
+
* shadow root leaves `control.labels` empty, and an `aria-describedby` pointing into it
|
|
12
|
+
* dangles. So the label, the control, the help and the error all live in the host's tree,
|
|
13
|
+
* where the association is the platform's job — and this element only generates the ids
|
|
14
|
+
* and points them at each other.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <ui-field>
|
|
19
|
+
* <label slot="label">Amount</label>
|
|
20
|
+
* <input type="number" />
|
|
21
|
+
* <span slot="help">In BRL, two decimals.</span>
|
|
22
|
+
* <span slot="error">Amount is required.</span>
|
|
23
|
+
* </ui-field>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class UiField extends LitElement {
|
|
27
|
+
#private;
|
|
28
|
+
static readonly styles: import("lit").CSSResult;
|
|
29
|
+
connectedCallback(): void;
|
|
30
|
+
disconnectedCallback(): void;
|
|
31
|
+
firstUpdated(): void;
|
|
32
|
+
render(): TemplateResult;
|
|
33
|
+
}
|
|
34
|
+
declare global {
|
|
35
|
+
interface HTMLElementTagNameMap {
|
|
36
|
+
'ui-field': UiField;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAQ,SAAQ,UAAU;;IACnC,gBAAyB,MAAM,0BAuB7B;IAeO,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAK5B,YAAY,IAAI,IAAI;IAIpB,MAAM,IAAI,cAAc;CAyFpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,UAAU,EAAE,OAAO,CAAC;KACvB;CACJ"}
|
package/dist/field.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { LitElement, css, html } from 'lit';
|
|
2
|
+
/** Distinguishes one field's generated ids from another's. */
|
|
3
|
+
let sequence = 0;
|
|
4
|
+
/**
|
|
5
|
+
* Form plumbing: a label bound to a control, help and error text bound through
|
|
6
|
+
* `aria-describedby`, and `aria-invalid` while the field is in error.
|
|
7
|
+
*
|
|
8
|
+
* Written once here rather than per control. Every form component in the v0 cut needs the
|
|
9
|
+
* same wiring, and five copies of it are five chances to get one subtly wrong.
|
|
10
|
+
*
|
|
11
|
+
* **Everything is slotted, and that is forced rather than chosen.** An ARIA relationship
|
|
12
|
+
* by IDREF does not cross a shadow boundary: a `<label for>` rendered in this element's
|
|
13
|
+
* shadow root leaves `control.labels` empty, and an `aria-describedby` pointing into it
|
|
14
|
+
* dangles. So the label, the control, the help and the error all live in the host's tree,
|
|
15
|
+
* where the association is the platform's job — and this element only generates the ids
|
|
16
|
+
* and points them at each other.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```html
|
|
20
|
+
* <ui-field>
|
|
21
|
+
* <label slot="label">Amount</label>
|
|
22
|
+
* <input type="number" />
|
|
23
|
+
* <span slot="help">In BRL, two decimals.</span>
|
|
24
|
+
* <span slot="error">Amount is required.</span>
|
|
25
|
+
* </ui-field>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class UiField extends LitElement {
|
|
29
|
+
static { this.styles = css `
|
|
30
|
+
:host {
|
|
31
|
+
display: block;
|
|
32
|
+
font-family: var(--ui-font, system-ui, sans-serif);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.stack {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: calc(var(--ui-space, 0.5rem) / 2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
slot[name='help']::slotted(*) {
|
|
42
|
+
color: var(--ui-color-text, #1f2937);
|
|
43
|
+
font-size: 0.875em;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Colour is not the only cue — the error text says what is wrong, and
|
|
47
|
+
aria-invalid marks the control regardless of styling. */
|
|
48
|
+
slot[name='error']::slotted(*) {
|
|
49
|
+
color: var(--ui-color-danger, #b91c1c);
|
|
50
|
+
font-size: 0.875em;
|
|
51
|
+
}
|
|
52
|
+
`; }
|
|
53
|
+
/** The prefix for this instance's generated ids, allocated on first association. */
|
|
54
|
+
#uid;
|
|
55
|
+
/**
|
|
56
|
+
* Watches the light DOM for anything that changes the association.
|
|
57
|
+
*
|
|
58
|
+
* Built here rather than on connection so it is never absent: a disconnect that has to
|
|
59
|
+
* ask whether the observer exists is a branch no test can reach.
|
|
60
|
+
*/
|
|
61
|
+
#observer = new MutationObserver(() => {
|
|
62
|
+
this.#associate();
|
|
63
|
+
});
|
|
64
|
+
connectedCallback() {
|
|
65
|
+
super.connectedCallback();
|
|
66
|
+
// The host may swap the error text without adding or removing an element, which is
|
|
67
|
+
// what a re-render looks like from here — so characterData matters as much as
|
|
68
|
+
// childList, and both can happen below a wrapper.
|
|
69
|
+
this.#observer.observe(this, { childList: true, characterData: true, subtree: true });
|
|
70
|
+
}
|
|
71
|
+
disconnectedCallback() {
|
|
72
|
+
this.#observer.disconnect();
|
|
73
|
+
super.disconnectedCallback();
|
|
74
|
+
}
|
|
75
|
+
firstUpdated() {
|
|
76
|
+
this.#associate();
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return html `
|
|
80
|
+
<div class="stack" part="stack">
|
|
81
|
+
<slot name="label"></slot>
|
|
82
|
+
<slot></slot>
|
|
83
|
+
<slot name="help"></slot>
|
|
84
|
+
<slot name="error"></slot>
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
/** The light-DOM child filling a slot, or `undefined` when nothing does. */
|
|
89
|
+
#slotted(name) {
|
|
90
|
+
const selector = name === null ? ':scope > :not([slot])' : `:scope > [slot='${name}']`;
|
|
91
|
+
const found = this.querySelector(selector);
|
|
92
|
+
return found instanceof HTMLElement ? found : undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Points the label, the help and the error at the control.
|
|
96
|
+
*
|
|
97
|
+
* A host-supplied `id` is never overwritten — it may already be referenced by something
|
|
98
|
+
* this element cannot see.
|
|
99
|
+
*/
|
|
100
|
+
#associate() {
|
|
101
|
+
const control = this.#slotted(null);
|
|
102
|
+
if (control === undefined) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// Stryker disable next-line UpdateOperator: the contract is that two fields on one
|
|
106
|
+
// page get different ids, and a decrementing counter delivers that as well as an
|
|
107
|
+
// incrementing one — `ui-field--1` is as valid an id as `ui-field-1`. No input
|
|
108
|
+
// distinguishes the two, so this is an equivalent mutant rather than a weak test.
|
|
109
|
+
const uid = (this.#uid ??= `ui-field-${String(++sequence)}`);
|
|
110
|
+
if (control.id === '') {
|
|
111
|
+
control.id = `${uid}-control`;
|
|
112
|
+
}
|
|
113
|
+
const label = this.#slotted('label');
|
|
114
|
+
if (label instanceof HTMLLabelElement) {
|
|
115
|
+
label.htmlFor = control.id;
|
|
116
|
+
}
|
|
117
|
+
const help = this.#describer(this.#slotted('help'), `${uid}-help`);
|
|
118
|
+
const error = this.#describer(this.#slotted('error'), `${uid}-error`);
|
|
119
|
+
// The error comes first: a screen reader announces descriptions in order, and the
|
|
120
|
+
// user needs to know what is wrong before reading how the value should look.
|
|
121
|
+
//
|
|
122
|
+
// The error SUPPLEMENTS the help rather than replacing it. Help text is usually the
|
|
123
|
+
// format requirement, which is exactly the error suggestion the user needs in order
|
|
124
|
+
// to recover (WCAG 3.3.3) — dropping it at the moment it becomes useful is the
|
|
125
|
+
// opposite of helping.
|
|
126
|
+
const described = [error, help].filter((id) => id !== undefined);
|
|
127
|
+
if (described.length > 0) {
|
|
128
|
+
control.setAttribute('aria-describedby', described.join(' '));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
control.removeAttribute('aria-describedby');
|
|
132
|
+
}
|
|
133
|
+
if (error === undefined) {
|
|
134
|
+
control.removeAttribute('aria-invalid');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
control.setAttribute('aria-invalid', 'true');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The id to describe the control by, or `undefined` when the element is absent or has
|
|
142
|
+
* nothing to say. An element rendered empty — the shape a framework produces for
|
|
143
|
+
* "no error yet" — must not mark the control invalid.
|
|
144
|
+
*/
|
|
145
|
+
#describer(element, fallbackId) {
|
|
146
|
+
if (element === undefined || element.textContent.trim() === '') {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
if (element.id === '') {
|
|
150
|
+
element.id = fallbackId;
|
|
151
|
+
}
|
|
152
|
+
return element.id;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Stryker disable next-line StringLiteral: the registration runs once, at import, inside
|
|
156
|
+
// the warm process Stryker switches mutants in — so by the time a mutant on this line is
|
|
157
|
+
// active the element is already defined under the original name, and no test can observe
|
|
158
|
+
// the change. Outside the runner's reach, not an equivalent mutant.
|
|
159
|
+
customElements.define('ui-field', UiField);
|
|
160
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAEjE,8DAA8D;AAC9D,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,OAAQ,SAAQ,UAAU;aACV,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;KAuBpC,CAAC;IAEF,oFAAoF;IACpF,IAAI,CAAU;IAEd;;;;;OAKG;IACM,SAAS,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;QAC3C,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;IAEM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AAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC7D,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;YACpB,OAAO,CAAC,EAAE,GAAG,UAAU,CAAC;QAC5B,CAAC;QAED,OAAO,OAAO,CAAC,EAAE,CAAC;IACtB,CAAC;;AAGL,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,oEAAoE;AACpE,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAc,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAc,MAAM,aAAa,CAAC"}
|
package/dist/tokens.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* setting it anywhere above the component — no build step, no theme object, no fork.
|
|
11
11
|
*/
|
|
12
12
|
/** The token names this package defines, as they appear in CSS. */
|
|
13
|
-
export declare const tokens: readonly ["--ui-color-accent", "--ui-color-accent-contrast", "--ui-color-surface", "--ui-color-text", "--ui-color-focus", "--ui-radius", "--ui-space", "--ui-font"];
|
|
13
|
+
export declare const tokens: readonly ["--ui-color-accent", "--ui-color-accent-contrast", "--ui-color-surface", "--ui-color-text", "--ui-color-focus", "--ui-color-danger", "--ui-radius", "--ui-space", "--ui-font"];
|
|
14
14
|
/** A CSS custom property this package defines. */
|
|
15
15
|
export type Token = (typeof tokens)[number];
|
|
16
16
|
/**
|
package/dist/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mEAAmE;AACnE,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mEAAmE;AACnE,eAAO,MAAM,MAAM,0LAUT,CAAC;AAEX,kDAAkD;AAClD,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAUpD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAIxC"}
|
package/dist/tokens.js
CHANGED
|
@@ -16,6 +16,7 @@ export const tokens = [
|
|
|
16
16
|
'--ui-color-surface',
|
|
17
17
|
'--ui-color-text',
|
|
18
18
|
'--ui-color-focus',
|
|
19
|
+
'--ui-color-danger',
|
|
19
20
|
'--ui-radius',
|
|
20
21
|
'--ui-space',
|
|
21
22
|
'--ui-font',
|
|
@@ -32,6 +33,7 @@ export const defaults = {
|
|
|
32
33
|
'--ui-color-surface': '#ffffff',
|
|
33
34
|
'--ui-color-text': '#1f2937',
|
|
34
35
|
'--ui-color-focus': '#f59e0b',
|
|
36
|
+
'--ui-color-danger': '#b91c1c',
|
|
35
37
|
'--ui-radius': '0.375rem',
|
|
36
38
|
'--ui-space': '0.5rem',
|
|
37
39
|
'--ui-font': 'system-ui, sans-serif',
|
package/dist/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mEAAmE;AACnE,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,mBAAmB;IACnB,4BAA4B;IAC5B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,aAAa;IACb,YAAY;IACZ,WAAW;CACL,CAAC;AAKX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAoC;IACrD,mBAAmB,EAAE,SAAS;IAC9B,4BAA4B,EAAE,SAAS;IACvC,oBAAoB,EAAE,SAAS;IAC/B,iBAAiB,EAAE,SAAS;IAC5B,kBAAkB,EAAE,SAAS;IAC7B,aAAa,EAAE,UAAU;IACzB,YAAY,EAAE,QAAQ;IACtB,WAAW,EAAE,uBAAuB;CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjF,OAAO,YAAY,IAAI,KAAK,CAAC;AACjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mEAAmE;AACnE,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,mBAAmB;IACnB,4BAA4B;IAC5B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,YAAY;IACZ,WAAW;CACL,CAAC;AAKX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAoC;IACrD,mBAAmB,EAAE,SAAS;IAC9B,4BAA4B,EAAE,SAAS;IACvC,oBAAoB,EAAE,SAAS;IAC/B,iBAAiB,EAAE,SAAS;IAC5B,kBAAkB,EAAE,SAAS;IAC7B,mBAAmB,EAAE,SAAS;IAC9B,aAAa,EAAE,UAAU;IACzB,YAAY,EAAE,QAAQ;IACtB,WAAW,EAAE,uBAAuB;CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjF,OAAO,YAAY,IAAI,KAAK,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rak200/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Host-agnostic custom-element UI components for the rak200 ecosystem",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "rak200 <rak.ricardo@windowslive.com>",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": [
|
|
28
|
-
"./dist/*.js"
|
|
28
|
+
"./dist/*.js",
|
|
29
|
+
"./src/*.ts"
|
|
29
30
|
],
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public"
|
|
@@ -39,15 +40,20 @@
|
|
|
39
40
|
"coverage": "coverage-floor",
|
|
40
41
|
"scan": "semgrep scan --config=p/typescript --severity=ERROR --sarif -o semgrep.sarif",
|
|
41
42
|
"mutation": "stryker run",
|
|
42
|
-
"build": "tsc -p tsconfig.build.json"
|
|
43
|
+
"build": "tsc -p tsconfig.build.json",
|
|
44
|
+
"storybook": "storybook dev -p 6006",
|
|
45
|
+
"build-storybook": "storybook build"
|
|
43
46
|
},
|
|
44
47
|
"dependencies": {
|
|
45
48
|
"lit": "^3.3.3"
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
48
|
-
"@rak200/coding-standard-ts": "github:rak200/coding-standard-ts#0.4.
|
|
51
|
+
"@rak200/coding-standard-ts": "github:rak200/coding-standard-ts#0.4.3",
|
|
52
|
+
"@storybook/addon-a11y": "^10.5.8",
|
|
53
|
+
"@storybook/web-components-vite": "^10.5.8",
|
|
49
54
|
"@types/node": "^26.1.2",
|
|
50
55
|
"@vitest/browser-playwright": "^4.1.10",
|
|
51
|
-
"axe-core": "^4.13.0"
|
|
56
|
+
"axe-core": "^4.13.0",
|
|
57
|
+
"storybook": "^10.5.8"
|
|
52
58
|
}
|
|
53
59
|
}
|