@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,725 +0,0 @@
1
- import {
2
- iconSvg
3
- } from "./chunk-NKMVICB5.js";
4
- import {
5
- ImpktElement,
6
- focusRing,
7
- fontWeight,
8
- lineHeight,
9
- say,
10
- space,
11
- spaceAround,
12
- t,
13
- targetSize,
14
- token,
15
- type,
16
- visuallyHidden
17
- } from "./chunk-3KO55PZK.js";
18
-
19
- // packages/ui/src/components/organisms.ts
20
- import { css, html, nothing } from "lit";
21
- var token_accent = token("color.accent.default", "#c8a15a");
22
- var reducedMotion = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
23
- var roundButton = css`
24
- .round { ${targetSize} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.rule}; border-radius: 50%; box-shadow: ${t.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }
25
- .round:hover:not(:disabled) { box-shadow: ${t.shadowMd}; }
26
- .round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
27
- `;
28
- var headingStyles = css`
29
- .eyebrow { margin: 0; color: var(--impkt-eyebrow, var(--impkt-color-text-eyebrow, ${t.brand})); ${type("sm")} font-size: var(--impkt-font-size-eyebrow, var(--impkt-font-size-sm, 0.875rem)); font-family: ${t.fontEyebrow}; font-weight: var(--impkt-font-weight-eyebrow, ${fontWeight("semibold")}); letter-spacing: ${t.trackingWide}; text-transform: uppercase; }
30
- .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; letter-spacing: ${t.trackingTight}; text-wrap: balance; }
31
- .lead { margin: 0; color: ${t.textMuted}; text-wrap: pretty; }
32
- `;
33
- var ImpktCarousel = class extends ImpktElement {
34
- constructor() {
35
- super();
36
- this.index = 0;
37
- this.count = 0;
38
- /** How many slides fit right now, which the width decides. */
39
- this.visible = null;
40
- /** Where a button or dot is taking the row. Until it arrives, the scroll position is not the truth. */
41
- this.heading = null;
42
- this.paused = false;
43
- this.held = false;
44
- this.label = "Slides";
45
- this.perView = "1";
46
- this.arrows = "below";
47
- this.autoplay = false;
48
- this.seconds = 6;
49
- this.spaceAbove = "none";
50
- this.spaceBelow = "none";
51
- }
52
- static {
53
- this.properties = {
54
- label: { type: String },
55
- perView: { type: String, reflect: true, attribute: "per-view" },
56
- arrows: { type: String, reflect: true },
57
- autoplay: { type: Boolean, reflect: true },
58
- seconds: { type: Number },
59
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
60
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
61
- };
62
- }
63
- static {
64
- this.styles = [...ImpktElement.styles, focusRing, spaceAround, roundButton, css`
65
- :host { display: block; container-type: inline-size; --most: 1; --gap: ${space(6)}; }
66
- :host([per-view='2']) { --most: 2; }
67
- :host([per-view='3']) { --most: 3; }
68
- .track { --per: var(--most); display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: ${space(1)} ${space(2)}; border-radius: ${t.radiusLg}; }
69
- .track::-webkit-scrollbar { display: none; }
70
- ::slotted(*) { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-inline-size: 0; scroll-snap-align: start; box-sizing: border-box; }
71
- /* Whole slides only: a slice of the next one reads as content spilling out of the page. */
72
- @container (max-width: 60rem) { .track { --per: min(var(--most), 2); } }
73
- @container (max-width: 40rem) { .track { --per: 1; --gap: ${space(4)}; } }
74
- .controls { display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; margin-block-start: ${space(4)}; }
75
- .dots { display: flex; flex-wrap: wrap; gap: ${space(1)}; }
76
- .dot { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: ${t.radiusSm}; }
77
- .dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: ${t.rule}; transition: inline-size 150ms ease-in-out, background-color 150ms ease-in-out; }
78
- .dot[aria-current='true'] span { inline-size: 24px; background: ${t.brand}; }
79
- .buttons { display: flex; gap: ${space(2)}; }
80
- section { position: relative; }
81
- @container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${space(4)}); inset-inline-end: 0; } }
82
- .sr-only { ${visuallyHidden} }
83
- @media (forced-colors: active) { .dot span { background: CanvasText; } .dot[aria-current='true'] span { background: Highlight; } }
84
- `];
85
- }
86
- get track() {
87
- return this.renderRoot.querySelector(".track");
88
- }
89
- get slides() {
90
- return Array.from(this.children);
91
- }
92
- /** The last slide that can sit at the start of the row. */
93
- get last() {
94
- return Math.max(0, this.count - (this.visible ?? Number(this.perView || 1)));
95
- }
96
- /** Count what actually fits, and keep the row on a real stop when that changes. */
97
- measure() {
98
- const track = this.track;
99
- const first = this.slides[0];
100
- if (!track || !first) return;
101
- const width = first.getBoundingClientRect().width;
102
- if (width <= 0) return;
103
- const gap = Number.parseFloat(getComputedStyle(track).columnGap) || 0;
104
- const fits = Math.max(1, Math.round((track.clientWidth + gap) / (width + gap)));
105
- if (fits === this.visible) return;
106
- this.visible = fits;
107
- this.index = Math.min(this.index, this.last);
108
- const slide = this.slides[this.index];
109
- if (slide && typeof track.scrollTo === "function") track.scrollTo({ left: slide.offsetLeft - track.offsetLeft, behavior: "auto" });
110
- this.requestUpdate();
111
- }
112
- onSlots() {
113
- const slides = this.slides;
114
- this.count = slides.length;
115
- slides.forEach((slide, i) => {
116
- slide.setAttribute("role", "group");
117
- slide.setAttribute("aria-roledescription", say("slide"));
118
- slide.setAttribute("aria-label", say("{slide} of {slides}", { slide: i + 1, slides: slides.length }));
119
- });
120
- this.measure();
121
- this.requestUpdate();
122
- }
123
- go(to) {
124
- const target = Math.min(this.last, Math.max(0, to));
125
- this.index = target;
126
- this.heading = target;
127
- clearTimeout(this.settle);
128
- this.settle = setTimeout(() => {
129
- const arrived = this.heading === null;
130
- this.heading = null;
131
- const track2 = this.track;
132
- const slide2 = this.slides[this.index];
133
- if (!arrived && track2 && slide2 && typeof track2.scrollTo === "function") track2.scrollTo({ left: slide2.offsetLeft - track2.offsetLeft, behavior: "auto" });
134
- }, 900);
135
- this.requestUpdate();
136
- const track = this.track;
137
- const slide = this.slides[target];
138
- if (track && slide && typeof track.scrollTo === "function") {
139
- track.scrollTo({ left: slide.offsetLeft - track.offsetLeft, behavior: reducedMotion() ? "auto" : "smooth" });
140
- }
141
- }
142
- onScroll() {
143
- const track = this.track;
144
- const slides = this.slides;
145
- if (!track || !slides.length) return;
146
- let nearest = 0;
147
- let distance = Infinity;
148
- slides.forEach((slide, i) => {
149
- const d = Math.abs(slide.offsetLeft - track.offsetLeft - track.scrollLeft);
150
- if (d < distance) {
151
- distance = d;
152
- nearest = i;
153
- }
154
- });
155
- if (this.heading !== null) {
156
- if (nearest === this.heading && distance < 2) {
157
- this.heading = null;
158
- clearTimeout(this.settle);
159
- }
160
- return;
161
- }
162
- if (nearest !== this.index) {
163
- this.index = Math.min(nearest, this.last);
164
- this.requestUpdate();
165
- }
166
- }
167
- onKey(event) {
168
- if (event.key === "ArrowRight") {
169
- event.preventDefault();
170
- this.go(this.index + 1);
171
- }
172
- if (event.key === "ArrowLeft") {
173
- event.preventDefault();
174
- this.go(this.index - 1);
175
- }
176
- }
177
- get canPlay() {
178
- return this.autoplay && !reducedMotion();
179
- }
180
- restart() {
181
- clearInterval(this.timer);
182
- this.timer = void 0;
183
- if (!this.canPlay || this.paused || this.held) return;
184
- this.timer = setInterval(() => this.go(this.index >= this.last ? 0 : this.index + 1), Math.max(2, this.seconds) * 1e3);
185
- }
186
- hold(held) {
187
- this.held = held;
188
- this.restart();
189
- }
190
- togglePause() {
191
- this.paused = !this.paused;
192
- this.restart();
193
- this.requestUpdate();
194
- }
195
- firstUpdated() {
196
- if (typeof ResizeObserver === "function" && this.track) {
197
- this.observer = new ResizeObserver(() => this.measure());
198
- this.observer.observe(this.track);
199
- }
200
- }
201
- updated(changed) {
202
- if (changed.has("autoplay") || changed.has("seconds")) this.restart();
203
- if (changed.has("perView")) this.measure();
204
- }
205
- connectedCallback() {
206
- super.connectedCallback();
207
- if (this.track) this.observer?.observe(this.track);
208
- this.restart();
209
- }
210
- disconnectedCallback() {
211
- super.disconnectedCallback();
212
- this.observer?.disconnect();
213
- clearInterval(this.timer);
214
- clearTimeout(this.settle);
215
- }
216
- render() {
217
- const stops = Array.from({ length: this.last + 1 }, (_, i) => i);
218
- return html`<section aria-roledescription=${say("carousel")} aria-label=${this.label} part="carousel" @keydown=${this.onKey}
219
- @mouseenter=${() => this.hold(true)} @mouseleave=${() => this.hold(false)} @focusin=${() => this.hold(true)} @focusout=${() => this.hold(false)}>
220
- <div class="track" part="track" tabindex="0" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>
221
- <div class="controls" part="controls">
222
- <div class="dots">${stops.length > 1 ? stops.map((i) => html`<button class="dot" type="button" aria-label=${say("Go to slide {slide}", { slide: i + 1 })} aria-current=${i === this.index ? "true" : "false"} @click=${() => this.go(i)}><span></span></button>`) : nothing}</div>
223
- <div class="buttons">
224
- ${this.canPlay ? html`<button class="round" type="button" aria-label=${say(this.paused ? "Play the slides" : "Pause the slides")} @click=${this.togglePause}>${this.paused ? iconSvg("arrow-right", "18px") : html`<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg>`}</button>` : nothing}
225
- <button class="round" type="button" aria-label=${say("Previous slide")} ?disabled=${this.index === 0} @click=${() => this.go(this.index - 1)}>${iconSvg("arrow-left", "18px")}</button>
226
- <button class="round" type="button" aria-label=${say("Next slide")} ?disabled=${this.index >= this.last} @click=${() => this.go(this.index + 1)}>${iconSvg("arrow-right", "18px")}</button>
227
- </div>
228
- </div>
229
- <p class="sr-only" aria-live="polite">${say("Slide {slide} of {slides}", { slide: this.index + 1, slides: this.count })}</p>
230
- </section>`;
231
- }
232
- };
233
- function gallerySpan(index, count, layout) {
234
- const last = index === count - 1;
235
- const span = { wide: 1, narrow: 1, rows: 1 };
236
- if (layout === "grid") {
237
- if (last) {
238
- span.wide = count % 3 ? 4 - count % 3 : 1;
239
- span.narrow = count % 2 ? 2 : 1;
240
- }
241
- return span;
242
- }
243
- if (index === 0) return span;
244
- if (count === 2) return { wide: 2, narrow: 2, rows: 2 };
245
- if (count === 3) return { ...span, wide: 2 };
246
- if (last) {
247
- const extra = (count - 5) % 4;
248
- span.wide = count === 4 ? 2 : count > 5 && extra ? 5 - extra : 1;
249
- span.narrow = count % 2 ? 1 : 2;
250
- }
251
- return span;
252
- }
253
- var ImpktGallery = class extends ImpktElement {
254
- constructor() {
255
- super();
256
- this.shown = -1;
257
- this.opener = null;
258
- this.items = [];
259
- this.layout = "feature";
260
- this.label = "Gallery";
261
- this.spaceAbove = "none";
262
- this.spaceBelow = "none";
263
- }
264
- static {
265
- this.properties = {
266
- items: { type: Array },
267
- layout: { type: String, reflect: true },
268
- label: { type: String },
269
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
270
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
271
- };
272
- }
273
- static {
274
- this.styles = [...ImpktElement.styles, focusRing, spaceAround, roundButton, css`
275
- :host { display: block; container-type: inline-size; }
276
- ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(3)}; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }
277
- :host([layout='grid']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }
278
- li { grid-column: span var(--span-wide, 1); grid-row: span var(--span-rows, 1); }
279
- :host([layout='feature']) li:first-child { grid-column: span 2; grid-row: span 2; }
280
- .open { position: relative; display: block; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: ${t.surfaceInset}; border-radius: ${t.radiusXl}; overflow: hidden; cursor: zoom-in; }
281
- .open img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 300ms ease-out; }
282
- .open:hover img { transform: scale(1.03); }
283
- @container (max-width: 40rem) { ul, :host([layout='grid']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; } li { grid-column: span var(--span-narrow, 1); } }
284
- dialog { padding: 0; border: 0; background: transparent; max-inline-size: none; max-block-size: none; inline-size: 100vw; block-size: 100dvh; }
285
- dialog::backdrop { background: rgb(10 14 12 / 0.9); }
286
- .stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; block-size: 100%; box-sizing: border-box; padding: ${space(4)}; gap: ${space(3)}; color: #fff; }
287
- .bar { display: flex; align-items: center; justify-content: space-between; ${type("sm")} }
288
- .middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${space(3)}; min-block-size: 0; }
289
- .middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${t.radiusLg}; }
290
- figure { margin: 0; display: flex; min-block-size: 0; block-size: 100%; }
291
- .caption { margin: 0; text-align: center; ${type("sm")} }
292
- `];
293
- }
294
- get dialog() {
295
- return this.renderRoot.querySelector("dialog");
296
- }
297
- open(index, event) {
298
- this.opener = event.currentTarget;
299
- this.shown = index;
300
- this.requestUpdate();
301
- void this.updateComplete.then(() => {
302
- const d = this.dialog;
303
- if (d && !d.open) {
304
- if (typeof d.showModal === "function") d.showModal();
305
- else d.setAttribute("open", "");
306
- }
307
- });
308
- }
309
- close() {
310
- const d = this.dialog;
311
- if (d?.open) {
312
- if (typeof d.close === "function") d.close();
313
- else d.removeAttribute("open");
314
- }
315
- this.onClosed();
316
- }
317
- onClosed() {
318
- if (this.shown === -1) return;
319
- this.shown = -1;
320
- this.requestUpdate();
321
- this.opener?.focus();
322
- }
323
- step(by) {
324
- const n = (this.items ?? []).length;
325
- if (!n || this.shown < 0) return;
326
- this.shown = (this.shown + by + n) % n;
327
- this.requestUpdate();
328
- }
329
- onKey(event) {
330
- if (event.key === "ArrowRight") {
331
- event.preventDefault();
332
- this.step(1);
333
- }
334
- if (event.key === "ArrowLeft") {
335
- event.preventDefault();
336
- this.step(-1);
337
- }
338
- }
339
- render() {
340
- const items = this.items ?? [];
341
- const current = this.shown >= 0 ? items[this.shown] : void 0;
342
- return html`<ul aria-label=${this.label} part="list">${items.map((item, i) => {
343
- const span = gallerySpan(i, items.length, this.layout);
344
- return html`<li style=${`--span-wide:${span.wide};--span-narrow:${span.narrow};--span-rows:${span.rows}`}>
345
- <button class="open" type="button" aria-label=${say("View larger: {picture}", { picture: item.alt })} @click=${(e) => this.open(i, e)}><img src=${item.src} alt=${item.alt} loading="lazy" /></button>
346
- </li>`;
347
- })}</ul>
348
- <dialog aria-label=${this.label} @keydown=${this.onKey} @close=${this.onClosed}>
349
- ${current ? html`<div class="stage">
350
- <div class="bar"><span>${this.shown + 1} of ${items.length}</span><button class="round" type="button" aria-label=${say("Close")} @click=${this.close}>${iconSvg("close", "18px")}</button></div>
351
- <div class="middle">
352
- <button class="round" type="button" aria-label=${say("Previous picture")} @click=${() => this.step(-1)}>${iconSvg("arrow-left", "18px")}</button>
353
- <figure><img src=${current.src} alt=${current.alt} /></figure>
354
- <button class="round" type="button" aria-label=${say("Next picture")} @click=${() => this.step(1)}>${iconSvg("arrow-right", "18px")}</button>
355
- </div>
356
- <p class="caption">${current.caption ?? current.alt}</p>
357
- </div>` : nothing}
358
- </dialog>`;
359
- }
360
- };
361
- var ImpktLogoCloud = class extends ImpktElement {
362
- static {
363
- this.properties = {
364
- heading: { type: String },
365
- items: { type: Array },
366
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
367
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
368
- };
369
- }
370
- constructor() {
371
- super();
372
- this.heading = "";
373
- this.items = [];
374
- this.spaceAbove = "none";
375
- this.spaceBelow = "none";
376
- }
377
- static {
378
- this.styles = [...ImpktElement.styles, focusRing, spaceAround, css`
379
- :host { display: block; }
380
- p { margin: 0 0 ${space(6)}; text-align: center; color: ${t.textMuted}; ${type("sm")} font-weight: ${fontWeight("medium")}; }
381
- ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${space(8)} ${space(12)}; }
382
- img { display: block; block-size: 40px; inline-size: auto; max-inline-size: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter 200ms ease-in-out, opacity 200ms ease-in-out; }
383
- li:hover img { filter: none; opacity: 1; }
384
- a { display: block; border-radius: ${t.radiusSm}; }
385
- `];
386
- }
387
- render() {
388
- return html`${this.heading ? html`<p part="heading">${this.heading}</p>` : nothing}
389
- <ul part="list">${(this.items ?? []).map((logo) => html`<li>${logo.href ? html`<a href=${logo.href}><img src=${logo.src} alt=${logo.alt} /></a>` : html`<img src=${logo.src} alt=${logo.alt} />`}</li>`)}</ul>`;
390
- }
391
- };
392
- var ImpktSteps = class extends ImpktElement {
393
- static {
394
- this.properties = {
395
- items: { type: Array },
396
- orientation: { type: String, reflect: true },
397
- look: { type: String, reflect: true },
398
- headingLevel: { type: Number, attribute: "heading-level" },
399
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
400
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
401
- };
402
- }
403
- constructor() {
404
- super();
405
- this.items = [];
406
- this.orientation = "horizontal";
407
- this.look = "numbered";
408
- this.headingLevel = 3;
409
- this.spaceAbove = "none";
410
- this.spaceBelow = "none";
411
- }
412
- static {
413
- this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
414
- :host { display: block; container-type: inline-size; }
415
- ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${space(6)}; }
416
- li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${space(2)}; }
417
- li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; ${type("sm")} font-weight: ${fontWeight("bold")}; position: relative; z-index: 1; margin-block-end: ${space(2)}; }
418
- li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${space(6)} + 8px); block-size: 2px; background: ${t.rule}; }
419
- .h { ${type("lg")} letter-spacing: 0; }
420
- .meta { margin: 0; ${type("sm")} color: ${t.textMuted}; font-family: ${t.fontMono}; letter-spacing: 0.02em; }
421
- .body { margin: 0; color: ${t.textMuted}; line-height: ${lineHeight("normal")}; text-wrap: pretty; }
422
- :host([orientation='vertical']) ol { grid-auto-flow: row; }
423
- :host([orientation='vertical']) li { padding-inline-start: 56px; min-block-size: 56px; }
424
- :host([orientation='vertical']) li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
425
- :host([orientation='vertical']) li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${space(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
426
- @container (max-width: 40rem) {
427
- ol { grid-auto-flow: row; }
428
- li { padding-inline-start: 56px; min-block-size: 56px; }
429
- li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
430
- li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${space(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
431
- }
432
- :host([look='ruled']) li { padding-block-start: ${space(5)}; border-block-start: 3px solid var(--rule); }
433
- :host([look='ruled']) li::before, :host([look='ruled']) li::after { display: none; }
434
- :host([look='ruled']) ol { gap: ${space(5)}; }
435
- /* On a phone the ruled steps become a branch graph: one trunk down the left, and each step a coloured branch off it with a dot. */
436
- @container (max-width: 40rem) {
437
- :host([look='ruled']) ol { gap: 0; }
438
- :host([look='ruled']) li { padding-inline-start: 40px; padding-block: ${space(6)}; min-block-size: 0; border-block-start: 0; }
439
- :host([look='ruled']) li::before { display: block; content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 2px; block-size: auto; border-radius: 0; margin: 0; background: ${t.text}; }
440
- :host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${space(3)}; inset-inline-start: 2px; inset-inline-end: auto; inline-size: 12px; block-size: auto; background: radial-gradient(circle at 100% 34px, var(--rule) 4px, transparent 4.5px); border: 2px solid var(--rule); border-inline-start: 0; border-radius: 0 14px 14px 0; }
441
- }
442
- @media (forced-colors: active) { li::before { border: 1px solid CanvasText; } li:not(:last-child)::after { background: CanvasText; } :host([look='ruled']) li { border-block-start-color: CanvasText; } }
443
- `];
444
- }
445
- render() {
446
- return html`<ol part="list">${(this.items ?? []).map((step, i) => html`<li part="step" style=${this.look === "ruled" ? `--rule:var(--impkt-color-chart-${i % 5 + 1}, ${"var(--impkt-color-brand-default, #1f4ed8)"})` : nothing}>
447
- ${step.meta ? html`<p class="meta">${step.meta}</p>` : nothing}
448
- <div class="h" role="heading" aria-level=${this.headingLevel}>${step.heading}</div>
449
- ${step.text ? html`<p class="body">${step.text}</p>` : nothing}
450
- </li>`)}</ol>`;
451
- }
452
- };
453
- var ImpktMediaSplit = class extends ImpktElement {
454
- static {
455
- this.properties = {
456
- eyebrow: { type: String },
457
- heading: { type: String },
458
- lead: { type: String },
459
- points: { type: Array },
460
- level: { type: Number, reflect: true },
461
- imageSrc: { type: String, attribute: "image-src" },
462
- imageAlt: { type: String, attribute: "image-alt" },
463
- imageSide: { type: String, reflect: true, attribute: "image-side" },
464
- insetSrc: { type: String, attribute: "inset-src" },
465
- insetAlt: { type: String, attribute: "inset-alt" },
466
- ratio: { type: String, reflect: true },
467
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
468
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
469
- };
470
- }
471
- constructor() {
472
- super();
473
- this.eyebrow = "";
474
- this.heading = "";
475
- this.lead = "";
476
- this.points = [];
477
- this.level = 2;
478
- this.imageSrc = "";
479
- this.imageAlt = "";
480
- this.imageSide = "end";
481
- this.insetSrc = "";
482
- this.insetAlt = "";
483
- this.ratio = "4:3";
484
- this.spaceAbove = "none";
485
- this.spaceBelow = "none";
486
- }
487
- static {
488
- this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
489
- :host { display: block; container-type: inline-size; --ratio: 4 / 3; }
490
- :host([ratio='1:1']) { --ratio: 1 / 1; }
491
- :host([ratio='3:2']) { --ratio: 3 / 2; }
492
- :host([ratio='16:9']) { --ratio: 16 / 9; }
493
- .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(16)}; align-items: center; }
494
- :host([image-side='start']) .picture { order: -1; }
495
- .words { display: flex; flex-direction: column; gap: ${space(4)}; }
496
- .h { ${type("4xl")} }
497
- .lead { ${type("lg")} }
498
- ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${space(3)}; }
499
- li { display: flex; gap: ${space(3)}; align-items: flex-start; line-height: ${lineHeight("normal")}; }
500
- .tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${t.brandSubtle}; color: ${t.brand}; }
501
- .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }
502
- img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowXl}; }
503
- .picture { position: relative; }
504
- .picture.has-inset { padding-block-end: 8%; padding-inline-end: 4%; }
505
- .inset { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 42%; aspect-ratio: 10 / 7; border: 6px solid ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-sizing: border-box; }
506
- @container (max-width: 48rem) {
507
- .split { grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; }
508
- :host([image-side='start']) .picture { order: 0; }
509
- .h { ${type("3xl")} }
510
- }
511
- `];
512
- }
513
- render() {
514
- return html`<div class="split" part="split">
515
- <div class="words">
516
- ${this.eyebrow ? html`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>` : nothing}
517
- <div class="h" role="heading" aria-level=${this.level}>${this.heading}</div>
518
- ${this.lead ? html`<p class="lead">${this.lead}</p>` : nothing}
519
- ${this.points?.length ? html`<ul>${this.points.map((p) => html`<li><span class="tick">${iconSvg("check", "14px")}</span><span>${p}</span></li>`)}</ul>` : nothing}
520
- <div class="actions"><slot name="actions"></slot></div>
521
- </div>
522
- ${this.imageSrc ? html`<div class="picture ${this.insetSrc ? "has-inset" : ""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc ? html`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />` : nothing}</div>` : nothing}
523
- </div>`;
524
- }
525
- };
526
- var ImpktCtaBanner = class extends ImpktElement {
527
- static {
528
- this.properties = {
529
- heading: { type: String },
530
- lead: { type: String },
531
- tone: { type: String, reflect: true },
532
- align: { type: String, reflect: true },
533
- imageSrc: { type: String, attribute: "image-src" },
534
- imageAlt: { type: String, attribute: "image-alt" },
535
- headingLevel: { type: Number, attribute: "heading-level" },
536
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
537
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
538
- };
539
- }
540
- constructor() {
541
- super();
542
- this.heading = "";
543
- this.lead = "";
544
- this.tone = "brand";
545
- this.align = "split";
546
- this.imageSrc = "";
547
- this.imageAlt = "";
548
- this.headingLevel = 2;
549
- this.spaceAbove = "none";
550
- this.spaceBelow = "none";
551
- }
552
- static {
553
- this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
554
- :host { display: block; container-type: inline-size; }
555
- .panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${space(8)}; padding: ${space(16)}; border-radius: ${t.radius2xl}; background: ${t.surfaceCard}; box-shadow: ${t.shadowSm}, inset 0 0 0 1px ${t.hairline}; }
556
- :host([tone='subtle']) .panel { background: ${t.surfaceSubtle}; box-shadow: none; }
557
- :host([tone='brand']) .panel { background: ${t.brand}; color: ${t.onBrand}; box-shadow: ${t.shadowLg}; }
558
- /* Only the words take the light colours: a button in the actions keeps its own. */
559
- :host([tone='brand']) .words { --impkt-color-text-heading: ${t.onBrand}; --impkt-color-text-default: ${t.onBrand}; --impkt-color-text-muted: ${t.onBrand}; --impkt-color-text-link: ${t.onBrand}; }
560
- /* A soft glow in the corner, so a flat colour has some depth. Decoration only. */
561
- :host([tone='brand']) .panel::before { content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -10%; inline-size: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, ${t.onBrand} 18%, transparent), transparent); pointer-events: none; }
562
- .photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
563
- .panel.pictured { min-block-size: 26rem; color: #fff; background: #12211a; --impkt-color-text-heading: #fff; }
564
- .panel.pictured::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.8) 0%, rgb(18 31 26 / 0.1) 75%); }
565
- .panel.pictured .words, .panel.pictured .actions { z-index: 1; }
566
- @container (max-width: 48rem) { .panel.pictured { justify-content: flex-end; } .panel.pictured::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.15) 0%, rgb(18 31 26 / 0.85) 100%); } }
567
- .words { position: relative; display: flex; flex-direction: column; gap: ${space(3)}; max-inline-size: 40rem; }
568
- .h { ${type("4xl")} }
569
- .lead { ${type("lg")} }
570
- .actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${space(3)}; }
571
- :host([align='stacked']) .panel { flex-direction: column; align-items: flex-start; justify-content: center; }
572
- :host([align='center']) .panel { flex-direction: column; text-align: center; }
573
- :host([align='center']) .words { align-items: center; }
574
- @container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${space(8)} ${space(6)}; } .h { ${type("3xl")} } :host([align='center']) .panel { align-items: center; } }
575
- @media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }
576
- `];
577
- }
578
- render() {
579
- return html`<div class="panel ${this.imageSrc ? "pictured" : ""}" part="panel">
580
- ${this.imageSrc ? html`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />` : nothing}
581
- <div class="words">
582
- <div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>
583
- ${this.lead ? html`<p class="lead">${this.lead}</p>` : nothing}
584
- </div>
585
- <div class="actions"><slot name="actions"></slot></div>
586
- </div>`;
587
- }
588
- };
589
- var stars = (rating) => html`<span class="stars" role="img" aria-label=${say("Rated {rating} out of 5", { rating })}>${[1, 2, 3, 4, 5].map((n) => html`<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true" fill=${n <= rating ? "currentColor" : "none"} stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M12 3.5l2.6 5.4 5.9.7-4.4 4 1.2 5.8L12 16.5l-5.3 2.9 1.2-5.8-4.4-4 5.9-.7z"/></svg>`)}</span>`;
590
- var initials = (name) => name.split(/\s+/).filter((w) => /^[A-Za-z]/.test(w) && w.toLowerCase() !== "and").slice(0, 2).map((w) => w[0].toUpperCase()).join("");
591
- var ImpktReviews = class extends ImpktElement {
592
- static {
593
- this.properties = {
594
- summary: { type: String },
595
- rating: { type: Number },
596
- items: { type: Array },
597
- columns: { type: String, reflect: true },
598
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
599
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
600
- };
601
- }
602
- constructor() {
603
- super();
604
- this.summary = "";
605
- this.rating = void 0;
606
- this.items = [];
607
- this.columns = "three";
608
- this.spaceAbove = "none";
609
- this.spaceBelow = "none";
610
- }
611
- static {
612
- this.styles = [...ImpktElement.styles, spaceAround, css`
613
- :host { display: block; container-type: inline-size; }
614
- .top { display: flex; align-items: center; gap: ${space(3)}; margin-block-end: ${space(6)}; ${type("sm")} font-weight: ${fontWeight("medium")}; }
615
- .stars { display: inline-flex; gap: 2px; color: ${token_accent}; }
616
- ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
617
- :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
618
- li { display: flex; flex-direction: column; gap: ${space(4)}; padding: ${space(6)}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}, inset 0 0 0 1px ${t.hairline}; }
619
- blockquote { margin: 0; flex: 1; ${type("md")} text-wrap: pretty; }
620
- .who { display: flex; align-items: center; gap: ${space(3)}; }
621
- .face { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border-radius: 50%; overflow: hidden; background: ${t.brandSubtle}; color: ${t.brand}; ${type("sm")} font-weight: ${fontWeight("bold")}; }
622
- .face img { inline-size: 100%; block-size: 100%; object-fit: cover; }
623
- .name { font-weight: ${fontWeight("semibold")}; ${type("sm")} }
624
- .about { color: ${t.textMuted}; ${type("sm")} }
625
- @container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }
626
- `];
627
- }
628
- render() {
629
- return html`${this.summary || this.rating ? html`<p class="top" part="summary" style="margin-block-start:0">${this.rating ? stars(Math.round(this.rating)) : nothing}<span>${this.summary}</span></p>` : nothing}
630
- <ul part="list">${(this.items ?? []).map((r) => html`<li part="review">
631
- ${r.rating ? stars(r.rating) : nothing}
632
- <blockquote>${r.quote}</blockquote>
633
- <div class="who"><span class="face" aria-hidden="true">${r.avatarSrc ? html`<img src=${r.avatarSrc} alt="" />` : initials(r.person)}</span><span><span class="name">${r.person}</span>${r.about ? html`<br /><span class="about">${r.about}</span>` : nothing}</span></div>
634
- </li>`)}</ul>`;
635
- }
636
- };
637
- var ImpktNewsletter = class extends ImpktElement {
638
- constructor() {
639
- super();
640
- this.done = false;
641
- this.heading = "";
642
- this.lead = "";
643
- this.label = "Email address";
644
- this.buttonText = "Sign up";
645
- this.smallPrint = "";
646
- this.doneText = "Thank you. You\u2019re on the list.";
647
- this.headingLevel = 2;
648
- this.spaceAbove = "none";
649
- this.spaceBelow = "none";
650
- }
651
- static {
652
- this.properties = {
653
- heading: { type: String },
654
- lead: { type: String },
655
- label: { type: String },
656
- buttonText: { type: String, attribute: "button-text" },
657
- smallPrint: { type: String, attribute: "small-print" },
658
- doneText: { type: String, attribute: "done-text" },
659
- headingLevel: { type: Number, attribute: "heading-level" },
660
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
661
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
662
- };
663
- }
664
- static {
665
- this.styles = [...ImpktElement.styles, focusRing, spaceAround, headingStyles, css`
666
- :host { display: block; container-type: inline-size; }
667
- .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(8)}; align-items: center; }
668
- .words { display: flex; flex-direction: column; gap: ${space(2)}; }
669
- .h { ${type("2xl")} }
670
- form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${space(1)} ${space(3)}; }
671
- label { grid-column: 1 / -1; ${type("sm")} font-weight: ${fontWeight("semibold")}; }
672
- input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${space(2.5)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; }
673
- button { ${targetSize} min-block-size: 44px; padding: ${space(2)} ${space(5)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.onBrand}; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; cursor: pointer; }
674
- button:hover { background: ${t.brandHover}; }
675
- .note { grid-column: 1 / -1; margin: ${space(1)} 0 0; color: ${t.textMuted}; ${type("sm")} }
676
- .done { margin: 0; ${type("md")} font-weight: ${fontWeight("semibold")}; }
677
- @container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
678
- `];
679
- }
680
- submit(event) {
681
- event.preventDefault();
682
- const form = event.currentTarget;
683
- if (typeof form.reportValidity === "function" && !form.reportValidity()) return;
684
- const email = form.querySelector("input").value.trim();
685
- this.dispatchEvent(new CustomEvent("impkt-submit", { detail: { email }, bubbles: true, composed: true }));
686
- this.done = true;
687
- this.requestUpdate();
688
- }
689
- render() {
690
- const field = this.id_("email");
691
- return html`<div class="wrap" part="wrap">
692
- <div class="words">
693
- ${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
694
- ${this.lead ? html`<p class="lead">${this.lead}</p>` : nothing}
695
- </div>
696
- <div aria-live="polite">${this.done ? html`<p class="done">${this.doneText}</p>` : html`<form @submit=${this.submit}>
697
- <label for=${field}>${this.label}</label>
698
- <input id=${field} type="email" name="email" autocomplete="email" required />
699
- <button type="submit">${this.buttonText}</button>
700
- ${this.smallPrint ? html`<p class="note">${this.smallPrint}</p>` : nothing}
701
- </form>`}</div>
702
- </div>`;
703
- }
704
- };
705
- customElements.define("impkt-carousel", ImpktCarousel);
706
- customElements.define("impkt-gallery", ImpktGallery);
707
- customElements.define("impkt-logo-cloud", ImpktLogoCloud);
708
- customElements.define("impkt-steps", ImpktSteps);
709
- customElements.define("impkt-media-split", ImpktMediaSplit);
710
- customElements.define("impkt-cta-banner", ImpktCtaBanner);
711
- customElements.define("impkt-reviews", ImpktReviews);
712
- customElements.define("impkt-newsletter", ImpktNewsletter);
713
-
714
- export {
715
- ImpktCarousel,
716
- gallerySpan,
717
- ImpktGallery,
718
- ImpktLogoCloud,
719
- ImpktSteps,
720
- ImpktMediaSplit,
721
- ImpktCtaBanner,
722
- ImpktReviews,
723
- ImpktNewsletter
724
- };
725
- //# sourceMappingURL=chunk-37PA72FC.js.map