@atomic-ui/ui 0.6.0 → 0.7.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.
Files changed (67) hide show
  1. package/custom-elements.json +2641 -256
  2. package/dist/{chunk-TAZZLOUY.js → chunk-2HWO5TFV.js} +2 -2
  3. package/dist/chunk-AMDTBUUL.js +299 -0
  4. package/dist/chunk-AMDTBUUL.js.map +1 -0
  5. package/dist/{chunk-EJD6LT7E.js → chunk-BNYILASW.js} +36 -4
  6. package/dist/chunk-BNYILASW.js.map +1 -0
  7. package/dist/{chunk-Q54FX3SY.js → chunk-INA53XXW.js} +2 -2
  8. package/dist/chunk-INA53XXW.js.map +1 -0
  9. package/dist/{chunk-SV77SN6P.js → chunk-MLRTPQQO.js} +39 -2
  10. package/dist/chunk-MLRTPQQO.js.map +1 -0
  11. package/dist/{chunk-ZS7RPXCT.js → chunk-NU34ZQFR.js} +4 -2
  12. package/dist/chunk-NU34ZQFR.js.map +1 -0
  13. package/dist/chunk-NUUX2SSN.js +263 -0
  14. package/dist/chunk-NUUX2SSN.js.map +1 -0
  15. package/dist/{chunk-HNZQ7LM4.js → chunk-OE6O3XQB.js} +78 -3
  16. package/dist/chunk-OE6O3XQB.js.map +1 -0
  17. package/dist/{chunk-WWYYNR3Z.js → chunk-RZWRAJCD.js} +7 -2
  18. package/dist/chunk-RZWRAJCD.js.map +1 -0
  19. package/dist/chunk-UF6KCRNT.js +316 -0
  20. package/dist/chunk-UF6KCRNT.js.map +1 -0
  21. package/dist/{chunk-Z45LY6BT.js → chunk-WH43U4IY.js} +37 -2
  22. package/dist/chunk-WH43U4IY.js.map +1 -0
  23. package/dist/{chunk-5Y3HYRCU.js → chunk-WS4AYRSL.js} +20 -2
  24. package/dist/chunk-WS4AYRSL.js.map +1 -0
  25. package/dist/{chunk-PANH23MF.js → chunk-XZQH2M5I.js} +2 -2
  26. package/dist/components/app-ui.d.ts +6 -1
  27. package/dist/components/app-ui.js +2 -2
  28. package/dist/components/badge.d.ts +7 -2
  29. package/dist/components/badge.js +2 -2
  30. package/dist/components/blocks.d.ts +27 -1
  31. package/dist/components/blocks.js +3 -1
  32. package/dist/components/button.d.ts +24 -3
  33. package/dist/components/button.js +2 -2
  34. package/dist/components/icon.d.ts +19 -1
  35. package/dist/components/icon.js +1 -1
  36. package/dist/components/link.d.ts +1 -1
  37. package/dist/components/link.js +2 -2
  38. package/dist/components/navigation.js +2 -2
  39. package/dist/components/progress.d.ts +11 -0
  40. package/dist/components/progress.js +1 -1
  41. package/dist/components/rows.d.ts +196 -0
  42. package/dist/components/rows.js +16 -0
  43. package/dist/components/rows.js.map +1 -0
  44. package/dist/components/shell.d.ts +166 -0
  45. package/dist/components/shell.js +17 -0
  46. package/dist/components/shell.js.map +1 -0
  47. package/dist/components/switch.d.ts +147 -0
  48. package/dist/components/switch.js +11 -0
  49. package/dist/components/switch.js.map +1 -0
  50. package/dist/components/table.js +2 -2
  51. package/dist/components/text-input.d.ts +14 -1
  52. package/dist/components/text-input.js +2 -1
  53. package/dist/index.d.ts +3 -0
  54. package/dist/index.js +43 -15
  55. package/dist/standalone/atomic-ui.js +929 -285
  56. package/dist/standalone/atomic-ui.js.map +4 -4
  57. package/package.json +2 -2
  58. package/dist/chunk-5Y3HYRCU.js.map +0 -1
  59. package/dist/chunk-EJD6LT7E.js.map +0 -1
  60. package/dist/chunk-HNZQ7LM4.js.map +0 -1
  61. package/dist/chunk-Q54FX3SY.js.map +0 -1
  62. package/dist/chunk-SV77SN6P.js.map +0 -1
  63. package/dist/chunk-WWYYNR3Z.js.map +0 -1
  64. package/dist/chunk-Z45LY6BT.js.map +0 -1
  65. package/dist/chunk-ZS7RPXCT.js.map +0 -1
  66. /package/dist/{chunk-TAZZLOUY.js.map → chunk-2HWO5TFV.js.map} +0 -0
  67. /package/dist/{chunk-PANH23MF.js.map → chunk-XZQH2M5I.js.map} +0 -0
