@kabobcompany/react 0.0.0-stage → 0.1.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 (141) hide show
  1. package/GUIDE.md +185 -0
  2. package/dist/components/Accordion/Accordion.d.ts +48 -0
  3. package/dist/components/Accordion/index.d.ts +2 -0
  4. package/dist/components/Alert/Alert.d.ts +23 -0
  5. package/dist/components/Alert/index.d.ts +2 -0
  6. package/dist/components/AppBar/AppBar.d.ts +22 -0
  7. package/dist/components/AppBar/index.d.ts +2 -0
  8. package/dist/components/ArrowButton/ArrowButton.d.ts +20 -0
  9. package/dist/components/ArrowButton/index.d.ts +2 -0
  10. package/dist/components/Avatar/Avatar.d.ts +38 -0
  11. package/dist/components/Avatar/index.d.ts +2 -0
  12. package/dist/components/Badge/Badge.d.ts +30 -0
  13. package/dist/components/Badge/index.d.ts +2 -0
  14. package/dist/components/Breadcrumb/Breadcrumb.d.ts +21 -0
  15. package/dist/components/Breadcrumb/index.d.ts +2 -0
  16. package/dist/components/Button/Button.d.ts +22 -0
  17. package/dist/components/Button/index.d.ts +2 -0
  18. package/dist/components/Calendar/Calendar.d.ts +37 -0
  19. package/dist/components/Calendar/index.d.ts +2 -0
  20. package/dist/components/Card/Card.d.ts +13 -0
  21. package/dist/components/Card/index.d.ts +2 -0
  22. package/dist/components/Carousel/Carousel.d.ts +47 -0
  23. package/dist/components/Carousel/index.d.ts +2 -0
  24. package/dist/components/Checkbox/Checkbox.d.ts +9 -0
  25. package/dist/components/Checkbox/index.d.ts +2 -0
  26. package/dist/components/ChoiceChips/ChoiceChips.d.ts +45 -0
  27. package/dist/components/ChoiceChips/index.d.ts +2 -0
  28. package/dist/components/Combobox/Combobox.d.ts +23 -0
  29. package/dist/components/Combobox/index.d.ts +2 -0
  30. package/dist/components/DataTable/DataTable.d.ts +70 -0
  31. package/dist/components/DataTable/index.d.ts +2 -0
  32. package/dist/components/DateRange/DateRange.d.ts +39 -0
  33. package/dist/components/DateRange/index.d.ts +2 -0
  34. package/dist/components/DescriptionList/DescriptionList.d.ts +12 -0
  35. package/dist/components/DescriptionList/index.d.ts +2 -0
  36. package/dist/components/Dialog/Dialog.d.ts +24 -0
  37. package/dist/components/Dialog/index.d.ts +2 -0
  38. package/dist/components/Drawer/Drawer.d.ts +28 -0
  39. package/dist/components/Drawer/index.d.ts +2 -0
  40. package/dist/components/Dropdown/Dropdown.d.ts +65 -0
  41. package/dist/components/Dropdown/index.d.ts +2 -0
  42. package/dist/components/Editor/Editor.d.ts +60 -0
  43. package/dist/components/Editor/index.d.ts +2 -0
  44. package/dist/components/EmptyState/EmptyState.d.ts +17 -0
  45. package/dist/components/EmptyState/index.d.ts +2 -0
  46. package/dist/components/FileUpload/FileUpload.d.ts +29 -0
  47. package/dist/components/FileUpload/index.d.ts +2 -0
  48. package/dist/components/Filter/Filter.d.ts +27 -0
  49. package/dist/components/Filter/index.d.ts +2 -0
  50. package/dist/components/Floating/Floating.d.ts +50 -0
  51. package/dist/components/Floating/index.d.ts +4 -0
  52. package/dist/components/FormSection/FormSection.d.ts +40 -0
  53. package/dist/components/FormSection/index.d.ts +2 -0
  54. package/dist/components/IconButton/IconButton.d.ts +17 -0
  55. package/dist/components/IconButton/index.d.ts +2 -0
  56. package/dist/components/Input/Input.d.ts +55 -0
  57. package/dist/components/Input/index.d.ts +2 -0
  58. package/dist/components/Kbd/Kbd.d.ts +18 -0
  59. package/dist/components/Kbd/index.d.ts +2 -0
  60. package/dist/components/LayoutPicker/LayoutPicker.d.ts +69 -0
  61. package/dist/components/LayoutPicker/index.d.ts +2 -0
  62. package/dist/components/List/List.d.ts +67 -0
  63. package/dist/components/List/index.d.ts +2 -0
  64. package/dist/components/Marquee/Marquee.d.ts +24 -0
  65. package/dist/components/Marquee/index.d.ts +2 -0
  66. package/dist/components/Media/Media.d.ts +19 -0
  67. package/dist/components/Media/index.d.ts +2 -0
  68. package/dist/components/Menu/Menu.d.ts +15 -0
  69. package/dist/components/Menu/index.d.ts +2 -0
  70. package/dist/components/NumberBoard/NumberBoard.d.ts +47 -0
  71. package/dist/components/NumberBoard/index.d.ts +2 -0
  72. package/dist/components/NumberStepper/NumberStepper.d.ts +36 -0
  73. package/dist/components/NumberStepper/index.d.ts +2 -0
  74. package/dist/components/OptionCard/OptionCard.d.ts +66 -0
  75. package/dist/components/OptionCard/index.d.ts +2 -0
  76. package/dist/components/PageHeader/PageHeader.d.ts +25 -0
  77. package/dist/components/PageHeader/index.d.ts +2 -0
  78. package/dist/components/Pagination/Pagination.d.ts +10 -0
  79. package/dist/components/Pagination/index.d.ts +2 -0
  80. package/dist/components/Popover/Popover.d.ts +8 -0
  81. package/dist/components/Popover/index.d.ts +2 -0
  82. package/dist/components/Progress/Progress.d.ts +24 -0
  83. package/dist/components/Progress/index.d.ts +2 -0
  84. package/dist/components/QueueItem/QueueItem.d.ts +55 -0
  85. package/dist/components/QueueItem/index.d.ts +2 -0
  86. package/dist/components/Radio/Radio.d.ts +6 -0
  87. package/dist/components/Radio/index.d.ts +2 -0
  88. package/dist/components/Resizable/Resizable.d.ts +40 -0
  89. package/dist/components/Resizable/index.d.ts +2 -0
  90. package/dist/components/Schedule/Schedule.d.ts +17 -0
  91. package/dist/components/Schedule/index.d.ts +2 -0
  92. package/dist/components/ScreenHeader/Clock.d.ts +21 -0
  93. package/dist/components/ScreenHeader/ScreenHeader.d.ts +21 -0
  94. package/dist/components/ScreenHeader/index.d.ts +4 -0
  95. package/dist/components/SegmentedControl/SegmentedControl.d.ts +17 -0
  96. package/dist/components/SegmentedControl/index.d.ts +2 -0
  97. package/dist/components/Select/Select.d.ts +10 -0
  98. package/dist/components/Select/index.d.ts +2 -0
  99. package/dist/components/Separator/Separator.d.ts +21 -0
  100. package/dist/components/Separator/index.d.ts +2 -0
  101. package/dist/components/SideRail/SideRail.d.ts +16 -0
  102. package/dist/components/SideRail/index.d.ts +2 -0
  103. package/dist/components/Slider/Slider.d.ts +52 -0
  104. package/dist/components/Slider/index.d.ts +2 -0
  105. package/dist/components/Spinner/Spinner.d.ts +29 -0
  106. package/dist/components/Spinner/index.d.ts +2 -0
  107. package/dist/components/StatBar/StatBar.d.ts +18 -0
  108. package/dist/components/StatBar/index.d.ts +2 -0
  109. package/dist/components/Stepper/Stepper.d.ts +16 -0
  110. package/dist/components/Stepper/index.d.ts +2 -0
  111. package/dist/components/Summary/Summary.d.ts +10 -0
  112. package/dist/components/Summary/index.d.ts +2 -0
  113. package/dist/components/Switch/Switch.d.ts +10 -0
  114. package/dist/components/Switch/index.d.ts +2 -0
  115. package/dist/components/Tabs/Tabs.d.ts +14 -0
  116. package/dist/components/Tabs/index.d.ts +2 -0
  117. package/dist/components/TagInput/TagInput.d.ts +27 -0
  118. package/dist/components/TagInput/index.d.ts +2 -0
  119. package/dist/components/TicketNumber/TicketNumber.d.ts +39 -0
  120. package/dist/components/TicketNumber/index.d.ts +2 -0
  121. package/dist/components/TileCard/TileCard.d.ts +49 -0
  122. package/dist/components/TileCard/index.d.ts +2 -0
  123. package/dist/components/TimeInput/TimeInput.d.ts +10 -0
  124. package/dist/components/TimeInput/index.d.ts +2 -0
  125. package/dist/components/Timeline/Timeline.d.ts +83 -0
  126. package/dist/components/Timeline/index.d.ts +2 -0
  127. package/dist/components/Toast/Toast.d.ts +11 -0
  128. package/dist/components/Toast/index.d.ts +2 -0
  129. package/dist/components/ToggleGroup/ToggleGroup.d.ts +72 -0
  130. package/dist/components/ToggleGroup/index.d.ts +2 -0
  131. package/dist/components/Tooltip/Tooltip.d.ts +21 -0
  132. package/dist/components/Tooltip/index.d.ts +2 -0
  133. package/dist/components/Tree/Tree.d.ts +18 -0
  134. package/dist/components/Tree/index.d.ts +2 -0
  135. package/dist/components/Typography/Typography.d.ts +54 -0
  136. package/dist/components/Typography/index.d.ts +2 -0
  137. package/dist/index.d.ts +67 -0
  138. package/dist/index.js +4935 -0
  139. package/dist/utils/floating.d.ts +29 -0
  140. package/package.json +39 -4
  141. package/README.md +0 -3
