@atomic-ui/ui 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +17 -3
  2. package/custom-elements.json +24569 -0
  3. package/dist/base/ImpktElement.d.ts +14 -0
  4. package/dist/base/locale.d.ts +8 -0
  5. package/dist/base/say.d.ts +1 -0
  6. package/dist/base/styles.d.ts +1 -1
  7. package/dist/base/tokens.d.ts +28 -2
  8. package/dist/{chunk-KWURASAB.js → chunk-26O27BQS.js} +3 -3
  9. package/dist/chunk-2CFVV2NZ.js +494 -0
  10. package/dist/chunk-2CFVV2NZ.js.map +1 -0
  11. package/dist/chunk-3IGNZTJU.js +14 -0
  12. package/dist/chunk-3IGNZTJU.js.map +1 -0
  13. package/dist/{chunk-DR3SJ7ZV.js → chunk-3IQ73WNW.js} +3 -3
  14. package/dist/{chunk-AXQ5YBN2.js → chunk-4X723QBD.js} +135 -10
  15. package/dist/chunk-4X723QBD.js.map +1 -0
  16. package/dist/{chunk-OFAVRPRK.js → chunk-6YYAOKNI.js} +2 -2
  17. package/dist/chunk-6YYAOKNI.js.map +1 -0
  18. package/dist/{chunk-DI2CJ3MZ.js → chunk-7AJN2TIS.js} +2 -2
  19. package/dist/chunk-7BSZPUE3.js +53 -0
  20. package/dist/chunk-7BSZPUE3.js.map +1 -0
  21. package/dist/{chunk-IBTOZOGI.js → chunk-7OXTZJR4.js} +2 -2
  22. package/dist/chunk-7XEPNEVQ.js +264 -0
  23. package/dist/chunk-7XEPNEVQ.js.map +1 -0
  24. package/dist/{chunk-5NUF7ZQA.js → chunk-D6C7XEY4.js} +64 -3
  25. package/dist/chunk-D6C7XEY4.js.map +1 -0
  26. package/dist/{chunk-4JKUAA6K.js → chunk-E2VBUWJ4.js} +53 -14
  27. package/dist/chunk-E2VBUWJ4.js.map +1 -0
  28. package/dist/{chunk-57P4WO4Y.js → chunk-E3XJK7MY.js} +38 -23
  29. package/dist/chunk-E3XJK7MY.js.map +1 -0
  30. package/dist/{chunk-6UDDZQDK.js → chunk-EDSZI227.js} +3 -3
  31. package/dist/chunk-EDSZI227.js.map +1 -0
  32. package/dist/{chunk-3OSL2HMN.js → chunk-FFCIY7NM.js} +9 -6
  33. package/dist/chunk-FFCIY7NM.js.map +1 -0
  34. package/dist/{chunk-4AJPS5AU.js → chunk-FJRHZA3C.js} +16 -6
  35. package/dist/chunk-FJRHZA3C.js.map +1 -0
  36. package/dist/{chunk-JPEWRJSQ.js → chunk-GQDUHZE3.js} +3 -3
  37. package/dist/chunk-HYPPG4NF.js +553 -0
  38. package/dist/chunk-HYPPG4NF.js.map +1 -0
  39. package/dist/chunk-J4JULXUG.js +249 -0
  40. package/dist/chunk-J4JULXUG.js.map +1 -0
  41. package/dist/{chunk-CFGLOYWW.js → chunk-KFD4O7VA.js} +4 -2
  42. package/dist/chunk-KFD4O7VA.js.map +1 -0
  43. package/dist/{chunk-LLRJU7XE.js → chunk-MVEFM5QI.js} +6 -6
  44. package/dist/chunk-MVEFM5QI.js.map +1 -0
  45. package/dist/{chunk-6GKI67P7.js → chunk-NCASAXQT.js} +7 -3
  46. package/dist/chunk-NCASAXQT.js.map +1 -0
  47. package/dist/{chunk-H6L3FSQY.js → chunk-NKTMMJYD.js} +7 -6
  48. package/dist/chunk-NKTMMJYD.js.map +1 -0
  49. package/dist/{chunk-QELX47AP.js → chunk-OB7WULFK.js} +50 -27
  50. package/dist/chunk-OB7WULFK.js.map +1 -0
  51. package/dist/chunk-OHDPGIJ3.js +428 -0
  52. package/dist/chunk-OHDPGIJ3.js.map +1 -0
  53. package/dist/{chunk-TZD7IVVQ.js → chunk-OLLZFNO6.js} +13 -5
  54. package/dist/chunk-OLLZFNO6.js.map +1 -0
  55. package/dist/{chunk-5RVMMKMO.js → chunk-OMJMUFOW.js} +3 -3
  56. package/dist/{chunk-U2S7OESF.js → chunk-QB2KMV6S.js} +56 -15
  57. package/dist/chunk-QB2KMV6S.js.map +1 -0
  58. package/dist/{chunk-QH46SOPJ.js → chunk-R67PDFKE.js} +54 -11
  59. package/dist/chunk-R67PDFKE.js.map +1 -0
  60. package/dist/chunk-RZSZQMSE.js +236 -0
  61. package/dist/chunk-RZSZQMSE.js.map +1 -0
  62. package/dist/{chunk-6MLXFFH4.js → chunk-TGT7J4EG.js} +3 -3
  63. package/dist/chunk-TGT7J4EG.js.map +1 -0
  64. package/dist/{chunk-S3EQO33M.js → chunk-UCHJCUYI.js} +6 -4
  65. package/dist/chunk-UCHJCUYI.js.map +1 -0
  66. package/dist/chunk-UHLRXI6J.js +453 -0
  67. package/dist/chunk-UHLRXI6J.js.map +1 -0
  68. package/dist/chunk-UNVL3CNM.js +725 -0
  69. package/dist/chunk-UNVL3CNM.js.map +1 -0
  70. package/dist/{chunk-2RBYVWZT.js → chunk-WDDWWCHN.js} +5 -3
  71. package/dist/chunk-WDDWWCHN.js.map +1 -0
  72. package/dist/chunk-WFKSOM6O.js +498 -0
  73. package/dist/chunk-WFKSOM6O.js.map +1 -0
  74. package/dist/{chunk-HWNY6U5F.js → chunk-XEJMFFIM.js} +4 -3
  75. package/dist/chunk-XEJMFFIM.js.map +1 -0
  76. package/dist/{chunk-ZDYTNFQI.js → chunk-XJXCTGDR.js} +16 -6
  77. package/dist/chunk-XJXCTGDR.js.map +1 -0
  78. package/dist/{chunk-G6UVYMA6.js → chunk-YD6IZ2C5.js} +2 -2
  79. package/dist/chunk-YK5QI57J.js +396 -0
  80. package/dist/chunk-YK5QI57J.js.map +1 -0
  81. package/dist/components/accordion.js +2 -2
  82. package/dist/components/alert.js +2 -2
  83. package/dist/components/app-ui.d.ts +421 -0
  84. package/dist/components/app-ui.js +27 -0
  85. package/dist/components/app-ui.js.map +1 -0
  86. package/dist/components/blocks.d.ts +2 -2
  87. package/dist/components/blocks.js +3 -3
  88. package/dist/components/button.d.ts +14 -0
  89. package/dist/components/button.js +3 -3
  90. package/dist/components/changelog.d.ts +386 -0
  91. package/dist/components/changelog.js +25 -0
  92. package/dist/components/changelog.js.map +1 -0
  93. package/dist/components/checkbox-group.js +3 -3
  94. package/dist/components/checkbox.js +3 -3
  95. package/dist/components/date-input.js +3 -3
  96. package/dist/components/dialog.js +2 -2
  97. package/dist/components/estimator.d.ts +246 -0
  98. package/dist/components/estimator.js +16 -0
  99. package/dist/components/estimator.js.map +1 -0
  100. package/dist/components/fieldset.js +2 -2
  101. package/dist/components/grid.d.ts +2 -2
  102. package/dist/components/grid.js +2 -2
  103. package/dist/components/help.js +2 -2
  104. package/dist/components/icon.d.ts +2 -0
  105. package/dist/components/icon.js +2 -2
  106. package/dist/components/journey.d.ts +433 -0
  107. package/dist/components/journey.js +22 -0
  108. package/dist/components/journey.js.map +1 -0
  109. package/dist/components/layout.d.ts +34 -5
  110. package/dist/components/layout.js +2 -2
  111. package/dist/components/link.js +3 -3
  112. package/dist/components/list.d.ts +50 -0
  113. package/dist/components/list.js +8 -0
  114. package/dist/components/list.js.map +1 -0
  115. package/dist/components/marketing.d.ts +119 -6
  116. package/dist/components/marketing.js +7 -3
  117. package/dist/components/media.d.ts +10 -0
  118. package/dist/components/media.js +2 -2
  119. package/dist/components/navigation.d.ts +25 -2
  120. package/dist/components/navigation.js +3 -3
  121. package/dist/components/organisms.d.ts +559 -0
  122. package/dist/components/organisms.js +25 -0
  123. package/dist/components/organisms.js.map +1 -0
  124. package/dist/components/page.d.ts +14 -3
  125. package/dist/components/page.js +2 -2
  126. package/dist/components/price.d.ts +6 -1
  127. package/dist/components/price.js +3 -2
  128. package/dist/components/progress.js +2 -2
  129. package/dist/components/property.d.ts +389 -0
  130. package/dist/components/property.js +20 -0
  131. package/dist/components/property.js.map +1 -0
  132. package/dist/components/radio-group.js +3 -3
  133. package/dist/components/scene.d.ts +138 -0
  134. package/dist/components/scene.js +8 -0
  135. package/dist/components/scene.js.map +1 -0
  136. package/dist/components/scrubber.d.ts +86 -0
  137. package/dist/components/scrubber.js +8 -0
  138. package/dist/components/scrubber.js.map +1 -0
  139. package/dist/components/select.js +3 -3
  140. package/dist/components/selling.d.ts +407 -0
  141. package/dist/components/selling.js +25 -0
  142. package/dist/components/selling.js.map +1 -0
  143. package/dist/components/site.d.ts +283 -0
  144. package/dist/components/site.js +20 -0
  145. package/dist/components/site.js.map +1 -0
  146. package/dist/components/summary-list.js +2 -2
  147. package/dist/components/table.js +2 -2
  148. package/dist/components/text-input.js +3 -3
  149. package/dist/components/textarea.d.ts +13 -0
  150. package/dist/components/textarea.js +3 -3
  151. package/dist/index.d.ts +13 -2
  152. package/dist/index.js +180 -47
  153. package/package.json +11 -4
  154. package/dist/chunk-2RBYVWZT.js.map +0 -1
  155. package/dist/chunk-3OSL2HMN.js.map +0 -1
  156. package/dist/chunk-4AJPS5AU.js.map +0 -1
  157. package/dist/chunk-4JKUAA6K.js.map +0 -1
  158. package/dist/chunk-57P4WO4Y.js.map +0 -1
  159. package/dist/chunk-5NUF7ZQA.js.map +0 -1
  160. package/dist/chunk-6GKI67P7.js.map +0 -1
  161. package/dist/chunk-6MLXFFH4.js.map +0 -1
  162. package/dist/chunk-6UDDZQDK.js.map +0 -1
  163. package/dist/chunk-AXQ5YBN2.js.map +0 -1
  164. package/dist/chunk-CFGLOYWW.js.map +0 -1
  165. package/dist/chunk-H6L3FSQY.js.map +0 -1
  166. package/dist/chunk-HWNY6U5F.js.map +0 -1
  167. package/dist/chunk-LLRJU7XE.js.map +0 -1
  168. package/dist/chunk-OFAVRPRK.js.map +0 -1
  169. package/dist/chunk-QELX47AP.js.map +0 -1
  170. package/dist/chunk-QH46SOPJ.js.map +0 -1
  171. package/dist/chunk-S3EQO33M.js.map +0 -1
  172. package/dist/chunk-TZD7IVVQ.js.map +0 -1
  173. package/dist/chunk-U2S7OESF.js.map +0 -1
  174. package/dist/chunk-ZDYTNFQI.js.map +0 -1
  175. /package/dist/{chunk-KWURASAB.js.map → chunk-26O27BQS.js.map} +0 -0
  176. /package/dist/{chunk-DR3SJ7ZV.js.map → chunk-3IQ73WNW.js.map} +0 -0
  177. /package/dist/{chunk-DI2CJ3MZ.js.map → chunk-7AJN2TIS.js.map} +0 -0
  178. /package/dist/{chunk-IBTOZOGI.js.map → chunk-7OXTZJR4.js.map} +0 -0
  179. /package/dist/{chunk-JPEWRJSQ.js.map → chunk-GQDUHZE3.js.map} +0 -0
  180. /package/dist/{chunk-5RVMMKMO.js.map → chunk-OMJMUFOW.js.map} +0 -0
  181. /package/dist/{chunk-G6UVYMA6.js.map → chunk-YD6IZ2C5.js.map} +0 -0