@@ -0,0 +1,263 @@
1
+ import {
2
+ pageLocale
3
+ } from "./chunk-3IGNZTJU.js";
4
+ import {
5
+ iconSvg
6
+ } from "./chunk-WS4AYRSL.js";
7
+ import {
8
+ ImpaktElement,
9
+ focusRing,
10
+ fontSize,
11
+ fontWeight,
12
+ space,
13
+ t,
14
+ targetSize,
15
+ token,
16
+ touchTarget,
17
+ visuallyHidden
18
+ } from "./chunk-YR6T73GY.js";
19
+
20
+ // packages/ui/src/components/rows.ts
21
+ import { html, css, nothing } from "lit";
22
+ var LIGHT = token("font.weight.light", "300");
23
+ var ImpaktStatTile = class extends ImpaktElement {
24
+ static {
25
+ this.properties = {
26
+ label: { type: String },
27
+ value: { type: String },
28
+ caption: { type: String },
29
+ href: { type: String },
30
+ tone: { type: String, reflect: true },
31
+ size: { type: String, reflect: true }
32
+ };
33
+ }
34
+ constructor() {
35
+ super();
36
+ this.label = "";
37
+ this.value = "";
38
+ this.caption = "";
39
+ this.href = "";
40
+ this.tone = "plain";
41
+ this.size = "md";
42
+ }
43
+ static {
44
+ this.styles = [...ImpaktElement.styles, focusRing, css`
45
+ :host { display: block; }
46
+ .tile {
47
+ box-sizing: border-box;
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: ${space(1)};
51
+ block-size: 100%;
52
+ min-block-size: 84px;
53
+ padding: ${space(3)} ${space(4)};
54
+ border-radius: ${t.radiusLg};
55
+ background: ${t.surfaceInset};
56
+ color: ${t.text};
57
+ text-decoration: none;
58
+ }
59
+ a.tile:hover { background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 5%); }
60
+ .label { font-size: 11px; font-weight: ${fontWeight("medium")}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }
61
+ .value { margin-block-start: auto; font-size: 34px; line-height: 1.1; font-weight: ${LIGHT}; font-variant-numeric: tabular-nums; }
62
+ .caption { font-size: ${fontSize("sm")}; color: ${t.textMuted}; }
63
+ :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; border-radius: ${t.radiusXl}; }
64
+ :host([size='lg']) .label { font-size: ${fontSize("sm")}; letter-spacing: normal; text-transform: none; }
65
+ :host([size='lg']) .value { font-size: 64px; line-height: 1; }
66
+ :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; }
67
+ :host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }
68
+ :host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }
69
+ @media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }
70
+ `];
71
+ }
72
+ render() {
73
+ const inner = html`
74
+ <span class="label" part="label">${this.label}</span>
75
+ <span class="value" part="value">${this.value}</span>
76
+ ${this.caption ? html`<span class="caption" part="caption">${this.caption}</span>` : nothing}
77
+ `;
78
+ return this.href ? html`<a class="tile" href=${this.href} part="tile">${inner}</a>` : html`<div class="tile" part="tile">${inner}</div>`;
79
+ }
80
+ };
81
+ var ImpaktDateTile = class extends ImpaktElement {
82
+ static {
83
+ this.properties = {
84
+ date: { type: String },
85
+ tone: { type: String, reflect: true }
86
+ };
87
+ }
88
+ constructor() {
89
+ super();
90
+ this.date = "";
91
+ this.tone = "brand";
92
+ }
93
+ static {
94
+ this.styles = [...ImpaktElement.styles, css`
95
+ :host { display: inline-block; flex: none; }
96
+ time {
97
+ box-sizing: border-box;
98
+ display: flex;
99
+ flex-direction: column;
100
+ align-items: center;
101
+ justify-content: center;
102
+ inline-size: 48px;
103
+ block-size: 52px;
104
+ border-radius: ${t.radiusLg};
105
+ background: ${t.brand};
106
+ color: ${t.onBrand};
107
+ line-height: 1;
108
+ }
109
+ :host([tone='plain']) time { background: ${t.surfaceInset}; color: ${t.text}; }
110
+ .month { font-size: 10px; font-weight: ${fontWeight("medium")}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }
111
+ .day { margin-block-start: ${space(1)}; font-size: 20px; font-weight: ${fontWeight("medium")}; font-variant-numeric: tabular-nums; }
112
+ .sr-only { ${visuallyHidden} }
113
+ @media (forced-colors: active) { time { border: 1px solid CanvasText; } }
114
+ `];
115
+ }
116
+ parts() {
117
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(this.date ?? "");
118
+ if (!match) return null;
119
+ const when = new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), 12));
120
+ if (Number.isNaN(when.getTime())) return null;
121
+ const locale = pageLocale(this);
122
+ const say = (options) => new Intl.DateTimeFormat(locale, { ...options, timeZone: "UTC" }).format(when);
123
+ return { month: say({ month: "short" }).replace(".", ""), day: say({ day: "numeric" }), full: say({ day: "numeric", month: "long", year: "numeric" }) };
124
+ }
125
+ render() {
126
+ const parts = this.parts();
127
+ if (!parts) return html`${nothing}`;
128
+ return html`<time datetime=${this.date} part="tile">
129
+ <span class="month" aria-hidden="true">${parts.month}</span>
130
+ <span class="day" aria-hidden="true">${parts.day}</span>
131
+ <span class="sr-only">${parts.full}</span>
132
+ </time>`;
133
+ }
134
+ };
135
+ var ImpaktRow = class extends ImpaktElement {
136
+ constructor() {
137
+ super();
138
+ this.filled = { start: false, end: false };
139
+ this.heading = "";
140
+ this.meta = "";
141
+ this.href = "";
142
+ this.divided = false;
143
+ this.muted = false;
144
+ }
145
+ static {
146
+ this.properties = {
147
+ heading: { type: String },
148
+ meta: { type: String },
149
+ href: { type: String },
150
+ divided: { type: Boolean, reflect: true },
151
+ muted: { type: Boolean, reflect: true }
152
+ };
153
+ }
154
+ static {
155
+ this.styles = [...ImpaktElement.styles, focusRing, css`
156
+ :host { display: block; }
157
+ :host([divided]) .row { border-block-start: ${t.borderThin} solid ${t.hairline}; }
158
+ .row { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block: ${space(3)}; }
159
+ .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(0.5)}; }
160
+ .title { font-size: ${fontSize("md")}; font-weight: ${fontWeight("medium")}; color: ${t.text}; }
161
+ :host([muted]) .title { color: ${t.textMuted}; font-weight: ${fontWeight("regular")}; }
162
+ .meta { font-size: ${fontSize("sm")}; color: ${t.textMuted}; }
163
+ a { color: inherit; text-decoration: none; }
164
+ /* The link is stretched over the row, so the row is one target. */
165
+ a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }
166
+ a:focus-visible { outline: none; }
167
+ a:focus-visible::after { box-shadow: ${t.focusShadow}; }
168
+ .row:has(a):hover .title { text-decoration: underline; text-underline-offset: 0.2em; }
169
+ .start, .end { flex: none; display: flex; align-items: center; gap: ${space(2)}; }
170
+ .start.empty, .end.empty { display: none; }
171
+ /* Controls at the end stay pressable above the stretched link. */
172
+ .end { position: relative; z-index: 1; }
173
+ .chevron { flex: none; color: ${t.textMuted}; }
174
+ `];
175
+ }
176
+ onSlot(event) {
177
+ const slot = event.target;
178
+ const name = slot.name;
179
+ this.filled = { ...this.filled, [name]: slot.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? "").trim() !== "") };
180
+ this.requestUpdate();
181
+ }
182
+ render() {
183
+ const title = this.href ? html`<a class="title" href=${this.href} part="link">${this.heading}</a>` : html`<span class="title" part="title">${this.heading}</span>`;
184
+ return html`<div class="row" part="row">
185
+ <div class="start ${this.filled.start ? "" : "empty"}"><slot name="start" @slotchange=${this.onSlot}></slot></div>
186
+ <div class="text">${title}${this.meta ? html`<span class="meta" part="meta">${this.meta}</span>` : nothing}</div>
187
+ <div class="end ${this.filled.end ? "" : "empty"}"><slot name="end" @slotchange=${this.onSlot}></slot></div>
188
+ ${this.href ? html`<span class="chevron" aria-hidden="true">${iconSvg("chevron-right", "20px")}</span>` : nothing}
189
+ </div>`;
190
+ }
191
+ };
192
+ var ImpaktFilterChip = class extends ImpaktElement {
193
+ static {
194
+ this.properties = {
195
+ label: { type: String },
196
+ count: { type: Number },
197
+ countLabel: { type: String, attribute: "count-label" },
198
+ pressed: { type: Boolean, reflect: true },
199
+ disabled: { type: Boolean, reflect: true }
200
+ };
201
+ }
202
+ constructor() {
203
+ super();
204
+ this.label = "";
205
+ this.count = void 0;
206
+ this.countLabel = "";
207
+ this.pressed = false;
208
+ this.disabled = false;
209
+ }
210
+ static {
211
+ this.styles = [...ImpaktElement.styles, focusRing, touchTarget("button"), css`
212
+ :host { display: inline-block; }
213
+ button {
214
+ ${targetSize}
215
+ display: inline-flex;
216
+ align-items: center;
217
+ gap: ${space(2)};
218
+ min-block-size: 36px;
219
+ padding: 0 ${space(3.5)};
220
+ font: inherit;
221
+ font-size: ${fontSize("sm")};
222
+ font-weight: ${fontWeight("medium")};
223
+ color: ${t.text};
224
+ background: ${t.surfaceCard};
225
+ border: ${t.borderThin} solid ${t.hairline};
226
+ border-radius: 999px;
227
+ cursor: pointer;
228
+ white-space: nowrap;
229
+ }
230
+ button:hover:not(:disabled) { background: ${t.surfaceInset}; }
231
+ button[aria-pressed='true'] { background: ${t.text}; color: ${t.surfaceCard}; border-color: ${t.text}; }
232
+ button:disabled { cursor: not-allowed; opacity: 0.5; }
233
+ .count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }
234
+ button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }
235
+ .sr-only { ${visuallyHidden} }
236
+ @media (forced-colors: active) { button[aria-pressed='true'] { border: 2px solid Highlight; } }
237
+ `];
238
+ }
239
+ toggle() {
240
+ if (this.disabled) return;
241
+ this.pressed = !this.pressed;
242
+ this.dispatchEvent(new CustomEvent("impakt-change", { detail: { pressed: this.pressed }, bubbles: true, composed: true }));
243
+ }
244
+ render() {
245
+ const hasCount = typeof this.count === "number" && !Number.isNaN(this.count);
246
+ return html`<button type="button" part="button" aria-pressed=${this.pressed ? "true" : "false"} ?disabled=${this.disabled} @click=${this.toggle}>
247
+ <span>${this.label}</span>
248
+ ${hasCount ? this.countLabel ? html`<span class="count" aria-hidden="true">${this.count}</span><span class="sr-only">${this.countLabel}</span>` : html`<span class="count">${this.count}</span>` : nothing}
249
+ </button>`;
250
+ }
251
+ };
252
+ customElements.define("impakt-stat-tile", ImpaktStatTile);
253
+ customElements.define("impakt-date-tile", ImpaktDateTile);
254
+ customElements.define("impakt-row", ImpaktRow);
255
+ customElements.define("impakt-filter-chip", ImpaktFilterChip);
256
+
257
+ export {
258
+ ImpaktStatTile,
259
+ ImpaktDateTile,
260
+ ImpaktRow,
261
+ ImpaktFilterChip
262
+ };
263
+ //# sourceMappingURL=chunk-NUUX2SSN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/rows.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport { pageLocale } from '../base/locale';\nimport { iconSvg } from './icon';\n\n/** The light weight large numbers are set in, 300 when the theme does not say. */\nconst LIGHT = token('font.weight.light', '300');\n\n/**\n * A count with its name: \"UK 4\", \"Active import jobs 12\". A dashboard shows a\n * row of them.\n *\n * **The name comes before the number in the reading order.** A screen reader\n * says \"UK, 4\", which makes sense heard on its own; \"4, UK\" does not. With\n * `href` the whole tile is one link, named by the label, the value and the\n * caption together.\n *\n * @category content\n * @icon badge\n */\nexport class ImpaktStatTile extends ImpaktElement {\n static properties = {\n label: { type: String },\n value: { type: String },\n caption: { type: String },\n href: { type: String },\n tone: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** What is counted, such as \"UK\" or \"Active import jobs\". */\n declare label: string;\n /** The count or figure, such as \"4\". */\n declare value: string;\n /** A line under the figure, such as \"3 arriving in the next two weeks\". */\n declare caption: string;\n /** Where the tile goes when it is pressed, such as the list it counts. */\n declare href: string;\n /** `plain` is a quiet tile on a card; `brand` is the one figure a screen leads with. */\n declare tone: 'plain' | 'brand';\n /** `lg` sets the figure larger, for the lead figure. */\n declare size: 'md' | 'lg';\n\n constructor() {\n super();\n this.label = '';\n this.value = '';\n this.caption = '';\n this.href = '';\n this.tone = 'plain';\n this.size = 'md';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; }\n .tile {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: ${space(1)};\n block-size: 100%;\n min-block-size: 84px;\n padding: ${space(3)} ${space(4)};\n border-radius: ${t.radiusLg};\n background: ${t.surfaceInset};\n color: ${t.text};\n text-decoration: none;\n }\n a.tile:hover { background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 5%); }\n .label { font-size: 11px; font-weight: ${fontWeight('medium')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }\n .value { margin-block-start: auto; font-size: 34px; line-height: 1.1; font-weight: ${LIGHT}; font-variant-numeric: tabular-nums; }\n .caption { font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; border-radius: ${t.radiusXl}; }\n :host([size='lg']) .label { font-size: ${fontSize('sm')}; letter-spacing: normal; text-transform: none; }\n :host([size='lg']) .value { font-size: 64px; line-height: 1; }\n :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; }\n :host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }\n :host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }\n @media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }\n `];\n\n render(): TemplateResult {\n const inner = html`\n <span class=\"label\" part=\"label\">${this.label}</span>\n <span class=\"value\" part=\"value\">${this.value}</span>\n ${this.caption ? html`<span class=\"caption\" part=\"caption\">${this.caption}</span>` : nothing}\n `;\n return this.href\n ? html`<a class=\"tile\" href=${this.href} part=\"tile\">${inner}</a>`\n : html`<div class=\"tile\" part=\"tile\">${inner}</div>`;\n }\n}\n\n/**\n * A date as a small block of month and day: \"DEC 2\". It sits at the start of a\n * row, beside what happens on that date.\n *\n * **The full date is what a screen reader hears.** The short month and day are\n * hidden from it, and the date is read in full in the page's language, such as\n * \"2 December 2026\", because \"DEC 2\" said aloud is ambiguous.\n *\n * @category content\n * @icon calendar\n */\nexport class ImpaktDateTile extends ImpaktElement {\n static properties = {\n date: { type: String },\n tone: { type: String, reflect: true },\n };\n /** The date, as YYYY-MM-DD. */\n declare date: string;\n /** `brand` is filled with the brand colour; `plain` is a quiet tile. */\n declare tone: 'brand' | 'plain';\n\n constructor() {\n super();\n this.date = '';\n this.tone = 'brand';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: inline-block; flex: none; }\n time {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: 48px;\n block-size: 52px;\n border-radius: ${t.radiusLg};\n background: ${t.brand};\n color: ${t.onBrand};\n line-height: 1;\n }\n :host([tone='plain']) time { background: ${t.surfaceInset}; color: ${t.text}; }\n .month { font-size: 10px; font-weight: ${fontWeight('medium')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .day { margin-block-start: ${space(1)}; font-size: 20px; font-weight: ${fontWeight('medium')}; font-variant-numeric: tabular-nums; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { time { border: 1px solid CanvasText; } }\n `];\n\n private parts(): { month: string; day: string; full: string } | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(this.date ?? '');\n if (!match) return null;\n // Noon UTC, so no time zone moves the date to the day before or after.\n const when = new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), 12));\n if (Number.isNaN(when.getTime())) return null;\n const locale = pageLocale(this);\n const say = (options: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { ...options, timeZone: 'UTC' }).format(when);\n return { month: say({ month: 'short' }).replace('.', ''), day: say({ day: 'numeric' }), full: say({ day: 'numeric', month: 'long', year: 'numeric' }) };\n }\n\n render(): TemplateResult {\n const parts = this.parts();\n if (!parts) return html`${nothing}`;\n return html`<time datetime=${this.date} part=\"tile\">\n <span class=\"month\" aria-hidden=\"true\">${parts.month}</span>\n <span class=\"day\" aria-hidden=\"true\">${parts.day}</span>\n <span class=\"sr-only\">${parts.full}</span>\n </time>`;\n }\n}\n\n/**\n * One line in a list: a title, a line of detail under it, and room at the\n * start and the end. It is the task with its tick, the job that needs\n * attention, the delivery with its date, the setting with its arrow.\n *\n * **With `href` the whole row is one target, without nesting controls in a\n * link.** The title is the link, and it is stretched over the row, so the row\n * can be pressed anywhere. Anything in the `end` slot, such as a button, sits\n * above the stretched link and stays its own control, because a button inside\n * a link is two controls a screen reader cannot tell apart (4.1.2).\n *\n * A chevron is drawn at the end of a row that is a link, as the sign that it\n * goes somewhere. Put rows in an element with `role=\"list\"` and give each\n * `role=\"listitem\"` when they are a list, so a screen reader says how many\n * there are.\n *\n * @category content\n * @icon list\n * @slot start - Before the title: a dot, a date tile, a checkbox.\n * @slot end - After the title: a badge, a button.\n */\nexport class ImpaktRow extends ImpaktElement {\n static properties = {\n heading: { type: String },\n meta: { type: String },\n href: { type: String },\n divided: { type: Boolean, reflect: true },\n muted: { type: Boolean, reflect: true },\n };\n /** The row's title. */\n declare heading: string;\n /** The line of detail under the title, such as \"CY-2026-00421 · Due 20 Nov 2026\". */\n declare meta: string;\n /** Where the row goes when it is pressed. */\n declare href: string;\n /** Draw a hairline above the row, for rows stacked on a card. */\n declare divided: boolean;\n /** Set the title quieter, for something finished, such as a done task. */\n declare muted: boolean;\n\n constructor() {\n super();\n this.heading = '';\n this.meta = '';\n this.href = '';\n this.divided = false;\n this.muted = false;\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; }\n :host([divided]) .row { border-block-start: ${t.borderThin} solid ${t.hairline}; }\n .row { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block: ${space(3)}; }\n .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(0.5)}; }\n .title { font-size: ${fontSize('md')}; font-weight: ${fontWeight('medium')}; color: ${t.text}; }\n :host([muted]) .title { color: ${t.textMuted}; font-weight: ${fontWeight('regular')}; }\n .meta { font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n a { color: inherit; text-decoration: none; }\n /* The link is stretched over the row, so the row is one target. */\n a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }\n a:focus-visible { outline: none; }\n a:focus-visible::after { box-shadow: ${t.focusShadow}; }\n .row:has(a):hover .title { text-decoration: underline; text-underline-offset: 0.2em; }\n .start, .end { flex: none; display: flex; align-items: center; gap: ${space(2)}; }\n .start.empty, .end.empty { display: none; }\n /* Controls at the end stay pressable above the stretched link. */\n .end { position: relative; z-index: 1; }\n .chevron { flex: none; color: ${t.textMuted}; }\n `];\n\n private filled = { start: false, end: false };\n\n private onSlot(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const name = slot.name as 'start' | 'end';\n this.filled = { ...this.filled, [name]: slot.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim() !== '') };\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const title = this.href\n ? html`<a class=\"title\" href=${this.href} part=\"link\">${this.heading}</a>`\n : html`<span class=\"title\" part=\"title\">${this.heading}</span>`;\n return html`<div class=\"row\" part=\"row\">\n <div class=\"start ${this.filled.start ? '' : 'empty'}\"><slot name=\"start\" @slotchange=${this.onSlot}></slot></div>\n <div class=\"text\">${title}${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}</div>\n <div class=\"end ${this.filled.end ? '' : 'empty'}\"><slot name=\"end\" @slotchange=${this.onSlot}></slot></div>\n ${this.href ? html`<span class=\"chevron\" aria-hidden=\"true\">${iconSvg('chevron-right', '20px')}</span>` : nothing}\n </div>`;\n }\n}\n\n/**\n * A pressable filter: \"UK 4\", \"Completed 27\". A row of them narrows a list.\n *\n * **It is a toggle button.** It carries `aria-pressed`, so a screen reader says\n * whether the filter is on, and it is filled when it is on, so that does not\n * rest on colour alone (1.4.1). When only one filter in a row can be on, the\n * app turns the others off when it hears `impakt-change`.\n *\n * The count is read with the label. Set `count-label` when the number needs its\n * noun to make sense aloud, such as \"4 jobs\".\n *\n * @category action\n * @icon badge\n * @fires {CustomEvent<{ pressed: boolean }>} impakt-change - When the filter is turned on or off.\n */\nexport class ImpaktFilterChip extends ImpaktElement {\n static properties = {\n label: { type: String },\n count: { type: Number },\n countLabel: { type: String, attribute: 'count-label' },\n pressed: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n };\n declare label: string;\n /** How many things the filter would show. Left out when not set. */\n declare count: number | undefined;\n /** The count in words for a screen reader, such as \"4 jobs\". The number alone when empty. */\n declare countLabel: string;\n declare pressed: boolean;\n declare disabled: boolean;\n\n constructor() {\n super();\n this.label = '';\n this.count = undefined;\n this.countLabel = '';\n this.pressed = false;\n this.disabled = false;\n }\n\n static styles = [...ImpaktElement.styles, focusRing, touchTarget('button'), css`\n :host { display: inline-block; }\n button {\n ${targetSize}\n display: inline-flex;\n align-items: center;\n gap: ${space(2)};\n min-block-size: 36px;\n padding: 0 ${space(3.5)};\n font: inherit;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('medium')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.hairline};\n border-radius: 999px;\n cursor: pointer;\n white-space: nowrap;\n }\n button:hover:not(:disabled) { background: ${t.surfaceInset}; }\n button[aria-pressed='true'] { background: ${t.text}; color: ${t.surfaceCard}; border-color: ${t.text}; }\n button:disabled { cursor: not-allowed; opacity: 0.5; }\n .count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }\n button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { button[aria-pressed='true'] { border: 2px solid Highlight; } }\n `];\n\n private toggle(): void {\n if (this.disabled) return;\n this.pressed = !this.pressed;\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: { pressed: this.pressed }, bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const hasCount = typeof this.count === 'number' && !Number.isNaN(this.count);\n return html`<button type=\"button\" part=\"button\" aria-pressed=${this.pressed ? 'true' : 'false'} ?disabled=${this.disabled} @click=${this.toggle}>\n <span>${this.label}</span>\n ${hasCount\n ? this.countLabel\n ? html`<span class=\"count\" aria-hidden=\"true\">${this.count}</span><span class=\"sr-only\">${this.countLabel}</span>`\n : html`<span class=\"count\">${this.count}</span>`\n : nothing}\n </button>`;\n }\n}\n\ncustomElements.define('impakt-stat-tile', ImpaktStatTile);\ncustomElements.define('impakt-date-tile', ImpaktDateTile);\ncustomElements.define('impakt-row', ImpaktRow);\ncustomElements.define('impakt-filter-chip', ImpaktFilterChip);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-stat-tile': ImpaktStatTile;\n 'impakt-date-tile': ImpaktDateTile;\n 'impakt-row': ImpaktRow;\n 'impakt-filter-chip': ImpaktFilterChip;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAQxD,IAAM,QAAQ,MAAM,qBAAqB,KAAK;AAcvC,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,cAAc,QAAQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAM1C,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,iBAGJ,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,uBACd,EAAE,QAAQ;AAAA,oBACb,E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5B;AAAA;AAAA,EAEO,SAAe;AACrB,QAAI,KAAK,SAAU;AACnB,SAAK,UAAU,CAAC,KAAK;AACrB,SAAK,cAAc,IAAI,YAAY,iBAAiB,EAAE,QAAQ,EAAE,SAAS,KAAK,QAAQ,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EAC3H;AAAA,EAEA,SAAyB;AACvB,UAAM,WAAW,OAAO,KAAK,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK,KAAK;AAC3E,WAAO,wDAAwD,KAAK,UAAU,SAAS,OAAO,cAAc,KAAK,QAAQ,WAAW,KAAK,MAAM;AAAA,cACrI,KAAK,KAAK;AAAA,QAChB,WACE,KAAK,aACH,8CAA8C,KAAK,KAAK,gCAAgC,KAAK,UAAU,YACvG,2BAA2B,KAAK,KAAK,YACvC,OAAO;AAAA;AAAA,EAEf;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  iconSvg
3
- } from "./chunk-5Y3HYRCU.js";
3
+ } from "./chunk-WS4AYRSL.js";
4
4
  import {
5
5
  ImpaktElement,
6
6
  focusRing,
@@ -31,6 +31,8 @@ var ImpaktButton = class extends ImpaktElement {
31
31
  this.iconBefore = "none";
32
32
  this.iconAfter = "none";
33
33
  this.href = "";
34
+ this.icon = "none";
35
+ this.label = "";
34
36
  try {
35
37
  this.internals = this.attachInternals();
36
38
  } catch {
@@ -53,7 +55,9 @@ var ImpaktButton = class extends ImpaktElement {
53
55
  size: { type: String, reflect: true },
54
56
  iconBefore: { type: String, attribute: "icon-before" },
55
57
  iconAfter: { type: String, attribute: "icon-after" },
56
- href: { type: String }
58
+ href: { type: String },
59
+ icon: { type: String },
60
+ label: { type: String }
57
61
  };
58
62
  }
59
63
  static {
@@ -141,6 +145,54 @@ var ImpaktButton = class extends ImpaktElement {
141
145
  background: ${t.wash};
142
146
  }
143
147
 
148
+ /* Dark: the text colour as a fill, the strong second choice on a light page. */
149
+ .dark {
150
+ background: ${t.text};
151
+ color: ${t.surfaceCard};
152
+ }
153
+ .dark:hover:not([aria-disabled='true']) {
154
+ background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 14%);
155
+ }
156
+ .dark:active:not([aria-disabled='true']) {
157
+ background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 24%);
158
+ }
159
+
160
+ /* Subtle: a quiet fill, for an action that sits beside the main one. */
161
+ .subtle {
162
+ background: ${t.surfaceInset};
163
+ color: ${t.text};
164
+ }
165
+ .subtle:hover:not([aria-disabled='true']) {
166
+ background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 6%);
167
+ }
168
+ .subtle:active:not([aria-disabled='true']) {
169
+ background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 12%);
170
+ }
171
+
172
+ /* Danger: the danger text colour as a fill, so white words on it keep 4.5:1. */
173
+ .danger {
174
+ background: ${t.dangerText};
175
+ color: ${t.surfaceCard};
176
+ }
177
+ .danger:hover:not([aria-disabled='true']) {
178
+ background: color-mix(in srgb, ${t.dangerText}, ${t.text} 15%);
179
+ }
180
+ .danger:active:not([aria-disabled='true']) {
181
+ background: color-mix(in srgb, ${t.dangerText}, ${t.text} 28%);
182
+ }
183
+
184
+ /* Icon only: a round button as tall as it is wide. */
185
+ .icon-only {
186
+ inline-size: 40px;
187
+ min-inline-size: 40px;
188
+ block-size: 40px;
189
+ min-block-size: 40px;
190
+ padding: 0;
191
+ border-radius: 999px;
192
+ }
193
+ :host([size='sm']) .icon-only { inline-size: 32px; min-inline-size: 32px; block-size: 32px; min-block-size: 32px; padding: 0; }
194
+ :host([size='lg']) .icon-only { inline-size: 48px; min-inline-size: 48px; block-size: 48px; min-block-size: 48px; padding: 0; }
195
+
144
196
  .sr-only {
145
197
  ${visuallyHidden}
146
198
  }
