@atomic-ui/ui 0.2.0 → 0.5.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 +88 -105
- package/custom-elements.json +6370 -15469
- package/dist/base/FieldElement.d.ts +14 -3
- package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
- package/dist/base/scroll-lock.d.ts +2 -0
- package/dist/base/styles.d.ts +31 -5
- package/dist/base/tokens.d.ts +1 -1
- package/dist/base/tone.d.ts +20 -0
- package/dist/chunk-2YRTFWW2.js +26 -0
- package/dist/chunk-2YRTFWW2.js.map +1 -0
- package/dist/{chunk-7BSZPUE3.js → chunk-3EF4T242.js} +7 -7
- package/dist/chunk-3EF4T242.js.map +1 -0
- package/dist/{chunk-KFD4O7VA.js → chunk-5Y3HYRCU.js} +7 -7
- package/dist/chunk-5Y3HYRCU.js.map +1 -0
- package/dist/{chunk-7AJN2TIS.js → chunk-5ZQVL3V2.js} +29 -12
- package/dist/chunk-5ZQVL3V2.js.map +1 -0
- package/dist/{chunk-NCASAXQT.js → chunk-A7YBFS4H.js} +15 -15
- package/dist/chunk-A7YBFS4H.js.map +1 -0
- package/dist/{chunk-E2VBUWJ4.js → chunk-ACQ4KYPR.js} +9 -9
- package/dist/chunk-ACQ4KYPR.js.map +1 -0
- package/dist/{chunk-OMJMUFOW.js → chunk-DE3INTHZ.js} +6 -6
- package/dist/chunk-DE3INTHZ.js.map +1 -0
- package/dist/chunk-EJD6LT7E.js +161 -0
- package/dist/chunk-EJD6LT7E.js.map +1 -0
- package/dist/{chunk-XJXCTGDR.js → chunk-EJSX4WCD.js} +9 -9
- package/dist/chunk-EJSX4WCD.js.map +1 -0
- package/dist/chunk-FMSC7J7J.js +76 -0
- package/dist/chunk-FMSC7J7J.js.map +1 -0
- package/dist/{chunk-R67PDFKE.js → chunk-FWR6SEIA.js} +33 -33
- package/dist/chunk-FWR6SEIA.js.map +1 -0
- package/dist/{chunk-FFCIY7NM.js → chunk-GJPHQLLN.js} +8 -8
- package/dist/chunk-GJPHQLLN.js.map +1 -0
- package/dist/{chunk-OLLZFNO6.js → chunk-HNBG2POR.js} +7 -7
- package/dist/chunk-HNBG2POR.js.map +1 -0
- package/dist/{chunk-E3XJK7MY.js → chunk-HNZQ7LM4.js} +13 -11
- package/dist/chunk-HNZQ7LM4.js.map +1 -0
- package/dist/{chunk-3IQ73WNW.js → chunk-I54DOEZB.js} +9 -7
- package/dist/chunk-I54DOEZB.js.map +1 -0
- package/dist/{chunk-QB2KMV6S.js → chunk-PANH23MF.js} +12 -12
- package/dist/chunk-PANH23MF.js.map +1 -0
- package/dist/{chunk-UCHJCUYI.js → chunk-PYVUQNFQ.js} +39 -13
- package/dist/chunk-PYVUQNFQ.js.map +1 -0
- package/dist/{chunk-GQDUHZE3.js → chunk-Q54FX3SY.js} +8 -8
- package/dist/chunk-Q54FX3SY.js.map +1 -0
- package/dist/{chunk-WFKSOM6O.js → chunk-QBORJTS4.js} +68 -44
- package/dist/chunk-QBORJTS4.js.map +1 -0
- package/dist/{chunk-TGT7J4EG.js → chunk-RXX4CN5J.js} +7 -7
- package/dist/chunk-RXX4CN5J.js.map +1 -0
- package/dist/{chunk-XEJMFFIM.js → chunk-SV77SN6P.js} +8 -8
- package/dist/chunk-SV77SN6P.js.map +1 -0
- package/dist/chunk-TAZZLOUY.js +328 -0
- package/dist/chunk-TAZZLOUY.js.map +1 -0
- package/dist/{chunk-7OXTZJR4.js → chunk-TRZO5CHU.js} +7 -7
- package/dist/chunk-TRZO5CHU.js.map +1 -0
- package/dist/{chunk-EDSZI227.js → chunk-UPOTBKKK.js} +12 -9
- package/dist/chunk-UPOTBKKK.js.map +1 -0
- package/dist/{chunk-26O27BQS.js → chunk-WP5WJ4V5.js} +6 -6
- package/dist/chunk-WP5WJ4V5.js.map +1 -0
- package/dist/{chunk-YD6IZ2C5.js → chunk-WS5AUJ35.js} +7 -7
- package/dist/chunk-WS5AUJ35.js.map +1 -0
- package/dist/{chunk-HYPPG4NF.js → chunk-WWYYNR3Z.js} +93 -53
- package/dist/chunk-WWYYNR3Z.js.map +1 -0
- package/dist/{chunk-NKTMMJYD.js → chunk-XU2XODVH.js} +9 -8
- package/dist/chunk-XU2XODVH.js.map +1 -0
- package/dist/{chunk-D6C7XEY4.js → chunk-YR6T73GY.js} +24 -12
- package/dist/chunk-YR6T73GY.js.map +1 -0
- package/dist/{chunk-OB7WULFK.js → chunk-YYYQPKQ7.js} +24 -24
- package/dist/chunk-YYYQPKQ7.js.map +1 -0
- package/dist/{chunk-FJRHZA3C.js → chunk-Z45LY6BT.js} +9 -9
- package/dist/chunk-Z45LY6BT.js.map +1 -0
- package/dist/{chunk-6YYAOKNI.js → chunk-ZQBEFP2O.js} +7 -7
- package/dist/chunk-ZQBEFP2O.js.map +1 -0
- package/dist/chunk-ZS7RPXCT.js +47 -0
- package/dist/chunk-ZS7RPXCT.js.map +1 -0
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +4 -4
- package/dist/components/alert.d.ts +3 -3
- package/dist/components/alert.js +4 -4
- package/dist/components/app-ui.d.ts +47 -31
- package/dist/components/app-ui.js +21 -20
- package/dist/components/badge.d.ts +37 -0
- package/dist/components/badge.js +9 -0
- package/dist/components/blocks.d.ts +37 -74
- package/dist/components/blocks.js +10 -13
- package/dist/components/button.d.ts +3 -3
- package/dist/components/button.js +5 -5
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +5 -5
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +5 -5
- package/dist/components/chip.d.ts +58 -0
- package/dist/components/chip.js +8 -0
- package/dist/components/date-input.d.ts +2 -2
- package/dist/components/date-input.js +5 -5
- package/dist/components/dialog.d.ts +18 -3
- package/dist/components/dialog.js +5 -4
- package/dist/components/fieldset.d.ts +3 -3
- package/dist/components/fieldset.js +4 -4
- package/dist/components/grid.d.ts +3 -3
- package/dist/components/grid.js +4 -4
- package/dist/components/help.d.ts +3 -3
- package/dist/components/help.js +4 -4
- package/dist/components/icon.d.ts +3 -3
- package/dist/components/icon.js +4 -4
- package/dist/components/journey.d.ts +30 -16
- package/dist/components/journey.js +15 -15
- package/dist/components/layout.d.ts +9 -9
- package/dist/components/layout.js +10 -10
- package/dist/components/link.d.ts +3 -3
- package/dist/components/link.js +5 -5
- package/dist/components/list.d.ts +3 -3
- package/dist/components/list.js +4 -4
- package/dist/components/media.d.ts +8 -8
- package/dist/components/media.js +8 -8
- package/dist/components/navigation.d.ts +5 -5
- package/dist/components/navigation.js +7 -7
- package/dist/components/page.d.ts +5 -5
- package/dist/components/page.js +6 -6
- package/dist/components/price.d.ts +3 -3
- package/dist/components/price.js +4 -4
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +4 -4
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +5 -5
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +5 -5
- package/dist/components/summary-list.d.ts +3 -3
- package/dist/components/summary-list.js +4 -4
- package/dist/components/table.d.ts +97 -5
- package/dist/components/table.js +6 -4
- package/dist/components/text-input.d.ts +2 -2
- package/dist/components/text-input.js +5 -5
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +5 -5
- package/dist/index.d.ts +47 -40
- package/dist/index.js +206 -269
- package/dist/standalone/atomic-ui.js +1928 -0
- package/dist/standalone/atomic-ui.js.map +7 -0
- package/dist/standalone/index.html +173 -0
- package/package.json +19 -7
- package/scripts/copy-to-product.mjs +52 -0
- package/specimen/index.html +173 -0
- package/dist/chunk-26O27BQS.js.map +0 -1
- package/dist/chunk-2CFVV2NZ.js +0 -494
- package/dist/chunk-2CFVV2NZ.js.map +0 -1
- package/dist/chunk-3IQ73WNW.js.map +0 -1
- package/dist/chunk-4X723QBD.js +0 -361
- package/dist/chunk-4X723QBD.js.map +0 -1
- package/dist/chunk-6YYAOKNI.js.map +0 -1
- package/dist/chunk-7AJN2TIS.js.map +0 -1
- package/dist/chunk-7BSZPUE3.js.map +0 -1
- package/dist/chunk-7OXTZJR4.js.map +0 -1
- package/dist/chunk-7XEPNEVQ.js +0 -264
- package/dist/chunk-7XEPNEVQ.js.map +0 -1
- package/dist/chunk-D6C7XEY4.js.map +0 -1
- package/dist/chunk-E2VBUWJ4.js.map +0 -1
- package/dist/chunk-E3XJK7MY.js.map +0 -1
- package/dist/chunk-EDSZI227.js.map +0 -1
- package/dist/chunk-FFCIY7NM.js.map +0 -1
- package/dist/chunk-FJRHZA3C.js.map +0 -1
- package/dist/chunk-GQDUHZE3.js.map +0 -1
- package/dist/chunk-HYPPG4NF.js.map +0 -1
- package/dist/chunk-J4JULXUG.js +0 -249
- package/dist/chunk-J4JULXUG.js.map +0 -1
- package/dist/chunk-KFD4O7VA.js.map +0 -1
- package/dist/chunk-MVEFM5QI.js +0 -195
- package/dist/chunk-MVEFM5QI.js.map +0 -1
- package/dist/chunk-NCASAXQT.js.map +0 -1
- package/dist/chunk-NKTMMJYD.js.map +0 -1
- package/dist/chunk-OB7WULFK.js.map +0 -1
- package/dist/chunk-OHDPGIJ3.js +0 -428
- package/dist/chunk-OHDPGIJ3.js.map +0 -1
- package/dist/chunk-OLLZFNO6.js.map +0 -1
- package/dist/chunk-OMJMUFOW.js.map +0 -1
- package/dist/chunk-QB2KMV6S.js.map +0 -1
- package/dist/chunk-R67PDFKE.js.map +0 -1
- package/dist/chunk-RZSZQMSE.js +0 -236
- package/dist/chunk-RZSZQMSE.js.map +0 -1
- package/dist/chunk-TGT7J4EG.js.map +0 -1
- package/dist/chunk-UCHJCUYI.js.map +0 -1
- package/dist/chunk-UHLRXI6J.js +0 -453
- package/dist/chunk-UHLRXI6J.js.map +0 -1
- package/dist/chunk-UNVL3CNM.js +0 -725
- package/dist/chunk-UNVL3CNM.js.map +0 -1
- package/dist/chunk-WDDWWCHN.js +0 -104
- package/dist/chunk-WDDWWCHN.js.map +0 -1
- package/dist/chunk-WFKSOM6O.js.map +0 -1
- package/dist/chunk-XEJMFFIM.js.map +0 -1
- package/dist/chunk-XJXCTGDR.js.map +0 -1
- package/dist/chunk-YD6IZ2C5.js.map +0 -1
- package/dist/chunk-YK5QI57J.js +0 -396
- package/dist/chunk-YK5QI57J.js.map +0 -1
- package/dist/components/changelog.d.ts +0 -386
- package/dist/components/changelog.js +0 -25
- package/dist/components/estimator.d.ts +0 -246
- package/dist/components/estimator.js +0 -16
- package/dist/components/marketing.d.ts +0 -370
- package/dist/components/marketing.js +0 -21
- package/dist/components/marketing.js.map +0 -1
- package/dist/components/organisms.d.ts +0 -559
- package/dist/components/organisms.js +0 -25
- package/dist/components/organisms.js.map +0 -1
- package/dist/components/property.d.ts +0 -389
- package/dist/components/property.js +0 -20
- package/dist/components/property.js.map +0 -1
- package/dist/components/scene.d.ts +0 -138
- package/dist/components/scene.js +0 -8
- package/dist/components/scene.js.map +0 -1
- package/dist/components/scrubber.d.ts +0 -86
- package/dist/components/scrubber.js +0 -8
- package/dist/components/scrubber.js.map +0 -1
- package/dist/components/selling.d.ts +0 -407
- package/dist/components/selling.js +0 -25
- package/dist/components/selling.js.map +0 -1
- package/dist/components/site.d.ts +0 -283
- package/dist/components/site.js +0 -20
- package/dist/components/site.js.map +0 -1
- /package/dist/components/{changelog.js.map → badge.js.map} +0 -0
- /package/dist/components/{estimator.js.map → chip.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/ui/src/base/tokens.ts
|
|
2
2
|
import { css, unsafeCSS } from "lit";
|
|
3
|
-
var token = (path, fallback) => unsafeCSS(`var(--
|
|
3
|
+
var token = (path, fallback) => unsafeCSS(`var(--impakt-${path.replace(/\./g, "-")}, ${fallback})`);
|
|
4
4
|
var t = {
|
|
5
5
|
brand: token("color.brand.default", "#1f4ed8"),
|
|
6
6
|
brandHover: token("color.brand.hover", "#1b45be"),
|
|
@@ -48,12 +48,12 @@ var t = {
|
|
|
48
48
|
radiusXl: token("radius.xl", "12px"),
|
|
49
49
|
radius2xl: token("radius.2xl", "16px"),
|
|
50
50
|
/** Hairline borders and rings, from the text colour, so they suit any surface. */
|
|
51
|
-
hairline: unsafeCSS("color-mix(in srgb, var(--
|
|
52
|
-
rule: unsafeCSS("color-mix(in srgb, var(--
|
|
51
|
+
hairline: unsafeCSS("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 10%, transparent)"),
|
|
52
|
+
rule: unsafeCSS("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 15%, transparent)"),
|
|
53
53
|
/** A wash of the text colour, for hover and pressed states on quiet controls. */
|
|
54
|
-
wash: unsafeCSS("color-mix(in srgb, var(--
|
|
54
|
+
wash: unsafeCSS("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 5%, transparent)"),
|
|
55
55
|
/** The brand at a fifth, for focus halos round fields. */
|
|
56
|
-
brandHalo: unsafeCSS("color-mix(in srgb, var(--
|
|
56
|
+
brandHalo: unsafeCSS("color-mix(in srgb, var(--impakt-color-brand-default, #1f4ed8) 22%, transparent)"),
|
|
57
57
|
shadowXs: token("shadow.xs", "0 1px 2px 0 rgb(0 0 0 / 0.05)"),
|
|
58
58
|
shadowSm: token("shadow.sm", "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"),
|
|
59
59
|
shadowMd: token("shadow.md", "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"),
|
|
@@ -62,7 +62,7 @@ var t = {
|
|
|
62
62
|
trackingTight: token("font.tracking.tight", "-0.02em"),
|
|
63
63
|
trackingWide: token("font.tracking.wide", "0.06em")
|
|
64
64
|
};
|
|
65
|
-
var type = (name) => unsafeCSS(`font-size: var(--
|
|
65
|
+
var type = (name) => unsafeCSS(`font-size: var(--impakt-font-size-${name}, 1rem); line-height: var(--impakt-font-leading-${name}, 1.5);`);
|
|
66
66
|
var space = (step) => token(`space.${String(step).replace(".", "-")}`, `${step * 4}px`);
|
|
67
67
|
var fontSize = (name) => token(`font.size.${name}`, "1rem");
|
|
68
68
|
var lineHeight = (name) => token(`font.line-height.${name}`, "1.5");
|
|
@@ -81,7 +81,7 @@ var spaceAround = css`
|
|
|
81
81
|
`;
|
|
82
82
|
|
|
83
83
|
// packages/ui/src/base/styles.ts
|
|
84
|
-
import { css as css2 } from "lit";
|
|
84
|
+
import { css as css2, unsafeCSS as unsafeCSS2 } from "lit";
|
|
85
85
|
var focusRing = css2`
|
|
86
86
|
:host(:focus-visible),
|
|
87
87
|
:host(:not([disabled])) :focus-visible {
|
|
@@ -133,6 +133,14 @@ var base = css2`
|
|
|
133
133
|
box-sizing: inherit;
|
|
134
134
|
}
|
|
135
135
|
`;
|
|
136
|
+
var touchTarget = (selector) => (
|
|
137
|
+
// Under :host, so it outweighs the component's own rule for the same control whatever the order.
|
|
138
|
+
unsafeCSS2(`@media (pointer: coarse) { :host :is(${selector}) { min-block-size: 44px; min-inline-size: 44px; } }`)
|
|
139
|
+
);
|
|
140
|
+
var hideOn = css2`
|
|
141
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
|
|
142
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
|
|
143
|
+
`;
|
|
136
144
|
|
|
137
145
|
// packages/ui/src/base/say.ts
|
|
138
146
|
var WORDING = Symbol.for("strata.wording");
|
|
@@ -143,10 +151,10 @@ function say(english, values) {
|
|
|
143
151
|
return values ? text.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole) : text;
|
|
144
152
|
}
|
|
145
153
|
|
|
146
|
-
// packages/ui/src/base/
|
|
154
|
+
// packages/ui/src/base/ImpaktElement.ts
|
|
147
155
|
import { LitElement, css as css3 } from "lit";
|
|
148
156
|
var counter = 0;
|
|
149
|
-
var
|
|
157
|
+
var ImpaktElement = class extends LitElement {
|
|
150
158
|
constructor() {
|
|
151
159
|
super(...arguments);
|
|
152
160
|
/**
|
|
@@ -156,7 +164,7 @@ var ImpktElement = class extends LitElement {
|
|
|
156
164
|
* that changes between renders breaks the relationship it exists to express
|
|
157
165
|
* — and it breaks it silently, since the markup still looks correct.
|
|
158
166
|
*/
|
|
159
|
-
this.uid = `
|
|
167
|
+
this.uid = `impakt-${counter += 1}`;
|
|
160
168
|
}
|
|
161
169
|
static {
|
|
162
170
|
this.styles = [base, reducedMotion, css3``];
|
|
@@ -204,7 +212,11 @@ export {
|
|
|
204
212
|
focusRing,
|
|
205
213
|
targetSize,
|
|
206
214
|
visuallyHidden,
|
|
215
|
+
reducedMotion,
|
|
216
|
+
base,
|
|
217
|
+
touchTarget,
|
|
218
|
+
hideOn,
|
|
207
219
|
say,
|
|
208
|
-
|
|
220
|
+
ImpaktElement
|
|
209
221
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-YR6T73GY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/base/tokens.ts","../src/base/styles.ts","../src/base/say.ts","../src/base/ImpaktElement.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](https://github.com/matthill8286/strata/blob/main/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(--impakt-color-brand-default, <fallback>)`. */\nexport const token = (path: string, fallback: string): CSSResult =>\n unsafeCSS(`var(--impakt-${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 /** Code-like labels: hashes, branches, version lines. */\n fontMono: token('font.family.mono', 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'),\n /** The small line above a heading: the body face, or the code face for a brand that asks. */\n fontEyebrow: token('font.family.eyebrow', 'inherit'),\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\n radiusXs: token('radius.xs', '2px'),\n radiusXl: token('radius.xl', '12px'),\n radius2xl: token('radius.2xl', '16px'),\n\n /** Hairline borders and rings, from the text colour, so they suit any surface. */\n hairline: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 10%, transparent)'),\n rule: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 15%, transparent)'),\n /** A wash of the text colour, for hover and pressed states on quiet controls. */\n wash: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 5%, transparent)'),\n /** The brand at a fifth, for focus halos round fields. */\n brandHalo: unsafeCSS('color-mix(in srgb, var(--impakt-color-brand-default, #1f4ed8) 22%, transparent)'),\n\n shadowXs: token('shadow.xs', '0 1px 2px 0 rgb(0 0 0 / 0.05)'),\n shadowSm: token('shadow.sm', '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)'),\n shadowMd: token('shadow.md', '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'),\n shadowLg: token('shadow.lg', '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'),\n shadowXl: token('shadow.xl', '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)'),\n\n trackingTight: token('font.tracking.tight', '-0.02em'),\n trackingWide: token('font.tracking.wide', '0.06em'),\n} as const;\n\n/**\n * A size on the type scale with its own line height, so text drawn at\n * `type('xl')` has the leading that size reads best at.\n */\nexport const type = (name: string): CSSResult =>\n unsafeCSS(`font-size: var(--impakt-font-size-${name}, 1rem); line-height: var(--impakt-font-leading-${name}, 1.5);`);\n\n/** `space(3)` → `space.3`, `space(0.5)` → `space.0-5`. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${String(step).replace('.', '-')}`, `${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-above='2xl']) { margin-block-start: clamp(${space(14)}, 8vw, ${space(28)}); }\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 :host([space-below='2xl']) { margin-block-end: clamp(${space(14)}, 8vw, ${space(28)}); }\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, unsafeCSS, type CSSResult } 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](https://github.com/matthill8286/strata/blob/main/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\n/**\n * On a touch screen a control is at least 44 by 44 CSS pixels.\n *\n * The 24px floor above is WCAG 2.2's minimum, and it is right for a mouse. A finger\n * is broader, and the design guide sets 44px on a touch screen, which is also\n * 2.5.5's enhanced size. It is applied by pointer rather than by width, because a\n * small laptop window is still driven by a mouse and a large tablet by a finger.\n * Pass the selectors that are the controls, inside the component's shadow root.\n */\nexport const touchTarget = (selector: string): CSSResult =>\n // Under :host, so it outweighs the component's own rule for the same control whatever the order.\n unsafeCSS(`@media (pointer: coarse) { :host :is(${selector}) { min-block-size: 44px; min-inline-size: 44px; } }`);\n\n/**\n * `hide-on`: an element left out on a phone, or on anything wider, so a phone's\n * header is built from the same pieces as a wide one. The width is the one the\n * nav folds at. A component that offers `hideOn` reflects it as `hide-on` and\n * adds this to its styles.\n */\nexport const hideOn = css`\n @media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }\n @media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }\n`;\n","/**\n * The library's own words, in the page's language (ADR 0026).\n *\n * Every word a component shows that a page did not give it, such as \"Skip to\n * content\", \"Next slide\" or \"There is a problem\", goes through `say`. The\n * renderer puts the site's wording in place before it draws a page\n * (`applySiteLanguage` in `@atomic-ui/renderer-core`), translated into the page's\n * language and with any of the site's own rewording. Without it, the English\n * here is shown, which is what every site did before it had languages.\n *\n * The English is the key, with `{name}` for a value put in, so the list of\n * words to translate (`SITE_WORDING` in `@atomic-ui/content-schemas`) can be\n * checked against this library by a test.\n */\nconst WORDING = Symbol.for('strata.wording');\n\ntype Store = { words?: Record<string, string> };\n\nexport function say(english: string, values?: Record<string, string | number>): string {\n const words = ((globalThis as Record<symbol, Store | undefined>)[WORDING])?.words;\n const chosen = words?.[english];\n const text = typeof chosen === 'string' && chosen.trim() ? chosen : english;\n return values ? text.replace(/\\{(\\w+)\\}/g, (whole, name: string) => (name in values ? String(values[name]) : whole)) : text;\n}\n","import { LitElement, css } from 'lit';\nimport { base, reducedMotion } from './styles';\nimport { say } from './say';\n\nlet counter = 0;\n\n/**\n * The base every Impakt 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 ImpaktElement 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 = `impakt-${(counter += 1)}`;\n\n protected id_(part: string): string {\n return `${this.uid}-${part}`;\n }\n\n /** @ignore */\n connectedCallback(): void {\n super.connectedCallback();\n this.sayDefaults();\n }\n\n /**\n * The words a component ships with, in the page's language (ADR 0026).\n *\n * Defaults stay plain English in the constructor, so the component manifest\n * still sees them (a prop with no default is read as required). When the\n * element joins the page, each word it holds is looked up in the site's\n * wording; anything that is not one of Strata's own words, such as a page's\n * own text or a variant name, is left exactly as it is.\n *\n * @ignore\n */\n private sayDefaults(): void {\n const props = (this.constructor as typeof LitElement).elementProperties;\n const self = this as unknown as Record<string, unknown>;\n for (const name of props.keys()) {\n const value = self[name as string];\n if (typeof value !== 'string' || !value) continue;\n const said = say(value);\n if (said !== value) self[name as string] = said;\n }\n }\n}\n"],"mappings":";AAmBA,SAAS,KAAK,iBAAiC;AAGxC,IAAM,QAAQ,CAAC,MAAc,aAClC,UAAU,gBAAgB,KAAK,QAAQ,OAAO,GAAG,CAAC,KAAK,QAAQ,GAAG;AAE7D,IAAM,IAAI;AAAA,EACf,OAAO,MAAM,uBAAuB,SAAS;AAAA,EAC7C,YAAY,MAAM,qBAAqB,SAAS;AAAA,EAChD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,SAAS,MAAM,uBAAuB,SAAS;AAAA,EAE/C,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,cAAc,MAAM,uBAAuB,SAAS;AAAA,EACpD,eAAe,MAAM,wBAAwB,SAAS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A;AAAA;AAAA;AAAA,SAAmB,MAAM,UAAW,WAAW,CAAE;AAAA;AAAA,EATjD;AAAA,SAAO,SAAS,CAAC,MAAM,eAAeC,MAAK;AAAA;AAAA,EAWjC,IAAI,MAAsB;AAClC,WAAO,GAAG,KAAK,GAAG,IAAI,IAAI;AAAA,EAC5B;AAAA;AAAA,EAGA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,YAAY;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaQ,cAAoB;AAC1B,UAAM,QAAS,KAAK,YAAkC;AACtD,UAAM,OAAO;AACb,eAAW,QAAQ,MAAM,KAAK,GAAG;AAC/B,YAAM,QAAQ,KAAK,IAAc;AACjC,UAAI,OAAO,UAAU,YAAY,CAAC,MAAO;AACzC,YAAM,OAAO,IAAI,KAAK;AACtB,UAAI,SAAS,MAAO,MAAK,IAAc,IAAI;AAAA,IAC7C;AAAA,EACF;AACF;","names":["css","unsafeCSS","css","unsafeCSS","css","css"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
ImpaktElement,
|
|
3
3
|
fontSize,
|
|
4
4
|
fontWeight,
|
|
5
5
|
lineHeight,
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
t,
|
|
9
9
|
type,
|
|
10
10
|
visuallyHidden
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YR6T73GY.js";
|
|
12
12
|
|
|
13
13
|
// packages/ui/src/components/layout.ts
|
|
14
14
|
import { html, css, nothing } from "lit";
|
|
15
|
-
var
|
|
15
|
+
var ImpaktStack = class extends ImpaktElement {
|
|
16
16
|
static {
|
|
17
17
|
this.properties = {
|
|
18
18
|
gap: { type: String, reflect: true },
|
|
@@ -34,7 +34,7 @@ var ImpktStack = class extends ImpktElement {
|
|
|
34
34
|
}
|
|
35
35
|
static {
|
|
36
36
|
this.styles = [
|
|
37
|
-
...
|
|
37
|
+
...ImpaktElement.styles,
|
|
38
38
|
spaceAround,
|
|
39
39
|
css`
|
|
40
40
|
:host {
|
|
@@ -64,7 +64,7 @@ var ImpktStack = class extends ImpktElement {
|
|
|
64
64
|
return html`<slot></slot>`;
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var ImpaktCard = class extends ImpaktElement {
|
|
68
68
|
static {
|
|
69
69
|
this.properties = {
|
|
70
70
|
tone: { type: String, reflect: true },
|
|
@@ -92,7 +92,7 @@ var ImpktCard = class extends ImpktElement {
|
|
|
92
92
|
}
|
|
93
93
|
static {
|
|
94
94
|
this.styles = [
|
|
95
|
-
...
|
|
95
|
+
...ImpaktElement.styles,
|
|
96
96
|
spaceAround,
|
|
97
97
|
css`
|
|
98
98
|
:host {
|
|
@@ -106,7 +106,7 @@ var ImpktCard = class extends ImpktElement {
|
|
|
106
106
|
--ratio: 16 / 9;
|
|
107
107
|
}
|
|
108
108
|
:host([tone='subtle']) { background: ${t.surfaceSubtle}; border-color: transparent; box-shadow: none; }
|
|
109
|
-
:host([tone='brand']) { background: ${t.brand}; border-color: transparent; color: ${t.onBrand}; --
|
|
109
|
+
:host([tone='brand']) { background: ${t.brand}; border-color: transparent; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; }
|
|
110
110
|
:host([tone='outline']) { background: transparent; box-shadow: none; border-color: ${t.rule}; }
|
|
111
111
|
:host([raised]) { border-color: transparent; box-shadow: 0 24px 60px rgb(16 19 23 / 12%), 0 2px 6px rgb(16 19 23 / 6%); border-radius: ${t.radius2xl}; }
|
|
112
112
|
:host([tone='plain']) { background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; }
|
|
@@ -129,7 +129,7 @@ var ImpktCard = class extends ImpktElement {
|
|
|
129
129
|
return html`${this.imageSrc ? html`<div class="picture"><img src=${this.imageSrc} alt=${this.imageAlt} part="image" />${this.badge ? html`<span class="tag">${this.badge}</span>` : nothing}</div>` : nothing}<div class="body" part="body"><slot></slot></div>`;
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
var
|
|
132
|
+
var ImpaktHeading = class extends ImpaktElement {
|
|
133
133
|
static {
|
|
134
134
|
this.properties = {
|
|
135
135
|
level: { type: Number, reflect: true },
|
|
@@ -149,7 +149,7 @@ var ImpktHeading = class extends ImpktElement {
|
|
|
149
149
|
}
|
|
150
150
|
static {
|
|
151
151
|
this.styles = [
|
|
152
|
-
...
|
|
152
|
+
...ImpaktElement.styles,
|
|
153
153
|
css`
|
|
154
154
|
:host {
|
|
155
155
|
display: block;
|
|
@@ -179,10 +179,10 @@ var ImpktHeading = class extends ImpktElement {
|
|
|
179
179
|
.eyebrow {
|
|
180
180
|
display: block;
|
|
181
181
|
margin-block-end: ${space(2)};
|
|
182
|
-
color: var(--
|
|
183
|
-
font-family: var(--
|
|
184
|
-
font-size: var(--
|
|
185
|
-
font-weight: var(--
|
|
182
|
+
color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${t.brand}));
|
|
183
|
+
font-family: var(--impakt-font-family-eyebrow, ${t.fontBody});
|
|
184
|
+
font-size: var(--impakt-font-size-eyebrow, ${fontSize("sm")});
|
|
185
|
+
font-weight: var(--impakt-font-weight-eyebrow, ${fontWeight("semibold")});
|
|
186
186
|
letter-spacing: 0.06em;
|
|
187
187
|
text-transform: uppercase;
|
|
188
188
|
}
|
|
@@ -195,7 +195,7 @@ var ImpktHeading = class extends ImpktElement {
|
|
|
195
195
|
</div>`;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
var
|
|
198
|
+
var ImpaktText = class extends ImpaktElement {
|
|
199
199
|
static {
|
|
200
200
|
this.properties = {
|
|
201
201
|
size: { type: String, reflect: true },
|
|
@@ -213,7 +213,7 @@ var ImpktText = class extends ImpktElement {
|
|
|
213
213
|
}
|
|
214
214
|
static {
|
|
215
215
|
this.styles = [
|
|
216
|
-
...
|
|
216
|
+
...ImpaktElement.styles,
|
|
217
217
|
css`
|
|
218
218
|
:host {
|
|
219
219
|
display: block;
|
|
@@ -243,15 +243,15 @@ var ImpktText = class extends ImpktElement {
|
|
|
243
243
|
return html`<p part="text"><slot></slot></p>`;
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
customElements.define("
|
|
247
|
-
customElements.define("
|
|
248
|
-
customElements.define("
|
|
249
|
-
customElements.define("
|
|
246
|
+
customElements.define("impakt-stack", ImpaktStack);
|
|
247
|
+
customElements.define("impakt-card", ImpaktCard);
|
|
248
|
+
customElements.define("impakt-heading", ImpaktHeading);
|
|
249
|
+
customElements.define("impakt-text", ImpaktText);
|
|
250
250
|
|
|
251
251
|
export {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
252
|
+
ImpaktStack,
|
|
253
|
+
ImpaktCard,
|
|
254
|
+
ImpaktHeading,
|
|
255
|
+
ImpaktText
|
|
256
256
|
};
|
|
257
|
-
//# sourceMappingURL=chunk-
|
|
257
|
+
//# sourceMappingURL=chunk-YYYQPKQ7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/layout.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { visuallyHidden as hiddenStyle } from '../base/styles';\nimport { fontSize, fontWeight, lineHeight, space, spaceAround, t, type } 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 ImpaktStack extends ImpaktElement {\n static properties = {\n gap: { type: String, reflect: true },\n align: { type: String, reflect: true },\n direction: { type: String, reflect: true },\n justify: { 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: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** How the items line up across the stack. */\n declare align: 'stretch' | 'start' | 'center' | 'end';\n /** Down the page, or along a row that wraps when it runs out of room, such as a row of buttons. */\n declare direction: 'vertical' | 'horizontal';\n /** Where the items sit along a row. */\n declare justify: 'start' | 'center' | 'end' | 'between';\n /** Space before the stack, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Space after the stack, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.gap = 'md';\n this.align = 'stretch';\n this.direction = 'vertical';\n this.justify = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n :host([gap='none']) { gap: 0; }\n :host([gap='xs']) { gap: ${space(1)}; }\n :host([align='start']) { align-items: flex-start; }\n :host([align='center']) { align-items: center; text-align: center; }\n :host([align='end']) { align-items: flex-end; }\n :host([direction='horizontal']) { flex-direction: row; flex-wrap: wrap; align-items: center; }\n :host([direction='horizontal'][align='start']) { align-items: flex-start; }\n :host([direction='horizontal'][align='end']) { align-items: flex-end; }\n :host([direction='horizontal'][align='center']) { text-align: start; }\n :host([justify='center']) { justify-content: center; }\n :host([justify='end']) { justify-content: flex-end; }\n :host([justify='between']) { justify-content: space-between; }\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 ImpaktCard extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n padding: { type: String, reflect: true },\n imageSrc: { type: String, attribute: 'image-src' },\n imageAlt: { type: String, attribute: 'image-alt' },\n ratio: { type: String, reflect: true },\n badge: { type: String },\n raised: { type: Boolean, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The card's surface. Text on a brand card takes the brand's text colour. */\n declare tone: 'default' | 'subtle' | 'brand' | 'outline' | 'plain';\n /** Space inside the card. */\n declare padding: 'none' | 'sm' | 'md' | 'lg';\n /** A picture across the top of the card. */\n declare imageSrc: string;\n /** What the picture shows. Leave empty only when it is decoration. */\n declare imageAlt: string;\n /** A short label on the picture, such as \"3 left\". */\n declare badge: string;\n /** The picture's shape. */\n declare ratio: '16:9' | '4:3' | '3:2' | '1:1';\n /** Lifted off the page with a soft shadow and no edge, as a form that floats beside its words is. */\n declare raised: boolean;\n /** Space before the card, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Space after the card, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.tone = 'default';\n this.padding = 'lg';\n this.imageSrc = '';\n this.imageAlt = '';\n this.ratio = '16:9';\n this.badge = '';\n this.raised = false;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.hairline};\n border-radius: ${t.radiusXl};\n box-shadow: ${t.shadowSm};\n overflow: hidden;\n --ratio: 16 / 9;\n }\n :host([tone='subtle']) { background: ${t.surfaceSubtle}; border-color: transparent; box-shadow: none; }\n :host([tone='brand']) { background: ${t.brand}; border-color: transparent; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; }\n :host([tone='outline']) { background: transparent; box-shadow: none; border-color: ${t.rule}; }\n :host([raised]) { border-color: transparent; box-shadow: 0 24px 60px rgb(16 19 23 / 12%), 0 2px 6px rgb(16 19 23 / 6%); border-radius: ${t.radius2xl}; }\n :host([tone='plain']) { background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; }\n :host([ratio='4:3']) { --ratio: 4 / 3; }\n :host([ratio='3:2']) { --ratio: 3 / 2; }\n :host([ratio='1:1']) { --ratio: 1 / 1; }\n .body { padding: ${space(6)}; flex: 1; display: flex; flex-direction: column; }\n :host([padding='none']) .body { padding: 0; }\n :host([padding='sm']) .body { padding: ${space(3)}; }\n :host([padding='md']) .body { padding: ${space(4)}; }\n :host([tone='plain']) .body { padding-inline: 0; }\n img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }\n .picture { position: relative; }\n .tag { position: absolute; inset-block-start: ${space(4)}; inset-inline-start: ${space(4)}; padding: ${space(1.5)} ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: 999px; }\n @media (forced-colors: active) { :host { border-color: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`${this.imageSrc ? html`<div class=\"picture\"><img src=${this.imageSrc} alt=${this.imageAlt} part=\"image\" />${this.badge ? html`<span class=\"tag\">${this.badge}</span>` : nothing}</div>` : nothing}<div class=\"body\" part=\"body\"><slot></slot></div>`;\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 ImpaktHeading extends ImpaktElement {\n static properties = {\n level: { type: Number, reflect: true },\n size: { type: String, reflect: true },\n eyebrow: { type: String, reflect: true },\n align: { type: String, reflect: true },\n screenReaderOnly: { type: Boolean, reflect: true, attribute: 'screen-reader-only' },\n };\n\n declare level: 1 | 2 | 3 | 4 | 5 | 6;\n declare size: '5xl' | '4xl' | '3xl' | '2xl' | 'xl' | 'lg' | 'md' | 'sm';\n /** A short label above the heading, such as \"Why Larkfield\". Part of the heading, read before it. */\n declare eyebrow: string;\n declare align: 'start' | 'center';\n /**\n * Read by screen readers and search engines, but not drawn: for a heading\n * whose words are already in a picture, such as a hero drawn as artwork.\n * The page still has its heading; nobody sees it twice. An eyebrow still shows.\n */\n declare screenReaderOnly: boolean;\n\n constructor() {\n super();\n this.level = 2;\n this.size = 'xl';\n this.eyebrow = '';\n this.align = 'start';\n this.screenReaderOnly = false;\n }\n\n static styles = [\n ...ImpaktElement.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='5xl']) { ${type('5xl')} letter-spacing: ${t.trackingTight}; }\n :host([size='4xl']) { ${type('4xl')} letter-spacing: ${t.trackingTight}; }\n :host([size='3xl']) { ${type('3xl')} letter-spacing: ${t.trackingTight}; }\n :host([size='2xl']) { ${type('2xl')} letter-spacing: ${t.trackingTight}; }\n :host([size='xl']) { ${type('xl')} }\n :host([size='lg']) { ${type('lg')} }\n :host([size='md']) { ${type('md')} }\n :host([size='sm']) { ${type('sm')} }\n .h { text-wrap: balance; }\n .h {\n margin: 0;\n font: inherit;\n color: inherit;\n }\n :host([align='center']) { text-align: center; }\n /* Only the words go: an eyebrow over a heading drawn as a picture still shows. */\n :host([screen-reader-only]) .words { ${hiddenStyle} }\n :host([screen-reader-only]:not([eyebrow])) { ${hiddenStyle} }\n .eyebrow {\n display: block;\n margin-block-end: ${space(2)};\n color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${t.brand}));\n font-family: var(--impakt-font-family-eyebrow, ${t.fontBody});\n font-size: var(--impakt-font-size-eyebrow, ${fontSize('sm')});\n font-weight: var(--impakt-font-weight-eyebrow, ${fontWeight('semibold')});\n letter-spacing: 0.06em;\n text-transform: uppercase;\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 ${this.eyebrow ? html`<span class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}<span style=\"position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)\">: </span></span>` : nothing}<span class=\"words\"><slot></slot></span>\n </div>`;\n }\n}\n\n/** A paragraph.\n *\n * @category typography\n * @icon text\n * @slot - The paragraph text.\n */\nexport class ImpaktText extends ImpaktElement {\n static properties = {\n size: { type: String, reflect: true },\n tone: { type: String, reflect: true },\n align: { type: String, reflect: true },\n look: { type: String, reflect: true },\n };\n\n declare size: 'sm' | 'md' | 'lg' | 'xl';\n declare tone: 'default' | 'muted';\n declare align: 'start' | 'center';\n /** `code` sets the words in the brand's monospace face on a faint panel, for a line like \"base: main ← compare: you/idea\". */\n declare look: 'prose' | 'code';\n\n constructor() {\n super();\n this.size = 'md';\n this.tone = 'default';\n this.align = 'start';\n this.look = 'prose';\n }\n\n static styles = [\n ...ImpaktElement.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']) { ${type('sm')} }\n :host([size='md']) { ${type('md')} }\n :host([size='lg']) { ${type('lg')} }\n :host([size='xl']) { ${type('xl')} }\n p { text-wrap: pretty; }\n :host([tone='muted']) { color: ${t.textMuted}; }\n :host([align='center']) { text-align: center; margin-inline: auto; }\n :host([look='code']) { font-family: ${t.fontMono}; ${type('sm')} padding: ${space(2)} ${space(3)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 6%, transparent); max-inline-size: none; }\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('impakt-stack', ImpaktStack);\ncustomElements.define('impakt-card', ImpaktCard);\ncustomElements.define('impakt-heading', ImpaktHeading);\ncustomElements.define('impakt-text', ImpaktText);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-stack': ImpaktStack;\n 'impakt-card': ImpaktCard;\n 'impakt-heading': ImpaktHeading;\n 'impakt-text': ImpaktText;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAmBjD,IAAM,cAAN,cAA0B,cAAc;AAAA,EAC7C;AAAA,SAAO,aAAa;AAAA,MAClB,KAAK,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACnC,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,WAAW,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACzC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,MACpE,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,IACtE;AAAA;AAAA,EAaA,cAAc;AACZ,UAAM;AACN,SAAK,MAAM;AACX,SAAK,QAAQ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+
} from "./chunk-YR6T73GY.js";
|
|
10
10
|
|
|
11
11
|
// packages/ui/src/components/text-input.ts
|
|
12
12
|
import { html, css, nothing } from "lit";
|
|
13
|
-
var
|
|
13
|
+
var ImpaktTextInput = class extends FieldElement {
|
|
14
14
|
static {
|
|
15
15
|
this.properties = {
|
|
16
16
|
...FieldElement.properties,
|
|
@@ -37,16 +37,16 @@ var ImpktTextInput = class extends FieldElement {
|
|
|
37
37
|
fieldWidths,
|
|
38
38
|
css`
|
|
39
39
|
input {
|
|
40
|
-
inline-size: min(100%, var(--
|
|
40
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
41
41
|
min-block-size: 44px;
|
|
42
42
|
padding: ${space(2.5)} ${space(3)};
|
|
43
43
|
font-family: inherit;
|
|
44
44
|
font-size: ${fontSize("md")};
|
|
45
45
|
color: ${t.text};
|
|
46
|
-
background: var(--
|
|
46
|
+
background: var(--impakt-color-field-surface, ${t.surfaceCard});
|
|
47
47
|
border: ${t.borderThin} solid ${t.border};
|
|
48
48
|
border-radius: ${t.radiusLg};
|
|
49
|
-
box-shadow: var(--
|
|
49
|
+
box-shadow: var(--impakt-shadow-field, ${t.shadowXs});
|
|
50
50
|
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
51
51
|
}
|
|
52
52
|
input:hover:not(:disabled) {
|
|
@@ -98,9 +98,9 @@ var ImpktTextInput = class extends FieldElement {
|
|
|
98
98
|
if (changed.has("error")) this.toggleAttribute("invalid", Boolean(this.error));
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
-
customElements.define("
|
|
101
|
+
customElements.define("impakt-text-input", ImpaktTextInput);
|
|
102
102
|
|
|
103
103
|
export {
|
|
104
|
-
|
|
104
|
+
ImpaktTextInput
|
|
105
105
|
};
|
|
106
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-Z45LY6BT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/text-input.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/**\n * A single-line text field.\n *\n * `inputmode` and `autocomplete` are first-class properties rather than\n * afterthoughts. 1.3.5 Identify Input Purpose is a Level AA criterion that\n * autofill satisfies directly, and it is the single cheapest accessibility win\n * in a checkout journey — a form that fills itself is a form that someone with a\n * motor impairment can actually finish.\n\n *\n * @category form\n * @icon field\n */\nexport class ImpaktTextInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n type: { type: String },\n placeholder: { type: String },\n autocomplete: { type: String },\n inputmode: { type: String },\n maxlength: { type: Number },\n };\n\n declare type: 'text' | 'email' | 'tel' | 'number' | 'password' | 'date';\n declare placeholder: string;\n /** A token from the HTML autofill list — `given-name`, `postal-code`, `tel`. */\n declare autocomplete: string;\n declare inputmode: string;\n declare maxlength: number | undefined;\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.type = 'text';\n this.placeholder = '';\n this.autocomplete = '';\n this.inputmode = '';\n this.maxlength = undefined;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n input {\n inline-size: min(100%, var(--impakt-field-width));\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: var(--impakt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n box-shadow: var(--impakt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n input:hover:not(:disabled) {\n border-color: ${t.borderStrong};\n }\n /* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */\n input:focus-visible {\n border-color: ${t.brand};\n box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};\n }\n input::placeholder {\n color: ${t.textPlaceholder};\n }\n input:disabled {\n background: ${t.surfaceInset};\n cursor: not-allowed;\n }\n /* The border thickens as well as reddening. Colour alone would carry the\n error, which 1.4.1 forbids — and the message below says it in words. */\n :host([invalid]) input {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <input\n id=${this.controlId}\n part=\"input\"\n type=${this.type}\n name=${this.name || nothing}\n .value=${this.value}\n placeholder=${this.placeholder || nothing}\n autocomplete=${this.autocomplete || nothing}\n inputmode=${this.inputmode || nothing}\n maxlength=${this.maxlength ?? nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => this.setFormValue((e.target as HTMLInputElement).value)}\n />\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-text-input', ImpaktTextInput);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-text-input': ImpaktTextInput;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAiBjD,IAAM,kBAAN,cAA8B,aAAa;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,cAAc,EAAE,MAAM,OAAO;AAAA,MAC7B,WAAW,EAAE,MAAM,OAAO;AAAA,MAC1B,WAAW,EAAE,MAAM,OAAO;AAAA,IAC5B;AAAA;AAAA,EAYA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK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A,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,qBAAqB,eAAe;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
ImpaktElement,
|
|
3
3
|
spaceAround,
|
|
4
4
|
token
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YR6T73GY.js";
|
|
6
6
|
|
|
7
7
|
// packages/ui/src/components/grid.ts
|
|
8
8
|
import { css, html } from "lit";
|
|
@@ -15,7 +15,7 @@ var WIDTHS = {
|
|
|
15
15
|
"2:1:1": "2fr 1fr 1fr",
|
|
16
16
|
"1:1:2": "1fr 1fr 2fr"
|
|
17
17
|
};
|
|
18
|
-
var
|
|
18
|
+
var ImpaktGrid = class extends ImpaktElement {
|
|
19
19
|
static {
|
|
20
20
|
this.properties = {
|
|
21
21
|
columns: { type: String, reflect: true },
|
|
@@ -38,7 +38,7 @@ var ImpktGrid = class extends ImpktElement {
|
|
|
38
38
|
this.spaceBelow = "none";
|
|
39
39
|
}
|
|
40
40
|
static {
|
|
41
|
-
this.styles = [...
|
|
41
|
+
this.styles = [...ImpaktElement.styles, spaceAround, css`
|
|
42
42
|
:host { display: block; min-inline-size: 0; container-type: inline-size; }
|
|
43
43
|
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${token("layout.gutter.md", "16px")}; align-items: stretch; }
|
|
44
44
|
:host([gap='none']) .columns { gap: 0; }
|
|
@@ -66,9 +66,9 @@ var ImpktGrid = class extends ImpktElement {
|
|
|
66
66
|
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>`;
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
customElements.define("
|
|
69
|
+
customElements.define("impakt-grid", ImpaktGrid);
|
|
70
70
|
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
ImpaktGrid
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-ZQBEFP2O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/grid.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\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 ImpaktGrid extends ImpaktElement {\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' | 'xl';\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' | '2xl';\n /** Space after the grid, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\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 = [...ImpaktElement.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([gap='xl']) .columns { gap: ${token('layout.gutter.xl', '48px')}; }\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('impakt-grid', ImpaktGrid);\ndeclare global { interface HTMLElementTagNameMap { 'impakt-grid': ImpaktGrid } }\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,aAAN,cAAyB,cAAc;AAAA,EAC5C;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,cAAc,QAAQ,aAAa;AAAA;AAAA,uFAE8B,MAAM,oBAAoB,MAAM,CAAC;AAAA;AAAA,wCAEhF,MAAM,oBAAoB,KAAK,CAAC;AAAA,wCAChC,MAAM,oBAAoB,MAAM,CAAC;AAAA,wCACjC,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,eAAe,UAAU;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
iconSvg
|
|
3
|
+
} from "./chunk-5Y3HYRCU.js";
|
|
4
|
+
import {
|
|
5
|
+
ImpaktElement,
|
|
6
|
+
fontWeight,
|
|
7
|
+
space,
|
|
8
|
+
t,
|
|
9
|
+
type
|
|
10
|
+
} from "./chunk-YR6T73GY.js";
|
|
11
|
+
|
|
12
|
+
// packages/ui/src/components/badge.ts
|
|
13
|
+
import { css, html } from "lit";
|
|
14
|
+
var ImpaktBadge = class extends ImpaktElement {
|
|
15
|
+
static {
|
|
16
|
+
this.properties = {
|
|
17
|
+
tone: { type: String, reflect: true },
|
|
18
|
+
icon: { type: String }
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.tone = "neutral";
|
|
24
|
+
this.icon = "none";
|
|
25
|
+
}
|
|
26
|
+
static {
|
|
27
|
+
this.styles = [...ImpaktElement.styles, css`
|
|
28
|
+
:host { display: inline-flex; }
|
|
29
|
+
span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; ${type("sm")} font-weight: ${fontWeight("medium")}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }
|
|
30
|
+
:host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }
|
|
31
|
+
:host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
32
|
+
:host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }
|
|
33
|
+
:host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
|
|
34
|
+
:host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }
|
|
35
|
+
@media (forced-colors: active) { span { border-color: CanvasText; } }
|
|
36
|
+
`];
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html`<span part="badge">${iconSvg(this.icon, "1em")}<slot></slot></span>`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
customElements.define("impakt-badge", ImpaktBadge);
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
ImpaktBadge
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-ZS7RPXCT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/badge.ts"],"sourcesContent":["/**\n * A short label on something, coloured by its tone.\n */\nimport { css, html, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { fontWeight, space, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A short label on something: \"New\", \"Selling fast\", \"2 left\".\n *\n * The tone colours it, and the words carry the meaning, so it reads the same\n * without the colour (1.4.1).\n *\n * @category feedback\n * @icon badge\n * @slot - The badge's words.\n */\nexport class ImpaktBadge extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n icon: { type: String },\n };\n declare tone: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info';\n /** An icon before the words. */\n declare icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n\n constructor() {\n super();\n this.tone = 'neutral';\n this.icon = 'none';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: inline-flex; }\n span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; ${type('sm')} font-weight: ${fontWeight('medium')}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }\n :host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }\n :host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }\n :host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }\n :host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }\n :host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }\n @media (forced-colors: active) { span { border-color: CanvasText; } }\n `];\n\n render(): TemplateResult {\n return html`<span part=\"badge\">${iconSvg(this.icon, '1em')}<slot></slot></span>`;\n }\n}\n\ncustomElements.define('impakt-badge', ImpaktBadge);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-badge': ImpaktBadge;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,KAAK,YAAiC;AAexC,IAAM,cAAN,cAA0B,cAAc;AAAA,EAC7C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,OAAO;AAAA,IACvB;AAAA;AAAA,EAKA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,cAAc,QAAQ;AAAA;AAAA,6DAEiB,MAAM,CAAC,CAAC,cAAc,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,oBAAoB,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC,iBAAiB,WAAW,QAAQ,CAAC,iBAAiB,EAAE,YAAY,YAAY,EAAE,IAAI,iCAAiC,EAAE,QAAQ;AAAA,+CACtO,EAAE,WAAW,YAAY,EAAE,KAAK;AAAA,iDAC9B,EAAE,aAAa,YAAY,EAAE,WAAW;AAAA,iDACxC,EAAE,aAAa,YAAY,EAAE,WAAW;AAAA,gDACzC,EAAE,YAAY,YAAY,EAAE,UAAU;AAAA,8CACxC,EAAE,UAAU,YAAY,EAAE,QAAQ;AAAA;AAAA,GAE7E;AAAA;AAAA,EAED,SAAyB;AACvB,WAAO,0BAA0B,QAAQ,KAAK,MAAM,KAAK,CAAC;AAAA,EAC5D;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TemplateResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { ImpaktElement } from '../base/ImpaktElement';
|
|
3
3
|
export interface AccordionItem {
|
|
4
4
|
id: string;
|
|
5
5
|
heading: string;
|
|
@@ -32,7 +32,7 @@ export interface AccordionItem {
|
|
|
32
32
|
* @category content
|
|
33
33
|
* @icon accordion
|
|
34
34
|
*/
|
|
35
|
-
export declare class
|
|
35
|
+
export declare class ImpaktAccordion extends ImpaktElement {
|
|
36
36
|
static properties: {
|
|
37
37
|
items: {
|
|
38
38
|
type: ArrayConstructor;
|
|
@@ -61,6 +61,6 @@ export declare class ImpktAccordion extends ImpktElement {
|
|
|
61
61
|
}
|
|
62
62
|
declare global {
|
|
63
63
|
interface HTMLElementTagNameMap {
|
|
64
|
-
'
|
|
64
|
+
'impakt-accordion': ImpaktAccordion;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
2
|
+
ImpaktAccordion
|
|
3
|
+
} from "../chunk-RXX4CN5J.js";
|
|
4
|
+
import "../chunk-YR6T73GY.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
ImpaktAccordion
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=accordion.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TemplateResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { ImpaktElement } from '../base/ImpaktElement';
|
|
3
3
|
export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
|
|
4
4
|
/**
|
|
5
5
|
* A notice.
|
|
@@ -19,7 +19,7 @@ export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
|
|
|
19
19
|
* @icon alert
|
|
20
20
|
* @slot - The body of the notice.
|
|
21
21
|
*/
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class ImpaktAlert extends ImpaktElement {
|
|
23
23
|
static properties: {
|
|
24
24
|
tone: {
|
|
25
25
|
type: StringConstructor;
|
|
@@ -44,6 +44,6 @@ export declare class ImpktAlert extends ImpktElement {
|
|
|
44
44
|
}
|
|
45
45
|
declare global {
|
|
46
46
|
interface HTMLElementTagNameMap {
|
|
47
|
-
'
|
|
47
|
+
'impakt-alert': ImpaktAlert;
|
|
48
48
|
}
|
|
49
49
|
}
|
package/dist/components/alert.js
CHANGED