@glimstone/vue 0.0.0-stage → 4.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 (63) hide show
  1. package/README.md +51 -2
  2. package/dist/Badge.vue.d.ts +49 -0
  3. package/dist/BrandMark.vue.d.ts +6 -0
  4. package/dist/Button.vue.d.ts +43 -0
  5. package/dist/Card.vue.d.ts +25 -0
  6. package/dist/Checkbox.vue.d.ts +24 -0
  7. package/dist/ColorPicker.vue.d.ts +30 -0
  8. package/dist/Combobox.js +70 -0
  9. package/dist/Combobox.vue.d.ts +27 -0
  10. package/dist/ConfirmDialog.vue.d.ts +37 -0
  11. package/dist/ContextMenu.vue.d.ts +27 -0
  12. package/dist/CopyField.vue.d.ts +22 -0
  13. package/dist/EmptyState.vue.d.ts +28 -0
  14. package/dist/IconTipButton.vue.d.ts +24 -0
  15. package/dist/InfoAboutCard.vue.d.ts +4 -0
  16. package/dist/InfoBubble.vue.d.ts +9 -0
  17. package/dist/InfoHelpCard.vue.d.ts +6 -0
  18. package/dist/InfoTile.vue.d.ts +22 -0
  19. package/dist/InfoVersionCard.vue.d.ts +15 -0
  20. package/dist/Kbd.vue.d.ts +15 -0
  21. package/dist/ListSelect.vue.d.ts +37 -0
  22. package/dist/MenuBar.vue.d.ts +13 -0
  23. package/dist/MenuChoice.vue.d.ts +27 -0
  24. package/dist/MenuRows.vue.d.ts +12 -0
  25. package/dist/MenuSelect.vue.d.ts +37 -0
  26. package/dist/MenuSubmenu.vue.d.ts +31 -0
  27. package/dist/Meter.vue.d.ts +23 -0
  28. package/dist/NumberField.vue.d.ts +10 -0
  29. package/dist/PasswordField.vue.d.ts +25 -0
  30. package/dist/Pill.vue.d.ts +23 -0
  31. package/dist/ProgressBar.vue.d.ts +19 -0
  32. package/dist/ReadmeButton.vue.d.ts +33 -0
  33. package/dist/Select.js +444 -0
  34. package/dist/Select.vue.d.ts +50 -0
  35. package/dist/SelectFace.vue.d.ts +26 -0
  36. package/dist/Selector.vue.d.ts +55 -0
  37. package/dist/SelectorSegment.vue.d.ts +28 -0
  38. package/dist/SidebarRow.vue.d.ts +22 -0
  39. package/dist/Slider.js +36 -0
  40. package/dist/Slider.vue.d.ts +23 -0
  41. package/dist/SubCard.vue.d.ts +21 -0
  42. package/dist/TipBubble.vue.d.ts +7 -0
  43. package/dist/TipWrap-rNAEgvb0.js +51 -0
  44. package/dist/TipWrap.d.ts +11 -0
  45. package/dist/ToastViewport.vue.d.ts +25 -0
  46. package/dist/Toggle.vue.d.ts +21 -0
  47. package/dist/UnavailableNotice.vue.d.ts +20 -0
  48. package/dist/Window.vue.d.ts +42 -0
  49. package/dist/confirm.d.ts +20 -0
  50. package/dist/engines.d.ts +12 -0
  51. package/dist/entries/combobox.d.ts +1 -0
  52. package/dist/entries/select.d.ts +1 -0
  53. package/dist/entries/slider.d.ts +1 -0
  54. package/dist/glyphs-Cgknt-k1.js +27 -0
  55. package/dist/glyphs.d.ts +25 -0
  56. package/dist/index.d.ts +42 -0
  57. package/dist/index.js +1995 -0
  58. package/dist/info.d.ts +71 -0
  59. package/dist/selectParts.d.ts +25 -0
  60. package/dist/selectorItem.d.ts +19 -0
  61. package/dist/tipBubble.d.ts +16 -0
  62. package/dist/windowParts.d.ts +22 -0
  63. package/package.json +47 -4
