@glimstone/vue 0.0.0-stage → 4.0.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 (50) 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/Combobox.js +70 -0
  7. package/dist/Combobox.vue.d.ts +27 -0
  8. package/dist/ConfirmDialog.vue.d.ts +37 -0
  9. package/dist/EmptyState.vue.d.ts +28 -0
  10. package/dist/IconTipButton.vue.d.ts +24 -0
  11. package/dist/InfoAboutCard.vue.d.ts +4 -0
  12. package/dist/InfoBubble.vue.d.ts +9 -0
  13. package/dist/InfoHelpCard.vue.d.ts +6 -0
  14. package/dist/InfoTile.vue.d.ts +22 -0
  15. package/dist/InfoVersionCard.vue.d.ts +15 -0
  16. package/dist/ListSelect.vue.d.ts +37 -0
  17. package/dist/MenuChoice.vue.d.ts +27 -0
  18. package/dist/MenuSelect.vue.d.ts +37 -0
  19. package/dist/MenuSubmenu.vue.d.ts +31 -0
  20. package/dist/NumberField.vue.d.ts +10 -0
  21. package/dist/ReadmeButton.vue.d.ts +33 -0
  22. package/dist/Select.js +444 -0
  23. package/dist/Select.vue.d.ts +50 -0
  24. package/dist/SelectFace.vue.d.ts +26 -0
  25. package/dist/Selector.vue.d.ts +55 -0
  26. package/dist/SelectorSegment.vue.d.ts +28 -0
  27. package/dist/SidebarRow.vue.d.ts +22 -0
  28. package/dist/Slider.js +36 -0
  29. package/dist/Slider.vue.d.ts +23 -0
  30. package/dist/SubCard.vue.d.ts +21 -0
  31. package/dist/TipBubble.vue.d.ts +7 -0
  32. package/dist/TipWrap-rNAEgvb0.js +51 -0
  33. package/dist/TipWrap.d.ts +11 -0
  34. package/dist/ToastViewport.vue.d.ts +25 -0
  35. package/dist/Toggle.vue.d.ts +21 -0
  36. package/dist/UnavailableNotice.vue.d.ts +20 -0
  37. package/dist/confirm.d.ts +20 -0
  38. package/dist/engines.d.ts +12 -0
  39. package/dist/entries/combobox.d.ts +1 -0
  40. package/dist/entries/select.d.ts +1 -0
  41. package/dist/entries/slider.d.ts +1 -0
  42. package/dist/glyphs-CvCRgBMU.js +27 -0
  43. package/dist/glyphs.d.ts +21 -0
  44. package/dist/index.d.ts +29 -0
  45. package/dist/index.js +1301 -0
  46. package/dist/info.d.ts +71 -0
  47. package/dist/selectParts.d.ts +25 -0
  48. package/dist/selectorItem.d.ts +19 -0
  49. package/dist/tipBubble.d.ts +16 -0
  50. package/package.json +47 -4