package/dist/index.js ADDED
@@ -0,0 +1,4935 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { Children as r, Fragment as i, cloneElement as a, createContext as o, isValidElement as s, useCallback as c, useContext as l, useEffect as u, useId as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
3
+ import { createPortal as g } from "react-dom";
4
+ //#region src/components/Button/Button.tsx
5
+ function _({ variant: e = "primary", size: r = "sm", rounded: i = !1, block: a = !1, icon: o, caret: s, type: c = "button", className: l, children: u, ...d }) {
6
+ let f = [
7
+ "kb-button",
8
+ `kb-button--${e}`,
9
+ `kb-button--${r}`,
10
+ i && "kb-button--rounded",
11
+ a && "kb-button--block",
12
+ l
13
+ ].filter(Boolean).join(" ");
14
+ return /* @__PURE__ */ n("button", {
15
+ type: c,
16
+ className: f,
17
+ ...d,
18
+ children: [
19
+ o ? /* @__PURE__ */ t("span", {
20
+ className: "kb-button__icon",
21
+ "aria-hidden": "true",
22
+ children: o
23
+ }) : null,
24
+ u,
25
+ s ? /* @__PURE__ */ t("span", {
26
+ className: "kb-button__caret",
27
+ "aria-hidden": "true"
28
+ }) : null
29
+ ]
30
+ });
31
+ }
32
+ //#endregion
33
+ //#region src/components/IconButton/IconButton.tsx
34
+ function v({ label: e, size: n = "md", round: r, filled: i, muted: a, pressed: o, type: s = "button", className: c, children: l, ...u }) {
35
+ let d = [
36
+ "kb-icon-button",
37
+ n === "sm" && "kb-icon-button--sm",
38
+ r && "kb-icon-button--round",
39
+ i && "kb-icon-button--filled",
40
+ a && "kb-icon-button--muted",
41
+ c
42
+ ].filter(Boolean).join(" ");
43
+ return /* @__PURE__ */ t("button", {
44
+ type: s,
45
+ className: d,
46
+ "aria-label": e,
47
+ "aria-pressed": o,
48
+ ...u,
49
+ children: l
50
+ });
51
+ }
52
+ //#endregion
53
+ //#region src/components/Checkbox/Checkbox.tsx
54
+ function y({ children: e, indeterminate: r = !1, className: i, ...a }) {
55
+ let o = m(null);
56
+ return u(() => {
57
+ o.current && (o.current.indeterminate = r);
58
+ }, [r]), /* @__PURE__ */ n("label", {
59
+ className: ["kb-checkbox", i].filter(Boolean).join(" "),
60
+ children: [
61
+ /* @__PURE__ */ t("input", {
62
+ ref: o,
63
+ type: "checkbox",
64
+ className: "kb-checkbox__input",
65
+ ...a
66
+ }),
67
+ /* @__PURE__ */ t("span", {
68
+ className: "kb-checkbox__box",
69
+ "aria-hidden": "true"
70
+ }),
71
+ e ? /* @__PURE__ */ t("span", {
72
+ className: "kb-checkbox__label",
73
+ children: e
74
+ }) : null
75
+ ]
76
+ });
77
+ }
78
+ //#endregion
79
+ //#region src/components/Radio/Radio.tsx
80
+ function b({ children: e, className: r, ...i }) {
81
+ return /* @__PURE__ */ n("label", {
82
+ className: ["kb-radio", r].filter(Boolean).join(" "),
83
+ children: [
84
+ /* @__PURE__ */ t("input", {
85
+ type: "radio",
86
+ className: "kb-radio__input",
87
+ ...i
88
+ }),
89
+ /* @__PURE__ */ t("span", {
90
+ className: "kb-radio__dot",
91
+ "aria-hidden": "true"
92
+ }),
93
+ e ? /* @__PURE__ */ t("span", {
94
+ className: "kb-radio__label",
95
+ children: e
96
+ }) : null
97
+ ]
98
+ });
99
+ }
100
+ //#endregion
101
+ //#region src/components/Switch/Switch.tsx
102
+ function x({ children: e, asLabel: r, extra: i, className: a, ...o }) {
103
+ return /* @__PURE__ */ n("label", {
104
+ className: [
105
+ "kb-switch",
106
+ r && "kb-switch--label",
107
+ a
108
+ ].filter(Boolean).join(" "),
109
+ children: [
110
+ /* @__PURE__ */ t("input", {
111
+ type: "checkbox",
112
+ role: "switch",
113
+ className: "kb-switch__input",
114
+ ...o
115
+ }),
116
+ /* @__PURE__ */ t("span", {
117
+ className: "kb-switch__track",
118
+ "aria-hidden": "true"
119
+ }),
120
+ e ? /* @__PURE__ */ t("span", {
121
+ className: "kb-switch__label",
122
+ children: e
123
+ }) : null,
124
+ i
125
+ ]
126
+ });
127
+ }
128
+ //#endregion
129
+ //#region src/components/Input/Input.tsx
130
+ function S({ label: e, hint: r, error: i, small: a, large: o, size: s, searchIcon: c, suffix: l, action: u, labelExtra: f, trailingIcon: p, id: m, className: h, ...g }) {
131
+ let _ = d(), v = m ?? _, y = [
132
+ "kb-input",
133
+ s ? `kb-input--${s}` : a ? "kb-input--sm" : o ? "kb-input--lg" : null,
134
+ c && "kb-input--search",
135
+ h
136
+ ].filter(Boolean).join(" "), b = /* @__PURE__ */ t("input", {
137
+ id: v,
138
+ className: y,
139
+ ...g
140
+ }), x = c || l || u || p ? /* @__PURE__ */ n("div", {
141
+ className: "kb-input-group",
142
+ children: [
143
+ c ? /* @__PURE__ */ t("span", {
144
+ className: "kb-input-group__icon",
145
+ "aria-hidden": "true",
146
+ children: c
147
+ }) : null,
148
+ b,
149
+ l ? /* @__PURE__ */ t("span", {
150
+ className: "kb-input-group__suffix",
151
+ children: l
152
+ }) : null,
153
+ p ? /* @__PURE__ */ t("span", {
154
+ className: "kb-input-group__trailing",
155
+ "aria-hidden": "true",
156
+ children: p
157
+ }) : null,
158
+ u ? /* @__PURE__ */ t("span", {
159
+ className: "kb-input-group__action",
160
+ children: u
161
+ }) : null
162
+ ]
163
+ }) : b;
164
+ return !e && !r ? x : /* @__PURE__ */ n("div", {
165
+ className: ["kb-field", i && "kb-field--error"].filter(Boolean).join(" "),
166
+ children: [
167
+ e ? /* @__PURE__ */ n("label", {
168
+ className: "kb-field__label",
169
+ htmlFor: v,
170
+ children: [e, f]
171
+ }) : null,
172
+ x,
173
+ r ? /* @__PURE__ */ t("p", {
174
+ className: "kb-field__hint",
175
+ children: r
176
+ }) : null
177
+ ]
178
+ });
179
+ }
180
+ function C({ className: e, children: n, ...r }) {
181
+ return /* @__PURE__ */ t("div", {
182
+ className: ["kb-form-grid", e].filter(Boolean).join(" "),
183
+ ...r,
184
+ children: n
185
+ });
186
+ }
187
+ C.Full = function({ className: e, children: n, ...r }) {
188
+ return /* @__PURE__ */ t("div", {
189
+ className: ["kb-form-grid__full", e].filter(Boolean).join(" "),
190
+ ...r,
191
+ children: n
192
+ });
193
+ };
194
+ function w({ label: e, children: r, className: i, ...a }) {
195
+ return /* @__PURE__ */ n("div", {
196
+ className: ["kb-field", i].filter(Boolean).join(" "),
197
+ ...a,
198
+ children: [/* @__PURE__ */ t("div", {
199
+ className: "kb-field__label-slot",
200
+ children: e
201
+ }), r]
202
+ });
203
+ }
204
+ function T({ label: e, hint: r, error: i, id: a, className: o, ...s }) {
205
+ let c = d(), l = a ?? c, u = /* @__PURE__ */ t("textarea", {
206
+ id: l,
207
+ className: ["kb-input", o].filter(Boolean).join(" "),
208
+ ...s
209
+ });
210
+ return !e && !r ? u : /* @__PURE__ */ n("div", {
211
+ className: ["kb-field", i && "kb-field--error"].filter(Boolean).join(" "),
212
+ children: [
213
+ e ? /* @__PURE__ */ t("label", {
214
+ className: "kb-field__label",
215
+ htmlFor: l,
216
+ children: e
217
+ }) : null,
218
+ u,
219
+ r ? /* @__PURE__ */ t("p", {
220
+ className: "kb-field__hint",
221
+ children: r
222
+ }) : null
223
+ ]
224
+ });
225
+ }
226
+ var E = () => /* @__PURE__ */ n("svg", {
227
+ viewBox: "0 0 16 16",
228
+ fill: "none",
229
+ stroke: "currentColor",
230
+ strokeWidth: "1.4",
231
+ strokeLinecap: "round",
232
+ children: [/* @__PURE__ */ t("rect", {
233
+ x: "2",
234
+ y: "3",
235
+ width: "12",
236
+ height: "11",
237
+ rx: "1.5"
238
+ }), /* @__PURE__ */ t("path", { d: "M2 6.5h12M5 1.5v3M11 1.5v3" })]
239
+ });
240
+ function D({ className: e, ...n }) {
241
+ return /* @__PURE__ */ t(S, {
242
+ type: "date",
243
+ trailingIcon: /* @__PURE__ */ t(E, {}),
244
+ className: ["kb-input--date", e].filter(Boolean).join(" "),
245
+ ...n
246
+ });
247
+ }
248
+ function O({ value: e, onChange: r, className: i, ...a }) {
249
+ let o = !e;
250
+ return /* @__PURE__ */ n("div", {
251
+ className: ["kb-color-input", i].filter(Boolean).join(" "),
252
+ children: [/* @__PURE__ */ t("span", {
253
+ className: ["kb-color-input__swatch", o && "kb-color-input__swatch--none"].filter(Boolean).join(" "),
254
+ style: o ? void 0 : { "--swatch": e },
255
+ "aria-hidden": "true"
256
+ }), /* @__PURE__ */ t(S, {
257
+ value: o ? "none" : e,
258
+ onChange: (e) => r?.(e.target.value === "none" ? "" : e.target.value),
259
+ spellCheck: !1,
260
+ ...a
261
+ })]
262
+ });
263
+ }
264
+ function k({ className: e, children: n, ...r }) {
265
+ return /* @__PURE__ */ t("div", {
266
+ className: ["kb-field-pair", e].filter(Boolean).join(" "),
267
+ ...r,
268
+ children: n
269
+ });
270
+ }
271
+ //#endregion
272
+ //#region src/components/Select/Select.tsx
273
+ function A({ small: e, size: r, label: i, id: a, className: o, children: s, ...c }) {
274
+ let l = d(), u = a ?? l, f = /* @__PURE__ */ t("div", {
275
+ className: [
276
+ "kb-select",
277
+ r ? `kb-select--${r}` : e && "kb-select--sm",
278
+ o
279
+ ].filter(Boolean).join(" "),
280
+ children: /* @__PURE__ */ t("select", {
281
+ id: u,
282
+ className: "kb-select__native",
283
+ ...c,
284
+ children: s
285
+ })
286
+ });
287
+ return i ? /* @__PURE__ */ n("div", {
288
+ className: "kb-field",
289
+ children: [/* @__PURE__ */ t("label", {
290
+ className: "kb-field__label",
291
+ htmlFor: u,
292
+ children: i
293
+ }), f]
294
+ }) : f;
295
+ }
296
+ //#endregion
297
+ //#region src/components/Tabs/Tabs.tsx
298
+ function j({ size: e = "md", className: n, children: r, ...i }) {
299
+ return /* @__PURE__ */ t("div", {
300
+ role: "tablist",
301
+ className: [
302
+ "kb-tabs",
303
+ e === "sm" && "kb-tabs--sm",
304
+ n
305
+ ].filter(Boolean).join(" "),
306
+ ...i,
307
+ children: r
308
+ });
309
+ }
310
+ function M({ active: e = !1, subtitle: r, type: i = "button", className: a, children: o, ...s }) {
311
+ let c = [
312
+ "kb-tab",
313
+ e && "kb-tab--active",
314
+ r && "kb-tab--stacked",
315
+ a
316
+ ].filter(Boolean).join(" ");
317
+ return /* @__PURE__ */ t("button", {
318
+ role: "tab",
319
+ "aria-selected": e,
320
+ type: i,
321
+ className: c,
322
+ ...s,
323
+ children: r ? /* @__PURE__ */ n("span", { children: [
324
+ /* @__PURE__ */ t("span", {
325
+ className: "kb-tab__title",
326
+ children: o
327
+ }),
328
+ /* @__PURE__ */ t("br", {}),
329
+ /* @__PURE__ */ t("span", {
330
+ className: "kb-tab__subtitle",
331
+ children: r
332
+ })
333
+ ] }) : o
334
+ });
335
+ }
336
+ //#endregion
337
+ //#region src/components/SegmentedControl/SegmentedControl.tsx
338
+ function N({ options: e, value: n, onChange: r, accent: i, block: a, className: o, ...s }) {
339
+ let c = [
340
+ "kb-segmented",
341
+ i && "kb-segmented--accent",
342
+ a && "kb-segmented--block",
343
+ o
344
+ ].filter(Boolean).join(" ");
345
+ return /* @__PURE__ */ t("div", {
346
+ role: "group",
347
+ className: c,
348
+ ...s,
349
+ children: e.map((e) => /* @__PURE__ */ t("button", {
350
+ type: "button",
351
+ className: ["kb-segmented__item", e.value === n && "kb-segmented__item--active"].filter(Boolean).join(" "),
352
+ "aria-pressed": e.value === n,
353
+ disabled: e.disabled,
354
+ onClick: () => r(e.value),
355
+ children: e.label
356
+ }, e.value))
357
+ });
358
+ }
359
+ //#endregion
360
+ //#region src/components/Badge/Badge.tsx
361
+ function P({ tone: e = "neutral", solid: r, icon: i, tag: a, small: o, className: s, children: c, ...l }) {
362
+ let u = [
363
+ "kb-badge",
364
+ r ? `kb-badge--solid kb-badge--${r}` : `kb-badge--${e}`,
365
+ a && "kb-badge--tag",
366
+ o && "kb-badge--sm",
367
+ s
368
+ ].filter(Boolean).join(" ");
369
+ return /* @__PURE__ */ n("span", {
370
+ className: u,
371
+ ...l,
372
+ children: [i ? /* @__PURE__ */ t("span", {
373
+ "aria-hidden": "true",
374
+ style: { display: "inline-flex" },
375
+ children: i
376
+ }) : null, c]
377
+ });
378
+ }
379
+ function F({ tone: e = "neutral", small: n, label: r, className: i, ...a }) {
380
+ return /* @__PURE__ */ t("span", {
381
+ className: [
382
+ "kb-dot",
383
+ e !== "neutral" && `kb-dot--${e}`,
384
+ n && "kb-dot--sm",
385
+ i
386
+ ].filter(Boolean).join(" "),
387
+ role: r ? "img" : void 0,
388
+ "aria-label": r,
389
+ ...a
390
+ });
391
+ }
392
+ function I({ level: e, max: n = 5, label: r = "Signal", className: i, ...a }) {
393
+ return /* @__PURE__ */ t("span", {
394
+ className: ["kb-signal", i].filter(Boolean).join(" "),
395
+ role: "img",
396
+ "aria-label": `${r} ${e} of ${n}`,
397
+ ...a,
398
+ children: Array.from({ length: n }, (n, r) => /* @__PURE__ */ t("span", { className: ["kb-signal__dot", r < e && "kb-signal__dot--on"].filter(Boolean).join(" ") }, r))
399
+ });
400
+ }
401
+ //#endregion
402
+ //#region src/components/Menu/Menu.tsx
403
+ function L({ arrow: e = "center", align: r = "center", className: i, children: a, ...o }) {
404
+ let s = [
405
+ "kb-menu",
406
+ e === "left" && "kb-menu--arrow-left",
407
+ e === "right" && "kb-menu--arrow-right",
408
+ r === "start" && "kb-menu--start",
409
+ i
410
+ ].filter(Boolean).join(" ");
411
+ return /* @__PURE__ */ n("div", {
412
+ role: "menu",
413
+ className: s,
414
+ ...o,
415
+ children: [e === "none" ? null : /* @__PURE__ */ t("span", {
416
+ className: "kb-menu__arrow",
417
+ "aria-hidden": "true"
418
+ }), a]
419
+ });
420
+ }
421
+ function R({ danger: e, type: n = "button", className: r, children: i, disabled: a, ...o }) {
422
+ return /* @__PURE__ */ t("button", {
423
+ role: "menuitem",
424
+ type: n,
425
+ className: [
426
+ "kb-menu__item",
427
+ e && "kb-menu__item--danger",
428
+ r
429
+ ].filter(Boolean).join(" "),
430
+ "aria-disabled": a || void 0,
431
+ disabled: a,
432
+ ...o,
433
+ children: i
434
+ });
435
+ }
436
+ function z() {
437
+ return /* @__PURE__ */ t("hr", { className: "kb-menu__divider" });
438
+ }
439
+ //#endregion
440
+ //#region src/components/Tooltip/Tooltip.tsx
441
+ function B({ content: e, children: r, placement: i = "top", open: o, className: s, ...c }) {
442
+ let l = d(), u = [
443
+ "kb-tooltip",
444
+ i === "bottom" && "kb-tooltip--bottom",
445
+ o && "kb-tooltip--open"
446
+ ].filter(Boolean).join(" ");
447
+ return /* @__PURE__ */ n("span", {
448
+ className: ["kb-tooltip-anchor", s].filter(Boolean).join(" "),
449
+ ...c,
450
+ children: [a(r, { "aria-describedby": l }), /* @__PURE__ */ t("span", {
451
+ role: "tooltip",
452
+ id: l,
453
+ className: u,
454
+ children: e
455
+ })]
456
+ });
457
+ }
458
+ function V({ content: e, label: n = "More info", className: r, ...i }) {
459
+ let a = /* @__PURE__ */ t("button", {
460
+ type: "button",
461
+ className: ["kb-info-icon", r].filter(Boolean).join(" "),
462
+ "aria-label": n,
463
+ ...i,
464
+ children: "i"
465
+ });
466
+ return e ? /* @__PURE__ */ t(B, {
467
+ content: e,
468
+ children: a
469
+ }) : a;
470
+ }
471
+ //#endregion
472
+ //#region src/components/Card/Card.tsx
473
+ function H({ variant: e = "muted", interactive: r, media: i, title: a, meta: o, className: s, children: c, ...l }) {
474
+ let u = [
475
+ "kb-card",
476
+ e !== "muted" && `kb-card--${e}`,
477
+ r && "kb-card--interactive",
478
+ s
479
+ ].filter(Boolean).join(" ");
480
+ return /* @__PURE__ */ n("div", {
481
+ className: u,
482
+ ...l,
483
+ children: [i ? /* @__PURE__ */ t("div", {
484
+ className: "kb-card__media",
485
+ children: i
486
+ }) : null, a || o || c ? /* @__PURE__ */ n("div", {
487
+ className: "kb-card__body",
488
+ children: [
489
+ a ? /* @__PURE__ */ t("p", {
490
+ className: "kb-card__title",
491
+ children: a
492
+ }) : null,
493
+ o ? /* @__PURE__ */ t("p", {
494
+ className: "kb-card__meta",
495
+ children: o
496
+ }) : null,
497
+ c
498
+ ]
499
+ }) : null]
500
+ });
501
+ }
502
+ //#endregion
503
+ //#region src/components/List/List.tsx
504
+ function U({ className: e, children: n, ...r }) {
505
+ return /* @__PURE__ */ t("div", {
506
+ className: ["kb-list", e].filter(Boolean).join(" "),
507
+ ...r,
508
+ children: n
509
+ });
510
+ }
511
+ function W({ className: e, children: n, ...r }) {
512
+ return /* @__PURE__ */ t("div", {
513
+ className: ["kb-list__header", e].filter(Boolean).join(" "),
514
+ ...r,
515
+ children: n
516
+ });
517
+ }
518
+ function G({ sortable: e, sort: n, width: r, grow: i, className: a, style: o, children: s, ...c }) {
519
+ return /* @__PURE__ */ t("span", {
520
+ className: [
521
+ "kb-list__col",
522
+ e && "kb-list__col--sortable",
523
+ a
524
+ ].filter(Boolean).join(" "),
525
+ "aria-sort": n,
526
+ style: {
527
+ ...r ? { flex: `0 0 ${r}px` } : i ? { flex: "1 1 0" } : {},
528
+ ...o
529
+ },
530
+ ...c,
531
+ children: s
532
+ });
533
+ }
534
+ function K({ status: e = "none", interactive: r, selected: i, thumb: a, thumbLarge: o, actions: s, tag: c, expandable: l, expanded: u, onToggle: d, className: f, children: p, ...m }) {
535
+ let h = [
536
+ "kb-list-row",
537
+ e !== "none" && `kb-list-row--${e}`,
538
+ r && "kb-list-row--interactive",
539
+ i && "kb-list-row--selected",
540
+ c && "kb-list-row--tagged",
541
+ f
542
+ ].filter(Boolean).join(" ");
543
+ return /* @__PURE__ */ n("div", {
544
+ className: h,
545
+ "aria-selected": i,
546
+ "aria-expanded": l ? !!u : void 0,
547
+ ...m,
548
+ children: [
549
+ /* @__PURE__ */ t("span", {
550
+ className: "kb-list-row__bar",
551
+ "aria-hidden": "true"
552
+ }),
553
+ c ? /* @__PURE__ */ t("span", {
554
+ className: "kb-list-row__tag",
555
+ children: c
556
+ }) : null,
557
+ a ? /* @__PURE__ */ t("span", {
558
+ className: ["kb-list-row__thumb", o && "kb-list-row__thumb--lg"].filter(Boolean).join(" "),
559
+ children: a
560
+ }) : null,
561
+ p,
562
+ s ? /* @__PURE__ */ t("div", {
563
+ className: "kb-list-row__actions",
564
+ children: s
565
+ }) : null,
566
+ l ? /* @__PURE__ */ t("button", {
567
+ type: "button",
568
+ className: "kb-icon-button kb-icon-button--muted kb-list-row__toggle",
569
+ "aria-label": u ? "Collapse" : "Expand",
570
+ onClick: (e) => {
571
+ e.stopPropagation(), d?.(!u);
572
+ },
573
+ children: /* @__PURE__ */ t("span", {
574
+ className: "kb-button__caret",
575
+ "aria-hidden": "true"
576
+ })
577
+ }) : null
578
+ ]
579
+ });
580
+ }
581
+ function ee({ className: e, children: n, ...r }) {
582
+ return /* @__PURE__ */ t("div", {
583
+ className: ["kb-list-detail", e].filter(Boolean).join(" "),
584
+ ...r,
585
+ children: n
586
+ });
587
+ }
588
+ function te({ columns: e, rows: r, className: i, ...a }) {
589
+ return /* @__PURE__ */ n("table", {
590
+ className: ["kb-subtable", i].filter(Boolean).join(" "),
591
+ ...a,
592
+ children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: e.map((e) => /* @__PURE__ */ t("th", {
593
+ style: e.width ? { width: e.width } : void 0,
594
+ children: e.label
595
+ }, e.key)) }) }), /* @__PURE__ */ t("tbody", { children: r.map((n) => /* @__PURE__ */ t("tr", { children: e.map((e) => /* @__PURE__ */ t("td", { children: n[e.key] }, e.key)) }, n.id)) })]
596
+ });
597
+ }
598
+ function q({ src: e, alt: r = "", action: i, onAction: a, className: o, ...s }) {
599
+ return /* @__PURE__ */ n("span", {
600
+ className: ["kb-thumb", o].filter(Boolean).join(" "),
601
+ ...s,
602
+ children: [/* @__PURE__ */ t("img", {
603
+ src: e,
604
+ alt: r
605
+ }), i ? /* @__PURE__ */ t("span", {
606
+ className: "kb-thumb__action",
607
+ children: /* @__PURE__ */ t("button", {
608
+ type: "button",
609
+ onClick: a,
610
+ children: i
611
+ })
612
+ }) : null]
613
+ });
614
+ }
615
+ function ne({ title: e, width: r, grow: i, className: a, style: o, children: s, ...c }) {
616
+ return /* @__PURE__ */ n("div", {
617
+ className: [
618
+ "kb-list-row__cell",
619
+ i && "kb-list-row__cell--grow",
620
+ a
621
+ ].filter(Boolean).join(" "),
622
+ style: {
623
+ ...r ? { flex: `0 0 ${r}px` } : {},
624
+ ...o
625
+ },
626
+ ...c,
627
+ children: [e ? /* @__PURE__ */ t("span", {
628
+ className: "kb-list-row__title",
629
+ children: e
630
+ }) : null, s]
631
+ });
632
+ }
633
+ //#endregion
634
+ //#region src/components/AppBar/AppBar.tsx
635
+ function re({ logo: r, wordmark: i, actions: a, tenant: o, editor: s, title: c, className: l, children: u, ...d }) {
636
+ let f = [
637
+ "kb-app-bar",
638
+ s && "kb-app-bar--editor",
639
+ l
640
+ ].filter(Boolean).join(" ");
641
+ return /* @__PURE__ */ t("header", {
642
+ className: f,
643
+ ...d,
644
+ children: s ? /* @__PURE__ */ n(e, { children: [
645
+ c ? /* @__PURE__ */ t("span", {
646
+ className: "kb-app-bar__title",
647
+ children: c
648
+ }) : null,
649
+ u,
650
+ a ? /* @__PURE__ */ t("div", {
651
+ className: "kb-app-bar__actions",
652
+ children: a
653
+ }) : null
654
+ ] }) : /* @__PURE__ */ n(e, { children: [
655
+ /* @__PURE__ */ n("div", {
656
+ className: "kb-app-bar__brand",
657
+ children: [r ? /* @__PURE__ */ t("span", {
658
+ className: "kb-app-bar__logo",
659
+ children: r
660
+ }) : null, i ? /* @__PURE__ */ t("span", {
661
+ className: "kb-app-bar__wordmark",
662
+ children: i
663
+ }) : null]
664
+ }),
665
+ u,
666
+ a ? /* @__PURE__ */ t("div", {
667
+ className: "kb-app-bar__actions",
668
+ children: a
669
+ }) : null,
670
+ o ? /* @__PURE__ */ t("div", {
671
+ className: "kb-app-bar__tenant",
672
+ children: /* @__PURE__ */ t("span", {
673
+ className: "kb-app-bar__tenant-tile",
674
+ children: o
675
+ })
676
+ }) : null
677
+ ] })
678
+ });
679
+ }
680
+ function ie({ icon: e, className: t, children: r, ...i }) {
681
+ return /* @__PURE__ */ n("span", {
682
+ className: ["kb-app-bar__chip", t].filter(Boolean).join(" "),
683
+ ...i,
684
+ children: [e, r]
685
+ });
686
+ }
687
+ //#endregion
688
+ //#region src/components/PageHeader/PageHeader.tsx
689
+ function J({ tabs: e, actions: r, title: i, onBack: a, className: o, children: s, ...c }) {
690
+ return /* @__PURE__ */ n("div", {
691
+ className: [
692
+ "kb-page-header",
693
+ i && "kb-page-header--back",
694
+ o
695
+ ].filter(Boolean).join(" "),
696
+ ...c,
697
+ children: [
698
+ i ? /* @__PURE__ */ n("button", {
699
+ type: "button",
700
+ className: "kb-page-header__back",
701
+ onClick: a,
702
+ children: [/* @__PURE__ */ t("svg", {
703
+ viewBox: "0 0 20 20",
704
+ fill: "none",
705
+ stroke: "currentColor",
706
+ strokeWidth: "1.6",
707
+ strokeLinecap: "round",
708
+ strokeLinejoin: "round",
709
+ children: /* @__PURE__ */ t("path", { d: "M16 10H4m0 0 5-5m-5 5 5 5" })
710
+ }), i]
711
+ }) : null,
712
+ e,
713
+ s,
714
+ r ? /* @__PURE__ */ t("div", {
715
+ className: "kb-page-header__actions",
716
+ children: r
717
+ }) : null
718
+ ]
719
+ });
720
+ }
721
+ function ae({ title: e, count: r, action: i, className: a, ...o }) {
722
+ return /* @__PURE__ */ n("div", {
723
+ className: ["kb-page-title", a].filter(Boolean).join(" "),
724
+ ...o,
725
+ children: [/* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("h2", {
726
+ className: "kb-page-title__heading",
727
+ children: e
728
+ }), r ? /* @__PURE__ */ t("span", {
729
+ className: "kb-page-title__count",
730
+ children: r
731
+ }) : null] }), i]
732
+ });
733
+ }
734
+ function oe({ className: e, children: n, ...r }) {
735
+ return /* @__PURE__ */ t("div", {
736
+ className: ["kb-toolbar", e].filter(Boolean).join(" "),
737
+ ...r,
738
+ children: n
739
+ });
740
+ }
741
+ //#endregion
742
+ //#region src/components/SideRail/SideRail.tsx
743
+ function se({ className: e, children: n, ...r }) {
744
+ return /* @__PURE__ */ t("nav", {
745
+ className: ["kb-rail", e].filter(Boolean).join(" "),
746
+ ...r,
747
+ children: n
748
+ });
749
+ }
750
+ function ce({ label: e, active: n, bottom: r, dot: i, className: a, children: o, ...s }) {
751
+ let c = [
752
+ "kb-rail__item",
753
+ n && "kb-rail__item--active",
754
+ r && "kb-rail__item--bottom",
755
+ i && "kb-rail__item--dot",
756
+ a
757
+ ].filter(Boolean).join(" ");
758
+ return /* @__PURE__ */ t("a", {
759
+ className: c,
760
+ "aria-label": e,
761
+ title: e,
762
+ "aria-current": n ? "page" : void 0,
763
+ ...s,
764
+ children: o
765
+ });
766
+ }
767
+ //#endregion
768
+ //#region src/components/Tree/Tree.tsx
769
+ function le({ className: e, children: n, ...r }) {
770
+ return /* @__PURE__ */ t("nav", {
771
+ className: ["kb-tree", e].filter(Boolean).join(" "),
772
+ ...r,
773
+ children: n
774
+ });
775
+ }
776
+ function ue({ depth: e = 0, active: r, expanded: i, root: a, icon: o, trailing: s, className: c, style: l, children: u, ...d }) {
777
+ let f = [
778
+ "kb-tree__item",
779
+ r && "kb-tree__item--active",
780
+ a && "kb-tree__item--root",
781
+ c
782
+ ].filter(Boolean).join(" ");
783
+ return /* @__PURE__ */ n("div", {
784
+ className: f,
785
+ style: {
786
+ "--depth": e,
787
+ ...l
788
+ },
789
+ "aria-expanded": i,
790
+ "aria-current": r ? "true" : void 0,
791
+ ...d,
792
+ children: [
793
+ i === void 0 ? null : /* @__PURE__ */ t("span", {
794
+ className: "kb-tree__chevron",
795
+ "aria-hidden": "true"
796
+ }),
797
+ o ? /* @__PURE__ */ t("span", {
798
+ className: "kb-tree__icon",
799
+ children: o
800
+ }) : null,
801
+ /* @__PURE__ */ t("span", {
802
+ className: "kb-tree__label",
803
+ children: u
804
+ }),
805
+ s ? /* @__PURE__ */ t("span", {
806
+ className: "kb-tree__trailing",
807
+ children: s
808
+ }) : null
809
+ ]
810
+ });
811
+ }
812
+ //#endregion
813
+ //#region src/components/StatBar/StatBar.tsx
814
+ function de({ summary: e, className: r, children: i, ...a }) {
815
+ return /* @__PURE__ */ n("div", {
816
+ className: ["kb-stat-bar", r].filter(Boolean).join(" "),
817
+ ...a,
818
+ children: [e ? /* @__PURE__ */ t("div", {
819
+ className: "kb-stat-bar__summary",
820
+ children: e
821
+ }) : null, i ? /* @__PURE__ */ t("div", {
822
+ className: "kb-stat-bar__stats",
823
+ children: i
824
+ }) : null]
825
+ });
826
+ }
827
+ function fe({ children: e }) {
828
+ return /* @__PURE__ */ t("span", {
829
+ className: "kb-stat-bar__label",
830
+ children: e
831
+ });
832
+ }
833
+ function pe({ tone: e = "neutral", icon: r, label: i, className: a, children: o, ...s }) {
834
+ return /* @__PURE__ */ n("span", {
835
+ className: [
836
+ "kb-stat",
837
+ `kb-stat--${e}`,
838
+ a
839
+ ].filter(Boolean).join(" "),
840
+ title: i,
841
+ ...s,
842
+ children: [
843
+ /* @__PURE__ */ t("span", {
844
+ className: "kb-stat__icon",
845
+ "aria-hidden": "true",
846
+ children: r
847
+ }),
848
+ /* @__PURE__ */ t("span", {
849
+ className: "kb-sr-only",
850
+ children: i
851
+ }),
852
+ o
853
+ ]
854
+ });
855
+ }
856
+ //#endregion
857
+ //#region src/components/Dialog/Dialog.tsx
858
+ function me({ open: e, onClose: r, title: i, footer: a, footerStart: o, small: s, large: c, centered: l, hideClose: f, closeLabel: p = "Close", className: m, children: h, ...g }) {
859
+ let _ = d();
860
+ return u(() => {
861
+ if (!e) return;
862
+ let t = (e) => e.key === "Escape" && r();
863
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
864
+ }, [e, r]), e ? /* @__PURE__ */ t("div", {
865
+ className: ["kb-dialog-backdrop", l && "kb-dialog-backdrop--centered"].filter(Boolean).join(" "),
866
+ onMouseDown: (e) => e.target === e.currentTarget && r(),
867
+ children: /* @__PURE__ */ n("div", {
868
+ role: "dialog",
869
+ "aria-modal": "true",
870
+ "aria-labelledby": i ? _ : void 0,
871
+ className: [
872
+ "kb-dialog",
873
+ s && "kb-dialog--sm",
874
+ c && "kb-dialog--lg",
875
+ m
876
+ ].filter(Boolean).join(" "),
877
+ ...g,
878
+ children: [
879
+ f ? null : /* @__PURE__ */ t("button", {
880
+ type: "button",
881
+ className: "kb-dialog__close",
882
+ "aria-label": p,
883
+ onClick: r,
884
+ children: /* @__PURE__ */ t("svg", {
885
+ viewBox: "0 0 20 20",
886
+ fill: "none",
887
+ stroke: "currentColor",
888
+ strokeWidth: "2",
889
+ strokeLinecap: "round",
890
+ children: /* @__PURE__ */ t("path", { d: "M4 4l12 12M16 4L4 16" })
891
+ })
892
+ }),
893
+ i ? /* @__PURE__ */ t("div", {
894
+ className: "kb-dialog__header",
895
+ children: /* @__PURE__ */ t("h2", {
896
+ className: "kb-dialog__title",
897
+ id: _,
898
+ children: i
899
+ })
900
+ }) : null,
901
+ /* @__PURE__ */ t("div", {
902
+ className: "kb-dialog__body",
903
+ children: h
904
+ }),
905
+ a || o ? /* @__PURE__ */ n("div", {
906
+ className: "kb-dialog__footer",
907
+ children: [o ? /* @__PURE__ */ t("div", {
908
+ className: "kb-dialog__footer-start",
909
+ children: o
910
+ }) : null, a]
911
+ }) : null
912
+ ]
913
+ })
914
+ }) : null;
915
+ }
916
+ //#endregion
917
+ //#region src/components/Summary/Summary.tsx
918
+ function he({ items: e, className: r, ...i }) {
919
+ return /* @__PURE__ */ t("dl", {
920
+ className: ["kb-summary", r].filter(Boolean).join(" "),
921
+ ...i,
922
+ children: e.map((e, r) => /* @__PURE__ */ n("div", {
923
+ className: "kb-summary__item",
924
+ children: [/* @__PURE__ */ t("dt", {
925
+ className: "kb-summary__label",
926
+ children: e.label
927
+ }), /* @__PURE__ */ t("dd", {
928
+ className: "kb-summary__value",
929
+ children: e.value
930
+ })]
931
+ }, r))
932
+ });
933
+ }
934
+ //#endregion
935
+ //#region src/components/Popover/Popover.tsx
936
+ function ge({ className: e, children: n, ...r }) {
937
+ return /* @__PURE__ */ t("div", {
938
+ className: ["kb-popover", e].filter(Boolean).join(" "),
939
+ ...r,
940
+ children: n
941
+ });
942
+ }
943
+ function _e({ className: e, children: n, ...r }) {
944
+ return /* @__PURE__ */ t("div", {
945
+ className: ["kb-popover__columns", e].filter(Boolean).join(" "),
946
+ ...r,
947
+ children: n
948
+ });
949
+ }
950
+ function ve({ className: e, children: n, ...r }) {
951
+ return /* @__PURE__ */ t("div", {
952
+ className: ["kb-popover__column", e].filter(Boolean).join(" "),
953
+ ...r,
954
+ children: n
955
+ });
956
+ }
957
+ function ye({ className: e, children: n, ...r }) {
958
+ return /* @__PURE__ */ t("div", {
959
+ className: ["kb-popover__footer", e].filter(Boolean).join(" "),
960
+ ...r,
961
+ children: n
962
+ });
963
+ }
964
+ //#endregion
965
+ //#region src/components/Filter/Filter.tsx
966
+ function be({ title: e, className: r, children: i, ...a }) {
967
+ return /* @__PURE__ */ n("div", {
968
+ className: ["kb-filter-group", r].filter(Boolean).join(" "),
969
+ ...a,
970
+ children: [/* @__PURE__ */ t("div", {
971
+ className: "kb-filter-group__title",
972
+ children: e
973
+ }), i]
974
+ });
975
+ }
976
+ function xe({ count: e, className: r, children: i, ...a }) {
977
+ return /* @__PURE__ */ n("div", {
978
+ className: ["kb-filter-option", r].filter(Boolean).join(" "),
979
+ children: [/* @__PURE__ */ t(y, {
980
+ ...a,
981
+ children: i
982
+ }), e === void 0 ? null : /* @__PURE__ */ t("span", {
983
+ className: "kb-filter-option__count",
984
+ children: e
985
+ })]
986
+ });
987
+ }
988
+ function Se({ title: e, open: r, defaultOpen: i = !1, onToggle: a, className: o, children: s, ...c }) {
989
+ let [l, u] = h(i), d = r ?? l, f = (e) => {
990
+ r === void 0 && u(e), a?.(e);
991
+ };
992
+ return /* @__PURE__ */ n("div", {
993
+ className: ["kb-filter-section", o].filter(Boolean).join(" "),
994
+ "data-open": d,
995
+ ...c,
996
+ children: [/* @__PURE__ */ t(y, {
997
+ className: "kb-filter-section__header",
998
+ checked: d,
999
+ onChange: (e) => f(e.target.checked),
1000
+ children: e
1001
+ }), /* @__PURE__ */ t("div", {
1002
+ className: "kb-filter-section__panel",
1003
+ hidden: !d,
1004
+ children: s
1005
+ })]
1006
+ });
1007
+ }
1008
+ //#endregion
1009
+ //#region src/components/Pagination/Pagination.tsx
1010
+ var Ce = ({ dir: e }) => /* @__PURE__ */ n("svg", {
1011
+ viewBox: "0 0 10 10",
1012
+ fill: "none",
1013
+ stroke: "currentColor",
1014
+ strokeWidth: "1.4",
1015
+ strokeLinecap: "round",
1016
+ strokeLinejoin: "round",
1017
+ children: [
1018
+ e === "l" && /* @__PURE__ */ t("path", { d: "m6.5 2-3 3 3 3" }),
1019
+ e === "r" && /* @__PURE__ */ t("path", { d: "m3.5 2 3 3-3 3" }),
1020
+ e === "first" && /* @__PURE__ */ t("path", { d: "m7 2-3 3 3 3M2.5 2v6" }),
1021
+ e === "last" && /* @__PURE__ */ t("path", { d: "m3 2 3 3-3 3M7.5 2v6" })
1022
+ ]
1023
+ });
1024
+ function we({ page: e, pageCount: r, onChange: i, siblings: a = 1, className: o, ...s }) {
1025
+ let c = [], l = Math.max(1, Math.min(e - a, r - a * 2)), u = Math.min(r, l + a * 2);
1026
+ for (let e = l; e <= u; e++) c.push(e);
1027
+ let d = (e) => () => i(Math.min(r, Math.max(1, e)));
1028
+ return /* @__PURE__ */ n("nav", {
1029
+ className: ["kb-pagination", o].filter(Boolean).join(" "),
1030
+ "aria-label": "Pagination",
1031
+ ...s,
1032
+ children: [
1033
+ /* @__PURE__ */ t("button", {
1034
+ type: "button",
1035
+ className: "kb-pagination__nav",
1036
+ "aria-label": "First page",
1037
+ disabled: e <= 1,
1038
+ onClick: d(1),
1039
+ children: /* @__PURE__ */ t(Ce, { dir: "first" })
1040
+ }),
1041
+ /* @__PURE__ */ t("button", {
1042
+ type: "button",
1043
+ className: "kb-pagination__nav",
1044
+ "aria-label": "Previous page",
1045
+ disabled: e <= 1,
1046
+ onClick: d(e - 1),
1047
+ children: /* @__PURE__ */ t(Ce, { dir: "l" })
1048
+ }),
1049
+ l > 1 ? /* @__PURE__ */ t("span", {
1050
+ className: "kb-pagination__ellipsis",
1051
+ children: "…"
1052
+ }) : null,
1053
+ c.map((n) => /* @__PURE__ */ t("button", {
1054
+ type: "button",
1055
+ className: "kb-pagination__page",
1056
+ "aria-current": n === e ? "page" : void 0,
1057
+ onClick: d(n),
1058
+ children: n
1059
+ }, n)),
1060
+ u < r ? /* @__PURE__ */ t("span", {
1061
+ className: "kb-pagination__ellipsis",
1062
+ children: "…"
1063
+ }) : null,
1064
+ /* @__PURE__ */ t("button", {
1065
+ type: "button",
1066
+ className: "kb-pagination__nav",
1067
+ "aria-label": "Next page",
1068
+ disabled: e >= r,
1069
+ onClick: d(e + 1),
1070
+ children: /* @__PURE__ */ t(Ce, { dir: "r" })
1071
+ }),
1072
+ /* @__PURE__ */ t("button", {
1073
+ type: "button",
1074
+ className: "kb-pagination__nav",
1075
+ "aria-label": "Last page",
1076
+ disabled: e >= r,
1077
+ onClick: d(r),
1078
+ children: /* @__PURE__ */ t(Ce, { dir: "last" })
1079
+ })
1080
+ ]
1081
+ });
1082
+ }
1083
+ //#endregion
1084
+ //#region src/components/Toast/Toast.tsx
1085
+ function Te({ tone: e = "neutral", onClose: r, className: i, children: a, ...o }) {
1086
+ return /* @__PURE__ */ n("div", {
1087
+ role: "status",
1088
+ className: [
1089
+ "kb-toast",
1090
+ e !== "neutral" && `kb-toast--${e}`,
1091
+ i
1092
+ ].filter(Boolean).join(" "),
1093
+ ...o,
1094
+ children: [/* @__PURE__ */ t("span", { children: a }), r ? /* @__PURE__ */ t("button", {
1095
+ type: "button",
1096
+ className: "kb-toast__close",
1097
+ "aria-label": "Dismiss",
1098
+ onClick: r,
1099
+ children: /* @__PURE__ */ t("svg", {
1100
+ viewBox: "0 0 8 8",
1101
+ fill: "none",
1102
+ stroke: "currentColor",
1103
+ strokeWidth: "1.4",
1104
+ strokeLinecap: "round",
1105
+ children: /* @__PURE__ */ t("path", { d: "M1 1l6 6M7 1 1 7" })
1106
+ })
1107
+ }) : null]
1108
+ });
1109
+ }
1110
+ function Ee({ className: e, children: n, ...r }) {
1111
+ return /* @__PURE__ */ t("div", {
1112
+ className: ["kb-toast-region", e].filter(Boolean).join(" "),
1113
+ "aria-live": "polite",
1114
+ ...r,
1115
+ children: n
1116
+ });
1117
+ }
1118
+ //#endregion
1119
+ //#region src/components/Calendar/Calendar.tsx
1120
+ var De = (e) => e.toISOString().slice(0, 10), Oe = (e, t) => new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate() + t));
1121
+ function ke({ month: r, events: i = [], selected: a, today: o, onSelect: s, onEventClick: c, maxVisible: l = 2, weekdayLabels: u = [
1122
+ "SUN",
1123
+ "MON",
1124
+ "TUE",
1125
+ "WED",
1126
+ "THU",
1127
+ "FRI",
1128
+ "SAT"
1129
+ ], title: d, className: f, ...p }) {
1130
+ let m = /* @__PURE__ */ new Date(r + "T00:00:00Z"), h = Oe(m, -m.getUTCDay()), g = Array.from({ length: 42 }, (e, t) => Oe(h, t)), _ = m.toLocaleString("en-US", {
1131
+ month: "long",
1132
+ timeZone: "UTC"
1133
+ });
1134
+ return /* @__PURE__ */ n("div", {
1135
+ className: ["kb-calendar", f].filter(Boolean).join(" "),
1136
+ ...p,
1137
+ children: [
1138
+ /* @__PURE__ */ t("div", {
1139
+ className: "kb-calendar__header",
1140
+ children: /* @__PURE__ */ t("span", {
1141
+ className: "kb-calendar__title",
1142
+ children: d ?? /* @__PURE__ */ n(e, { children: [
1143
+ m.getUTCFullYear(),
1144
+ " ",
1145
+ _,
1146
+ /* @__PURE__ */ t("span", {
1147
+ className: "kb-button__caret",
1148
+ "aria-hidden": "true"
1149
+ })
1150
+ ] })
1151
+ })
1152
+ }),
1153
+ /* @__PURE__ */ t("div", {
1154
+ className: "kb-calendar__weekdays",
1155
+ children: u.map((e) => /* @__PURE__ */ t("div", {
1156
+ className: "kb-calendar__weekday",
1157
+ children: e
1158
+ }, e))
1159
+ }),
1160
+ /* @__PURE__ */ t("div", {
1161
+ className: "kb-calendar__grid",
1162
+ role: "grid",
1163
+ children: g.map((e) => {
1164
+ let r = De(e), u = e.getUTCMonth() !== m.getUTCMonth(), d = i.filter((e) => e.start <= r && e.end >= r), f = d.slice(0, l), p = d.length - f.length, h = [
1165
+ "kb-calendar__cell",
1166
+ u && "kb-calendar__cell--outside",
1167
+ r === o && "kb-calendar__cell--today",
1168
+ r === a && "kb-calendar__cell--selected"
1169
+ ].filter(Boolean).join(" ");
1170
+ return /* @__PURE__ */ n("div", {
1171
+ role: "gridcell",
1172
+ className: h,
1173
+ onClick: () => s?.(r),
1174
+ "aria-selected": r === a,
1175
+ children: [/* @__PURE__ */ t("span", {
1176
+ className: "kb-calendar__day",
1177
+ children: e.getUTCDate()
1178
+ }), /* @__PURE__ */ n("div", {
1179
+ className: "kb-calendar__events",
1180
+ children: [f.map((n) => {
1181
+ let i = n.start === r || e.getUTCDay() === 0, a = n.end === r || e.getUTCDay() === 6, o = n.start === r || e.getUTCDay() === 0;
1182
+ return /* @__PURE__ */ t("span", {
1183
+ className: [
1184
+ "kb-calendar__event",
1185
+ i && "kb-calendar__event--start",
1186
+ a && "kb-calendar__event--end",
1187
+ !o && "kb-calendar__event--continues"
1188
+ ].filter(Boolean).join(" "),
1189
+ title: n.title,
1190
+ onClick: (e) => {
1191
+ e.stopPropagation(), c?.(n);
1192
+ },
1193
+ children: n.title
1194
+ }, n.id);
1195
+ }), p > 0 ? /* @__PURE__ */ n("button", {
1196
+ type: "button",
1197
+ className: "kb-calendar__more",
1198
+ onClick: (e) => {
1199
+ e.stopPropagation(), s?.(r);
1200
+ },
1201
+ children: [p, " more"]
1202
+ }) : null]
1203
+ })]
1204
+ }, r);
1205
+ })
1206
+ })
1207
+ ]
1208
+ });
1209
+ }
1210
+ function Ae({ index: e, title: r, duration: i, range: a, actionLabel: o = "展開", onAction: s, className: c, ...l }) {
1211
+ return /* @__PURE__ */ n("div", {
1212
+ className: ["kb-event-card", c].filter(Boolean).join(" "),
1213
+ ...l,
1214
+ children: [
1215
+ /* @__PURE__ */ t("span", {
1216
+ className: "kb-event-card__index",
1217
+ children: e
1218
+ }),
1219
+ /* @__PURE__ */ t("span", {
1220
+ className: "kb-event-card__title",
1221
+ children: r
1222
+ }),
1223
+ /* @__PURE__ */ t("span", {}),
1224
+ /* @__PURE__ */ n("div", {
1225
+ className: "kb-event-card__meta",
1226
+ children: [i ? /* @__PURE__ */ n("span", { children: ["total duration ", /* @__PURE__ */ t("b", { children: i })] }) : null, a ? /* @__PURE__ */ t("span", { children: a }) : null]
1227
+ }),
1228
+ s ? /* @__PURE__ */ t("button", {
1229
+ type: "button",
1230
+ className: "kb-event-card__action",
1231
+ onClick: s,
1232
+ children: o
1233
+ }) : null
1234
+ ]
1235
+ });
1236
+ }
1237
+ //#endregion
1238
+ //#region src/components/Schedule/Schedule.tsx
1239
+ function je({ className: e, children: n, ...r }) {
1240
+ return /* @__PURE__ */ t("div", {
1241
+ className: ["kb-schedule", e].filter(Boolean).join(" "),
1242
+ ...r,
1243
+ children: n
1244
+ });
1245
+ }
1246
+ function Me({ day: e, onAdd: r, className: i, children: a, ...o }) {
1247
+ return /* @__PURE__ */ n("div", {
1248
+ className: ["kb-schedule__column", i].filter(Boolean).join(" "),
1249
+ ...o,
1250
+ children: [/* @__PURE__ */ n("div", {
1251
+ className: "kb-schedule__day",
1252
+ children: [e, r ? /* @__PURE__ */ t("button", {
1253
+ type: "button",
1254
+ className: "kb-schedule__add",
1255
+ "aria-label": "Add",
1256
+ onClick: r,
1257
+ children: /* @__PURE__ */ t("svg", {
1258
+ viewBox: "0 0 10 10",
1259
+ fill: "none",
1260
+ stroke: "currentColor",
1261
+ strokeWidth: "1.6",
1262
+ strokeLinecap: "round",
1263
+ children: /* @__PURE__ */ t("path", { d: "M5 1.5v7M1.5 5h7" })
1264
+ })
1265
+ }) : null]
1266
+ }), a]
1267
+ });
1268
+ }
1269
+ function Ne({ title: e, tone: r = "blue", menu: i, className: a, children: o, ...s }) {
1270
+ return /* @__PURE__ */ n("div", {
1271
+ className: [
1272
+ "kb-schedule-card",
1273
+ r !== "blue" && `kb-schedule-card--${r}`,
1274
+ a
1275
+ ].filter(Boolean).join(" "),
1276
+ ...s,
1277
+ children: [/* @__PURE__ */ n("div", {
1278
+ className: "kb-schedule-card__header",
1279
+ children: [/* @__PURE__ */ t("span", { children: e }), i]
1280
+ }), /* @__PURE__ */ t("div", {
1281
+ className: "kb-schedule-card__body",
1282
+ children: o
1283
+ })]
1284
+ });
1285
+ }
1286
+ //#endregion
1287
+ //#region src/components/DescriptionList/DescriptionList.tsx
1288
+ function Pe({ title: e, items: r, columns: i = 3, className: a, style: o, ...s }) {
1289
+ return /* @__PURE__ */ n("div", {
1290
+ className: ["kb-desc", a].filter(Boolean).join(" "),
1291
+ style: o,
1292
+ ...s,
1293
+ children: [e ? /* @__PURE__ */ t("h3", {
1294
+ className: "kb-desc__title",
1295
+ children: e
1296
+ }) : null, /* @__PURE__ */ t("dl", {
1297
+ className: "kb-desc__grid",
1298
+ style: { "--cols": i },
1299
+ children: r.map((e, r) => /* @__PURE__ */ n("div", {
1300
+ className: "kb-desc__item",
1301
+ children: [/* @__PURE__ */ t("dt", {
1302
+ className: "kb-desc__label",
1303
+ children: e.label
1304
+ }), /* @__PURE__ */ t("dd", {
1305
+ className: "kb-desc__value",
1306
+ children: e.value
1307
+ })]
1308
+ }, r))
1309
+ })]
1310
+ });
1311
+ }
1312
+ //#endregion
1313
+ //#region src/components/Stepper/Stepper.tsx
1314
+ function Fe({ className: e, children: n, ...r }) {
1315
+ return /* @__PURE__ */ t("nav", {
1316
+ className: ["kb-stepnav", e].filter(Boolean).join(" "),
1317
+ ...r,
1318
+ children: n
1319
+ });
1320
+ }
1321
+ function Ie({ step: e, active: r, current: i, type: a = "button", className: o, children: s, ...c }) {
1322
+ let l = [
1323
+ "kb-stepnav__item",
1324
+ r && "kb-stepnav__item--active",
1325
+ i && "kb-stepnav__item--current",
1326
+ !e && "kb-stepnav__item--title",
1327
+ o
1328
+ ].filter(Boolean).join(" ");
1329
+ return /* @__PURE__ */ n("button", {
1330
+ type: a,
1331
+ className: l,
1332
+ "aria-current": r || i ? "step" : void 0,
1333
+ ...c,
1334
+ children: [e ? /* @__PURE__ */ t("span", {
1335
+ className: "kb-stepnav__step",
1336
+ children: e
1337
+ }) : null, /* @__PURE__ */ t("span", { children: s })]
1338
+ });
1339
+ }
1340
+ function Le({ step: e, className: r, children: i, ...a }) {
1341
+ return /* @__PURE__ */ n("span", {
1342
+ className: ["kb-step-tag", r].filter(Boolean).join(" "),
1343
+ ...a,
1344
+ children: [/* @__PURE__ */ t("span", { children: e }), /* @__PURE__ */ t("span", { children: i })]
1345
+ });
1346
+ }
1347
+ //#endregion
1348
+ //#region src/components/Media/Media.tsx
1349
+ function Re({ className: e, children: n, ...r }) {
1350
+ return /* @__PURE__ */ t("div", {
1351
+ className: ["kb-media-grid", e].filter(Boolean).join(" "),
1352
+ ...r,
1353
+ children: n
1354
+ });
1355
+ }
1356
+ var ze = () => /* @__PURE__ */ t("svg", {
1357
+ viewBox: "0 0 61 52",
1358
+ fill: "currentColor",
1359
+ children: /* @__PURE__ */ t("path", { d: "M4 6a4 4 0 0 1 4-4h14l6 6h25a4 4 0 0 1 4 4v32a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4z" })
1360
+ });
1361
+ function Be({ name: e, src: r, folder: i, selected: a, onSelect: o, className: s, ...c }) {
1362
+ let l = [
1363
+ "kb-media-card",
1364
+ i && "kb-media-card--folder",
1365
+ a && "kb-media-card--selected",
1366
+ s
1367
+ ].filter(Boolean).join(" ");
1368
+ return /* @__PURE__ */ n("div", {
1369
+ className: l,
1370
+ "aria-selected": a,
1371
+ ...c,
1372
+ children: [i ? /* @__PURE__ */ t("span", {
1373
+ className: "kb-media-card__icon",
1374
+ children: /* @__PURE__ */ t(ze, {})
1375
+ }) : /* @__PURE__ */ n("div", {
1376
+ className: "kb-media-card__thumb",
1377
+ children: [r ? /* @__PURE__ */ t("img", {
1378
+ src: r,
1379
+ alt: ""
1380
+ }) : null, o ? /* @__PURE__ */ t("span", {
1381
+ className: "kb-media-card__check",
1382
+ onClick: (e) => e.stopPropagation(),
1383
+ children: /* @__PURE__ */ t(y, {
1384
+ checked: !!a,
1385
+ onChange: (e) => o(e.target.checked),
1386
+ "aria-label": "Select"
1387
+ })
1388
+ }) : null]
1389
+ }), /* @__PURE__ */ t("div", {
1390
+ className: "kb-media-card__name",
1391
+ children: e
1392
+ })]
1393
+ });
1394
+ }
1395
+ function Ve({ title: e = "支援格式與大小限制", limits: r, className: i, ...a }) {
1396
+ return /* @__PURE__ */ n("div", {
1397
+ className: ["kb-media-notice", i].filter(Boolean).join(" "),
1398
+ ...a,
1399
+ children: [/* @__PURE__ */ t("span", { children: e }), /* @__PURE__ */ t("span", {
1400
+ className: "kb-media-notice__table",
1401
+ children: r.map(([e, r], i) => /* @__PURE__ */ n("span", {
1402
+ style: { display: "contents" },
1403
+ children: [/* @__PURE__ */ t("span", { children: e }), /* @__PURE__ */ t("span", { children: r })]
1404
+ }, i))
1405
+ })]
1406
+ });
1407
+ }
1408
+ //#endregion
1409
+ //#region src/components/Editor/Editor.tsx
1410
+ function He({ kind: e = "panel", className: n, children: r, ...i }) {
1411
+ return /* @__PURE__ */ t("aside", {
1412
+ className: [
1413
+ "kb-editor-sidebar",
1414
+ e === "content" && "kb-editor-sidebar--content",
1415
+ n
1416
+ ].filter(Boolean).join(" "),
1417
+ ...i,
1418
+ children: r
1419
+ });
1420
+ }
1421
+ function Ue({ title: e, onAdd: r, action: i, className: a, ...o }) {
1422
+ return /* @__PURE__ */ n("div", {
1423
+ className: ["kb-editor-panel__header", a].filter(Boolean).join(" "),
1424
+ ...o,
1425
+ children: [
1426
+ /* @__PURE__ */ t("span", { children: e }),
1427
+ r ? /* @__PURE__ */ t("button", {
1428
+ type: "button",
1429
+ className: "kb-editor-panel__add",
1430
+ "aria-label": "Add",
1431
+ onClick: r,
1432
+ children: /* @__PURE__ */ t("svg", {
1433
+ viewBox: "0 0 8 8",
1434
+ fill: "none",
1435
+ stroke: "currentColor",
1436
+ strokeWidth: "1.4",
1437
+ strokeLinecap: "round",
1438
+ children: /* @__PURE__ */ t("path", { d: "M4 1v6M1 4h6" })
1439
+ })
1440
+ }) : null,
1441
+ i ? /* @__PURE__ */ t("button", {
1442
+ type: "button",
1443
+ className: "kb-editor-panel__action",
1444
+ children: i
1445
+ }) : null
1446
+ ]
1447
+ });
1448
+ }
1449
+ function We({ className: e, children: n, ...r }) {
1450
+ return /* @__PURE__ */ t("div", {
1451
+ className: ["kb-editor-panel__footer", e].filter(Boolean).join(" "),
1452
+ ...r,
1453
+ children: n
1454
+ });
1455
+ }
1456
+ function Ge({ onCollapse: e, className: r, children: i, ...a }) {
1457
+ return /* @__PURE__ */ n("div", {
1458
+ className: ["kb-tool-palette", r].filter(Boolean).join(" "),
1459
+ ...a,
1460
+ children: [i, e ? /* @__PURE__ */ t("button", {
1461
+ type: "button",
1462
+ className: "kb-tool-palette__handle",
1463
+ "aria-label": "Collapse tools",
1464
+ onClick: e,
1465
+ children: /* @__PURE__ */ t("svg", {
1466
+ viewBox: "0 0 10 6",
1467
+ fill: "none",
1468
+ stroke: "currentColor",
1469
+ strokeWidth: "1.4",
1470
+ strokeLinecap: "round",
1471
+ children: /* @__PURE__ */ t("path", { d: "m1 5 4-4 4 4" })
1472
+ })
1473
+ }) : null]
1474
+ });
1475
+ }
1476
+ function Ke({ className: e, children: n, ...r }) {
1477
+ return /* @__PURE__ */ t("div", {
1478
+ className: ["kb-tool-palette__row", e].filter(Boolean).join(" "),
1479
+ ...r,
1480
+ children: n
1481
+ });
1482
+ }
1483
+ function qe({ label: e, active: n, type: r = "button", className: i, children: a, ...o }) {
1484
+ return /* @__PURE__ */ t("button", {
1485
+ type: r,
1486
+ className: ["kb-tool", i].filter(Boolean).join(" "),
1487
+ "aria-label": e,
1488
+ title: e,
1489
+ "aria-pressed": !!n,
1490
+ ...o,
1491
+ children: a
1492
+ });
1493
+ }
1494
+ function Je({ title: e = "Layers", className: r, children: i, ...a }) {
1495
+ return /* @__PURE__ */ n("div", {
1496
+ className: ["kb-layer-list", r].filter(Boolean).join(" "),
1497
+ ...a,
1498
+ children: [/* @__PURE__ */ t("div", {
1499
+ className: "kb-layer-list__title",
1500
+ children: e
1501
+ }), /* @__PURE__ */ t("div", {
1502
+ className: "kb-layer-list__items",
1503
+ role: "listbox",
1504
+ children: i
1505
+ })]
1506
+ });
1507
+ }
1508
+ function Ye({ icon: e, active: r, className: i, children: a, ...o }) {
1509
+ return /* @__PURE__ */ n("div", {
1510
+ role: "option",
1511
+ "aria-selected": !!r,
1512
+ className: [
1513
+ "kb-layer",
1514
+ r && "kb-layer--active",
1515
+ i
1516
+ ].filter(Boolean).join(" "),
1517
+ ...o,
1518
+ children: [e ? /* @__PURE__ */ t("span", {
1519
+ className: "kb-layer__icon",
1520
+ children: e
1521
+ }) : null, /* @__PURE__ */ t("span", { children: a })]
1522
+ });
1523
+ }
1524
+ function Xe({ className: e, children: n, ...r }) {
1525
+ return /* @__PURE__ */ t("div", {
1526
+ className: ["kb-panel-title", e].filter(Boolean).join(" "),
1527
+ ...r,
1528
+ children: n
1529
+ });
1530
+ }
1531
+ function Ze({ className: e, children: n, ...r }) {
1532
+ return /* @__PURE__ */ t("div", {
1533
+ className: ["kb-panel-section", e].filter(Boolean).join(" "),
1534
+ ...r,
1535
+ children: n
1536
+ });
1537
+ }
1538
+ function Qe({ className: e, children: n, ...r }) {
1539
+ return /* @__PURE__ */ t("div", {
1540
+ className: ["kb-slide-list", e].filter(Boolean).join(" "),
1541
+ ...r,
1542
+ children: n
1543
+ });
1544
+ }
1545
+ function $e({ index: e, duration: r, name: i, src: a, video: o, selected: s, actions: c, handle: l, className: u, ...d }) {
1546
+ return /* @__PURE__ */ t("div", {
1547
+ className: ["kb-slide-wrap", s && "kb-slide-wrap--selected"].filter(Boolean).join(" "),
1548
+ children: /* @__PURE__ */ n("div", {
1549
+ className: [
1550
+ "kb-slide",
1551
+ s && "kb-slide--selected",
1552
+ u
1553
+ ].filter(Boolean).join(" "),
1554
+ "aria-selected": s,
1555
+ ...d,
1556
+ children: [/* @__PURE__ */ n("div", {
1557
+ className: "kb-slide__thumb",
1558
+ children: [
1559
+ a ? /* @__PURE__ */ t("img", {
1560
+ src: a,
1561
+ alt: ""
1562
+ }) : null,
1563
+ /* @__PURE__ */ n("span", {
1564
+ className: "kb-slide__chip",
1565
+ children: [
1566
+ /* @__PURE__ */ t("b", { children: e }),
1567
+ /* @__PURE__ */ t("i", { "aria-hidden": "true" }),
1568
+ o ? /* @__PURE__ */ n("svg", {
1569
+ viewBox: "0 0 14 14",
1570
+ fill: "currentColor",
1571
+ children: [/* @__PURE__ */ t("rect", {
1572
+ x: "1",
1573
+ y: "3",
1574
+ width: "12",
1575
+ height: "8",
1576
+ rx: "1.5"
1577
+ }), /* @__PURE__ */ t("path", {
1578
+ d: "m6 5 3 2-3 2z",
1579
+ fill: "#000"
1580
+ })]
1581
+ }) : null,
1582
+ r
1583
+ ]
1584
+ }),
1585
+ l ? /* @__PURE__ */ t("span", {
1586
+ className: "kb-slide__handle",
1587
+ "aria-hidden": "true",
1588
+ children: /* @__PURE__ */ t("svg", {
1589
+ viewBox: "0 0 12 12",
1590
+ fill: "none",
1591
+ stroke: "currentColor",
1592
+ strokeWidth: "1.4",
1593
+ strokeLinecap: "round",
1594
+ children: /* @__PURE__ */ t("path", { d: "M2 4h8M2 8h8" })
1595
+ })
1596
+ }) : null,
1597
+ c ? /* @__PURE__ */ t("div", {
1598
+ className: "kb-slide__actions",
1599
+ children: c
1600
+ }) : null
1601
+ ]
1602
+ }), /* @__PURE__ */ t("div", {
1603
+ className: "kb-slide__name",
1604
+ children: i
1605
+ })]
1606
+ })
1607
+ });
1608
+ }
1609
+ function et({ value: e, onChange: r, step: i = 10, min: a = 10, max: o = 400, className: s, ...c }) {
1610
+ let l = (e) => Math.min(o, Math.max(a, e));
1611
+ return /* @__PURE__ */ n("div", {
1612
+ className: ["kb-zoom", s].filter(Boolean).join(" "),
1613
+ ...c,
1614
+ children: [
1615
+ /* @__PURE__ */ t("button", {
1616
+ type: "button",
1617
+ "aria-label": "Zoom in",
1618
+ onClick: () => r(l(e + i)),
1619
+ children: /* @__PURE__ */ t("svg", {
1620
+ viewBox: "0 0 16 16",
1621
+ fill: "none",
1622
+ stroke: "currentColor",
1623
+ strokeWidth: "1.4",
1624
+ strokeLinecap: "round",
1625
+ children: /* @__PURE__ */ t("path", { d: "M8 3v10M3 8h10" })
1626
+ })
1627
+ }),
1628
+ /* @__PURE__ */ n("span", {
1629
+ className: "kb-zoom__value",
1630
+ children: [e, " %"]
1631
+ }),
1632
+ /* @__PURE__ */ t("button", {
1633
+ type: "button",
1634
+ "aria-label": "Zoom out",
1635
+ onClick: () => r(l(e - i)),
1636
+ children: /* @__PURE__ */ t("svg", {
1637
+ viewBox: "0 0 16 16",
1638
+ fill: "none",
1639
+ stroke: "currentColor",
1640
+ strokeWidth: "1.4",
1641
+ strokeLinecap: "round",
1642
+ children: /* @__PURE__ */ t("path", { d: "M3 8h10" })
1643
+ })
1644
+ })
1645
+ ]
1646
+ });
1647
+ }
1648
+ function tt({ className: e, children: n, ...r }) {
1649
+ return /* @__PURE__ */ t("span", {
1650
+ className: ["kb-size-label", e].filter(Boolean).join(" "),
1651
+ ...r,
1652
+ children: n
1653
+ });
1654
+ }
1655
+ //#endregion
1656
+ //#region src/components/TagInput/TagInput.tsx
1657
+ var nt = () => /* @__PURE__ */ t("svg", {
1658
+ viewBox: "0 0 10 10",
1659
+ fill: "none",
1660
+ stroke: "currentColor",
1661
+ strokeWidth: "1.5",
1662
+ strokeLinecap: "round",
1663
+ "aria-hidden": "true",
1664
+ children: /* @__PURE__ */ t("path", { d: "m2 2 6 6m0-6-6 6" })
1665
+ });
1666
+ function rt({ value: r, onChange: i, label: a, hint: o, error: s, size: c = "lg", layout: l = "inline", separators: u = ["Enter", ","], allowDuplicates: f = !1, max: p, removeLabel: g = (e) => `Remove ${e}`, disabled: _, id: v, className: y, style: b, onKeyDown: x, onBlur: S, onPaste: C, placeholder: w, ...T }) {
1667
+ let E = d(), D = v ?? E, O = o ? `${D}-hint` : void 0, [k, A] = h(""), j = m(null), M = p !== void 0 && r.length >= p, N = (e) => {
1668
+ let t = [...r];
1669
+ for (let n of e) {
1670
+ let e = n.trim();
1671
+ !e || p !== void 0 && t.length >= p || (f || !t.includes(e)) && t.push(e);
1672
+ }
1673
+ t.length !== r.length && i(t);
1674
+ }, P = (e) => {
1675
+ i(r.filter((t, n) => n !== e)), j.current?.focus();
1676
+ }, F = (e) => {
1677
+ x?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (u.includes(e.key) ? k.trim() ? (e.preventDefault(), N([k]), A("")) : e.key !== "Enter" && e.preventDefault() : e.key === "Backspace" && k === "" && r.length > 0 && (e.preventDefault(), i(r.slice(0, -1))));
1678
+ }, I = /* @__PURE__ */ t("ul", {
1679
+ className: "kb-tag-input__tags",
1680
+ "aria-label": "Tags",
1681
+ children: r.map((e, r) => /* @__PURE__ */ n("li", {
1682
+ className: "kb-tag-input__tag",
1683
+ children: [/* @__PURE__ */ t("span", {
1684
+ className: "kb-tag-input__tag-label",
1685
+ children: e
1686
+ }), /* @__PURE__ */ t("button", {
1687
+ type: "button",
1688
+ className: "kb-tag-input__remove",
1689
+ "aria-label": g(e),
1690
+ disabled: _,
1691
+ onClick: (e) => {
1692
+ e.stopPropagation(), P(r);
1693
+ },
1694
+ children: /* @__PURE__ */ t(nt, {})
1695
+ })]
1696
+ }, `${e}-${r}`))
1697
+ }), L = /* @__PURE__ */ t("input", {
1698
+ ref: j,
1699
+ id: D,
1700
+ className: "kb-tag-input__field",
1701
+ type: "text",
1702
+ value: k,
1703
+ disabled: _ || M,
1704
+ placeholder: M ? void 0 : w,
1705
+ "aria-invalid": s || void 0,
1706
+ "aria-describedby": O,
1707
+ onChange: (e) => A(e.target.value),
1708
+ onKeyDown: F,
1709
+ onBlur: (e) => {
1710
+ S?.(e), k.trim() && (N([k]), A(""));
1711
+ },
1712
+ onPaste: (e) => {
1713
+ C?.(e);
1714
+ let t = e.clipboardData.getData("text");
1715
+ !e.defaultPrevented && u.includes(",") && t.includes(",") && (e.preventDefault(), N((k + t).split(",")), A(""));
1716
+ },
1717
+ ...T
1718
+ }), R = l === "stacked", z = /* @__PURE__ */ t("div", {
1719
+ className: [
1720
+ "kb-tag-input",
1721
+ `kb-tag-input--${c}`,
1722
+ R && "kb-tag-input--stacked",
1723
+ s && "kb-tag-input--error",
1724
+ _ && "kb-tag-input--disabled",
1725
+ y
1726
+ ].filter(Boolean).join(" "),
1727
+ style: b,
1728
+ onClick: R ? void 0 : () => j.current?.focus(),
1729
+ children: R ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
1730
+ className: "kb-tag-input__box",
1731
+ onClick: () => j.current?.focus(),
1732
+ children: L
1733
+ }), I] }) : /* @__PURE__ */ n(e, { children: [I, L] })
1734
+ });
1735
+ return !a && !o ? z : /* @__PURE__ */ n("div", {
1736
+ className: ["kb-field", s && "kb-field--error"].filter(Boolean).join(" "),
1737
+ children: [
1738
+ a ? /* @__PURE__ */ t("label", {
1739
+ className: "kb-field__label",
1740
+ htmlFor: D,
1741
+ children: a
1742
+ }) : null,
1743
+ z,
1744
+ o ? /* @__PURE__ */ t("p", {
1745
+ id: O,
1746
+ className: "kb-field__hint",
1747
+ children: o
1748
+ }) : null
1749
+ ]
1750
+ });
1751
+ }
1752
+ //#endregion
1753
+ //#region src/components/NumberStepper/NumberStepper.tsx
1754
+ var it = () => /* @__PURE__ */ t("svg", {
1755
+ viewBox: "0 0 12 12",
1756
+ fill: "none",
1757
+ stroke: "currentColor",
1758
+ strokeWidth: "1.6",
1759
+ strokeLinecap: "round",
1760
+ "aria-hidden": "true",
1761
+ children: /* @__PURE__ */ t("path", { d: "M2 6h8" })
1762
+ }), at = () => /* @__PURE__ */ t("svg", {
1763
+ viewBox: "0 0 12 12",
1764
+ fill: "none",
1765
+ stroke: "currentColor",
1766
+ strokeWidth: "1.6",
1767
+ strokeLinecap: "round",
1768
+ "aria-hidden": "true",
1769
+ children: /* @__PURE__ */ t("path", { d: "M2 6h8M6 2v8" })
1770
+ }), ot = (e) => (String(e).split(".")[1] ?? "").length;
1771
+ function st({ value: e, defaultValue: r, onChange: i, min: a, max: o, step: s = 1, disabled: c, error: l, size: f = "md", block: p, label: m, hint: g, name: _, inputId: v, decrementLabel: y = "Decrease", incrementLabel: b = "Increase", className: x, ...S }) {
1772
+ let C = d(), w = v ?? C, [T, E] = h(r ?? a ?? 0), D = e ?? T, [O, k] = h(String(D));
1773
+ u(() => k(String(D)), [D]);
1774
+ let A = (e) => {
1775
+ let t = e;
1776
+ return a !== void 0 && (t = Math.max(a, t)), o !== void 0 && (t = Math.min(o, t)), Number(t.toFixed(Math.max(ot(s), ot(t) > 6 ? 6 : ot(t))));
1777
+ }, j = (t) => {
1778
+ let n = A(t);
1779
+ e === void 0 && E(n), k(String(n)), n !== D && i?.(n);
1780
+ }, M = () => {
1781
+ let e = parseFloat(O);
1782
+ Number.isNaN(e) ? k(String(D)) : j(e);
1783
+ }, N = a !== void 0 && D <= a, P = o !== void 0 && D >= o, F = (e) => {
1784
+ let t = {
1785
+ ArrowUp: s,
1786
+ ArrowDown: -s,
1787
+ PageUp: s * 10,
1788
+ PageDown: -s * 10
1789
+ };
1790
+ e.key in t ? (e.preventDefault(), j(D + t[e.key])) : e.key === "Home" && a !== void 0 ? (e.preventDefault(), j(a)) : e.key === "End" && o !== void 0 ? (e.preventDefault(), j(o)) : e.key === "Enter" && M();
1791
+ }, I = /* @__PURE__ */ n("div", {
1792
+ role: "group",
1793
+ className: [
1794
+ "kb-number-stepper",
1795
+ `kb-number-stepper--${f}`,
1796
+ p && "kb-number-stepper--block",
1797
+ l && "kb-number-stepper--error",
1798
+ c && "kb-number-stepper--disabled",
1799
+ x
1800
+ ].filter(Boolean).join(" "),
1801
+ ...S,
1802
+ children: [
1803
+ /* @__PURE__ */ t("button", {
1804
+ type: "button",
1805
+ className: "kb-number-stepper__button",
1806
+ "aria-label": y,
1807
+ "aria-controls": w,
1808
+ tabIndex: -1,
1809
+ disabled: c || N,
1810
+ onClick: () => j(D - s),
1811
+ children: /* @__PURE__ */ t(it, {})
1812
+ }),
1813
+ /* @__PURE__ */ t("input", {
1814
+ id: w,
1815
+ name: _,
1816
+ className: "kb-number-stepper__input",
1817
+ type: "text",
1818
+ inputMode: "decimal",
1819
+ role: "spinbutton",
1820
+ autoComplete: "off",
1821
+ "aria-valuenow": D,
1822
+ "aria-valuemin": a,
1823
+ "aria-valuemax": o,
1824
+ "aria-invalid": l || void 0,
1825
+ disabled: c,
1826
+ value: O,
1827
+ onChange: (e) => k(e.target.value),
1828
+ onBlur: M,
1829
+ onKeyDown: F
1830
+ }),
1831
+ /* @__PURE__ */ t("button", {
1832
+ type: "button",
1833
+ className: "kb-number-stepper__button",
1834
+ "aria-label": b,
1835
+ "aria-controls": w,
1836
+ tabIndex: -1,
1837
+ disabled: c || P,
1838
+ onClick: () => j(D + s),
1839
+ children: /* @__PURE__ */ t(at, {})
1840
+ })
1841
+ ]
1842
+ });
1843
+ return !m && !g ? I : /* @__PURE__ */ n("div", {
1844
+ className: ["kb-field", l && "kb-field--error"].filter(Boolean).join(" "),
1845
+ children: [
1846
+ m ? /* @__PURE__ */ t("label", {
1847
+ className: "kb-field__label",
1848
+ htmlFor: w,
1849
+ children: m
1850
+ }) : null,
1851
+ I,
1852
+ g ? /* @__PURE__ */ t("p", {
1853
+ className: "kb-field__hint",
1854
+ children: g
1855
+ }) : null
1856
+ ]
1857
+ });
1858
+ }
1859
+ //#endregion
1860
+ //#region src/components/Dropdown/Dropdown.tsx
1861
+ var ct = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e : [e];
1862
+ function lt(e) {
1863
+ let { options: r, placeholder: i = "請選擇", variant: a = "default", size: o = "lg", icon: s, label: c, hint: l, error: f, placement: p = "bottom", alignEnd: g, name: _, multiple: v, value: y, defaultValue: b, onChange: x, disabled: S, id: C, className: w, style: T, onKeyDown: E, onClick: D, ...O } = e, k = d(), A = C ?? `${k}-trigger`, j = `${k}-list`, M = (e) => `${k}-opt-${e}`, [N, P] = h(ct(b) ?? []), F = ct(y) ?? N, [I, L] = h(!1), [R, z] = h(-1), B = m(null), V = m(null), H = m({
1864
+ text: "",
1865
+ at: 0
1866
+ });
1867
+ u(() => {
1868
+ if (!I) return;
1869
+ let e = (e) => {
1870
+ B.current?.contains(e.target) || L(!1);
1871
+ };
1872
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1873
+ }, [I]), u(() => {
1874
+ !I || R < 0 || (V.current?.querySelector(`#${CSS.escape(M(R))}`))?.scrollIntoView?.({ block: "nearest" });
1875
+ }, [I, R]);
1876
+ let U = (e, t) => {
1877
+ for (let n = e; n >= 0 && n < r.length; n += t) if (!r[n].disabled) return n;
1878
+ return -1;
1879
+ }, W = (e) => {
1880
+ if (S) return;
1881
+ let t = r.findIndex((e) => F.includes(e.value) && !e.disabled);
1882
+ z(e ?? (t >= 0 ? t : U(0, 1))), L(!0);
1883
+ }, G = (e) => {
1884
+ let t = r[e];
1885
+ if (t && !t.disabled) {
1886
+ if (v) {
1887
+ let n = F.includes(t.value) ? F.filter((e) => e !== t.value) : [...F, t.value];
1888
+ y === void 0 && P(n), x?.(n), z(e);
1889
+ } else y === void 0 && P([t.value]), F.includes(t.value) || x?.(t.value), L(!1);
1890
+ }
1891
+ }, K = (e) => {
1892
+ let t = Date.now();
1893
+ H.current.text = t - H.current.at > 600 ? e : H.current.text + e, H.current.at = t;
1894
+ let n = H.current.text.toLowerCase(), i = I ? R + 1 : 0, a = [...r.keys()].map((e) => (e + i) % r.length).find((e) => !r[e].disabled && r[e].label.toLowerCase().startsWith(n));
1895
+ a !== void 0 && (I ? z(a) : v || G(a));
1896
+ }, ee = (e) => {
1897
+ if (E?.(e), e.defaultPrevented || S) return;
1898
+ let t = e.key;
1899
+ if (!I) {
1900
+ t === "ArrowDown" || t === "ArrowUp" || t === "Enter" || t === " " ? (e.preventDefault(), W(t === "ArrowUp" ? U(r.length - 1, -1) : void 0)) : t.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && K(t);
1901
+ return;
1902
+ }
1903
+ switch (t) {
1904
+ case "ArrowDown": {
1905
+ e.preventDefault();
1906
+ let t = U(R + 1, 1);
1907
+ t >= 0 && z(t);
1908
+ break;
1909
+ }
1910
+ case "ArrowUp": {
1911
+ e.preventDefault();
1912
+ let t = U(R - 1, -1);
1913
+ t >= 0 && z(t);
1914
+ break;
1915
+ }
1916
+ case "Home":
1917
+ e.preventDefault(), z(U(0, 1));
1918
+ break;
1919
+ case "End":
1920
+ e.preventDefault(), z(U(r.length - 1, -1));
1921
+ break;
1922
+ case "Enter":
1923
+ case " ":
1924
+ if (e.preventDefault(), t === " " && H.current.text && Date.now() - H.current.at < 600) {
1925
+ K(" ");
1926
+ break;
1927
+ }
1928
+ G(R);
1929
+ break;
1930
+ case "Escape":
1931
+ e.preventDefault(), L(!1);
1932
+ break;
1933
+ case "Tab":
1934
+ L(!1);
1935
+ break;
1936
+ default: t.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && K(t);
1937
+ }
1938
+ }, te = r.filter((e) => F.includes(e.value)), q = te.map((e) => e.label).join(", "), ne = s ?? (v ? void 0 : te[0]?.icon), re = /* @__PURE__ */ n("div", {
1939
+ ref: B,
1940
+ className: [
1941
+ "kb-dropdown",
1942
+ `kb-dropdown--${o}`,
1943
+ a === "pill" && "kb-dropdown--pill",
1944
+ I && "kb-dropdown--open",
1945
+ p === "top" && "kb-dropdown--up",
1946
+ g && "kb-dropdown--align-end",
1947
+ f && "kb-dropdown--error",
1948
+ w
1949
+ ].filter(Boolean).join(" "),
1950
+ style: T,
1951
+ children: [
1952
+ /* @__PURE__ */ n("button", {
1953
+ id: A,
1954
+ type: "button",
1955
+ role: "combobox",
1956
+ className: "kb-dropdown__trigger",
1957
+ "aria-haspopup": "listbox",
1958
+ "aria-expanded": I,
1959
+ "aria-controls": j,
1960
+ "aria-activedescendant": I && R >= 0 ? M(R) : void 0,
1961
+ "aria-invalid": f || void 0,
1962
+ disabled: S,
1963
+ onClick: (e) => {
1964
+ D?.(e), I ? L(!1) : W();
1965
+ },
1966
+ onKeyDown: ee,
1967
+ onBlur: (e) => {
1968
+ B.current?.contains(e.relatedTarget) || L(!1);
1969
+ },
1970
+ ...O,
1971
+ children: [
1972
+ ne ? /* @__PURE__ */ t("span", {
1973
+ className: "kb-dropdown__icon",
1974
+ "aria-hidden": "true",
1975
+ children: ne
1976
+ }) : null,
1977
+ /* @__PURE__ */ t("span", {
1978
+ className: ["kb-dropdown__value", !q && "kb-dropdown__value--placeholder"].filter(Boolean).join(" "),
1979
+ children: q || i
1980
+ }),
1981
+ /* @__PURE__ */ t("span", {
1982
+ className: "kb-dropdown__chevron",
1983
+ "aria-hidden": "true"
1984
+ })
1985
+ ]
1986
+ }),
1987
+ I ? /* @__PURE__ */ n("ul", {
1988
+ ref: V,
1989
+ id: j,
1990
+ className: "kb-dropdown__list",
1991
+ role: "listbox",
1992
+ "aria-labelledby": A,
1993
+ "aria-multiselectable": v || void 0,
1994
+ tabIndex: -1,
1995
+ onMouseDown: (e) => e.preventDefault(),
1996
+ children: [r.length === 0 ? /* @__PURE__ */ t("li", {
1997
+ className: "kb-dropdown__empty",
1998
+ role: "presentation",
1999
+ children: "無選項"
2000
+ }) : null, r.map((e, r) => {
2001
+ let i = F.includes(e.value);
2002
+ return /* @__PURE__ */ n("li", {
2003
+ id: M(r),
2004
+ role: "option",
2005
+ "aria-selected": i,
2006
+ "aria-disabled": e.disabled || void 0,
2007
+ className: [
2008
+ "kb-dropdown__option",
2009
+ i && "kb-dropdown__option--selected",
2010
+ r === R && "kb-dropdown__option--active",
2011
+ e.disabled && "kb-dropdown__option--disabled"
2012
+ ].filter(Boolean).join(" "),
2013
+ onMouseEnter: () => !e.disabled && z(r),
2014
+ onClick: () => G(r),
2015
+ children: [
2016
+ v ? /* @__PURE__ */ t("span", {
2017
+ className: "kb-dropdown__check",
2018
+ "aria-hidden": "true"
2019
+ }) : null,
2020
+ e.icon ? /* @__PURE__ */ t("span", {
2021
+ className: "kb-dropdown__icon",
2022
+ "aria-hidden": "true",
2023
+ children: e.icon
2024
+ }) : null,
2025
+ /* @__PURE__ */ t("span", {
2026
+ className: "kb-dropdown__option-label",
2027
+ children: e.label
2028
+ })
2029
+ ]
2030
+ }, e.value);
2031
+ })]
2032
+ }) : null,
2033
+ _ ? F.map((e) => /* @__PURE__ */ t("input", {
2034
+ type: "hidden",
2035
+ name: _,
2036
+ value: e
2037
+ }, e)) : null
2038
+ ]
2039
+ });
2040
+ return !c && !l ? re : /* @__PURE__ */ n("div", {
2041
+ className: ["kb-field", f && "kb-field--error"].filter(Boolean).join(" "),
2042
+ children: [
2043
+ c ? /* @__PURE__ */ t("label", {
2044
+ className: "kb-field__label",
2045
+ htmlFor: A,
2046
+ children: c
2047
+ }) : null,
2048
+ re,
2049
+ l ? /* @__PURE__ */ t("p", {
2050
+ className: "kb-field__hint",
2051
+ children: l
2052
+ }) : null
2053
+ ]
2054
+ });
2055
+ }
2056
+ //#endregion
2057
+ //#region src/components/DateRange/DateRange.tsx
2058
+ var ut = () => /* @__PURE__ */ n("svg", {
2059
+ viewBox: "0 0 16 16",
2060
+ fill: "none",
2061
+ stroke: "currentColor",
2062
+ strokeWidth: "1.4",
2063
+ strokeLinecap: "round",
2064
+ children: [/* @__PURE__ */ t("rect", {
2065
+ x: "2",
2066
+ y: "3",
2067
+ width: "12",
2068
+ height: "11",
2069
+ rx: "1.5"
2070
+ }), /* @__PURE__ */ t("path", { d: "M2 6.5h12M5 1.5v3M11 1.5v3" })]
2071
+ });
2072
+ function dt({ value: e, defaultValue: r = ["", ""], onChange: i, min: a, max: o, label: s, hint: c, error: l, disabled: u, required: f, size: p = "lg", block: m, startName: g, endName: _, startLabel: v = "Start date", endLabel: y = "End date", separator: b = "~", className: x, id: S, ...C }) {
2073
+ let w = d(), T = S ?? `${w}-start`, [E, D] = h(r), [O, k] = e ?? E, A = (t) => {
2074
+ e === void 0 && D(t), i?.(t);
2075
+ }, j = /* @__PURE__ */ n("div", {
2076
+ role: "group",
2077
+ "aria-label": typeof s == "string" ? s : void 0,
2078
+ className: [
2079
+ "kb-date-range",
2080
+ `kb-date-range--${p}`,
2081
+ m && "kb-date-range--block",
2082
+ l && "kb-date-range--error",
2083
+ u && "kb-date-range--disabled",
2084
+ x
2085
+ ].filter(Boolean).join(" "),
2086
+ ...C,
2087
+ children: [
2088
+ /* @__PURE__ */ t("input", {
2089
+ id: T,
2090
+ type: "date",
2091
+ className: "kb-date-range__input",
2092
+ "aria-label": v,
2093
+ "aria-invalid": l || void 0,
2094
+ name: g,
2095
+ value: O,
2096
+ min: a,
2097
+ max: k || o,
2098
+ disabled: u,
2099
+ required: f,
2100
+ onChange: (e) => A([e.target.value, k])
2101
+ }),
2102
+ /* @__PURE__ */ t("span", {
2103
+ className: "kb-date-range__separator",
2104
+ "aria-hidden": "true",
2105
+ children: b
2106
+ }),
2107
+ /* @__PURE__ */ t("input", {
2108
+ type: "date",
2109
+ className: "kb-date-range__input",
2110
+ "aria-label": y,
2111
+ "aria-invalid": l || void 0,
2112
+ name: _,
2113
+ value: k,
2114
+ min: O || a,
2115
+ max: o,
2116
+ disabled: u,
2117
+ required: f,
2118
+ onChange: (e) => A([O, e.target.value])
2119
+ }),
2120
+ /* @__PURE__ */ t("span", {
2121
+ className: "kb-date-range__icon",
2122
+ "aria-hidden": "true",
2123
+ children: /* @__PURE__ */ t(ut, {})
2124
+ })
2125
+ ]
2126
+ });
2127
+ return !s && !c ? j : /* @__PURE__ */ n("div", {
2128
+ className: ["kb-field", l && "kb-field--error"].filter(Boolean).join(" "),
2129
+ children: [
2130
+ s ? /* @__PURE__ */ t("label", {
2131
+ className: "kb-field__label",
2132
+ htmlFor: T,
2133
+ children: s
2134
+ }) : null,
2135
+ j,
2136
+ c ? /* @__PURE__ */ t("p", {
2137
+ className: "kb-field__hint",
2138
+ children: c
2139
+ }) : null
2140
+ ]
2141
+ });
2142
+ }
2143
+ //#endregion
2144
+ //#region src/components/TimeInput/TimeInput.tsx
2145
+ var ft = () => /* @__PURE__ */ n("svg", {
2146
+ viewBox: "0 0 16 16",
2147
+ fill: "none",
2148
+ stroke: "currentColor",
2149
+ strokeWidth: "1.4",
2150
+ strokeLinecap: "round",
2151
+ strokeLinejoin: "round",
2152
+ children: [/* @__PURE__ */ t("circle", {
2153
+ cx: "8",
2154
+ cy: "8",
2155
+ r: "6"
2156
+ }), /* @__PURE__ */ t("path", { d: "M8 4.8V8l2.2 1.4" })]
2157
+ });
2158
+ function pt({ withSeconds: e, step: n, className: r, ...i }) {
2159
+ return /* @__PURE__ */ t(S, {
2160
+ type: "time",
2161
+ step: n ?? (e ? 1 : void 0),
2162
+ trailingIcon: /* @__PURE__ */ t(ft, {}),
2163
+ className: ["kb-time-input", r].filter(Boolean).join(" "),
2164
+ ...i
2165
+ });
2166
+ }
2167
+ //#endregion
2168
+ //#region src/components/FileUpload/FileUpload.tsx
2169
+ var mt = () => /* @__PURE__ */ t("svg", {
2170
+ viewBox: "0 0 24 24",
2171
+ fill: "none",
2172
+ stroke: "currentColor",
2173
+ strokeWidth: "1.6",
2174
+ strokeLinecap: "round",
2175
+ children: /* @__PURE__ */ t("path", { d: "M12 5v14M5 12h14" })
2176
+ });
2177
+ function ht(e, t) {
2178
+ if (!t) return !0;
2179
+ let n = e.name.toLowerCase(), r = e.type.toLowerCase();
2180
+ return t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean).some((e) => e.startsWith(".") ? n.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r === e);
2181
+ }
2182
+ function gt({ onFiles: r, accept: i, multiple: a, disabled: o, error: s, title: c = "點擊或拖曳檔案上傳", hint: l, icon: u, preview: d, variant: f = "default", name: p, className: g, "aria-label": _, onDragEnter: v, onDragOver: y, onDragLeave: b, ...x }) {
2183
+ let [S, C] = h(!1), w = m(0), T = (e) => {
2184
+ if (!e) return;
2185
+ let t = Array.from(e).filter((e) => ht(e, i));
2186
+ a || (t = t.slice(0, 1)), t.length && r(t);
2187
+ }, E = (e, t) => {
2188
+ t === "enter" && v?.(e), t === "over" && y?.(e), t === "leave" && b?.(e), !o && e.dataTransfer.types.includes("Files") && (e.preventDefault(), t === "enter" && (w.current += 1), t === "leave" && (w.current = Math.max(0, w.current - 1)), t === "over" && (e.dataTransfer.dropEffect = "copy"), C(w.current > 0));
2189
+ }, D = /* @__PURE__ */ n(e, { children: [
2190
+ /* @__PURE__ */ t("span", {
2191
+ className: "kb-file-upload__icon",
2192
+ "aria-hidden": "true",
2193
+ children: u ?? /* @__PURE__ */ t(mt, {})
2194
+ }),
2195
+ c ? /* @__PURE__ */ t("span", {
2196
+ className: "kb-file-upload__title",
2197
+ children: c
2198
+ }) : null,
2199
+ l ? /* @__PURE__ */ t("span", {
2200
+ className: "kb-file-upload__hint",
2201
+ children: l
2202
+ }) : null
2203
+ ] });
2204
+ return /* @__PURE__ */ n("label", {
2205
+ className: [
2206
+ "kb-file-upload",
2207
+ f === "square" && "kb-file-upload--square",
2208
+ S && "kb-file-upload--dragover",
2209
+ s && "kb-file-upload--error",
2210
+ o && "kb-file-upload--disabled",
2211
+ d && "kb-file-upload--has-preview",
2212
+ g
2213
+ ].filter(Boolean).join(" "),
2214
+ onDragEnter: (e) => E(e, "enter"),
2215
+ onDragOver: (e) => E(e, "over"),
2216
+ onDragLeave: (e) => E(e, "leave"),
2217
+ onDrop: (e) => {
2218
+ o || (e.preventDefault(), w.current = 0, C(!1), T(e.dataTransfer.files));
2219
+ },
2220
+ ...x,
2221
+ children: [/* @__PURE__ */ t("input", {
2222
+ type: "file",
2223
+ className: "kb-file-upload__input",
2224
+ accept: i,
2225
+ multiple: a,
2226
+ disabled: o,
2227
+ name: p,
2228
+ "aria-label": _,
2229
+ "aria-invalid": s || void 0,
2230
+ onChange: (e) => {
2231
+ T(e.target.files), e.target.value = "";
2232
+ }
2233
+ }), d ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
2234
+ className: "kb-file-upload__preview",
2235
+ children: d
2236
+ }), /* @__PURE__ */ t("span", {
2237
+ className: "kb-file-upload__overlay",
2238
+ children: D
2239
+ })] }) : D]
2240
+ });
2241
+ }
2242
+ //#endregion
2243
+ //#region src/components/ChoiceChips/ChoiceChips.tsx
2244
+ function _t(e) {
2245
+ let { options: r, size: i = "md", disabled: a, name: o, multiple: s, value: c, defaultValue: l, onChange: u, className: f, ...p } = e, m = s === !1, g = d(), _ = o ?? g, v = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e : [e], [y, b] = h(v(l) ?? []), x = v(c) ?? y, S = (e) => {
2246
+ if (m) {
2247
+ c === void 0 && b([e]), u?.(e);
2248
+ return;
2249
+ }
2250
+ let t = x.includes(e) ? x.filter((t) => t !== e) : [...x, e];
2251
+ c === void 0 && b(t), u?.(t);
2252
+ };
2253
+ return /* @__PURE__ */ t("div", {
2254
+ role: m ? "radiogroup" : "group",
2255
+ className: [
2256
+ "kb-choice-chips",
2257
+ `kb-choice-chips--${i}`,
2258
+ m && "kb-choice-chips--single",
2259
+ f
2260
+ ].filter(Boolean).join(" "),
2261
+ ...p,
2262
+ children: r.map((e) => /* @__PURE__ */ n("label", {
2263
+ className: "kb-choice-chips__chip",
2264
+ children: [
2265
+ /* @__PURE__ */ t("input", {
2266
+ type: m ? "radio" : "checkbox",
2267
+ className: "kb-choice-chips__input",
2268
+ name: _,
2269
+ value: e.value,
2270
+ checked: x.includes(e.value),
2271
+ disabled: a || e.disabled,
2272
+ onChange: () => S(e.value)
2273
+ }),
2274
+ m ? null : /* @__PURE__ */ t("span", {
2275
+ className: "kb-choice-chips__box",
2276
+ "aria-hidden": "true"
2277
+ }),
2278
+ /* @__PURE__ */ t("span", {
2279
+ className: "kb-choice-chips__label",
2280
+ children: e.label
2281
+ })
2282
+ ]
2283
+ }, e.value))
2284
+ });
2285
+ }
2286
+ //#endregion
2287
+ //#region src/components/Accordion/Accordion.tsx
2288
+ var vt = o(null);
2289
+ function yt({ multiple: e = !1, value: n, defaultValue: r, onChange: i, variant: a = "default", headingLevel: o = 3, className: s, children: l, ...u }) {
2290
+ let [d, f] = h(r ?? []), p = n ?? d, m = c((t) => {
2291
+ let r = p.includes(t) ? p.filter((e) => e !== t) : e ? [...p, t] : [t];
2292
+ n === void 0 && f(r), i?.(r);
2293
+ }, [
2294
+ p,
2295
+ e,
2296
+ n,
2297
+ i
2298
+ ]);
2299
+ return /* @__PURE__ */ t(vt.Provider, {
2300
+ value: {
2301
+ openValues: p,
2302
+ toggle: m,
2303
+ variant: a,
2304
+ headingLevel: o
2305
+ },
2306
+ children: /* @__PURE__ */ t("div", {
2307
+ className: [
2308
+ "kb-accordion",
2309
+ a === "grouped" && "kb-accordion--grouped",
2310
+ s
2311
+ ].filter(Boolean).join(" "),
2312
+ ...u,
2313
+ children: l
2314
+ })
2315
+ });
2316
+ }
2317
+ function bt({ value: e, title: r, meta: i, icon: a, actions: o, disabled: s, className: c, children: u, ...f }) {
2318
+ let p = l(vt);
2319
+ if (!p) throw Error("AccordionItem must be used inside <Accordion>");
2320
+ let m = d(), h = p.openValues.includes(e), g = `${m}-header`, _ = `${m}-panel`, v = `h${p.headingLevel}`;
2321
+ return /* @__PURE__ */ n("div", {
2322
+ className: [
2323
+ "kb-accordion__item",
2324
+ h && "kb-accordion__item--open",
2325
+ s && "kb-accordion__item--disabled",
2326
+ c
2327
+ ].filter(Boolean).join(" "),
2328
+ ...f,
2329
+ children: [/* @__PURE__ */ n("div", {
2330
+ className: "kb-accordion__header",
2331
+ children: [/* @__PURE__ */ t(v, {
2332
+ className: "kb-accordion__heading",
2333
+ children: /* @__PURE__ */ n("button", {
2334
+ type: "button",
2335
+ id: g,
2336
+ className: "kb-accordion__trigger",
2337
+ "aria-expanded": h,
2338
+ "aria-controls": _,
2339
+ disabled: s,
2340
+ onClick: () => p.toggle(e),
2341
+ children: [
2342
+ a ? /* @__PURE__ */ t("span", {
2343
+ className: "kb-accordion__icon",
2344
+ "aria-hidden": "true",
2345
+ children: a
2346
+ }) : null,
2347
+ /* @__PURE__ */ t("span", {
2348
+ className: "kb-accordion__title",
2349
+ children: r
2350
+ }),
2351
+ i == null ? null : /* @__PURE__ */ t("span", {
2352
+ className: "kb-accordion__meta",
2353
+ children: i
2354
+ }),
2355
+ /* @__PURE__ */ t("span", {
2356
+ className: "kb-accordion__chevron",
2357
+ "aria-hidden": "true"
2358
+ })
2359
+ ]
2360
+ })
2361
+ }), o ? /* @__PURE__ */ t("div", {
2362
+ className: "kb-accordion__actions",
2363
+ children: o
2364
+ }) : null]
2365
+ }), /* @__PURE__ */ t("div", {
2366
+ className: "kb-accordion__panel",
2367
+ id: _,
2368
+ role: "region",
2369
+ "aria-labelledby": g,
2370
+ hidden: !h,
2371
+ children: u
2372
+ })]
2373
+ });
2374
+ }
2375
+ function xt({ actions: e, interactive: r, selected: i, className: a, children: o, ...s }) {
2376
+ return /* @__PURE__ */ n("div", {
2377
+ className: [
2378
+ "kb-accordion__row",
2379
+ r && "kb-accordion__row--interactive",
2380
+ i && "kb-accordion__row--selected",
2381
+ a
2382
+ ].filter(Boolean).join(" "),
2383
+ "aria-selected": i,
2384
+ ...s,
2385
+ children: [/* @__PURE__ */ t("div", {
2386
+ className: "kb-accordion__row-main",
2387
+ children: o
2388
+ }), e ? /* @__PURE__ */ t("div", {
2389
+ className: "kb-accordion__row-actions",
2390
+ children: e
2391
+ }) : null]
2392
+ });
2393
+ }
2394
+ //#endregion
2395
+ //#region src/components/Spinner/Spinner.tsx
2396
+ function St({ size: e = "md", label: r, vertical: i, tone: a = "brand", className: o, "aria-label": s, ...c }) {
2397
+ return /* @__PURE__ */ n("span", {
2398
+ role: "status",
2399
+ "aria-label": r ? void 0 : s ?? "Loading",
2400
+ className: [
2401
+ "kb-spinner",
2402
+ `kb-spinner--${e}`,
2403
+ i && "kb-spinner--vertical",
2404
+ a === "current" && "kb-spinner--current",
2405
+ o
2406
+ ].filter(Boolean).join(" "),
2407
+ ...c,
2408
+ children: [/* @__PURE__ */ t("span", {
2409
+ className: "kb-spinner__ring",
2410
+ "aria-hidden": "true"
2411
+ }), r ? /* @__PURE__ */ t("span", {
2412
+ className: "kb-spinner__label",
2413
+ children: r
2414
+ }) : null]
2415
+ });
2416
+ }
2417
+ function Ct({ variant: e = "text", width: n, height: r, lines: i = 1, className: a, style: o, ...s }) {
2418
+ let c = [
2419
+ "kb-skeleton",
2420
+ `kb-skeleton--${e}`,
2421
+ a
2422
+ ].filter(Boolean).join(" "), l = {
2423
+ ...n === void 0 ? {} : { width: n },
2424
+ ...r === void 0 ? {} : { height: r },
2425
+ ...o
2426
+ };
2427
+ return e === "text" && i > 1 ? /* @__PURE__ */ t("span", {
2428
+ className: "kb-skeleton-group",
2429
+ "aria-hidden": "true",
2430
+ style: n === void 0 ? void 0 : { width: n },
2431
+ children: Array.from({ length: i }, (e, n) => /* @__PURE__ */ t("span", {
2432
+ className: c,
2433
+ style: {
2434
+ ...r === void 0 ? {} : { height: r },
2435
+ ...n === i - 1 ? { width: "60%" } : {},
2436
+ ...o
2437
+ },
2438
+ ...s
2439
+ }, n))
2440
+ }) : /* @__PURE__ */ t("span", {
2441
+ className: c,
2442
+ "aria-hidden": "true",
2443
+ style: l,
2444
+ ...s
2445
+ });
2446
+ }
2447
+ //#endregion
2448
+ //#region src/components/DataTable/DataTable.tsx
2449
+ function wt(e, t) {
2450
+ return typeof t == "function" ? t(e) : e[t];
2451
+ }
2452
+ function Tt(e, t) {
2453
+ return e == null && t == null ? 0 : e == null ? 1 : t == null ? -1 : typeof e == "number" && typeof t == "number" ? e - t : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : String(e).localeCompare(String(t), void 0, { numeric: !0 });
2454
+ }
2455
+ var Et = (e) => e === "center" ? "kb-data-table__cell--center" : e === "end" ? "kb-data-table__cell--end" : void 0;
2456
+ function Dt({ columns: e, rows: r, rowKey: i, sort: a, defaultSort: o = null, onSortChange: s, selectable: c, selectedKeys: l, defaultSelectedKeys: u, onSelectionChange: d, onRowClick: f, empty: m = "沒有資料", loading: g, loadingContent: _, stickyHeader: v, dense: b, caption: x, selectAllLabel: S = "Select all rows", selectRowLabel: C = () => "Select row", className: w, ...T }) {
2457
+ let [E, D] = h(o), [O, k] = h(u ?? []), A = a !== void 0, j = A ? a : E, M = l ?? O, N = p(() => {
2458
+ if (A || !j) return r;
2459
+ let e = j.direction === "ascending" ? 1 : -1;
2460
+ return [...r].sort((t, n) => e * Tt(t[j.key], n[j.key]));
2461
+ }, [
2462
+ r,
2463
+ j,
2464
+ A
2465
+ ]), P = (e) => {
2466
+ let t = j?.key === e ? j.direction === "ascending" ? {
2467
+ key: e,
2468
+ direction: "descending"
2469
+ } : null : {
2470
+ key: e,
2471
+ direction: "ascending"
2472
+ };
2473
+ A || D(t), s?.(t);
2474
+ }, F = (e) => {
2475
+ l === void 0 && k(e), d?.(e);
2476
+ }, I = N.map((e) => wt(e, i)), L = I.filter((e) => M.includes(e)).length, R = I.length > 0 && L === I.length, z = e.length + +!!c, B = N.length === 0;
2477
+ return /* @__PURE__ */ t("div", {
2478
+ className: [
2479
+ "kb-data-table",
2480
+ v && "kb-data-table--sticky",
2481
+ b && "kb-data-table--dense",
2482
+ w
2483
+ ].filter(Boolean).join(" "),
2484
+ ...T,
2485
+ children: /* @__PURE__ */ n("table", {
2486
+ className: "kb-data-table__table",
2487
+ "aria-busy": g || void 0,
2488
+ children: [
2489
+ x ? /* @__PURE__ */ t("caption", {
2490
+ className: "kb-data-table__caption",
2491
+ children: x
2492
+ }) : null,
2493
+ /* @__PURE__ */ n("colgroup", { children: [c ? /* @__PURE__ */ t("col", {}) : null, e.map((e) => /* @__PURE__ */ t("col", { style: e.width === void 0 ? void 0 : { width: e.width } }, e.key))] }),
2494
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ n("tr", { children: [c ? /* @__PURE__ */ t("th", {
2495
+ scope: "col",
2496
+ className: "kb-data-table__th kb-data-table__select",
2497
+ children: /* @__PURE__ */ t(y, {
2498
+ "aria-label": S,
2499
+ checked: R,
2500
+ indeterminate: L > 0 && !R,
2501
+ disabled: I.length === 0,
2502
+ onChange: () => F(R ? M.filter((e) => !I.includes(e)) : Array.from(/* @__PURE__ */ new Set([...M, ...I])))
2503
+ })
2504
+ }) : null, e.map((e) => {
2505
+ let n = j?.key === e.key ? j.direction : void 0;
2506
+ return /* @__PURE__ */ t("th", {
2507
+ scope: "col",
2508
+ className: ["kb-data-table__th", Et(e.align)].filter(Boolean).join(" "),
2509
+ "aria-sort": e.sortable ? n ?? "none" : void 0,
2510
+ children: e.sortable ? /* @__PURE__ */ t("button", {
2511
+ type: "button",
2512
+ className: "kb-data-table__sort",
2513
+ onClick: () => P(e.key),
2514
+ children: e.label
2515
+ }) : e.label
2516
+ }, e.key);
2517
+ })] }) }),
2518
+ /* @__PURE__ */ t("tbody", { children: B ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
2519
+ className: "kb-data-table__state",
2520
+ colSpan: z,
2521
+ children: g ? _ ?? /* @__PURE__ */ t(St, { label: "載入中…" }) : m
2522
+ }) }) : N.map((r, a) => {
2523
+ let o = wt(r, i), s = M.includes(o);
2524
+ return /* @__PURE__ */ n("tr", {
2525
+ className: [
2526
+ "kb-data-table__row",
2527
+ s && "kb-data-table__row--selected",
2528
+ f && "kb-data-table__row--interactive"
2529
+ ].filter(Boolean).join(" "),
2530
+ "aria-selected": c ? s : void 0,
2531
+ onClick: f ? () => f(r, a) : void 0,
2532
+ children: [c ? /* @__PURE__ */ t("td", {
2533
+ className: "kb-data-table__td kb-data-table__select",
2534
+ onClick: (e) => e.stopPropagation(),
2535
+ children: /* @__PURE__ */ t(y, {
2536
+ "aria-label": C(r),
2537
+ checked: s,
2538
+ onChange: () => F(s ? M.filter((e) => e !== o) : [...M, o])
2539
+ })
2540
+ }) : null, e.map((e) => /* @__PURE__ */ t("td", {
2541
+ className: ["kb-data-table__td", Et(e.align)].filter(Boolean).join(" "),
2542
+ children: e.render ? e.render(r, a) : r[e.key]
2543
+ }, e.key))]
2544
+ }, o);
2545
+ }) })
2546
+ ]
2547
+ })
2548
+ });
2549
+ }
2550
+ //#endregion
2551
+ //#region src/components/EmptyState/EmptyState.tsx
2552
+ function Ot({ icon: e, illustration: r, title: i, description: a, action: o, compact: s, className: c, children: l, ...u }) {
2553
+ return /* @__PURE__ */ n("div", {
2554
+ className: [
2555
+ "kb-empty-state",
2556
+ s && "kb-empty-state--compact",
2557
+ c
2558
+ ].filter(Boolean).join(" "),
2559
+ ...u,
2560
+ children: [
2561
+ r ? /* @__PURE__ */ t("div", {
2562
+ className: "kb-empty-state__icon kb-empty-state__icon--illustration",
2563
+ "aria-hidden": "true",
2564
+ children: r
2565
+ }) : e ? /* @__PURE__ */ t("div", {
2566
+ className: "kb-empty-state__icon",
2567
+ "aria-hidden": "true",
2568
+ children: e
2569
+ }) : null,
2570
+ i ? /* @__PURE__ */ t("p", {
2571
+ className: "kb-empty-state__title",
2572
+ children: i
2573
+ }) : null,
2574
+ a ? /* @__PURE__ */ t("p", {
2575
+ className: "kb-empty-state__description",
2576
+ children: a
2577
+ }) : null,
2578
+ l,
2579
+ o ? /* @__PURE__ */ t("div", {
2580
+ className: "kb-empty-state__actions",
2581
+ children: o
2582
+ }) : null
2583
+ ]
2584
+ });
2585
+ }
2586
+ //#endregion
2587
+ //#region src/components/Progress/Progress.tsx
2588
+ function kt({ value: e, max: r = 100, indeterminate: i, label: a, showValue: o, valueLabel: s, tone: c = "brand", size: l = "md", steps: u, className: f, "aria-label": p, ...m }) {
2589
+ let h = d(), g = u !== void 0 && u > 0, _ = g ? u : r, v = !g && (i || e === void 0), y = Math.min(Math.max(e ?? 0, 0), _), b = _ > 0 ? y / _ * 100 : 0, x = g ? `${y} / ${_}` : `${Math.round(b)}%`, S = [
2590
+ "kb-progress",
2591
+ c !== "brand" && `kb-progress--${c}`,
2592
+ l === "sm" && "kb-progress--sm",
2593
+ v && "kb-progress--indeterminate",
2594
+ f
2595
+ ].filter(Boolean).join(" ");
2596
+ return /* @__PURE__ */ n("div", {
2597
+ className: S,
2598
+ ...m,
2599
+ children: [a || o && !v ? /* @__PURE__ */ n("div", {
2600
+ className: "kb-progress__header",
2601
+ children: [a ? /* @__PURE__ */ t("span", {
2602
+ className: "kb-progress__label",
2603
+ id: h,
2604
+ children: a
2605
+ }) : null, o && !v ? /* @__PURE__ */ t("span", {
2606
+ className: "kb-progress__value",
2607
+ children: s ?? x
2608
+ }) : null]
2609
+ }) : null, /* @__PURE__ */ t("div", {
2610
+ className: ["kb-progress__track", g && "kb-progress__track--steps"].filter(Boolean).join(" "),
2611
+ role: "progressbar",
2612
+ "aria-labelledby": a ? h : void 0,
2613
+ "aria-label": a ? void 0 : p,
2614
+ "aria-valuemin": v ? void 0 : 0,
2615
+ "aria-valuemax": v ? void 0 : _,
2616
+ "aria-valuenow": v ? void 0 : y,
2617
+ "aria-valuetext": v ? void 0 : typeof s == "string" ? s : x,
2618
+ children: g ? Array.from({ length: u }, (e, n) => /* @__PURE__ */ t("span", { className: ["kb-progress__segment", n < y && "kb-progress__segment--done"].filter(Boolean).join(" ") }, n)) : /* @__PURE__ */ t("div", {
2619
+ className: "kb-progress__bar",
2620
+ style: v ? void 0 : { "--kb-progress-value": `${b}%` }
2621
+ })
2622
+ })]
2623
+ });
2624
+ }
2625
+ //#endregion
2626
+ //#region src/components/Alert/Alert.tsx
2627
+ var At = {
2628
+ fill: "none",
2629
+ stroke: "currentColor",
2630
+ strokeWidth: 1.6,
2631
+ strokeLinecap: "round",
2632
+ strokeLinejoin: "round"
2633
+ }, jt = {
2634
+ info: /* @__PURE__ */ n("svg", {
2635
+ viewBox: "0 0 20 20",
2636
+ ...At,
2637
+ children: [/* @__PURE__ */ t("circle", {
2638
+ cx: "10",
2639
+ cy: "10",
2640
+ r: "7.25"
2641
+ }), /* @__PURE__ */ t("path", { d: "M10 9v4.5M10 6.5v.01" })]
2642
+ }),
2643
+ success: /* @__PURE__ */ n("svg", {
2644
+ viewBox: "0 0 20 20",
2645
+ ...At,
2646
+ children: [/* @__PURE__ */ t("circle", {
2647
+ cx: "10",
2648
+ cy: "10",
2649
+ r: "7.25"
2650
+ }), /* @__PURE__ */ t("path", { d: "m7 10 2 2 4-4" })]
2651
+ }),
2652
+ warning: /* @__PURE__ */ n("svg", {
2653
+ viewBox: "0 0 20 20",
2654
+ ...At,
2655
+ children: [/* @__PURE__ */ t("path", { d: "M10 3 2.5 16.5h15z" }), /* @__PURE__ */ t("path", { d: "M10 8.5v3.5M10 14v.01" })]
2656
+ }),
2657
+ error: /* @__PURE__ */ n("svg", {
2658
+ viewBox: "0 0 20 20",
2659
+ ...At,
2660
+ children: [/* @__PURE__ */ t("circle", {
2661
+ cx: "10",
2662
+ cy: "10",
2663
+ r: "7.25"
2664
+ }), /* @__PURE__ */ t("path", { d: "m7.5 7.5 5 5m0-5-5 5" })]
2665
+ })
2666
+ };
2667
+ function Mt({ tone: e = "info", variant: r = "subtle", title: i, icon: a, action: o, onDismiss: s, dismissLabel: c = "Dismiss", role: l, className: u, children: d, ...f }) {
2668
+ let p = a === !1 ? null : a ?? jt[e];
2669
+ return /* @__PURE__ */ n("div", {
2670
+ role: l ?? (e === "error" || e === "warning" ? "alert" : "status"),
2671
+ className: [
2672
+ "kb-alert",
2673
+ `kb-alert--${e}`,
2674
+ `kb-alert--${r}`,
2675
+ u
2676
+ ].filter(Boolean).join(" "),
2677
+ ...f,
2678
+ children: [
2679
+ p ? /* @__PURE__ */ t("span", {
2680
+ className: "kb-alert__icon",
2681
+ "aria-hidden": "true",
2682
+ children: p
2683
+ }) : null,
2684
+ /* @__PURE__ */ n("div", {
2685
+ className: "kb-alert__content",
2686
+ children: [i ? /* @__PURE__ */ t("p", {
2687
+ className: "kb-alert__title",
2688
+ children: i
2689
+ }) : null, d ? /* @__PURE__ */ t("div", {
2690
+ className: "kb-alert__body",
2691
+ children: d
2692
+ }) : null]
2693
+ }),
2694
+ o ? /* @__PURE__ */ t("div", {
2695
+ className: "kb-alert__actions",
2696
+ children: o
2697
+ }) : null,
2698
+ s ? /* @__PURE__ */ t("button", {
2699
+ type: "button",
2700
+ className: "kb-alert__dismiss",
2701
+ "aria-label": c,
2702
+ onClick: s,
2703
+ children: /* @__PURE__ */ t("svg", {
2704
+ viewBox: "0 0 20 20",
2705
+ ...At,
2706
+ strokeWidth: 2,
2707
+ children: /* @__PURE__ */ t("path", { d: "M5 5l10 10M15 5 5 15" })
2708
+ })
2709
+ }) : null
2710
+ ]
2711
+ });
2712
+ }
2713
+ //#endregion
2714
+ //#region src/components/Breadcrumb/Breadcrumb.tsx
2715
+ var Nt = () => /* @__PURE__ */ t("svg", {
2716
+ viewBox: "0 0 20 20",
2717
+ fill: "none",
2718
+ stroke: "currentColor",
2719
+ strokeWidth: "1.8",
2720
+ strokeLinecap: "round",
2721
+ strokeLinejoin: "round",
2722
+ children: /* @__PURE__ */ t("path", { d: "m8 5 5 5-5 5" })
2723
+ });
2724
+ function Pt({ items: e, size: r = "md", separator: i, className: a, "aria-label": o = "Breadcrumb", ...s }) {
2725
+ return /* @__PURE__ */ t("nav", {
2726
+ "aria-label": o,
2727
+ className: [
2728
+ "kb-breadcrumb",
2729
+ r === "lg" && "kb-breadcrumb--lg",
2730
+ a
2731
+ ].filter(Boolean).join(" "),
2732
+ ...s,
2733
+ children: /* @__PURE__ */ t("ol", {
2734
+ className: "kb-breadcrumb__list",
2735
+ children: e.map((r, a) => {
2736
+ let o = a === e.length - 1;
2737
+ return /* @__PURE__ */ n("li", {
2738
+ className: "kb-breadcrumb__item",
2739
+ children: [o ? /* @__PURE__ */ t("span", {
2740
+ className: "kb-breadcrumb__current",
2741
+ "aria-current": "page",
2742
+ children: r.label
2743
+ }) : r.href ? /* @__PURE__ */ t("a", {
2744
+ className: "kb-breadcrumb__link",
2745
+ href: r.href,
2746
+ onClick: r.onClick,
2747
+ children: r.label
2748
+ }) : r.onClick ? /* @__PURE__ */ t("button", {
2749
+ type: "button",
2750
+ className: "kb-breadcrumb__link",
2751
+ onClick: r.onClick,
2752
+ children: r.label
2753
+ }) : /* @__PURE__ */ t("span", { children: r.label }), o ? null : /* @__PURE__ */ t("span", {
2754
+ className: "kb-breadcrumb__separator",
2755
+ "aria-hidden": "true",
2756
+ children: i ?? /* @__PURE__ */ t(Nt, {})
2757
+ })]
2758
+ }, a);
2759
+ })
2760
+ })
2761
+ });
2762
+ }
2763
+ //#endregion
2764
+ //#region src/components/Drawer/Drawer.tsx
2765
+ var Ft = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
2766
+ function It({ open: e, onClose: r, title: i, footer: a, footerStart: o, side: s = "right", size: c = "md", closeOnOverlay: l = !0, hideClose: f, closeLabel: p = "Close", className: h, children: g, ..._ }) {
2767
+ let v = d(), y = m(null), b = m(r);
2768
+ return b.current = r, u(() => {
2769
+ if (!e) return;
2770
+ let t = document.activeElement, n = y.current;
2771
+ (n?.querySelector(Ft) ?? n)?.focus();
2772
+ let r = (e) => {
2773
+ if (e.key === "Escape") {
2774
+ e.stopPropagation(), b.current();
2775
+ return;
2776
+ }
2777
+ if (e.key !== "Tab" || !n) return;
2778
+ let t = Array.from(n.querySelectorAll(Ft));
2779
+ if (t.length === 0) {
2780
+ e.preventDefault(), n.focus();
2781
+ return;
2782
+ }
2783
+ let r = t[0], i = t[t.length - 1], a = document.activeElement;
2784
+ e.shiftKey && (a === r || a === n) ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
2785
+ };
2786
+ return document.addEventListener("keydown", r), () => {
2787
+ document.removeEventListener("keydown", r), t?.focus?.();
2788
+ };
2789
+ }, [e]), e ? /* @__PURE__ */ t("div", {
2790
+ className: "kb-drawer-backdrop",
2791
+ onMouseDown: (e) => l && e.target === e.currentTarget && r(),
2792
+ children: /* @__PURE__ */ n("aside", {
2793
+ ref: y,
2794
+ role: "dialog",
2795
+ "aria-modal": "true",
2796
+ "aria-labelledby": i ? v : void 0,
2797
+ tabIndex: -1,
2798
+ className: [
2799
+ "kb-drawer",
2800
+ `kb-drawer--${s}`,
2801
+ `kb-drawer--${c}`,
2802
+ h
2803
+ ].filter(Boolean).join(" "),
2804
+ ..._,
2805
+ children: [
2806
+ i || !f ? /* @__PURE__ */ n("div", {
2807
+ className: "kb-drawer__header",
2808
+ children: [i ? /* @__PURE__ */ t("h2", {
2809
+ className: "kb-drawer__title",
2810
+ id: v,
2811
+ children: i
2812
+ }) : null, f ? null : /* @__PURE__ */ t("button", {
2813
+ type: "button",
2814
+ className: "kb-icon-button kb-drawer__close",
2815
+ "aria-label": p,
2816
+ onClick: r,
2817
+ children: /* @__PURE__ */ t("svg", {
2818
+ viewBox: "0 0 20 20",
2819
+ fill: "none",
2820
+ stroke: "currentColor",
2821
+ strokeWidth: "1.8",
2822
+ strokeLinecap: "round",
2823
+ children: /* @__PURE__ */ t("path", { d: "M5 5l10 10M15 5 5 15" })
2824
+ })
2825
+ })]
2826
+ }) : null,
2827
+ /* @__PURE__ */ t("div", {
2828
+ className: "kb-drawer__body",
2829
+ children: g
2830
+ }),
2831
+ a || o ? /* @__PURE__ */ n("div", {
2832
+ className: "kb-drawer__footer",
2833
+ children: [o ? /* @__PURE__ */ t("div", {
2834
+ className: "kb-drawer__footer-start",
2835
+ children: o
2836
+ }) : null, a]
2837
+ }) : null
2838
+ ]
2839
+ })
2840
+ }) : null;
2841
+ }
2842
+ //#endregion
2843
+ //#region src/components/FormSection/FormSection.tsx
2844
+ function Lt({ title: r, description: i, info: a, headerActions: o, layout: s = "stacked", headingLevel: c = 2, className: l, children: u, ...f }) {
2845
+ let p = d(), m = `h${c}`, h = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("div", {
2846
+ className: "kb-form-section__header",
2847
+ children: [
2848
+ /* @__PURE__ */ t(m, {
2849
+ className: "kb-form-section__title",
2850
+ id: p,
2851
+ children: r
2852
+ }),
2853
+ a ? /* @__PURE__ */ t("span", {
2854
+ className: "kb-form-section__info",
2855
+ children: a
2856
+ }) : null,
2857
+ o ? /* @__PURE__ */ t("div", {
2858
+ className: "kb-form-section__header-actions",
2859
+ children: o
2860
+ }) : null
2861
+ ]
2862
+ }), i ? /* @__PURE__ */ t("p", {
2863
+ className: "kb-form-section__description",
2864
+ children: i
2865
+ }) : null] });
2866
+ return /* @__PURE__ */ n("section", {
2867
+ "aria-labelledby": p,
2868
+ className: [
2869
+ "kb-form-section",
2870
+ s === "aside" && "kb-form-section--aside",
2871
+ l
2872
+ ].filter(Boolean).join(" "),
2873
+ ...f,
2874
+ children: [s === "aside" ? /* @__PURE__ */ t("div", {
2875
+ className: "kb-form-section__aside",
2876
+ children: h
2877
+ }) : h, /* @__PURE__ */ t("div", {
2878
+ className: "kb-form-section__content",
2879
+ children: u
2880
+ })]
2881
+ });
2882
+ }
2883
+ function Rt({ label: e, hint: r, labelExtra: i, htmlFor: a, className: o, children: s, ...c }) {
2884
+ let l = d(), u = a ? "label" : "div";
2885
+ return /* @__PURE__ */ n("div", {
2886
+ className: ["kb-form-section__row", o].filter(Boolean).join(" "),
2887
+ ...c,
2888
+ children: [/* @__PURE__ */ n("div", {
2889
+ className: "kb-form-section__row-label",
2890
+ children: [/* @__PURE__ */ n("span", {
2891
+ className: "kb-form-section__row-label-text",
2892
+ children: [/* @__PURE__ */ t(u, {
2893
+ id: l,
2894
+ ...a ? { htmlFor: a } : {},
2895
+ children: e
2896
+ }), i]
2897
+ }), r ? /* @__PURE__ */ t("span", {
2898
+ className: "kb-form-section__row-hint",
2899
+ children: r
2900
+ }) : null]
2901
+ }), /* @__PURE__ */ t("div", {
2902
+ className: "kb-form-section__row-control",
2903
+ role: a ? void 0 : "group",
2904
+ "aria-labelledby": a ? void 0 : l,
2905
+ children: s
2906
+ })]
2907
+ });
2908
+ }
2909
+ function zt({ start: e, sticky: r = !0, className: i, children: a, ...o }) {
2910
+ return /* @__PURE__ */ n("div", {
2911
+ className: [
2912
+ "kb-action-footer",
2913
+ !r && "kb-action-footer--static",
2914
+ i
2915
+ ].filter(Boolean).join(" "),
2916
+ ...o,
2917
+ children: [e ? /* @__PURE__ */ t("div", {
2918
+ className: "kb-action-footer__start",
2919
+ children: e
2920
+ }) : null, a]
2921
+ });
2922
+ }
2923
+ //#endregion
2924
+ //#region src/components/OptionCard/OptionCard.tsx
2925
+ var Bt = o(null);
2926
+ function Vt({ title: e, description: r, indicator: i, icon: a, aside: o, size: s, value: c, checked: u, disabled: f, onChange: p, className: m, id: h, name: g, ..._ }) {
2927
+ let v = l(Bt), y = d(), b = h ?? y, x = v?.type ?? i ?? "radio", S = v && c != null ? v.isChecked(c) : u, C = f || v?.disabled, w = v?.size ?? s ?? "md", T = r ? `${b}-desc` : void 0, E = [
2928
+ "kb-option-card",
2929
+ w === "sm" && "kb-option-card--sm",
2930
+ S && "kb-option-card--selected",
2931
+ C && "kb-option-card--disabled",
2932
+ m
2933
+ ].filter(Boolean).join(" ");
2934
+ return /* @__PURE__ */ n("label", {
2935
+ className: E,
2936
+ htmlFor: b,
2937
+ children: [
2938
+ /* @__PURE__ */ n("span", {
2939
+ className: "kb-option-card__control",
2940
+ children: [/* @__PURE__ */ t("input", {
2941
+ id: b,
2942
+ type: x,
2943
+ name: v?.name ?? g,
2944
+ value: c,
2945
+ checked: S,
2946
+ disabled: C,
2947
+ "aria-describedby": T,
2948
+ className: x === "radio" ? "kb-radio__input" : "kb-checkbox__input",
2949
+ onChange: (e) => {
2950
+ v && c != null && v.toggle(c, e.target.checked), p?.(e.target.checked, e);
2951
+ },
2952
+ ..._
2953
+ }), /* @__PURE__ */ t("span", {
2954
+ className: x === "radio" ? "kb-radio__dot" : "kb-checkbox__box",
2955
+ "aria-hidden": "true"
2956
+ })]
2957
+ }),
2958
+ a ? /* @__PURE__ */ t("span", {
2959
+ className: "kb-option-card__icon",
2960
+ "aria-hidden": "true",
2961
+ children: a
2962
+ }) : null,
2963
+ /* @__PURE__ */ n("span", {
2964
+ className: "kb-option-card__body",
2965
+ children: [/* @__PURE__ */ t("span", {
2966
+ className: "kb-option-card__title",
2967
+ children: e
2968
+ }), r ? /* @__PURE__ */ t("span", {
2969
+ className: "kb-option-card__description",
2970
+ id: T,
2971
+ children: r
2972
+ }) : null]
2973
+ }),
2974
+ o ? /* @__PURE__ */ t("span", {
2975
+ className: "kb-option-card__aside",
2976
+ children: o
2977
+ }) : null
2978
+ ]
2979
+ });
2980
+ }
2981
+ function Ht(e) {
2982
+ let { label: n, name: r, horizontal: i, disabled: a, size: o = "md", className: s, children: c, type: l = "radio", value: u, defaultValue: f, onChange: p, ...m } = e, g = d(), [_, v] = h(f), y = u !== void 0, b = y ? u : _, x = {
2983
+ type: l,
2984
+ name: r ?? g,
2985
+ disabled: a,
2986
+ size: o,
2987
+ isChecked: (e) => l === "checkbox" ? Array.isArray(b) && b.includes(e) : b === e,
2988
+ toggle: (e, t) => {
2989
+ let n;
2990
+ if (l === "checkbox") {
2991
+ let r = Array.isArray(b) ? b : [];
2992
+ n = t ? [...r.filter((t) => t !== e), e] : r.filter((t) => t !== e), p?.(n);
2993
+ } else {
2994
+ if (!t) return;
2995
+ n = e, p?.(n);
2996
+ }
2997
+ y || v(n);
2998
+ }
2999
+ };
3000
+ return /* @__PURE__ */ t(Bt.Provider, {
3001
+ value: x,
3002
+ children: /* @__PURE__ */ t("div", {
3003
+ role: l === "radio" ? "radiogroup" : "group",
3004
+ "aria-label": n,
3005
+ "aria-disabled": a || void 0,
3006
+ className: [
3007
+ "kb-option-card-group",
3008
+ i && "kb-option-card-group--horizontal",
3009
+ s
3010
+ ].filter(Boolean).join(" "),
3011
+ ...m,
3012
+ children: c
3013
+ })
3014
+ });
3015
+ }
3016
+ //#endregion
3017
+ //#region src/components/TicketNumber/TicketNumber.tsx
3018
+ function Ut({ number: e, label: r, size: i = "md", tone: a = "default", layout: o = "stack", centered: s, status: c, meta: l, live: u, className: d, children: f, ...p }) {
3019
+ let m = [
3020
+ "kb-ticket-number",
3021
+ `kb-ticket-number--${i}`,
3022
+ a !== "default" && `kb-ticket-number--${a}`,
3023
+ o === "inline" && "kb-ticket-number--inline",
3024
+ s && "kb-ticket-number--center",
3025
+ d
3026
+ ].filter(Boolean).join(" ");
3027
+ return /* @__PURE__ */ n("div", {
3028
+ className: m,
3029
+ "aria-live": u ? "polite" : void 0,
3030
+ "aria-atomic": u ? !0 : void 0,
3031
+ ...p,
3032
+ children: [
3033
+ r ? /* @__PURE__ */ t("span", {
3034
+ className: "kb-ticket-number__label",
3035
+ children: r
3036
+ }) : null,
3037
+ /* @__PURE__ */ t("span", {
3038
+ className: "kb-ticket-number__value",
3039
+ children: e
3040
+ }),
3041
+ c ? /* @__PURE__ */ t("span", {
3042
+ className: "kb-ticket-number__status",
3043
+ children: c
3044
+ }) : null,
3045
+ l && l.length ? /* @__PURE__ */ t("dl", {
3046
+ className: "kb-ticket-number__meta",
3047
+ children: l.map((e, r) => /* @__PURE__ */ n("div", {
3048
+ className: "kb-ticket-number__meta-item",
3049
+ children: [/* @__PURE__ */ t("dt", { children: e.label }), /* @__PURE__ */ t("dd", { children: e.value })]
3050
+ }, r))
3051
+ }) : null,
3052
+ f ? /* @__PURE__ */ t("div", {
3053
+ className: "kb-ticket-number__extra",
3054
+ children: f
3055
+ }) : null
3056
+ ]
3057
+ });
3058
+ }
3059
+ //#endregion
3060
+ //#region src/components/QueueItem/QueueItem.tsx
3061
+ var Wt = o(void 0), Gt = {
3062
+ cancelled: "Cancel",
3063
+ "no-show": "No Show"
3064
+ };
3065
+ function Kt({ number: r, subline: i, state: a = "waiting", tag: o, selected: s, surface: c, actions: u, onSelect: d, selectLabel: f, className: p, ...m }) {
3066
+ let h = l(Wt), g = c ?? h ?? "light", _ = o === !1 ? null : o ?? Gt[a] ?? null, v = [
3067
+ "kb-queue-item",
3068
+ `kb-queue-item--${g}`,
3069
+ a !== "waiting" && `kb-queue-item--${a}`,
3070
+ s && "kb-queue-item--selected",
3071
+ _ && "kb-queue-item--tagged",
3072
+ p
3073
+ ].filter(Boolean).join(" "), y = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
3074
+ className: "kb-queue-item__number",
3075
+ children: r
3076
+ }), i ? /* @__PURE__ */ t("span", {
3077
+ className: "kb-queue-item__subline",
3078
+ children: i
3079
+ }) : null] });
3080
+ return /* @__PURE__ */ n("div", {
3081
+ className: v,
3082
+ "data-state": a,
3083
+ ...m,
3084
+ children: [
3085
+ _ ? /* @__PURE__ */ t("span", {
3086
+ className: `kb-queue-item__tag kb-queue-item__tag--${a}`,
3087
+ children: _
3088
+ }) : null,
3089
+ d ? /* @__PURE__ */ t("button", {
3090
+ type: "button",
3091
+ className: "kb-queue-item__main",
3092
+ onClick: d,
3093
+ "aria-pressed": !!s,
3094
+ "aria-label": f,
3095
+ children: y
3096
+ }) : /* @__PURE__ */ t("div", {
3097
+ className: "kb-queue-item__main",
3098
+ children: y
3099
+ }),
3100
+ u ? /* @__PURE__ */ t("div", {
3101
+ className: "kb-queue-item__actions",
3102
+ children: u
3103
+ }) : null
3104
+ ]
3105
+ });
3106
+ }
3107
+ function qt({ surface: e = "light", search: r, label: i = "Queue", className: a, children: o, ...s }) {
3108
+ return /* @__PURE__ */ t(Wt.Provider, {
3109
+ value: e,
3110
+ children: /* @__PURE__ */ n("aside", {
3111
+ className: [
3112
+ "kb-queue-rail",
3113
+ e === "dark" && "kb-queue-rail--dark",
3114
+ a
3115
+ ].filter(Boolean).join(" "),
3116
+ "aria-label": i,
3117
+ ...s,
3118
+ children: [r ? /* @__PURE__ */ t("div", {
3119
+ className: "kb-queue-rail__search",
3120
+ children: r
3121
+ }) : null, o]
3122
+ })
3123
+ });
3124
+ }
3125
+ function Jt({ title: e, count: i, action: a, emptyText: o, className: c, children: l, ...u }) {
3126
+ let d = r.toArray(l);
3127
+ return /* @__PURE__ */ n("section", {
3128
+ className: ["kb-queue-rail__section", c].filter(Boolean).join(" "),
3129
+ ...u,
3130
+ children: [/* @__PURE__ */ n("header", {
3131
+ className: "kb-queue-rail__header",
3132
+ children: [
3133
+ /* @__PURE__ */ t("h3", {
3134
+ className: "kb-queue-rail__title",
3135
+ children: e
3136
+ }),
3137
+ i == null ? null : /* @__PURE__ */ t("span", {
3138
+ className: "kb-queue-rail__count",
3139
+ children: i
3140
+ }),
3141
+ a ? /* @__PURE__ */ t("span", {
3142
+ className: "kb-queue-rail__action",
3143
+ children: a
3144
+ }) : null
3145
+ ]
3146
+ }), d.length ? /* @__PURE__ */ t("ul", {
3147
+ className: "kb-queue-rail__list",
3148
+ children: d.map((e, n) => /* @__PURE__ */ t("li", { children: e }, s(e) && e.key != null ? e.key : n))
3149
+ }) : o ? /* @__PURE__ */ t("p", {
3150
+ className: "kb-queue-rail__empty",
3151
+ children: o
3152
+ }) : null]
3153
+ });
3154
+ }
3155
+ //#endregion
3156
+ //#region src/components/NumberBoard/NumberBoard.tsx
3157
+ var Yt = {
3158
+ calling: "Calling",
3159
+ yours: "Yours"
3160
+ };
3161
+ function Xt({ title: e, headerTone: r = "brand", numbers: i, columns: a = 4, size: o = "compact", highlight: s, tagLabels: c, emptyText: l, headingLevel: u = 2, live: f, className: p, style: m, ...h }) {
3162
+ let g = d(), _ = `h${u}`, v = {
3163
+ ...Yt,
3164
+ ...c
3165
+ }, y = i.map((e) => typeof e == "object" ? e : { number: e });
3166
+ return /* @__PURE__ */ n("section", {
3167
+ className: [
3168
+ "kb-number-board",
3169
+ `kb-number-board--${o}`,
3170
+ p
3171
+ ].filter(Boolean).join(" "),
3172
+ "aria-labelledby": e ? g : void 0,
3173
+ style: {
3174
+ "--kb-number-board-columns": a,
3175
+ ...m
3176
+ },
3177
+ ...h,
3178
+ children: [e ? /* @__PURE__ */ t(_, {
3179
+ id: g,
3180
+ className: ["kb-number-board__header", r === "neutral" && "kb-number-board__header--neutral"].filter(Boolean).join(" "),
3181
+ children: e
3182
+ }) : null, y.length ? /* @__PURE__ */ t("ul", {
3183
+ className: "kb-number-board__grid",
3184
+ "aria-live": f ? "polite" : void 0,
3185
+ "aria-relevant": f ? "additions" : void 0,
3186
+ children: y.map((e) => {
3187
+ let r = e.highlight ?? s?.[String(e.number)], i = e.tag ?? (r ? v[r] : null);
3188
+ return /* @__PURE__ */ n("li", {
3189
+ className: ["kb-number-board__cell", r && `kb-number-board__cell--${r}`].filter(Boolean).join(" "),
3190
+ children: [i ? /* @__PURE__ */ t("span", {
3191
+ className: "kb-number-board__tag",
3192
+ children: i
3193
+ }) : null, /* @__PURE__ */ t("span", {
3194
+ className: "kb-number-board__number",
3195
+ children: e.number
3196
+ })]
3197
+ }, e.number);
3198
+ })
3199
+ }) : l ? /* @__PURE__ */ t("p", {
3200
+ className: "kb-number-board__empty",
3201
+ children: l
3202
+ }) : null]
3203
+ });
3204
+ }
3205
+ function Zt({ counter: e, number: r, idleText: i = "—", calling: a, className: o, ...s }) {
3206
+ let c = r == null || r === "";
3207
+ return /* @__PURE__ */ n("div", {
3208
+ className: [
3209
+ "kb-counter-tile",
3210
+ a && "kb-counter-tile--calling",
3211
+ c && "kb-counter-tile--idle",
3212
+ o
3213
+ ].filter(Boolean).join(" "),
3214
+ ...s,
3215
+ children: [/* @__PURE__ */ t("div", {
3216
+ className: "kb-counter-tile__header",
3217
+ children: e
3218
+ }), /* @__PURE__ */ t("div", {
3219
+ className: "kb-counter-tile__number",
3220
+ children: c ? i : r
3221
+ })]
3222
+ });
3223
+ }
3224
+ //#endregion
3225
+ //#region src/components/Marquee/Marquee.tsx
3226
+ function Qt({ items: e, separator: r = "•", speed: a = 80, tone: o = "neutral", size: s = "md", paused: c, pauseOnHover: l = !0, className: d, style: f, children: p, ...g }) {
3227
+ let _ = m(null), [v, y] = h(null);
3228
+ u(() => {
3229
+ let e = _.current;
3230
+ if (!e) return;
3231
+ let t = () => {
3232
+ let t = e.getBoundingClientRect().width;
3233
+ t > 0 && a > 0 && y(t / a);
3234
+ };
3235
+ if (t(), typeof ResizeObserver > "u") return;
3236
+ let n = new ResizeObserver(t);
3237
+ return n.observe(e), () => n.disconnect();
3238
+ }, [a]);
3239
+ let b = e ? e.map((e, a) => /* @__PURE__ */ n(i, { children: [a > 0 ? /* @__PURE__ */ t("span", {
3240
+ className: "kb-marquee__separator",
3241
+ "aria-hidden": "true",
3242
+ children: r
3243
+ }) : null, /* @__PURE__ */ t("span", { children: e })] }, a)) : /* @__PURE__ */ t("span", { children: p }), x = [
3244
+ "kb-marquee",
3245
+ o === "brand" && "kb-marquee--brand",
3246
+ s === "sm" && "kb-marquee--sm",
3247
+ c && "kb-marquee--paused",
3248
+ l && "kb-marquee--hover-pause",
3249
+ d
3250
+ ].filter(Boolean).join(" ");
3251
+ return /* @__PURE__ */ t("div", {
3252
+ className: x,
3253
+ role: "marquee",
3254
+ style: {
3255
+ ...v ? { "--kb-marquee-duration": `${v.toFixed(2)}s` } : {},
3256
+ ...f
3257
+ },
3258
+ ...g,
3259
+ children: /* @__PURE__ */ n("div", {
3260
+ className: "kb-marquee__track",
3261
+ children: [/* @__PURE__ */ t("span", {
3262
+ className: "kb-marquee__content",
3263
+ ref: _,
3264
+ children: b
3265
+ }), /* @__PURE__ */ t("span", {
3266
+ className: "kb-marquee__content kb-marquee__content--clone",
3267
+ "aria-hidden": "true",
3268
+ children: b
3269
+ })]
3270
+ })
3271
+ });
3272
+ }
3273
+ //#endregion
3274
+ //#region src/components/ScreenHeader/ScreenHeader.tsx
3275
+ function $t({ variant: e = "surface", shadow: r = !1, start: i, center: a, end: o, className: s, children: c, ...l }) {
3276
+ let u = [
3277
+ "kb-screen-header",
3278
+ `kb-screen-header--${e}`,
3279
+ r && "kb-screen-header--shadow",
3280
+ s
3281
+ ].filter(Boolean).join(" ");
3282
+ return /* @__PURE__ */ n("header", {
3283
+ className: u,
3284
+ ...l,
3285
+ children: [
3286
+ /* @__PURE__ */ t("div", {
3287
+ className: "kb-screen-header__start",
3288
+ children: i
3289
+ }),
3290
+ /* @__PURE__ */ t("div", {
3291
+ className: "kb-screen-header__center",
3292
+ children: a ?? c
3293
+ }),
3294
+ /* @__PURE__ */ t("div", {
3295
+ className: "kb-screen-header__end",
3296
+ children: o
3297
+ })
3298
+ ]
3299
+ });
3300
+ }
3301
+ //#endregion
3302
+ //#region src/components/ScreenHeader/Clock.tsx
3303
+ var en = [
3304
+ "Sun",
3305
+ "Mon",
3306
+ "Tue",
3307
+ "Wed",
3308
+ "Thu",
3309
+ "Fri",
3310
+ "Sat"
3311
+ ], tn = (e) => String(e).padStart(2, "0"), nn = "YYYY/MM/DD ddd. HH:mm";
3312
+ function rn(e, t = nn) {
3313
+ let n = {
3314
+ YYYY: String(e.getFullYear()),
3315
+ MM: tn(e.getMonth() + 1),
3316
+ DD: tn(e.getDate()),
3317
+ ddd: en[e.getDay()],
3318
+ HH: tn(e.getHours()),
3319
+ mm: tn(e.getMinutes()),
3320
+ ss: tn(e.getSeconds())
3321
+ };
3322
+ return t.replace(/YYYY|MM|DD|ddd|HH|mm|ss/g, (e) => n[e]);
3323
+ }
3324
+ function an({ format: e = nn, now: n, interval: r = 1e3, className: i, ...a }) {
3325
+ let [o, s] = h(() => /* @__PURE__ */ new Date());
3326
+ u(() => {
3327
+ if (n) return;
3328
+ s(/* @__PURE__ */ new Date());
3329
+ let e = window.setInterval(() => s(/* @__PURE__ */ new Date()), r);
3330
+ return () => window.clearInterval(e);
3331
+ }, [n, r]);
3332
+ let c = n ?? o, l = typeof e == "function" ? e(c) : rn(c, e);
3333
+ return /* @__PURE__ */ t("time", {
3334
+ className: ["kb-clock", i].filter(Boolean).join(" "),
3335
+ dateTime: c.toISOString(),
3336
+ ...a,
3337
+ children: l
3338
+ });
3339
+ }
3340
+ //#endregion
3341
+ //#region src/components/TileCard/TileCard.tsx
3342
+ function on({ title: e, icon: r, tone: i = "brand", indicator: a = "checkbox", description: o, stats: s, selected: c = !1, onSelectedChange: l, selectable: u, disabled: d = !1, solid: f = !1, className: p, children: m, onClick: h, onKeyDown: g, ..._ }) {
3343
+ let v = u ?? !!(l || h), y = [
3344
+ "kb-tile-card",
3345
+ v && "kb-tile-card--selectable",
3346
+ c && "kb-tile-card--selected",
3347
+ d && "kb-tile-card--disabled",
3348
+ f && "kb-tile-card--solid",
3349
+ p
3350
+ ].filter(Boolean).join(" "), b = () => {
3351
+ d || l?.(!c);
3352
+ }, x = (e) => {
3353
+ d || (h?.(e), e.defaultPrevented || b());
3354
+ }, S = (e) => {
3355
+ g?.(e), !(e.defaultPrevented || d) && (e.key === " " || e.key === "Enter") && (e.preventDefault(), e.currentTarget.click());
3356
+ }, C = a === "none" ? "button" : a, w = v ? {
3357
+ role: C,
3358
+ tabIndex: d ? -1 : 0,
3359
+ "aria-disabled": d || void 0,
3360
+ ...C === "button" ? { "aria-pressed": c } : { "aria-checked": c },
3361
+ onClick: x,
3362
+ onKeyDown: S
3363
+ } : {
3364
+ onClick: h,
3365
+ onKeyDown: g
3366
+ }, T = f ? "none" : i, E = e != null || r != null || a !== "none", D = o != null || s != null || m != null;
3367
+ return /* @__PURE__ */ n("div", {
3368
+ className: y,
3369
+ ...w,
3370
+ ..._,
3371
+ children: [E ? /* @__PURE__ */ n("div", {
3372
+ className: `kb-tile-card__header kb-tile-card__header--${T}`,
3373
+ children: [
3374
+ r ? /* @__PURE__ */ t("span", {
3375
+ className: "kb-tile-card__icon",
3376
+ "aria-hidden": "true",
3377
+ children: r
3378
+ }) : null,
3379
+ e == null ? null : /* @__PURE__ */ t("span", {
3380
+ className: "kb-tile-card__title",
3381
+ children: e
3382
+ }),
3383
+ a === "none" ? null : /* @__PURE__ */ t("span", {
3384
+ className: [
3385
+ "kb-tile-card__indicator",
3386
+ `kb-tile-card__indicator--${a}`,
3387
+ c && "kb-tile-card__indicator--checked"
3388
+ ].filter(Boolean).join(" "),
3389
+ "aria-hidden": "true"
3390
+ })
3391
+ ]
3392
+ }) : null, D ? /* @__PURE__ */ n("div", {
3393
+ className: "kb-tile-card__body",
3394
+ children: [
3395
+ o == null ? null : /* @__PURE__ */ t("p", {
3396
+ className: "kb-tile-card__description",
3397
+ children: o
3398
+ }),
3399
+ m,
3400
+ s == null ? null : /* @__PURE__ */ t("div", {
3401
+ className: "kb-tile-card__stats",
3402
+ children: s
3403
+ })
3404
+ ]
3405
+ }) : null]
3406
+ });
3407
+ }
3408
+ function sn({ value: e, unit: r, caption: i, className: a, ...o }) {
3409
+ return /* @__PURE__ */ n("div", {
3410
+ className: ["kb-tile-stat", a].filter(Boolean).join(" "),
3411
+ ...o,
3412
+ children: [/* @__PURE__ */ n("span", {
3413
+ className: "kb-tile-stat__value",
3414
+ children: [e, r == null ? null : /* @__PURE__ */ t("span", {
3415
+ className: "kb-tile-stat__unit",
3416
+ children: r
3417
+ })]
3418
+ }), i == null ? null : /* @__PURE__ */ t("span", {
3419
+ className: "kb-tile-stat__caption",
3420
+ children: i
3421
+ })]
3422
+ });
3423
+ }
3424
+ //#endregion
3425
+ //#region src/components/ArrowButton/ArrowButton.tsx
3426
+ function cn({ direction: e = "right", variant: r = "solid", size: i = "md", icon: a, type: o = "button", className: s, children: c, ...l }) {
3427
+ let u = [
3428
+ "kb-arrow-button",
3429
+ `kb-arrow-button--${e}`,
3430
+ `kb-arrow-button--${r}`,
3431
+ `kb-arrow-button--${i}`,
3432
+ s
3433
+ ].filter(Boolean).join(" ");
3434
+ return /* @__PURE__ */ n("button", {
3435
+ type: o,
3436
+ className: u,
3437
+ ...l,
3438
+ children: [a ? /* @__PURE__ */ t("span", {
3439
+ className: "kb-arrow-button__icon",
3440
+ "aria-hidden": "true",
3441
+ children: a
3442
+ }) : null, /* @__PURE__ */ t("span", {
3443
+ className: "kb-arrow-button__label",
3444
+ children: c
3445
+ })]
3446
+ });
3447
+ }
3448
+ //#endregion
3449
+ //#region src/components/LayoutPicker/LayoutPicker.tsx
3450
+ var ln = [
3451
+ {
3452
+ id: "full",
3453
+ name: "Full screen",
3454
+ orientation: "landscape",
3455
+ regions: [{
3456
+ x: 0,
3457
+ y: 0,
3458
+ w: 1,
3459
+ h: 1,
3460
+ name: "Main"
3461
+ }]
3462
+ },
3463
+ {
3464
+ id: "columns-2",
3465
+ name: "2 columns",
3466
+ orientation: "landscape",
3467
+ regions: [{
3468
+ x: 0,
3469
+ y: 0,
3470
+ w: .5,
3471
+ h: 1,
3472
+ name: "Left"
3473
+ }, {
3474
+ x: .5,
3475
+ y: 0,
3476
+ w: .5,
3477
+ h: 1,
3478
+ name: "Right"
3479
+ }]
3480
+ },
3481
+ {
3482
+ id: "rows-2",
3483
+ name: "2 rows",
3484
+ orientation: "landscape",
3485
+ regions: [{
3486
+ x: 0,
3487
+ y: 0,
3488
+ w: 1,
3489
+ h: .5,
3490
+ name: "Top"
3491
+ }, {
3492
+ x: 0,
3493
+ y: .5,
3494
+ w: 1,
3495
+ h: .5,
3496
+ name: "Bottom"
3497
+ }]
3498
+ },
3499
+ {
3500
+ id: "grid-2x2",
3501
+ name: "2 × 2 grid",
3502
+ orientation: "landscape",
3503
+ regions: [
3504
+ {
3505
+ x: 0,
3506
+ y: 0,
3507
+ w: .5,
3508
+ h: .5,
3509
+ name: "Top left"
3510
+ },
3511
+ {
3512
+ x: .5,
3513
+ y: 0,
3514
+ w: .5,
3515
+ h: .5,
3516
+ name: "Top right"
3517
+ },
3518
+ {
3519
+ x: 0,
3520
+ y: .5,
3521
+ w: .5,
3522
+ h: .5,
3523
+ name: "Bottom left"
3524
+ },
3525
+ {
3526
+ x: .5,
3527
+ y: .5,
3528
+ w: .5,
3529
+ h: .5,
3530
+ name: "Bottom right"
3531
+ }
3532
+ ]
3533
+ },
3534
+ {
3535
+ id: "columns-3",
3536
+ name: "3 columns",
3537
+ orientation: "landscape",
3538
+ regions: [
3539
+ {
3540
+ x: 0,
3541
+ y: 0,
3542
+ w: 1 / 3,
3543
+ h: 1,
3544
+ name: "Left"
3545
+ },
3546
+ {
3547
+ x: 1 / 3,
3548
+ y: 0,
3549
+ w: 1 / 3,
3550
+ h: 1,
3551
+ name: "Centre"
3552
+ },
3553
+ {
3554
+ x: 2 / 3,
3555
+ y: 0,
3556
+ w: 1 / 3,
3557
+ h: 1,
3558
+ name: "Right"
3559
+ }
3560
+ ]
3561
+ },
3562
+ {
3563
+ id: "l-shape",
3564
+ name: "Main + side + bottom",
3565
+ orientation: "landscape",
3566
+ regions: [
3567
+ {
3568
+ x: 0,
3569
+ y: 0,
3570
+ w: .75,
3571
+ h: .8,
3572
+ name: "Main"
3573
+ },
3574
+ {
3575
+ x: .75,
3576
+ y: 0,
3577
+ w: .25,
3578
+ h: .8,
3579
+ name: "Side"
3580
+ },
3581
+ {
3582
+ x: 0,
3583
+ y: .8,
3584
+ w: 1,
3585
+ h: .2,
3586
+ name: "Bottom"
3587
+ }
3588
+ ]
3589
+ },
3590
+ {
3591
+ id: "portrait-full",
3592
+ name: "Portrait full",
3593
+ orientation: "portrait",
3594
+ regions: [{
3595
+ x: 0,
3596
+ y: 0,
3597
+ w: 1,
3598
+ h: 1,
3599
+ name: "Main"
3600
+ }]
3601
+ },
3602
+ {
3603
+ id: "portrait-rows-2",
3604
+ name: "Portrait 2 rows",
3605
+ orientation: "portrait",
3606
+ regions: [{
3607
+ x: 0,
3608
+ y: 0,
3609
+ w: 1,
3610
+ h: .5,
3611
+ name: "Top"
3612
+ }, {
3613
+ x: 0,
3614
+ y: .5,
3615
+ w: 1,
3616
+ h: .5,
3617
+ name: "Bottom"
3618
+ }]
3619
+ }
3620
+ ], un = (...e) => e.filter(Boolean).join(" "), dn = (e) => `${+(e * 100).toFixed(4)}%`;
3621
+ function fn({ layout: r, size: i = "md", showNames: a, regionContent: o, activeRegion: s, onRegionSelect: c, label: l, className: u, ...d }) {
3622
+ return /* @__PURE__ */ t("div", {
3623
+ role: c ? "group" : "img",
3624
+ "aria-label": l ?? r.name,
3625
+ className: un("kb-layout-preview", r.orientation === "portrait" && "kb-layout-preview--portrait", i !== "md" && `kb-layout-preview--${i}`, u),
3626
+ ...d,
3627
+ children: /* @__PURE__ */ t("span", {
3628
+ className: "kb-layout-preview__stage",
3629
+ children: r.regions.map((r, i) => {
3630
+ let l = s === i, u = /* @__PURE__ */ n(e, { children: [
3631
+ /* @__PURE__ */ t("span", {
3632
+ className: "kb-layout-preview__index",
3633
+ children: i + 1
3634
+ }),
3635
+ a && r.name ? /* @__PURE__ */ t("span", {
3636
+ className: "kb-layout-preview__name",
3637
+ children: r.name
3638
+ }) : null,
3639
+ o?.[i] == null ? null : /* @__PURE__ */ t("span", {
3640
+ className: "kb-layout-preview__content",
3641
+ children: o[i]
3642
+ })
3643
+ ] }), d = un("kb-layout-preview__box", l && "kb-layout-preview__box--active");
3644
+ return /* @__PURE__ */ t("span", {
3645
+ className: "kb-layout-preview__region",
3646
+ style: {
3647
+ left: dn(r.x),
3648
+ top: dn(r.y),
3649
+ width: dn(r.w),
3650
+ height: dn(r.h)
3651
+ },
3652
+ children: c ? /* @__PURE__ */ t("button", {
3653
+ type: "button",
3654
+ className: d,
3655
+ "aria-pressed": l,
3656
+ "aria-label": `Region ${i + 1}${r.name ? `: ${r.name}` : ""}`,
3657
+ onClick: () => c(i, r),
3658
+ children: u
3659
+ }) : /* @__PURE__ */ t("span", {
3660
+ className: d,
3661
+ children: u
3662
+ })
3663
+ }, i);
3664
+ })
3665
+ })
3666
+ });
3667
+ }
3668
+ function pn({ layouts: e = ln, value: r, defaultValue: i, onChange: a, showNames: o = !0, minColumnWidth: s, disabled: c, className: l, style: u, ...d }) {
3669
+ let [f, p] = h(i ?? null), g = r === void 0 ? f : r, _ = m([]), v = (e) => !c && !e.disabled, y = e.findIndex((e) => e.id === g), b = y >= 0 && v(e[y]) ? y : e.findIndex(v), x = (t) => {
3670
+ let n = e[t];
3671
+ n && v(n) && (r === void 0 && p(n.id), n.id !== g && a?.(n.id, n));
3672
+ }, S = (t, n) => {
3673
+ let r = e.length;
3674
+ for (let i = 1; i <= r; i++) {
3675
+ let a = (t + n * i + r) % r;
3676
+ if (v(e[a])) return a;
3677
+ }
3678
+ return -1;
3679
+ }, C = (t, n) => {
3680
+ let r = -1;
3681
+ switch (t.key) {
3682
+ case "ArrowRight":
3683
+ case "ArrowDown":
3684
+ r = S(n, 1);
3685
+ break;
3686
+ case "ArrowLeft":
3687
+ case "ArrowUp":
3688
+ r = S(n, -1);
3689
+ break;
3690
+ case "Home":
3691
+ r = S(-1 + e.length, 1);
3692
+ break;
3693
+ case "End":
3694
+ r = S(0, -1);
3695
+ break;
3696
+ case " ":
3697
+ case "Enter":
3698
+ t.preventDefault(), x(n);
3699
+ return;
3700
+ default: return;
3701
+ }
3702
+ t.preventDefault(), r >= 0 && (x(r), _.current[r]?.focus());
3703
+ };
3704
+ return /* @__PURE__ */ t("div", {
3705
+ role: "radiogroup",
3706
+ "aria-disabled": c || void 0,
3707
+ className: un("kb-layout-picker", l),
3708
+ style: s ? {
3709
+ ...u,
3710
+ "--kb-layout-picker-min": s
3711
+ } : u,
3712
+ ...d,
3713
+ children: e.map((e, r) => {
3714
+ let i = e.id === g, a = v(e);
3715
+ return /* @__PURE__ */ n("div", {
3716
+ ref: (e) => {
3717
+ _.current[r] = e;
3718
+ },
3719
+ role: "radio",
3720
+ "aria-checked": i,
3721
+ "aria-disabled": !a || void 0,
3722
+ "aria-label": o ? void 0 : e.name,
3723
+ tabIndex: r === b ? 0 : -1,
3724
+ className: un("kb-layout-picker__option", i && "kb-layout-picker__option--selected", !a && "kb-layout-picker__option--disabled"),
3725
+ onClick: () => x(r),
3726
+ onKeyDown: (e) => C(e, r),
3727
+ children: [/* @__PURE__ */ t("div", {
3728
+ className: "kb-layout-picker__frame",
3729
+ "aria-hidden": "true",
3730
+ children: /* @__PURE__ */ t(fn, {
3731
+ layout: e,
3732
+ size: "sm"
3733
+ })
3734
+ }), o ? /* @__PURE__ */ t("span", {
3735
+ className: "kb-layout-picker__name",
3736
+ children: e.name
3737
+ }) : null]
3738
+ }, e.id);
3739
+ })
3740
+ });
3741
+ }
3742
+ //#endregion
3743
+ //#region src/components/Timeline/Timeline.tsx
3744
+ var Y = (...e) => e.filter(Boolean).join(" "), X = (e) => String(e).padStart(2, "0"), Z = (e) => typeof e == "number" ? e : e.getTime() / 6e4;
3745
+ function mn(e) {
3746
+ if (typeof e == "number") {
3747
+ let t = Math.round(e), n = Math.floor(t / 60);
3748
+ return `${X(t === 1440 ? 24 : (n % 24 + 24) % 24)}:${X((t % 60 + 60) % 60)}`;
3749
+ }
3750
+ return `${X(e.getHours())}:${X(e.getMinutes())}`;
3751
+ }
3752
+ function hn(e) {
3753
+ let t = [...e].sort((e, t) => Z(e.start) - Z(t.start) || Z(t.end) - Z(e.end)), n = [];
3754
+ return {
3755
+ placed: t.map((e) => {
3756
+ let t = Z(e.start), r = n.findIndex((e) => e <= t);
3757
+ return r < 0 && (r = n.length), n[r] = Z(e.end), {
3758
+ item: e,
3759
+ row: r
3760
+ };
3761
+ }),
3762
+ rows: Math.max(1, n.length)
3763
+ };
3764
+ }
3765
+ function gn({ start: r, end: i, tracks: a, now: o, selectedId: s, onSelect: c, pxPerHour: l = 80, labelWidth: u, corner: f, formatTime: m = mn, hideItemTimes: h, emptyMessage: g = "Nothing scheduled", className: _, style: v, ...y }) {
3766
+ let b = d(), x = r instanceof Date, S = Z(r), C = Math.max(Z(i), S + 1), w = l / 60, T = Math.round((C - S) * w), E = (e) => (Z(e) - S) * w, D = (e) => x ? /* @__PURE__ */ new Date(e * 6e4) : e, O = p(() => {
3767
+ let e = [
3768
+ 1,
3769
+ 2,
3770
+ 3,
3771
+ 4,
3772
+ 6,
3773
+ 12,
3774
+ 24
3775
+ ].find((e) => e * l >= 44) ?? 24, t = l >= 72, n = [], i;
3776
+ if (x) {
3777
+ let e = new Date(r);
3778
+ e.setMinutes(0, 0, 0), i = Z(e);
3779
+ } else i = Math.floor(S / 60) * 60;
3780
+ for (let r = i; r <= C; r += 60) {
3781
+ let i = x ? (/* @__PURE__ */ new Date(r * 6e4)).getHours() : Math.round(r / 60);
3782
+ r >= S && n.push({
3783
+ m: r,
3784
+ major: !0,
3785
+ label: i % e === 0 && r < C ? m(D(r)) : void 0
3786
+ }), t && r + 30 > S && r + 30 < C && n.push({
3787
+ m: r + 30,
3788
+ major: !1
3789
+ });
3790
+ }
3791
+ return {
3792
+ out: n,
3793
+ first: i
3794
+ };
3795
+ }, [
3796
+ S,
3797
+ C,
3798
+ l,
3799
+ x,
3800
+ m
3801
+ ]), k = p(() => a.map((e) => hn(e.items)), [a]), A = o !== void 0 && Z(o) >= S && Z(o) <= C, j = {
3802
+ ...v,
3803
+ "--kb-timeline-width": `${T}px`,
3804
+ "--kb-timeline-hour": `${l}px`,
3805
+ "--kb-timeline-grid-offset": `${(O.first - S) * w % l}px`,
3806
+ ...u ? { "--kb-timeline-label-width": u } : null
3807
+ };
3808
+ return /* @__PURE__ */ t("div", {
3809
+ className: Y("kb-timeline", _),
3810
+ style: j,
3811
+ ...y,
3812
+ children: /* @__PURE__ */ t("div", {
3813
+ className: "kb-timeline__scroller",
3814
+ children: /* @__PURE__ */ n("div", {
3815
+ className: "kb-timeline__inner",
3816
+ children: [
3817
+ /* @__PURE__ */ t("div", {
3818
+ className: "kb-timeline__corner",
3819
+ children: f
3820
+ }),
3821
+ /* @__PURE__ */ t("div", {
3822
+ className: "kb-timeline__ruler",
3823
+ "aria-hidden": "true",
3824
+ children: O.out.map((e) => /* @__PURE__ */ t("span", {
3825
+ className: Y("kb-timeline__tick", e.major && "kb-timeline__tick--major"),
3826
+ style: { left: `${(e.m - S) * w}px` },
3827
+ children: e.label ? /* @__PURE__ */ t("span", {
3828
+ className: "kb-timeline__tick-label",
3829
+ children: e.label
3830
+ }) : null
3831
+ }, e.m))
3832
+ }),
3833
+ a.length === 0 ? /* @__PURE__ */ t("div", {
3834
+ className: "kb-timeline__empty",
3835
+ children: g
3836
+ }) : null,
3837
+ a.map((r, i) => {
3838
+ let { placed: o, rows: l } = k[i], u = `${b}-t${i}`, d = i === a.length - 1;
3839
+ return [/* @__PURE__ */ n("div", {
3840
+ id: u,
3841
+ className: Y("kb-timeline__label", d && "kb-timeline__label--last"),
3842
+ children: [/* @__PURE__ */ t("span", {
3843
+ className: "kb-timeline__label-text",
3844
+ children: r.label
3845
+ }), r.meta ? /* @__PURE__ */ t("span", {
3846
+ className: "kb-timeline__label-meta",
3847
+ children: r.meta
3848
+ }) : null]
3849
+ }, `${r.id}-label`), /* @__PURE__ */ t("div", {
3850
+ role: "group",
3851
+ "aria-labelledby": u,
3852
+ className: Y("kb-timeline__lane", d && "kb-timeline__lane--last"),
3853
+ style: { "--kb-timeline-rows": l },
3854
+ children: o.map(({ item: i, row: a }) => {
3855
+ let o = Math.max(0, E(i.start)), l = Math.min(T, E(i.end));
3856
+ if (l <= 0 || o >= T) return null;
3857
+ let u = Math.max(2, l - o), d = `${m(i.start)}–${m(i.end)}`, f = i.title ?? (typeof i.label == "string" ? i.label : ""), p = i.id === s, g = {
3858
+ className: Y("kb-timeline__item", i.tone && i.tone !== "accent" && `kb-timeline__item--${i.tone}`, p && "kb-timeline__item--selected"),
3859
+ style: {
3860
+ left: `${o}px`,
3861
+ width: `${u}px`,
3862
+ "--kb-timeline-sub-row": a
3863
+ },
3864
+ title: `${f} ${d}`.trim()
3865
+ }, _ = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
3866
+ className: "kb-timeline__item-label",
3867
+ children: i.label
3868
+ }), !h && u >= 140 ? /* @__PURE__ */ t("span", {
3869
+ className: "kb-timeline__item-time",
3870
+ children: d
3871
+ }) : null] });
3872
+ return c ? /* @__PURE__ */ t("button", {
3873
+ type: "button",
3874
+ "aria-pressed": p,
3875
+ "aria-label": `${f} ${d}`.trim(),
3876
+ onClick: () => c(i, r),
3877
+ ...g,
3878
+ children: _
3879
+ }, i.id) : /* @__PURE__ */ t("div", {
3880
+ ...g,
3881
+ children: _
3882
+ }, i.id);
3883
+ })
3884
+ }, `${r.id}-lane`)];
3885
+ }),
3886
+ A ? /* @__PURE__ */ t("div", {
3887
+ className: "kb-timeline__now",
3888
+ role: "img",
3889
+ "aria-label": `Now ${m(o)}`,
3890
+ title: `Now ${m(o)}`,
3891
+ style: { "--kb-timeline-now": `${E(o)}px` }
3892
+ }) : null
3893
+ ]
3894
+ })
3895
+ })
3896
+ });
3897
+ }
3898
+ var _n = (e) => {
3899
+ let t = Math.max(0, Math.round(e)), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60);
3900
+ return n ? `${n}:${X(r)}:${X(t % 60)}` : `${X(r)}:${X(t % 60)}`;
3901
+ };
3902
+ function vn({ items: r, selectedId: i, onSelect: a, formatDuration: o = _n, totalLabel: s = "Total", emptyMessage: c = "No content", label: l = "Playlist", className: u, ...d }) {
3903
+ let f = r.reduce((e, t) => e + Math.max(0, t.duration), 0);
3904
+ return /* @__PURE__ */ n("div", {
3905
+ className: Y("kb-playlist-strip", u),
3906
+ ...d,
3907
+ children: [r.length === 0 ? /* @__PURE__ */ t("div", {
3908
+ className: "kb-playlist-strip__empty",
3909
+ children: c
3910
+ }) : /* @__PURE__ */ t("div", {
3911
+ className: "kb-playlist-strip__items",
3912
+ role: "list",
3913
+ "aria-label": l,
3914
+ children: r.map((r, s) => {
3915
+ let c = r.id === i, l = o(r.duration), u = /* @__PURE__ */ n(e, { children: [r.thumbnail == null ? null : typeof r.thumbnail == "string" ? /* @__PURE__ */ t("img", {
3916
+ className: "kb-playlist-strip__thumb",
3917
+ src: r.thumbnail,
3918
+ alt: ""
3919
+ }) : /* @__PURE__ */ t("span", {
3920
+ className: "kb-playlist-strip__thumb",
3921
+ "aria-hidden": "true",
3922
+ children: r.thumbnail
3923
+ }), /* @__PURE__ */ n("span", {
3924
+ className: "kb-playlist-strip__body",
3925
+ children: [/* @__PURE__ */ t("span", {
3926
+ className: "kb-playlist-strip__label",
3927
+ children: r.label
3928
+ }), /* @__PURE__ */ t("span", {
3929
+ className: "kb-playlist-strip__duration",
3930
+ children: l
3931
+ })]
3932
+ })] }), d = Y("kb-playlist-strip__item", c && "kb-playlist-strip__item--selected"), f = { "--kb-playlist-grow": Math.max(r.duration, 1) }, p = typeof r.label == "string" ? r.label : `Item ${s + 1}`;
3933
+ return /* @__PURE__ */ t("div", {
3934
+ role: "listitem",
3935
+ className: "kb-playlist-strip__cell",
3936
+ style: f,
3937
+ children: a ? /* @__PURE__ */ t("button", {
3938
+ type: "button",
3939
+ className: d,
3940
+ "aria-pressed": c,
3941
+ "aria-label": `${p}, ${l}`,
3942
+ title: `${p} · ${l}`,
3943
+ onClick: () => a(r),
3944
+ children: u
3945
+ }) : /* @__PURE__ */ t("div", {
3946
+ className: d,
3947
+ title: `${p} · ${l}`,
3948
+ children: u
3949
+ })
3950
+ }, r.id);
3951
+ })
3952
+ }), s !== null && r.length > 0 ? /* @__PURE__ */ n("div", {
3953
+ className: "kb-playlist-strip__total",
3954
+ children: [/* @__PURE__ */ t("span", {
3955
+ className: "kb-playlist-strip__total-label",
3956
+ children: s
3957
+ }), /* @__PURE__ */ t("span", {
3958
+ className: "kb-playlist-strip__total-value",
3959
+ children: o(f)
3960
+ })]
3961
+ }) : null]
3962
+ });
3963
+ }
3964
+ //#endregion
3965
+ //#region src/components/Avatar/Avatar.tsx
3966
+ function yn(e, t = 2) {
3967
+ let n = e.trim().split(/\s+/).filter(Boolean);
3968
+ return n.length === 0 ? "" : n.length === 1 && /[぀-ヿ㐀-鿿가-힯]/.test(n[0]) ? n[0].charAt(0) : n.slice(0, t).map((e) => Array.from(e)[0]).join("").toUpperCase();
3969
+ }
3970
+ function bn({ src: e, name: r, fallback: i, size: a = "md", shape: o = "circle", status: s, statusLabel: c, className: l, ...d }) {
3971
+ let [f, p] = h(!1);
3972
+ u(() => p(!1), [e]);
3973
+ let m = !!e && !f, g = [r, c].filter(Boolean).join(", ") || void 0;
3974
+ return /* @__PURE__ */ n("span", {
3975
+ className: [
3976
+ "kb-avatar",
3977
+ `kb-avatar--${a}`,
3978
+ o === "square" && "kb-avatar--square",
3979
+ l
3980
+ ].filter(Boolean).join(" "),
3981
+ role: g || d["aria-label"] ? "img" : void 0,
3982
+ "aria-label": g,
3983
+ title: r,
3984
+ ...d,
3985
+ children: [m ? /* @__PURE__ */ t("img", {
3986
+ className: "kb-avatar__image",
3987
+ src: e,
3988
+ alt: "",
3989
+ onError: () => p(!0)
3990
+ }) : /* @__PURE__ */ t("span", {
3991
+ className: "kb-avatar__fallback",
3992
+ "aria-hidden": "true",
3993
+ children: i ?? (r ? yn(r) : null)
3994
+ }), s ? /* @__PURE__ */ t("span", {
3995
+ className: ["kb-avatar__status", s !== "neutral" && `kb-avatar__status--${s}`].filter(Boolean).join(" "),
3996
+ "aria-hidden": "true"
3997
+ }) : null]
3998
+ });
3999
+ }
4000
+ function xn({ max: e, size: i = "md", shape: a, total: o, className: c, children: l, ...u }) {
4001
+ let d = r.toArray(l).filter(s), f = Math.max(o ?? 0, d.length), p = e != null && e < d.length ? d.slice(0, e) : d, m = f - p.length;
4002
+ return /* @__PURE__ */ n("div", {
4003
+ className: ["kb-avatar-group", c].filter(Boolean).join(" "),
4004
+ role: "group",
4005
+ "aria-label": u["aria-label"] ?? `${f} members`,
4006
+ ...u,
4007
+ children: [p.map((e, n) => /* @__PURE__ */ t(bn, {
4008
+ ...e.props,
4009
+ size: i,
4010
+ shape: a ?? e.props.shape
4011
+ }, e.key ?? n)), m > 0 ? /* @__PURE__ */ t("span", {
4012
+ className: [
4013
+ "kb-avatar",
4014
+ `kb-avatar--${i}`,
4015
+ "kb-avatar--more",
4016
+ a === "square" && "kb-avatar--square"
4017
+ ].filter(Boolean).join(" "),
4018
+ role: "img",
4019
+ "aria-label": `${m} more`,
4020
+ children: /* @__PURE__ */ n("span", {
4021
+ "aria-hidden": "true",
4022
+ children: ["+", m]
4023
+ })
4024
+ }) : null]
4025
+ });
4026
+ }
4027
+ //#endregion
4028
+ //#region src/components/Slider/Slider.tsx
4029
+ function Sn(e) {
4030
+ let t = String(e), n = t.indexOf(".");
4031
+ return n < 0 ? 0 : t.length - n - 1;
4032
+ }
4033
+ function Cn({ value: e, defaultValue: r, onChange: i, onChangeEnd: a, min: o = 0, max: s = 100, step: c = 1, pageStep: l, minDistance: u = 0, marks: f, label: p, showOutput: g, tooltip: _ = "auto", formatValue: v = String, thumbLabels: y, size: b = "md", disabled: x, name: S, className: C, ...w }) {
4034
+ let [T, E] = h(r ?? o), D = e ?? T, O = Array.isArray(D), k = O ? [...D] : [D], [A, j] = h(null), M = m(null), N = m(D);
4035
+ N.current = D;
4036
+ let P = d(), F = s - o || 1, I = Math.max(Sn(c), Sn(o)), L = (e) => (Math.min(s, Math.max(o, e)) - o) / F * 100, R = (e) => {
4037
+ let t = Math.round((e - o) / c) * c + o;
4038
+ return Number(Math.min(s, Math.max(o, t)).toFixed(I));
4039
+ }, z = l ?? Math.max(c, F / 10), B = (t, n) => {
4040
+ let r = R(n);
4041
+ O && (r = t === 0 ? Math.min(r, k[1] - u) : Math.max(r, k[0] + u), r = Math.min(s, Math.max(o, r)));
4042
+ let a = O ? t === 0 ? [r, k[1]] : [k[0], r] : r;
4043
+ return (O ? a[t] !== k[t] : a !== k[0]) && (e === void 0 && E(a), N.current = a, i?.(a)), a;
4044
+ }, V = (e) => {
4045
+ let t = M.current.getBoundingClientRect(), n = t.width ? (e - t.left) / t.width : 0;
4046
+ return o + Math.min(1, Math.max(0, n)) * F;
4047
+ }, H = (e) => {
4048
+ if (x || e.button !== 0) return;
4049
+ e.preventDefault();
4050
+ let t = V(e.clientX), n = 0;
4051
+ if (O) {
4052
+ let e = Math.abs(t - k[0]), r = Math.abs(t - k[1]);
4053
+ n = +(r < e || r === e && t > k[1]);
4054
+ }
4055
+ j(n), e.currentTarget.setPointerCapture(e.pointerId), M.current?.querySelectorAll("[role=\"slider\"]")[n]?.focus(), B(n, t);
4056
+ }, U = (e) => {
4057
+ A !== null && B(A, V(e.clientX));
4058
+ }, W = (e) => {
4059
+ A !== null && (e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), j(null), a?.(N.current));
4060
+ }, G = (e) => (t) => {
4061
+ if (x) return;
4062
+ let n = k[e], r = null;
4063
+ switch (t.key) {
4064
+ case "ArrowRight":
4065
+ case "ArrowUp":
4066
+ r = n + c;
4067
+ break;
4068
+ case "ArrowLeft":
4069
+ case "ArrowDown":
4070
+ r = n - c;
4071
+ break;
4072
+ case "PageUp":
4073
+ r = n + z;
4074
+ break;
4075
+ case "PageDown":
4076
+ r = n - z;
4077
+ break;
4078
+ case "Home":
4079
+ r = o;
4080
+ break;
4081
+ case "End": r = s;
4082
+ }
4083
+ if (r === null) return;
4084
+ t.preventDefault();
4085
+ let i = B(e, r);
4086
+ a?.(i);
4087
+ }, K = [];
4088
+ if (f === !0) {
4089
+ let e = Math.floor(F / c);
4090
+ if (e <= 50) for (let t = 0; t <= e; t++) K.push({ value: Number((o + t * c).toFixed(I)) });
4091
+ } else if (Array.isArray(f)) for (let e of f) K.push(typeof e == "number" ? { value: e } : e);
4092
+ let ee = O ? k[0] : o, te = O ? k[1] : k[0], q = (e) => e >= ee && e <= te, ne = K.some((e) => e.label != null), re = g ?? p != null, ie = O ? `${v(k[0])} – ${v(k[1])}` : v(k[0]), J = Array.isArray(y) ? y : y ? [y, y] : O ? ["Minimum", "Maximum"] : [], ae = [
4093
+ "kb-slider",
4094
+ b === "sm" && "kb-slider--sm",
4095
+ _ === "always" && "kb-slider--tooltip-always",
4096
+ x && "kb-slider--disabled",
4097
+ C
4098
+ ].filter(Boolean).join(" ");
4099
+ return /* @__PURE__ */ n("div", {
4100
+ className: ae,
4101
+ "aria-disabled": x || void 0,
4102
+ ...w,
4103
+ children: [
4104
+ p != null || re ? /* @__PURE__ */ n("div", {
4105
+ className: "kb-slider__header",
4106
+ children: [p == null ? /* @__PURE__ */ t("span", {}) : /* @__PURE__ */ t("span", {
4107
+ className: "kb-slider__label",
4108
+ id: P,
4109
+ children: p
4110
+ }), re ? /* @__PURE__ */ t("output", {
4111
+ className: "kb-slider__output",
4112
+ "aria-live": "off",
4113
+ children: ie
4114
+ }) : null]
4115
+ }) : null,
4116
+ /* @__PURE__ */ n("div", {
4117
+ ref: M,
4118
+ className: "kb-slider__control",
4119
+ onPointerDown: H,
4120
+ onPointerMove: U,
4121
+ onPointerUp: W,
4122
+ onPointerCancel: W,
4123
+ children: [
4124
+ /* @__PURE__ */ t("div", { className: "kb-slider__track" }),
4125
+ /* @__PURE__ */ t("div", {
4126
+ className: "kb-slider__fill",
4127
+ style: O ? {
4128
+ left: `${L(k[0])}%`,
4129
+ right: `${100 - L(k[1])}%`
4130
+ } : { right: `${100 - L(k[0])}%` }
4131
+ }),
4132
+ K.map((e) => /* @__PURE__ */ t("span", {
4133
+ className: ["kb-slider__tick", q(e.value) && "kb-slider__tick--active"].filter(Boolean).join(" "),
4134
+ style: { left: `${L(e.value)}%` }
4135
+ }, e.value)),
4136
+ k.map((e, n) => /* @__PURE__ */ t("div", {
4137
+ className: ["kb-slider__thumb", A === n && "kb-slider__thumb--active"].filter(Boolean).join(" "),
4138
+ style: { left: `${L(e)}%` },
4139
+ role: "slider",
4140
+ tabIndex: x ? -1 : 0,
4141
+ "aria-valuemin": O && n === 1 ? k[0] + u : o,
4142
+ "aria-valuemax": O && n === 0 ? k[1] - u : s,
4143
+ "aria-valuenow": e,
4144
+ "aria-valuetext": v(e),
4145
+ "aria-orientation": "horizontal",
4146
+ "aria-disabled": x || void 0,
4147
+ "aria-labelledby": p != null && !J[n] ? P : void 0,
4148
+ "aria-label": J[n] ? typeof p == "string" ? `${p} ${J[n]}` : J[n] : void 0,
4149
+ onKeyDown: G(n),
4150
+ children: _ === "none" ? null : /* @__PURE__ */ t("span", {
4151
+ className: "kb-slider__tooltip",
4152
+ "aria-hidden": "true",
4153
+ children: v(e)
4154
+ })
4155
+ }, n))
4156
+ ]
4157
+ }),
4158
+ ne ? /* @__PURE__ */ t("div", {
4159
+ className: "kb-slider__marks",
4160
+ "aria-hidden": "true",
4161
+ children: K.filter((e) => e.label != null).map((e) => /* @__PURE__ */ t("span", {
4162
+ className: ["kb-slider__mark", q(e.value) && "kb-slider__mark--active"].filter(Boolean).join(" "),
4163
+ style: { left: `${L(e.value)}%` },
4164
+ children: /* @__PURE__ */ t("span", {
4165
+ className: "kb-slider__mark-label",
4166
+ children: e.label
4167
+ })
4168
+ }, e.value))
4169
+ }) : null,
4170
+ S ? k.map((e, n) => /* @__PURE__ */ t("input", {
4171
+ type: "hidden",
4172
+ name: S,
4173
+ value: e,
4174
+ disabled: x
4175
+ }, n)) : null
4176
+ ]
4177
+ });
4178
+ }
4179
+ //#endregion
4180
+ //#region src/components/Carousel/Carousel.tsx
4181
+ function wn(...e) {
4182
+ return e.filter(Boolean).join(" ");
4183
+ }
4184
+ function Tn() {
4185
+ let [e, t] = h(!1);
4186
+ return u(() => {
4187
+ if (typeof window > "u" || !window.matchMedia) return;
4188
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)");
4189
+ t(e.matches);
4190
+ let n = () => t(e.matches);
4191
+ return e.addEventListener("change", n), () => e.removeEventListener("change", n);
4192
+ }, []), e;
4193
+ }
4194
+ var En = () => /* @__PURE__ */ t("svg", {
4195
+ viewBox: "0 0 20 20",
4196
+ fill: "none",
4197
+ stroke: "currentColor",
4198
+ strokeWidth: "1.6",
4199
+ strokeLinecap: "round",
4200
+ strokeLinejoin: "round",
4201
+ "aria-hidden": "true",
4202
+ children: /* @__PURE__ */ t("path", { d: "m12 5-5 5 5 5" })
4203
+ }), Dn = () => /* @__PURE__ */ t("svg", {
4204
+ viewBox: "0 0 20 20",
4205
+ fill: "none",
4206
+ stroke: "currentColor",
4207
+ strokeWidth: "1.6",
4208
+ strokeLinecap: "round",
4209
+ strokeLinejoin: "round",
4210
+ "aria-hidden": "true",
4211
+ children: /* @__PURE__ */ t("path", { d: "m8 5 5 5-5 5" })
4212
+ }), On = () => /* @__PURE__ */ n("svg", {
4213
+ viewBox: "0 0 12 12",
4214
+ fill: "currentColor",
4215
+ "aria-hidden": "true",
4216
+ children: [/* @__PURE__ */ t("rect", {
4217
+ x: "2",
4218
+ y: "1.5",
4219
+ width: "2.5",
4220
+ height: "9",
4221
+ rx: "0.5"
4222
+ }), /* @__PURE__ */ t("rect", {
4223
+ x: "7.5",
4224
+ y: "1.5",
4225
+ width: "2.5",
4226
+ height: "9",
4227
+ rx: "0.5"
4228
+ })]
4229
+ }), kn = () => /* @__PURE__ */ t("svg", {
4230
+ viewBox: "0 0 12 12",
4231
+ fill: "currentColor",
4232
+ "aria-hidden": "true",
4233
+ children: /* @__PURE__ */ t("path", { d: "M3 1.5v9l7.5-4.5z" })
4234
+ });
4235
+ function An({ children: i, aspectRatio: a, index: o, defaultIndex: s = 0, onIndexChange: l, loop: d = !1, autoplay: f = !1, interval: p = 5e3, showArrows: g = !0, showDots: _ = !0, dotsPlacement: v = "below", transition: y = "slide", label: b = "Carousel", slideLabel: x = (e, t) => `${e + 1} / ${t}`, labels: S = {}, className: C, onKeyDown: w, onMouseEnter: T, onMouseLeave: E, onFocus: D, onBlur: O, ...k }) {
4236
+ let A = r.toArray(i), j = A.length, M = d || f, [N, P] = h(s), F = Math.min(Math.max(o ?? N, 0), Math.max(j - 1, 0)), I = Tn(), [L, R] = h(null), [z, B] = h(!1), [V, H] = h(!1), U = L ?? I, W = f && j > 1 && !U && !z && !V, G = c((e) => {
4237
+ if (j === 0) return;
4238
+ let t = M ? (e + j) % j : Math.min(Math.max(e, 0), j - 1);
4239
+ t !== F && (o === void 0 && P(t), l?.(t));
4240
+ }, [
4241
+ j,
4242
+ F,
4243
+ o,
4244
+ M,
4245
+ l
4246
+ ]);
4247
+ u(() => {
4248
+ if (!W) return;
4249
+ let e = window.setTimeout(() => G(F + 1), p);
4250
+ return () => window.clearTimeout(e);
4251
+ }, [
4252
+ W,
4253
+ F,
4254
+ p,
4255
+ G
4256
+ ]);
4257
+ let K = m([]);
4258
+ u(() => {
4259
+ K.current.forEach((e, t) => e?.toggleAttribute("inert", t !== F));
4260
+ }, [F, j]);
4261
+ let ee = (e) => {
4262
+ if (w?.(e), !e.defaultPrevented && !e.target.closest("input, textarea, select, [contenteditable=\"true\"]")) {
4263
+ if (e.key === "ArrowLeft") G(F - 1);
4264
+ else if (e.key === "ArrowRight") G(F + 1);
4265
+ else if (e.key === "Home") G(0);
4266
+ else if (e.key === "End") G(j - 1);
4267
+ else return;
4268
+ e.preventDefault();
4269
+ }
4270
+ }, te = (e) => {
4271
+ D?.(e), e.target.matches(":focus-visible") && H(!0);
4272
+ }, q = (e) => {
4273
+ O?.(e), e.currentTarget.contains(e.relatedTarget) || H(!1);
4274
+ }, ne = M || F > 0, re = M || F < j - 1, ie = y === "slide" ? { transform: `translateX(${-F * 100}%)` } : void 0, J = a == null ? void 0 : { aspectRatio: String(a) }, ae = _ && j > 1 || f ? /* @__PURE__ */ n("div", {
4275
+ className: "kb-carousel__footer",
4276
+ children: [_ && j > 1 ? /* @__PURE__ */ t("div", {
4277
+ className: "kb-carousel__dots",
4278
+ role: "group",
4279
+ "aria-label": `${b} slides`,
4280
+ children: A.map((e, n) => /* @__PURE__ */ t("button", {
4281
+ type: "button",
4282
+ className: wn("kb-carousel__dot", n === F && "kb-carousel__dot--active"),
4283
+ "aria-current": n === F ? "true" : void 0,
4284
+ "aria-label": S.goTo ? S.goTo(n) : `Go to slide ${n + 1}`,
4285
+ onClick: () => G(n)
4286
+ }, n))
4287
+ }) : null, f && j > 1 ? /* @__PURE__ */ t("button", {
4288
+ type: "button",
4289
+ className: "kb-carousel__play",
4290
+ "aria-label": U ? S.play ?? "Start automatic slide show" : S.pause ?? "Stop automatic slide show",
4291
+ onClick: () => R(!U),
4292
+ children: t(U ? kn : On, {})
4293
+ }) : null]
4294
+ }) : null;
4295
+ return /* @__PURE__ */ n("section", {
4296
+ className: wn("kb-carousel", y === "fade" && "kb-carousel--fade", v === "overlay" && "kb-carousel--overlay", C),
4297
+ "aria-roledescription": "carousel",
4298
+ "aria-label": b,
4299
+ onKeyDown: ee,
4300
+ onMouseEnter: (e) => {
4301
+ T?.(e), B(!0);
4302
+ },
4303
+ onMouseLeave: (e) => {
4304
+ E?.(e), B(!1);
4305
+ },
4306
+ onFocus: te,
4307
+ onBlur: q,
4308
+ ...k,
4309
+ children: [/* @__PURE__ */ n("div", {
4310
+ className: "kb-carousel__viewport",
4311
+ style: J,
4312
+ children: [
4313
+ /* @__PURE__ */ t("div", {
4314
+ className: "kb-carousel__track",
4315
+ style: ie,
4316
+ "aria-live": W ? "off" : "polite",
4317
+ children: A.map((e, n) => /* @__PURE__ */ t("div", {
4318
+ ref: (e) => {
4319
+ K.current[n] = e;
4320
+ },
4321
+ className: wn("kb-carousel__slide", n === F && "kb-carousel__slide--current"),
4322
+ role: "group",
4323
+ "aria-roledescription": "slide",
4324
+ "aria-label": x(n, j),
4325
+ "aria-hidden": n !== F || void 0,
4326
+ children: e
4327
+ }, n))
4328
+ }),
4329
+ g && j > 1 ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
4330
+ type: "button",
4331
+ className: "kb-carousel__nav kb-carousel__nav--prev",
4332
+ "aria-label": S.previous ?? "Previous slide",
4333
+ disabled: !ne,
4334
+ onClick: () => G(F - 1),
4335
+ children: /* @__PURE__ */ t(En, {})
4336
+ }), /* @__PURE__ */ t("button", {
4337
+ type: "button",
4338
+ className: "kb-carousel__nav kb-carousel__nav--next",
4339
+ "aria-label": S.next ?? "Next slide",
4340
+ disabled: !re,
4341
+ onClick: () => G(F + 1),
4342
+ children: /* @__PURE__ */ t(Dn, {})
4343
+ })] }) : null,
4344
+ v === "overlay" ? ae : null
4345
+ ]
4346
+ }), v === "below" ? ae : null]
4347
+ });
4348
+ }
4349
+ //#endregion
4350
+ //#region src/components/Separator/Separator.tsx
4351
+ function jn({ orientation: e = "horizontal", tone: n = "default", label: r, spaced: i, decorative: a = !0, className: o, ...s }) {
4352
+ let c = [
4353
+ "kb-separator",
4354
+ e === "vertical" && "kb-separator--vertical",
4355
+ n === "faint" && "kb-separator--faint",
4356
+ r != null && "kb-separator--labelled",
4357
+ i && "kb-separator--spaced",
4358
+ o
4359
+ ].filter(Boolean).join(" ");
4360
+ return /* @__PURE__ */ t("div", {
4361
+ className: c,
4362
+ ...a ? { role: "none" } : {
4363
+ role: "separator",
4364
+ "aria-orientation": e
4365
+ },
4366
+ ...s,
4367
+ children: r == null ? null : /* @__PURE__ */ t("span", {
4368
+ className: "kb-separator__label",
4369
+ children: r
4370
+ })
4371
+ });
4372
+ }
4373
+ //#endregion
4374
+ //#region src/components/Kbd/Kbd.tsx
4375
+ function Mn({ small: e, className: n, children: r, ...i }) {
4376
+ return /* @__PURE__ */ t("kbd", {
4377
+ className: [
4378
+ "kb-kbd",
4379
+ e && "kb-kbd--sm",
4380
+ n
4381
+ ].filter(Boolean).join(" "),
4382
+ ...i,
4383
+ children: r
4384
+ });
4385
+ }
4386
+ function Nn({ keys: e, separator: r = "+", small: a, className: o, ...s }) {
4387
+ return /* @__PURE__ */ t("span", {
4388
+ className: ["kb-kbd-group", o].filter(Boolean).join(" "),
4389
+ ...s,
4390
+ children: e.map((e, o) => /* @__PURE__ */ n(i, { children: [o > 0 && r != null ? /* @__PURE__ */ t("span", {
4391
+ className: "kb-kbd-group__sep",
4392
+ "aria-hidden": "true",
4393
+ children: r
4394
+ }) : null, /* @__PURE__ */ t(Mn, {
4395
+ small: a,
4396
+ children: e
4397
+ })] }, o))
4398
+ });
4399
+ }
4400
+ //#endregion
4401
+ //#region src/components/Typography/Typography.tsx
4402
+ function Pn(...e) {
4403
+ return e.filter(Boolean).join(" ");
4404
+ }
4405
+ function Fn(e, t, n, r) {
4406
+ let i = !t && n != null && n > 0;
4407
+ return {
4408
+ className: Pn(t && `${e}--truncate`, i && `${e}--clamp`),
4409
+ style: i ? {
4410
+ ...r,
4411
+ "--kb-text-lines": n
4412
+ } : r
4413
+ };
4414
+ }
4415
+ function In({ level: e = 2, as: n, tone: r, truncate: i, lineClamp: a, className: o, style: s, children: c, ...l }) {
4416
+ let u = n ?? `h${e}`, d = Fn("kb-heading", i, a, s);
4417
+ return /* @__PURE__ */ t(u, {
4418
+ className: Pn("kb-heading", `kb-heading--${e}`, r && r !== "primary" && `kb-heading--${r}`, d.className, o),
4419
+ style: d.style,
4420
+ ...l,
4421
+ children: c
4422
+ });
4423
+ }
4424
+ function Ln({ as: e = "p", size: n, weight: r, tone: i, truncate: a, lineClamp: o, className: s, style: c, children: l, ...u }) {
4425
+ let d = Fn("kb-text", a, o, c);
4426
+ return /* @__PURE__ */ t(e, {
4427
+ className: Pn("kb-text", n && n !== "xs" && `kb-text--${n}`, r && r !== "regular" && `kb-text--${r}`, i && i !== "primary" && `kb-text--${i}`, d.className, s),
4428
+ style: d.style,
4429
+ ...u,
4430
+ children: l
4431
+ });
4432
+ }
4433
+ function Rn({ as: e = "span", label: n, className: r, children: i, ...a }) {
4434
+ return /* @__PURE__ */ t(e, {
4435
+ className: Pn("kb-caption", n && "kb-caption--label", r),
4436
+ ...a,
4437
+ children: i
4438
+ });
4439
+ }
4440
+ //#endregion
4441
+ //#region src/components/Resizable/Resizable.tsx
4442
+ function zn(...e) {
4443
+ return e.filter(Boolean).join(" ");
4444
+ }
4445
+ var Bn = (e, t, n) => Math.min(n, Math.max(t, e)), Vn = (e) => Math.round(e * 100) / 100, Hn = o(null), Un = o(-1);
4446
+ function Wn(e) {
4447
+ let t = l(Hn);
4448
+ if (!t) throw Error(`${e} must be a direct child of ResizablePanelGroup`);
4449
+ return t;
4450
+ }
4451
+ function Gn({ defaultSize: e, minSize: n, maxSize: r, className: i, style: a, id: o, children: s, ...c }) {
4452
+ let u = Wn("ResizablePanel"), d = l(Un), f = u.sizes[d] ?? 0;
4453
+ return /* @__PURE__ */ t("div", {
4454
+ id: o ?? u.panelIds[d],
4455
+ className: zn("kb-resizable__panel", i),
4456
+ style: {
4457
+ ...a,
4458
+ flex: `${f} 1 0px`
4459
+ },
4460
+ "data-size": Vn(f),
4461
+ ...c,
4462
+ children: s
4463
+ });
4464
+ }
4465
+ function Kn({ withGrip: e, disabled: n, className: r, onKeyDown: i, onDoubleClick: a, ...o }) {
4466
+ let s = Wn("ResizableHandle"), c = l(Un), u = s.direction === "horizontal", d = s.sizes[c] ?? 0, f = s.limits[c] ?? {
4467
+ min: 0,
4468
+ max: 100
4469
+ };
4470
+ return /* @__PURE__ */ t("div", {
4471
+ role: "separator",
4472
+ tabIndex: n ? -1 : 0,
4473
+ "aria-orientation": u ? "vertical" : "horizontal",
4474
+ "aria-valuenow": Math.round(d),
4475
+ "aria-valuemin": Math.round(f.min),
4476
+ "aria-valuemax": Math.round(f.max),
4477
+ "aria-controls": s.panelIds[c],
4478
+ "aria-disabled": n || void 0,
4479
+ "aria-label": o["aria-label"] ?? "Resize",
4480
+ className: zn("kb-resizable__handle", e && "kb-resizable__handle--grip", s.activeHandle === c && "kb-resizable__handle--active", n && "kb-resizable__handle--disabled", r),
4481
+ onPointerDown: n ? void 0 : (e) => s.startDrag(c, e),
4482
+ onPointerMove: s.moveDrag,
4483
+ onPointerUp: s.endDrag,
4484
+ onPointerCancel: s.endDrag,
4485
+ onKeyDown: (e) => {
4486
+ if (i?.(e), e.defaultPrevented || n) return;
4487
+ let t = u ? "ArrowLeft" : "ArrowUp", r = u ? "ArrowRight" : "ArrowDown";
4488
+ if (e.key === t) s.resizeBy(c, -1, e.shiftKey);
4489
+ else if (e.key === r) s.resizeBy(c, 1, e.shiftKey);
4490
+ else if (e.key === "Home") s.resizeTo(c, f.min);
4491
+ else if (e.key === "End") s.resizeTo(c, f.max);
4492
+ else if (e.key === "Enter") s.reset();
4493
+ else return;
4494
+ e.preventDefault();
4495
+ },
4496
+ onDoubleClick: (e) => {
4497
+ a?.(e), !n && !e.defaultPrevented && s.reset();
4498
+ },
4499
+ ...o,
4500
+ children: /* @__PURE__ */ t("span", {
4501
+ className: "kb-resizable__grip",
4502
+ "aria-hidden": "true"
4503
+ })
4504
+ });
4505
+ }
4506
+ function qn(e) {
4507
+ let t = e.map((e) => e.defaultSize), n = t.reduce((e, t) => e + (t ?? 0), 0), r = t.filter((e) => e == null).length, i = r ? Math.max(0, 100 - n) / r : 0, a = t.map((e) => e ?? i), o = a.reduce((e, t) => e + t, 0) || 1;
4508
+ return a.map((e) => e / o * 100);
4509
+ }
4510
+ function Jn({ direction: e = "horizontal", onLayout: n, keyboardStep: i = 2, className: a, children: o, ...c }) {
4511
+ let l = r.toArray(o).filter(s), u = l.filter((e) => e.type === Gn), f = u.map((e) => e.props), p = f.map((e) => ({
4512
+ min: e.minSize ?? 0,
4513
+ max: e.maxSize ?? 100
4514
+ })), [g, _] = h(() => qn(f)), v = g.length === u.length ? g : qn(f), y = d(), b = f.map((e, t) => e.id ?? `${y}-panel-${t}`), x = m(null), S = m(null), [C, w] = h(null), T = (e) => {
4515
+ let t = e.map(Vn);
4516
+ _(t), n?.(t);
4517
+ }, E = (e, t, n) => {
4518
+ let r = t + 1;
4519
+ if (r >= e.length) return e;
4520
+ let i = e[t] + e[r], a = Bn(e[t] + n, p[t].min, p[t].max), o = i - a;
4521
+ o = Bn(o, p[r].min, p[r].max), a = i - o;
4522
+ let s = e.slice();
4523
+ return s[t] = a, s[r] = o, s;
4524
+ }, D = {
4525
+ direction: e,
4526
+ sizes: v,
4527
+ limits: p,
4528
+ panelIds: b,
4529
+ activeHandle: C,
4530
+ startDrag: (t, n) => {
4531
+ if (n.button !== 0 || !x.current) return;
4532
+ n.preventDefault();
4533
+ let r = x.current.getBoundingClientRect();
4534
+ S.current = {
4535
+ handle: t,
4536
+ start: v,
4537
+ origin: e === "horizontal" ? n.clientX : n.clientY,
4538
+ extent: e === "horizontal" ? r.width : r.height,
4539
+ pointer: n.pointerId
4540
+ }, n.currentTarget.setPointerCapture(n.pointerId), n.currentTarget.focus(), w(t);
4541
+ },
4542
+ moveDrag: (t) => {
4543
+ let n = S.current;
4544
+ if (!n || t.pointerId !== n.pointer || !n.extent) return;
4545
+ let r = e === "horizontal" ? t.clientX : t.clientY;
4546
+ T(E(n.start, n.handle, (r - n.origin) / n.extent * 100));
4547
+ },
4548
+ endDrag: (e) => {
4549
+ let t = S.current;
4550
+ t && e.pointerId === t.pointer && (e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), S.current = null, w(null));
4551
+ },
4552
+ resizeBy: (e, t, n) => T(E(v, e, t * (n ? 10 : i))),
4553
+ resizeTo: (e, t) => T(E(v, e, t - v[e])),
4554
+ reset: () => T(qn(f))
4555
+ }, O = -1;
4556
+ return /* @__PURE__ */ t(Hn.Provider, {
4557
+ value: D,
4558
+ children: /* @__PURE__ */ t("div", {
4559
+ ref: x,
4560
+ className: zn("kb-resizable", `kb-resizable--${e}`, C !== null && "kb-resizable--dragging", a),
4561
+ "data-direction": e,
4562
+ ...c,
4563
+ children: l.map((e, n) => (e.type === Gn && (O += 1), /* @__PURE__ */ t(Un.Provider, {
4564
+ value: Math.max(O, 0),
4565
+ children: e
4566
+ }, e.key ?? n)))
4567
+ })
4568
+ });
4569
+ }
4570
+ //#endregion
4571
+ //#region src/components/ToggleGroup/ToggleGroup.tsx
4572
+ function Yn(...e) {
4573
+ return e.filter(Boolean).join(" ");
4574
+ }
4575
+ function Xn({ pressed: e, defaultPressed: n = !1, onPressedChange: r, size: i = "md", icon: a, className: o, onClick: s, children: c, ...l }) {
4576
+ let [u, d] = h(n), f = e ?? u;
4577
+ return /* @__PURE__ */ t("button", {
4578
+ type: "button",
4579
+ "aria-pressed": f,
4580
+ className: Yn("kb-toggle", "kb-toggle--standalone", `kb-toggle--${i}`, a && "kb-toggle--icon", f && "kb-toggle--active", o),
4581
+ onClick: (t) => {
4582
+ s?.(t), !t.defaultPrevented && (e === void 0 && d(!f), r?.(!f));
4583
+ },
4584
+ ...l,
4585
+ children: c
4586
+ });
4587
+ }
4588
+ function Zn(e) {
4589
+ let { type: r, items: i, size: a = "md", block: o, disabled: s, value: c, defaultValue: l, onChange: u, allowEmpty: d, className: f, onKeyDown: p, ...g } = e, [_, v] = h(() => {
4590
+ let e = l;
4591
+ return Array.isArray(e) ? e : e ? [e] : [];
4592
+ }), y = c === void 0 ? _ : Array.isArray(c) ? c : c ? [c] : [], b = m([]), x = r === "single", S = (e) => {
4593
+ c === void 0 && v(e), x ? u?.(e[0] ?? "") : u?.(e);
4594
+ }, C = (e) => {
4595
+ let t = y.includes(e);
4596
+ if (x) {
4597
+ if (t && !d) return;
4598
+ S(t ? [] : [e]);
4599
+ } else S(t ? y.filter((t) => t !== e) : [...y, e]);
4600
+ }, w = i.map((e) => !s && !e.disabled), T = i.findIndex((e, t) => w[t] && y.includes(e.value)), E = T >= 0 ? T : w.indexOf(!0), D = (e) => {
4601
+ if (p?.(e), e.defaultPrevented) return;
4602
+ let t = b.current.findIndex((e) => e === document.activeElement);
4603
+ if (t < 0) return;
4604
+ let n = (e) => {
4605
+ for (let n = 1; n <= i.length; n++) {
4606
+ let r = (t + e * n + i.length) % i.length;
4607
+ if (w[r]) return r;
4608
+ }
4609
+ return t;
4610
+ }, r = -1;
4611
+ e.key === "ArrowRight" || e.key === "ArrowDown" ? r = n(1) : e.key === "ArrowLeft" || e.key === "ArrowUp" ? r = n(-1) : e.key === "Home" ? r = w.indexOf(!0) : e.key === "End" && (r = w.lastIndexOf(!0)), !(r < 0) && (e.preventDefault(), b.current[r]?.focus(), x && !d && S([i[r].value]));
4612
+ }, O = x && !d;
4613
+ return /* @__PURE__ */ t("div", {
4614
+ role: O ? "radiogroup" : "group",
4615
+ "aria-disabled": s || void 0,
4616
+ className: Yn("kb-toggle-group", `kb-toggle-group--${a}`, o && "kb-toggle-group--block", f),
4617
+ onKeyDown: D,
4618
+ ...g,
4619
+ children: i.map((e, r) => {
4620
+ let i = y.includes(e.value), a = !!e.icon && e.label == null;
4621
+ return /* @__PURE__ */ n("button", {
4622
+ ref: (e) => {
4623
+ b.current[r] = e;
4624
+ },
4625
+ type: "button",
4626
+ role: O ? "radio" : void 0,
4627
+ "aria-checked": O ? i : void 0,
4628
+ "aria-pressed": O ? void 0 : i,
4629
+ "aria-label": e.ariaLabel,
4630
+ title: e.title,
4631
+ tabIndex: r === E ? 0 : -1,
4632
+ disabled: s || e.disabled,
4633
+ className: Yn("kb-toggle", a && "kb-toggle--icon", i && "kb-toggle--active"),
4634
+ onClick: () => C(e.value),
4635
+ children: [e.icon ? /* @__PURE__ */ t("span", {
4636
+ className: "kb-toggle__icon",
4637
+ "aria-hidden": "true",
4638
+ children: e.icon
4639
+ }) : null, e.label]
4640
+ }, e.value);
4641
+ })
4642
+ });
4643
+ }
4644
+ //#endregion
4645
+ //#region src/utils/floating.ts
4646
+ var Q = 8;
4647
+ function Qn(e, t, { open: n, placement: r = "bottom-start", offset: i = 6, flip: a = !0, matchWidth: o = !1, point: s = null }) {
4648
+ let [l, d] = h({
4649
+ style: {
4650
+ position: "fixed",
4651
+ top: 0,
4652
+ left: 0,
4653
+ visibility: "hidden"
4654
+ },
4655
+ placement: r
4656
+ }), p = c(() => {
4657
+ let n = t.current, c = s ? new DOMRect(s.x, s.y, 0, 0) : e.current?.getBoundingClientRect();
4658
+ if (!n || !c) return;
4659
+ let l = n.getBoundingClientRect(), u = window.innerWidth, f = window.innerHeight, p = o ? Math.max(c.width, l.width) : l.width, [m, h] = r.split("-");
4660
+ a && (m === "bottom" && c.bottom + i + l.height > f - Q && c.top - i - l.height > Q ? m = "top" : m === "top" && c.top - i - l.height < Q && c.bottom + i + l.height < f - Q ? m = "bottom" : m === "right" && c.right + i + p > u - Q ? m = "left" : m === "left" && c.left - i - p < Q && (m = "right"));
4661
+ let g = 0, _ = 0;
4662
+ m === "bottom" || m === "top" ? (g = m === "bottom" ? c.bottom + i : c.top - i - l.height, _ = h === "start" ? c.left : h === "end" ? c.right - p : c.left + c.width / 2 - p / 2) : (_ = m === "right" ? c.right + i : c.left - i - p, g = c.top), _ = Math.min(Math.max(Q, _), u - p - Q), g = Math.min(Math.max(Q, g), f - l.height - Q), d({
4663
+ style: {
4664
+ position: "fixed",
4665
+ top: g,
4666
+ left: _,
4667
+ ...o ? { minWidth: c.width } : {},
4668
+ visibility: "visible"
4669
+ },
4670
+ placement: `${m}${h ? `-${h}` : ""}`
4671
+ });
4672
+ }, [
4673
+ e,
4674
+ t,
4675
+ r,
4676
+ i,
4677
+ a,
4678
+ o,
4679
+ s
4680
+ ]);
4681
+ return f(() => {
4682
+ n && p();
4683
+ }, [n, p]), u(() => {
4684
+ if (n) return window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
4685
+ window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
4686
+ };
4687
+ }, [n, p]), l;
4688
+ }
4689
+ function $n(e, t, n) {
4690
+ u(() => {
4691
+ if (!e) return;
4692
+ let r = (e) => {
4693
+ n.some((t) => t.current?.contains(e.target)) || t();
4694
+ }, i = (e) => e.key === "Escape" && t();
4695
+ return document.addEventListener("pointerdown", r), document.addEventListener("keydown", i), () => {
4696
+ document.removeEventListener("pointerdown", r), document.removeEventListener("keydown", i);
4697
+ };
4698
+ }, [
4699
+ e,
4700
+ t,
4701
+ n
4702
+ ]);
4703
+ }
4704
+ function $(e, t, n = "[role=\"menuitem\"]:not([aria-disabled=\"true\"])") {
4705
+ if (!e) return;
4706
+ let r = Array.from(e.querySelectorAll(n));
4707
+ if (!r.length) return;
4708
+ let i = r.indexOf(document.activeElement);
4709
+ r[t === "first" ? 0 : t === "last" ? r.length - 1 : (i + t + r.length) % r.length]?.focus();
4710
+ }
4711
+ //#endregion
4712
+ //#region src/components/Floating/Floating.tsx
4713
+ function er(e, t, n) {
4714
+ let [r, i] = h(t);
4715
+ return [e ?? r, c((t) => {
4716
+ e === void 0 && i(t), n?.(t);
4717
+ }, [e, n])];
4718
+ }
4719
+ var tr = ({ children: e }) => typeof document > "u" ? null : g(e, document.body);
4720
+ function nr({ trigger: r, children: i, placement: o = "bottom-end", open: s, defaultOpen: l = !1, onOpenChange: u, align: f = "center", keepOpen: h, className: g }) {
4721
+ let [_, v] = er(s, l, u), y = m(null), b = m(null), x = d(), { style: S } = Qn(y, b, {
4722
+ open: _,
4723
+ placement: o
4724
+ }), C = c(() => v(!1), [v]);
4725
+ return $n(_, C, p(() => [y, b], [])), /* @__PURE__ */ n(e, { children: [a(r, {
4726
+ ref: y,
4727
+ onClick: (e) => {
4728
+ r.props.onClick?.(e), v(!_), _ || requestAnimationFrame(() => $(b.current, "first"));
4729
+ },
4730
+ "aria-haspopup": "menu",
4731
+ "aria-expanded": _,
4732
+ "aria-controls": _ ? x : void 0
4733
+ }), _ ? /* @__PURE__ */ t(tr, { children: /* @__PURE__ */ t("div", {
4734
+ ref: b,
4735
+ className: "kb-floating",
4736
+ style: S,
4737
+ onKeyDown: (e) => {
4738
+ e.key === "ArrowDown" ? (e.preventDefault(), $(b.current, 1)) : e.key === "ArrowUp" ? (e.preventDefault(), $(b.current, -1)) : e.key === "Home" ? (e.preventDefault(), $(b.current, "first")) : e.key === "End" ? (e.preventDefault(), $(b.current, "last")) : e.key === "Tab" && C();
4739
+ },
4740
+ onClick: (e) => {
4741
+ !h && e.target.closest("[role=\"menuitem\"]") && (C(), y.current?.focus());
4742
+ },
4743
+ children: /* @__PURE__ */ t("div", {
4744
+ role: "menu",
4745
+ id: x,
4746
+ className: [
4747
+ "kb-menu",
4748
+ f === "start" && "kb-menu--start",
4749
+ g
4750
+ ].filter(Boolean).join(" "),
4751
+ children: i
4752
+ })
4753
+ }) }) : null] });
4754
+ }
4755
+ function rr({ trigger: r, content: i, placement: o = "bottom-end", open: s, defaultOpen: l = !1, onOpenChange: u, label: f, className: h, ...g }) {
4756
+ let [_, v] = er(s, l, u), y = m(null), b = m(null), x = d(), { style: S } = Qn(y, b, {
4757
+ open: _,
4758
+ placement: o
4759
+ });
4760
+ return $n(_, c(() => v(!1), [v]), p(() => [y, b], [])), /* @__PURE__ */ n(e, { children: [a(r, {
4761
+ ref: y,
4762
+ onClick: (e) => {
4763
+ r.props.onClick?.(e), v(!_);
4764
+ },
4765
+ "aria-haspopup": "dialog",
4766
+ "aria-expanded": _,
4767
+ "aria-controls": _ ? x : void 0
4768
+ }), _ ? /* @__PURE__ */ t(tr, { children: /* @__PURE__ */ t("div", {
4769
+ ref: b,
4770
+ className: "kb-floating",
4771
+ style: S,
4772
+ children: /* @__PURE__ */ t("div", {
4773
+ role: "dialog",
4774
+ "aria-label": f,
4775
+ id: x,
4776
+ className: ["kb-popover", h].filter(Boolean).join(" "),
4777
+ ...g,
4778
+ children: i
4779
+ })
4780
+ }) }) : null] });
4781
+ }
4782
+ function ir({ menu: e, align: r = "start", className: i, children: a, ...o }) {
4783
+ let [s, l] = h(null), u = m(null), d = m(null), f = s !== null, { style: g } = Qn(u, d, {
4784
+ open: f,
4785
+ point: s,
4786
+ placement: "bottom-start",
4787
+ offset: 2
4788
+ }), _ = c(() => l(null), []);
4789
+ $n(f, _, p(() => [d], []));
4790
+ let v = (e, t) => {
4791
+ l({
4792
+ x: e,
4793
+ y: t
4794
+ }), requestAnimationFrame(() => $(d.current, "first"));
4795
+ };
4796
+ return /* @__PURE__ */ n("div", {
4797
+ ref: u,
4798
+ className: i,
4799
+ onContextMenu: (e) => {
4800
+ e.preventDefault(), v(e.clientX, e.clientY);
4801
+ },
4802
+ onKeyDown: (e) => {
4803
+ if (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") {
4804
+ e.preventDefault();
4805
+ let t = e.target.getBoundingClientRect();
4806
+ v(t.left + 8, t.bottom);
4807
+ }
4808
+ },
4809
+ ...o,
4810
+ children: [a, f ? /* @__PURE__ */ t(tr, { children: /* @__PURE__ */ t("div", {
4811
+ ref: d,
4812
+ className: "kb-floating",
4813
+ style: g,
4814
+ onKeyDown: (e) => {
4815
+ e.key === "ArrowDown" ? (e.preventDefault(), $(d.current, 1)) : e.key === "ArrowUp" && (e.preventDefault(), $(d.current, -1));
4816
+ },
4817
+ onClick: (e) => {
4818
+ e.target.closest("[role=\"menuitem\"]") && _();
4819
+ },
4820
+ children: /* @__PURE__ */ t("div", {
4821
+ role: "menu",
4822
+ className: ["kb-menu", r === "start" && "kb-menu--start"].filter(Boolean).join(" "),
4823
+ children: e
4824
+ })
4825
+ }) }) : null]
4826
+ });
4827
+ }
4828
+ //#endregion
4829
+ //#region src/components/Combobox/Combobox.tsx
4830
+ var ar = (e, t) => `${e.label} ${e.keywords ?? ""}`.toLowerCase().includes(t.toLowerCase());
4831
+ function or({ options: r, value: i, defaultValue: a = null, onChange: o, filter: s = ar, emptyText: l = "沒有符合的項目", label: u, size: f = "lg", placeholder: _, disabled: v, id: y, className: b, ...x }) {
4832
+ let [S, C] = h(a), w = i === void 0 ? S : i, T = r.find((e) => e.value === w)?.label ?? "", [E, D] = h(null), [O, k] = h(!1), [A, j] = h(0), M = d(), N = y ?? M, P = `${N}-list`, F = m(null), I = m(null), { style: L } = Qn(F, I, {
4833
+ open: O,
4834
+ placement: "bottom-start",
4835
+ offset: 4,
4836
+ matchWidth: !0
4837
+ }), R = c(() => {
4838
+ k(!1), D(null);
4839
+ }, []);
4840
+ $n(O, R, p(() => [F, I], []));
4841
+ let z = E ? r.filter((e) => s(e, E)) : r, B = (e) => {
4842
+ e.disabled || (i === void 0 && C(e.value), o?.(e.value), R());
4843
+ }, V = (e) => {
4844
+ if (!z.length) return;
4845
+ let t = A;
4846
+ for (let n = 0; n < z.length && (t = (t + e + z.length) % z.length, z[t].disabled); n++);
4847
+ j(t), I.current?.querySelector(`#${CSS.escape(`${P}-${t}`)}`)?.scrollIntoView({ block: "nearest" });
4848
+ }, H = (r) => {
4849
+ if (!E) return r;
4850
+ let i = r.toLowerCase().indexOf(E.toLowerCase());
4851
+ return i < 0 ? r : /* @__PURE__ */ n(e, { children: [
4852
+ r.slice(0, i),
4853
+ /* @__PURE__ */ t("span", {
4854
+ className: "kb-combobox__match",
4855
+ children: r.slice(i, i + E.length)
4856
+ }),
4857
+ r.slice(i + E.length)
4858
+ ] });
4859
+ }, U = /* @__PURE__ */ n("div", {
4860
+ ref: F,
4861
+ className: ["kb-combobox", b].filter(Boolean).join(" "),
4862
+ children: [
4863
+ /* @__PURE__ */ t("input", {
4864
+ id: N,
4865
+ role: "combobox",
4866
+ "aria-expanded": O,
4867
+ "aria-controls": P,
4868
+ "aria-autocomplete": "list",
4869
+ "aria-activedescendant": O && z[A] ? `${P}-${A}` : void 0,
4870
+ className: ["kb-input", `kb-input--${f}`].join(" "),
4871
+ value: E ?? T,
4872
+ placeholder: _,
4873
+ disabled: v,
4874
+ autoComplete: "off",
4875
+ onFocus: () => {
4876
+ k(!0), j(Math.max(0, r.findIndex((e) => e.value === w)));
4877
+ },
4878
+ onChange: (e) => {
4879
+ D(e.target.value), k(!0), j(0);
4880
+ },
4881
+ onKeyDown: (e) => {
4882
+ e.key === "ArrowDown" ? (e.preventDefault(), O ? V(1) : k(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), V(-1)) : e.key === "Enter" && O && z[A] ? (e.preventDefault(), B(z[A])) : (e.key === "Escape" || e.key === "Tab") && R();
4883
+ },
4884
+ ...x
4885
+ }),
4886
+ /* @__PURE__ */ t("span", {
4887
+ className: "kb-combobox__caret",
4888
+ "aria-hidden": "true"
4889
+ }),
4890
+ O && typeof document < "u" ? g(/* @__PURE__ */ t("div", {
4891
+ ref: I,
4892
+ className: "kb-floating",
4893
+ style: L,
4894
+ children: /* @__PURE__ */ n("ul", {
4895
+ role: "listbox",
4896
+ id: P,
4897
+ className: "kb-dropdown__list",
4898
+ children: [z.length === 0 ? /* @__PURE__ */ t("li", {
4899
+ className: "kb-combobox__empty",
4900
+ children: l
4901
+ }) : null, z.map((e, n) => /* @__PURE__ */ t("li", {
4902
+ id: `${P}-${n}`,
4903
+ role: "option",
4904
+ "aria-selected": e.value === w,
4905
+ "aria-disabled": e.disabled || void 0,
4906
+ className: [
4907
+ "kb-dropdown__option",
4908
+ e.value === w && "kb-dropdown__option--selected",
4909
+ n === A && "kb-dropdown__option--active",
4910
+ e.disabled && "kb-dropdown__option--disabled"
4911
+ ].filter(Boolean).join(" "),
4912
+ onMouseEnter: () => j(n),
4913
+ onMouseDown: (t) => {
4914
+ t.preventDefault(), B(e);
4915
+ },
4916
+ children: /* @__PURE__ */ t("span", {
4917
+ className: "kb-dropdown__option-label",
4918
+ children: H(e.label)
4919
+ })
4920
+ }, e.value))]
4921
+ })
4922
+ }), document.body) : null
4923
+ ]
4924
+ });
4925
+ return u ? /* @__PURE__ */ n("div", {
4926
+ className: "kb-field",
4927
+ children: [/* @__PURE__ */ t("label", {
4928
+ className: "kb-field__label",
4929
+ htmlFor: N,
4930
+ children: u
4931
+ }), U]
4932
+ }) : U;
4933
+ }
4934
+ //#endregion
4935
+ export { yt as Accordion, bt as AccordionItem, xt as AccordionRow, zt as ActionFooter, Mt as Alert, re as AppBar, ie as AppBarChip, cn as ArrowButton, bn as Avatar, xn as AvatarGroup, P as Badge, Pt as Breadcrumb, _ as Button, nn as CLOCK_DEFAULT_PATTERN, ke as Calendar, Rn as Caption, H as Card, An as Carousel, y as Checkbox, _t as ChoiceChips, an as Clock, O as ColorInput, or as Combobox, ir as ContextMenu, Zt as CounterTile, Dt as DataTable, D as DateInput, dt as DateRange, Pe as DescriptionList, me as Dialog, It as Drawer, lt as Dropdown, nr as DropdownMenu, We as EditorPanelFooter, Ue as EditorPanelHeader, He as EditorSidebar, Ot as EmptyState, Ae as EventCard, k as FieldPair, w as FieldSlot, gt as FileUpload, be as FilterGroup, xe as FilterOption, Se as FilterSection, rr as FloatingPopover, C as FormGrid, Lt as FormSection, Rt as FormSectionRow, In as Heading, v as IconButton, V as InfoIcon, S as Input, Mn as Kbd, Nn as KbdGroup, Ye as LayerItem, Je as LayerList, pn as LayoutPicker, fn as LayoutPreview, U as List, ne as ListCell, G as ListColumn, ee as ListDetail, W as ListHeader, K as ListRow, Qt as Marquee, Be as MediaCard, Re as MediaGrid, Ve as MediaNotice, L as Menu, z as MenuDivider, R as MenuItem, Xt as NumberBoard, st as NumberStepper, Vt as OptionCard, Ht as OptionCardGroup, J as PageHeader, ae as PageTitle, we as Pagination, Ze as PanelSection, Xe as PanelTitle, vn as PlaylistStrip, ge as Popover, ve as PopoverColumn, _e as PopoverColumns, ye as PopoverFooter, kt as Progress, Kt as QueueItem, qt as QueueRail, Jt as QueueRailSection, b as Radio, ce as RailItem, Kn as ResizableHandle, Gn as ResizablePanel, Jn as ResizablePanelGroup, je as ScheduleBoard, Ne as ScheduleCard, Me as ScheduleColumn, $t as ScreenHeader, N as SegmentedControl, A as Select, jn as Separator, se as SideRail, I as SignalDots, tt as SizeLabel, Ct as Skeleton, $e as SlideCard, Qe as SlideList, Cn as Slider, St as Spinner, pe as Stat, de as StatBar, fe as StatLabel, F as StatusDot, Ie as StepItem, Fe as StepNav, Le as StepTag, te as SubTable, he as Summary, x as Switch, M as Tab, j as Tabs, rt as TagInput, Ln as Text, T as Textarea, q as Thumbnail, Ut as TicketNumber, on as TileCard, sn as TileStat, pt as TimeInput, gn as Timeline, Te as Toast, Ee as ToastRegion, Xn as Toggle, Zn as ToggleGroup, qe as ToolButton, Ge as ToolPalette, Ke as ToolRow, oe as Toolbar, B as Tooltip, le as Tree, ue as TreeItem, et as ZoomControl, rn as formatClock, yn as getInitials, ln as presetLayouts, Qn as useAnchoredPosition, $n as useDismiss };