package/dist/index.js ADDED
@@ -0,0 +1,1995 @@
1
+ import { n as e, r as t, t as n } from "./TipWrap-rNAEgvb0.js";
2
+ import { a as r, c as i, d as a, f as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./glyphs-Cgknt-k1.js";
3
+ import { Fragment as _, Teleport as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as w, createTextVNode as T, createVNode as E, defineComponent as D, h as ee, mergeModels as O, mergeProps as k, normalizeClass as A, normalizeStyle as j, onBeforeUnmount as te, onMounted as M, onScopeDispose as N, onUnmounted as ne, openBlock as P, ref as F, renderList as I, renderSlot as L, resolveDynamicComponent as R, shallowRef as z, toDisplayString as B, unref as V, useAttrs as re, useId as ie, useModel as H, useSlots as ae, vModelDynamic as oe, watch as U, withCtx as W, withDirectives as se, withKeys as ce, withModifiers as G } from "vue";
4
+ import { COLOR_NAMES_DE as le, COLOR_PICKER_TEXT as ue, COPIED_MS as de, DEFAULT_MOTION as fe, DEFAULT_SHAPE as pe, DESKTOP_QUERY as me, GLIMSTONE_VERSION as he, MARKS as ge, TOAST_MARKS as _e, WIDE_QUERY as ve, applyAccent as ye, applyMotion as be, applyRainbow as xe, applyShape as Se, attachNumberSteppers as Ce, badgeClassName as we, buttonView as Te, claimMenu as Ee, closeMenuOutside as De, colorPicker as Oe, copyText as ke, countSelector as Ae, floatColorPicker as je, focusFirstMenuRow as Me, focusMenuRow as Ne, focusedAsker as Pe, getLabelMode as Fe, hueVars as Ie, isMenuHead as K, keepReadmeFit as Le, labelModeChanged as Re, mailHref as ze, mediaMatches as Be, menuIsOpen as Ve, menuMove as He, menuRowView as Ue, meterView as We, nearestColorName as Ge, normalizeHex as Ke, offersMail as qe, openInBrowser as Je, pillClassName as Ye, placeMenu as Xe, placeSubmenu as Ze, progressView as Qe, rainbowState as $e, readmePartClass as et, readmeSoon as tt, readmeUnitClass as nt, returnFocus as rt, roveSelector as it, rovedIndex as at, runUpdateCheck as ot, segmentView as st, selectorAxis as ct, selectorFlex as lt, selectorTabId as ut, selectorTabId as dt, selectorView as ft, setLabelMode as pt, sidebarRowView as mt, stackWindow as ht, subscribeLabelMode as gt, subscribeMedia as _t, subscribeRainbow as vt, syncNumberSteppers as yt, takePageHue as bt, tidyMenu as xt, toggleSelection as St, trapDialogKeys as Ct, updateFace as wt, updateStage as Tt, versionLink as q, watchSelectorFit as Et, watchSelectorRows as Dt, windowFocusTarget as Ot, windowFoot as kt } from "@glimstone/core";
5
+ // src/IconTipButton.vue?vue&type=script&setup=true&lang.ts
6
+ var At = [
7
+ "type",
8
+ "disabled",
9
+ "aria-label",
10
+ "aria-describedby"
11
+ ], J = /* @__PURE__ */ D({
12
+ inheritAttrs: !1,
13
+ __name: "IconTipButton",
14
+ props: {
15
+ tip: {},
16
+ disabled: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ type: { default: "button" }
21
+ },
22
+ setup(r) {
23
+ let i = r, a = t(() => i.tip, () => i.disabled);
24
+ return (t, i) => (P(), S(_, null, [E(V(n), {
25
+ on: r.disabled,
26
+ show: V(a).show,
27
+ hide: V(a).hide
28
+ }, {
29
+ default: W(() => [C("button", k(t.$attrs, {
30
+ ref: (e) => V(a).trigger.value = e,
31
+ type: r.type,
32
+ disabled: r.disabled,
33
+ "aria-label": r.tip,
34
+ "aria-describedby": V(a).describedBy.value,
35
+ onMouseenter: i[0] ||= (...e) => V(a).show && V(a).show(...e),
36
+ onMouseleave: i[1] ||= (...e) => V(a).hide && V(a).hide(...e),
37
+ onFocus: i[2] ||= (...e) => V(a).showOnFocus && V(a).showOnFocus(...e),
38
+ onBlur: i[3] ||= (...e) => V(a).hide && V(a).hide(...e)
39
+ }), [L(t.$slots, "default")], 16, At)]),
40
+ _: 3
41
+ }, 8, [
42
+ "on",
43
+ "show",
44
+ "hide"
45
+ ]), E(e, { state: V(a) }, null, 8, ["state"])], 64));
46
+ }
47
+ }), jt = ["disabled"], Y = /* @__PURE__ */ D({
48
+ __name: "Badge",
49
+ props: {
50
+ tone: { default: "neutral" },
51
+ size: { default: "medium" },
52
+ shape: { default: "rounded" },
53
+ as: { default: "span" },
54
+ disabled: {
55
+ type: Boolean,
56
+ default: !1
57
+ },
58
+ wrap: {
59
+ type: Boolean,
60
+ default: !1
61
+ },
62
+ hueIndex: {},
63
+ tip: {},
64
+ insetStart: {},
65
+ inFlow: {
66
+ type: Boolean,
67
+ default: !1
68
+ }
69
+ },
70
+ setup(e) {
71
+ let t = e, n = y(() => t.hueIndex !== void 0 && (t.tone === "heading" || t.tone === "active")), r = y(() => [
72
+ n.value && "glim-hue",
73
+ n.value && t.size === "heading" && "glim-notch-hue",
74
+ we({
75
+ tone: t.tone,
76
+ size: t.size,
77
+ shape: t.shape,
78
+ wrap: t.wrap,
79
+ iconOnly: t.tip !== void 0,
80
+ inFlow: t.inFlow,
81
+ insetStart: t.insetStart,
82
+ action: t.as !== "span"
83
+ })
84
+ ].filter(Boolean)), i = y(() => n.value ? Ie(t.hueIndex) : void 0);
85
+ return (t, n) => e.as === "button" && e.tip !== void 0 ? (P(), b(J, {
86
+ key: 0,
87
+ tip: e.tip,
88
+ disabled: e.disabled,
89
+ class: A(r.value),
90
+ style: j(i.value)
91
+ }, {
92
+ default: W(() => [L(t.$slots, "default")]),
93
+ _: 3
94
+ }, 8, [
95
+ "tip",
96
+ "disabled",
97
+ "class",
98
+ "style"
99
+ ])) : e.as === "button" ? (P(), S("button", {
100
+ key: 1,
101
+ type: "button",
102
+ disabled: e.disabled,
103
+ class: A(r.value),
104
+ style: j(i.value)
105
+ }, [L(t.$slots, "default")], 14, jt)) : e.as === "a" ? (P(), S("a", {
106
+ key: 2,
107
+ class: A(r.value),
108
+ style: j(i.value)
109
+ }, [L(t.$slots, "default")], 6)) : (P(), S("span", {
110
+ key: 3,
111
+ class: A(r.value),
112
+ style: j(i.value)
113
+ }, [L(t.$slots, "default")], 6));
114
+ }
115
+ }), Mt = ["innerHTML"], Nt = /* @__PURE__ */ D({
116
+ __name: "BrandMark",
117
+ props: { svg: {} },
118
+ setup(e) {
119
+ return (t, n) => (P(), S("span", {
120
+ class: "glim-brand-svg",
121
+ "aria-hidden": "true",
122
+ innerHTML: e.svg
123
+ }, null, 8, Mt));
124
+ }
125
+ });
126
+ // src/engines.ts
127
+ function X(e) {
128
+ let t = z(Fe(e));
129
+ return N(gt(() => t.value = Fe(e))), y({
130
+ get: () => t.value,
131
+ set: (t) => {
132
+ pt(e, t), Re();
133
+ }
134
+ });
135
+ }
136
+ function Pt() {
137
+ let e = z($e());
138
+ return N(vt(() => e.value = $e())), y({
139
+ get: () => e.value,
140
+ set: (e) => xe(e)
141
+ });
142
+ }
143
+ function Ft(e) {
144
+ return y(() => {
145
+ let t = e();
146
+ return t === void 0 ? void 0 : Ie(t);
147
+ });
148
+ }
149
+ function It(e, t) {
150
+ let n = z(t()), r = new MutationObserver(() => n.value = t());
151
+ return r.observe(document.documentElement, {
152
+ attributes: !0,
153
+ attributeFilter: [e]
154
+ }), N(() => r.disconnect()), n;
155
+ }
156
+ function Lt() {
157
+ let e = It("data-shape", () => document.documentElement.getAttribute("data-shape") ?? pe);
158
+ return y({
159
+ get: () => e.value,
160
+ set: Se
161
+ });
162
+ }
163
+ function Rt() {
164
+ let e = It("data-motion", () => document.documentElement.getAttribute("data-motion") ?? fe);
165
+ return y({
166
+ get: () => e.value,
167
+ set: be
168
+ });
169
+ }
170
+ function zt() {
171
+ let e = It("style", () => document.documentElement.style.getPropertyValue("--accent"));
172
+ return y({
173
+ get: () => e.value,
174
+ set: (e) => ye(e || void 0)
175
+ });
176
+ }
177
+ // src/Button.vue?vue&type=script&setup=true&lang.ts
178
+ var Bt = [
179
+ "type",
180
+ "disabled",
181
+ "aria-busy",
182
+ "aria-describedby"
183
+ ], Vt = {
184
+ key: 0,
185
+ class: "glim-btn-glyph"
186
+ }, Ht = {
187
+ key: 0,
188
+ class: "glim-spinner"
189
+ }, Z = /* @__PURE__ */ D({
190
+ inheritAttrs: !1,
191
+ __name: "Button",
192
+ props: {
193
+ label: {},
194
+ labelKey: {},
195
+ glyph: {},
196
+ tone: { default: "neutral" },
197
+ variant: { default: "default" },
198
+ disabled: {
199
+ type: Boolean,
200
+ default: !1
201
+ },
202
+ type: { default: "button" },
203
+ title: {},
204
+ hueIndex: {},
205
+ busy: {
206
+ type: Boolean,
207
+ default: !1
208
+ },
209
+ stage: {},
210
+ keepLabel: {
211
+ type: Boolean,
212
+ default: !1
213
+ }
214
+ },
215
+ setup(r, { expose: i }) {
216
+ let a = r, o = X("buttons"), s = y(() => a.glyph ?? (a.labelKey ? f(a.labelKey) : void 0) ?? (a.variant === "chip" ? p : void 0)), c = y(() => Te({
217
+ mode: o.value,
218
+ label: a.label,
219
+ hasGlyph: !!s.value || a.busy,
220
+ tone: a.tone,
221
+ variant: a.variant,
222
+ disabled: a.disabled,
223
+ keepLabel: a.keepLabel,
224
+ title: a.title,
225
+ hueIndex: a.hueIndex,
226
+ stage: a.stage
227
+ })), l = t(() => c.value.tip, () => a.disabled), u = z(null);
228
+ function d(e) {
229
+ u.value = e, l.trigger.value = u.value;
230
+ }
231
+ function m(e) {
232
+ c.value.pageHue && bt(e.currentTarget), l.show();
233
+ }
234
+ function h(e) {
235
+ c.value.pageHue && bt(e.currentTarget), l.showOnFocus();
236
+ }
237
+ return i({ el: u }), (t, i) => (P(), S(_, null, [E(V(n), {
238
+ on: r.disabled && !!c.value.tip,
239
+ show: V(l).show,
240
+ hide: V(l).hide
241
+ }, {
242
+ default: W(() => [C("button", k(t.$attrs, {
243
+ ref: d,
244
+ type: r.type,
245
+ disabled: r.disabled,
246
+ "aria-busy": r.busy || void 0,
247
+ "aria-describedby": V(l).describedBy.value,
248
+ style: c.value.style,
249
+ class: c.value.className,
250
+ onMouseenter: m,
251
+ onMouseleave: i[0] ||= (...e) => V(l).hide && V(l).hide(...e),
252
+ onFocus: h,
253
+ onBlur: i[1] ||= (...e) => V(l).hide && V(l).hide(...e)
254
+ }), [c.value.showGlyph ? (P(), S("span", Vt, [r.busy ? (P(), S("span", Ht)) : (P(), b(R(s.value), { key: 1 }))])) : x("", !0), C("span", { class: A(c.value.labelClass) }, B(r.label), 3)], 16, Bt)]),
255
+ _: 1
256
+ }, 8, [
257
+ "on",
258
+ "show",
259
+ "hide"
260
+ ]), E(e, { state: V(l) }, null, 8, ["state"])], 64));
261
+ }
262
+ }), Ut = ["aria-label", "aria-describedby"], Q = /* @__PURE__ */ D({
263
+ __name: "InfoBubble",
264
+ props: {
265
+ tip: {},
266
+ onAccent: {
267
+ type: Boolean,
268
+ default: !1
269
+ }
270
+ },
271
+ setup(n) {
272
+ let r = n, i = t(() => r.tip);
273
+ return (t, r) => (P(), S(_, null, [C("span", {
274
+ ref: (e) => V(i).trigger.value = e,
275
+ "aria-label": n.tip,
276
+ "aria-describedby": V(i).describedBy.value,
277
+ tabindex: "0",
278
+ class: A(n.onAccent ? "glim-info-icon glim-info-icon--on-accent" : "glim-info-icon"),
279
+ onMouseenter: r[0] ||= (...e) => V(i).show && V(i).show(...e),
280
+ onMouseleave: r[1] ||= (...e) => V(i).hide && V(i).hide(...e),
281
+ onFocus: r[2] ||= (...e) => V(i).showOnFocus && V(i).showOnFocus(...e),
282
+ onBlur: r[3] ||= (...e) => V(i).hide && V(i).hide(...e),
283
+ onClick: r[4] ||= G(() => {}, ["prevent"])
284
+ }, [...r[5] ||= [C("svg", {
285
+ viewBox: "0 0 16 16",
286
+ width: "15",
287
+ height: "15",
288
+ fill: "none",
289
+ "aria-hidden": "true"
290
+ }, [
291
+ C("circle", {
292
+ cx: "8",
293
+ cy: "8",
294
+ r: "7",
295
+ stroke: "currentColor",
296
+ "stroke-width": "1.3"
297
+ }),
298
+ C("circle", {
299
+ cx: "8",
300
+ cy: "4.6",
301
+ r: "0.9",
302
+ fill: "currentColor"
303
+ }),
304
+ C("path", {
305
+ d: "M8 7v4.4",
306
+ stroke: "currentColor",
307
+ "stroke-width": "1.3",
308
+ "stroke-linecap": "round"
309
+ })
310
+ ], -1)]], 42, Ut), E(e, { state: V(i) }, null, 8, ["state"])], 64));
311
+ }
312
+ }), Wt = {
313
+ key: 0,
314
+ class: "glim-panel-heading"
315
+ }, Gt = /* @__PURE__ */ D({
316
+ __name: "Card",
317
+ props: {
318
+ title: {},
319
+ hint: {},
320
+ hueIndex: {},
321
+ nested: { type: Boolean }
322
+ },
323
+ setup(e) {
324
+ let t = e, n = y(() => t.hueIndex === void 0 ? void 0 : Ie(t.hueIndex));
325
+ return (t, r) => (P(), S("div", {
326
+ class: A([
327
+ "glim-panel",
328
+ "glim-notch-card",
329
+ {
330
+ "glim-panel--nested": e.nested,
331
+ "glim-hue": e.hueIndex !== void 0
332
+ }
333
+ ]),
334
+ style: j(n.value)
335
+ }, [e.title || e.hint ? (P(), S("h2", Wt, [E(Y, {
336
+ tone: "heading",
337
+ size: "heading",
338
+ wrap: "",
339
+ "hue-index": e.hueIndex
340
+ }, {
341
+ default: W(() => [T(B(e.title) + " ", 1), e.hint ? (P(), b(Q, {
342
+ key: 0,
343
+ tip: e.hint,
344
+ "on-accent": ""
345
+ }, null, 8, ["tip"])) : x("", !0)]),
346
+ _: 1
347
+ }, 8, ["hue-index"])])) : x("", !0), L(t.$slots, "default")], 6));
348
+ }
349
+ }), Kt = [
350
+ "aria-checked",
351
+ "aria-label",
352
+ "disabled"
353
+ ], qt = {
354
+ class: "glim-checkbox-box",
355
+ "aria-hidden": "true"
356
+ }, Jt = { key: 0 }, Yt = /* @__PURE__ */ D({
357
+ __name: "Checkbox",
358
+ props: /*@__PURE__*/ O({
359
+ label: {},
360
+ hideLabel: {
361
+ type: Boolean,
362
+ default: !1
363
+ },
364
+ slim: {
365
+ type: Boolean,
366
+ default: !1
367
+ },
368
+ disabled: {
369
+ type: Boolean,
370
+ default: !1
371
+ }
372
+ }, {
373
+ modelValue: {
374
+ type: Boolean,
375
+ required: !0
376
+ },
377
+ modelModifiers: {}
378
+ }),
379
+ emits: ["update:modelValue"],
380
+ setup(e) {
381
+ let t = e, n = y(() => t.hideLabel || t.slim), r = H(e, "modelValue");
382
+ return (t, i) => (P(), S("button", {
383
+ type: "button",
384
+ role: "checkbox",
385
+ "aria-checked": r.value,
386
+ "aria-label": n.value ? e.label : void 0,
387
+ disabled: e.disabled,
388
+ class: A(["glim-checkbox", { "glim-checkbox--slim": e.slim }]),
389
+ onClick: i[0] ||= (e) => r.value = !r.value
390
+ }, [C("span", qt, [E(V(u))]), n.value ? x("", !0) : (P(), S("span", Jt, B(e.label), 1))], 10, Kt));
391
+ }
392
+ }), Xt = { class: "glim-picker-foot" }, Zt = {
393
+ key: 0,
394
+ class: "glim-picker-name"
395
+ }, Qt = ["value", "aria-label"], $t = { class: "glim-picker-actions" }, en = /* @__PURE__ */ D({
396
+ __name: "ColorPicker",
397
+ props: /*@__PURE__*/ O({
398
+ anchor: { default: null },
399
+ names: {
400
+ type: [Array, Boolean],
401
+ default: () => le
402
+ },
403
+ text: {}
404
+ }, {
405
+ modelValue: { required: !0 },
406
+ modelModifiers: {}
407
+ }),
408
+ emits: /*@__PURE__*/ O([
409
+ "apply",
410
+ "input",
411
+ "close"
412
+ ], ["update:modelValue"]),
413
+ setup(e, { emit: t }) {
414
+ let n = e, r = H(e, "modelValue"), i = t, a = {
415
+ ...ue,
416
+ ...n.text
417
+ }, o = z(null), s = z(null), c = F(Ke(r.value) ?? "#000000"), l = F(c.value), d = y(() => n.names === !1 ? null : Ge(c.value, n.names)), f = Oe(c.value, (e) => {
418
+ c.value = e, l.value = e, i("input", e);
419
+ }, { text: a }), p;
420
+ M(() => {
421
+ s.value.appendChild(f.el), n.anchor && o.value && (p = je(o.value, n.anchor, () => i("close")), f.focus());
422
+ }), te(() => p?.()), U(r, (e) => {
423
+ let t = Ke(e);
424
+ t && (c.value = t, l.value = t, f.setValue(t));
425
+ });
426
+ function m(e) {
427
+ l.value = e.target.value;
428
+ let t = Ke(l.value);
429
+ t && (c.value = t, f.setValue(t), i("input", t));
430
+ }
431
+ function h() {
432
+ r.value = c.value, i("apply", c.value, d.value), n.anchor && (n.anchor.focus(), i("close"));
433
+ }
434
+ function g(e) {
435
+ e.key === "Enter" && !(e.target instanceof HTMLButtonElement) && (e.preventDefault(), h());
436
+ }
437
+ return (t, n) => (P(), b(v, {
438
+ to: "body",
439
+ disabled: !e.anchor
440
+ }, [C("div", {
441
+ ref_key: "panel",
442
+ ref: o,
443
+ class: A(["glim-picker-panel", e.anchor && "glim-picker-panel--float"]),
444
+ style: j({ "--glim-picker-colour": c.value }),
445
+ onKeydown: g
446
+ }, [
447
+ C("div", {
448
+ ref_key: "host",
449
+ ref: s,
450
+ style: { display: "contents" }
451
+ }, null, 512),
452
+ C("div", Xt, [
453
+ n[0] ||= C("span", {
454
+ class: "glim-picker-swatch",
455
+ "aria-hidden": "true"
456
+ }, null, -1),
457
+ d.value === null ? x("", !0) : (P(), S("span", Zt, B(d.value), 1)),
458
+ C("input", {
459
+ class: "glim-picker-hex",
460
+ value: l.value,
461
+ maxlength: "7",
462
+ spellcheck: "false",
463
+ "aria-label": a.hex,
464
+ onInput: m
465
+ }, null, 40, Qt)
466
+ ]),
467
+ C("div", $t, [E(Z, {
468
+ label: a.apply,
469
+ "label-key": "apply",
470
+ glyph: V(u),
471
+ tone: "accent",
472
+ onClick: h
473
+ }, null, 8, ["label", "glyph"])])
474
+ ], 38)], 8, ["disabled"]));
475
+ }
476
+ }), tn = { class: "glim-modal-head" }, nn = {
477
+ id: "confirmdialog-title",
478
+ class: "glim-modal-title"
479
+ }, rn = { class: "glim-modal-body" }, an = {
480
+ id: "confirmdialog-message",
481
+ class: "glim-modal-text"
482
+ }, on = {
483
+ key: 0,
484
+ class: "glim-modal-extra"
485
+ }, sn = { class: "glim-modal-foot" }, cn = /* @__PURE__ */ D({
486
+ __name: "ConfirmDialog",
487
+ props: {
488
+ title: {},
489
+ message: {},
490
+ confirmLabel: {},
491
+ confirmLabelKey: {},
492
+ confirmGlyph: {},
493
+ cancelLabel: {},
494
+ closeLabel: {}
495
+ },
496
+ emits: ["confirm", "cancel"],
497
+ setup(e, { expose: t, emit: n }) {
498
+ let r = n, i = z(null), a = z(null);
499
+ return M(() => a.value?.el?.focus()), t({ card: i }), (t, n) => (P(), S("div", {
500
+ class: "glim-modal-backdrop",
501
+ onClick: n[3] ||= G((e) => r("cancel"), ["self"])
502
+ }, [C("div", {
503
+ ref_key: "card",
504
+ ref: i,
505
+ role: "dialog",
506
+ "aria-modal": "true",
507
+ "aria-labelledby": "confirmdialog-title",
508
+ "aria-describedby": "confirmdialog-message",
509
+ class: "glim-modal-card"
510
+ }, [
511
+ C("div", tn, [C("h2", nn, [E(Y, {
512
+ tone: "heading",
513
+ size: "heading",
514
+ wrap: ""
515
+ }, {
516
+ default: W(() => [T(B(e.title), 1)]),
517
+ _: 1
518
+ })]), e.closeLabel === void 0 ? x("", !0) : (P(), b(Z, {
519
+ key: 0,
520
+ label: e.closeLabel,
521
+ "label-key": "common.close",
522
+ glyph: V(p),
523
+ class: "glim-modal-close",
524
+ onClick: n[0] ||= (e) => r("cancel")
525
+ }, null, 8, ["label", "glyph"]))]),
526
+ C("div", rn, [C("p", an, B(e.message), 1), t.$slots.extra ? (P(), S("div", on, [L(t.$slots, "extra")])) : x("", !0)]),
527
+ C("div", sn, [E(Z, {
528
+ ref_key: "cancel",
529
+ ref: a,
530
+ label: e.cancelLabel,
531
+ "label-key": "common.cancel",
532
+ glyph: V(h),
533
+ onClick: n[1] ||= (e) => r("cancel")
534
+ }, null, 8, ["label", "glyph"]), E(Z, {
535
+ label: e.confirmLabel,
536
+ "label-key": e.confirmLabelKey ?? null,
537
+ glyph: e.confirmGlyph,
538
+ onClick: n[2] ||= (e) => r("confirm")
539
+ }, null, 8, [
540
+ "label",
541
+ "label-key",
542
+ "glyph"
543
+ ])])
544
+ ], 512)]));
545
+ }
546
+ }), ln = { class: "glim-kbd" }, un = /* @__PURE__ */ D({
547
+ __name: "Kbd",
548
+ setup(e) {
549
+ return (e, t) => (P(), S("kbd", ln, [L(e.$slots, "default")]));
550
+ }
551
+ }), dn = {
552
+ key: 0,
553
+ class: "glim-menu-sep",
554
+ role: "separator"
555
+ }, fn = {
556
+ key: 1,
557
+ class: "glim-menu-head",
558
+ role: "presentation"
559
+ }, pn = [
560
+ "role",
561
+ "aria-checked",
562
+ "aria-haspopup",
563
+ "aria-expanded",
564
+ "disabled",
565
+ "data-row",
566
+ "onClick"
567
+ ], mn = {
568
+ key: 0,
569
+ class: "glim-checkbox-box",
570
+ "aria-hidden": "true"
571
+ }, hn = {
572
+ key: 2,
573
+ class: "glim-menu-glyph",
574
+ "aria-hidden": "true"
575
+ }, gn = { class: "glim-menu-label" }, _n = {
576
+ key: 3,
577
+ class: "glim-menu-end glim-menu-caret",
578
+ "aria-hidden": "true"
579
+ }, vn = {
580
+ key: 4,
581
+ class: "glim-menu-end glim-menu-tick",
582
+ "aria-hidden": "true"
583
+ }, yn = {
584
+ key: 6,
585
+ class: "glim-menu-end glim-menu-count glim-num"
586
+ }, bn = /* @__PURE__ */ D({
587
+ __name: "MenuRows",
588
+ props: {
589
+ entries: {},
590
+ openAt: {}
591
+ },
592
+ emits: ["pick"],
593
+ setup(e, { emit: t }) {
594
+ let n = e, a = t, o = y(() => n.entries.map((e) => e === "-" ? { kind: "sep" } : K(e) ? {
595
+ kind: "head",
596
+ head: e
597
+ } : {
598
+ kind: "item",
599
+ item: e,
600
+ view: Ue(e)
601
+ }));
602
+ return (t, n) => (P(!0), S(_, null, I(o.value, (t, n) => (P(), S(_, { key: n }, [t.kind === "sep" ? (P(), S("div", dn)) : t.kind === "head" ? (P(), S("div", fn, [C("span", null, B(t.head.head), 1), t.head.edit ? (P(), b(J, {
603
+ key: 0,
604
+ tip: t.head.edit.tip,
605
+ role: "menuitem",
606
+ tabindex: "-1",
607
+ class: "glim-menu-head-edit",
608
+ "data-row": n,
609
+ onClick: (e) => a("pick", n)
610
+ }, {
611
+ default: W(() => [(P(), b(R(t.head.edit.glyph ?? V(i))))]),
612
+ _: 2
613
+ }, 1032, [
614
+ "tip",
615
+ "data-row",
616
+ "onClick"
617
+ ])) : x("", !0)])) : (P(), S("button", {
618
+ key: 2,
619
+ type: "button",
620
+ role: t.view.role,
621
+ tabindex: "-1",
622
+ "aria-checked": t.view.role === "menuitem" ? void 0 : t.item.checked,
623
+ "aria-haspopup": t.item.sub ? "menu" : void 0,
624
+ "aria-expanded": t.item.sub ? e.openAt === n : void 0,
625
+ disabled: t.item.disabled,
626
+ class: A(["glim-menu-item", { "glim-menu-item--current": t.view.current }]),
627
+ "data-row": n,
628
+ onClick: (e) => a("pick", n)
629
+ }, [
630
+ t.view.lead === "box" ? (P(), S("span", mn, [E(V(u))])) : t.view.lead === "dot" ? (P(), S("span", {
631
+ key: 1,
632
+ class: "glim-menu-dot",
633
+ style: j({ backgroundColor: t.item.color }),
634
+ "aria-hidden": "true"
635
+ }, null, 4)) : (P(), S("span", hn, [t.view.lead === "glyph" ? (P(), b(R(t.item.glyph), { key: 0 })) : x("", !0)])),
636
+ C("span", gn, B(t.item.label), 1),
637
+ t.view.end === "submenu" ? (P(), S("span", _n, [E(V(r))])) : t.view.end === "tick" ? (P(), S("span", vn, [E(V(u))])) : t.view.end === "shortcut" ? (P(), b(un, {
638
+ key: 5,
639
+ class: "glim-menu-end"
640
+ }, {
641
+ default: W(() => [T(B(t.item.shortcut), 1)]),
642
+ _: 2
643
+ }, 1024)) : t.view.end === "count" ? (P(), S("span", yn, B(t.item.count), 1)) : x("", !0)
644
+ ], 10, pn))], 64))), 128));
645
+ }
646
+ }), xn = ["aria-label"], Sn = ["aria-label"], Cn = /* @__PURE__ */ D({
647
+ __name: "ContextMenu",
648
+ props: {
649
+ x: {},
650
+ y: {},
651
+ items: {},
652
+ above: {
653
+ type: Boolean,
654
+ default: !1
655
+ },
656
+ label: { default: void 0 },
657
+ opener: { default: null }
658
+ },
659
+ emits: ["close", "step"],
660
+ setup(e, { emit: t }) {
661
+ let n = e, r = t, i = z(null), a = z(null), o = Pe(), s = F({
662
+ left: n.x,
663
+ top: n.y
664
+ }), c = z(null), l = F(null), u = y(() => xt(n.items)), d = y(() => {
665
+ let e = c.value ? u.value[c.value.at] : void 0;
666
+ return e && e !== "-" && !K(e) && e.sub ? e : null;
667
+ }), f = y(() => d.value?.sub ? xt(d.value.sub) : null), p = () => ({
668
+ width: innerWidth,
669
+ height: innerHeight
670
+ });
671
+ function m(e) {
672
+ r("close"), e && rt(n.opener ?? o);
673
+ }
674
+ function h() {
675
+ let e = i.value;
676
+ e && (s.value = Xe(n.x, n.y, {
677
+ width: e.offsetWidth,
678
+ height: e.offsetHeight
679
+ }, p(), n.above));
680
+ }
681
+ U(() => [
682
+ n.x,
683
+ n.y,
684
+ n.above
685
+ ], h, { flush: "post" });
686
+ let g, _;
687
+ M(() => {
688
+ h(), g = Ee(m), _ = De(() => [
689
+ i.value,
690
+ a.value,
691
+ n.opener
692
+ ], () => m(!1)), i.value && Me(i.value);
693
+ }), ne(() => {
694
+ g?.(), _?.();
695
+ }), U(c, (e) => {
696
+ l.value = null;
697
+ let t = e && i.value?.querySelector(`[data-row="${e.at}"]`), n = a.value;
698
+ if (!e || !t || !n) return;
699
+ let r = getComputedStyle(i.value).direction === "rtl";
700
+ l.value = Ze(t.getBoundingClientRect(), {
701
+ width: n.offsetWidth,
702
+ height: n.offsetHeight
703
+ }, p(), r), e.focus && Me(n);
704
+ }, { flush: "post" });
705
+ function w(e, t) {
706
+ let n = e[t];
707
+ n !== "-" && (K(n) ? (m(!0), n.edit?.onSelect()) : n.sub && e === u.value ? c.value = {
708
+ at: t,
709
+ focus: !0
710
+ } : (Ue(n).staysOpen || m(!0), n.onSelect?.()));
711
+ }
712
+ function T(e, t) {
713
+ if (e.key === "Tab") return m(!1);
714
+ let n = e.currentTarget, a = He(e.key, getComputedStyle(n).direction === "rtl");
715
+ if (!a) return;
716
+ if (e.preventDefault(), a !== "in" && a !== "out") return Ne(n, a);
717
+ if (t) {
718
+ a === "out" && c.value && (i.value?.querySelector(`[data-row="${c.value.at}"]`)?.focus(), c.value = null);
719
+ return;
720
+ }
721
+ let o = Number(document.activeElement?.dataset.row), s = u.value[o];
722
+ a === "in" && s && s !== "-" && !K(s) && s.sub && !s.disabled ? c.value = {
723
+ at: o,
724
+ focus: !0
725
+ } : r("step", a === "in" ? 1 : -1);
726
+ }
727
+ function D(e) {
728
+ let t = e.target.closest("[data-row]");
729
+ if (!t) return;
730
+ let n = Number(t.dataset.row), r = u.value[n], i = r !== "-" && !K(r) && !!r.sub && !r.disabled;
731
+ i && c.value?.at !== n ? c.value = {
732
+ at: n,
733
+ focus: !1
734
+ } : !i && c.value && (c.value = null);
735
+ }
736
+ return (t, n) => (P(), b(v, { to: "body" }, [C("div", {
737
+ ref_key: "menu",
738
+ ref: i,
739
+ role: "menu",
740
+ "aria-label": e.label,
741
+ class: "glim-menu",
742
+ style: j({
743
+ left: `${s.value.left}px`,
744
+ top: `${s.value.top}px`
745
+ }),
746
+ onKeydown: n[1] ||= (e) => T(e, !1),
747
+ onMouseover: D,
748
+ onContextmenu: n[2] ||= G(() => {}, ["prevent"])
749
+ }, [E(bn, {
750
+ entries: u.value,
751
+ "open-at": c.value?.at,
752
+ onPick: n[0] ||= (e) => w(u.value, e)
753
+ }, null, 8, ["entries", "open-at"])], 44, xn), f.value ? (P(), S("div", {
754
+ key: 0,
755
+ ref_key: "subMenu",
756
+ ref: a,
757
+ role: "menu",
758
+ "aria-label": d.value?.label,
759
+ class: "glim-menu",
760
+ style: j({
761
+ left: `${l.value?.left ?? 0}px`,
762
+ top: `${l.value?.top ?? 0}px`
763
+ }),
764
+ onKeydown: n[4] ||= (e) => T(e, !0),
765
+ onContextmenu: n[5] ||= G(() => {}, ["prevent"])
766
+ }, [E(bn, {
767
+ entries: f.value,
768
+ onPick: n[3] ||= (e) => w(f.value, e)
769
+ }, null, 8, ["entries"])], 44, Sn)) : x("", !0)]));
770
+ }
771
+ }), wn = { class: "glim-copy" }, Tn = ["value", "aria-label"], En = {
772
+ role: "status",
773
+ class: "glim-sr-only"
774
+ }, Dn = /* @__PURE__ */ D({
775
+ __name: "CopyField",
776
+ props: {
777
+ value: {},
778
+ label: {},
779
+ text: { default: () => ({
780
+ copy: "Copy",
781
+ copied: "Copied"
782
+ }) }
783
+ },
784
+ emits: ["copy"],
785
+ setup(e, { emit: t }) {
786
+ let n = e, r = t, i = F(!1), a = z(null), o;
787
+ te(() => clearTimeout(o));
788
+ async function c() {
789
+ let e = await ke(n.value);
790
+ r("copy", e), e ? (i.value = !0, clearTimeout(o), o = window.setTimeout(() => i.value = !1, de)) : (a.value?.focus(), a.value?.select());
791
+ }
792
+ return (t, n) => (P(), S("span", wn, [
793
+ C("input", {
794
+ ref_key: "field",
795
+ ref: a,
796
+ readonly: "",
797
+ value: e.value,
798
+ "aria-label": e.label,
799
+ spellcheck: "false",
800
+ class: "glim-input glim-input--mono"
801
+ }, null, 8, Tn),
802
+ E(Z, {
803
+ label: i.value ? e.text.copied : e.text.copy,
804
+ "label-key": i.value ? "copied" : "copy",
805
+ glyph: i.value ? V(u) : V(s),
806
+ variant: "icon",
807
+ onClick: c
808
+ }, null, 8, [
809
+ "label",
810
+ "label-key",
811
+ "glyph"
812
+ ]),
813
+ C("span", En, B(i.value ? e.text.copied : ""), 1)
814
+ ]));
815
+ }
816
+ }), On = {
817
+ key: 0,
818
+ class: "glim-empty-glyph",
819
+ "aria-hidden": "true"
820
+ }, kn = { class: "glim-empty-title" }, An = {
821
+ key: 1,
822
+ class: "glim-empty-hint"
823
+ }, jn = /* @__PURE__ */ D({
824
+ __name: "EmptyState",
825
+ props: {
826
+ glyph: {},
827
+ title: {},
828
+ hint: {},
829
+ nested: {
830
+ type: Boolean,
831
+ default: !1
832
+ }
833
+ },
834
+ setup(e) {
835
+ return (t, n) => (P(), S("div", { class: A(e.nested ? "glim-empty" : "glim-card glim-empty") }, [
836
+ e.glyph ? (P(), S("span", On, [(P(), b(R(e.glyph)))])) : x("", !0),
837
+ C("p", kn, B(e.title), 1),
838
+ e.hint ? (P(), S("p", An, B(e.hint), 1)) : x("", !0),
839
+ L(t.$slots, "default")
840
+ ], 2));
841
+ }
842
+ }), Mn = {
843
+ key: 0,
844
+ class: "glim-readme-btn-art",
845
+ "aria-hidden": "true"
846
+ }, Nn = { class: "glim-readme-btn-text" }, Pn = { class: "glim-readme-btn-name" }, Fn = {
847
+ key: 0,
848
+ class: "glim-readme-btn-sub"
849
+ }, In = {
850
+ key: 0,
851
+ class: "glim-readme-btn-sheen",
852
+ "aria-hidden": "true"
853
+ }, Ln = {
854
+ key: 1,
855
+ class: "glim-readme-btn-hint"
856
+ }, $ = /* @__PURE__ */ D({
857
+ __name: "ReadmeButton",
858
+ props: {
859
+ brand: {},
860
+ parts: {},
861
+ markClass: {},
862
+ hint: {},
863
+ note: {
864
+ type: Boolean,
865
+ default: !1
866
+ },
867
+ soonLabel: {}
868
+ },
869
+ emits: ["linkClick"],
870
+ setup(e, { emit: t }) {
871
+ let n = e, r = t, i = y(() => tt(n.parts)), a = z(null), o = y(() => n.parts.map((e) => `${e.name}\n${e.sub ?? ""}`).join("\n") + (i.value ? n.soonLabel : "")), s;
872
+ U([a, o], () => {
873
+ s?.(), s = a.value ? Le(a.value) : void 0;
874
+ }, { flush: "post" }), N(() => s?.());
875
+ let c = (e) => i.value ? n.soonLabel : e.sub, l = (e) => c(e) ? `${e.name} ${c(e)}` : e.name, u = (e) => i.value ? "span" : e.href ? "a" : "button", d = (e) => i.value ? { "aria-disabled": !0 } : e.href ? {
876
+ href: e.href,
877
+ target: "_blank",
878
+ rel: "noreferrer noopener",
879
+ onClick: (e) => r("linkClick", e)
880
+ } : {
881
+ type: "button",
882
+ onClick: e.onClick
883
+ };
884
+ return (t, n) => (P(), S("div", {
885
+ ref_key: "root",
886
+ ref: a,
887
+ class: A(V(nt)(e.brand, e.parts.length, e.note, i.value))
888
+ }, [
889
+ (P(!0), S(_, null, I(e.parts, (n, r) => (P(), b(R(u(n)), k({ key: r }, { ref_for: !0 }, d(n), {
890
+ "aria-label": l(n),
891
+ class: V(et)(r, i.value)
892
+ }), {
893
+ default: W(() => [r === 0 && t.$slots.art ? (P(), S("span", Mn, [L(t.$slots, "art")])) : (P(), S(_, { key: 1 }, [r === 0 && t.$slots.mark ? (P(), S("span", {
894
+ key: 0,
895
+ class: A(`glim-readme-btn-mark ${e.markClass ?? ""}`),
896
+ "aria-hidden": "true"
897
+ }, [L(t.$slots, "mark")], 2)) : x("", !0), C("span", Nn, [C("span", Pn, B(n.name), 1), c(n) ? (P(), S("span", Fn, B(c(n)), 1)) : x("", !0)])], 64))]),
898
+ _: 2
899
+ }, 1040, ["aria-label", "class"]))), 128)),
900
+ i.value ? x("", !0) : (P(), S("span", In)),
901
+ e.hint ? (P(), S("span", Ln, [E(Q, { tip: e.hint }, null, 8, ["tip"])])) : x("", !0)
902
+ ], 2));
903
+ }
904
+ }), Rn = { class: "glim-info-text" }, zn = { class: "glim-info-text" }, Bn = { class: "glim-readme-btn-rows glim-about-give" }, Vn = /* @__PURE__ */ D({
905
+ __name: "InfoAboutCard",
906
+ props: {
907
+ text: {},
908
+ onCoffee: { type: Function },
909
+ coffeeArt: {},
910
+ onPaypal: { type: Function },
911
+ paypalGlyph: {},
912
+ onCrypto: { type: Function },
913
+ cryptoGlyph: {},
914
+ hueIndex: {}
915
+ },
916
+ setup(e) {
917
+ return (t, n) => (P(), b(Gt, {
918
+ title: e.text.title,
919
+ "hue-index": e.hueIndex
920
+ }, {
921
+ default: W(() => [
922
+ C("p", Rn, B(e.text.body), 1),
923
+ C("p", zn, B(e.text.coffee), 1),
924
+ C("div", Bn, [
925
+ E($, {
926
+ brand: "coffee",
927
+ parts: [{
928
+ name: e.text.coffeeButton,
929
+ onClick: e.onCoffee
930
+ }]
931
+ }, {
932
+ art: W(() => [(P(), b(R(e.coffeeArt)))]),
933
+ _: 1
934
+ }, 8, ["parts"]),
935
+ e.onPaypal && e.text.paypalButton ? (P(), b($, {
936
+ key: 0,
937
+ brand: "paypal",
938
+ parts: [{
939
+ name: e.text.paypalButton,
940
+ onClick: e.onPaypal
941
+ }],
942
+ "mark-class": "glim-paypal-mark"
943
+ }, w({ _: 2 }, [e.paypalGlyph ? {
944
+ name: "mark",
945
+ fn: W(() => [(P(), b(R(e.paypalGlyph)))]),
946
+ key: "0"
947
+ } : void 0]), 1032, ["parts"])) : x("", !0),
948
+ e.onCrypto && e.text.cryptoButton ? (P(), b($, {
949
+ key: 1,
950
+ brand: "bitcoin",
951
+ parts: [{
952
+ name: e.text.cryptoButton,
953
+ onClick: e.onCrypto
954
+ }],
955
+ "mark-class": "glim-bitcoin-mark"
956
+ }, w({ _: 2 }, [e.cryptoGlyph ? {
957
+ name: "mark",
958
+ fn: W(() => [(P(), b(R(e.cryptoGlyph)))]),
959
+ key: "0"
960
+ } : void 0]), 1032, ["parts"])) : x("", !0)
961
+ ])
962
+ ]),
963
+ _: 1
964
+ }, 8, ["title", "hue-index"]));
965
+ }
966
+ }), Hn = { class: "glim-info-text" }, Un = { class: "glim-readme-btn-rows" }, Wn = /* @__PURE__ */ D({
967
+ __name: "InfoHelpCard",
968
+ props: {
969
+ text: {},
970
+ repoUrl: {},
971
+ repoGlyph: {},
972
+ mailAddress: {},
973
+ mailGlyph: {},
974
+ manualUrl: {},
975
+ manualGlyph: {},
976
+ onBugReport: {},
977
+ bugGlyph: {},
978
+ openUrl: { default: Je },
979
+ hueIndex: {}
980
+ },
981
+ setup(e) {
982
+ let t = e, n = y(() => qe(t.text.report, t.mailAddress));
983
+ return (t, r) => (P(), b(Gt, {
984
+ title: e.text.title,
985
+ hint: e.text.hint,
986
+ "hue-index": e.hueIndex
987
+ }, {
988
+ default: W(() => [C("p", Hn, B(e.text.report), 1), C("div", Un, [
989
+ E($, {
990
+ brand: "github",
991
+ parts: [{
992
+ name: e.text.repoButton,
993
+ onClick: () => e.openUrl(e.repoUrl)
994
+ }],
995
+ "mark-class": "glim-github-mark"
996
+ }, w({ _: 2 }, [e.repoGlyph ? {
997
+ name: "mark",
998
+ fn: W(() => [(P(), b(R(e.repoGlyph)))]),
999
+ key: "0"
1000
+ } : void 0]), 1032, ["parts"]),
1001
+ n.value ? (P(), b($, {
1002
+ key: 0,
1003
+ brand: "house",
1004
+ parts: [{
1005
+ name: e.text.mailButton,
1006
+ onClick: () => e.openUrl(V(ze)(e.mailAddress, e.text.mailSubject))
1007
+ }],
1008
+ "mark-class": "glim-house-mark"
1009
+ }, w({ _: 2 }, [e.mailGlyph ? {
1010
+ name: "mark",
1011
+ fn: W(() => [(P(), b(R(e.mailGlyph)))]),
1012
+ key: "0"
1013
+ } : void 0]), 1032, ["parts"])) : x("", !0),
1014
+ e.manualUrl && e.text.manual ? (P(), b($, {
1015
+ key: 1,
1016
+ brand: "docs",
1017
+ parts: [{
1018
+ name: e.text.manual,
1019
+ sub: e.text.manualSub,
1020
+ onClick: () => e.openUrl(e.manualUrl)
1021
+ }],
1022
+ "mark-class": "glim-docs-mark"
1023
+ }, w({ _: 2 }, [e.manualGlyph ? {
1024
+ name: "mark",
1025
+ fn: W(() => [(P(), b(R(e.manualGlyph)))]),
1026
+ key: "0"
1027
+ } : void 0]), 1032, ["parts"])) : x("", !0),
1028
+ e.onBugReport && e.text.bugReport ? (P(), b($, {
1029
+ key: 2,
1030
+ brand: "github",
1031
+ parts: [{
1032
+ name: e.text.bugReport,
1033
+ sub: e.text.bugReportSub,
1034
+ onClick: e.onBugReport
1035
+ }]
1036
+ }, w({ _: 2 }, [e.bugGlyph ? {
1037
+ name: "mark",
1038
+ fn: W(() => [(P(), b(R(e.bugGlyph)))]),
1039
+ key: "0"
1040
+ } : void 0]), 1032, ["parts"])) : x("", !0)
1041
+ ])]),
1042
+ _: 1
1043
+ }, 8, [
1044
+ "title",
1045
+ "hint",
1046
+ "hue-index"
1047
+ ]));
1048
+ }
1049
+ }), Gn = { class: "glim-version-rows" }, Kn = { class: "glim-version-name" }, qn = { class: "glim-version-part" }, Jn = {
1050
+ key: 0,
1051
+ class: "glim-version-sub"
1052
+ }, Yn = ["href", "onClick"], Xn = {
1053
+ key: 1,
1054
+ class: "glim-num glim-version-number"
1055
+ }, Zn = {
1056
+ key: 0,
1057
+ class: "glim-version-actions"
1058
+ }, Qn = {
1059
+ role: "status",
1060
+ class: "glim-sr-only"
1061
+ }, $n = /* @__PURE__ */ D({
1062
+ __name: "InfoVersionCard",
1063
+ props: {
1064
+ text: {},
1065
+ rows: {},
1066
+ updateCheck: {},
1067
+ onReleaseNotes: {},
1068
+ openUrl: { default: Je },
1069
+ hueIndex: {}
1070
+ },
1071
+ setup(e) {
1072
+ let t = e, n = ae(), r = y(() => !n["whats-new"] && t.onReleaseNotes && t.text.releaseNotes), i = z({ kind: "idle" }), a = z(0), o = y(() => t.updateCheck && wt(i.value, t.updateCheck.text));
1073
+ function s() {
1074
+ ot(t.updateCheck, i.value, (e) => {
1075
+ i.value = e, e.kind === "failed" && a.value++;
1076
+ });
1077
+ }
1078
+ function c(e, n) {
1079
+ e.preventDefault(), t.openUrl(n);
1080
+ }
1081
+ return (t, n) => (P(), b(Gt, {
1082
+ title: e.text.title,
1083
+ hint: e.text.hint,
1084
+ "hue-index": e.hueIndex
1085
+ }, {
1086
+ default: W(() => [C("ul", Gn, [(P(!0), S(_, null, I(e.rows, (t) => (P(), S("li", {
1087
+ key: t.name,
1088
+ class: "glim-version-row"
1089
+ }, [C("span", Kn, [C("span", qn, B(t.name), 1), t.sub ? (P(), S("span", Jn, B(t.sub), 1)) : x("", !0)]), V(q)(t).href ? (P(), S("a", {
1090
+ key: 0,
1091
+ href: V(q)(t).href,
1092
+ target: "_blank",
1093
+ rel: "noopener noreferrer",
1094
+ class: "glim-num glim-version-number",
1095
+ onClick: (e) => c(e, V(q)(t).href)
1096
+ }, B(V(q)(t).shown), 9, Yn)) : (P(), S("span", Xn, B(V(q)(t).released ? V(q)(t).shown : e.text.unreleased(V(q)(t).shown)), 1))]))), 128))]), r.value || t.$slots["whats-new"] || e.updateCheck ? (P(), S("div", Zn, [
1097
+ r.value ? (P(), b(Z, {
1098
+ key: 0,
1099
+ label: e.text.releaseNotes,
1100
+ "label-key": "about.releaseNotes",
1101
+ onClick: n[0] ||= (t) => e.onReleaseNotes()
1102
+ }, null, 8, ["label"])) : x("", !0),
1103
+ L(t.$slots, "whats-new"),
1104
+ e.updateCheck && o.value ? (P(), S(_, { key: 1 }, [(P(), b(Z, {
1105
+ key: a.value,
1106
+ label: o.value.label,
1107
+ "label-key": o.value.labelKey,
1108
+ tone: o.value.tone,
1109
+ stage: V(Tt)(e.updateCheck.text, o.value.label),
1110
+ busy: i.value.kind === "busy",
1111
+ class: A(a.value > 0 ? "glim-shake" : ""),
1112
+ onClick: s
1113
+ }, null, 8, [
1114
+ "label",
1115
+ "label-key",
1116
+ "tone",
1117
+ "stage",
1118
+ "busy",
1119
+ "class"
1120
+ ])), C("span", Qn, B(o.value.announced), 1)], 64)) : x("", !0)
1121
+ ])) : x("", !0)]),
1122
+ _: 3
1123
+ }, 8, [
1124
+ "title",
1125
+ "hint",
1126
+ "hue-index"
1127
+ ]));
1128
+ }
1129
+ }), er = /* @__PURE__ */ D({
1130
+ __name: "InfoTile",
1131
+ props: {
1132
+ version: {},
1133
+ help: {},
1134
+ about: {},
1135
+ hueIndex: {}
1136
+ },
1137
+ setup(e) {
1138
+ let t = e, n = (e) => t.hueIndex === void 0 ? void 0 : t.hueIndex + e;
1139
+ return (t, r) => (P(), S(_, null, [
1140
+ E($n, k(e.version, { "hue-index": n(0) }), w({ _: 2 }, [t.$slots["whats-new"] ? {
1141
+ name: "whats-new",
1142
+ fn: W(() => [L(t.$slots, "whats-new")]),
1143
+ key: "0"
1144
+ } : void 0]), 1040, ["hue-index"]),
1145
+ E(Wn, k(e.help, { "hue-index": n(1) }), null, 16, ["hue-index"]),
1146
+ E(Vn, k(e.about, { "hue-index": n(2) }), null, 16, ["hue-index"])
1147
+ ], 64));
1148
+ }
1149
+ }), tr = ["aria-label"], nr = [
1150
+ "aria-expanded",
1151
+ "tabindex",
1152
+ "onClick",
1153
+ "onMouseenter",
1154
+ "onKeydown",
1155
+ "onFocus"
1156
+ ], rr = /* @__PURE__ */ D({
1157
+ __name: "MenuBar",
1158
+ props: {
1159
+ label: {},
1160
+ menus: {}
1161
+ },
1162
+ setup(e, { expose: t }) {
1163
+ let n = e, r = [], i = z(null), a = z(0);
1164
+ function o(e) {
1165
+ let t = r[e];
1166
+ if (!t) return;
1167
+ t.focus(), a.value = e;
1168
+ let n = t.getBoundingClientRect();
1169
+ i.value = {
1170
+ at: e,
1171
+ x: n.left,
1172
+ y: n.bottom + 6
1173
+ };
1174
+ }
1175
+ t({ open: o });
1176
+ let s = (e) => (e + n.menus.length) % n.menus.length;
1177
+ function c(e) {
1178
+ i.value?.at === e ? i.value = null : o(e);
1179
+ }
1180
+ function l(e, t) {
1181
+ let n = getComputedStyle(e.currentTarget).direction === "rtl", i = {
1182
+ ArrowRight: n ? -1 : 1,
1183
+ ArrowLeft: n ? 1 : -1
1184
+ }[e.key];
1185
+ i === void 0 ? e.key === "ArrowDown" && (e.preventDefault(), o(t)) : (e.preventDefault(), a.value = s(t + i), r[a.value]?.focus());
1186
+ }
1187
+ return (t, n) => (P(), S("div", {
1188
+ role: "menubar",
1189
+ "aria-label": e.label,
1190
+ class: "glim-menubar"
1191
+ }, [(P(!0), S(_, null, I(e.menus, (e, t) => (P(), S("button", {
1192
+ key: t,
1193
+ ref_for: !0,
1194
+ ref: (e) => r[t] = e,
1195
+ type: "button",
1196
+ role: "menuitem",
1197
+ "aria-haspopup": "menu",
1198
+ "aria-expanded": i.value?.at === t,
1199
+ tabindex: t === a.value ? 0 : -1,
1200
+ class: "glim-menubar-item",
1201
+ onClick: (e) => c(t),
1202
+ onMouseenter: (e) => i.value && i.value.at !== t && o(t),
1203
+ onKeydown: (e) => l(e, t),
1204
+ onFocus: (e) => a.value = t
1205
+ }, B(e.label), 41, nr))), 128)), i.value && e.menus[i.value.at] ? (P(), b(Cn, {
1206
+ key: i.value.at,
1207
+ x: i.value.x,
1208
+ y: i.value.y,
1209
+ items: e.menus[i.value.at].items,
1210
+ label: e.menus[i.value.at].label,
1211
+ opener: r[i.value.at],
1212
+ onClose: n[0] ||= (e) => i.value = null,
1213
+ onStep: n[1] ||= (e) => i.value && o(s(i.value.at + e))
1214
+ }, null, 8, [
1215
+ "x",
1216
+ "y",
1217
+ "items",
1218
+ "label",
1219
+ "opener"
1220
+ ])) : x("", !0)], 8, tr));
1221
+ }
1222
+ }), ir = [
1223
+ "role",
1224
+ "aria-label",
1225
+ "aria-valuemin",
1226
+ "aria-valuemax",
1227
+ "aria-valuenow",
1228
+ "aria-valuetext",
1229
+ "aria-busy"
1230
+ ], ar = /* @__PURE__ */ D({
1231
+ inheritAttrs: !1,
1232
+ __name: "Meter",
1233
+ props: {
1234
+ value: { default: null },
1235
+ label: {},
1236
+ size: { default: "medium" },
1237
+ threshold: { default: .9 },
1238
+ quiet: {
1239
+ type: Boolean,
1240
+ default: !1
1241
+ },
1242
+ valueText: {}
1243
+ },
1244
+ setup(n) {
1245
+ let r = n, i = y(() => We(r.value, {
1246
+ size: r.size,
1247
+ threshold: r.threshold,
1248
+ quiet: r.quiet
1249
+ })), a = y(() => i.value.percent === null), o = t(() => r.valueText);
1250
+ return (t, r) => (P(), S(_, null, [C("span", k(t.$attrs, {
1251
+ ref: (e) => V(o).trigger.value = e,
1252
+ role: a.value ? "progressbar" : "meter",
1253
+ "aria-label": n.label,
1254
+ "aria-valuemin": a.value ? void 0 : 0,
1255
+ "aria-valuemax": a.value ? void 0 : 100,
1256
+ "aria-valuenow": i.value.percent ?? void 0,
1257
+ "aria-valuetext": n.valueText,
1258
+ "aria-busy": a.value || void 0,
1259
+ class: i.value.className,
1260
+ onMouseenter: r[0] ||= (...e) => V(o).show && V(o).show(...e),
1261
+ onMouseleave: r[1] ||= (...e) => V(o).hide && V(o).hide(...e)
1262
+ }), [C("span", {
1263
+ class: "glim-meter-fill",
1264
+ style: j(i.value.width ? { width: i.value.width } : void 0)
1265
+ }, null, 4)], 16, ir), E(e, { state: V(o) }, null, 8, ["state"])], 64));
1266
+ }
1267
+ }), or = { class: "glim-num-wrap" }, sr = /* @__PURE__ */ D({
1268
+ inheritAttrs: !1,
1269
+ __name: "NumberField",
1270
+ props: {
1271
+ modelValue: { default: null },
1272
+ modelModifiers: {}
1273
+ },
1274
+ emits: ["update:modelValue"],
1275
+ setup(e) {
1276
+ let t = H(e, "modelValue"), n = re(), r = z(null), i;
1277
+ M(() => {
1278
+ a(t.value), i = Ce(r.value);
1279
+ }), te(() => i?.());
1280
+ function a(e) {
1281
+ let t = r.value;
1282
+ t && (t.value === "" ? null : t.valueAsNumber) !== e && (t.value = e === null ? "" : String(e));
1283
+ }
1284
+ U([
1285
+ t,
1286
+ () => n.min,
1287
+ () => n.max,
1288
+ () => n.step,
1289
+ () => n.disabled,
1290
+ () => n.readonly
1291
+ ], () => {
1292
+ a(t.value), r.value && yt(r.value);
1293
+ }, { flush: "post" });
1294
+ function o(e) {
1295
+ let n = e.target;
1296
+ t.value = n.value === "" ? null : n.valueAsNumber;
1297
+ }
1298
+ return (e, t) => (P(), S("span", or, [C("input", k(e.$attrs, {
1299
+ ref_key: "input",
1300
+ ref: r,
1301
+ type: "number",
1302
+ class: "glim-num-input glim-num-field glim-num",
1303
+ onInput: o
1304
+ }), null, 16)]));
1305
+ }
1306
+ }), cr = ["disabled", "type"], lr = /* @__PURE__ */ D({
1307
+ inheritAttrs: !1,
1308
+ __name: "PasswordField",
1309
+ props: /*@__PURE__*/ O({
1310
+ text: { default: () => ({
1311
+ show: "Show",
1312
+ hide: "Hide"
1313
+ }) },
1314
+ disabled: {
1315
+ type: Boolean,
1316
+ default: !1
1317
+ }
1318
+ }, {
1319
+ modelValue: { default: "" },
1320
+ modelModifiers: {}
1321
+ }),
1322
+ emits: ["update:modelValue"],
1323
+ setup(e) {
1324
+ let t = H(e, "modelValue"), n = F(!1);
1325
+ return (r, i) => (P(), S("span", {
1326
+ class: A(["glim-secret", r.$attrs.class]),
1327
+ style: j(r.$attrs.style)
1328
+ }, [se(C("input", k({
1329
+ "onUpdate:modelValue": i[0] ||= (e) => t.value = e,
1330
+ autocomplete: "current-password",
1331
+ spellcheck: "false"
1332
+ }, {
1333
+ ...r.$attrs,
1334
+ class: void 0,
1335
+ style: void 0
1336
+ }, {
1337
+ disabled: e.disabled,
1338
+ type: n.value ? "text" : "password",
1339
+ class: "glim-input"
1340
+ }), null, 16, cr), [[oe, t.value]]), E(J, {
1341
+ tip: n.value ? e.text.hide : e.text.show,
1342
+ class: "glim-secret-eye",
1343
+ disabled: e.disabled,
1344
+ onClick: i[1] ||= (e) => n.value = !n.value
1345
+ }, {
1346
+ default: W(() => [(P(), b(R(n.value ? V(m) : V(d))))]),
1347
+ _: 1
1348
+ }, 8, ["tip", "disabled"])], 6));
1349
+ }
1350
+ }), ur = /* @__PURE__ */ D({
1351
+ __name: "Pill",
1352
+ props: { tone: { default: "neutral" } },
1353
+ setup(e) {
1354
+ let t = e, n = y(() => Ye(t.tone));
1355
+ return (e, t) => (P(), S("span", { class: A(n.value) }, [L(e.$slots, "default")], 2));
1356
+ }
1357
+ }), dr = [
1358
+ "aria-label",
1359
+ "aria-valuemin",
1360
+ "aria-valuemax",
1361
+ "aria-valuenow",
1362
+ "aria-valuetext"
1363
+ ], fr = /* @__PURE__ */ D({
1364
+ __name: "ProgressBar",
1365
+ props: {
1366
+ value: { default: null },
1367
+ label: {},
1368
+ paused: {
1369
+ type: Boolean,
1370
+ default: !1
1371
+ },
1372
+ failed: {
1373
+ type: Boolean,
1374
+ default: !1
1375
+ },
1376
+ valueText: {}
1377
+ },
1378
+ setup(e) {
1379
+ let t = e, n = y(() => Qe(t.value, {
1380
+ paused: t.paused,
1381
+ failed: t.failed
1382
+ }));
1383
+ return (t, r) => (P(), S("span", {
1384
+ role: "progressbar",
1385
+ "aria-label": e.label,
1386
+ "aria-valuemin": n.value.percent === null ? void 0 : 0,
1387
+ "aria-valuemax": n.value.percent === null ? void 0 : 100,
1388
+ "aria-valuenow": n.value.percent ?? void 0,
1389
+ "aria-valuetext": e.valueText,
1390
+ class: A(n.value.className)
1391
+ }, [C("span", {
1392
+ class: "glim-progress-fill",
1393
+ style: j(n.value.width ? { width: n.value.width } : void 0)
1394
+ }, null, 4)], 10, dr));
1395
+ }
1396
+ }), pr = [
1397
+ "href",
1398
+ "data-sel-id",
1399
+ "aria-selected",
1400
+ "aria-current",
1401
+ "aria-describedby",
1402
+ "tabindex"
1403
+ ], mr = [
1404
+ "data-sel-id",
1405
+ "id",
1406
+ "role",
1407
+ "aria-selected",
1408
+ "aria-controls",
1409
+ "aria-checked",
1410
+ "aria-pressed",
1411
+ "aria-label",
1412
+ "aria-describedby",
1413
+ "disabled",
1414
+ "tabindex"
1415
+ ], hr = ["id"], gr = /* @__PURE__ */ D({
1416
+ __name: "SelectorSegment",
1417
+ props: {
1418
+ item: {},
1419
+ index: {},
1420
+ strip: {},
1421
+ on: { type: Boolean },
1422
+ disabled: { type: Boolean },
1423
+ roved: { type: Boolean },
1424
+ share: {},
1425
+ squeezed: { type: Boolean },
1426
+ orientation: {},
1427
+ size: {},
1428
+ variant: {},
1429
+ equalWidth: { type: Boolean },
1430
+ buttonHeight: { type: Boolean },
1431
+ pairsOnPhone: { type: Boolean },
1432
+ hue: { type: Boolean },
1433
+ hueOffset: {},
1434
+ panelId: {}
1435
+ },
1436
+ emits: ["select"],
1437
+ setup(r, { emit: i }) {
1438
+ let a = r, o = i, s = y(() => st({
1439
+ strip: a.strip,
1440
+ orientation: a.orientation,
1441
+ size: a.size,
1442
+ variant: a.variant,
1443
+ equalWidth: a.equalWidth,
1444
+ buttonHeight: a.buttonHeight,
1445
+ pairsOnPhone: a.pairsOnPhone,
1446
+ hue: a.hue,
1447
+ hueOffset: a.hueOffset,
1448
+ index: a.index,
1449
+ label: a.item.label,
1450
+ hasGlyph: !!a.item.glyph,
1451
+ iconOnly: !!a.item.iconOnly,
1452
+ tip: a.item.tip,
1453
+ title: a.item.title,
1454
+ on: a.on,
1455
+ disabled: a.disabled,
1456
+ dim: a.item.dim,
1457
+ squeezed: a.squeezed
1458
+ })), c = t(() => s.value.tip, () => a.disabled), l = ie(), u = y(() => a.disabled && !!s.value.tip), d = y(() => u.value ? l : c.describedBy.value), f = y(() => a.strip.kind === "tab"), p = y(() => ({
1459
+ ...s.value.style,
1460
+ ...a.share
1461
+ }));
1462
+ function m(e) {
1463
+ c.trigger.value = e;
1464
+ }
1465
+ function h(e) {
1466
+ e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || e.button !== 0 || (e.preventDefault(), o("select"));
1467
+ }
1468
+ return (t, i) => (P(), S(_, null, [r.orientation === "vertical" ? (P(), S("a", {
1469
+ key: 0,
1470
+ ref: m,
1471
+ href: r.item.href,
1472
+ "data-sel-id": r.item.id,
1473
+ role: "tab",
1474
+ "aria-selected": r.on,
1475
+ "aria-current": r.on ? "page" : void 0,
1476
+ "aria-describedby": d.value,
1477
+ tabindex: r.roved ? 0 : -1,
1478
+ class: A(s.value.className),
1479
+ style: j(p.value),
1480
+ onClick: h,
1481
+ onMouseenter: i[0] ||= (...e) => V(c).show && V(c).show(...e),
1482
+ onMouseleave: i[1] ||= (...e) => V(c).hide && V(c).hide(...e),
1483
+ onFocus: i[2] ||= (...e) => V(c).showOnFocus && V(c).showOnFocus(...e),
1484
+ onBlur: i[3] ||= (...e) => V(c).hide && V(c).hide(...e)
1485
+ }, [s.value.showGlyph && r.item.glyph ? (P(), b(R(r.item.glyph), { key: 0 })) : x("", !0), s.value.labelClass === null ? x("", !0) : (P(), S("span", {
1486
+ key: 1,
1487
+ "data-sel-label": "",
1488
+ class: A(s.value.labelClass)
1489
+ }, B(r.item.label), 3))], 46, pr)) : (P(), S(_, { key: 1 }, [E(V(n), k({
1490
+ on: u.value,
1491
+ show: V(c).show,
1492
+ hide: V(c).hide
1493
+ }, u.value ? { style: r.share } : {}), {
1494
+ default: W(() => [C("button", {
1495
+ ref: m,
1496
+ type: "button",
1497
+ "data-sel-id": r.item.id,
1498
+ id: r.panelId && f.value ? V(dt)(r.panelId, r.item.id) : void 0,
1499
+ role: r.strip.kind === "toggle" ? void 0 : r.strip.kind,
1500
+ "aria-selected": f.value ? r.on : void 0,
1501
+ "aria-controls": r.panelId && f.value && r.on ? r.panelId : void 0,
1502
+ "aria-checked": r.strip.kind === "radio" ? r.on : void 0,
1503
+ "aria-pressed": r.strip.kind === "toggle" ? r.on : void 0,
1504
+ "aria-label": s.value.ariaLabel,
1505
+ "aria-describedby": d.value,
1506
+ disabled: r.disabled,
1507
+ tabindex: r.roved ? 0 : -1,
1508
+ class: A(s.value.className),
1509
+ style: j(p.value),
1510
+ onClick: i[4] ||= (e) => o("select"),
1511
+ onMouseenter: i[5] ||= (...e) => V(c).show && V(c).show(...e),
1512
+ onMouseleave: i[6] ||= (...e) => V(c).hide && V(c).hide(...e),
1513
+ onFocus: i[7] ||= (...e) => V(c).showOnFocus && V(c).showOnFocus(...e),
1514
+ onBlur: i[8] ||= (...e) => V(c).hide && V(c).hide(...e)
1515
+ }, [s.value.showGlyph && r.item.glyph ? (P(), b(R(r.item.glyph), { key: 0 })) : x("", !0), s.value.labelClass === null ? x("", !0) : (P(), S("span", {
1516
+ key: 1,
1517
+ "data-sel-label": "",
1518
+ class: A(s.value.labelClass)
1519
+ }, B(r.item.label), 3))], 46, mr)]),
1520
+ _: 1
1521
+ }, 16, [
1522
+ "on",
1523
+ "show",
1524
+ "hide"
1525
+ ]), u.value ? (P(), S("span", {
1526
+ key: 0,
1527
+ id: V(l),
1528
+ hidden: ""
1529
+ }, B(s.value.tip), 9, hr)) : x("", !0)], 64)), E(e, { state: V(c) }, null, 8, ["state"])], 64));
1530
+ }
1531
+ }), _r = [
1532
+ "role",
1533
+ "aria-label",
1534
+ "aria-orientation"
1535
+ ], vr = /* @__PURE__ */ D({
1536
+ __name: "Selector",
1537
+ props: /*@__PURE__*/ O({
1538
+ items: {},
1539
+ label: {},
1540
+ select: { default: "one" },
1541
+ orientation: { default: "horizontal" },
1542
+ size: { default: "md" },
1543
+ variant: { default: "well" },
1544
+ activation: { default: "auto" },
1545
+ equalWidth: {
1546
+ type: Boolean,
1547
+ default: !1
1548
+ },
1549
+ inline: {
1550
+ type: Boolean,
1551
+ default: !1
1552
+ },
1553
+ fit: {
1554
+ type: Boolean,
1555
+ default: !1
1556
+ },
1557
+ pairsOnPhone: {
1558
+ type: Boolean,
1559
+ default: !1
1560
+ },
1561
+ buttonHeight: {
1562
+ type: Boolean,
1563
+ default: !1
1564
+ },
1565
+ hue: {
1566
+ type: Boolean,
1567
+ default: !0
1568
+ },
1569
+ hueOffset: {},
1570
+ disabled: {
1571
+ type: Boolean,
1572
+ default: !1
1573
+ },
1574
+ panelId: {}
1575
+ }, {
1576
+ modelValue: { required: !0 },
1577
+ modelModifiers: {}
1578
+ }),
1579
+ emits: ["update:modelValue"],
1580
+ setup(e) {
1581
+ let t = e, n = H(e, "modelValue");
1582
+ function r(e) {
1583
+ let t = z(Be(e));
1584
+ return N(_t(e, () => t.value = Be(e))), t;
1585
+ }
1586
+ let i = X(ct(t.size, t.orientation)), a = r(me), o = r(ve), s = y(() => ft({
1587
+ mode: i.value,
1588
+ select: t.select,
1589
+ activation: t.activation,
1590
+ orientation: t.orientation,
1591
+ size: t.size,
1592
+ variant: t.variant,
1593
+ equalWidth: t.equalWidth,
1594
+ inline: t.inline,
1595
+ fit: t.fit,
1596
+ pairsOnPhone: t.pairsOnPhone,
1597
+ hue: t.hue,
1598
+ hueOffset: t.hueOffset,
1599
+ desktop: a.value,
1600
+ wide: o.value,
1601
+ items: t.items.map((e) => ({
1602
+ hasGlyph: !!e.glyph,
1603
+ iconOnly: !!e.iconOnly
1604
+ }))
1605
+ })), c = z(null), l = z(null), u = F("even"), d = y(() => t.items.map((e) => e.label).join("\n")), f = y(() => t.items.map((e) => t.disabled || e.disabled ? "1" : "0").join(""));
1606
+ function p(e, t) {
1607
+ U([c, e], (e, n, r) => {
1608
+ if (!c.value) return;
1609
+ let i = t(c.value);
1610
+ i && r(i);
1611
+ }, { flush: "post" });
1612
+ }
1613
+ p(() => s.value.counted, (e) => s.value.counted ? Ae(e) : void 0), p(() => [
1614
+ s.value.pinWidth,
1615
+ t.equalWidth,
1616
+ t.inline,
1617
+ d.value,
1618
+ f.value,
1619
+ t.size,
1620
+ s.value.mode
1621
+ ].join("|"), (e) => {
1622
+ if (!s.value.pinWidth) l.value = null;
1623
+ else return Dt(e, {
1624
+ inline: t.inline,
1625
+ equalWidth: t.equalWidth
1626
+ }, (e) => l.value = e);
1627
+ }), p(() => [
1628
+ s.value.canSqueeze,
1629
+ d.value,
1630
+ f.value,
1631
+ t.size
1632
+ ].join("|"), (e) => {
1633
+ if (!s.value.canSqueeze) u.value = "even";
1634
+ else return Et(e, (e) => u.value = e);
1635
+ });
1636
+ let m = y(() => lt({
1637
+ rows: l.value,
1638
+ pinWidth: s.value.pinWidth,
1639
+ inline: t.inline,
1640
+ fit: t.fit,
1641
+ fitMode: u.value,
1642
+ pairsOnPhone: t.pairsOnPhone
1643
+ })), h = y(() => t.select === "many"), g = (e) => h.value ? (n.value ?? []).includes(e) : n.value === e, v = y(() => t.items.map((e) => t.disabled || !!e.disabled)), x = y(() => at(v.value, t.items.findIndex((e) => g(e.id))));
1644
+ function C(e) {
1645
+ n.value = h.value ? St(n.value ?? [], e, t.items.map((e) => e.id)) : e;
1646
+ }
1647
+ function w(e) {
1648
+ let n = e.target;
1649
+ if (t.orientation === "vertical" && e.key === " " && n.dataset.selId) {
1650
+ e.preventDefault(), n.click();
1651
+ return;
1652
+ }
1653
+ let r = it(c.value, e.key, t.orientation);
1654
+ r && (e.preventDefault(), s.value.autoSelect && r.dataset.selId && C(r.dataset.selId));
1655
+ }
1656
+ return (t, n) => (P(), S("div", {
1657
+ ref_key: "track",
1658
+ ref: c,
1659
+ role: s.value.role,
1660
+ "aria-label": e.label,
1661
+ "aria-orientation": s.value.role === "group" ? void 0 : e.orientation,
1662
+ class: A(s.value.className),
1663
+ style: j(m.value.track),
1664
+ onKeydown: w
1665
+ }, [(P(!0), S(_, null, I(e.items, (t, n) => (P(), b(gr, {
1666
+ key: t.id,
1667
+ item: t,
1668
+ index: n,
1669
+ strip: s.value,
1670
+ on: g(t.id),
1671
+ disabled: v.value[n],
1672
+ roved: n === x.value,
1673
+ share: e.orientation === "vertical" ? {} : m.value.segment,
1674
+ squeezed: s.value.canSqueeze && u.value === "squeezed",
1675
+ orientation: e.orientation,
1676
+ size: e.size,
1677
+ variant: e.variant,
1678
+ "equal-width": e.equalWidth,
1679
+ "button-height": e.buttonHeight,
1680
+ "pairs-on-phone": e.pairsOnPhone,
1681
+ hue: e.hue,
1682
+ "hue-offset": e.hueOffset,
1683
+ "panel-id": e.panelId,
1684
+ onSelect: (e) => C(t.id)
1685
+ }, null, 8, [
1686
+ "item",
1687
+ "index",
1688
+ "strip",
1689
+ "on",
1690
+ "disabled",
1691
+ "roved",
1692
+ "share",
1693
+ "squeezed",
1694
+ "orientation",
1695
+ "size",
1696
+ "variant",
1697
+ "equal-width",
1698
+ "button-height",
1699
+ "pairs-on-phone",
1700
+ "hue",
1701
+ "hue-offset",
1702
+ "panel-id",
1703
+ "onSelect"
1704
+ ]))), 128))], 46, _r));
1705
+ }
1706
+ }), yr = [
1707
+ "href",
1708
+ "aria-current",
1709
+ "aria-describedby"
1710
+ ], br = { class: "glim-sr-only" }, xr = /* @__PURE__ */ D({
1711
+ inheritAttrs: !1,
1712
+ __name: "SidebarRow",
1713
+ props: {
1714
+ label: {},
1715
+ glyph: {},
1716
+ href: {},
1717
+ active: {
1718
+ type: Boolean,
1719
+ default: !1
1720
+ },
1721
+ hueIndex: {},
1722
+ count: {}
1723
+ },
1724
+ setup(n) {
1725
+ let r = n, i = X("sidebar"), a = y(() => mt({
1726
+ mode: i.value,
1727
+ label: r.label,
1728
+ hasGlyph: !!r.glyph,
1729
+ active: r.active,
1730
+ hueIndex: r.hueIndex,
1731
+ count: r.count?.value
1732
+ })), o = t(() => a.value.tip);
1733
+ function s(e) {
1734
+ o.trigger.value = e;
1735
+ }
1736
+ return (t, r) => (P(), S(_, null, [C("a", k(t.$attrs, {
1737
+ ref: s,
1738
+ href: n.href,
1739
+ "aria-current": n.active ? "page" : void 0,
1740
+ "aria-describedby": V(o).describedBy.value,
1741
+ class: a.value.className,
1742
+ style: a.value.style,
1743
+ onMouseenter: r[0] ||= (...e) => V(o).show && V(o).show(...e),
1744
+ onMouseleave: r[1] ||= (...e) => V(o).hide && V(o).hide(...e),
1745
+ onFocus: r[2] ||= (...e) => V(o).showOnFocus && V(o).showOnFocus(...e),
1746
+ onBlur: r[3] ||= (...e) => V(o).hide && V(o).hide(...e)
1747
+ }), [
1748
+ a.value.showGlyph && n.glyph ? (P(), b(R(n.glyph), { key: 0 })) : x("", !0),
1749
+ C("span", { class: A(a.value.labelClass) }, B(n.label), 3),
1750
+ a.value.countClass && n.count ? (P(), S(_, { key: 1 }, [C("span", {
1751
+ class: A(a.value.countClass),
1752
+ "aria-hidden": "true"
1753
+ }, B(n.count.value), 3), C("span", br, B(n.count.label), 1)], 64)) : x("", !0)
1754
+ ], 16, yr), E(e, { state: V(o) }, null, 8, ["state"])], 64));
1755
+ }
1756
+ }), Sr = ["aria-labelledby"], Cr = { class: "glim-subcard-title" }, wr = ["id"], Tr = /* @__PURE__ */ D({
1757
+ __name: "SubCard",
1758
+ props: {
1759
+ title: {},
1760
+ hint: {}
1761
+ },
1762
+ setup(e) {
1763
+ let t = ie();
1764
+ return (n, r) => (P(), S("section", {
1765
+ class: "glim-subcard",
1766
+ "aria-labelledby": V(t)
1767
+ }, [C("h3", Cr, [C("span", { id: V(t) }, B(e.title), 9, wr), e.hint ? (P(), b(Q, {
1768
+ key: 0,
1769
+ tip: e.hint
1770
+ }, null, 8, ["tip"])) : x("", !0)]), L(n.$slots, "default")], 8, Sr));
1771
+ }
1772
+ }), Er = { class: "glim-toast-stack" }, Dr = [
1773
+ "role",
1774
+ "onMouseenter",
1775
+ "onMouseleave",
1776
+ "onFocusin",
1777
+ "onFocusout",
1778
+ "onKeydown"
1779
+ ], Or = { class: "glim-toast-message" }, kr = ["aria-label", "onClick"], Ar = /* @__PURE__ */ D({
1780
+ __name: "ToastViewport",
1781
+ props: {
1782
+ toasts: {},
1783
+ dismissLabel: {}
1784
+ },
1785
+ emits: [
1786
+ "dismiss",
1787
+ "enter",
1788
+ "leave",
1789
+ "focusin",
1790
+ "focusout"
1791
+ ],
1792
+ setup(e, { emit: t }) {
1793
+ let n = t, r = (e) => e === "success" ? "status" : "alert";
1794
+ return (t, i) => (P(), S("div", Er, [(P(!0), S(_, null, I(e.toasts, (t) => (P(), S("div", {
1795
+ key: t.id,
1796
+ role: r(t.severity),
1797
+ class: "glim-toast glim-toast-card",
1798
+ onMouseenter: (e) => n("enter", t.id),
1799
+ onMouseleave: (e) => n("leave", t.id),
1800
+ onFocusin: (e) => n("focusin", t.id),
1801
+ onFocusout: (e) => n("focusout", t.id),
1802
+ onKeydown: ce(G((e) => n("dismiss", t.id), ["stop"]), ["esc"])
1803
+ }, [
1804
+ E(V(o), {
1805
+ mark: V(_e)[t.severity],
1806
+ class: A(`glim-toast-glyph glim-toast-glyph--${t.severity}`)
1807
+ }, null, 8, ["mark", "class"]),
1808
+ C("p", Or, B(t.message), 1),
1809
+ C("button", {
1810
+ type: "button",
1811
+ "aria-label": e.dismissLabel,
1812
+ class: "glim-btn-bare glim-toast-dismiss",
1813
+ onClick: (e) => n("dismiss", t.id)
1814
+ }, [E(V(o), { mark: V(ge).dismiss }, null, 8, ["mark"])], 8, kr)
1815
+ ], 40, Dr))), 128))]));
1816
+ }
1817
+ }), jr = { class: "glim-toggle" }, Mr = {
1818
+ key: 0,
1819
+ class: "glim-toggle-label"
1820
+ }, Nr = [
1821
+ "aria-checked",
1822
+ "aria-label",
1823
+ "disabled"
1824
+ ], Pr = /* @__PURE__ */ D({
1825
+ __name: "Toggle",
1826
+ props: /*@__PURE__*/ O({
1827
+ label: {},
1828
+ hideLabel: {
1829
+ type: Boolean,
1830
+ default: !1
1831
+ },
1832
+ disabled: {
1833
+ type: Boolean,
1834
+ default: !1
1835
+ }
1836
+ }, {
1837
+ modelValue: {
1838
+ type: Boolean,
1839
+ required: !0
1840
+ },
1841
+ modelModifiers: {}
1842
+ }),
1843
+ emits: ["update:modelValue"],
1844
+ setup(e) {
1845
+ let t = H(e, "modelValue");
1846
+ return (n, r) => (P(), S("span", jr, [e.hideLabel ? x("", !0) : (P(), S("span", Mr, B(e.label), 1)), C("button", {
1847
+ type: "button",
1848
+ role: "switch",
1849
+ "aria-checked": t.value,
1850
+ "aria-label": e.label,
1851
+ disabled: e.disabled,
1852
+ class: "glim-toggle-track",
1853
+ onClick: r[0] ||= (e) => t.value = !t.value
1854
+ }, [...r[1] ||= [C("span", { class: "glim-toggle-thumb" }, null, -1)]], 8, Nr)]));
1855
+ }
1856
+ }), Fr = { class: "glim-notice" }, Ir = { class: "glim-notice-title" }, Lr = { class: "glim-notice-reason" }, Rr = {
1857
+ key: 0,
1858
+ class: "glim-notice-action"
1859
+ }, zr = /* @__PURE__ */ D({
1860
+ __name: "UnavailableNotice",
1861
+ props: { title: {} },
1862
+ setup(e) {
1863
+ return (t, n) => (P(), S("div", Fr, [
1864
+ C("p", Ir, B(e.title), 1),
1865
+ C("p", Lr, [L(t.$slots, "default")]),
1866
+ t.$slots.action ? (P(), S("div", Rr, [L(t.$slots, "action")])) : x("", !0)
1867
+ ]));
1868
+ }
1869
+ }), Br = ["aria-labelledby"], Vr = ["id"], Hr = { class: "glim-modal-body glim-window-body" }, Ur = {
1870
+ key: 0,
1871
+ class: "glim-modal-foot"
1872
+ }, Wr = {
1873
+ key: 0,
1874
+ class: "glim-window-start"
1875
+ }, Gr = /* @__PURE__ */ D({
1876
+ inheritAttrs: !1,
1877
+ __name: "Window",
1878
+ props: {
1879
+ title: {},
1880
+ actions: { default: () => [] },
1881
+ start: {},
1882
+ size: { default: "normal" },
1883
+ text: {}
1884
+ },
1885
+ emits: ["close"],
1886
+ setup(e, { emit: t }) {
1887
+ let n = e, r = t, i = ae(), a = z(null), o = ie(), s = Pe(), c = y(() => n.start !== void 0 || !!i.start), l = y(() => kt(n.actions, c.value, {
1888
+ cancel: {
1889
+ label: n.text.cancel,
1890
+ labelKey: "common.cancel",
1891
+ glyph: h,
1892
+ wayOut: !0
1893
+ },
1894
+ close: {
1895
+ label: n.text.close,
1896
+ labelKey: "common.close",
1897
+ glyph: p,
1898
+ wayOut: !0
1899
+ }
1900
+ })), u;
1901
+ M(() => {
1902
+ u = ht(() => a.value, () => r("close")), a.value && Ot(a.value)?.focus();
1903
+ }), ne(() => {
1904
+ u?.(), rt(s);
1905
+ });
1906
+ function d(e) {
1907
+ e.onClick?.() !== !1 && r("close");
1908
+ }
1909
+ function f() {
1910
+ Ve() || r("close");
1911
+ }
1912
+ return (t, n) => (P(), b(v, { to: "body" }, [C("div", {
1913
+ class: "glim-modal-backdrop",
1914
+ onMousedown: G(f, ["self"])
1915
+ }, [C("div", k(t.$attrs, {
1916
+ ref_key: "card",
1917
+ ref: a,
1918
+ role: "dialog",
1919
+ "aria-modal": "true",
1920
+ "aria-labelledby": V(o),
1921
+ class: [
1922
+ "glim-modal-card",
1923
+ "glim-window",
1924
+ e.size !== "normal" && `glim-window--${e.size}`
1925
+ ]
1926
+ }), [
1927
+ C("h2", {
1928
+ id: V(o),
1929
+ class: "glim-window-title"
1930
+ }, [E(Y, {
1931
+ tone: "heading",
1932
+ size: "heading",
1933
+ wrap: "",
1934
+ "inset-start": 5
1935
+ }, {
1936
+ default: W(() => [T(B(e.title), 1)]),
1937
+ _: 1
1938
+ })], 8, Vr),
1939
+ C("div", Hr, [L(t.$slots, "default")]),
1940
+ l.value.length ? (P(), S("div", Ur, [c.value ? (P(), S("span", Wr, [L(t.$slots, "start", {}, () => [T(B(e.start), 1)])])) : x("", !0), (P(!0), S(_, null, I(l.value, (e, t) => (P(), b(Z, {
1941
+ key: t,
1942
+ label: e.label,
1943
+ "label-key": e.labelKey,
1944
+ glyph: e.glyph,
1945
+ tone: e.primary ? "accent" : "neutral",
1946
+ disabled: e.disabled,
1947
+ onClick: (t) => d(e)
1948
+ }, null, 8, [
1949
+ "label",
1950
+ "label-key",
1951
+ "glyph",
1952
+ "tone",
1953
+ "disabled",
1954
+ "onClick"
1955
+ ]))), 128))])) : x("", !0)
1956
+ ], 16, Br)], 32)]));
1957
+ }
1958
+ });
1959
+ // src/confirm.ts
1960
+ function Kr(e) {
1961
+ let t = z(null), n = z(null), r = null, i = null;
1962
+ function a(e, n) {
1963
+ return i = Pe(), new Promise((i) => {
1964
+ r = i, t.value = {
1965
+ message: e,
1966
+ ...n
1967
+ };
1968
+ });
1969
+ }
1970
+ function o(e) {
1971
+ r?.(e), r = null, t.value = null, rt(i), i = null;
1972
+ }
1973
+ let s = () => o(!1);
1974
+ return U(t, (e, t, r) => {
1975
+ e && r(Ct(() => n.value, s));
1976
+ }), {
1977
+ confirm: a,
1978
+ dismiss: s,
1979
+ ConfirmHost: D(() => () => {
1980
+ let r = t.value;
1981
+ return r ? ee(v, { to: "body" }, [ee(cn, {
1982
+ ref: (e) => n.value = e?.card ?? null,
1983
+ title: e.title,
1984
+ message: r.message,
1985
+ confirmLabel: r.confirmLabel ?? e.confirm,
1986
+ confirmLabelKey: r.confirmLabelKey,
1987
+ confirmGlyph: r.confirmGlyph,
1988
+ cancelLabel: e.cancel,
1989
+ onConfirm: () => o(!0),
1990
+ onCancel: () => o(!1)
1991
+ }, r.extra ? { extra: () => ee(r.extra) } : void 0)]) : null;
1992
+ })
1993
+ };
1994
+ }
1995
+ export { Y as Badge, Nt as BrandMark, Z as Button, Gt as Card, Yt as Checkbox, en as ColorPicker, cn as ConfirmDialog, Cn as ContextMenu, Dn as CopyField, jn as EmptyState, he as GLIMSTONE_VERSION, h as IconCancel, u as IconCheck, p as IconClose, s as IconCopy, r as IconExpand, d as IconEye, m as IconEyeOff, i as IconPencil, J as IconTipButton, c as IconWindowMaximise, g as IconWindowMinimise, a as IconWindowRestore, Vn as InfoAboutCard, Q as InfoBubble, Wn as InfoHelpCard, er as InfoTile, $n as InfoVersionCard, un as Kbd, o as MarkSvg, rr as MenuBar, ar as Meter, sr as NumberField, lr as PasswordField, ur as Pill, fr as ProgressBar, $ as ReadmeButton, vr as Selector, xr as SidebarRow, Tr as SubCard, Ar as ToastViewport, Pr as Toggle, zr as UnavailableNotice, Gr as Window, f as glyphFor, ut as selectorTabId, l as setGlyphResolver, zt as useAccent, Kr as useConfirm, Ft as useHue, X as useLabelMode, Rt as useMotion, Pt as useRainbow, Lt as useShape, t as useTipBubble };