@atomic-ui/ui 0.1.1 → 0.1.3
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/base/tokens.d.ts +6 -0
- package/dist/{chunk-TRLEYGGH.js → chunk-2RBYVWZT.js} +2 -2
- package/dist/{chunk-SSNCGJ5W.js → chunk-3OSL2HMN.js} +2 -2
- package/dist/{chunk-KAU3V65B.js → chunk-4KFHQBH2.js} +2 -2
- package/dist/chunk-4Y3HJBJY.js +73 -0
- package/dist/chunk-4Y3HJBJY.js.map +1 -0
- package/dist/{chunk-J5KAMJ2N.js → chunk-5NUF7ZQA.js} +21 -10
- package/dist/chunk-5NUF7ZQA.js.map +1 -0
- package/dist/{chunk-T4HSPWA7.js → chunk-6MLXFFH4.js} +2 -2
- package/dist/{chunk-GU4UQKJP.js → chunk-6UDDZQDK.js} +2 -2
- package/dist/{chunk-NEWN44LO.js → chunk-A4CJ2F3J.js} +3 -3
- package/dist/{chunk-GEBLDC2J.js → chunk-CGMDIZPO.js} +3 -3
- package/dist/{chunk-IHEEUM3M.js → chunk-DIZCGSJA.js} +2 -2
- package/dist/{chunk-BUWE6XGX.js → chunk-GGODB3GY.js} +23 -3
- package/dist/chunk-GGODB3GY.js.map +1 -0
- package/dist/{chunk-BOLZMDAS.js → chunk-HWNY6U5F.js} +2 -2
- package/dist/{chunk-AC6G7X3G.js → chunk-IBTOZOGI.js} +2 -2
- package/dist/{chunk-HJ2V635J.js → chunk-LFOWTFMR.js} +3 -3
- package/dist/{chunk-XEN5NV55.js → chunk-MAMBT7BZ.js} +3 -3
- package/dist/{chunk-T63FI4ET.js → chunk-OBCSDZHP.js} +3 -3
- package/dist/{chunk-Z4KZG2E3.js → chunk-PDXOPY22.js} +3 -3
- package/dist/{chunk-7T34CRBF.js → chunk-QYHWR6C5.js} +3 -3
- package/dist/{chunk-TOTVL3YH.js → chunk-S3EQO33M.js} +2 -2
- package/dist/{chunk-BBWMRF5N.js → chunk-TIKX5POO.js} +2 -2
- package/dist/chunk-TIKX5POO.js.map +1 -0
- package/dist/{chunk-KC6RKWO6.js → chunk-TZD7IVVQ.js} +2 -2
- package/dist/{chunk-6HZA6A3L.js → chunk-ZXCSQ6MK.js} +2 -2
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.js +2 -2
- package/dist/components/button.d.ts +1 -0
- package/dist/components/button.js +2 -2
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +3 -3
- package/dist/components/date-input.js +3 -3
- package/dist/components/dialog.js +2 -2
- package/dist/components/grid.d.ts +39 -1
- package/dist/components/grid.js +2 -2
- package/dist/components/help.js +2 -2
- package/dist/components/layout.d.ts +31 -0
- package/dist/components/layout.js +2 -2
- package/dist/components/link.js +2 -2
- package/dist/components/media.js +2 -2
- package/dist/components/price.js +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/select.js +3 -3
- package/dist/components/summary-list.js +2 -2
- package/dist/components/table.js +2 -2
- package/dist/components/text-input.js +3 -3
- package/dist/components/textarea.js +3 -3
- package/dist/index.js +22 -22
- package/package.json +2 -2
- package/dist/chunk-4YAA7EML.js +0 -43
- package/dist/chunk-4YAA7EML.js.map +0 -1
- package/dist/chunk-BBWMRF5N.js.map +0 -1
- package/dist/chunk-BUWE6XGX.js.map +0 -1
- package/dist/chunk-J5KAMJ2N.js.map +0 -1
- /package/dist/{chunk-TRLEYGGH.js.map → chunk-2RBYVWZT.js.map} +0 -0
- /package/dist/{chunk-SSNCGJ5W.js.map → chunk-3OSL2HMN.js.map} +0 -0
- /package/dist/{chunk-KAU3V65B.js.map → chunk-4KFHQBH2.js.map} +0 -0
- /package/dist/{chunk-T4HSPWA7.js.map → chunk-6MLXFFH4.js.map} +0 -0
- /package/dist/{chunk-GU4UQKJP.js.map → chunk-6UDDZQDK.js.map} +0 -0
- /package/dist/{chunk-NEWN44LO.js.map → chunk-A4CJ2F3J.js.map} +0 -0
- /package/dist/{chunk-GEBLDC2J.js.map → chunk-CGMDIZPO.js.map} +0 -0
- /package/dist/{chunk-IHEEUM3M.js.map → chunk-DIZCGSJA.js.map} +0 -0
- /package/dist/{chunk-BOLZMDAS.js.map → chunk-HWNY6U5F.js.map} +0 -0
- /package/dist/{chunk-AC6G7X3G.js.map → chunk-IBTOZOGI.js.map} +0 -0
- /package/dist/{chunk-HJ2V635J.js.map → chunk-LFOWTFMR.js.map} +0 -0
- /package/dist/{chunk-XEN5NV55.js.map → chunk-MAMBT7BZ.js.map} +0 -0
- /package/dist/{chunk-T63FI4ET.js.map → chunk-OBCSDZHP.js.map} +0 -0
- /package/dist/{chunk-Z4KZG2E3.js.map → chunk-PDXOPY22.js.map} +0 -0
- /package/dist/{chunk-7T34CRBF.js.map → chunk-QYHWR6C5.js.map} +0 -0
- /package/dist/{chunk-TOTVL3YH.js.map → chunk-S3EQO33M.js.map} +0 -0
- /package/dist/{chunk-KC6RKWO6.js.map → chunk-TZD7IVVQ.js.map} +0 -0
- /package/dist/{chunk-6HZA6A3L.js.map → chunk-ZXCSQ6MK.js.map} +0 -0
package/dist/base/tokens.d.ts
CHANGED
|
@@ -66,3 +66,9 @@ export declare const space: (step: number) => CSSResult;
|
|
|
66
66
|
export declare const fontSize: (name: string) => CSSResult;
|
|
67
67
|
export declare const lineHeight: (name: string) => CSSResult;
|
|
68
68
|
export declare const fontWeight: (name: string) => CSSResult;
|
|
69
|
+
/**
|
|
70
|
+
* Space above and below a section, from the spacing scale: `none`, `sm`,
|
|
71
|
+
* `md`, `lg` or `xl`, set by `space-above` and `space-below`. A section names
|
|
72
|
+
* a step rather than a size, so a page keeps the brand's rhythm.
|
|
73
|
+
*/
|
|
74
|
+
export declare const spaceAround: CSSResult;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
fontWeight,
|
|
6
6
|
space,
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/table.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -99,4 +99,4 @@ customElements.define("impkt-table", ImpktTable);
|
|
|
99
99
|
export {
|
|
100
100
|
ImpktTable
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-2RBYVWZT.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
fontWeight,
|
|
5
5
|
space,
|
|
6
6
|
t
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
8
8
|
|
|
9
9
|
// packages/ui/src/components/alert.ts
|
|
10
10
|
import { html, css, nothing } from "lit";
|
|
@@ -102,4 +102,4 @@ customElements.define("impkt-alert", ImpktAlert);
|
|
|
102
102
|
export {
|
|
103
103
|
ImpktAlert
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-3OSL2HMN.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
focusRing,
|
|
4
4
|
t,
|
|
5
5
|
visuallyHidden
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
7
7
|
|
|
8
8
|
// packages/ui/src/components/link.ts
|
|
9
9
|
import { html, css, nothing } from "lit";
|
|
@@ -62,4 +62,4 @@ customElements.define("impkt-link", ImpktLink);
|
|
|
62
62
|
export {
|
|
63
63
|
ImpktLink
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-4KFHQBH2.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpktElement,
|
|
3
|
+
spaceAround,
|
|
4
|
+
token
|
|
5
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
6
|
+
|
|
7
|
+
// packages/ui/src/components/grid.ts
|
|
8
|
+
import { css, html } from "lit";
|
|
9
|
+
var WIDTHS = {
|
|
10
|
+
"2:1": "2fr 1fr",
|
|
11
|
+
"1:2": "1fr 2fr",
|
|
12
|
+
"3:1": "3fr 1fr",
|
|
13
|
+
"1:3": "1fr 3fr",
|
|
14
|
+
"1:2:1": "1fr 2fr 1fr",
|
|
15
|
+
"2:1:1": "2fr 1fr 1fr",
|
|
16
|
+
"1:1:2": "1fr 1fr 2fr"
|
|
17
|
+
};
|
|
18
|
+
var ImpktGrid = class extends ImpktElement {
|
|
19
|
+
static {
|
|
20
|
+
this.properties = {
|
|
21
|
+
columns: { type: String, reflect: true },
|
|
22
|
+
widths: { type: String, reflect: true },
|
|
23
|
+
gap: { type: String, reflect: true },
|
|
24
|
+
stackOn: { type: String, reflect: true, attribute: "stack-on" },
|
|
25
|
+
align: { type: String, reflect: true },
|
|
26
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
27
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.columns = "two";
|
|
33
|
+
this.widths = "equal";
|
|
34
|
+
this.gap = "md";
|
|
35
|
+
this.stackOn = "phone";
|
|
36
|
+
this.align = "stretch";
|
|
37
|
+
this.spaceAbove = "none";
|
|
38
|
+
this.spaceBelow = "none";
|
|
39
|
+
}
|
|
40
|
+
static {
|
|
41
|
+
this.styles = [...ImpktElement.styles, spaceAround, css`
|
|
42
|
+
:host { display: block; min-inline-size: 0; container-type: inline-size; }
|
|
43
|
+
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${token("layout.gutter.md", "16px")}; align-items: stretch; }
|
|
44
|
+
:host([gap='none']) .columns { gap: 0; }
|
|
45
|
+
:host([gap='sm']) .columns { gap: ${token("layout.gutter.sm", "8px")}; }
|
|
46
|
+
:host([gap='lg']) .columns { gap: ${token("layout.gutter.lg", "32px")}; }
|
|
47
|
+
:host([align='start']) .columns { align-items: start; }
|
|
48
|
+
:host([align='center']) .columns { align-items: center; }
|
|
49
|
+
:host([align='end']) .columns { align-items: end; }
|
|
50
|
+
:host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }
|
|
51
|
+
:host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
52
|
+
:host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
53
|
+
:host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
|
|
54
|
+
:host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
|
|
55
|
+
.column { min-inline-size: 0; overflow-wrap: anywhere; }
|
|
56
|
+
::slotted(*) { max-inline-size: 100%; }
|
|
57
|
+
@container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
58
|
+
@container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
59
|
+
`];
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
const count = this.columns === "one" ? 1 : this.columns === "three" ? 3 : this.columns === "four" ? 4 : 2;
|
|
63
|
+
const fractions = WIDTHS[this.widths]?.split(" ");
|
|
64
|
+
const template = fractions && fractions.length === count ? fractions.map((f) => `minmax(0, ${f})`).join(" ") : "";
|
|
65
|
+
return html`<div class="columns" part="row" style=${template ? `grid-template-columns: ${template}` : ""}>${Array.from({ length: count }, (_, i) => html`<div class="column" part="column"><slot name=${`column-${i + 1}`}></slot></div>`)}</div>`;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
customElements.define("impkt-grid", ImpktGrid);
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
ImpktGrid
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=chunk-4Y3HJBJY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/grid.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { spaceAround, token } from '../base/tokens';\n\n/** Column widths as fractions, for each choice of `widths`. */\nconst WIDTHS: Record<string, string> = {\n '2:1': '2fr 1fr', '1:2': '1fr 2fr', '3:1': '3fr 1fr', '1:3': '1fr 3fr',\n '1:2:1': '1fr 2fr 1fr', '2:1:1': '2fr 1fr 1fr', '1:1:2': '1fr 1fr 2fr',\n};\n\n/**\n * A responsive row with named column slots. Child order stays inside each\n * column; changing a page's visual grid never reorders its reading sequence.\n *\n * Gutters come from the brand's layout, so every grid for a partner keeps the\n * same rhythm. Where the columns stack is a choice, because a three-column\n * row of cards may work on a tablet where two columns of long text do not.\n *\n * @category layout\n * @icon columns\n * @slot column-1 - First column.\n * @slot column-2 - Second column.\n * @slot column-3 - Third column.\n * @slot column-4 - Fourth column.\n */\nexport class ImpktGrid extends ImpktElement {\n static properties = {\n columns: { type: String, reflect: true },\n widths: { type: String, reflect: true },\n gap: { type: String, reflect: true },\n stackOn: { type: String, reflect: true, attribute: 'stack-on' },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare columns: 'one' | 'two' | 'three' | 'four' | 'sidebar-left' | 'sidebar-right';\n /** How wide each column is against the others. Applies when it has as many parts as there are columns. */\n declare widths: 'equal' | '2:1' | '1:2' | '3:1' | '1:3' | '1:2:1' | '2:1:1' | '1:1:2';\n /** The space between columns, from the brand's gutters. */\n declare gap: 'none' | 'sm' | 'md' | 'lg';\n /** The screens on which the columns stack, one above another, in column order. */\n declare stackOn: 'phone' | 'tablet' | 'never';\n /** How columns of different heights line up. */\n declare align: 'stretch' | 'start' | 'center' | 'end';\n /** Space before the grid, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n /** Space after the grid, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n constructor() {\n super();\n this.columns = 'two';\n this.widths = 'equal';\n this.gap = 'md';\n this.stackOn = 'phone';\n this.align = 'stretch';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; min-inline-size: 0; container-type: inline-size; }\n .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${token('layout.gutter.md', '16px')}; align-items: stretch; }\n :host([gap='none']) .columns { gap: 0; }\n :host([gap='sm']) .columns { gap: ${token('layout.gutter.sm', '8px')}; }\n :host([gap='lg']) .columns { gap: ${token('layout.gutter.lg', '32px')}; }\n :host([align='start']) .columns { align-items: start; }\n :host([align='center']) .columns { align-items: center; }\n :host([align='end']) .columns { align-items: end; }\n :host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }\n :host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n :host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }\n :host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }\n .column { min-inline-size: 0; overflow-wrap: anywhere; }\n ::slotted(*) { max-inline-size: 100%; }\n @container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n @container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n `];\n render() {\n const count = this.columns === 'one' ? 1 : this.columns === 'three' ? 3 : this.columns === 'four' ? 4 : 2;\n const fractions = WIDTHS[this.widths]?.split(' ');\n // A width split for a different number of columns would leave a column out, so it is ignored.\n const template = fractions && fractions.length === count ? fractions.map((f) => `minmax(0, ${f})`).join(' ') : '';\n return html`<div class=\"columns\" part=\"row\" style=${template ? `grid-template-columns: ${template}` : ''}>${Array.from({ length: count }, (_, i) => html`<div class=\"column\" part=\"column\"><slot name=${`column-${i + 1}`}></slot></div>`)}</div>`;\n }\n}\ncustomElements.define('impkt-grid', ImpktGrid);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-grid': ImpktGrid } }\n"],"mappings":";;;;;;;AAAA,SAAS,KAAK,YAAY;AAK1B,IAAM,SAAiC;AAAA,EACrC,OAAO;AAAA,EAAW,OAAO;AAAA,EAAW,OAAO;AAAA,EAAW,OAAO;AAAA,EAC7D,SAAS;AAAA,EAAe,SAAS;AAAA,EAAe,SAAS;AAC3D;AAiBO,IAAM,YAAN,cAAwB,aAAa;AAAA,EAC1C;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,QAAQ,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACtC,KAAK,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACnC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,WAAW;AAAA,MAC9D,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,MACpE,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,IACtE;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU;AACf,SAAK,SAAS;AACd,SAAK,MAAM;AACX,SAAK,UAAU;AACf,SAAK,QAAQ;AACb,SAAK,aAAa;AAClB,SAAK,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,SAAO,SAAS,CAAC,GAAG,aAAa,QAAQ,aAAa;AAAA;AAAA,uFAE+B,MAAM,oBAAoB,MAAM,CAAC;AAAA;AAAA,wCAEhF,MAAM,oBAAoB,KAAK,CAAC;AAAA,wCAChC,MAAM,oBAAoB,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAatE;AAAA;AAAA,EACD,SAAS;AACP,UAAM,QAAQ,KAAK,YAAY,QAAQ,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,SAAS,IAAI;AACxG,UAAM,YAAY,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG;AAEhD,UAAM,WAAW,aAAa,UAAU,WAAW,QAAQ,UAAU,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;AAC/G,WAAO,6CAA6C,WAAW,0BAA0B,QAAQ,KAAK,EAAE,IAAI,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM,oDAAoD,UAAU,IAAI,CAAC,EAAE,gBAAgB,CAAC;AAAA,EAC5O;AACF;AACA,eAAe,OAAO,cAAc,SAAS;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// packages/ui/src/base/tokens.ts
|
|
2
|
-
import { unsafeCSS } from "lit";
|
|
2
|
+
import { css, unsafeCSS } from "lit";
|
|
3
3
|
var token = (path, fallback) => unsafeCSS(`var(--impkt-${path.replace(/\./g, "-")}, ${fallback})`);
|
|
4
4
|
var t = {
|
|
5
5
|
brand: token("color.brand.default", "#1f4ed8"),
|
|
@@ -45,10 +45,20 @@ var space = (step) => token(`space.${step}`, `${step * 4}px`);
|
|
|
45
45
|
var fontSize = (name) => token(`font.size.${name}`, "1rem");
|
|
46
46
|
var lineHeight = (name) => token(`font.line-height.${name}`, "1.5");
|
|
47
47
|
var fontWeight = (name) => token(`font.weight.${name}`, "400");
|
|
48
|
+
var spaceAround = css`
|
|
49
|
+
:host([space-above='sm']) { margin-block-start: ${space(2)}; }
|
|
50
|
+
:host([space-above='md']) { margin-block-start: ${space(4)}; }
|
|
51
|
+
:host([space-above='lg']) { margin-block-start: ${space(6)}; }
|
|
52
|
+
:host([space-above='xl']) { margin-block-start: ${space(8)}; }
|
|
53
|
+
:host([space-below='sm']) { margin-block-end: ${space(2)}; }
|
|
54
|
+
:host([space-below='md']) { margin-block-end: ${space(4)}; }
|
|
55
|
+
:host([space-below='lg']) { margin-block-end: ${space(6)}; }
|
|
56
|
+
:host([space-below='xl']) { margin-block-end: ${space(8)}; }
|
|
57
|
+
`;
|
|
48
58
|
|
|
49
59
|
// packages/ui/src/base/styles.ts
|
|
50
|
-
import { css } from "lit";
|
|
51
|
-
var focusRing =
|
|
60
|
+
import { css as css2 } from "lit";
|
|
61
|
+
var focusRing = css2`
|
|
52
62
|
:host(:focus-visible),
|
|
53
63
|
:host(:not([disabled])) :focus-visible {
|
|
54
64
|
outline: 2px solid transparent;
|
|
@@ -56,11 +66,11 @@ var focusRing = css`
|
|
|
56
66
|
box-shadow: ${t.focusShadow};
|
|
57
67
|
}
|
|
58
68
|
`;
|
|
59
|
-
var targetSize =
|
|
69
|
+
var targetSize = css2`
|
|
60
70
|
min-block-size: ${t.targetMin};
|
|
61
71
|
min-inline-size: ${t.targetMin};
|
|
62
72
|
`;
|
|
63
|
-
var visuallyHidden =
|
|
73
|
+
var visuallyHidden = css2`
|
|
64
74
|
position: absolute;
|
|
65
75
|
inline-size: 1px;
|
|
66
76
|
block-size: 1px;
|
|
@@ -71,7 +81,7 @@ var visuallyHidden = css`
|
|
|
71
81
|
white-space: nowrap;
|
|
72
82
|
border: 0;
|
|
73
83
|
`;
|
|
74
|
-
var reducedMotion =
|
|
84
|
+
var reducedMotion = css2`
|
|
75
85
|
@media (prefers-reduced-motion: reduce) {
|
|
76
86
|
:host,
|
|
77
87
|
:host *,
|
|
@@ -84,7 +94,7 @@ var reducedMotion = css`
|
|
|
84
94
|
}
|
|
85
95
|
}
|
|
86
96
|
`;
|
|
87
|
-
var base =
|
|
97
|
+
var base = css2`
|
|
88
98
|
:host {
|
|
89
99
|
box-sizing: border-box;
|
|
90
100
|
font-family: ${t.fontBody};
|
|
@@ -101,7 +111,7 @@ var base = css`
|
|
|
101
111
|
`;
|
|
102
112
|
|
|
103
113
|
// packages/ui/src/base/ImpktElement.ts
|
|
104
|
-
import { LitElement, css as
|
|
114
|
+
import { LitElement, css as css3 } from "lit";
|
|
105
115
|
var counter = 0;
|
|
106
116
|
var ImpktElement = class extends LitElement {
|
|
107
117
|
constructor() {
|
|
@@ -116,7 +126,7 @@ var ImpktElement = class extends LitElement {
|
|
|
116
126
|
this.uid = `impkt-${counter += 1}`;
|
|
117
127
|
}
|
|
118
128
|
static {
|
|
119
|
-
this.styles = [base, reducedMotion,
|
|
129
|
+
this.styles = [base, reducedMotion, css3``];
|
|
120
130
|
}
|
|
121
131
|
id_(part) {
|
|
122
132
|
return `${this.uid}-${part}`;
|
|
@@ -130,9 +140,10 @@ export {
|
|
|
130
140
|
fontSize,
|
|
131
141
|
lineHeight,
|
|
132
142
|
fontWeight,
|
|
143
|
+
spaceAround,
|
|
133
144
|
focusRing,
|
|
134
145
|
targetSize,
|
|
135
146
|
visuallyHidden,
|
|
136
147
|
ImpktElement
|
|
137
148
|
};
|
|
138
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-5NUF7ZQA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/base/tokens.ts","../src/base/styles.ts","../src/base/ImpktElement.ts"],"sourcesContent":["/**\n * Token helpers.\n *\n * Components never name a colour, a size or a radius. They name a token, and a\n * brand decides what it holds — which is what makes a rebrand a content\n * publish rather than a rebuild\n * ([ADR 0005](../../../../docs/decisions/0005-design-tokens.md)).\n *\n * Every reference carries a fallback so that a component dropped onto a page\n * with no token stylesheet still renders something legible. An unstyled\n * component is indistinguishable from a broken one, and the fallback is what\n * keeps a missing stylesheet a visible annoyance rather than a blank screen.\n *\n * These return `CSSResult` rather than strings. Lit's `css` tag refuses plain\n * interpolated strings, which is a deliberate guard against injecting\n * attacker-controlled text into a stylesheet; `unsafeCSS` is the documented\n * way past it and is safe here because every value is a literal in this file,\n * never anything authored or fetched.\n */\nimport { css, unsafeCSS, type CSSResult } from 'lit';\n\n/** `color.brand.default` → `var(--impkt-color-brand-default, <fallback>)`. */\nexport const token = (path: string, fallback: string): CSSResult =>\n unsafeCSS(`var(--impkt-${path.replace(/\\./g, '-')}, ${fallback})`);\n\nexport const t = {\n brand: token('color.brand.default', '#1f4ed8'),\n brandHover: token('color.brand.hover', '#1b45be'),\n brandActive: token('color.brand.active', '#183ba4'),\n brandSubtle: token('color.brand.subtle', '#e4eafa'),\n onBrand: token('color.text.on-brand', '#ffffff'),\n\n surfaceCard: token('color.surface.card', '#ffffff'),\n surfaceInset: token('color.surface.inset', '#f4f4f4'),\n surfaceSubtle: token('color.surface.subtle', '#e4eafa'),\n\n text: token('color.text.default', '#1a1a1a'),\n textMuted: token('color.text.muted', '#717171'),\n textPlaceholder: token('color.text.placeholder', '#767676'),\n textHeading: token('color.text.heading', '#1f4ed8'),\n link: token('color.text.link', '#1f4ed8'),\n linkHover: token('color.text.link-hover', '#193ead'),\n\n border: token('color.border.default', '#929292'),\n borderStrong: token('color.border.strong', '#818181'),\n\n danger: token('color.status.danger.default', '#c8102e'),\n dangerText: token('color.status.danger.text', '#c8102e'),\n dangerSubtle: token('color.status.danger.subtle', '#f8e2e6'),\n warning: token('color.status.warning.default', '#b45309'),\n warningText: token('color.status.warning.text', '#b45309'),\n warningSubtle: token('color.status.warning.subtle', '#f6eae1'),\n success: token('color.status.success.default', '#047857'),\n successText: token('color.status.success.text', '#047857'),\n successSubtle: token('color.status.success.subtle', '#e0f0ea'),\n info: token('color.status.info.default', '#1f4ed8'),\n infoText: token('color.status.info.text', '#1f4ed8'),\n infoSubtle: token('color.status.info.subtle', '#e4eafa'),\n\n fontBody: token('font.family.body', 'system-ui, sans-serif'),\n fontHeading: token('font.family.heading', 'system-ui, sans-serif'),\n\n focusShadow: token('focus.ring.shadow', '0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a'),\n focusOffset: token('focus.ring.offset', '2px'),\n\n targetMin: token('target.min', '24px'),\n\n radiusSm: token('radius.sm', '2px'),\n radius: token('radius.md', '4px'),\n radiusLg: token('radius.lg', '8px'),\n\n borderThin: token('border.width.thin', '1px'),\n borderThick: token('border.width.thick', '2px'),\n} as const;\n\n/** `space.3` → the custom property. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${step}`, `${step * 4}px`);\n/** `font.size.lg` → the custom property. */\nexport const fontSize = (name: string): CSSResult => token(`font.size.${name}`, '1rem');\nexport const lineHeight = (name: string): CSSResult => token(`font.line-height.${name}`, '1.5');\nexport const fontWeight = (name: string): CSSResult => token(`font.weight.${name}`, '400');\n\n/**\n * Space above and below a section, from the spacing scale: `none`, `sm`,\n * `md`, `lg` or `xl`, set by `space-above` and `space-below`. A section names\n * a step rather than a size, so a page keeps the brand's rhythm.\n */\nexport const spaceAround: CSSResult = css`\n :host([space-above='sm']) { margin-block-start: ${space(2)}; }\n :host([space-above='md']) { margin-block-start: ${space(4)}; }\n :host([space-above='lg']) { margin-block-start: ${space(6)}; }\n :host([space-above='xl']) { margin-block-start: ${space(8)}; }\n :host([space-below='sm']) { margin-block-end: ${space(2)}; }\n :host([space-below='md']) { margin-block-end: ${space(4)}; }\n :host([space-below='lg']) { margin-block-end: ${space(6)}; }\n :host([space-below='xl']) { margin-block-end: ${space(8)}; }\n`;\n","/**\n * Shared style fragments.\n *\n * Three of these carry an accessibility guarantee and are therefore not\n * negotiable per component: the focus ring, the minimum target size and the\n * reduced-motion rule. A component that wants its own focus treatment is a\n * component that will get it subtly wrong on one brand, so there is one.\n */\nimport { css } from 'lit';\nimport { t } from './tokens';\n\n/**\n * The focus ring.\n *\n * `:focus-visible` rather than `:focus`, so a mouse click on a button does not\n * draw a ring the user did not ask for while keyboard focus still does.\n *\n * The ring is two-tone — a light inner band inside a dark outer one — drawn\n * with `box-shadow` and a transparent `outline` behind it. The outline is not\n * decoration: it is what survives Windows High Contrast Mode, where box-shadow\n * is dropped entirely and a shadow-only ring disappears for exactly the users\n * who most need it.\n *\n * The colours come from locked tokens a brand cannot reach\n * ([ADR 0010](../../../../docs/decisions/0010-what-a-brand-may-set.md)).\n */\nexport const focusRing = css`\n :host(:focus-visible),\n :host(:not([disabled])) :focus-visible {\n outline: 2px solid transparent;\n outline-offset: ${t.focusOffset};\n box-shadow: ${t.focusShadow};\n }\n`;\n\n/**\n * WCAG 2.2, 2.5.8 Target Size (Minimum): 24 by 24 CSS pixels.\n *\n * Applied as a minimum rather than a fixed size so a control grows with its\n * content and never shrinks below the floor. It reads the locked token, which\n * is deliberately outside the spacing scale — otherwise a brand tightening its\n * spacing unit would shrink every tap target with it.\n */\nexport const targetSize = css`\n min-block-size: ${t.targetMin};\n min-inline-size: ${t.targetMin};\n`;\n\n/**\n * Visible to a screen reader, invisible on screen.\n *\n * `clip-path` with a 1px box rather than `display: none` or `visibility:\n * hidden`, both of which remove the text from the accessibility tree — which\n * is the one thing this must not do.\n */\nexport const visuallyHidden = css`\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n`;\n\n/**\n * 2.3.3 Animation from Interactions, and plain decency.\n *\n * `0.01ms` rather than `0` because a zero-duration transition does not fire a\n * `transitionend` event in every engine, and components that wait for one hang.\n */\nexport const reducedMotion = css`\n @media (prefers-reduced-motion: reduce) {\n :host,\n :host *,\n :host *::before,\n :host *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n }\n`;\n\n/** The base every component starts from. */\nexport const base = css`\n :host {\n box-sizing: border-box;\n font-family: ${t.fontBody};\n color: ${t.text};\n }\n :host([hidden]) {\n display: none !important;\n }\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n`;\n","import { LitElement, css } from 'lit';\nimport { base, reducedMotion } from './styles';\n\nlet counter = 0;\n\n/**\n * The base every Impkt component extends.\n *\n * It carries the two style fragments that are not a per-component choice — the\n * reset and the reduced-motion rule — and a stable id generator for the ARIA\n * wiring. It deliberately carries nothing else: a base class that grows\n * behaviour becomes the place every component's exceptions are negotiated.\n */\nexport class ImpktElement extends LitElement {\n static styles = [base, reducedMotion, css``];\n\n /**\n * A unique id for this instance, for `aria-describedby` and friends.\n *\n * Generated once in the constructor rather than in `render`, because an id\n * that changes between renders breaks the relationship it exists to express\n * — and it breaks it silently, since the markup still looks correct.\n */\n protected readonly uid = `impkt-${(counter += 1)}`;\n\n protected id_(part: string): string {\n return `${this.uid}-${part}`;\n }\n}\n"],"mappings":"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","names":["css","css","css","css"]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/accordion.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
@@ -119,4 +119,4 @@ customElements.define("impkt-accordion", ImpktAccordion);
|
|
|
119
119
|
export {
|
|
120
120
|
ImpktAccordion
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-6MLXFFH4.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
fontWeight,
|
|
6
6
|
space,
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/summary-list.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -117,4 +117,4 @@ customElements.define("impkt-summary-list", ImpktSummaryList);
|
|
|
117
117
|
export {
|
|
118
118
|
ImpktSummaryList
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-6UDDZQDK.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/text-input.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -89,4 +89,4 @@ customElements.define("impkt-text-input", ImpktTextInput);
|
|
|
89
89
|
export {
|
|
90
90
|
ImpktTextInput
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-A4CJ2F3J.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/date-input.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -133,4 +133,4 @@ customElements.define("impkt-date-input", ImpktDateInput);
|
|
|
133
133
|
export {
|
|
134
134
|
ImpktDateInput
|
|
135
135
|
};
|
|
136
|
-
//# sourceMappingURL=chunk-
|
|
136
|
+
//# sourceMappingURL=chunk-CGMDIZPO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpktElement,
|
|
3
3
|
t
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
5
5
|
|
|
6
6
|
// packages/ui/src/components/media.ts
|
|
7
7
|
import { html, css, nothing } from "lit";
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
ImpktLogo,
|
|
160
160
|
ImpktDocumentLink
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-DIZCGSJA.js.map
|
|
@@ -4,22 +4,30 @@ import {
|
|
|
4
4
|
fontWeight,
|
|
5
5
|
lineHeight,
|
|
6
6
|
space,
|
|
7
|
+
spaceAround,
|
|
7
8
|
t
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
10
|
|
|
10
11
|
// packages/ui/src/components/layout.ts
|
|
11
12
|
import { html, css } from "lit";
|
|
12
13
|
var ImpktStack = class extends ImpktElement {
|
|
13
14
|
static {
|
|
14
|
-
this.properties = {
|
|
15
|
+
this.properties = {
|
|
16
|
+
gap: { type: String, reflect: true },
|
|
17
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
18
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
19
|
+
};
|
|
15
20
|
}
|
|
16
21
|
constructor() {
|
|
17
22
|
super();
|
|
18
23
|
this.gap = "md";
|
|
24
|
+
this.spaceAbove = "none";
|
|
25
|
+
this.spaceBelow = "none";
|
|
19
26
|
}
|
|
20
27
|
static {
|
|
21
28
|
this.styles = [
|
|
22
29
|
...ImpktElement.styles,
|
|
30
|
+
spaceAround,
|
|
23
31
|
css`
|
|
24
32
|
:host {
|
|
25
33
|
display: flex;
|
|
@@ -38,9 +46,21 @@ var ImpktStack = class extends ImpktElement {
|
|
|
38
46
|
}
|
|
39
47
|
};
|
|
40
48
|
var ImpktCard = class extends ImpktElement {
|
|
49
|
+
static {
|
|
50
|
+
this.properties = {
|
|
51
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
52
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
constructor() {
|
|
56
|
+
super();
|
|
57
|
+
this.spaceAbove = "none";
|
|
58
|
+
this.spaceBelow = "none";
|
|
59
|
+
}
|
|
41
60
|
static {
|
|
42
61
|
this.styles = [
|
|
43
62
|
...ImpktElement.styles,
|
|
63
|
+
spaceAround,
|
|
44
64
|
css`
|
|
45
65
|
:host {
|
|
46
66
|
display: block;
|
|
@@ -149,4 +169,4 @@ export {
|
|
|
149
169
|
ImpktHeading,
|
|
150
170
|
ImpktText
|
|
151
171
|
};
|
|
152
|
-
//# sourceMappingURL=chunk-
|
|
172
|
+
//# sourceMappingURL=chunk-GGODB3GY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/layout.ts"],"sourcesContent":["import { html, css, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, lineHeight, space, spaceAround, t } from '../base/tokens';\n\n/**\n * Layout and typography primitives.\n *\n * These are the components a composition is mostly made of, and they are\n * deliberately dull. Their one job is that spacing, type and colour come from\n * tokens, so that a page built in the CMS cannot contain a hard-coded 13px.\n */\n\n/** Vertical rhythm. Every gap is a spacing token, never a number.\n *\n * @category layout\n * @icon stack\n * @slot - The things being stacked.\n */\nexport class ImpktStack extends ImpktElement {\n static properties = {\n gap: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Space before the stack, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n /** Space after the stack, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.gap = 'md';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpktElement.styles,\n spaceAround,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n :host([gap='xs']) { gap: ${space(1)}; }\n :host([gap='sm']) { gap: ${space(2)}; }\n :host([gap='md']) { gap: ${space(4)}; }\n :host([gap='lg']) { gap: ${space(6)}; }\n :host([gap='xl']) { gap: ${space(8)}; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<slot></slot>`;\n }\n}\n\n/** A surface. What text is read against, and what contrast is measured from.\n *\n * @category layout\n * @icon card\n * @slot - What sits on the card.\n */\nexport class ImpktCard extends ImpktElement {\n static properties = {\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** Space before the card, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n /** Space after the card, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpktElement.styles,\n spaceAround,\n css`\n :host {\n display: block;\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n padding: ${space(6)};\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`<slot></slot>`;\n }\n}\n\n/**\n * A heading.\n *\n * `level` is required and renders the matching `<h1>`–`<h6>`, because heading\n * level is document structure rather than appearance: a screen-reader user\n * navigates by it, and a page whose levels skip is a page they cannot skim.\n * Size is a separate property, so a visually small `<h2>` needs no lie about\n * its level — which is the usual reason levels end up wrong.\n\n *\n * @category typography\n * @icon heading\n * @role heading\n * @slot - The heading text.\n */\nexport class ImpktHeading extends ImpktElement {\n static properties = {\n level: { type: Number, reflect: true },\n size: { type: String, reflect: true },\n };\n\n declare level: 1 | 2 | 3 | 4 | 5 | 6;\n declare size: '3xl' | '2xl' | 'xl' | 'lg' | 'md';\n\n constructor() {\n super();\n this.level = 2;\n this.size = 'xl';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n color: ${t.textHeading};\n font-family: ${t.fontHeading};\n font-weight: ${fontWeight('bold')};\n line-height: ${lineHeight('tight')};\n }\n :host([size='3xl']) { font-size: ${fontSize('3xl')}; }\n :host([size='2xl']) { font-size: ${fontSize('2xl')}; }\n :host([size='xl']) { font-size: ${fontSize('xl')}; }\n :host([size='lg']) { font-size: ${fontSize('lg')}; }\n :host([size='md']) { font-size: ${fontSize('md')}; }\n .h {\n margin: 0;\n font: inherit;\n color: inherit;\n }\n `,\n ];\n\n render(): TemplateResult {\n // A `role=\"heading\"` with `aria-level` rather than six branches of\n // template. The native element would be marginally better; this is the one\n // place where Lit's lack of a dynamic tag makes the explicit role the\n // honest trade, and the role is fully supported.\n return html`<div class=\"h\" role=\"heading\" aria-level=${this.level} part=\"heading\">\n <slot></slot>\n </div>`;\n }\n}\n\n/** A paragraph.\n *\n * @category typography\n * @icon text\n * @slot - The paragraph text.\n */\nexport class ImpktText extends ImpktElement {\n static properties = {\n size: { type: String, reflect: true },\n tone: { type: String, reflect: true },\n };\n\n declare size: 'sm' | 'md' | 'lg';\n declare tone: 'default' | 'muted';\n\n constructor() {\n super();\n this.size = 'md';\n this.tone = 'default';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n /* 1.4.8 asks for 1.5 within a paragraph, and it is the default here\n rather than an option, because body text is what it is about. */\n line-height: ${lineHeight('normal')};\n /* 1.4.12 Text Spacing: a user stylesheet must be able to widen this\n without clipping, which a max-width in ch units survives and a\n fixed pixel height does not. */\n max-inline-size: 70ch;\n }\n :host([size='sm']) { font-size: ${fontSize('sm')}; }\n :host([size='md']) { font-size: ${fontSize('md')}; }\n :host([size='lg']) { font-size: ${fontSize('lg')}; }\n :host([tone='muted']) { color: ${t.textMuted}; }\n p {\n margin: 0;\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`<p part=\"text\"><slot></slot></p>`;\n }\n}\n\ncustomElements.define('impkt-stack', ImpktStack);\ncustomElements.define('impkt-card', ImpktCard);\ncustomElements.define('impkt-heading', ImpktHeading);\ncustomElements.define('impkt-text', ImpktText);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-stack': ImpktStack;\n 'impkt-card': ImpktCard;\n 'impkt-heading': ImpktHeading;\n 'impkt-text': ImpktText;\n }\n}\n"],"mappings":"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","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
space,
|
|
6
6
|
t,
|
|
7
7
|
visuallyHidden
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/progress.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -92,4 +92,4 @@ customElements.define("impkt-progress", ImpktProgress);
|
|
|
92
92
|
export {
|
|
93
93
|
ImpktProgress
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-HWNY6U5F.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
focusRing,
|
|
4
4
|
fontWeight,
|
|
5
5
|
t
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
7
7
|
|
|
8
8
|
// packages/ui/src/components/help.ts
|
|
9
9
|
import { html, css, nothing } from "lit";
|
|
@@ -81,4 +81,4 @@ customElements.define("impkt-help", ImpktHelp);
|
|
|
81
81
|
export {
|
|
82
82
|
ImpktHelp
|
|
83
83
|
};
|
|
84
|
-
//# sourceMappingURL=chunk-
|
|
84
|
+
//# sourceMappingURL=chunk-IBTOZOGI.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/checkbox.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
@@ -85,4 +85,4 @@ customElements.define("impkt-checkbox", ImpktCheckbox);
|
|
|
85
85
|
export {
|
|
86
86
|
ImpktCheckbox
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-LFOWTFMR.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/select.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -76,4 +76,4 @@ customElements.define("impkt-select", ImpktSelect);
|
|
|
76
76
|
export {
|
|
77
77
|
ImpktSelect
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
//# sourceMappingURL=chunk-MAMBT7BZ.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/radio-group.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
@@ -136,4 +136,4 @@ customElements.define("impkt-radio-group", ImpktRadioGroup);
|
|
|
136
136
|
export {
|
|
137
137
|
ImpktRadioGroup
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-OBCSDZHP.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/checkbox-group.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
@@ -128,4 +128,4 @@ customElements.define("impkt-checkbox-group", ImpktCheckboxGroup);
|
|
|
128
128
|
export {
|
|
129
129
|
ImpktCheckboxGroup
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-PDXOPY22.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXCSQ6MK.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/textarea.ts
|
|
11
11
|
import { html, css, nothing } from "lit";
|
|
@@ -72,4 +72,4 @@ customElements.define("impkt-textarea", ImpktTextarea);
|
|
|
72
72
|
export {
|
|
73
73
|
ImpktTextarea
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-QYHWR6C5.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/dialog.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
@@ -127,4 +127,4 @@ customElements.define("impkt-dialog", ImpktDialog);
|
|
|
127
127
|
export {
|
|
128
128
|
ImpktDialog
|
|
129
129
|
};
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-S3EQO33M.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
t,
|
|
8
8
|
targetSize,
|
|
9
9
|
visuallyHidden
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
11
11
|
|
|
12
12
|
// packages/ui/src/components/button.ts
|
|
13
13
|
import { html, css, nothing } from "lit";
|
|
@@ -154,4 +154,4 @@ customElements.define("impkt-button", ImpktButton);
|
|
|
154
154
|
export {
|
|
155
155
|
ImpktButton
|
|
156
156
|
};
|
|
157
|
-
//# sourceMappingURL=chunk-
|
|
157
|
+
//# sourceMappingURL=chunk-TIKX5POO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/button.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\n/**\n * A button.\n *\n * Two decisions carry the accessibility weight here.\n *\n * **A busy button is not a disabled button.** While an action is in flight the\n * control keeps its place in the tab order and reports `aria-disabled`, rather\n * than taking the native `disabled` attribute. A natively disabled element is\n * removed from the tab order, so a keyboard user who had just activated it\n * loses their focus position to the top of the document — at precisely the\n * moment something is happening that they need to be told about. Activation is\n * blocked in the handler instead.\n *\n * **It renders a real `<button>`.** A `<div role=\"button\">` needs Enter and\n * Space handling, a tabindex, and a disabled story, and it will still not\n * submit a form. The native element already has all of that, correctly, in\n * every browser and every assistive technology.\n\n *\n * @category action\n * @icon button\n * @slot - The button label.\n * @fires click - When the button is pressed. Not while it is busy or disabled.\n */\nexport class ImpktButton extends ImpktElement {\n static formAssociated = true;\n\n static properties = {\n variant: { type: String, reflect: true },\n type: { type: String },\n disabled: { type: Boolean, reflect: true },\n busy: { type: Boolean, reflect: true },\n busyLabel: { type: String, attribute: 'busy-label' },\n full: { type: Boolean, reflect: true },\n };\n\n declare variant: 'primary' | 'secondary' | 'ghost';\n declare type: 'button' | 'submit' | 'reset';\n declare disabled: boolean;\n declare busy: boolean;\n /** Announced when the button becomes busy. Says what is happening, not that something is. */\n declare busyLabel: string;\n declare full: boolean;\n\n private internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.variant = 'primary';\n this.type = 'button';\n this.disabled = false;\n this.busy = false;\n this.busyLabel = 'Working';\n this.full = false;\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: inline-block;\n }\n :host([full]) {\n display: block;\n }\n button {\n ${targetSize}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${space(2)};\n inline-size: 100%;\n padding: ${space(3)} ${space(5)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n font-weight: ${fontWeight('semibold')};\n line-height: 1.2;\n border-radius: ${t.radius};\n border: ${t.borderThick} solid transparent;\n cursor: pointer;\n transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out;\n }\n /* The cursor is the only thing that changes while busy. Moving or\n recolouring a control the moment it is pressed is how a user loses it. */\n button[aria-disabled='true'] {\n cursor: progress;\n }\n :host([disabled]) button {\n cursor: not-allowed;\n opacity: 0.55;\n }\n\n button.primary {\n background: ${t.brand};\n color: ${t.onBrand};\n }\n button.primary:hover:not([aria-disabled='true']) {\n background: ${t.brandHover};\n }\n button.primary:active:not([aria-disabled='true']) {\n background: ${t.brandActive};\n }\n\n button.secondary {\n background: transparent;\n color: ${t.link};\n border-color: currentColor;\n }\n button.secondary:hover:not([aria-disabled='true']) {\n background: ${t.brandSubtle};\n }\n\n button.ghost {\n background: transparent;\n color: ${t.link};\n border-color: transparent;\n text-decoration: underline;\n }\n button.ghost:hover:not([aria-disabled='true']) {\n background: ${t.brandSubtle};\n }\n\n .sr-only {\n ${visuallyHidden}\n }\n\n /* Windows High Contrast Mode drops background and border colours, so a\n button styled only by background becomes invisible. A forced-colors\n border puts the boundary back. */\n @media (forced-colors: active) {\n button {\n border-color: ButtonBorder;\n }\n }\n `,\n ];\n\n private onClick(event: MouseEvent): void {\n if (this.disabled || this.busy) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n // A shadow-rooted button does not submit the outer form by itself, because\n // the click never reaches it. `requestSubmit` rather than `submit` so that\n // native validation and the submit event both still run.\n if (this.type === 'submit') this.internals?.form?.requestSubmit();\n if (this.type === 'reset') this.internals?.form?.reset();\n }\n\n render(): TemplateResult {\n return html`\n <button\n class=${this.variant}\n type=\"button\"\n part=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n <slot></slot>\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n}\n\ncustomElements.define('impkt-button', ImpktButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-button': ImpktButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA6BjD,IAAM,cAAN,cAA0B,aAAa;AAAA,EAsB5C,cAAc;AACZ,UAAM;AAHR,SAAQ,YAAqC;AAI3C,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EAlCA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IACvC;AAAA;AAAA,EA2BA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAQM,UAAU;AAAA;AAAA;AAAA;AAAA,eAIL,MAAM,CAAC,CAAC;AAAA;AAAA,mBAEJ,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA,qBAElB,SAAS,IAAI,CAAC;AAAA,uBACZ,WAAW,UAAU,CAAC;AAAA;AAAA,yBAEpB,EAAE,MAAM;AAAA,kBACf,EAAE,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAeT,EAAE,KAAK;AAAA,iBACZ,EAAE,OAAO;AAAA;AAAA;AAAA,sBAGJ,EAAE,UAAU;AAAA;AAAA;AAAA,sBAGZ,EAAE,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKlB,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA,sBAID,EAAE,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKlB,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKD,EAAE,WAAW;AAAA;AAAA;AAAA;AAAA,UAIzB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYtB;AAAA;AAAA,EAEQ,QAAQ,OAAyB;AACvC,QAAI,KAAK,YAAY,KAAK,MAAM;AAC9B,YAAM,eAAe;AACrB,YAAM,yBAAyB;AAC/B;AAAA,IACF;AAIA,QAAI,KAAK,SAAS,SAAU,MAAK,WAAW,MAAM,cAAc;AAChE,QAAI,KAAK,SAAS,QAAS,MAAK,WAAW,MAAM,MAAM;AAAA,EACzD;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA,gBAEK,KAAK,OAAO;AAAA;AAAA;AAAA,oBAGR,KAAK,QAAQ;AAAA,wBACT,KAAK,OAAO,SAAS,OAAO;AAAA,oBAChC,KAAK,OAAO,SAAS,OAAO;AAAA,iBAC/B,KAAK,OAAO;AAAA;AAAA;AAAA,UAGnB,KAAK,OAAO,6BAA6B,KAAK,SAAS,YAAY,OAAO;AAAA;AAAA;AAAA,EAGlF;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
fontWeight,
|
|
5
5
|
space,
|
|
6
6
|
t
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5NUF7ZQA.js";
|
|
8
8
|
|
|
9
9
|
// packages/ui/src/components/price.ts
|
|
10
10
|
import { html, css, nothing } from "lit";
|
|
@@ -78,4 +78,4 @@ customElements.define("impkt-price", ImpktPrice);
|
|
|
78
78
|
export {
|
|
79
79
|
ImpktPrice
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-TZD7IVVQ.js.map
|