package/dist/Select.js ADDED
@@ -0,0 +1,444 @@
1
+ import { i as e, n as t } from "./glyphs-CvCRgBMU.js";
2
+ import { n, r, t as i } from "./TipWrap-rNAEgvb0.js";
3
+ import { Fragment as a, Teleport as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeClass as _, normalizeProps as v, onMounted as y, onScopeDispose as b, openBlock as x, renderList as S, resolveDynamicComponent as C, shallowRef as w, toDisplayString as T, unref as E, useId as D, useModel as O, watch as k, withCtx as A } from "vue";
4
+ import { SELECT_POSITIONING as j, closeOnPageMove as M, defaultWidth as N, enableWheelStep as P, faceLabels as F, flattenRuns as I, hasSubmenu as L, homeRow as R, isSubmenu as z, pageDir as B, readPortalHue as V, selectContentClass as H, selectRootClass as U, selectTriggerClass as W, shake as G, wheelValue as K } from "@glimstone/core";
5
+ import * as q from "@zag-js/select";
6
+ import { normalizeProps as J, useMachine as Y } from "@zag-js/vue";
7
+ import * as X from "@zag-js/menu";
8
+ // src/SelectFace.vue?vue&type=script&setup=true&lang.ts
9
+ var ee = {
10
+ key: 0,
11
+ class: "glim-select-glyph"
12
+ }, te = { class: "glim-select-value" }, ne = ["aria-hidden"], Z = /* @__PURE__ */ p({
13
+ __name: "SelectFace",
14
+ props: {
15
+ all: {},
16
+ value: {},
17
+ placeholder: {},
18
+ width: {},
19
+ glyphs: { type: Boolean }
20
+ },
21
+ setup(e) {
22
+ let t = e, n = s(() => F(t.all, t.value, t.placeholder, t.width)), r = s(() => t.all.find((e) => e.value === t.value)?.glyph);
23
+ return (t, i) => (x(), u(a, null, [e.glyphs ? (x(), u("span", ee, [r.value ? (x(), c(C(r.value), { key: 0 })) : l("", !0)])) : l("", !0), d("span", te, [(x(!0), u(a, null, S(n.value.labels, (e) => (x(), u("span", {
24
+ key: e,
25
+ "aria-hidden": e !== n.value.text || void 0,
26
+ class: _(e === n.value.text ? void 0 : "glim-select-ghost")
27
+ }, T(e), 11, ne))), 128))])], 64));
28
+ }
29
+ });
30
+ // src/selectParts.ts
31
+ function Q(e, t) {
32
+ let n = w(null);
33
+ return k(e, (e) => n.value = e && t.value ? V(t.value) : null, { flush: "sync" }), {
34
+ style: s(() => n.value ?? void 0),
35
+ className: s(() => n.value ? "glim-hue" : "")
36
+ };
37
+ }
38
+ function $(e, t) {
39
+ let n;
40
+ k(e, (e) => {
41
+ n?.(), n = e ? P(e, (e) => {
42
+ if (t.inert()) return;
43
+ let n = K(t.all(), t.value(), e);
44
+ n !== void 0 && t.onChange(n);
45
+ }) : void 0;
46
+ }, { immediate: !0 }), k(t.shakeCount, (t, n, r) => {
47
+ e.value && t > 0 && r(G(e.value));
48
+ }), b(() => n?.());
49
+ }
50
+ // src/ListSelect.vue?vue&type=script&setup=true&lang.ts
51
+ var re = ["aria-busy", "aria-describedby"], ie = {
52
+ key: 0,
53
+ class: "glim-select-glyph"
54
+ }, ae = /* @__PURE__ */ p({
55
+ __name: "ListSelect",
56
+ props: {
57
+ label: {},
58
+ hideLabel: { type: Boolean },
59
+ groups: {},
60
+ value: {},
61
+ placeholder: {},
62
+ width: {},
63
+ triggerClass: {},
64
+ id: {},
65
+ disabled: { type: Boolean },
66
+ busy: { type: Boolean },
67
+ tip: {},
68
+ shake: {}
69
+ },
70
+ emits: ["change"],
71
+ setup(p, { expose: h, emit: _ }) {
72
+ let y = p, b = _, O = D(), N = s(() => I(y.groups)), P = s(() => N.value.some((e) => e.glyph)), F = s(() => q.collection({
73
+ items: N.value,
74
+ itemToValue: (e) => e.value,
75
+ itemToString: (e) => e.label,
76
+ isItemDisabled: (e) => !!e.disabled
77
+ })), L = Y(q.machine, s(() => ({
78
+ id: O,
79
+ ids: y.id ? { trigger: y.id } : void 0,
80
+ dir: B(),
81
+ collection: F.value,
82
+ value: y.value === null ? [] : [y.value],
83
+ disabled: y.disabled,
84
+ readOnly: y.busy,
85
+ onValueChange: (e) => {
86
+ let t = e.value[0];
87
+ t !== void 0 && t !== y.value && b("change", t);
88
+ },
89
+ positioning: j
90
+ }))), R = s(() => q.connect(L, J)), z = w(null), V = r(() => y.tip, () => !!y.disabled);
91
+ $(z, {
92
+ all: () => N.value,
93
+ value: () => y.value,
94
+ inert: () => !!(y.disabled || y.busy),
95
+ onChange: (e) => b("change", e),
96
+ shakeCount: () => y.shake ?? 0
97
+ }), k(() => R.value.open, (e, t, n) => {
98
+ e && n(M(() => R.value.setOpen(!1)));
99
+ });
100
+ let W = Q(() => R.value.open, z);
101
+ function G(e) {
102
+ z.value = e, V.trigger.value = z.value;
103
+ }
104
+ return h({ trigger: z }), (r, s) => (x(), u("div", g(R.value.getRootProps(), { class: E(U)(p.width) }), [
105
+ d("label", g(R.value.getLabelProps(), { class: p.hideLabel ? "glim-sr-only" : "glim-field-label" }), T(p.label), 17),
106
+ d("div", v(m(R.value.getControlProps())), [f(E(i), {
107
+ on: !!p.disabled && !!p.tip,
108
+ show: E(V).show,
109
+ hide: E(V).hide
110
+ }, {
111
+ default: A(() => [d("button", g(R.value.getTriggerProps(), {
112
+ ref: G,
113
+ "aria-busy": p.busy || void 0,
114
+ "aria-describedby": E(V).describedBy.value,
115
+ class: p.triggerClass,
116
+ onMouseenter: s[0] ||= (...e) => E(V).show && E(V).show(...e),
117
+ onMouseleave: s[1] ||= (...e) => E(V).hide && E(V).hide(...e),
118
+ onFocus: s[2] ||= (...e) => E(V).showOnFocus && E(V).showOnFocus(...e),
119
+ onBlur: s[3] ||= (...e) => E(V).hide && E(V).hide(...e)
120
+ }), [f(Z, {
121
+ all: N.value,
122
+ value: p.value,
123
+ placeholder: p.placeholder,
124
+ width: p.width,
125
+ glyphs: P.value
126
+ }, null, 8, [
127
+ "all",
128
+ "value",
129
+ "placeholder",
130
+ "width",
131
+ "glyphs"
132
+ ]), d("span", g(R.value.getIndicatorProps(), { class: "glim-select-indicator" }), [f(E(e))], 16)], 16, re)]),
133
+ _: 1
134
+ }, 8, [
135
+ "on",
136
+ "show",
137
+ "hide"
138
+ ])], 16),
139
+ f(n, { state: E(V) }, null, 8, ["state"]),
140
+ (x(), c(o, { to: "body" }, [d("div", g(R.value.getPositionerProps(), {
141
+ style: E(W).style.value,
142
+ class: ["glim-select-positioner", E(W).className.value]
143
+ }), [d("div", g(R.value.getContentProps(), { class: E(H)(P.value) }), [(x(!0), u(a, null, S(p.groups, (e, n) => (x(), u(a, { key: n }, [e.entries.length > 0 ? (x(), u("div", g({
144
+ key: 0,
145
+ ref_for: !0
146
+ }, e.heading ? R.value.getItemGroupProps({ id: `${E(O)}-g${n}` }) : {}, { class: "glim-select-group" }), [e.heading ? (x(), u("div", g({
147
+ key: 0,
148
+ ref_for: !0
149
+ }, R.value.getItemGroupLabelProps({ htmlFor: `${E(O)}-g${n}` }), { class: "glim-select-heading" }), T(e.heading), 17)) : l("", !0), (x(!0), u(a, null, S(e.entries, (e) => (x(), u("div", g({ key: e.value }, { ref_for: !0 }, R.value.getItemProps({ item: e }), { class: "glim-select-item" }), [
150
+ P.value ? (x(), u("span", ie, [e.glyph ? (x(), c(C(e.glyph), { key: 0 })) : l("", !0)])) : l("", !0),
151
+ d("span", g({ ref_for: !0 }, R.value.getItemTextProps({ item: e }), { class: "glim-select-label" }), T(e.label), 17),
152
+ d("span", g({ ref_for: !0 }, R.value.getItemIndicatorProps({ item: e }), { class: "glim-select-check" }), [f(E(t))], 16)
153
+ ], 16))), 128))], 16)) : l("", !0)], 64))), 128))], 16)], 16)])),
154
+ d("select", v(m(R.value.getHiddenSelectProps())), null, 16)
155
+ ], 16));
156
+ }
157
+ }), oe = {
158
+ key: 0,
159
+ class: "glim-select-glyph"
160
+ }, se = ["data-state"], ce = /* @__PURE__ */ p({
161
+ __name: "MenuChoice",
162
+ props: {
163
+ api: {},
164
+ option: {},
165
+ value: {},
166
+ glyphs: { type: Boolean }
167
+ },
168
+ emits: ["change"],
169
+ setup(e, { emit: n }) {
170
+ let r = e, i = n, a = s(() => r.option.value === r.value), o = s(() => ({
171
+ type: "radio",
172
+ value: r.option.value,
173
+ valueText: r.option.label,
174
+ checked: a.value,
175
+ disabled: r.option.disabled,
176
+ onCheckedChange: () => {
177
+ a.value || i("change", r.option.value);
178
+ }
179
+ }));
180
+ return (n, r) => (x(), u("div", g(e.api.getOptionItemProps(o.value), { class: "glim-select-item" }), [
181
+ e.glyphs ? (x(), u("span", oe, [e.option.glyph ? (x(), c(C(e.option.glyph), { key: 0 })) : l("", !0)])) : l("", !0),
182
+ d("span", g(e.api.getItemTextProps(o.value), { class: "glim-select-label" }), T(e.option.label), 17),
183
+ d("span", {
184
+ "aria-hidden": "true",
185
+ "data-state": a.value ? "checked" : "unchecked",
186
+ class: "glim-select-check"
187
+ }, [f(E(t))], 8, se)
188
+ ], 16));
189
+ }
190
+ }), le = {
191
+ key: 0,
192
+ class: "glim-select-glyph"
193
+ }, ue = { class: "glim-select-label" }, de = {
194
+ "aria-hidden": "true",
195
+ class: "glim-select-caret"
196
+ }, fe = /* @__PURE__ */ p({
197
+ __name: "MenuSubmenu",
198
+ props: {
199
+ parent: {},
200
+ parentApi: {},
201
+ triggerId: {},
202
+ entry: {},
203
+ value: {},
204
+ glyphs: { type: Boolean },
205
+ hueStyle: {},
206
+ hueClass: {}
207
+ },
208
+ emits: ["change"],
209
+ setup(t, { emit: n }) {
210
+ let r = t, i = n, p = Y(X.machine, {
211
+ id: D(),
212
+ ids: { trigger: r.triggerId },
213
+ dir: B(),
214
+ "aria-label": r.entry.label
215
+ }), m = s(() => X.connect(p, J));
216
+ return y(() => {
217
+ r.parentApi.setChild(p), m.value.setParent(r.parent);
218
+ }), (n, r) => (x(), u(a, null, [d("div", g(t.parentApi.getTriggerItemProps(m.value), { class: "glim-select-item" }), [
219
+ t.glyphs ? (x(), u("span", le, [t.entry.glyph ? (x(), c(C(t.entry.glyph), { key: 0 })) : l("", !0)])) : l("", !0),
220
+ d("span", ue, T(t.entry.label), 1),
221
+ d("span", de, [f(E(e))])
222
+ ], 16), (x(), c(o, { to: "body" }, [d("div", g(m.value.getPositionerProps(), {
223
+ style: t.hueStyle,
224
+ class: ["glim-select-positioner", t.hueClass]
225
+ }), [d("div", g(m.value.getContentProps(), { class: E(H)(t.glyphs) }), [(x(!0), u(a, null, S(t.entry.options, (e) => (x(), c(ce, {
226
+ key: e.value,
227
+ api: m.value,
228
+ option: e,
229
+ value: t.value,
230
+ glyphs: t.glyphs,
231
+ onChange: r[0] ||= (e) => i("change", e)
232
+ }, null, 8, [
233
+ "api",
234
+ "option",
235
+ "value",
236
+ "glyphs"
237
+ ]))), 128))], 16)], 16)]))], 64));
238
+ }
239
+ }), pe = {
240
+ key: 0,
241
+ "aria-hidden": "true",
242
+ class: "glim-field-label"
243
+ }, me = [
244
+ "disabled",
245
+ "data-disabled",
246
+ "data-readonly",
247
+ "aria-busy",
248
+ "aria-label",
249
+ "aria-describedby"
250
+ ], he = /* @__PURE__ */ p({
251
+ __name: "MenuSelect",
252
+ props: {
253
+ label: {},
254
+ hideLabel: { type: Boolean },
255
+ groups: {},
256
+ value: {},
257
+ placeholder: {},
258
+ width: {},
259
+ triggerClass: {},
260
+ id: {},
261
+ disabled: { type: Boolean },
262
+ busy: { type: Boolean },
263
+ tip: {},
264
+ shake: {}
265
+ },
266
+ emits: ["change"],
267
+ setup(t, { expose: p, emit: m }) {
268
+ let h = t, v = m, y = D(), b = Y(X.machine, s(() => ({
269
+ id: y,
270
+ ids: h.id ? { trigger: h.id } : void 0,
271
+ dir: B(),
272
+ "aria-label": h.label,
273
+ positioning: j
274
+ }))), C = s(() => X.connect(b, J)), O = s(() => I(h.groups)), N = s(() => O.value.some((e) => e.glyph)), P = s(() => F(O.value, h.value, h.placeholder, h.width).text), L = (e, t) => `${y}-sub-${e}-${t}`, V = w(null), W = r(() => h.tip, () => !!h.disabled);
275
+ $(V, {
276
+ all: () => O.value,
277
+ value: () => h.value,
278
+ inert: () => !!(h.disabled || h.busy),
279
+ onChange: (e) => v("change", e),
280
+ shakeCount: () => h.shake ?? 0
281
+ });
282
+ let G = Q(() => C.value.open, V);
283
+ k(() => C.value.open, (e, t, n) => {
284
+ if (!e) return;
285
+ n(M(() => C.value.setOpen(!1)));
286
+ let r = R(h.groups, h.value, L);
287
+ if (r === null) return;
288
+ let i = 0, a = requestAnimationFrame(() => {
289
+ i = requestAnimationFrame(() => C.value.setHighlightedValue(r));
290
+ });
291
+ n(() => {
292
+ cancelAnimationFrame(a), cancelAnimationFrame(i);
293
+ });
294
+ });
295
+ let K = s(() => {
296
+ let e = C.value.getTriggerProps(), t = (t) => (n) => {
297
+ h.busy ? n.preventDefault() : e[t]?.(n);
298
+ };
299
+ return {
300
+ ...e,
301
+ onPointerdown: t("onPointerdown"),
302
+ onClick: t("onClick"),
303
+ onKeydown: t("onKeydown")
304
+ };
305
+ });
306
+ function q(e) {
307
+ V.value = e, W.trigger.value = V.value;
308
+ }
309
+ return p({ trigger: V }), (r, s) => (x(), u("div", { class: _(E(U)(t.width)) }, [
310
+ t.hideLabel ? l("", !0) : (x(), u("span", pe, T(t.label), 1)),
311
+ d("div", null, [f(E(i), {
312
+ on: !!t.disabled && !!t.tip,
313
+ show: E(W).show,
314
+ hide: E(W).hide
315
+ }, {
316
+ default: A(() => [d("button", g(K.value, {
317
+ ref: q,
318
+ disabled: t.disabled,
319
+ "data-disabled": t.disabled ? "" : void 0,
320
+ "data-readonly": t.busy ? "" : void 0,
321
+ "aria-busy": t.busy || void 0,
322
+ "aria-label": `${t.label}: ${P.value}`,
323
+ "aria-describedby": E(W).describedBy.value,
324
+ class: t.triggerClass,
325
+ onMouseenter: s[0] ||= (...e) => E(W).show && E(W).show(...e),
326
+ onMouseleave: s[1] ||= (...e) => E(W).hide && E(W).hide(...e),
327
+ onFocus: s[2] ||= (...e) => E(W).showOnFocus && E(W).showOnFocus(...e),
328
+ onBlur: s[3] ||= (...e) => E(W).hide && E(W).hide(...e)
329
+ }), [f(Z, {
330
+ all: O.value,
331
+ value: t.value,
332
+ placeholder: t.placeholder,
333
+ width: t.width,
334
+ glyphs: N.value
335
+ }, null, 8, [
336
+ "all",
337
+ "value",
338
+ "placeholder",
339
+ "width",
340
+ "glyphs"
341
+ ]), d("span", g(C.value.getIndicatorProps(), { class: "glim-select-indicator" }), [f(E(e))], 16)], 16, me)]),
342
+ _: 1
343
+ }, 8, [
344
+ "on",
345
+ "show",
346
+ "hide"
347
+ ])]),
348
+ f(n, { state: E(W) }, null, 8, ["state"]),
349
+ (x(), c(o, { to: "body" }, [d("div", g(C.value.getPositionerProps(), {
350
+ style: E(G).style.value,
351
+ class: ["glim-select-positioner", E(G).className.value]
352
+ }), [d("div", g(C.value.getContentProps(), { class: E(H)(N.value) }), [(x(!0), u(a, null, S(t.groups, (e, n) => (x(), u(a, { key: n }, [e.entries.length > 0 ? (x(), u("div", g({
353
+ key: 0,
354
+ ref_for: !0
355
+ }, e.heading ? C.value.getItemGroupProps({ id: `g${n}` }) : {}, { class: "glim-select-group" }), [e.heading ? (x(), u("div", g({
356
+ key: 0,
357
+ ref_for: !0
358
+ }, C.value.getItemGroupLabelProps({ htmlFor: `g${n}` }), { class: "glim-select-heading" }), T(e.heading), 17)) : l("", !0), (x(!0), u(a, null, S(e.entries, (e, r) => (x(), u(a, { key: E(z)(e) ? `s${r}` : e.value }, [E(z)(e) ? (x(), c(fe, {
359
+ key: 0,
360
+ parent: E(b),
361
+ "parent-api": C.value,
362
+ "trigger-id": L(n, r),
363
+ entry: e,
364
+ value: t.value,
365
+ glyphs: N.value,
366
+ "hue-style": E(G).style.value,
367
+ "hue-class": E(G).className.value,
368
+ onChange: s[4] ||= (e) => v("change", e)
369
+ }, null, 8, [
370
+ "parent",
371
+ "parent-api",
372
+ "trigger-id",
373
+ "entry",
374
+ "value",
375
+ "glyphs",
376
+ "hue-style",
377
+ "hue-class"
378
+ ])) : (x(), c(ce, {
379
+ key: 1,
380
+ api: C.value,
381
+ option: e,
382
+ value: t.value,
383
+ glyphs: N.value,
384
+ onChange: s[5] ||= (e) => v("change", e)
385
+ }, null, 8, [
386
+ "api",
387
+ "option",
388
+ "value",
389
+ "glyphs"
390
+ ]))], 64))), 128))], 16)) : l("", !0)], 64))), 128))], 16)], 16)]))
391
+ ], 2));
392
+ }
393
+ }), ge = /* @__PURE__ */ p({
394
+ __name: "Select",
395
+ props: /*@__PURE__*/ h({
396
+ label: {},
397
+ hideLabel: {
398
+ type: Boolean,
399
+ default: !1
400
+ },
401
+ options: {},
402
+ groups: {},
403
+ placeholder: {},
404
+ width: {},
405
+ size: { default: "field" },
406
+ wrap: {
407
+ type: Boolean,
408
+ default: !1
409
+ },
410
+ id: {},
411
+ disabled: {
412
+ type: Boolean,
413
+ default: !1
414
+ },
415
+ busy: {
416
+ type: Boolean,
417
+ default: !1
418
+ },
419
+ tip: {},
420
+ shake: {}
421
+ }, {
422
+ modelValue: { required: !0 },
423
+ modelModifiers: {}
424
+ }),
425
+ emits: ["update:modelValue"],
426
+ setup(e) {
427
+ let t = e, n = O(e, "modelValue"), r = s(() => t.groups ?? [{ entries: t.options ?? [] }]), i = s(() => ({
428
+ label: t.label,
429
+ hideLabel: t.hideLabel,
430
+ groups: r.value,
431
+ value: n.value,
432
+ placeholder: t.placeholder,
433
+ width: t.width ?? N(t.size),
434
+ triggerClass: W(t.size, t.wrap),
435
+ id: t.id,
436
+ disabled: t.disabled,
437
+ busy: t.busy,
438
+ tip: t.tip,
439
+ shake: t.shake
440
+ }));
441
+ return (e, t) => E(L)(r.value) ? (x(), c(he, g({ key: 0 }, i.value, { onChange: t[0] ||= (e) => n.value = e }), null, 16)) : (x(), c(ae, g({ key: 1 }, i.value, { onChange: t[1] ||= (e) => n.value = e }), null, 16));
442
+ }
443
+ });
444
+ export { ge as Select };
@@ -0,0 +1,50 @@
1
+ import { type SelectSize, type SelectWidth } from "@glimstone/core";
2
+ import type { SelectGroup, SelectOption } from "./selectParts";
3
+ declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
5
+ /** The field's name, always the accessible name. */
6
+ label: string;
7
+ /** Draw the label off screen, for a settings row that names the field at its start. */
8
+ hideLabel?: boolean;
9
+ /** Every choice, in list order, for a list without groups. */
10
+ options?: SelectOption<T>[];
11
+ /** The list in runs, with headings and submenus. */
12
+ groups?: SelectGroup<T>[];
13
+ /** Shown while the value is null. */
14
+ placeholder?: string;
15
+ /** Defaults to `fill` for a field and to `steady` for the smaller sizes. */
16
+ width?: SelectWidth;
17
+ size?: SelectSize;
18
+ /** Lets a long value run onto a second line, for one whose end says as much as its start. */
19
+ wrap?: boolean;
20
+ /** The trigger's id, for a `<label for>` outside the select. */
21
+ id?: string;
22
+ disabled?: boolean;
23
+ /** A choice is out and its answer not back yet: the trigger keeps its focus but takes no input. */
24
+ busy?: boolean;
25
+ /** A hover bubble, for a trigger with no label beside it whose value does not say what it picks. */
26
+ tip?: string;
27
+ /** The caller's failure counter. Each bump shakes the trigger once, as the value snaps back. */
28
+ shake?: number;
29
+ } & {
30
+ /** Null when there is no one value, such as over a selection whose rows disagree. */
31
+ modelValue: T | null;
32
+ }) & {
33
+ "onUpdate:modelValue"?: ((value: T | null) => any) | undefined;
34
+ }> & (typeof globalThis extends {
35
+ __VLS_PROPS_FALLBACK: infer P;
36
+ } ? P : {});
37
+ expose: (exposed: {}) => void;
38
+ attrs: any;
39
+ slots: {};
40
+ emit: (event: "update:modelValue", value: T | null) => void;
41
+ }>) => import("vue").VNode & {
42
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
43
+ };
44
+ declare const _default: typeof __VLS_export;
45
+ export default _default;
46
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
47
+ [K in keyof T]: T[K];
48
+ } : {
49
+ [K in keyof T as K]: T[K];
50
+ }) & {};
@@ -0,0 +1,26 @@
1
+ import { type SelectWidth } from "@glimstone/core";
2
+ import type { SelectOption } from "./selectParts";
3
+ declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
5
+ all: SelectOption<T>[];
6
+ value: T | null;
7
+ placeholder?: string;
8
+ width: SelectWidth;
9
+ glyphs: boolean;
10
+ }> & (typeof globalThis extends {
11
+ __VLS_PROPS_FALLBACK: infer P;
12
+ } ? P : {});
13
+ expose: (exposed: {}) => void;
14
+ attrs: any;
15
+ slots: {};
16
+ emit: {};
17
+ }>) => import("vue").VNode & {
18
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
19
+ };
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
23
+ [K in keyof T]: T[K];
24
+ } : {
25
+ [K in keyof T as K]: T[K];
26
+ }) & {};
@@ -0,0 +1,55 @@
1
+ import { type SelectMode, type SelectorActivation, type SelectorOrientation, type SelectorSize, type SelectorVariant } from "@glimstone/core";
2
+ import type { SelectorItem } from "./selectorItem";
3
+ type __VLS_Props = {
4
+ items: SelectorItem[];
5
+ /** The accessible name of the strip, such as "Sort" or "Settings pages". */
6
+ label: string;
7
+ select?: SelectMode;
8
+ /** `vertical` is the column of tiles beside a settings area's pages. */
9
+ orientation?: SelectorOrientation;
10
+ size?: SelectorSize;
11
+ variant?: SelectorVariant;
12
+ /** "manual" moves the focus and chooses on Space, Enter or a click, for a strip that saves a setting. */
13
+ activation?: SelectorActivation;
14
+ /** Pin every segment to the widest one's measured width; the page-level picker. */
15
+ equalWidth?: boolean;
16
+ /** Hug the segments, for a strip that shares a toolbar row. */
17
+ inline?: boolean;
18
+ /** Keep every segment on one row, for page tabs. */
19
+ fit?: boolean;
20
+ /** Below 600px, two segments to a row with labels that wrap. */
21
+ pairsOnPhone?: boolean;
22
+ /** The button height for every segment, for a strip beside a Button. */
23
+ buttonHeight?: boolean;
24
+ /** Take a colour under rainbow. */
25
+ hue?: boolean;
26
+ /** Makes the strip a tab strip for colour, each segment keeping its own position from here. */
27
+ hueOffset?: number;
28
+ disabled?: boolean;
29
+ /** The id of the panel a tab strip switches. */
30
+ panelId?: string;
31
+ };
32
+ type __VLS_ModelProps = {
33
+ modelValue: string | null | string[];
34
+ };
35
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
36
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ "update:modelValue": (value: string | string[] | null) => any;
38
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
39
+ "onUpdate:modelValue"?: ((value: string | string[] | null) => any) | undefined;
40
+ }>, {
41
+ disabled: boolean;
42
+ select: SelectMode;
43
+ size: SelectorSize;
44
+ variant: SelectorVariant;
45
+ inline: boolean;
46
+ orientation: SelectorOrientation;
47
+ equalWidth: boolean;
48
+ buttonHeight: boolean;
49
+ pairsOnPhone: boolean;
50
+ hue: boolean;
51
+ activation: SelectorActivation;
52
+ fit: boolean;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
+ declare const _default: typeof __VLS_export;
55
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { type SelectorOrientation, type SelectorSize, type SelectorVariant, type SelectorView } from "@glimstone/core";
2
+ import type { SelectorItem } from "./selectorItem";
3
+ type __VLS_Props = {
4
+ item: SelectorItem;
5
+ index: number;
6
+ strip: SelectorView;
7
+ on: boolean;
8
+ disabled: boolean;
9
+ roved: boolean;
10
+ share: Record<string, string>;
11
+ squeezed: boolean;
12
+ orientation: SelectorOrientation;
13
+ size: SelectorSize;
14
+ variant: SelectorVariant;
15
+ equalWidth: boolean;
16
+ buttonHeight: boolean;
17
+ pairsOnPhone: boolean;
18
+ hue: boolean;
19
+ hueOffset?: number;
20
+ panelId?: string;
21
+ };
22
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ select: () => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onSelect?: (() => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { type Component } from "vue";
2
+ type __VLS_Props = {
3
+ /** The destination's name: shown, or hidden but still the link's name. */
4
+ label: string;
5
+ /** Without one the row shows its name in every mode. */
6
+ glyph?: Component;
7
+ href: string;
8
+ /** This destination is showing; the row is filled and marked as the current page. */
9
+ active?: boolean;
10
+ /** The row's rank among the rows the rail shows. */
11
+ hueIndex?: number;
12
+ /** The figure on the row, with the figure in words as `label`. Nothing shows at zero. */
13
+ count?: {
14
+ value: number;
15
+ label: string;
16
+ };
17
+ };
18
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
19
+ active: boolean;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
package/dist/Slider.js ADDED
@@ -0,0 +1,36 @@
1
+ import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, mergeProps as o, openBlock as s, renderList as c, toDisplayString as l, useId as u, useModel as d } from "vue";
2
+ import { normalizeProps as f, useMachine as p } from "@zag-js/vue";
3
+ import * as m from "@zag-js/slider";
4
+ // src/Slider.vue?vue&type=script&setup=true&lang.ts
5
+ var h = { class: "glim-slider-head" }, g = /* @__PURE__ */ i({
6
+ __name: "Slider",
7
+ props: /*@__PURE__*/ a({
8
+ label: {},
9
+ min: {},
10
+ max: {},
11
+ step: { default: 1 },
12
+ format: {},
13
+ disabled: {
14
+ type: Boolean,
15
+ default: !1
16
+ }
17
+ }, {
18
+ modelValue: { required: !0 },
19
+ modelModifiers: {}
20
+ }),
21
+ emits: ["update:modelValue"],
22
+ setup(i) {
23
+ let a = i, g = d(i, "modelValue"), _ = u(), v = p(m.machine, t(() => ({
24
+ id: _,
25
+ value: [g.value],
26
+ min: a.min,
27
+ max: a.max,
28
+ step: a.step,
29
+ disabled: a.disabled,
30
+ onValueChange: (e) => g.value = e.value[0],
31
+ getAriaValueText: (e) => a.format(e.value)
32
+ }))), y = t(() => m.connect(v, f));
33
+ return (t, a) => (s(), n("div", o(y.value.getRootProps(), { class: "glim-slider" }), [r("div", h, [r("label", o(y.value.getLabelProps(), { class: "glim-field-label" }), l(i.label), 17), r("output", o(y.value.getValueTextProps(), { class: "glim-slider-value" }), l(i.format(y.value.value[0])), 17)]), r("div", o(y.value.getControlProps(), { class: "glim-slider-control" }), [r("div", o(y.value.getTrackProps(), { class: "glim-slider-track" }), [r("div", o(y.value.getRangeProps(), { class: "glim-slider-range" }), null, 16)], 16), (s(!0), n(e, null, c(y.value.value, (e, t) => (s(), n("div", o({ key: t }, { ref_for: !0 }, y.value.getThumbProps({ index: t }), { class: "glim-slider-thumb" }), [r("input", o({ ref_for: !0 }, y.value.getHiddenInputProps({ index: t })), null, 16)], 16))), 128))], 16)], 16));
34
+ }
35
+ });
36
+ export { g as Slider };