@atomic-ui/ui 0.1.7 → 0.2.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/README.md +5 -3
- package/custom-elements.json +24569 -0
- package/dist/base/ImpktElement.d.ts +14 -0
- package/dist/base/locale.d.ts +8 -0
- package/dist/base/say.d.ts +1 -0
- package/dist/base/styles.d.ts +1 -1
- package/dist/base/tokens.d.ts +5 -1
- package/dist/{chunk-GSCVG2ER.js → chunk-26O27BQS.js} +3 -3
- package/dist/chunk-2CFVV2NZ.js +494 -0
- package/dist/chunk-2CFVV2NZ.js.map +1 -0
- package/dist/chunk-3IGNZTJU.js +14 -0
- package/dist/chunk-3IGNZTJU.js.map +1 -0
- package/dist/{chunk-4HU4Y23Q.js → chunk-3IQ73WNW.js} +3 -3
- package/dist/{chunk-7Y6UCSUS.js → chunk-4X723QBD.js} +4 -4
- package/dist/chunk-4X723QBD.js.map +1 -0
- package/dist/{chunk-OB7LC6NJ.js → chunk-6YYAOKNI.js} +2 -2
- package/dist/{chunk-7BIQ3K6H.js → chunk-7AJN2TIS.js} +2 -2
- package/dist/chunk-7BSZPUE3.js +53 -0
- package/dist/chunk-7BSZPUE3.js.map +1 -0
- package/dist/{chunk-HWWA27DN.js → chunk-7OXTZJR4.js} +2 -2
- package/dist/chunk-7XEPNEVQ.js +264 -0
- package/dist/chunk-7XEPNEVQ.js.map +1 -0
- package/dist/{chunk-NTNXHLTM.js → chunk-D6C7XEY4.js} +41 -1
- package/dist/chunk-D6C7XEY4.js.map +1 -0
- package/dist/{chunk-C36CZRHK.js → chunk-E2VBUWJ4.js} +43 -13
- package/dist/chunk-E2VBUWJ4.js.map +1 -0
- package/dist/{chunk-XJP45LFA.js → chunk-E3XJK7MY.js} +13 -5
- package/dist/chunk-E3XJK7MY.js.map +1 -0
- package/dist/{chunk-GO2IBRFP.js → chunk-EDSZI227.js} +2 -2
- package/dist/{chunk-6ICOJPMD.js → chunk-FFCIY7NM.js} +4 -3
- package/dist/chunk-FFCIY7NM.js.map +1 -0
- package/dist/{chunk-MOEMFL4K.js → chunk-FJRHZA3C.js} +5 -5
- package/dist/chunk-FJRHZA3C.js.map +1 -0
- package/dist/{chunk-ZGAOMRYD.js → chunk-GQDUHZE3.js} +3 -3
- package/dist/{chunk-QCNT7D5V.js → chunk-HYPPG4NF.js} +12 -8
- package/dist/chunk-HYPPG4NF.js.map +1 -0
- package/dist/chunk-J4JULXUG.js +249 -0
- package/dist/chunk-J4JULXUG.js.map +1 -0
- package/dist/{chunk-2YQA3VBY.js → chunk-KFD4O7VA.js} +4 -2
- package/dist/chunk-KFD4O7VA.js.map +1 -0
- package/dist/{chunk-ZQJD4YEJ.js → chunk-MVEFM5QI.js} +3 -3
- package/dist/{chunk-WECSVHIM.js → chunk-NCASAXQT.js} +7 -3
- package/dist/chunk-NCASAXQT.js.map +1 -0
- package/dist/{chunk-QDNI54ON.js → chunk-NKTMMJYD.js} +7 -6
- package/dist/chunk-NKTMMJYD.js.map +1 -0
- package/dist/{chunk-T6L3USBZ.js → chunk-OB7WULFK.js} +23 -11
- package/dist/chunk-OB7WULFK.js.map +1 -0
- package/dist/{chunk-ZBLTU67D.js → chunk-OHDPGIJ3.js} +15 -11
- package/dist/chunk-OHDPGIJ3.js.map +1 -0
- package/dist/{chunk-TPF4MOMF.js → chunk-OLLZFNO6.js} +7 -4
- package/dist/chunk-OLLZFNO6.js.map +1 -0
- package/dist/{chunk-NQKYHILD.js → chunk-OMJMUFOW.js} +3 -3
- package/dist/{chunk-MLVUMCQ2.js → chunk-QB2KMV6S.js} +14 -5
- package/dist/chunk-QB2KMV6S.js.map +1 -0
- package/dist/{chunk-5EA4IDUD.js → chunk-R67PDFKE.js} +2 -2
- package/dist/chunk-RZSZQMSE.js +236 -0
- package/dist/chunk-RZSZQMSE.js.map +1 -0
- package/dist/{chunk-XVKEM5JY.js → chunk-TGT7J4EG.js} +2 -2
- package/dist/{chunk-VTFCTWSX.js → chunk-UCHJCUYI.js} +2 -2
- package/dist/chunk-UHLRXI6J.js +453 -0
- package/dist/chunk-UHLRXI6J.js.map +1 -0
- package/dist/{chunk-X7IPZPTG.js → chunk-UNVL3CNM.js} +34 -19
- package/dist/chunk-UNVL3CNM.js.map +1 -0
- package/dist/{chunk-VWNBB7FW.js → chunk-WDDWWCHN.js} +2 -2
- package/dist/chunk-WFKSOM6O.js +498 -0
- package/dist/chunk-WFKSOM6O.js.map +1 -0
- package/dist/{chunk-G6OVKNL7.js → chunk-XEJMFFIM.js} +4 -3
- package/dist/chunk-XEJMFFIM.js.map +1 -0
- package/dist/{chunk-CMAU4DSB.js → chunk-XJXCTGDR.js} +5 -5
- package/dist/chunk-XJXCTGDR.js.map +1 -0
- package/dist/{chunk-BTGCUONV.js → chunk-YD6IZ2C5.js} +2 -2
- package/dist/chunk-YK5QI57J.js +396 -0
- package/dist/chunk-YK5QI57J.js.map +1 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.js +2 -2
- package/dist/components/app-ui.js +5 -4
- package/dist/components/blocks.js +3 -3
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +3 -3
- package/dist/components/changelog.d.ts +386 -0
- package/dist/components/changelog.js +25 -0
- package/dist/components/changelog.js.map +1 -0
- 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/estimator.d.ts +246 -0
- package/dist/components/estimator.js +16 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/fieldset.js +2 -2
- package/dist/components/grid.js +2 -2
- package/dist/components/help.js +2 -2
- package/dist/components/icon.d.ts +2 -0
- package/dist/components/icon.js +2 -2
- package/dist/components/journey.d.ts +433 -0
- package/dist/components/journey.js +22 -0
- package/dist/components/journey.js.map +1 -0
- package/dist/components/layout.d.ts +24 -0
- package/dist/components/layout.js +2 -2
- package/dist/components/link.js +3 -3
- package/dist/components/list.d.ts +50 -0
- package/dist/components/list.js +8 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/marketing.js +3 -3
- package/dist/components/media.d.ts +10 -0
- package/dist/components/media.js +2 -2
- package/dist/components/navigation.d.ts +16 -0
- package/dist/components/navigation.js +3 -3
- package/dist/components/organisms.d.ts +12 -0
- package/dist/components/organisms.js +3 -3
- package/dist/components/page.js +2 -2
- package/dist/components/price.d.ts +1 -1
- package/dist/components/price.js +3 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/property.js +4 -3
- package/dist/components/radio-group.js +3 -3
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +8 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +8 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/select.js +3 -3
- package/dist/components/selling.d.ts +407 -0
- package/dist/components/selling.js +25 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +283 -0
- package/dist/components/site.js +20 -0
- package/dist/components/site.js.map +1 -0
- 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.d.ts +13 -0
- package/dist/components/textarea.js +3 -3
- package/dist/index.d.ts +9 -1
- package/dist/index.js +134 -55
- package/package.json +11 -4
- package/dist/chunk-2YQA3VBY.js.map +0 -1
- package/dist/chunk-6ICOJPMD.js.map +0 -1
- package/dist/chunk-7Y6UCSUS.js.map +0 -1
- package/dist/chunk-C36CZRHK.js.map +0 -1
- package/dist/chunk-CMAU4DSB.js.map +0 -1
- package/dist/chunk-G6OVKNL7.js.map +0 -1
- package/dist/chunk-MLVUMCQ2.js.map +0 -1
- package/dist/chunk-MOEMFL4K.js.map +0 -1
- package/dist/chunk-NTNXHLTM.js.map +0 -1
- package/dist/chunk-QCNT7D5V.js.map +0 -1
- package/dist/chunk-QDNI54ON.js.map +0 -1
- package/dist/chunk-T6L3USBZ.js.map +0 -1
- package/dist/chunk-TPF4MOMF.js.map +0 -1
- package/dist/chunk-WECSVHIM.js.map +0 -1
- package/dist/chunk-X7IPZPTG.js.map +0 -1
- package/dist/chunk-XJP45LFA.js.map +0 -1
- package/dist/chunk-ZBLTU67D.js.map +0 -1
- /package/dist/{chunk-GSCVG2ER.js.map → chunk-26O27BQS.js.map} +0 -0
- /package/dist/{chunk-4HU4Y23Q.js.map → chunk-3IQ73WNW.js.map} +0 -0
- /package/dist/{chunk-OB7LC6NJ.js.map → chunk-6YYAOKNI.js.map} +0 -0
- /package/dist/{chunk-7BIQ3K6H.js.map → chunk-7AJN2TIS.js.map} +0 -0
- /package/dist/{chunk-HWWA27DN.js.map → chunk-7OXTZJR4.js.map} +0 -0
- /package/dist/{chunk-GO2IBRFP.js.map → chunk-EDSZI227.js.map} +0 -0
- /package/dist/{chunk-ZGAOMRYD.js.map → chunk-GQDUHZE3.js.map} +0 -0
- /package/dist/{chunk-ZQJD4YEJ.js.map → chunk-MVEFM5QI.js.map} +0 -0
- /package/dist/{chunk-NQKYHILD.js.map → chunk-OMJMUFOW.js.map} +0 -0
- /package/dist/{chunk-5EA4IDUD.js.map → chunk-R67PDFKE.js.map} +0 -0
- /package/dist/{chunk-XVKEM5JY.js.map → chunk-TGT7J4EG.js.map} +0 -0
- /package/dist/{chunk-VTFCTWSX.js.map → chunk-UCHJCUYI.js.map} +0 -0
- /package/dist/{chunk-VWNBB7FW.js.map → chunk-WDDWWCHN.js.map} +0 -0
- /package/dist/{chunk-BTGCUONV.js.map → chunk-YD6IZ2C5.js.map} +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pageLocale
|
|
3
|
+
} from "./chunk-3IGNZTJU.js";
|
|
1
4
|
import {
|
|
2
5
|
ImpktElement,
|
|
3
6
|
fontSize,
|
|
4
7
|
fontWeight,
|
|
5
8
|
space,
|
|
6
9
|
t
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-D6C7XEY4.js";
|
|
8
11
|
|
|
9
12
|
// packages/ui/src/components/price.ts
|
|
10
13
|
import { html, css, nothing } from "lit";
|
|
@@ -24,7 +27,7 @@ var ImpktPrice = class extends ImpktElement {
|
|
|
24
27
|
super();
|
|
25
28
|
this.amount = void 0;
|
|
26
29
|
this.currency = "GBP";
|
|
27
|
-
this.locale = "
|
|
30
|
+
this.locale = "";
|
|
28
31
|
this.prefix = "";
|
|
29
32
|
this.period = "";
|
|
30
33
|
this.size = "xl";
|
|
@@ -60,7 +63,7 @@ var ImpktPrice = class extends ImpktElement {
|
|
|
60
63
|
get formatted() {
|
|
61
64
|
if (this.amount === void 0 || Number.isNaN(this.amount)) return this.pending;
|
|
62
65
|
try {
|
|
63
|
-
return new Intl.NumberFormat(this.locale, {
|
|
66
|
+
return new Intl.NumberFormat(this.locale || pageLocale(this), {
|
|
64
67
|
style: "currency",
|
|
65
68
|
currency: this.currency,
|
|
66
69
|
// A house price reads as £385,000. Pence only mean something on small amounts.
|
|
@@ -83,4 +86,4 @@ customElements.define("impkt-price", ImpktPrice);
|
|
|
83
86
|
export {
|
|
84
87
|
ImpktPrice
|
|
85
88
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-OLLZFNO6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/price.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { pageLocale } from '../base/locale';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\n/**\n * A money amount.\n *\n * This component exists because of a decision taken in the content model: a\n * binding names a source and cannot compute\n * ([ADR 0003](https://github.com/matthill8286/strata/blob/main/docs/decisions/0003-binding-expressions.md)). The\n * consequence is that formatting lives here, where the locale and the currency\n * are known, rather than in authored content — so there is one place that\n * decides what \"£24.99\" looks like, and nobody writes a format string into a\n * CMS field.\n *\n * **The amount is one text node.** Splitting the pounds and the pence into\n * separate elements for typographic effect makes some screen readers read them\n * as two numbers, and \"twenty-four ninety-nine\" becomes \"twenty four, ninety\n * nine\". The visual emphasis is done with CSS over one node instead.\n *\n * **Minor units in, major units out.** `amount` is in pence, because a price\n * that arrives from a pricing API as a float has already lost money to binary\n * rounding before it reaches the screen.\n\n *\n * @category content\n * @icon price\n */\nexport class ImpktPrice extends ImpktElement {\n static properties = {\n amount: { type: Number },\n currency: { type: String },\n locale: { type: String },\n prefix: { type: String },\n period: { type: String },\n size: { type: String, reflect: true },\n pending: { type: String },\n };\n\n /** In minor units — pence, cents. */\n declare amount: number | undefined;\n declare currency: string;\n declare locale: string;\n /** \"From\", \"Guide\". Read before the amount. */\n declare prefix: string;\n /** \"a month\", \"a year\". Read after the amount. */\n declare period: string;\n declare size: 'md' | 'lg' | 'xl';\n /** Shown while there is no amount yet. A price takes seconds to arrive. */\n declare pending: string;\n\n constructor() {\n super();\n this.amount = undefined;\n this.currency = 'GBP';\n this.locale = '';\n this.prefix = '';\n this.period = '';\n this.size = 'xl';\n this.pending = '—';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: inline-flex;\n align-items: baseline;\n gap: ${space(1)};\n color: ${t.text};\n }\n .amount {\n font-family: ${t.fontHeading};\n font-weight: ${fontWeight('bold')};\n /* Tabular figures so a price does not reflow as the digits change,\n which otherwise makes a recalculating price jitter. */\n font-variant-numeric: tabular-nums;\n }\n :host([size='md']) .amount { font-size: ${fontSize('lg')}; }\n :host([size='lg']) .amount { font-size: ${fontSize('2xl')}; }\n :host([size='xl']) .amount { font-size: ${fontSize('3xl')}; }\n .period {\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n }\n `,\n ];\n\n private get formatted(): string {\n if (this.amount === undefined || Number.isNaN(this.amount)) return this.pending;\n try {\n return new Intl.NumberFormat(this.locale || pageLocale(this), {\n style: 'currency',\n currency: this.currency,\n // A house price reads as £385,000. Pence only mean something on small amounts.\n ...(this.amount >= 100000 && this.amount % 100 === 0 ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : {}),\n }).format(this.amount / 100);\n } catch {\n // An unknown currency or locale must not take the page down. The number\n // is still the most useful thing on the screen.\n return (this.amount / 100).toFixed(2);\n }\n }\n\n render(): TemplateResult {\n return html`\n ${this.prefix ? html`<span class=\"period\" part=\"prefix\">${this.prefix}</span>` : nothing}\n <span class=\"amount\" part=\"amount\">${this.formatted}</span>\n ${this.period ? html`<span class=\"period\" part=\"period\">${this.period}</span>` : nothing}\n `;\n }\n}\n\ncustomElements.define('impkt-price', ImpktPrice);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-price': ImpktPrice }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA6BjD,IAAM,aAAN,cAAyB,aAAa;AAAA,EAC3C;AAAA,SAAO,aAAa;AAAA,MAClB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,UAAU,EAAE,MAAM,OAAO;AAAA,MACzB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,SAAS,EAAE,MAAM,OAAO;AAAA,IAC1B;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,SAAS;AACd,SAAK,SAAS;AACd,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA,eAIW,MAAM,CAAC,CAAC;AAAA,iBACN,EAAE,IAAI;AAAA;AAAA;AAAA,uBAGA,EAAE,WAAW;AAAA,uBACb,WAAW,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,gDAKO,SAAS,IAAI,CAAC;AAAA,gDACd,SAAS,KAAK,CAAC;AAAA,gDACf,SAAS,KAAK,CAAC;AAAA;AAAA,qBAE1C,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,SAAS;AAAA;AAAA;AAAA,IAG1B;AAAA;AAAA,EAEA,IAAY,YAAoB;AAC9B,QAAI,KAAK,WAAW,UAAa,OAAO,MAAM,KAAK,MAAM,EAAG,QAAO,KAAK;AACxE,QAAI;AACF,aAAO,IAAI,KAAK,aAAa,KAAK,UAAU,WAAW,IAAI,GAAG;AAAA,QAC5D,OAAO;AAAA,QACP,UAAU,KAAK;AAAA;AAAA,QAEf,GAAI,KAAK,UAAU,OAAU,KAAK,SAAS,QAAQ,IAAI,EAAE,uBAAuB,GAAG,uBAAuB,EAAE,IAAI,CAAC;AAAA,MACnH,CAAC,EAAE,OAAO,KAAK,SAAS,GAAG;AAAA,IAC7B,QAAQ;AAGN,cAAQ,KAAK,SAAS,KAAK,QAAQ,CAAC;AAAA,IACtC;AAAA,EACF;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,QACH,KAAK,SAAS,0CAA0C,KAAK,MAAM,YAAY,OAAO;AAAA,2CACnD,KAAK,SAAS;AAAA,QACjD,KAAK,SAAS,0CAA0C,KAAK,MAAM,YAAY,OAAO;AAAA;AAAA,EAE5F;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7AJN2TIS.js";
|
|
4
4
|
import {
|
|
5
5
|
fontSize,
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D6C7XEY4.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-OMJMUFOW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
iconSvg
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KFD4O7VA.js";
|
|
4
4
|
import {
|
|
5
5
|
ImpktElement,
|
|
6
6
|
focusRing,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
t,
|
|
11
11
|
targetSize,
|
|
12
12
|
visuallyHidden
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-D6C7XEY4.js";
|
|
14
14
|
|
|
15
15
|
// packages/ui/src/components/navigation.ts
|
|
16
16
|
import { css, html, nothing } from "lit";
|
|
17
17
|
function where(href) {
|
|
18
|
-
if (typeof location === "undefined" || !href) return null;
|
|
18
|
+
if (typeof location === "undefined" || !href || href.startsWith("#")) return null;
|
|
19
19
|
let path;
|
|
20
20
|
try {
|
|
21
21
|
path = new URL(href, location.href).pathname.replace(/\/$/, "") || "/";
|
|
@@ -36,6 +36,8 @@ var ImpktNav = class extends ImpktElement {
|
|
|
36
36
|
this.links = [];
|
|
37
37
|
this.label = "Main";
|
|
38
38
|
this.menuText = "Menu";
|
|
39
|
+
this.menuLook = "button";
|
|
40
|
+
this.size = "md";
|
|
39
41
|
this.align = "end";
|
|
40
42
|
}
|
|
41
43
|
static {
|
|
@@ -43,6 +45,8 @@ var ImpktNav = class extends ImpktElement {
|
|
|
43
45
|
links: { type: Array },
|
|
44
46
|
label: { type: String },
|
|
45
47
|
menuText: { type: String, attribute: "menu-text" },
|
|
48
|
+
menuLook: { type: String, reflect: true, attribute: "menu-look" },
|
|
49
|
+
size: { type: String, reflect: true },
|
|
46
50
|
align: { type: String, reflect: true }
|
|
47
51
|
};
|
|
48
52
|
}
|
|
@@ -69,6 +73,11 @@ var ImpktNav = class extends ImpktElement {
|
|
|
69
73
|
/* When they do not fit, the links fold behind a Menu button and open as a panel under it. */
|
|
70
74
|
:host([folded]) { flex: 0 0 auto; }
|
|
71
75
|
:host([folded]) .toggle { display: inline-flex; }
|
|
76
|
+
:host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; }
|
|
77
|
+
:host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
78
|
+
:host([size='sm']) ul { column-gap: ${space(6)}; }
|
|
79
|
+
:host([size='sm']) a { padding-inline: 0; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("medium")}; }
|
|
80
|
+
:host([size='sm'][folded]) a { padding-inline: ${space(3)}; }
|
|
72
81
|
:host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${space(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${space(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
|
|
73
82
|
:host([folded]) ul.open { display: flex; }
|
|
74
83
|
:host([folded]) li { text-align: start; }
|
|
@@ -116,7 +125,7 @@ var ImpktNav = class extends ImpktElement {
|
|
|
116
125
|
render() {
|
|
117
126
|
const list = this.id_("links");
|
|
118
127
|
return html`<nav aria-label=${this.label || nothing} part="nav" @keydown=${this.onKey}>
|
|
119
|
-
<button class="toggle" type="button" aria-expanded=${this.open ? "true" : "false"} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? "close" : "menu")}
|
|
128
|
+
<button class="toggle" type="button" aria-expanded=${this.open ? "true" : "false"} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? "close" : this.menuLook === "icon" ? "menu-two" : "menu")}<span class="words">${this.menuText}</span></button>
|
|
120
129
|
<ul id=${list} class=${this.open ? "open" : ""} part="list">
|
|
121
130
|
${(this.links ?? []).map((link) => {
|
|
122
131
|
const current = where(link.href);
|
|
@@ -164,4 +173,4 @@ export {
|
|
|
164
173
|
ImpktNav,
|
|
165
174
|
ImpktBreadcrumbs
|
|
166
175
|
};
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-QB2KMV6S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation.ts"],"sourcesContent":["import { css, html, 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';\nimport { iconSvg } from './icon';\n\n/** One link in a navigation or a trail. */\nexport interface NavLink {\n label: string;\n href: string;\n}\n\n/** Whether a link is the page the visitor is on, or a page above it. */\nfunction where(href: string): 'page' | 'section' | null {\n // A link to a place on this page, or to nowhere yet (\"#\"), is not where the reader is.\n if (typeof location === 'undefined' || !href || href.startsWith('#')) return null;\n let path: string;\n try { path = new URL(href, location.href).pathname.replace(/\\/$/, '') || '/'; } catch { return null; }\n const here = location.pathname.replace(/\\/$/, '') || '/';\n if (path === here) return 'page';\n return path !== '/' && here.startsWith(`${path}/`) ? 'section' : null;\n}\n\n/**\n * The site's main navigation: a row of links that folds into a Menu button\n * when there is not room for all of them, whatever the screen.\n *\n * **The page you are on is marked in words as well as colour.** Its link\n * carries `aria-current=\"page\"`, which a screen reader announces, and an\n * underline, so it does not rely on colour alone (1.4.1).\n *\n * **The menu is a disclosure, not a pop-up.** The Menu button says whether the\n * list is open (`aria-expanded`), the links follow it in the reading order, and\n * Escape closes it and returns focus to the button.\n *\n * @category action\n * @icon menu\n */\nexport class ImpktNav extends ImpktElement {\n static properties = {\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n menuLook: { type: String, reflect: true, attribute: 'menu-look' },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n };\n /** The links, in order. */\n declare links: NavLink[];\n /** What the navigation is called for a screen reader, such as \"Main\". */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /**\n * The Menu button: `button` with its words, or `icon`, a round button with\n * only the icon, the words kept as its name for screen readers.\n */\n declare menuLook: 'button' | 'icon';\n /** `sm` sets the links a step smaller and closer, as a site header's are. */\n declare size: 'md' | 'sm';\n /** Where the links sit along the row. */\n declare align: 'start' | 'center' | 'end';\n /** Whether the menu is open on a narrow screen. Not a setting: it is the visitor's. */\n private menuOpen = false;\n private get open(): boolean { return this.menuOpen; }\n private set open(next: boolean) { this.menuOpen = next; this.requestUpdate(); }\n\n constructor() {\n super();\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.menuLook = 'button';\n this.size = 'md';\n this.align = 'end';\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n /* It grows to fill a row it sits in, because it measures itself to decide when to fold. */\n :host { display: block; flex: 1 1 8rem; min-inline-size: 0; }\n nav { display: flex; flex-direction: column; position: relative; }\n li { flex: none; }\n ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${space(1)} ${space(6)}; align-items: center; justify-content: flex-end; }\n :host([align='start']) ul { justify-content: flex-start; }\n :host([align='center']) ul { justify-content: center; }\n a { ${targetSize} display: inline-flex; align-items: center; padding: ${space(2)} ${space(1)}; color: inherit; font-weight: ${fontWeight('semibold')}; text-decoration: none; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }\n .toggle { display: none; ${targetSize} align-items: center; gap: ${space(2)}; align-self: flex-end; padding: ${space(2)} ${space(3)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: inherit; background: transparent; border: ${t.borderThin} solid currentColor; border-radius: ${t.radius}; cursor: pointer; }\n /* When they do not fit, the links fold behind a Menu button and open as a panel under it. */\n :host([folded]) { flex: 0 0 auto; }\n :host([folded]) .toggle { display: inline-flex; }\n :host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; }\n :host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n :host([size='sm']) ul { column-gap: ${space(6)}; }\n :host([size='sm']) a { padding-inline: 0; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('medium')}; }\n :host([size='sm'][folded]) a { padding-inline: ${space(3)}; }\n :host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${space(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${space(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }\n :host([folded]) ul.open { display: flex; }\n :host([folded]) li { text-align: start; }\n :host([folded]) a { display: flex; padding: ${space(3)} ${space(3)}; }\n `];\n\n /** The width the links need in one row. Measured once for each set of links, and again while folded it cannot be read. */\n private needs = 0;\n private resize?: ResizeObserver;\n\n private fit(): void {\n const room = this.getBoundingClientRect().width;\n if (room <= 0) return;\n if (!this.needs) {\n this.removeAttribute('folded');\n const items = Array.from(this.renderRoot.querySelectorAll('li'));\n const gap = Number.parseFloat(getComputedStyle(this.renderRoot.querySelector('ul')!).columnGap) || 0;\n this.needs = items.reduce((total, item) => total + item.getBoundingClientRect().width, 0) + gap * Math.max(0, items.length - 1);\n }\n const fold = this.needs > room;\n this.toggleAttribute('folded', fold);\n if (!fold && this.menuOpen) this.open = false;\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('links')) { this.needs = 0; this.fit(); }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(() => this.fit());\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resize?.disconnect();\n }\n\n private toggle(): void {\n this.open = !this.open;\n }\n\n private onKey(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !this.open) return;\n this.open = false;\n this.renderRoot.querySelector<HTMLButtonElement>('.toggle')?.focus();\n }\n\n render(): TemplateResult {\n const list = this.id_('links');\n return html`<nav aria-label=${this.label || nothing} part=\"nav\" @keydown=${this.onKey}>\n <button class=\"toggle\" type=\"button\" aria-expanded=${this.open ? 'true' : 'false'} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? 'close' : this.menuLook === 'icon' ? 'menu-two' : 'menu')}<span class=\"words\">${this.menuText}</span></button>\n <ul id=${list} class=${this.open ? 'open' : ''} part=\"list\">\n ${(this.links ?? []).map((link) => {\n const current = where(link.href);\n return html`<li><a href=${link.href} aria-current=${current === 'page' ? 'page' : current === 'section' ? 'true' : nothing} part=\"link\">${link.label}</a></li>`;\n })}\n </ul>\n </nav>`;\n }\n}\n\n/**\n * Where the page sits in the site, as a trail of links back to the top: Home,\n * then Developments, then this page.\n *\n * The last item is the page itself. It is not a link, and it carries\n * `aria-current=\"page\"`. The separators are drawn, not written, so a screen\n * reader reads the trail as a list rather than a string of slashes.\n *\n * @category action\n * @icon breadcrumbs\n */\nexport class ImpktBreadcrumbs extends ImpktElement {\n static properties = {\n items: { type: Array },\n label: { type: String },\n };\n /** The trail, from the top of the site down to this page. */\n declare items: NavLink[];\n /** What the trail is called for a screen reader. */\n declare label: string;\n\n constructor() {\n super();\n this.items = [];\n this.label = 'Breadcrumb';\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n :host { display: block; font-size: ${fontSize('sm')}; }\n ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${space(1)}; }\n li { display: inline-flex; align-items: center; gap: ${space(1)}; }\n li + li::before { content: ''; inline-size: 0.45em; block-size: 0.45em; border-block-start: 1.5px solid ${t.textMuted}; border-inline-end: 1.5px solid ${t.textMuted}; transform: rotate(45deg); margin-inline: ${space(1)} ${space(2)}; }\n a { color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${t.radiusSm}; }\n a:hover { color: ${t.linkHover}; }\n [aria-current] { color: ${t.textMuted}; }\n .sr-only { ${visuallyHidden} }\n `];\n\n render(): TemplateResult {\n const items = this.items ?? [];\n return html`<nav aria-label=${this.label} part=\"nav\"><ol>\n ${items.map((item, i) => html`<li>${i === items.length - 1\n ? html`<span aria-current=\"page\">${item.label}</span>`\n : html`<a href=${item.href} part=\"link\">${item.label}</a>`}</li>`)}\n </ol></nav>`;\n }\n}\n\ncustomElements.define('impkt-nav', ImpktNav);\ncustomElements.define('impkt-breadcrumbs', ImpktBreadcrumbs);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-nav': ImpktNav; 'impkt-breadcrumbs': ImpktBreadcrumbs } }\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAaxD,SAAS,MAAM,MAAyC;AAEtD,MAAI,OAAO,aAAa,eAAe,CAAC,QAAQ,KAAK,WAAW,GAAG,EAAG,QAAO;AAC7E,MAAI;AACJ,MAAI;AAAE,WAAO,IAAI,IAAI,MAAM,SAAS,IAAI,EAAE,SAAS,QAAQ,OAAO,EAAE,KAAK;AAAA,EAAK,QAAQ;AAAE,WAAO;AAAA,EAAM;AACrG,QAAM,OAAO,SAAS,SAAS,QAAQ,OAAO,EAAE,KAAK;AACrD,MAAI,SAAS,KAAM,QAAO;AAC1B,SAAO,SAAS,OAAO,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,YAAY;AACnE;AAiBO,IAAM,WAAN,cAAuB,aAAa;AAAA,EA6BzC,cAAc;AACZ,UAAM;AALR;AAAA,SAAQ,WAAW;AAyCnB;AAAA,SAAQ,QAAQ;AAnCd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AAC;AAAA,iBACzN,EAAE,IAAI,8EAA8E,EAAE,QAAQ;AAAA,uBACxF,EAAE,SAAS;AAAA,8BACJ,EAAE,SAAS;AAAA,iBACxB,cAAc;AAAA,GAC5B;AAAA;AAAA,EAED,SAAyB;AACvB,UAAM,QAAQ,KAAK,SAAS,CAAC;AAC7B,WAAO,uBAAuB,KAAK,KAAK;AAAA,QACpC,MAAM,IAAI,CAAC,MAAM,MAAM,WAAW,MAAM,MAAM,SAAS,IACrD,iCAAiC,KAAK,KAAK,YAC3C,eAAe,KAAK,IAAI,gBAAgB,KAAK,KAAK,MAAM,OAAO,CAAC;AAAA;AAAA,EAExE;AACF;AAEA,eAAe,OAAO,aAAa,QAAQ;AAC3C,eAAe,OAAO,qBAAqB,gBAAgB;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
spaceAround,
|
|
6
6
|
t,
|
|
7
7
|
token
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-D6C7XEY4.js";
|
|
9
9
|
|
|
10
10
|
// packages/ui/src/components/page.ts
|
|
11
11
|
import { css, html, nothing } from "lit";
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
ImpktPage,
|
|
175
175
|
ImpktSection
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-R67PDFKE.js.map
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpktElement,
|
|
3
|
+
fontSize,
|
|
4
|
+
fontWeight,
|
|
5
|
+
say,
|
|
6
|
+
space,
|
|
7
|
+
t,
|
|
8
|
+
token,
|
|
9
|
+
visuallyHidden
|
|
10
|
+
} from "./chunk-D6C7XEY4.js";
|
|
11
|
+
|
|
12
|
+
// packages/ui/src/components/scrubber.ts
|
|
13
|
+
import { html, css } from "lit";
|
|
14
|
+
var TONES = {
|
|
15
|
+
brand: "var(--impkt-color-brand-default, #1f4ed8)",
|
|
16
|
+
accent: "var(--impkt-color-accent-default, #c8a15a)",
|
|
17
|
+
info: "var(--impkt-color-status-info-default, #1f4ed8)",
|
|
18
|
+
success: "var(--impkt-color-status-success-default, #047857)",
|
|
19
|
+
warning: "var(--impkt-color-status-warning-default, #b45309)",
|
|
20
|
+
danger: "var(--impkt-color-status-danger-default, #c8102e)"
|
|
21
|
+
};
|
|
22
|
+
var ImpktScrubber = class extends ImpktElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.scene = null;
|
|
26
|
+
this.onProgress = (e) => {
|
|
27
|
+
this.value = e.detail.progress;
|
|
28
|
+
};
|
|
29
|
+
this.onInput = (e) => {
|
|
30
|
+
const v = Number(e.target.value) / 1e3;
|
|
31
|
+
this.value = v;
|
|
32
|
+
this.scene?.seek(v);
|
|
33
|
+
};
|
|
34
|
+
this.label = "Scene progress";
|
|
35
|
+
this.stops = [];
|
|
36
|
+
this.look = "buttons";
|
|
37
|
+
this.hint = "";
|
|
38
|
+
this.value = 0;
|
|
39
|
+
}
|
|
40
|
+
static {
|
|
41
|
+
this.properties = {
|
|
42
|
+
label: { type: String },
|
|
43
|
+
stops: { type: Array },
|
|
44
|
+
look: { type: String, reflect: true },
|
|
45
|
+
hint: { type: String },
|
|
46
|
+
value: { type: Number, state: true }
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static {
|
|
50
|
+
this.styles = [
|
|
51
|
+
...ImpktElement.styles,
|
|
52
|
+
css`
|
|
53
|
+
:host {
|
|
54
|
+
display: block;
|
|
55
|
+
width: 100%;
|
|
56
|
+
max-width: 48rem;
|
|
57
|
+
margin-inline: auto;
|
|
58
|
+
}
|
|
59
|
+
.wrap {
|
|
60
|
+
display: grid;
|
|
61
|
+
gap: ${space(2)};
|
|
62
|
+
padding: ${space(3)} ${space(4)};
|
|
63
|
+
border-radius: ${token("radius.xl", "16px")};
|
|
64
|
+
background: ${t.surfaceCard};
|
|
65
|
+
box-shadow: ${token("shadow.lg", "0 10px 15px -3px rgba(0,0,0,.1)")};
|
|
66
|
+
border: 1px solid ${t.border};
|
|
67
|
+
}
|
|
68
|
+
input {
|
|
69
|
+
width: 100%;
|
|
70
|
+
min-height: ${token("target.min", "24px")};
|
|
71
|
+
accent-color: ${t.brand};
|
|
72
|
+
margin: 0;
|
|
73
|
+
}
|
|
74
|
+
.stops {
|
|
75
|
+
position: relative;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
gap: ${space(2)};
|
|
79
|
+
list-style: none;
|
|
80
|
+
margin: 0;
|
|
81
|
+
padding: 0;
|
|
82
|
+
}
|
|
83
|
+
button {
|
|
84
|
+
min-height: ${token("target.min", "24px")};
|
|
85
|
+
padding: ${space(1)} ${space(3)};
|
|
86
|
+
border-radius: ${token("radius.full", "9999px")};
|
|
87
|
+
border: 1px solid ${t.border};
|
|
88
|
+
background: transparent;
|
|
89
|
+
color: ${t.textMuted};
|
|
90
|
+
font-size: ${fontSize("xs")};
|
|
91
|
+
font-weight: ${fontWeight("medium")};
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
button[aria-current='true'] {
|
|
95
|
+
color: ${t.text};
|
|
96
|
+
border-color: ${t.text};
|
|
97
|
+
}
|
|
98
|
+
.sr-only {
|
|
99
|
+
${visuallyHidden}
|
|
100
|
+
}
|
|
101
|
+
/* The graph look: the code of where you are, the line of stops, where you are. */
|
|
102
|
+
:host([look='graph']) { max-width: none; }
|
|
103
|
+
.graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${space(6)}; align-items: center; padding: ${space(4)} ${space(6)}; border-radius: ${token("radius.xl", "16px")}; background: ${t.surfaceCard}; box-shadow: ${token("shadow.lg", "0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${t.border}; }
|
|
104
|
+
.mono { font-family: ${t.fontMono}; font-size: ${fontSize("xs")}; letter-spacing: 0.04em; }
|
|
105
|
+
.head { display: grid; gap: 2px; }
|
|
106
|
+
.head .k { color: ${t.textMuted}; text-transform: uppercase; }
|
|
107
|
+
.head .code { font-size: ${fontSize("md")}; color: ${t.text}; }
|
|
108
|
+
.head .note { color: ${t.textMuted}; }
|
|
109
|
+
.line { position: relative; block-size: 48px; }
|
|
110
|
+
.track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${t.border}; opacity: 0.5; }
|
|
111
|
+
.fill { opacity: 1; background: none; display: flex; overflow: hidden; }
|
|
112
|
+
.fill span { block-size: 100%; }
|
|
113
|
+
.dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${t.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
|
|
114
|
+
.dot[data-passed] { background: var(--c); }
|
|
115
|
+
.dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
|
|
116
|
+
.dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${t.textMuted}; text-transform: uppercase; pointer-events: none; }
|
|
117
|
+
.dot-label[data-current] { color: ${t.text}; font-weight: ${fontWeight("bold")}; }
|
|
118
|
+
.line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
|
|
119
|
+
.line input:focus-visible { opacity: 1; }
|
|
120
|
+
.where { display: grid; gap: ${space(2)}; justify-items: end; }
|
|
121
|
+
.chip { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${token("radius.full", "9999px")}; border: 1px solid ${t.border}; color: ${t.text}; text-transform: uppercase; }
|
|
122
|
+
.chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
|
|
123
|
+
.hint { color: ${t.textMuted}; text-transform: uppercase; }
|
|
124
|
+
@media (max-width: 48rem) {
|
|
125
|
+
.graph { grid-template-columns: minmax(0, 1fr); }
|
|
126
|
+
.where { justify-items: start; }
|
|
127
|
+
.dot-label:not([data-current]) { display: none; }
|
|
128
|
+
}
|
|
129
|
+
button:focus-visible,
|
|
130
|
+
input:focus-visible {
|
|
131
|
+
outline: none;
|
|
132
|
+
box-shadow: ${token("focus.ring.shadow", "0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
133
|
+
}
|
|
134
|
+
`
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
/** @ignore */
|
|
138
|
+
connectedCallback() {
|
|
139
|
+
super.connectedCallback();
|
|
140
|
+
this.scene = this.closest("impkt-scene");
|
|
141
|
+
this.scene?.addEventListener("impkt-scene-progress", this.onProgress);
|
|
142
|
+
if (this.scene) this.value = this.scene.progress;
|
|
143
|
+
}
|
|
144
|
+
/** @ignore */
|
|
145
|
+
disconnectedCallback() {
|
|
146
|
+
super.disconnectedCallback();
|
|
147
|
+
this.scene?.removeEventListener("impkt-scene-progress", this.onProgress);
|
|
148
|
+
this.scene = null;
|
|
149
|
+
}
|
|
150
|
+
goTo(stop) {
|
|
151
|
+
this.scene?.seek(stop.at, 600);
|
|
152
|
+
}
|
|
153
|
+
/** The stop nearest the current position, which the stop list marks as current. */
|
|
154
|
+
nearest() {
|
|
155
|
+
let best = -1;
|
|
156
|
+
let gap = Infinity;
|
|
157
|
+
this.stops.forEach((s, i) => {
|
|
158
|
+
const d = Math.abs(s.at - this.value);
|
|
159
|
+
if (d < gap) {
|
|
160
|
+
gap = d;
|
|
161
|
+
best = i;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return best;
|
|
165
|
+
}
|
|
166
|
+
renderGraph(nearestIndex, valueText) {
|
|
167
|
+
let current = nearestIndex;
|
|
168
|
+
const stops = [...this.stops ?? []].sort((a, b) => a.at - b.at);
|
|
169
|
+
current = stops.indexOf(this.stops[current]);
|
|
170
|
+
const colour = (s) => {
|
|
171
|
+
const tone = s?.tone ?? "brand";
|
|
172
|
+
return typeof tone === "number" ? `var(--impkt-color-chart-${tone}, ${TONES.brand})` : TONES[tone] ?? TONES.brand;
|
|
173
|
+
};
|
|
174
|
+
const now = stops[current] ?? stops[0];
|
|
175
|
+
const segments = stops.map((s, i) => {
|
|
176
|
+
const from = i === 0 ? 0 : stops[i - 1].at;
|
|
177
|
+
const to = Math.min(s.at, this.value);
|
|
178
|
+
return { width: Math.round(Math.max(0, to - from) * 1e4) / 100, c: colour(s) };
|
|
179
|
+
});
|
|
180
|
+
return html`<div class="graph" part="wrap">
|
|
181
|
+
<div class="head mono" aria-hidden="true">
|
|
182
|
+
<span class="k">HEAD</span>
|
|
183
|
+
<span class="code">${now?.meta ?? now?.label ?? ""}</span>
|
|
184
|
+
${now?.note ? html`<span class="note">${now.note}</span>` : null}
|
|
185
|
+
</div>
|
|
186
|
+
<div class="line">
|
|
187
|
+
<div class="track"></div>
|
|
188
|
+
<div class="fill" aria-hidden="true">${segments.map((g) => html`<span style=${`width:${g.width}%;background:${g.c}`}></span>`)}</div>
|
|
189
|
+
${stops.map((s, i) => html`
|
|
190
|
+
<button type="button" class="dot" style=${`left:${s.at * 100}%;--c:${colour(s)}`} ?data-passed=${s.at <= this.value + 1e-4} aria-current=${i === current ? "true" : "false"} @click=${() => this.goTo(s)}>
|
|
191
|
+
<span class="sr-only">${say("Go to {name}", { name: s.label })}</span>
|
|
192
|
+
</button>
|
|
193
|
+
<span class="dot-label mono" style=${`left:${s.at * 100}%`} ?data-current=${i === current} aria-hidden="true">${s.label}</span>`)}
|
|
194
|
+
<input type="range" min="0" max="1000" step="1" .value=${String(Math.round(this.value * 1e3))} aria-label=${this.label} aria-valuetext=${valueText} @input=${this.onInput} />
|
|
195
|
+
</div>
|
|
196
|
+
<div class="where" aria-hidden="true">
|
|
197
|
+
${now ? html`<span class="chip mono" style=${`--c:${colour(now)}`}>${now.label}${now.meta ? html` <span style="opacity:.6">${now.meta}</span>` : null}</span>` : null}
|
|
198
|
+
${this.hint ? html`<span class="hint mono">${this.hint}</span>` : null}
|
|
199
|
+
</div>
|
|
200
|
+
</div>`;
|
|
201
|
+
}
|
|
202
|
+
render() {
|
|
203
|
+
const current = this.nearest();
|
|
204
|
+
const valueText = current >= 0 ? this.stops[current].label : `${Math.round(this.value * 100)}%`;
|
|
205
|
+
if (this.look === "graph") return this.renderGraph(current, valueText);
|
|
206
|
+
return html`
|
|
207
|
+
<div class="wrap" part="wrap">
|
|
208
|
+
<input
|
|
209
|
+
type="range"
|
|
210
|
+
min="0"
|
|
211
|
+
max="1000"
|
|
212
|
+
step="1"
|
|
213
|
+
.value=${String(Math.round(this.value * 1e3))}
|
|
214
|
+
aria-label=${this.label}
|
|
215
|
+
aria-valuetext=${valueText}
|
|
216
|
+
@input=${this.onInput}
|
|
217
|
+
/>
|
|
218
|
+
${this.stops.length ? html`<ul class="stops" part="stops">
|
|
219
|
+
${this.stops.map(
|
|
220
|
+
(s, i) => html`<li>
|
|
221
|
+
<button type="button" aria-current=${i === current ? "true" : "false"} @click=${() => this.goTo(s)}>
|
|
222
|
+
<span aria-hidden="true">${s.label}</span><span class="sr-only">${say("Go to {name}", { name: s.label })}</span>
|
|
223
|
+
</button>
|
|
224
|
+
</li>`
|
|
225
|
+
)}
|
|
226
|
+
</ul>` : null}
|
|
227
|
+
</div>
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
customElements.define("impkt-scrubber", ImpktScrubber);
|
|
232
|
+
|
|
233
|
+
export {
|
|
234
|
+
ImpktScrubber
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=chunk-RZSZQMSE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/scrubber.ts"],"sourcesContent":["import { html, css, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport type { ImpktScene } from './scene';\n\nexport interface ScrubberStop {\n /** Where the stop sits on the scene's progress, from 0 to 1. */\n at: number;\n label: string;\n /** A short code beside it in the graph look, such as a commit hash. */\n meta?: string;\n /** A line under the code in the graph look, such as a commit message. */\n note?: string;\n /**\n * The colour of the line up to this stop, in the graph look: a named tone,\n * or 1 to 5 for the brand's chart colours, as a project's phases are drawn.\n */\n tone?: 'brand' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 1 | 2 | 3 | 4 | 5;\n}\n\nconst TONES = {\n brand: 'var(--impkt-color-brand-default, #1f4ed8)',\n accent: 'var(--impkt-color-accent-default, #c8a15a)',\n info: 'var(--impkt-color-status-info-default, #1f4ed8)',\n success: 'var(--impkt-color-status-success-default, #047857)',\n warning: 'var(--impkt-color-status-warning-default, #b45309)',\n danger: 'var(--impkt-color-status-danger-default, #c8102e)',\n} as const;\n\n/**\n * Drives the scene it sits in, by hand.\n *\n * Place it in an `impkt-scene`'s `controls` slot and set that scene's `drive`\n * to `scrubber`. Dragging moves through the scene; a named stop seeks to it\n * with an eased move rather than a cut, which is what makes the Commit-style\n * \"time travel\" read as travel.\n *\n * **It is a native range input.** A slider built from divs has to recreate\n * arrow keys, Page Up and Down, Home and End, the value announcement and touch\n * handling, and every one of those is a place to get it wrong. The input\n * already does all of it. The stops are buttons beside it, so a keyboard or\n * switch user reaches each named moment in one action instead of nudging a\n * thumb to find it (2.5.7, dragging movements).\n *\n * @category action\n * @icon adjustments-horizontal\n */\nexport class ImpktScrubber extends ImpktElement {\n static properties = {\n label: { type: String },\n stops: { type: Array },\n look: { type: String, reflect: true },\n hint: { type: String },\n value: { type: Number, state: true },\n };\n\n /** The slider's accessible name. */\n declare label: string;\n declare stops: ScrubberStop[];\n /**\n * `buttons` lists the stops as buttons under the slider. `graph` draws them\n * as commits on a line that fills in each stop's colour as it is dragged,\n * with the current one's code and note beside it.\n */\n declare look: 'buttons' | 'graph';\n /** A word of help in the graph look, such as \"drag to time-travel\". */\n declare hint: string;\n declare value: number;\n\n private scene: ImpktScene | null = null;\n\n constructor() {\n super();\n this.label = 'Scene progress';\n this.stops = [];\n this.look = 'buttons';\n this.hint = '';\n this.value = 0;\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n width: 100%;\n max-width: 48rem;\n margin-inline: auto;\n }\n .wrap {\n display: grid;\n gap: ${space(2)};\n padding: ${space(3)} ${space(4)};\n border-radius: ${token('radius.xl', '16px')};\n background: ${t.surfaceCard};\n box-shadow: ${token('shadow.lg', '0 10px 15px -3px rgba(0,0,0,.1)')};\n border: 1px solid ${t.border};\n }\n input {\n width: 100%;\n min-height: ${token('target.min', '24px')};\n accent-color: ${t.brand};\n margin: 0;\n }\n .stops {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: ${space(2)};\n list-style: none;\n margin: 0;\n padding: 0;\n }\n button {\n min-height: ${token('target.min', '24px')};\n padding: ${space(1)} ${space(3)};\n border-radius: ${token('radius.full', '9999px')};\n border: 1px solid ${t.border};\n background: transparent;\n color: ${t.textMuted};\n font-size: ${fontSize('xs')};\n font-weight: ${fontWeight('medium')};\n cursor: pointer;\n }\n button[aria-current='true'] {\n color: ${t.text};\n border-color: ${t.text};\n }\n .sr-only {\n ${visuallyHidden}\n }\n /* The graph look: the code of where you are, the line of stops, where you are. */\n :host([look='graph']) { max-width: none; }\n .graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${space(6)}; align-items: center; padding: ${space(4)} ${space(6)}; border-radius: ${token('radius.xl', '16px')}; background: ${t.surfaceCard}; box-shadow: ${token('shadow.lg', '0 10px 15px -3px rgba(0,0,0,.1)')}; border: 1px solid ${t.border}; }\n .mono { font-family: ${t.fontMono}; font-size: ${fontSize('xs')}; letter-spacing: 0.04em; }\n .head { display: grid; gap: 2px; }\n .head .k { color: ${t.textMuted}; text-transform: uppercase; }\n .head .code { font-size: ${fontSize('md')}; color: ${t.text}; }\n .head .note { color: ${t.textMuted}; }\n .line { position: relative; block-size: 48px; }\n .track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${t.border}; opacity: 0.5; }\n .fill { opacity: 1; background: none; display: flex; overflow: hidden; }\n .fill span { block-size: 100%; }\n .dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${t.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }\n .dot[data-passed] { background: var(--c); }\n .dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }\n .dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${t.textMuted}; text-transform: uppercase; pointer-events: none; }\n .dot-label[data-current] { color: ${t.text}; font-weight: ${fontWeight('bold')}; }\n .line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }\n .line input:focus-visible { opacity: 1; }\n .where { display: grid; gap: ${space(2)}; justify-items: end; }\n .chip { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${token('radius.full', '9999px')}; border: 1px solid ${t.border}; color: ${t.text}; text-transform: uppercase; }\n .chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }\n .hint { color: ${t.textMuted}; text-transform: uppercase; }\n @media (max-width: 48rem) {\n .graph { grid-template-columns: minmax(0, 1fr); }\n .where { justify-items: start; }\n .dot-label:not([data-current]) { display: none; }\n }\n button:focus-visible,\n input:focus-visible {\n outline: none;\n box-shadow: ${token('focus.ring.shadow', '0 0 0 2px #fff, 0 0 0 4px #1a1a1a')};\n }\n `,\n ];\n\n /** @ignore */\n connectedCallback(): void {\n super.connectedCallback();\n this.scene = this.closest('impkt-scene');\n this.scene?.addEventListener('impkt-scene-progress', this.onProgress);\n if (this.scene) this.value = this.scene.progress;\n }\n\n /** @ignore */\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.scene?.removeEventListener('impkt-scene-progress', this.onProgress);\n this.scene = null;\n }\n\n private onProgress = (e: Event) => {\n this.value = (e as CustomEvent<{ progress: number }>).detail.progress;\n };\n\n private onInput = (e: Event) => {\n const v = Number((e.target as HTMLInputElement).value) / 1000;\n this.value = v;\n this.scene?.seek(v);\n };\n\n private goTo(stop: ScrubberStop) {\n this.scene?.seek(stop.at, 600);\n }\n\n /** The stop nearest the current position, which the stop list marks as current. */\n private nearest(): number {\n let best = -1;\n let gap = Infinity;\n this.stops.forEach((s, i) => {\n const d = Math.abs(s.at - this.value);\n if (d < gap) {\n gap = d;\n best = i;\n }\n });\n return best;\n }\n\n private renderGraph(nearestIndex: number, valueText: string): TemplateResult {\n let current = nearestIndex;\n const stops = [...(this.stops ?? [])].sort((a, b) => a.at - b.at);\n // Where you are, among the stops in the order they are drawn.\n current = stops.indexOf(this.stops[current]!);\n const colour = (s: ScrubberStop | undefined) => {\n const tone = s?.tone ?? 'brand';\n return typeof tone === 'number' ? `var(--impkt-color-chart-${tone}, ${TONES.brand})` : TONES[tone] ?? TONES.brand;\n };\n const now = stops[current] ?? stops[0];\n // The line fills in each stop's colour, from the stop before it to it, as far as the playhead.\n const segments = stops.map((s, i) => {\n const from = i === 0 ? 0 : stops[i - 1]!.at;\n const to = Math.min(s.at, this.value);\n return { width: Math.round(Math.max(0, to - from) * 10000) / 100, c: colour(s) };\n });\n return html`<div class=\"graph\" part=\"wrap\">\n <div class=\"head mono\" aria-hidden=\"true\">\n <span class=\"k\">HEAD</span>\n <span class=\"code\">${now?.meta ?? now?.label ?? ''}</span>\n ${now?.note ? html`<span class=\"note\">${now.note}</span>` : null}\n </div>\n <div class=\"line\">\n <div class=\"track\"></div>\n <div class=\"fill\" aria-hidden=\"true\">${segments.map((g) => html`<span style=${`width:${g.width}%;background:${g.c}`}></span>`)}</div>\n ${stops.map((s, i) => html`\n <button type=\"button\" class=\"dot\" style=${`left:${s.at * 100}%;--c:${colour(s)}`} ?data-passed=${s.at <= this.value + 0.0001} aria-current=${i === current ? 'true' : 'false'} @click=${() => this.goTo(s)}>\n <span class=\"sr-only\">${say('Go to {name}', { name: s.label })}</span>\n </button>\n <span class=\"dot-label mono\" style=${`left:${s.at * 100}%`} ?data-current=${i === current} aria-hidden=\"true\">${s.label}</span>`)}\n <input type=\"range\" min=\"0\" max=\"1000\" step=\"1\" .value=${String(Math.round(this.value * 1000))} aria-label=${this.label} aria-valuetext=${valueText} @input=${this.onInput} />\n </div>\n <div class=\"where\" aria-hidden=\"true\">\n ${now ? html`<span class=\"chip mono\" style=${`--c:${colour(now)}`}>${now.label}${now.meta ? html` <span style=\"opacity:.6\">${now.meta}</span>` : null}</span>` : null}\n ${this.hint ? html`<span class=\"hint mono\">${this.hint}</span>` : null}\n </div>\n </div>`;\n }\n\n render(): TemplateResult {\n const current = this.nearest();\n const valueText = current >= 0 ? this.stops[current].label : `${Math.round(this.value * 100)}%`;\n if (this.look === 'graph') return this.renderGraph(current, valueText);\n return html`\n <div class=\"wrap\" part=\"wrap\">\n <input\n type=\"range\"\n min=\"0\"\n max=\"1000\"\n step=\"1\"\n .value=${String(Math.round(this.value * 1000))}\n aria-label=${this.label}\n aria-valuetext=${valueText}\n @input=${this.onInput}\n />\n ${this.stops.length\n ? html`<ul class=\"stops\" part=\"stops\">\n ${this.stops.map(\n (s, i) => html`<li>\n <button type=\"button\" aria-current=${i === current ? 'true' : 'false'} @click=${() => this.goTo(s)}>\n <span aria-hidden=\"true\">${s.label}</span><span class=\"sr-only\">${say('Go to {name}', { name: s.label })}</span>\n </button>\n </li>`,\n )}\n </ul>`\n : null}\n </div>\n `;\n }\n}\n\ncustomElements.define('impkt-scrubber', ImpktScrubber);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-scrubber': ImpktScrubber }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,WAAgC;AAsB/C,IAAM,QAAQ;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA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AAK,MAAM,KAAK,QAAQ,GAAG,CAAC;AAC5F,QAAI,KAAK,SAAS,QAAS,QAAO,KAAK,YAAY,SAAS,SAAS;AACrE,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAOQ,OAAO,KAAK,MAAM,KAAK,QAAQ,GAAI,CAAC,CAAC;AAAA,uBACjC,KAAK,KAAK;AAAA,2BACN,SAAS;AAAA,mBACjB,KAAK,OAAO;AAAA;AAAA,UAErB,KAAK,MAAM,SACT;AAAA,gBACI,KAAK,MAAM;AAAA,MACX,CAAC,GAAG,MAAM;AAAA,uDAC6B,MAAM,UAAU,SAAS,OAAO,WAAW,MAAM,KAAK,KAAK,CAAC,CAAC;AAAA,+CACrE,EAAE,KAAK,gCAAgC,IAAI,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,IAG9G,CAAC;AAAA,qBAEH,IAAI;AAAA;AAAA;AAAA,EAGd;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D6C7XEY4.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-TGT7J4EG.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
space,
|
|
7
7
|
t,
|
|
8
8
|
targetSize
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D6C7XEY4.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/dialog.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
@@ -129,4 +129,4 @@ customElements.define("impkt-dialog", ImpktDialog);
|
|
|
129
129
|
export {
|
|
130
130
|
ImpktDialog
|
|
131
131
|
};
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-UCHJCUYI.js.map
|