@@ -0,0 +1,553 @@
1
+ import {
2
+ pageLocale
3
+ } from "./chunk-3IGNZTJU.js";
4
+ import {
5
+ iconSvg
6
+ } from "./chunk-KFD4O7VA.js";
7
+ import {
8
+ FieldElement
9
+ } from "./chunk-7AJN2TIS.js";
10
+ import {
11
+ ImpktElement,
12
+ focusRing,
13
+ fontWeight,
14
+ say,
15
+ space,
16
+ spaceAround,
17
+ t,
18
+ targetSize,
19
+ type,
20
+ visuallyHidden
21
+ } from "./chunk-D6C7XEY4.js";
22
+
23
+ // packages/ui/src/components/app-ui.ts
24
+ import { css, html, nothing } from "lit";
25
+ var ImpktDrawer = class extends ImpktElement {
26
+ constructor() {
27
+ super();
28
+ this.hasFooter = false;
29
+ this.open = false;
30
+ this.heading = "";
31
+ this.side = "right";
32
+ this.closeLabel = "Close";
33
+ }
34
+ static {
35
+ this.properties = {
36
+ open: { type: Boolean, reflect: true },
37
+ heading: { type: String },
38
+ side: { type: String, reflect: true },
39
+ closeLabel: { type: String, attribute: "close-label" }
40
+ };
41
+ }
42
+ static {
43
+ this.styles = [...ImpktElement.styles, focusRing, css`
44
+ dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }
45
+ dialog[open] { display: flex; }
46
+ :host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
47
+ dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }
48
+ @keyframes from-right { from { transform: translateX(100%); } }
49
+ @keyframes from-left { from { transform: translateX(-100%); } }
50
+ .head { display: flex; align-items: center; justify-content: space-between; gap: ${space(3)}; padding: ${space(4)} ${space(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
51
+ h2 { margin: 0; font-family: ${t.fontHeading}; ${type("xl")} font-weight: ${fontWeight("bold")}; color: ${t.textHeading}; }
52
+ .close { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${t.text}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
53
+ .close:hover { background: ${t.surfaceSubtle}; }
54
+ .body { flex: 1; overflow: auto; padding: ${space(5)}; }
55
+ .foot { display: flex; gap: ${space(3)}; justify-content: flex-end; padding: ${space(4)} ${space(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
56
+ .foot[hidden] { display: none; }
57
+ `];
58
+ }
59
+ get dialog() {
60
+ return this.renderRoot.querySelector("dialog");
61
+ }
62
+ updated(changed) {
63
+ if (!changed.has("open")) return;
64
+ const dialog = this.dialog;
65
+ if (!dialog) return;
66
+ if (this.open) {
67
+ if (typeof dialog.showModal === "function") dialog.showModal();
68
+ else dialog.setAttribute("open", "");
69
+ } else if (typeof dialog.close === "function" && dialog.open) dialog.close();
70
+ else dialog.removeAttribute("open");
71
+ }
72
+ close() {
73
+ this.open = false;
74
+ this.dispatchEvent(new CustomEvent("impkt-close", { bubbles: true, composed: true }));
75
+ }
76
+ footerChanged(event) {
77
+ this.hasFooter = event.target.assignedNodes().length > 0;
78
+ this.requestUpdate();
79
+ }
80
+ render() {
81
+ return html`<dialog part="dialog" aria-labelledby=${this.heading ? this.id_("heading") : nothing}
82
+ @cancel=${() => this.close()}
83
+ @close=${() => {
84
+ if (this.open) this.close();
85
+ }}
86
+ @click=${(event) => {
87
+ if (event.target === this.dialog) this.close();
88
+ }}>
89
+ <div class="head">
90
+ ${this.heading ? html`<h2 id=${this.id_("heading")}>${this.heading}</h2>` : html`<span></span>`}
91
+ <button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg("close", "20px")}</button>
92
+ </div>
93
+ <div class="body" part="body"><slot></slot></div>
94
+ <div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
95
+ </dialog>`;
96
+ }
97
+ };
98
+ var TOAST_ICON = { neutral: "info", success: "check", warning: "warning", danger: "warning" };
99
+ var ImpktToast = class extends ImpktElement {
100
+ static {
101
+ this.properties = {
102
+ open: { type: Boolean, reflect: true },
103
+ message: { type: String },
104
+ tone: { type: String, reflect: true },
105
+ duration: { type: Number },
106
+ actionText: { type: String, attribute: "action-text" },
107
+ closeLabel: { type: String, attribute: "close-label" }
108
+ };
109
+ }
110
+ constructor() {
111
+ super();
112
+ this.open = false;
113
+ this.message = "";
114
+ this.tone = "neutral";
115
+ this.duration = 6;
116
+ this.actionText = "";
117
+ this.closeLabel = "Dismiss";
118
+ }
119
+ static {
120
+ this.styles = [...ImpktElement.styles, focusRing, css`
121
+ .region { position: fixed; inset-block-end: calc(${space(4)} + var(--impkt-bottom-bar, 0px)); inset-inline-end: ${space(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${space(8)})); }
122
+ .toast { display: flex; align-items: flex-start; gap: ${space(3)}; padding: ${space(3)} ${space(3)} ${space(3)} ${space(4)}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowXl}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }
123
+ @keyframes rise { from { opacity: 0; transform: translateY(${space(3)}); } }
124
+ .mark { display: inline-flex; flex: none; margin-block-start: ${space(0.5)}; color: ${t.info}; }
125
+ :host([tone='success']) .mark { color: ${t.success}; }
126
+ :host([tone='warning']) .mark { color: ${t.warning}; }
127
+ :host([tone='danger']) .mark { color: ${t.danger}; }
128
+ .message { flex: 1; align-self: center; margin: 0; ${type("sm")} font-weight: ${fontWeight("medium")}; }
129
+ .action, .close { ${targetSize} padding: 0 ${space(2)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
130
+ .close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }
131
+ .action:hover, .close:hover { background: ${t.surfaceSubtle}; }
132
+ `];
133
+ }
134
+ disconnectedCallback() {
135
+ super.disconnectedCallback();
136
+ this.stop();
137
+ }
138
+ updated(changed) {
139
+ if (changed.has("open") || changed.has("duration")) {
140
+ this.stop();
141
+ if (this.open) this.start();
142
+ }
143
+ }
144
+ start() {
145
+ if (this.duration > 0) this.timer = setTimeout(() => this.close(), this.duration * 1e3);
146
+ }
147
+ stop() {
148
+ if (this.timer) clearTimeout(this.timer);
149
+ this.timer = void 0;
150
+ }
151
+ close() {
152
+ this.stop();
153
+ if (!this.open) return;
154
+ this.open = false;
155
+ this.dispatchEvent(new CustomEvent("impkt-close", { bubbles: true, composed: true }));
156
+ }
157
+ action() {
158
+ this.dispatchEvent(new CustomEvent("impkt-action", { bubbles: true, composed: true }));
159
+ this.close();
160
+ }
161
+ render() {
162
+ return html`<div class="region" role="status" aria-live="polite">
163
+ ${this.open ? html`<div class="toast" part="toast" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}>
164
+ <span class="mark">${iconSvg(TOAST_ICON[this.tone] ?? "info", "20px")}</span>
165
+ <p class="message">${this.message}</p>
166
+ ${this.actionText ? html`<button class="action" type="button" @click=${this.action}>${this.actionText}</button>` : nothing}
167
+ <button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg("close", "16px")}</button>
168
+ </div>` : nothing}
169
+ </div>`;
170
+ }
171
+ };
172
+ var ImpktMenu = class extends ImpktElement {
173
+ constructor() {
174
+ super();
175
+ this.outside = (event) => {
176
+ if (!event.composedPath().includes(this)) this.toggle(false);
177
+ };
178
+ this.label = "Menu";
179
+ this.icon = "";
180
+ this.items = [];
181
+ this.edge = "start";
182
+ this.open = false;
183
+ }
184
+ static {
185
+ this.properties = {
186
+ label: { type: String },
187
+ icon: { type: String },
188
+ items: { type: Array },
189
+ edge: { type: String, reflect: true },
190
+ open: { type: Boolean, reflect: true }
191
+ };
192
+ }
193
+ static {
194
+ this.styles = [...ImpktElement.styles, focusRing, css`
195
+ :host { position: relative; display: inline-block; }
196
+ .trigger { ${targetSize} display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(2)} ${space(3.5)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; cursor: pointer; }
197
+ .trigger:hover { background: ${t.surfaceSubtle}; }
198
+ .chev { display: inline-flex; color: ${t.textMuted}; transition: transform 120ms ease-in-out; }
199
+ :host([open]) .chev { transform: rotate(180deg); }
200
+ .list { position: absolute; z-index: 100; inset-block-start: calc(100% + ${space(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(20rem, 90vw); margin: 0; padding: ${space(1.5)}; list-style: none; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowLg}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: pop 120ms ease-out; }
201
+ :host([edge='end']) .list { inset-inline: auto 0; }
202
+ @keyframes pop { from { opacity: 0; transform: translateY(-${space(1)}); } }
203
+ .item { ${targetSize} box-sizing: border-box; display: flex; align-items: center; gap: ${space(2.5)}; inline-size: 100%; padding: ${space(2)} ${space(2.5)}; font: inherit; ${type("sm")} text-align: start; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
204
+ .item:hover, .item:focus { background: ${t.surfaceSubtle}; }
205
+ .item.danger { color: ${t.dangerText}; }
206
+ .item svg { flex: none; }
207
+ `];
208
+ }
209
+ disconnectedCallback() {
210
+ super.disconnectedCallback();
211
+ document.removeEventListener("click", this.outside);
212
+ }
213
+ get entries() {
214
+ return Array.from(this.renderRoot.querySelectorAll(".item"));
215
+ }
216
+ get trigger() {
217
+ return this.renderRoot.querySelector(".trigger");
218
+ }
219
+ toggle(open, focus) {
220
+ this.open = open;
221
+ if (open) {
222
+ document.addEventListener("click", this.outside);
223
+ void this.updateComplete.then(() => this.entries[focus === "last" ? this.entries.length - 1 : 0]?.focus());
224
+ } else document.removeEventListener("click", this.outside);
225
+ }
226
+ triggerKey(event) {
227
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
228
+ event.preventDefault();
229
+ this.toggle(true, event.key === "ArrowUp" ? "last" : "first");
230
+ }
231
+ }
232
+ listKey(event) {
233
+ const entries = this.entries;
234
+ const at = entries.indexOf(this.renderRoot.activeElement);
235
+ const go = { ArrowDown: (at + 1) % entries.length, ArrowUp: (at - 1 + entries.length) % entries.length, Home: 0, End: entries.length - 1 };
236
+ if (event.key in go) {
237
+ event.preventDefault();
238
+ entries[go[event.key]]?.focus();
239
+ } else if (event.key === "Escape") {
240
+ event.preventDefault();
241
+ this.toggle(false);
242
+ this.trigger?.focus();
243
+ } else if (event.key === "Tab") this.toggle(false);
244
+ }
245
+ choose(item) {
246
+ this.toggle(false);
247
+ this.trigger?.focus();
248
+ if (!item.href) this.dispatchEvent(new CustomEvent("impkt-select", { detail: { value: item.value ?? item.text }, bubbles: true, composed: true }));
249
+ }
250
+ render() {
251
+ const inner = (item) => html`${iconSvg(item.icon, "18px")}<span>${item.text}</span>`;
252
+ return html`<button class="trigger" part="trigger" type="button" aria-haspopup="menu" aria-expanded=${String(this.open)} aria-controls=${this.id_("list")}
253
+ @click=${() => this.toggle(!this.open)} @keydown=${this.triggerKey}>${iconSvg(this.icon, "18px")}${this.label}<span class="chev">${iconSvg("chevron-down", "16px")}</span></button>
254
+ ${this.open ? html`<ul class="list" part="list" id=${this.id_("list")} role="menu" aria-label=${this.label} @keydown=${this.listKey}>
255
+ ${this.items.map((item) => html`<li role="none">${item.href ? html`<a class="item ${item.tone === "danger" ? "danger" : ""}" role="menuitem" tabindex="-1" href=${item.href} @click=${() => this.choose(item)}>${inner(item)}</a>` : html`<button class="item ${item.tone === "danger" ? "danger" : ""}" role="menuitem" tabindex="-1" type="button" @click=${() => this.choose(item)}>${inner(item)}</button>`}</li>`)}
256
+ </ul>` : nothing}`;
257
+ }
258
+ };
259
+ function pageWindow(page, pages) {
260
+ const wanted = [.../* @__PURE__ */ new Set([1, page - 1, page, page + 1, pages])].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);
261
+ return wanted.flatMap((n, i) => {
262
+ const previous = wanted[i - 1];
263
+ if (previous === void 0 || n === previous + 1) return [n];
264
+ return n === previous + 2 ? [previous + 1, n] : ["gap", n];
265
+ });
266
+ }
267
+ var ImpktPagination = class extends ImpktElement {
268
+ static {
269
+ this.properties = {
270
+ page: { type: Number },
271
+ pages: { type: Number },
272
+ hrefPattern: { type: String, attribute: "href-pattern" },
273
+ label: { type: String },
274
+ previousText: { type: String, attribute: "previous-text" },
275
+ nextText: { type: String, attribute: "next-text" }
276
+ };
277
+ }
278
+ constructor() {
279
+ super();
280
+ this.page = 1;
281
+ this.pages = 1;
282
+ this.hrefPattern = "";
283
+ this.label = "Pages";
284
+ this.previousText = "Previous";
285
+ this.nextText = "Next";
286
+ }
287
+ static {
288
+ this.styles = [...ImpktElement.styles, focusRing, css`
289
+ :host { display: block; container-type: inline-size; }
290
+ nav { display: flex; align-items: center; justify-content: space-between; gap: ${space(2)}; }
291
+ ul { display: flex; align-items: center; gap: ${space(1)}; margin: 0; padding: 0; list-style: none; }
292
+ .n, .step { ${targetSize} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${space(1.5)}; min-inline-size: 44px; padding: 0 ${space(2.5)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("medium")}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
293
+ .n:hover, .step:hover { background: ${t.surfaceSubtle}; }
294
+ .n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${fontWeight("semibold")}; }
295
+ .step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }
296
+ .gap { color: ${t.textMuted}; padding: 0 ${space(1)}; }
297
+ .count { display: none; ${type("sm")} color: ${t.textMuted}; }
298
+ @container (max-width: 34rem) { ul { display: none; } .count { display: block; } }
299
+ `];
300
+ }
301
+ go(page, event) {
302
+ if (this.hrefPattern) return;
303
+ event.preventDefault();
304
+ this.page = page;
305
+ this.dispatchEvent(new CustomEvent("impkt-page", { detail: { page }, bubbles: true, composed: true }));
306
+ }
307
+ link(page, classes, content, label, current) {
308
+ return this.hrefPattern ? html`<a class=${classes} href=${this.hrefPattern.replace("{page}", String(page))} aria-label=${label} aria-current=${current ? "page" : nothing}>${content}</a>` : html`<button class=${classes} type="button" aria-label=${label} aria-current=${current ? "page" : nothing} @click=${(e) => this.go(page, e)}>${content}</button>`;
309
+ }
310
+ step(to, words, icon, off) {
311
+ const content = icon === "arrow-left" ? html`${iconSvg(icon, "16px")}${words}` : html`${words}${iconSvg(icon, "16px")}`;
312
+ return off ? html`<span class="step" aria-disabled="true">${content}</span>` : this.link(to, "step", content, words, false);
313
+ }
314
+ render() {
315
+ const page = Math.min(Math.max(this.page, 1), Math.max(this.pages, 1));
316
+ return html`<nav aria-label=${this.label} part="nav">
317
+ ${this.step(page - 1, this.previousText, "arrow-left", page <= 1)}
318
+ <ul>${pageWindow(page, this.pages).map((n) => html`<li>${n === "gap" ? html`<span class="gap" aria-hidden="true">…</span>` : this.link(n, "n", n, say("Page {page}", { page: n }), n === page)}</li>`)}</ul>
319
+ <span class="count">${say("Page {page} of {pages}", { page, pages: this.pages })}</span>
320
+ ${this.step(page + 1, this.nextText, "arrow-right", page >= this.pages)}
321
+ </nav>`;
322
+ }
323
+ };
324
+ var initialsOf = (name) => {
325
+ const words = name.trim().split(/\s+/).filter(Boolean);
326
+ return ((words[0]?.[0] ?? "") + (words.length > 1 ? words[words.length - 1][0] : "")).toUpperCase();
327
+ };
328
+ var ImpktAvatar = class extends ImpktElement {
329
+ constructor() {
330
+ super();
331
+ this.failed = false;
332
+ this.fullName = "";
333
+ this.src = "";
334
+ this.size = "md";
335
+ }
336
+ static {
337
+ this.properties = {
338
+ fullName: { type: String, attribute: "full-name" },
339
+ src: { type: String },
340
+ size: { type: String, reflect: true }
341
+ };
342
+ }
343
+ static {
344
+ this.styles = [...ImpktElement.styles, css`
345
+ :host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }
346
+ :host([size='sm']) { --size: 32px; }
347
+ :host([size='lg']) { --size: 56px; }
348
+ :host([size='xl']) { --size: 80px; }
349
+ .face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${fontWeight("semibold")}; }
350
+ img { inline-size: 100%; block-size: 100%; object-fit: cover; }
351
+ `];
352
+ }
353
+ willUpdate(changed) {
354
+ if (changed.has("src")) this.failed = false;
355
+ }
356
+ render() {
357
+ if (this.src && !this.failed) {
358
+ return html`<div class="face"><img src=${this.src} alt=${this.fullName} @error=${() => {
359
+ this.failed = true;
360
+ this.requestUpdate();
361
+ }} /></div>`;
362
+ }
363
+ return html`<div class="face" role="img" aria-label=${this.fullName || say("Person")}>${initialsOf(this.fullName) || iconSvg("user", "55%")}</div>`;
364
+ }
365
+ };
366
+ var ImpktAvatarGroup = class extends ImpktElement {
367
+ static {
368
+ this.properties = {
369
+ items: { type: Array },
370
+ max: { type: Number },
371
+ size: { type: String, reflect: true },
372
+ moreLabel: { type: String, attribute: "more-label" }
373
+ };
374
+ }
375
+ constructor() {
376
+ super();
377
+ this.items = [];
378
+ this.max = 4;
379
+ this.size = "md";
380
+ this.moreLabel = "more people";
381
+ }
382
+ static {
383
+ this.styles = [...ImpktElement.styles, css`
384
+ ul { display: flex; margin: 0; padding: 0; list-style: none; }
385
+ li { margin-inline-start: -${space(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }
386
+ li:first-child { margin-inline-start: 0; }
387
+ .more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${type("xs")} line-height: 1; font-weight: ${fontWeight("semibold")}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }
388
+ :host([size='sm']) .more { inline-size: 32px; block-size: 32px; }
389
+ :host([size='lg']) .more { inline-size: 56px; block-size: 56px; }
390
+ .sr { ${visuallyHidden} }
391
+ `];
392
+ }
393
+ render() {
394
+ const shown = this.items.slice(0, this.max);
395
+ const rest = this.items.length - shown.length;
396
+ return html`<ul part="list">
397
+ ${shown.map((item) => html`<li><impkt-avatar full-name=${item.name} src=${item.src ?? ""} size=${this.size}></impkt-avatar></li>`)}
398
+ ${rest > 0 ? html`<li><span class="more"><span aria-hidden="true">+${rest}</span><span class="sr">${rest} ${this.moreLabel}</span></span></li>` : nothing}
399
+ </ul>`;
400
+ }
401
+ };
402
+ var ImpktEmptyState = class extends ImpktElement {
403
+ static {
404
+ this.properties = {
405
+ icon: { type: String },
406
+ heading: { type: String },
407
+ lead: { type: String },
408
+ framed: { type: Boolean, reflect: true },
409
+ headingLevel: { type: Number, attribute: "heading-level" },
410
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
411
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
412
+ };
413
+ }
414
+ constructor() {
415
+ super();
416
+ this.icon = "search";
417
+ this.heading = "";
418
+ this.lead = "";
419
+ this.framed = false;
420
+ this.headingLevel = 2;
421
+ this.spaceAbove = "none";
422
+ this.spaceBelow = "none";
423
+ }
424
+ static {
425
+ this.styles = [...ImpktElement.styles, spaceAround, css`
426
+ .wrap { display: flex; flex-direction: column; align-items: center; gap: ${space(2)}; padding: ${space(12)} ${space(6)}; text-align: center; }
427
+ :host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }
428
+ .mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${space(2)}; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; }
429
+ .h { margin: 0; font-family: ${t.fontHeading}; ${type("xl")} font-weight: ${fontWeight("bold")}; color: ${t.textHeading}; }
430
+ p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }
431
+ .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${space(3)}; margin-block-start: ${space(3)}; }
432
+ `];
433
+ }
434
+ render() {
435
+ return html`<div class="wrap" part="wrap">
436
+ <span class="mark">${iconSvg(this.icon, "26px")}</span>
437
+ ${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
438
+ ${this.lead ? html`<p>${this.lead}</p>` : nothing}
439
+ <div class="actions"><slot name="actions"></slot></div>
440
+ </div>`;
441
+ }
442
+ };
443
+ var timesOf = (day) => String(day?.times ?? "").split(",").map((time) => time.trim()).filter(Boolean);
444
+ function dayParts(date) {
445
+ const parsed = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
446
+ if (Number.isNaN(parsed.getTime())) return { weekday: "", day: date, month: "" };
447
+ const locale = pageLocale();
448
+ const part = (options) => new Intl.DateTimeFormat(locale, { timeZone: "UTC", ...options }).format(parsed);
449
+ return { weekday: part({ weekday: "short" }), day: part({ day: "numeric" }), month: part({ month: "short" }) };
450
+ }
451
+ var ImpktSlotPicker = class extends FieldElement {
452
+ constructor() {
453
+ super();
454
+ this.day = "";
455
+ this.days = [];
456
+ this.dayLabel = "Day";
457
+ this.timeLabel = "Time";
458
+ this.emptyText = "No times are available at the moment.";
459
+ }
460
+ static {
461
+ this.properties = {
462
+ ...FieldElement.properties,
463
+ days: { type: Array },
464
+ dayLabel: { type: String, attribute: "day-label" },
465
+ timeLabel: { type: String, attribute: "time-label" },
466
+ emptyText: { type: String, attribute: "empty-text" }
467
+ };
468
+ }
469
+ static {
470
+ this.styles = [...FieldElement.styles, css`
471
+ fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
472
+ legend { padding: 0; }
473
+ .row-label { ${type("sm")} color: ${t.textMuted}; margin-block: ${space(2)}; }
474
+ .days { display: flex; gap: ${space(2)}; overflow-x: auto; padding: ${space(1)}; margin: -${space(1)}; scrollbar-width: thin; }
475
+ .times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${space(2)}; }
476
+ label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusLg}; box-shadow: inset 0 0 0 1px ${t.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }
477
+ label:hover { background: ${t.surfaceSubtle}; }
478
+ label:has(input:checked) { color: ${t.onBrand}; background: ${t.brand}; box-shadow: none; }
479
+ label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }
480
+ input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
481
+ .day { flex: none; inline-size: 4.5rem; padding-block: ${space(2.5)}; }
482
+ .weekday, .month { ${type("xs")} }
483
+ .num { ${type("xl")} font-weight: ${fontWeight("semibold")}; }
484
+ .time { padding: ${space(2)}; ${type("sm")} font-weight: ${fontWeight("medium")}; }
485
+ .empty { margin: 0; color: ${t.textMuted}; }
486
+ :host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${t.danger}; }
487
+ `];
488
+ }
489
+ get currentDay() {
490
+ const wanted = this.day || this.value.split("T")[0];
491
+ return this.days.find((day) => day.date === wanted) ?? this.days[0];
492
+ }
493
+ chooseDay(date) {
494
+ this.day = date;
495
+ if (this.value && !this.value.startsWith(`${date}T`)) this.setFormValue("");
496
+ this.requestUpdate();
497
+ }
498
+ renderLabel() {
499
+ return html`<legend class="label" part="label">${this.label}${this.required ? html`<span class="required"> (${this.requiredText})</span>` : nothing}</legend>`;
500
+ }
501
+ renderControl() {
502
+ const current = this.currentDay;
503
+ if (!current) return html`<p class="empty">${this.emptyText}</p>`;
504
+ return html`
505
+ <div class="row-label" id=${this.id_("days")}>${this.dayLabel}</div>
506
+ <div class="days" part="days" role="radiogroup" aria-labelledby=${this.id_("days")}>
507
+ ${this.days.map((day) => {
508
+ const parts = dayParts(day.date);
509
+ return html`<label class="day"><input type="radio" name=${`${this.uid}-day`} .checked=${day.date === current.date} ?disabled=${this.disabled} @change=${() => this.chooseDay(day.date)} />
510
+ <span class="weekday">${parts.weekday}</span><span class="num">${parts.day}</span><span class="month">${parts.month}</span></label>`;
511
+ })}
512
+ </div>
513
+ <div class="row-label" id=${this.id_("times")}>${this.timeLabel}</div>
514
+ <div class="times" part="times" role="radiogroup" aria-labelledby=${this.id_("times")}>
515
+ ${timesOf(current).map((time, i) => {
516
+ const value = `${current.date}T${time}`;
517
+ return html`<label class="time"><input type="radio" name=${`${this.uid}-time`} .checked=${this.value === value} ?required=${this.required && i === 0} ?disabled=${this.disabled} @change=${() => this.setFormValue(value)} />${time}</label>`;
518
+ })}
519
+ </div>`;
520
+ }
521
+ render() {
522
+ return html`<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error ? "true" : nothing}>
523
+ ${this.renderLabel()}
524
+ ${this.description ? html`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>` : nothing}
525
+ ${this.renderControl()}
526
+ <div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error || nothing}</div>
527
+ </fieldset>`;
528
+ }
529
+ updated(changed) {
530
+ if (changed.has("error")) this.toggleAttribute("invalid", Boolean(this.error));
531
+ }
532
+ };
533
+ customElements.define("impkt-drawer", ImpktDrawer);
534
+ customElements.define("impkt-toast", ImpktToast);
535
+ customElements.define("impkt-menu", ImpktMenu);
536
+ customElements.define("impkt-pagination", ImpktPagination);
537
+ customElements.define("impkt-avatar", ImpktAvatar);
538
+ customElements.define("impkt-avatar-group", ImpktAvatarGroup);
539
+ customElements.define("impkt-empty-state", ImpktEmptyState);
540
+ customElements.define("impkt-slot-picker", ImpktSlotPicker);
541
+
542
+ export {
543
+ ImpktDrawer,
544
+ ImpktToast,
545
+ ImpktMenu,
546
+ pageWindow,
547
+ ImpktPagination,
548
+ ImpktAvatar,
549
+ ImpktAvatarGroup,
550
+ ImpktEmptyState,
551
+ ImpktSlotPicker
552
+ };
553
+ //# sourceMappingURL=chunk-HYPPG4NF.js.map