@atomic-ui/ui 0.3.0 → 0.6.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 (213) hide show
  1. package/README.md +31 -33
  2. package/custom-elements.json +5986 -15880
  3. package/dist/base/FieldElement.d.ts +4 -4
  4. package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
  5. package/dist/base/styles.d.ts +7 -0
  6. package/dist/base/tokens.d.ts +1 -1
  7. package/dist/base/tone.d.ts +20 -0
  8. package/dist/{chunk-3RE4H2XO.js → chunk-3EF4T242.js} +7 -7
  9. package/dist/chunk-3EF4T242.js.map +1 -0
  10. package/dist/chunk-4ZQTXTPA.js +76 -0
  11. package/dist/chunk-4ZQTXTPA.js.map +1 -0
  12. package/dist/{chunk-NKMVICB5.js → chunk-5Y3HYRCU.js} +7 -7
  13. package/dist/chunk-5Y3HYRCU.js.map +1 -0
  14. package/dist/{chunk-ZOTAAYO5.js → chunk-5ZQVL3V2.js} +19 -12
  15. package/dist/chunk-5ZQVL3V2.js.map +1 -0
  16. package/dist/{chunk-4OYHT4BN.js → chunk-A7YBFS4H.js} +15 -15
  17. package/dist/chunk-A7YBFS4H.js.map +1 -0
  18. package/dist/{chunk-DAH7RLW3.js → chunk-DE3INTHZ.js} +6 -6
  19. package/dist/chunk-DE3INTHZ.js.map +1 -0
  20. package/dist/{chunk-HXINWP3V.js → chunk-EJD6LT7E.js} +20 -83
  21. package/dist/chunk-EJD6LT7E.js.map +1 -0
  22. package/dist/{chunk-P6GDMZK4.js → chunk-EJSX4WCD.js} +9 -9
  23. package/dist/chunk-EJSX4WCD.js.map +1 -0
  24. package/dist/{chunk-46BYUQ5A.js → chunk-FWR6SEIA.js} +33 -33
  25. package/dist/chunk-FWR6SEIA.js.map +1 -0
  26. package/dist/{chunk-CUUBAETM.js → chunk-GJPHQLLN.js} +8 -8
  27. package/dist/chunk-GJPHQLLN.js.map +1 -0
  28. package/dist/{chunk-R7FKGFW6.js → chunk-HNBG2POR.js} +7 -7
  29. package/dist/chunk-HNBG2POR.js.map +1 -0
  30. package/dist/{chunk-DKZ425AM.js → chunk-HNZQ7LM4.js} +11 -11
  31. package/dist/chunk-HNZQ7LM4.js.map +1 -0
  32. package/dist/{chunk-55DK75QF.js → chunk-I54DOEZB.js} +6 -6
  33. package/dist/chunk-I54DOEZB.js.map +1 -0
  34. package/dist/{chunk-WGPB3QQU.js → chunk-KFAGXPIK.js} +10 -10
  35. package/dist/chunk-KFAGXPIK.js.map +1 -0
  36. package/dist/{chunk-J2FACXYI.js → chunk-PANH23MF.js} +12 -12
  37. package/dist/chunk-PANH23MF.js.map +1 -0
  38. package/dist/{chunk-KKJEEKL2.js → chunk-PYVUQNFQ.js} +8 -8
  39. package/dist/chunk-PYVUQNFQ.js.map +1 -0
  40. package/dist/{chunk-RWWRTURA.js → chunk-Q54FX3SY.js} +8 -8
  41. package/dist/chunk-Q54FX3SY.js.map +1 -0
  42. package/dist/{chunk-AUVIOU5G.js → chunk-QBORJTS4.js} +36 -36
  43. package/dist/chunk-QBORJTS4.js.map +1 -0
  44. package/dist/{chunk-5QSTXIPG.js → chunk-RXX4CN5J.js} +7 -7
  45. package/dist/chunk-RXX4CN5J.js.map +1 -0
  46. package/dist/{chunk-XPCU4KUY.js → chunk-SV77SN6P.js} +7 -7
  47. package/dist/chunk-SV77SN6P.js.map +1 -0
  48. package/dist/{chunk-FVCM4WHD.js → chunk-TAZZLOUY.js} +10 -10
  49. package/dist/chunk-TAZZLOUY.js.map +1 -0
  50. package/dist/{chunk-KMCGX76Y.js → chunk-TRZO5CHU.js} +7 -7
  51. package/dist/chunk-TRZO5CHU.js.map +1 -0
  52. package/dist/{chunk-F4YQWKK2.js → chunk-UPOTBKKK.js} +7 -7
  53. package/dist/chunk-UPOTBKKK.js.map +1 -0
  54. package/dist/{chunk-APJ5JGRW.js → chunk-WP5WJ4V5.js} +6 -6
  55. package/dist/chunk-WP5WJ4V5.js.map +1 -0
  56. package/dist/{chunk-TCXKZDMR.js → chunk-WS5AUJ35.js} +7 -7
  57. package/dist/chunk-WS5AUJ35.js.map +1 -0
  58. package/dist/{chunk-7P4Z4CLK.js → chunk-WWYYNR3Z.js} +50 -49
  59. package/dist/chunk-WWYYNR3Z.js.map +1 -0
  60. package/dist/{chunk-RYBY35QE.js → chunk-XU2XODVH.js} +6 -6
  61. package/dist/chunk-XU2XODVH.js.map +1 -0
  62. package/dist/{chunk-3KO55PZK.js → chunk-YR6T73GY.js} +18 -11
  63. package/dist/chunk-YR6T73GY.js.map +1 -0
  64. package/dist/{chunk-IOBSIAHB.js → chunk-YYYQPKQ7.js} +24 -24
  65. package/dist/chunk-YYYQPKQ7.js.map +1 -0
  66. package/dist/{chunk-PO6FCAIS.js → chunk-Z45LY6BT.js} +9 -9
  67. package/dist/chunk-Z45LY6BT.js.map +1 -0
  68. package/dist/{chunk-DJEZW7AC.js → chunk-ZQBEFP2O.js} +7 -7
  69. package/dist/chunk-ZQBEFP2O.js.map +1 -0
  70. package/dist/chunk-ZS7RPXCT.js +47 -0
  71. package/dist/chunk-ZS7RPXCT.js.map +1 -0
  72. package/dist/components/accordion.d.ts +3 -3
  73. package/dist/components/accordion.js +4 -4
  74. package/dist/components/alert.d.ts +3 -3
  75. package/dist/components/alert.js +4 -4
  76. package/dist/components/app-ui.d.ts +25 -25
  77. package/dist/components/app-ui.js +21 -21
  78. package/dist/components/badge.d.ts +37 -0
  79. package/dist/components/badge.js +9 -0
  80. package/dist/components/blocks.d.ts +10 -73
  81. package/dist/components/blocks.js +10 -13
  82. package/dist/components/button.d.ts +3 -3
  83. package/dist/components/button.js +5 -5
  84. package/dist/components/checkbox-group.d.ts +2 -2
  85. package/dist/components/checkbox-group.js +5 -5
  86. package/dist/components/checkbox.d.ts +2 -2
  87. package/dist/components/checkbox.js +5 -5
  88. package/dist/components/chip.d.ts +58 -0
  89. package/dist/components/chip.js +8 -0
  90. package/dist/components/date-input.d.ts +2 -2
  91. package/dist/components/date-input.js +5 -5
  92. package/dist/components/dialog.d.ts +4 -4
  93. package/dist/components/dialog.js +4 -4
  94. package/dist/components/fieldset.d.ts +3 -3
  95. package/dist/components/fieldset.js +4 -4
  96. package/dist/components/grid.d.ts +3 -3
  97. package/dist/components/grid.js +4 -4
  98. package/dist/components/help.d.ts +3 -3
  99. package/dist/components/help.js +4 -4
  100. package/dist/components/icon.d.ts +3 -3
  101. package/dist/components/icon.js +4 -4
  102. package/dist/components/journey.d.ts +18 -18
  103. package/dist/components/journey.js +15 -15
  104. package/dist/components/layout.d.ts +9 -9
  105. package/dist/components/layout.js +10 -10
  106. package/dist/components/link.d.ts +3 -3
  107. package/dist/components/link.js +5 -5
  108. package/dist/components/list.d.ts +3 -3
  109. package/dist/components/list.js +4 -4
  110. package/dist/components/media.d.ts +8 -8
  111. package/dist/components/media.js +8 -8
  112. package/dist/components/navigation.d.ts +5 -5
  113. package/dist/components/navigation.js +7 -7
  114. package/dist/components/page.d.ts +5 -5
  115. package/dist/components/page.js +6 -6
  116. package/dist/components/price.d.ts +3 -3
  117. package/dist/components/price.js +4 -4
  118. package/dist/components/progress.d.ts +3 -3
  119. package/dist/components/progress.js +4 -4
  120. package/dist/components/radio-group.d.ts +2 -2
  121. package/dist/components/radio-group.js +5 -5
  122. package/dist/components/select.d.ts +2 -2
  123. package/dist/components/select.js +5 -5
  124. package/dist/components/summary-list.d.ts +3 -3
  125. package/dist/components/summary-list.js +4 -4
  126. package/dist/components/table.d.ts +6 -6
  127. package/dist/components/table.js +5 -5
  128. package/dist/components/text-input.d.ts +2 -2
  129. package/dist/components/text-input.js +5 -5
  130. package/dist/components/textarea.d.ts +2 -2
  131. package/dist/components/textarea.js +5 -5
  132. package/dist/index.d.ts +47 -40
  133. package/dist/index.js +206 -270
  134. package/dist/standalone/atomic-ui.js +796 -2002
  135. package/dist/standalone/atomic-ui.js.map +4 -4
  136. package/dist/standalone/index.html +51 -52
  137. package/package.json +4 -4
  138. package/specimen/index.html +51 -52
  139. package/dist/chunk-37PA72FC.js +0 -725
  140. package/dist/chunk-37PA72FC.js.map +0 -1
  141. package/dist/chunk-3KO55PZK.js.map +0 -1
  142. package/dist/chunk-3RE4H2XO.js.map +0 -1
  143. package/dist/chunk-46BYUQ5A.js.map +0 -1
  144. package/dist/chunk-4OYHT4BN.js.map +0 -1
  145. package/dist/chunk-55DK75QF.js.map +0 -1
  146. package/dist/chunk-5QSTXIPG.js.map +0 -1
  147. package/dist/chunk-7P4Z4CLK.js.map +0 -1
  148. package/dist/chunk-APJ5JGRW.js.map +0 -1
  149. package/dist/chunk-AUVIOU5G.js.map +0 -1
  150. package/dist/chunk-CUUBAETM.js.map +0 -1
  151. package/dist/chunk-DAH7RLW3.js.map +0 -1
  152. package/dist/chunk-DJEZW7AC.js.map +0 -1
  153. package/dist/chunk-DKZ425AM.js.map +0 -1
  154. package/dist/chunk-F4YQWKK2.js.map +0 -1
  155. package/dist/chunk-FVCM4WHD.js.map +0 -1
  156. package/dist/chunk-GBRML4RF.js +0 -264
  157. package/dist/chunk-GBRML4RF.js.map +0 -1
  158. package/dist/chunk-HXINWP3V.js.map +0 -1
  159. package/dist/chunk-IOBSIAHB.js.map +0 -1
  160. package/dist/chunk-IZOTGWWI.js +0 -361
  161. package/dist/chunk-IZOTGWWI.js.map +0 -1
  162. package/dist/chunk-J2FACXYI.js.map +0 -1
  163. package/dist/chunk-KKJEEKL2.js.map +0 -1
  164. package/dist/chunk-KMCGX76Y.js.map +0 -1
  165. package/dist/chunk-NKMVICB5.js.map +0 -1
  166. package/dist/chunk-OFLMG6RN.js +0 -428
  167. package/dist/chunk-OFLMG6RN.js.map +0 -1
  168. package/dist/chunk-P6GDMZK4.js.map +0 -1
  169. package/dist/chunk-PO6FCAIS.js.map +0 -1
  170. package/dist/chunk-PWLZFGS3.js +0 -494
  171. package/dist/chunk-PWLZFGS3.js.map +0 -1
  172. package/dist/chunk-QJIB36DM.js +0 -249
  173. package/dist/chunk-QJIB36DM.js.map +0 -1
  174. package/dist/chunk-R7FKGFW6.js.map +0 -1
  175. package/dist/chunk-RWWRTURA.js.map +0 -1
  176. package/dist/chunk-RYBY35QE.js.map +0 -1
  177. package/dist/chunk-S7F5VKWU.js +0 -453
  178. package/dist/chunk-S7F5VKWU.js.map +0 -1
  179. package/dist/chunk-T5W3FDSF.js +0 -396
  180. package/dist/chunk-T5W3FDSF.js.map +0 -1
  181. package/dist/chunk-TCXKZDMR.js.map +0 -1
  182. package/dist/chunk-WGPB3QQU.js.map +0 -1
  183. package/dist/chunk-XPCU4KUY.js.map +0 -1
  184. package/dist/chunk-YRYZUYY7.js +0 -236
  185. package/dist/chunk-YRYZUYY7.js.map +0 -1
  186. package/dist/chunk-ZOTAAYO5.js.map +0 -1
  187. package/dist/components/changelog.d.ts +0 -386
  188. package/dist/components/changelog.js +0 -25
  189. package/dist/components/estimator.d.ts +0 -246
  190. package/dist/components/estimator.js +0 -16
  191. package/dist/components/marketing.d.ts +0 -370
  192. package/dist/components/marketing.js +0 -21
  193. package/dist/components/marketing.js.map +0 -1
  194. package/dist/components/organisms.d.ts +0 -559
  195. package/dist/components/organisms.js +0 -25
  196. package/dist/components/organisms.js.map +0 -1
  197. package/dist/components/property.d.ts +0 -389
  198. package/dist/components/property.js +0 -20
  199. package/dist/components/property.js.map +0 -1
  200. package/dist/components/scene.d.ts +0 -138
  201. package/dist/components/scene.js +0 -8
  202. package/dist/components/scene.js.map +0 -1
  203. package/dist/components/scrubber.d.ts +0 -86
  204. package/dist/components/scrubber.js +0 -8
  205. package/dist/components/scrubber.js.map +0 -1
  206. package/dist/components/selling.d.ts +0 -409
  207. package/dist/components/selling.js +0 -25
  208. package/dist/components/selling.js.map +0 -1
  209. package/dist/components/site.d.ts +0 -283
  210. package/dist/components/site.js +0 -20
  211. package/dist/components/site.js.map +0 -1
  212. /package/dist/components/{changelog.js.map → badge.js.map} +0 -0
  213. /package/dist/components/{estimator.js.map → chip.js.map} +0 -0