@@ -166,6 +218,29 @@ var ImpaktButton = class extends ImpaktElement {
166
218
  if (this.type === "reset") this.internals?.form?.reset();
167
219
  }
168
220
  render() {
221
+ const iconOnly = Boolean(this.icon && this.icon !== "none" && this.label);
222
+ const cls = iconOnly ? `${this.variant} icon-only` : this.variant;
223
+ if (iconOnly) {
224
+ const drawn = iconSvg(this.icon);
225
+ if (this.href && !this.disabled) {
226
+ return html`<a class=${cls} href=${this.href} part="button" aria-label=${this.label}>${drawn}</a>`;
227
+ }
228
+ return html`
229
+ <button
230
+ class=${cls}
231
+ type="button"
232
+ part="button"
233
+ aria-label=${this.label}
234
+ ?disabled=${this.disabled}
235
+ aria-disabled=${this.busy ? "true" : nothing}
236
+ aria-busy=${this.busy ? "true" : nothing}
237
+ @click=${this.onClick}
238
+ >
239
+ ${drawn}
240
+ ${this.busy ? html`<span class="sr-only">${this.busyLabel}</span>` : nothing}
241
+ </button>
242
+ `;
243
+ }
169
244
  const words = html`${iconSvg(this.iconBefore)}<slot></slot>${this.iconAfter && this.iconAfter !== "none" ? html`<span class="after" aria-hidden="true">${iconSvg(this.iconAfter)}</span>` : nothing}`;
170
245
  if (this.href && !this.disabled) {
171
246
  return html`<a class=${this.variant} href=${this.href} part="button">${words}</a>`;
@@ -191,4 +266,4 @@ customElements.define("impakt-button", ImpaktButton);
191
266
  export {
192
267
  ImpaktButton
193
268
  };
194
- //# sourceMappingURL=chunk-HNZQ7LM4.js.map
269
+ //# sourceMappingURL=chunk-OE6O3XQB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/button.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A button.\n *\n * Two decisions carry the accessibility weight here.\n *\n * **A busy button is not a disabled button.** While an action is in flight the\n * control keeps its place in the tab order and reports `aria-disabled`, rather\n * than taking the native `disabled` attribute. A natively disabled element is\n * removed from the tab order, so a keyboard user who had just activated it\n * loses their focus position to the top of the document — at precisely the\n * moment something is happening that they need to be told about. Activation is\n * blocked in the handler instead.\n *\n * **It renders a real `<button>`.** A `<div role=\"button\">` needs Enter and\n * Space handling, a tabindex, and a disabled story, and it will still not\n * submit a form. The native element already has all of that, correctly, in\n * every browser and every assistive technology.\n\n *\n * **A button that goes somewhere is a link.** With `href` set it renders an\n * `<a>` styled as a button, so it opens in a new tab, shows its address and is\n * announced as a link, which is what it is.\n *\n * **An icon-only button still has a name.** With `icon` set and no words, the\n * button shows the icon alone and `label` becomes its accessible name, so a\n * screen reader says \"Back\" rather than \"button\". Without a `label` an\n * icon-only button is not rendered as icon-only, because it would be nameless\n * (4.1.2).\n *\n * @category action\n * @icon button\n * @slot - The button label.\n * @fires click - When the button is pressed. Not while it is busy or disabled.\n */\nexport class ImpaktButton extends ImpaktElement {\n static formAssociated = true;\n\n static properties = {\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n variant: { type: String, reflect: true },\n type: { type: String },\n disabled: { type: Boolean, reflect: true },\n busy: { type: Boolean, reflect: true },\n busyLabel: { type: String, attribute: 'busy-label' },\n full: { type: Boolean, reflect: true },\n fullOnPhone: { type: Boolean, attribute: 'full-on-phone', reflect: true },\n size: { type: String, reflect: true },\n iconBefore: { type: String, attribute: 'icon-before' },\n iconAfter: { type: String, attribute: 'icon-after' },\n href: { type: String },\n icon: { type: String },\n label: { type: String },\n };\n\n /** Leave it out on a phone, where a header has no room for it. */\n declare hideOn: 'never' | 'phone';\n /**\n * How much the button asks for attention. `dark` is the strong second\n * choice on a light page, `subtle` a quiet filled one, and `danger` an\n * action that removes or cancels something.\n */\n declare variant: 'primary' | 'secondary' | 'ghost' | 'dark' | 'subtle' | 'danger';\n declare type: 'button' | 'submit' | 'reset';\n declare disabled: boolean;\n declare busy: boolean;\n /** Announced when the button becomes busy. Says what is happening, not that something is. */\n declare busyLabel: string;\n declare full: boolean;\n /** As wide as its space on a phone only, such as a form's send button. */\n declare fullOnPhone: boolean;\n declare size: 'sm' | 'md' | 'lg';\n /** An icon before the words, such as phone or calendar. */\n declare iconBefore: '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' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n /** An icon after the words, such as arrow-right. */\n declare iconAfter: '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' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n /** Where the button goes, when it opens a page rather than doing something here. */\n declare href: string;\n /** Draws the button as this icon alone, a round button. Needs `label`. */\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' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n /** The accessible name of an icon-only button, such as \"Back\" or \"More actions\". */\n declare label: string;\n\n private internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.hideOn = 'never';\n this.variant = 'primary';\n this.type = 'button';\n this.disabled = false;\n this.busy = false;\n this.busyLabel = 'Working';\n this.full = false;\n this.fullOnPhone = false;\n this.size = 'md';\n this.iconBefore = 'none';\n this.iconAfter = 'none';\n this.href = '';\n this.icon = 'none';\n this.label = '';\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('button, a'),\n css`\n @media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }\n :host {\n display: inline-block;\n }\n :host([full]) {\n display: block;\n }\n @media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }\n button, a {\n ${targetSize}\n box-sizing: border-box;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${space(2)};\n inline-size: 100%;\n min-block-size: 40px;\n padding: ${space(2)} ${space(4)};\n font-family: inherit;\n ${type('sm')}\n font-weight: ${fontWeight('semibold')};\n border-radius: ${t.radiusLg};\n border: ${t.borderThin} solid transparent;\n cursor: pointer;\n transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n :host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${space(1)} ${space(3)}; ${type('sm')} gap: ${space(1.5)}; }\n :host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${space(3)} ${space(6)}; ${type('md')} }\n .icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }\n /* The cursor is the only thing that changes while busy. Moving or\n recolouring a control the moment it is pressed is how a user loses it. */\n button[aria-disabled='true'] {\n cursor: progress;\n }\n :host([disabled]) button {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Solid: the brand, with a hairline highlight along the top edge. */\n .primary {\n background: ${t.brand};\n color: ${t.onBrand};\n box-shadow: ${t.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);\n }\n .primary:hover:not([aria-disabled='true']) {\n background: var(--impakt-color-action-hover, ${t.brandHover});\n color: var(--impakt-color-action-on-hover, ${t.onBrand});\n }\n /* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */\n .after { transition: transform 160ms ease-out; }\n :is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impakt-motion-button-turn, 0deg)); }\n @media (prefers-reduced-motion: reduce) { .after { transition: none; } }\n .primary:active:not([aria-disabled='true']) {\n background: ${t.brandActive};\n }\n\n /* Outline: the card, a hairline border and the text colour, for the second choice. */\n .secondary {\n background: ${t.surfaceCard};\n color: ${t.text};\n border-color: ${t.rule};\n box-shadow: ${t.shadowXs};\n }\n .secondary:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%);\n border-color: color-mix(in srgb, ${t.text} 25%, transparent);\n }\n\n /* Plain: words only until it is pointed at. */\n .ghost {\n background: transparent;\n color: ${t.link};\n }\n .ghost:hover:not([aria-disabled='true']) {\n background: ${t.wash};\n }\n\n /* Dark: the text colour as a fill, the strong second choice on a light page. */\n .dark {\n background: ${t.text};\n color: ${t.surfaceCard};\n }\n .dark:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 14%);\n }\n .dark:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 24%);\n }\n\n /* Subtle: a quiet fill, for an action that sits beside the main one. */\n .subtle {\n background: ${t.surfaceInset};\n color: ${t.text};\n }\n .subtle:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 6%);\n }\n .subtle:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 12%);\n }\n\n /* Danger: the danger text colour as a fill, so white words on it keep 4.5:1. */\n .danger {\n background: ${t.dangerText};\n color: ${t.surfaceCard};\n }\n .danger:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.dangerText}, ${t.text} 15%);\n }\n .danger:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.dangerText}, ${t.text} 28%);\n }\n\n /* Icon only: a round button as tall as it is wide. */\n .icon-only {\n inline-size: 40px;\n min-inline-size: 40px;\n block-size: 40px;\n min-block-size: 40px;\n padding: 0;\n border-radius: 999px;\n }\n :host([size='sm']) .icon-only { inline-size: 32px; min-inline-size: 32px; block-size: 32px; min-block-size: 32px; padding: 0; }\n :host([size='lg']) .icon-only { inline-size: 48px; min-inline-size: 48px; block-size: 48px; min-block-size: 48px; padding: 0; }\n\n .sr-only {\n ${visuallyHidden}\n }\n\n /* Windows High Contrast Mode drops background and border colours, so a\n button styled only by background becomes invisible. A forced-colors\n border puts the boundary back. */\n @media (forced-colors: active) {\n button, a {\n border-color: ButtonBorder;\n }\n }\n `,\n ];\n\n private onClick(event: MouseEvent): void {\n if (this.disabled || this.busy) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n // A shadow-rooted button does not submit the outer form by itself, because\n // the click never reaches it. `requestSubmit` rather than `submit` so that\n // native validation and the submit event both still run.\n if (this.type === 'submit') this.internals?.form?.requestSubmit();\n if (this.type === 'reset') this.internals?.form?.reset();\n }\n\n render(): TemplateResult {\n const iconOnly = Boolean(this.icon && this.icon !== 'none' && this.label);\n const cls = iconOnly ? `${this.variant} icon-only` : this.variant;\n if (iconOnly) {\n const drawn = iconSvg(this.icon);\n if (this.href && !this.disabled) {\n return html`<a class=${cls} href=${this.href} part=\"button\" aria-label=${this.label}>${drawn}</a>`;\n }\n return html`\n <button\n class=${cls}\n type=\"button\"\n part=\"button\"\n aria-label=${this.label}\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n ${drawn}\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n const words = html`${iconSvg(this.iconBefore)}<slot></slot>${this.iconAfter && this.iconAfter !== 'none' ? html`<span class=\"after\" aria-hidden=\"true\">${iconSvg(this.iconAfter)}</span>` : nothing}`;\n if (this.href && !this.disabled) {\n return html`<a class=${this.variant} href=${this.href} part=\"button\">${words}</a>`;\n }\n return html`\n <button\n class=${this.variant}\n type=\"button\"\n part=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n ${words}\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n}\n\ncustomElements.define('impakt-button', ImpaktButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-button': ImpaktButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAwCjD,IAAM,eAAN,cAA2B,cAAc;AAAA,EAkD9C,cAAc;AACZ,UAAM;AAHR,SAAQ,YAAqC;AAI3C,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EAtEA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,SAAO,aAAa;AAAA,MAClB,QAAQ,EAAE,MAAM,QAA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,SAAS,KAAK,IAAI,kBAAkB,KAAK;AAAA,IAC9E;AACA,WAAO;AAAA;AAAA,gBAEK,KAAK,OAAO;AAAA;AAAA;AAAA,oBAGR,KAAK,QAAQ;AAAA,wBACT,KAAK,OAAO,SAAS,OAAO;AAAA,oBAChC,KAAK,OAAO,SAAS,OAAO;AAAA,iBAC/B,KAAK,OAAO;AAAA;AAAA,UAEnB,KAAK;AAAA,UACL,KAAK,OAAO,6BAA6B,KAAK,SAAS,YAAY,OAAO;AAAA;AAAA;AAAA,EAGlF;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-2YRTFWW2.js";
8
8
  import {
9
9
  iconSvg
10
- } from "./chunk-5Y3HYRCU.js";
10
+ } from "./chunk-WS4AYRSL.js";
11
11
  import {
12
12
  FieldElement
13
13
  } from "./chunk-5ZQVL3V2.js";
@@ -49,6 +49,11 @@ var ImpaktDrawer = class extends ImpaktElement {
49
49
  dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }
50
50
  dialog[open] { display: flex; }
51
51
  :host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
52
+ :host([side='bottom']) dialog { inline-size: 100vw; block-size: fit-content; max-block-size: 90dvh; margin: auto 0 0 0; padding-block-end: env(safe-area-inset-bottom); border-radius: 28px 28px 0 0; animation-name: from-bottom; }
53
+ :host([side='bottom']) .head { box-shadow: none; }
54
+ :host([side='bottom']) .foot { box-shadow: none; }
55
+ :host([side='bottom']) .foot ::slotted(*) { flex: 1; }
56
+ @keyframes from-bottom { from { transform: translateY(100%); } }
52
57
  dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }
53
58
  @keyframes from-right { from { transform: translateX(100%); } }
54
59
  @keyframes from-left { from { transform: translateX(-100%); } }
@@ -590,4 +595,4 @@ export {
590
595
  ImpaktEmptyState,
591
596
  ImpaktSlotPicker
592
597
  };
593
- //# sourceMappingURL=chunk-WWYYNR3Z.js.map
598
+ //# sourceMappingURL=chunk-RZWRAJCD.js.map