@@ -1,249 +0,0 @@
1
- import {
2
- toneOf
3
- } from "./chunk-PWLZFGS3.js";
4
- import {
5
- ImpktElement,
6
- focusRing,
7
- fontSize,
8
- fontWeight,
9
- space,
10
- t,
11
- type
12
- } from "./chunk-3KO55PZK.js";
13
-
14
- // packages/ui/src/components/site.ts
15
- import { css, html, nothing } from "lit";
16
- var STRIPE = [0, 1, 2, 3, 4];
17
- var MONO = t.fontMono;
18
- var hideOn = css`
19
- @media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
20
- @media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
21
- `;
22
- var ImpktSiteHeader = class extends ImpktElement {
23
- static {
24
- this.properties = {
25
- brand: { type: String },
26
- logoSrc: { type: String, attribute: "logo-src" },
27
- logoAlt: { type: String, attribute: "logo-alt" },
28
- home: { type: String },
29
- badge: { type: String },
30
- meta: { type: String },
31
- links: { type: Array },
32
- label: { type: String },
33
- menuText: { type: String, attribute: "menu-text" },
34
- status: { type: String },
35
- statusMeta: { type: String, attribute: "status-meta" },
36
- statusTone: { type: String, attribute: "status-tone" },
37
- actionText: { type: String, attribute: "action-text" },
38
- actionHref: { type: String, attribute: "action-href" }
39
- };
40
- }
41
- constructor() {
42
- super();
43
- this.brand = "";
44
- this.logoSrc = "";
45
- this.logoAlt = "";
46
- this.home = "/";
47
- this.badge = "";
48
- this.meta = "";
49
- this.links = [];
50
- this.label = "Main";
51
- this.menuText = "Menu";
52
- this.status = "";
53
- this.statusMeta = "";
54
- this.statusTone = "success";
55
- this.actionText = "";
56
- this.actionHref = "";
57
- }
58
- static {
59
- this.styles = [...ImpktElement.styles, focusRing, css`
60
- :host { display: block; container-type: inline-size; }
61
- .bar { display: flex; align-items: center; gap: ${space(6)}; }
62
- .start { display: flex; align-items: center; gap: ${space(3)}; flex: none; }
63
- .middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
64
- .middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
65
- slot { display: contents; }
66
- .brand { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight("semibold")}; ${type("2xl")} letter-spacing: -0.02em; line-height: 1; }
67
- .brand img { display: block; block-size: 32px; inline-size: auto; }
68
- .chip { display: inline-flex; align-items: center; gap: ${space(1)}; padding: 2px ${space(2)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${MONO}; font-size: ${fontSize("xs")}; }
69
- .chip svg { inline-size: 12px; block-size: 12px; }
70
- .meta { font-family: ${MONO}; font-size: ${fontSize("xs")}; opacity: 0.55; }
71
- .middle impkt-nav { flex: 1 1 8rem; }
72
- .end { display: flex; align-items: center; gap: ${space(3)}; flex: none; }
73
- .end:empty, .start:empty { display: none; }
74
- .status { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border: ${t.borderThin} solid ${t.border}; border-radius: 999px; background: ${t.surfaceCard}; font-family: ${MONO}; font-size: ${fontSize("xs")}; white-space: nowrap; }
75
- .status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
76
- .status .hash { opacity: 0.55; }
77
- @container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${space(3)}; } }
78
- `];
79
- }
80
- act() {
81
- this.dispatchEvent(new CustomEvent("impkt-action", { bubbles: true, composed: true }));
82
- }
83
- render() {
84
- const wordmark = this.logoSrc ? html`<img src=${this.logoSrc} alt=${this.logoAlt || this.brand} />` : html`${this.brand}`;
85
- return html`<div class="bar" part="bar">
86
- <div class="start"><slot name="start">
87
- ${this.brand || this.logoSrc ? html`<a class="brand" href=${this.home || "/"} part="brand">${wordmark}</a>` : nothing}
88
- ${this.badge ? html`<span class="chip" part="badge"><svg viewBox="0 0 14 14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="3.5" cy="3" r="1.5"/><circle cx="3.5" cy="11" r="1.5"/><circle cx="10.5" cy="4.5" r="1.5"/><path d="M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4"/></svg>${this.badge}</span>` : nothing}
89
- ${this.meta ? html`<span class="meta" part="meta">${this.meta}</span>` : nothing}
90
- </slot></div>
91
- <div class="middle"><slot name="middle">${(this.links ?? []).length ? html`<impkt-nav align="center" size="sm" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impkt-nav>` : nothing}</slot></div>
92
- <div class="end"><slot name="end">
93
- ${this.status ? html`<span class="status" part="status" style=${`--tone:${toneOf(this.statusTone, 0)}`}><span class="dot" aria-hidden="true"></span>${this.status}${this.statusMeta ? html` <span class="hash">${this.statusMeta}</span>` : nothing}</span>` : nothing}
94
- ${this.actionText ? html`<impkt-button variant="primary" icon-after="arrow-right" href=${this.actionHref || nothing} @click=${this.act}>${this.actionText}</impkt-button>` : nothing}
95
- </slot></div>
96
- </div>`;
97
- }
98
- };
99
- var ImpktWordmark = class extends ImpktElement {
100
- static {
101
- this.properties = {
102
- text: { type: String },
103
- src: { type: String },
104
- alt: { type: String },
105
- href: { type: String },
106
- size: { type: String, reflect: true },
107
- hideOn: { type: String, reflect: true, attribute: "hide-on" }
108
- };
109
- }
110
- constructor() {
111
- super();
112
- this.text = "";
113
- this.src = "";
114
- this.alt = "";
115
- this.href = "/";
116
- this.size = "md";
117
- this.hideOn = "never";
118
- }
119
- static {
120
- this.styles = [...ImpktElement.styles, focusRing, hideOn, css`
121
- :host { display: inline-flex; align-items: center; flex: none; }
122
- a { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight("semibold")}; letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }
123
- :host([size='sm']) a { ${type("xl")} } :host([size='md']) a { ${type("2xl")} } :host([size='lg']) a { ${type("3xl")} }
124
- img { display: block; block-size: 32px; inline-size: auto; }
125
- @media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${type("xl")} } }
126
- `];
127
- }
128
- render() {
129
- return html`<a href=${this.href || "/"} part="link">${this.src ? html`<img src=${this.src} alt=${this.alt || this.text || this.textContent?.trim() || ""} />` : html`<slot>${this.text}</slot>`}</a>`;
130
- }
131
- };
132
- var ImpktChip = class extends ImpktElement {
133
- static {
134
- this.properties = {
135
- label: { type: String },
136
- meta: { type: String },
137
- icon: { type: String, reflect: true },
138
- tone: { type: String },
139
- look: { type: String, reflect: true },
140
- hideOn: { type: String, reflect: true, attribute: "hide-on" }
141
- };
142
- }
143
- constructor() {
144
- super();
145
- this.label = "";
146
- this.meta = "";
147
- this.icon = "none";
148
- this.tone = "success";
149
- this.look = "filled";
150
- this.hideOn = "never";
151
- }
152
- static {
153
- this.styles = [...ImpktElement.styles, hideOn, css`
154
- :host { display: inline-flex; flex: none; }
155
- span.chip { display: inline-flex; align-items: center; gap: ${space(1.5)}; padding: 3px ${space(2.5)}; border-radius: 999px; font-family: ${MONO}; font-size: ${fontSize("xs")}; line-height: 1.2; white-space: nowrap; }
156
- :host([look='filled']) span.chip { border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }
157
- :host([look='outlined']) span.chip { border: ${t.borderThin} solid ${t.border}; background: ${t.surfaceCard}; text-transform: uppercase; letter-spacing: 0.04em; }
158
- :host([look='plain']) span.chip { padding: 0; }
159
- .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
160
- svg { inline-size: 12px; block-size: 12px; }
161
- .meta { opacity: 0.55; text-transform: none; }
162
- :host([look='plain']) .label { opacity: 0.55; }
163
- `];
164
- }
165
- render() {
166
- const icon = this.icon === "dot" ? html`<span class="dot" aria-hidden="true"></span>` : this.icon === "branch" ? html`<svg viewBox="0 0 14 14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="3.5" cy="3" r="1.5"/><circle cx="3.5" cy="11" r="1.5"/><circle cx="10.5" cy="4.5" r="1.5"/><path d="M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4"/></svg>` : nothing;
167
- return html`<span class="chip" part="chip" style=${`--tone:${toneOf(this.tone, 0)}`}>${icon}<span class="label">${this.label}</span>${this.meta ? html` <span class="meta">${this.meta}</span>` : nothing}</span>`;
168
- }
169
- };
170
- var ImpktSiteFooter = class extends ImpktElement {
171
- static {
172
- this.properties = {
173
- brand: { type: String },
174
- log: { type: Array },
175
- columns: { type: Array },
176
- columnsOnPhone: { type: String, attribute: "columns-on-phone", reflect: true },
177
- legal: { type: String },
178
- stripe: { type: Boolean, reflect: true },
179
- headingLevel: { type: Number, attribute: "heading-level" }
180
- };
181
- }
182
- constructor() {
183
- super();
184
- this.brand = "";
185
- this.log = [];
186
- this.columns = [];
187
- this.columnsOnPhone = "shown";
188
- this.legal = "";
189
- this.stripe = false;
190
- this.headingLevel = 2;
191
- }
192
- static {
193
- this.styles = [...ImpktElement.styles, focusRing, css`
194
- /* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */
195
- :host { display: block; container-type: inline-size; position: relative; padding-block: ${space(8)} ${space(4)}; margin-block-end: calc(-1 * ${space(8)}); }
196
- .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${space(10)}; }
197
- .brand { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
198
- ul { list-style: none; margin: 0; padding: 0; }
199
- .log { margin-block-start: ${space(8)}; display: grid; gap: ${space(3)}; font-family: ${MONO}; font-size: ${fontSize("sm")}; }
200
- .log li { display: flex; align-items: center; gap: ${space(3)}; opacity: 0.55; }
201
- .log li:first-child { opacity: 1; }
202
- .log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }
203
- .log .code { margin-inline-end: ${space(3)}; }
204
- .columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${space(8)}; }
205
- .h { margin: 0 0 ${space(4)}; font-family: ${MONO}; font-size: ${fontSize("xs")}; font-weight: ${fontWeight("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }
206
- .columns ul { display: grid; gap: ${space(3)}; }
207
- a { color: inherit; text-decoration: none; font-weight: ${fontWeight("medium")}; border-radius: ${t.radiusSm}; }
208
- a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
209
- .legal { margin: ${space(16)} 0 0; font-family: ${MONO}; font-size: ${fontSize("xs")}; opacity: 0.55; }
210
- .stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
211
- .stripe span { flex: 1; }
212
- @container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
213
- @container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }
214
- @media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }
215
- `];
216
- }
217
- heading(text) {
218
- const level = Math.min(Math.max(this.headingLevel || 2, 2), 4);
219
- return level === 3 ? html`<h3 class="h">${text}</h3>` : level === 4 ? html`<h4 class="h">${text}</h4>` : html`<h2 class="h">${text}</h2>`;
220
- }
221
- render() {
222
- const log = this.log ?? [];
223
- return html`<div part="footer">
224
- <div class="top">
225
- <div>
226
- ${this.brand ? html`<p class="brand" part="brand">${this.brand}</p>` : nothing}
227
- ${log.length ? html`<ul class="log" part="log">${log.map((line, i) => html`<li style=${`--tone:${toneOf(line.tone ?? (i === 0 ? "success" : "accent"), i)}`}><span class="dot" aria-hidden="true"></span><span>${line.meta ? html`<span class="code">${line.meta}</span>` : nothing}${line.text}</span></li>`)}</ul>` : nothing}
228
- </div>
229
- <div class="columns" part="columns" style=${`--count:${Math.max(1, (this.columns ?? []).length)}`}>
230
- ${(this.columns ?? []).map((column) => html`<div>${this.heading(column.heading)}<ul>${(column.links ?? []).map((link) => html`<li><a href=${link.href}>${link.label}</a></li>`)}</ul></div>`)}
231
- </div>
232
- </div>
233
- ${this.legal ? html`<p class="legal" part="legal">${this.legal}</p>` : nothing}
234
- ${this.stripe ? html`<div class="stripe" aria-hidden="true">${STRIPE.map((i) => html`<span style=${`background:${toneOf(void 0, i)}`}></span>`)}</div>` : nothing}
235
- </div>`;
236
- }
237
- };
238
- customElements.define("impkt-site-header", ImpktSiteHeader);
239
- customElements.define("impkt-wordmark", ImpktWordmark);
240
- customElements.define("impkt-chip", ImpktChip);
241
- customElements.define("impkt-site-footer", ImpktSiteFooter);
242
-
243
- export {
244
- ImpktSiteHeader,
245
- ImpktWordmark,
246
- ImpktChip,
247
- ImpktSiteFooter
248
- };
249
- //# sourceMappingURL=chunk-QJIB36DM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/site.ts"],"sourcesContent":["/**\n * A site's own header and footer, drawn as one piece each, for the layout's\n * header and footer slots.\n *\n * The page frame (`impkt-page`) gives them their landmarks, so neither draws a\n * `<header>` or `<footer>` of its own: a second banner would be one a screen\n * reader announces twice.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing } from '../base/styles';\nimport { fontSize, fontWeight, space, t, type } from '../base/tokens';\nimport { toneOf, type Tone } from './changelog';\nimport type { NavLink } from './navigation';\nimport './navigation';\nimport './button';\n\n/** The footer stripe's colours, left to right. */\n/** The stripe's segments take the brand's chart colours in order. */\nconst STRIPE = [0, 1, 2, 3, 4];\n\n/** Code-like labels: a branch, a hash, a commit message. */\nconst MONO = t.fontMono;\n\n/** `hideOn`: left out on a phone, or on anything wider. The same width the nav folds at. */\nconst 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\n/**\n * The site header: the brand, the main links and one call to action, with an\n * optional chip beside the brand and a status before the action.\n *\n * The links fold behind a Menu button when they do not fit, as `impkt-nav`\n * does. The chip and the status are labels, not controls, and they are left\n * out on a phone so the brand, the menu and the action keep the row.\n *\n * **Build your own.** Place components in its three slots, start, middle and\n * end, and each slot that holds something replaces what the props draw there:\n * a wordmark and chips at the start, a nav in the middle, a status and a\n * button at the end, in any order. Give a component `hideOn: 'phone'` to leave\n * it out on a phone, so the phone's header is built from the same pieces.\n *\n * @category layout\n * @icon header\n * @slot start - The brand: a wordmark or logo, and any chips beside it.\n * @slot middle - The links, usually one nav.\n * @slot end - A status and the call to action.\n * @fires {CustomEvent<null>} impkt-action - When the call to action is pressed.\n */\nexport class ImpktSiteHeader extends ImpktElement {\n static properties = {\n brand: { type: String },\n logoSrc: { type: String, attribute: 'logo-src' },\n logoAlt: { type: String, attribute: 'logo-alt' },\n home: { type: String },\n badge: { type: String },\n meta: { type: String },\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n status: { type: String },\n statusMeta: { type: String, attribute: 'status-meta' },\n statusTone: { type: String, attribute: 'status-tone' },\n actionText: { type: String, attribute: 'action-text' },\n actionHref: { type: String, attribute: 'action-href' },\n };\n /** The site's name, set as a wordmark when there is no logo picture. */\n declare brand: string;\n /** A logo picture, used instead of the wordmark. */\n declare logoSrc: string;\n /** What the logo says. Leave empty to use the brand name. */\n declare logoAlt: string;\n /** Where the brand links to. */\n declare home: string;\n /** A short chip beside the brand, such as \"main\". */\n declare badge: string;\n /** A code-like line after the chip, such as a commit hash. */\n declare meta: string;\n declare links: NavLink[];\n /** The name of the links' landmark. */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /** A status before the action, such as the stage the site is at. */\n declare status: string;\n /** A code-like line in the status, such as a hash. */\n declare statusMeta: string;\n declare statusTone: Tone;\n declare actionText: string;\n declare actionHref: string;\n\n constructor() {\n super();\n this.brand = '';\n this.logoSrc = '';\n this.logoAlt = '';\n this.home = '/';\n this.badge = '';\n this.meta = '';\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.status = '';\n this.statusMeta = '';\n this.statusTone = 'success';\n this.actionText = '';\n this.actionHref = '';\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n :host { display: block; container-type: inline-size; }\n .bar { display: flex; align-items: center; gap: ${space(6)}; }\n .start { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }\n .middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }\n slot { display: contents; }\n .brand { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; ${type('2xl')} letter-spacing: -0.02em; line-height: 1; }\n .brand img { display: block; block-size: 32px; inline-size: auto; }\n .chip { display: inline-flex; align-items: center; gap: ${space(1)}; padding: 2px ${space(2)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${MONO}; font-size: ${fontSize('xs')}; }\n .chip svg { inline-size: 12px; block-size: 12px; }\n .meta { font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.55; }\n .middle impkt-nav { flex: 1 1 8rem; }\n .end { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .end:empty, .start:empty { display: none; }\n .status { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border: ${t.borderThin} solid ${t.border}; border-radius: 999px; background: ${t.surfaceCard}; font-family: ${MONO}; font-size: ${fontSize('xs')}; white-space: nowrap; }\n .status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }\n .status .hash { opacity: 0.55; }\n @container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${space(3)}; } }\n `];\n\n private act(): void {\n this.dispatchEvent(new CustomEvent('impkt-action', { bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const wordmark = this.logoSrc\n ? html`<img src=${this.logoSrc} alt=${this.logoAlt || this.brand} />`\n : html`${this.brand}`;\n // Each region shows what is placed in its slot, or, when nothing is, what the props describe.\n return html`<div class=\"bar\" part=\"bar\">\n <div class=\"start\"><slot name=\"start\">\n ${this.brand || this.logoSrc ? html`<a class=\"brand\" href=${this.home || '/'} part=\"brand\">${wordmark}</a>` : nothing}\n ${this.badge ? html`<span class=\"chip\" part=\"badge\"><svg viewBox=\"0 0 14 14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><circle cx=\"3.5\" cy=\"3\" r=\"1.5\"/><circle cx=\"3.5\" cy=\"11\" r=\"1.5\"/><circle cx=\"10.5\" cy=\"4.5\" r=\"1.5\"/><path d=\"M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4\"/></svg>${this.badge}</span>` : nothing}\n ${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}\n </slot></div>\n <div class=\"middle\"><slot name=\"middle\">${(this.links ?? []).length ? html`<impkt-nav align=\"center\" size=\"sm\" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impkt-nav>` : nothing}</slot></div>\n <div class=\"end\"><slot name=\"end\">\n ${this.status ? html`<span class=\"status\" part=\"status\" style=${`--tone:${toneOf(this.statusTone, 0)}`}><span class=\"dot\" aria-hidden=\"true\"></span>${this.status}${this.statusMeta ? html` <span class=\"hash\">${this.statusMeta}</span>` : nothing}</span>` : nothing}\n ${this.actionText ? html`<impkt-button variant=\"primary\" icon-after=\"arrow-right\" href=${this.actionHref || nothing} @click=${this.act}>${this.actionText}</impkt-button>` : nothing}\n </slot></div>\n </div>`;\n }\n}\n\n/**\n * The site's name as a wordmark, or its logo, linking home: the start of a\n * site header.\n *\n * @category layout\n * @icon logo\n */\nexport class ImpktWordmark extends ImpktElement {\n static properties = {\n text: { type: String },\n src: { type: String },\n alt: { type: String },\n href: { type: String },\n size: { type: String, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n /** The name, set in the heading face. */\n declare text: string;\n /** A logo picture, used instead of the name. */\n declare src: string;\n /** What the logo says. Leave empty to use the name. */\n declare alt: string;\n declare href: string;\n /** Larger on a wide header, smaller on a phone's. */\n declare size: 'sm' | 'md' | 'lg';\n declare hideOn: 'never' | 'phone' | 'wide';\n\n constructor() {\n super();\n this.text = '';\n this.src = '';\n this.alt = '';\n this.href = '/';\n this.size = 'md';\n this.hideOn = 'never';\n }\n\n static styles = [...ImpktElement.styles, focusRing, hideOn, css`\n :host { display: inline-flex; align-items: center; flex: none; }\n a { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n :host([size='sm']) a { ${type('xl')} } :host([size='md']) a { ${type('2xl')} } :host([size='lg']) a { ${type('3xl')} }\n img { display: block; block-size: 32px; inline-size: auto; }\n @media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${type('xl')} } }\n `];\n\n render(): TemplateResult {\n // The name arrives as the element's words when a page places it, or as `text` when it is set directly.\n return html`<a href=${this.href || '/'} part=\"link\">${this.src ? html`<img src=${this.src} alt=${this.alt || this.text || this.textContent?.trim() || ''} />` : html`<slot>${this.text}</slot>`}</a>`;\n }\n}\n\n/**\n * A short label: a branch name with its icon, a status with its dot, or a\n * code such as a commit hash. It says something; it does nothing.\n *\n * @category content\n * @icon badge\n */\nexport class ImpktChip extends ImpktElement {\n static properties = {\n label: { type: String },\n meta: { type: String },\n icon: { type: String, reflect: true },\n tone: { type: String },\n look: { type: String, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n declare label: string;\n /** A code after the label, quieter, such as a hash. */\n declare meta: string;\n /** A coloured dot, a branch, or nothing before the label. */\n declare icon: 'none' | 'dot' | 'branch';\n /** The dot's colour: a named tone, or 1 to 5 for the brand's chart colours. */\n declare tone: Tone;\n /** `outlined` on the card colour, `filled` with a faint wash, or `plain` words in the code face. */\n declare look: 'outlined' | 'filled' | 'plain';\n declare hideOn: 'never' | 'phone' | 'wide';\n\n constructor() {\n super();\n this.label = '';\n this.meta = '';\n this.icon = 'none';\n this.tone = 'success';\n this.look = 'filled';\n this.hideOn = 'never';\n }\n\n static styles = [...ImpktElement.styles, hideOn, css`\n :host { display: inline-flex; flex: none; }\n span.chip { display: inline-flex; align-items: center; gap: ${space(1.5)}; padding: 3px ${space(2.5)}; border-radius: 999px; font-family: ${MONO}; font-size: ${fontSize('xs')}; line-height: 1.2; white-space: nowrap; }\n :host([look='filled']) span.chip { border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }\n :host([look='outlined']) span.chip { border: ${t.borderThin} solid ${t.border}; background: ${t.surfaceCard}; text-transform: uppercase; letter-spacing: 0.04em; }\n :host([look='plain']) span.chip { padding: 0; }\n .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }\n svg { inline-size: 12px; block-size: 12px; }\n .meta { opacity: 0.55; text-transform: none; }\n :host([look='plain']) .label { opacity: 0.55; }\n `];\n\n render(): TemplateResult {\n const icon = this.icon === 'dot'\n ? html`<span class=\"dot\" aria-hidden=\"true\"></span>`\n : this.icon === 'branch'\n ? html`<svg viewBox=\"0 0 14 14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><circle cx=\"3.5\" cy=\"3\" r=\"1.5\"/><circle cx=\"3.5\" cy=\"11\" r=\"1.5\"/><circle cx=\"10.5\" cy=\"4.5\" r=\"1.5\"/><path d=\"M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4\"/></svg>`\n : nothing;\n return html`<span class=\"chip\" part=\"chip\" style=${`--tone:${toneOf(this.tone, 0)}`}>${icon}<span class=\"label\">${this.label}</span>${this.meta ? html` <span class=\"meta\">${this.meta}</span>` : nothing}</span>`;\n }\n}\n\n/** One line of a footer's log: a code, what it says, and the colour of its dot. */\nexport interface FooterLogLine {\n meta?: string;\n text: string;\n tone?: Tone;\n}\n\n/** A column of footer links under a short heading. */\nexport interface FooterColumn {\n heading: string;\n links: NavLink[];\n}\n\n/**\n * The site footer: the footer band with the brand set large, an optional log of\n * lines beside it, columns of links, a legal line and a stripe of the brand's\n * colours along the foot.\n *\n * Each column is a list under its own heading, so a screen reader can move\n * from one to the next. The log is a list too; its dots are decoration.\n *\n * @category layout\n * @icon footer\n */\nexport class ImpktSiteFooter extends ImpktElement {\n static properties = {\n brand: { type: String },\n log: { type: Array },\n columns: { type: Array },\n columnsOnPhone: { type: String, attribute: 'columns-on-phone', reflect: true },\n legal: { type: String },\n stripe: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n };\n /** The site's name, set large. */\n declare brand: string;\n /** Lines set in code type under the brand, newest first. The first is bright. */\n declare log: FooterLogLine[];\n declare columns: FooterColumn[];\n /** `hidden` leaves the link columns out on a phone, so the footer there is the name, the lines and the legal line. */\n declare columnsOnPhone: 'shown' | 'hidden';\n /** The line at the foot, such as the copyright. */\n declare legal: string;\n /** A stripe of the brand's colours along the bottom edge. */\n declare stripe: boolean;\n /** The level of each column's heading. */\n declare headingLevel: 2 | 3 | 4;\n\n constructor() {\n super();\n this.brand = '';\n this.log = [];\n this.columns = [];\n this.columnsOnPhone = 'shown';\n this.legal = '';\n this.stripe = false;\n this.headingLevel = 2;\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n /* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */\n :host { display: block; container-type: inline-size; position: relative; padding-block: ${space(8)} ${space(4)}; margin-block-end: calc(-1 * ${space(8)}); }\n .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${space(10)}; }\n .brand { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }\n ul { list-style: none; margin: 0; padding: 0; }\n .log { margin-block-start: ${space(8)}; display: grid; gap: ${space(3)}; font-family: ${MONO}; font-size: ${fontSize('sm')}; }\n .log li { display: flex; align-items: center; gap: ${space(3)}; opacity: 0.55; }\n .log li:first-child { opacity: 1; }\n .log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }\n .log .code { margin-inline-end: ${space(3)}; }\n .columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${space(8)}; }\n .h { margin: 0 0 ${space(4)}; font-family: ${MONO}; font-size: ${fontSize('xs')}; font-weight: ${fontWeight('medium')}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }\n .columns ul { display: grid; gap: ${space(3)}; }\n a { color: inherit; text-decoration: none; font-weight: ${fontWeight('medium')}; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n .legal { margin: ${space(16)} 0 0; font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.55; }\n .stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }\n .stripe span { flex: 1; }\n @container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }\n @media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }\n `];\n\n private heading(text: string): TemplateResult {\n const level = Math.min(Math.max(this.headingLevel || 2, 2), 4);\n return level === 3 ? html`<h3 class=\"h\">${text}</h3>` : level === 4 ? html`<h4 class=\"h\">${text}</h4>` : html`<h2 class=\"h\">${text}</h2>`;\n }\n\n render(): TemplateResult {\n const log = this.log ?? [];\n return html`<div part=\"footer\">\n <div class=\"top\">\n <div>\n ${this.brand ? html`<p class=\"brand\" part=\"brand\">${this.brand}</p>` : nothing}\n ${log.length ? html`<ul class=\"log\" part=\"log\">${log.map((line, i) => html`<li style=${`--tone:${toneOf(line.tone ?? (i === 0 ? 'success' : 'accent'), i)}`}><span class=\"dot\" aria-hidden=\"true\"></span><span>${line.meta ? html`<span class=\"code\">${line.meta}</span>` : nothing}${line.text}</span></li>`)}</ul>` : nothing}\n </div>\n <div class=\"columns\" part=\"columns\" style=${`--count:${Math.max(1, (this.columns ?? []).length)}`}>\n ${(this.columns ?? []).map((column) => html`<div>${this.heading(column.heading)}<ul>${(column.links ?? []).map((link) => html`<li><a href=${link.href}>${link.label}</a></li>`)}</ul></div>`)}\n </div>\n </div>\n ${this.legal ? html`<p class=\"legal\" part=\"legal\">${this.legal}</p>` : nothing}\n ${this.stripe ? html`<div class=\"stripe\" aria-hidden=\"true\">${STRIPE.map((i) => html`<span style=${`background:${toneOf(undefined, i)}`}></span>`)}</div>` : nothing}\n </div>`;\n }\n}\n\ncustomElements.define('impkt-site-header', ImpktSiteHeader);\ncustomElements.define('impkt-wordmark', ImpktWordmark);\ncustomElements.define('impkt-chip', ImpktChip);\ncustomElements.define('impkt-site-footer', ImpktSiteFooter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-site-header': ImpktSiteHeader;\n 'impkt-wordmark': ImpktWordmark;\n 'impkt-chip': ImpktChip;\n 'impkt-site-footer': ImpktSiteFooter;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAQA,SAAS,KAAK,MAAM,eAAoC;AAWxD,IAAM,SAAS,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAG7B,IAAM,OAAO,EAAE;AAGf,IAAM,SAAS;AAAA;AAAA;AAAA;AA2BR,IAAM,kBAAN,cAA8B,aAAa;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,MAC/C,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,MAC/C,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,UAAU,EAAE,MAAM,QAAQ,WAAW,YAAY;AAAA,MACjD,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;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QAAQ,OAAO,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,mBAAmB,KAAK,IAAI,IAAI,KAAK,KAAK,WAAW,CAAC,aAAa,CAAC;AAAA;AAAA;AAAA,QAG/L,KAAK,QAAQ,qCAAqC,KAAK,KAAK,SAAS,OAAO;AAAA,QAC5E,KAAK,SAAS,8CAA8C,OAAO,IAAI,CAAC,MAAM,mBAAmB,cAAc,OAAO,QAAW,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,OAAO;AAAA;AAAA,EAExK;AACF;AAEA,eAAe,OAAO,qBAAqB,eAAe;AAC1D,eAAe,OAAO,kBAAkB,aAAa;AACrD,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,qBAAqB,eAAe;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/price.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { pageLocale } from '../base/locale';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\n/**\n * A money amount.\n *\n * This component exists because of a decision taken in the content model: a\n * binding names a source and cannot compute\n * ([ADR 0003](https://github.com/matthill8286/strata/blob/main/docs/decisions/0003-binding-expressions.md)). The\n * consequence is that formatting lives here, where the locale and the currency\n * are known, rather than in authored content — so there is one place that\n * decides what \"£24.99\" looks like, and nobody writes a format string into a\n * CMS field.\n *\n * **The amount is one text node.** Splitting the pounds and the pence into\n * separate elements for typographic effect makes some screen readers read them\n * as two numbers, and \"twenty-four ninety-nine\" becomes \"twenty four, ninety\n * nine\". The visual emphasis is done with CSS over one node instead.\n *\n * **Minor units in, major units out.** `amount` is in pence, because a price\n * that arrives from a pricing API as a float has already lost money to binary\n * rounding before it reaches the screen.\n\n *\n * @category content\n * @icon price\n */\nexport class ImpktPrice extends ImpktElement {\n static properties = {\n amount: { type: Number },\n currency: { type: String },\n locale: { type: String },\n prefix: { type: String },\n period: { type: String },\n size: { type: String, reflect: true },\n pending: { type: String },\n };\n\n /** In minor units — pence, cents. */\n declare amount: number | undefined;\n declare currency: string;\n declare locale: string;\n /** \"From\", \"Guide\". Read before the amount. */\n declare prefix: string;\n /** \"a month\", \"a year\". Read after the amount. */\n declare period: string;\n declare size: 'md' | 'lg' | 'xl';\n /** Shown while there is no amount yet. A price takes seconds to arrive. */\n declare pending: string;\n\n constructor() {\n super();\n this.amount = undefined;\n this.currency = 'GBP';\n this.locale = '';\n this.prefix = '';\n this.period = '';\n this.size = 'xl';\n this.pending = '—';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: inline-flex;\n align-items: baseline;\n gap: ${space(1)};\n color: ${t.text};\n }\n .amount {\n font-family: ${t.fontHeading};\n font-weight: ${fontWeight('bold')};\n /* Tabular figures so a price does not reflow as the digits change,\n which otherwise makes a recalculating price jitter. */\n font-variant-numeric: tabular-nums;\n }\n :host([size='md']) .amount { font-size: ${fontSize('lg')}; }\n :host([size='lg']) .amount { font-size: ${fontSize('2xl')}; }\n :host([size='xl']) .amount { font-size: ${fontSize('3xl')}; }\n .period {\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n }\n `,\n ];\n\n private get formatted(): string {\n if (this.amount === undefined || Number.isNaN(this.amount)) return this.pending;\n try {\n return new Intl.NumberFormat(this.locale || pageLocale(this), {\n style: 'currency',\n currency: this.currency,\n // A house price reads as £385,000. Pence only mean something on small amounts.\n ...(this.amount >= 100000 && this.amount % 100 === 0 ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : {}),\n }).format(this.amount / 100);\n } catch {\n // An unknown currency or locale must not take the page down. The number\n // is still the most useful thing on the screen.\n return (this.amount / 100).toFixed(2);\n }\n }\n\n render(): TemplateResult {\n return html`\n ${this.prefix ? html`<span class=\"period\" part=\"prefix\">${this.prefix}</span>` : nothing}\n <span class=\"amount\" part=\"amount\">${this.formatted}</span>\n ${this.period ? html`<span class=\"period\" part=\"period\">${this.period}</span>` : nothing}\n `;\n }\n}\n\ncustomElements.define('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AAA,QAC5D,OAAO;AAAA,QACP,UAAU,KAAK;AAAA;AAAA,QAEf,GAAI,KAAK,UAAU,OAAU,KAAK,SAAS,QAAQ,IAAI,EAAE,uBAAuB,GAAG,uBAAuB,EAAE,IAAI,CAAC;AAAA,MACnH,CAAC,EAAE,OAAO,KAAK,SAAS,GAAG;AAAA,IAC7B,QAAQ;AAGN,cAAQ,KAAK,SAAS,KAAK,QAAQ,CAAC;AAAA,IACtC;AAAA,EACF;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,QACH,KAAK,SAAS,0CAA0C,KAAK,MAAM,YAAY,OAAO;AAAA,2CACnD,KAAK,SAAS;AAAA,QACjD,KAAK,SAAS,0CAA0C,KAAK,MAAM,YAAY,OAAO;AAAA;AAAA,EAE5F;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/link.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A link.\n *\n * **A new tab is always announced.** When `external` is set, the accessible\n * name gains \"opens in a new tab\" — not as a tooltip, which no screen reader\n * reads, and not as an icon alone, which carries no text. An unannounced new\n * tab breaks the back button for someone who cannot see that the window\n * changed, and that is what 3.2.5 is about.\n *\n * **It is underlined.** 1.4.1 Use of Colour: a link distinguished from body\n * text only by being a different colour is not distinguished at all for a\n * reader who cannot tell the two colours apart.\n\n *\n * @category action\n * @icon link\n * @slot - The link text.\n */\nexport class ImpktLink extends ImpktElement {\n static properties = {\n href: { type: String },\n external: { type: Boolean, reflect: true },\n externalText: { type: String, attribute: 'external-text' },\n variant: { type: String, reflect: true },\n icon: { type: String },\n };\n\n declare href: string;\n declare external: boolean;\n declare externalText: string;\n /** In a sentence, or on its own line as a call to action, bolder and with an arrow. */\n declare variant: 'inline' | 'standalone';\n /** An icon after the words. A standalone link has an arrow unless it says otherwise. */\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.href = '';\n this.external = false;\n this.externalText = 'opens in a new tab';\n this.variant = 'inline';\n this.icon = 'none';\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: inline;\n }\n a {\n color: ${t.link};\n text-decoration: underline;\n text-underline-offset: 0.2em;\n border-radius: ${t.radiusSm};\n }\n a:hover {\n color: ${t.linkHover};\n }\n :host([variant='standalone']) { display: inline-block; }\n :host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${space(1)}; font-weight: ${fontWeight('semibold')}; text-decoration-thickness: 1px; }\n :host([variant='standalone']) a:hover .icon { transform: translateX(2px); }\n .icon { flex: none; transition: transform 120ms ease-in-out; }\n .sr-only {\n ${visuallyHidden}\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`\n <a\n part=\"link\"\n href=${this.href || nothing}\n target=${this.external ? '_blank' : nothing}\n rel=${this.external ? 'noopener noreferrer' : nothing}\n >\n <slot></slot>${iconSvg(this.icon !== 'none' ? this.icon : this.variant === 'standalone' ? (this.external ? 'external' : 'arrow-right') : undefined, '1em')}${this.external ? html`<span class=\"sr-only\"> (${this.externalText})</span>` : nothing}\n </a>\n `;\n }\n}\n\ncustomElements.define('impkt-link', ImpktLink);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-link': ImpktLink }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAwBjD,IAAM,YAAN,cAAwB,aAAa;AAAA,EAC1C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,OAAO;AAAA,IACvB;AAAA;AAAA,EAUA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,eAAe;AACpB,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKa,EAAE,IAAI;AAAA;AAAA;AAAA,yBAGE,EAAE,QAAQ;AAAA;AAAA;AAAA,iBAGlB,EAAE,SAAS;AAAA;AAAA;AAAA,0FAG8D,MAAM,CAAC,CAAC,kBAAkB,WAAW,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA,UAIhI,cAAc;AAAA;AAAA;AAAA,IAGtB;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,eAGI,KAAK,QAAQ,OAAO;AAAA,iBAClB,KAAK,WAAW,WAAW,OAAO;AAAA,cACrC,KAAK,WAAW,wBAAwB,OAAO;AAAA;AAAA,uBAEtC,QAAQ,KAAK,SAAS,SAAS,KAAK,OAAO,KAAK,YAAY,eAAgB,KAAK,WAAW,aAAa,gBAAiB,QAAW,KAAK,CAAC,GAAG,KAAK,WAAW,+BAA+B,KAAK,YAAY,aAAa,OAAO;AAAA;AAAA;AAAA,EAGvP;AACF;AAEA,eAAe,OAAO,cAAc,SAAS;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/date-input.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { FieldElement } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/**\n * A date, as three fields.\n *\n * **Why not `<input type=\"date\">`.** The native control is excellent for\n * picking a date near today — an appointment, a start date — and poor for a\n * date of birth, which is the date this product asks for most. Its picker\n * opens on the current month and makes a user born in 1958 navigate eight\n * hundred steps back, its text entry expects a locale-specific format the\n * field does not state, and its rendering differs enough between browsers that\n * no single hint is correct everywhere.\n *\n * Three fields is the pattern government services converged on after testing\n * it on exactly this problem. Each part is typed directly, in any order, with\n * no picker to fight.\n *\n * **The accessibility shape.** A `<fieldset>` and `<legend>` ask the question\n * once; each part has its own visible label, so \"Month\" is announced rather\n * than \"second field\"; `inputmode=\"numeric\"` brings up a number pad without\n * `type=\"number\"`, which on a date part gives spinners, scroll-wheel surprises\n * and silent stripping of a leading zero. The parts carry `autocomplete`\n * tokens so autofill still works, which is 1.3.5.\n\n *\n * @category form\n * @icon calendar\n */\nexport class ImpktDateInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n day: { type: String },\n month: { type: String },\n year: { type: String },\n autocompleteSection: { type: String, attribute: 'autocomplete-section' },\n };\n\n declare day: string;\n declare month: string;\n declare year: string;\n /** \"bday\" fills a date of birth. Empty disables autofill for this field. */\n declare autocompleteSection: string;\n\n constructor() {\n super();\n this.day = '';\n this.month = '';\n this.year = '';\n this.autocompleteSection = 'bday';\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n min-inline-size: 0;\n }\n legend {\n padding: 0;\n }\n .parts {\n display: flex;\n gap: ${space(3)};\n }\n .part {\n display: flex;\n flex-direction: column;\n gap: ${space(1)};\n }\n .part label {\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n }\n input {\n min-block-size: 44px;\n padding: ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radius};\n /* Room for the digits plus the padding and border, so the box is never narrower than a finger. */\n inline-size: calc(3ch + ${space(6)} + 2px);\n }\n .year input {\n inline-size: calc(5ch + ${space(6)} + 2px);\n }\n :host([invalid]) input {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </legend>`;\n }\n\n private datePart(\n name: 'day' | 'month' | 'year',\n label: string,\n length: number,\n autocomplete: string,\n ): TemplateResult {\n const id = this.id_(name);\n return html`\n <div class=\"part ${name}\">\n <label for=${id}>${label}</label>\n <input\n id=${id}\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=${length}\n .value=${this[name]}\n autocomplete=${this.autocompleteSection ? `${this.autocompleteSection}-${autocomplete}` : nothing}\n ?disabled=${this.disabled}\n @input=${(e: Event) => {\n this[name] = (e.target as HTMLInputElement).value;\n this.emit();\n }}\n />\n </div>\n `;\n }\n\n /** ISO, or empty while incomplete. Partial dates are not half-valid. */\n private emit(): void {\n const complete = this.day && this.month && this.year.length === 4;\n const iso = complete\n ? `${this.year}-${this.month.padStart(2, '0')}-${this.day.padStart(2, '0')}`\n : '';\n this.setFormValue(iso);\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <div class=\"parts\" part=\"parts\">\n ${this.datePart('day', say('Day'), 2, 'day')}\n ${this.datePart('month', say('Month'), 2, 'month')}\n ${this.datePart('year', say('Year'), 4, 'year')}\n </div>\n `;\n }\n\n render(): TemplateResult {\n return html`\n <fieldset part=\"fieldset\" aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}>\n ${this.renderLabel()}\n ${this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">${this.description}</div>`\n : nothing}\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">${this.error || nothing}</div>\n </fieldset>\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('impkt-date-input', ImpktDateInput);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-date-input': ImpktDateInput }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA+BjD,IAAM,iBAAN,cAA6B,aAAa;AAAA,EAC/C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,KAAK,EAAE,MAAM,OAAO;AAAA,MACpB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,qBAAqB,EAAE,MAAM,QAAQ,WAAW,uBAAuB;AAAA,IACzE;AAAA;AAAA,EAQA,cAAc;AACZ,UAAM;AACN,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,sBAAsB;AAAA,EAC7B;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAYW,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAKR,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,qBAGF,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,mBAIT,MAAM,CAAC,CAAC;AAAA;AAAA,qBAEN,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,IAAI;AAAA,sBACD,EAAE,WAAW;AAAA,kBACjB,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,MAAM;AAAA;AAAA,kCAEC,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,kCAGR,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,wBAGlB,EAAE,MAAM;AAAA,wBACR,EAAE,WAAW;AAAA;AAAA;AA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