@glimstone/vue 4.4.0 → 4.5.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 (96) hide show
  1. package/dist/AboutCard.vue.d.ts +40 -0
  2. package/dist/Accordion.js +36 -0
  3. package/dist/Accordion.vue.d.ts +32 -0
  4. package/dist/AngleSlider.js +46 -0
  5. package/dist/AngleSlider.vue.d.ts +22 -0
  6. package/dist/Avatar.js +37 -0
  7. package/dist/Avatar.vue.d.ts +14 -0
  8. package/dist/Badge-BhK0gMse.js +81 -0
  9. package/dist/Badge.vue.d.ts +1 -1
  10. package/dist/Button-BM5Dzboj.js +203 -0
  11. package/dist/Carousel.js +80 -0
  12. package/dist/Carousel.vue.d.ts +36 -0
  13. package/dist/CoffeeDialog.vue.d.ts +21 -0
  14. package/dist/Collapsible.js +34 -0
  15. package/dist/Collapsible.vue.d.ts +30 -0
  16. package/dist/Combobox.js +3 -3
  17. package/dist/ContextMenu.vue.d.ts +3 -0
  18. package/dist/CryptoDonateDialog.vue.d.ts +48 -0
  19. package/dist/DatePicker.js +103 -0
  20. package/dist/DatePicker.vue.d.ts +24 -0
  21. package/dist/DropdownListbox.vue.d.ts +30 -0
  22. package/dist/FileUpload.js +67 -0
  23. package/dist/FileUpload.vue.d.ts +25 -0
  24. package/dist/FloatingPanel.js +85 -0
  25. package/dist/FloatingPanel.vue.d.ts +34 -0
  26. package/dist/Fortress.vue.d.ts +2 -2
  27. package/dist/HoverCard.js +42 -0
  28. package/dist/HoverCard.vue.d.ts +23 -0
  29. package/dist/IconButton-D5YOChZI.js +48 -0
  30. package/dist/IconTipButton-BLtrZfgN.js +56 -0
  31. package/dist/Marquee.js +49 -0
  32. package/dist/Marquee.vue.d.ts +32 -0
  33. package/dist/MenuBar.vue.d.ts +1 -3
  34. package/dist/Pagination.js +72 -0
  35. package/dist/Pagination.vue.d.ts +23 -0
  36. package/dist/PaypalDialog.vue.d.ts +63 -0
  37. package/dist/PinInput.js +61 -0
  38. package/dist/PinInput.vue.d.ts +34 -0
  39. package/dist/PresenceBadges.vue.d.ts +8 -0
  40. package/dist/ProgressBar.vue.d.ts +1 -1
  41. package/dist/Rating.js +56 -0
  42. package/dist/Rating.vue.d.ts +27 -0
  43. package/dist/ScrollArea.js +31 -0
  44. package/dist/ScrollArea.vue.d.ts +21 -0
  45. package/dist/Select-CBScnONy.js +458 -0
  46. package/dist/Select.js +1 -1
  47. package/dist/SignaturePad.js +63 -0
  48. package/dist/SignaturePad.vue.d.ts +19 -0
  49. package/dist/Splitter.js +46 -0
  50. package/dist/Splitter.vue.d.ts +31 -0
  51. package/dist/Steps.js +77 -0
  52. package/dist/Steps.vue.d.ts +34 -0
  53. package/dist/TagsInput.js +73 -0
  54. package/dist/TagsInput.vue.d.ts +25 -0
  55. package/dist/Timer.js +74 -0
  56. package/dist/Timer.vue.d.ts +22 -0
  57. package/dist/TipWrap-5Nw7Yj0O.js +51 -0
  58. package/dist/ToastCard.vue.d.ts +25 -0
  59. package/dist/ToastViewport.vue.d.ts +16 -8
  60. package/dist/Tour.js +84 -0
  61. package/dist/Tour.vue.d.ts +16 -0
  62. package/dist/Tree.vue.d.ts +2 -2
  63. package/dist/WindowBar.vue.d.ts +27 -0
  64. package/dist/confirm.d.ts +5 -1
  65. package/dist/deprecatedEvents.d.ts +8 -0
  66. package/dist/engines.d.ts +2 -1
  67. package/dist/entries/accordion.d.ts +2 -0
  68. package/dist/entries/angleslider.d.ts +1 -0
  69. package/dist/entries/avatar.d.ts +2 -0
  70. package/dist/entries/carousel.d.ts +2 -0
  71. package/dist/entries/collapsible.d.ts +1 -0
  72. package/dist/entries/datepicker.d.ts +2 -0
  73. package/dist/entries/fileupload.d.ts +2 -0
  74. package/dist/entries/floatingpanel.d.ts +2 -0
  75. package/dist/entries/hovercard.d.ts +1 -0
  76. package/dist/entries/marquee.d.ts +2 -0
  77. package/dist/entries/pagination.d.ts +2 -0
  78. package/dist/entries/pininput.d.ts +2 -0
  79. package/dist/entries/rating.d.ts +2 -0
  80. package/dist/entries/scrollarea.d.ts +1 -0
  81. package/dist/entries/signaturepad.d.ts +2 -0
  82. package/dist/entries/splitter.d.ts +2 -0
  83. package/dist/entries/steps.d.ts +2 -0
  84. package/dist/entries/tagsinput.d.ts +2 -0
  85. package/dist/entries/timer.d.ts +2 -0
  86. package/dist/entries/tour.d.ts +2 -0
  87. package/dist/fortressParts.d.ts +3 -0
  88. package/dist/{glyphs-CYhs4mrY.js → glyphs-DEch1yYd.js} +2 -2
  89. package/dist/glyphs.d.ts +8 -0
  90. package/dist/index.d.ts +15 -2
  91. package/dist/index.js +3655 -3330
  92. package/dist/paypalButtons.d.ts +17 -0
  93. package/dist/selectParts-0e1ib8BL.js +23 -0
  94. package/dist/selectParts.d.ts +9 -5
  95. package/package.json +108 -7
  96. package/dist/Select-D8Kf1NZa.js +0 -520
@@ -0,0 +1,458 @@
1
+ import { r as e } from "./fieldName-DBygJJfe.js";
2
+ import { i as t, s as n } from "./glyphs-DEch1yYd.js";
3
+ import { n as r, t as i } from "./selectParts-0e1ib8BL.js";
4
+ import { n as a, r as o, t as s } from "./TipWrap-5Nw7Yj0O.js";
5
+ import { Fragment as c, Teleport as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeModels as v, mergeProps as y, normalizeClass as b, normalizeProps as x, onMounted as S, openBlock as C, renderList as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, useModel as A, watch as j, withCtx as M } from "vue";
6
+ import { SELECT_POSITIONING as N, closeOnPageMove as P, defaultWidth as F, endOption as I, faceLabels as L, flattenRuns as R, hasSubmenu as z, homeRow as B, isSubmenu as V, pageDir as H, portalTarget as U, selectRootClass as W, selectRowParts as G, selectTriggerClass as K } from "@glimstone/core";
7
+ import * as q from "@zag-js/select";
8
+ import { normalizeProps as J, useMachine as Y } from "@zag-js/vue";
9
+ import * as X from "@zag-js/menu";
10
+ // src/SelectFace.vue?vue&type=script&setup=true&lang.ts
11
+ var Z = {
12
+ key: 0,
13
+ class: "glim-select-glyph"
14
+ }, Q = { class: "glim-select-value" }, $ = ["aria-hidden"], ee = /* @__PURE__ */ g({
15
+ __name: "SelectFace",
16
+ props: {
17
+ all: {},
18
+ value: {},
19
+ placeholder: {},
20
+ width: {},
21
+ glyphs: { type: Boolean }
22
+ },
23
+ setup(e) {
24
+ let t = e, n = u(() => L(t.all, t.value, t.placeholder, t.width)), r = u(() => t.all.find((e) => e.value === t.value)?.glyph);
25
+ return (t, i) => (C(), p(c, null, [e.glyphs ? (C(), p("span", Z, [r.value ? (C(), d(T(r.value), { key: 0 })) : f("", !0)])) : f("", !0), m("span", Q, [(C(!0), p(c, null, w(n.value.labels, (e) => (C(), p("span", {
26
+ key: e,
27
+ "aria-hidden": e !== n.value.text || void 0,
28
+ class: b(e === n.value.text ? void 0 : "glim-select-ghost")
29
+ }, D(e), 11, $))), 128))])], 64));
30
+ }
31
+ }), te = ["aria-busy", "aria-describedby"], ne = /* @__PURE__ */ g({
32
+ __name: "ListSelect",
33
+ props: {
34
+ label: {},
35
+ hideLabel: { type: Boolean },
36
+ groups: {},
37
+ value: {},
38
+ placeholder: {},
39
+ width: {},
40
+ rows: {},
41
+ triggerClass: {},
42
+ id: {},
43
+ triggerAttrs: {},
44
+ listId: {},
45
+ disabled: { type: Boolean },
46
+ busy: { type: Boolean },
47
+ tip: {},
48
+ shake: {}
49
+ },
50
+ emits: ["change"],
51
+ setup(e, { expose: g, emit: v }) {
52
+ let S = e, A = v, F = k(), L = u(() => R(S.groups)), z = u(() => L.value.some((e) => e.glyph)), B = u(() => G(S.rows, z.value)), V = u(() => q.collection({
53
+ items: L.value,
54
+ itemToValue: (e) => e.value,
55
+ itemToString: (e) => e.label,
56
+ isItemDisabled: (e) => !!e.disabled
57
+ })), K = Y(q.machine, u(() => ({
58
+ id: F,
59
+ ids: {
60
+ trigger: S.id,
61
+ content: S.listId
62
+ },
63
+ dir: H(),
64
+ collection: V.value,
65
+ value: S.value === null ? [] : [S.value],
66
+ disabled: S.disabled,
67
+ readOnly: S.busy,
68
+ onValueChange: (e) => {
69
+ let t = e.value[0];
70
+ t !== void 0 && t !== S.value && A("change", t);
71
+ },
72
+ positioning: N
73
+ }))), X = u(() => q.connect(K, J)), Z = E(null), Q = o(() => S.tip, () => !!S.disabled);
74
+ r(Z, {
75
+ all: () => L.value,
76
+ value: () => S.value,
77
+ inert: () => !!(S.disabled || S.busy),
78
+ onChange: (e) => A("change", e),
79
+ shakeCount: () => S.shake ?? 0
80
+ }), j(() => X.value.open, (e, t, n) => {
81
+ e && n(P(() => X.value.setOpen(!1)));
82
+ });
83
+ let $ = i(() => X.value.open, Z);
84
+ function ne(e) {
85
+ let t = X.value.open ? void 0 : I(L.value, e.key);
86
+ if (t === void 0) return X.value.getTriggerProps().onKeydown?.(e);
87
+ e.preventDefault(), X.value.setOpen(!0), X.value.setHighlightValue(t);
88
+ }
89
+ function re(e) {
90
+ Z.value = e, Q.trigger.value = Z.value;
91
+ }
92
+ return g({ trigger: Z }), (r, i) => (C(), p("div", y(X.value.getRootProps(), { class: O(W)(e.width) }), [
93
+ m("label", y(X.value.getLabelProps(), { class: e.hideLabel ? "glim-sr-only" : "glim-field-label" }), D(e.label), 17),
94
+ m("div", x(_(X.value.getControlProps())), [h(O(s), {
95
+ on: !!e.disabled && !!e.tip,
96
+ show: O(Q).show,
97
+ hide: O(Q).hide
98
+ }, {
99
+ default: M(() => [m("button", y({
100
+ ...e.triggerAttrs,
101
+ ...X.value.getTriggerProps(),
102
+ onKeydown: ne
103
+ }, {
104
+ ref: re,
105
+ "aria-busy": e.busy || void 0,
106
+ "aria-describedby": O(Q).describedBy.value,
107
+ class: e.triggerClass,
108
+ onMouseenter: i[0] ||= (...e) => O(Q).show && O(Q).show(...e),
109
+ onMouseleave: i[1] ||= (...e) => O(Q).hide && O(Q).hide(...e),
110
+ onFocus: i[2] ||= (...e) => O(Q).showOnFocus && O(Q).showOnFocus(...e),
111
+ onBlur: i[3] ||= (...e) => O(Q).hide && O(Q).hide(...e)
112
+ }), [h(ee, {
113
+ all: L.value,
114
+ value: e.value,
115
+ placeholder: e.placeholder,
116
+ width: e.width,
117
+ glyphs: z.value
118
+ }, null, 8, [
119
+ "all",
120
+ "value",
121
+ "placeholder",
122
+ "width",
123
+ "glyphs"
124
+ ]), m("span", y(X.value.getIndicatorProps(), { class: "glim-select-indicator" }), [h(O(n))], 16)], 16, te)]),
125
+ _: 1
126
+ }, 8, [
127
+ "on",
128
+ "show",
129
+ "hide"
130
+ ])], 16),
131
+ h(a, { state: O(Q) }, null, 8, ["state"]),
132
+ (C(), d(l, { to: O(U)() }, [m("div", y(X.value.getPositionerProps(), {
133
+ style: O($).style.value,
134
+ class: ["glim-select-positioner", O($).className.value]
135
+ }), [m("div", y(X.value.getContentProps(), { class: B.value.content }), [(C(!0), p(c, null, w(e.groups, (e, n) => (C(), p(c, { key: n }, [e.entries.length > 0 ? (C(), p("div", y({
136
+ key: 0,
137
+ ref_for: !0
138
+ }, e.heading ? X.value.getItemGroupProps({ id: `${O(F)}-g${n}` }) : {}, { class: "glim-select-group" }), [e.heading ? (C(), p("div", y({
139
+ key: 0,
140
+ ref_for: !0
141
+ }, X.value.getItemGroupLabelProps({ htmlFor: `${O(F)}-g${n}` }), { class: B.value.heading }), D(e.heading), 17)) : f("", !0), (C(!0), p(c, null, w(e.entries, (e) => (C(), p("div", y({ key: e.value }, { ref_for: !0 }, X.value.getItemProps({ item: e }), { class: B.value.item }), [
142
+ B.value.glyph ? (C(), p("span", {
143
+ key: 0,
144
+ class: b(B.value.glyph)
145
+ }, [e.glyph ? (C(), d(T(e.glyph), { key: 0 })) : f("", !0)], 2)) : f("", !0),
146
+ m("span", y({ ref_for: !0 }, X.value.getItemTextProps({ item: e }), { class: B.value.label }), D(e.label), 17),
147
+ m("span", y({ ref_for: !0 }, X.value.getItemIndicatorProps({ item: e }), { class: B.value.check }), [h(O(t))], 16)
148
+ ], 16))), 128))], 16)) : f("", !0)], 64))), 128))], 16)], 16)], 8, ["to"])),
149
+ m("select", x(_(X.value.getHiddenSelectProps())), null, 16)
150
+ ], 16));
151
+ }
152
+ }), re = ["data-state"], ie = /* @__PURE__ */ g({
153
+ __name: "MenuChoice",
154
+ props: {
155
+ api: {},
156
+ option: {},
157
+ value: {},
158
+ parts: {}
159
+ },
160
+ emits: ["change"],
161
+ setup(e, { emit: n }) {
162
+ let r = e, i = n, a = u(() => r.option.value === r.value), o = u(() => ({
163
+ type: "radio",
164
+ value: r.option.value,
165
+ valueText: r.option.label,
166
+ checked: a.value,
167
+ disabled: r.option.disabled,
168
+ onCheckedChange: () => {
169
+ a.value || i("change", r.option.value);
170
+ }
171
+ }));
172
+ return (n, r) => (C(), p("div", y(e.api.getOptionItemProps(o.value), { class: e.parts.item }), [
173
+ e.parts.glyph ? (C(), p("span", {
174
+ key: 0,
175
+ class: b(e.parts.glyph)
176
+ }, [e.option.glyph ? (C(), d(T(e.option.glyph), { key: 0 })) : f("", !0)], 2)) : f("", !0),
177
+ m("span", y(e.api.getItemTextProps(o.value), { class: e.parts.label }), D(e.option.label), 17),
178
+ m("span", {
179
+ "aria-hidden": "true",
180
+ "data-state": a.value ? "checked" : "unchecked",
181
+ class: b(e.parts.check)
182
+ }, [h(O(t))], 10, re)
183
+ ], 16));
184
+ }
185
+ }), ae = /* @__PURE__ */ g({
186
+ __name: "MenuSubmenu",
187
+ props: {
188
+ parent: {},
189
+ parentApi: {},
190
+ triggerId: {},
191
+ entry: {},
192
+ value: {},
193
+ parts: {},
194
+ hueStyle: {},
195
+ hueClass: {}
196
+ },
197
+ emits: ["change"],
198
+ setup(e, { emit: t }) {
199
+ let r = e, i = t, a = Y(X.machine, {
200
+ id: k(),
201
+ ids: { trigger: r.triggerId },
202
+ dir: H(),
203
+ "aria-label": r.entry.label
204
+ }), o = u(() => X.connect(a, J));
205
+ return S(() => {
206
+ r.parentApi.setChild(a), o.value.setParent(r.parent);
207
+ }), (t, r) => (C(), p(c, null, [m("div", y(e.parentApi.getTriggerItemProps(o.value), { class: e.parts.item }), [
208
+ e.parts.glyph ? (C(), p("span", {
209
+ key: 0,
210
+ class: b(e.parts.glyph)
211
+ }, [e.entry.glyph ? (C(), d(T(e.entry.glyph), { key: 0 })) : f("", !0)], 2)) : f("", !0),
212
+ m("span", { class: b(e.parts.label) }, D(e.entry.label), 3),
213
+ m("span", {
214
+ "aria-hidden": "true",
215
+ class: b(e.parts.caret)
216
+ }, [h(O(n))], 2)
217
+ ], 16), (C(), d(l, { to: O(U)() }, [m("div", y(o.value.getPositionerProps(), {
218
+ style: e.hueStyle,
219
+ class: ["glim-select-positioner", e.hueClass]
220
+ }), [m("div", y(o.value.getContentProps(), { class: e.parts.content }), [(C(!0), p(c, null, w(e.entry.options, (t) => (C(), d(ie, {
221
+ key: t.value,
222
+ api: o.value,
223
+ option: t,
224
+ value: e.value,
225
+ parts: e.parts,
226
+ onChange: r[0] ||= (e) => i("change", e)
227
+ }, null, 8, [
228
+ "api",
229
+ "option",
230
+ "value",
231
+ "parts"
232
+ ]))), 128))], 16)], 16)], 8, ["to"]))], 64));
233
+ }
234
+ }), oe = {
235
+ key: 0,
236
+ "aria-hidden": "true",
237
+ class: "glim-field-label"
238
+ }, se = [
239
+ "disabled",
240
+ "data-disabled",
241
+ "data-readonly",
242
+ "aria-busy",
243
+ "aria-label",
244
+ "aria-describedby"
245
+ ], ce = /* @__PURE__ */ g({
246
+ __name: "MenuSelect",
247
+ props: {
248
+ label: {},
249
+ hideLabel: { type: Boolean },
250
+ groups: {},
251
+ value: {},
252
+ placeholder: {},
253
+ width: {},
254
+ rows: {},
255
+ triggerClass: {},
256
+ id: {},
257
+ triggerAttrs: {},
258
+ listId: {},
259
+ disabled: { type: Boolean },
260
+ busy: { type: Boolean },
261
+ tip: {},
262
+ shake: {}
263
+ },
264
+ emits: ["change"],
265
+ setup(e, { expose: t, emit: g }) {
266
+ let _ = e, v = g, x = k(), S = Y(X.machine, u(() => ({
267
+ id: x,
268
+ ids: {
269
+ trigger: _.id,
270
+ content: _.listId
271
+ },
272
+ dir: H(),
273
+ "aria-label": _.label,
274
+ positioning: N
275
+ }))), T = u(() => X.connect(S, J)), A = u(() => R(_.groups)), F = u(() => A.value.some((e) => e.glyph)), I = u(() => G(_.rows, F.value)), z = u(() => L(A.value, _.value, _.placeholder, _.width).text), K = (e, t) => `${x}-sub-${e}-${t}`, q = E(null), Z = o(() => _.tip, () => !!_.disabled);
276
+ r(q, {
277
+ all: () => A.value,
278
+ value: () => _.value,
279
+ inert: () => !!(_.disabled || _.busy),
280
+ onChange: (e) => v("change", e),
281
+ shakeCount: () => _.shake ?? 0
282
+ });
283
+ let Q = i(() => T.value.open, q);
284
+ j(() => T.value.open, (e, t, n) => {
285
+ if (!e) return;
286
+ n(P(() => T.value.setOpen(!1)));
287
+ let r = B(_.groups, _.value, K);
288
+ if (r === null) return;
289
+ let i = 0, a = requestAnimationFrame(() => {
290
+ i = requestAnimationFrame(() => T.value.setHighlightedValue(r));
291
+ });
292
+ n(() => {
293
+ cancelAnimationFrame(a), cancelAnimationFrame(i);
294
+ });
295
+ });
296
+ let $ = u(() => {
297
+ let e = T.value.getTriggerProps(), t = (t) => (n) => {
298
+ _.busy ? n.preventDefault() : e[t]?.(n);
299
+ };
300
+ return {
301
+ ..._.triggerAttrs,
302
+ ...e,
303
+ onPointerdown: t("onPointerdown"),
304
+ onClick: t("onClick"),
305
+ onKeydown: t("onKeydown")
306
+ };
307
+ });
308
+ function te(e) {
309
+ q.value = e, Z.trigger.value = q.value;
310
+ }
311
+ return t({ trigger: q }), (t, r) => (C(), p("div", { class: b(O(W)(e.width)) }, [
312
+ e.hideLabel ? f("", !0) : (C(), p("span", oe, D(e.label), 1)),
313
+ m("div", null, [h(O(s), {
314
+ on: !!e.disabled && !!e.tip,
315
+ show: O(Z).show,
316
+ hide: O(Z).hide
317
+ }, {
318
+ default: M(() => [m("button", y($.value, {
319
+ ref: te,
320
+ disabled: e.disabled,
321
+ "data-disabled": e.disabled ? "" : void 0,
322
+ "data-readonly": e.busy ? "" : void 0,
323
+ "aria-busy": e.busy || void 0,
324
+ "aria-label": `${e.label}: ${z.value}`,
325
+ "aria-describedby": O(Z).describedBy.value,
326
+ class: e.triggerClass,
327
+ onMouseenter: r[0] ||= (...e) => O(Z).show && O(Z).show(...e),
328
+ onMouseleave: r[1] ||= (...e) => O(Z).hide && O(Z).hide(...e),
329
+ onFocus: r[2] ||= (...e) => O(Z).showOnFocus && O(Z).showOnFocus(...e),
330
+ onBlur: r[3] ||= (...e) => O(Z).hide && O(Z).hide(...e)
331
+ }), [h(ee, {
332
+ all: A.value,
333
+ value: e.value,
334
+ placeholder: e.placeholder,
335
+ width: e.width,
336
+ glyphs: F.value
337
+ }, null, 8, [
338
+ "all",
339
+ "value",
340
+ "placeholder",
341
+ "width",
342
+ "glyphs"
343
+ ]), m("span", y(T.value.getIndicatorProps(), { class: "glim-select-indicator" }), [h(O(n))], 16)], 16, se)]),
344
+ _: 1
345
+ }, 8, [
346
+ "on",
347
+ "show",
348
+ "hide"
349
+ ])]),
350
+ h(a, { state: O(Z) }, null, 8, ["state"]),
351
+ (C(), d(l, { to: O(U)() }, [m("div", y(T.value.getPositionerProps(), {
352
+ style: O(Q).style.value,
353
+ class: ["glim-select-positioner", O(Q).className.value]
354
+ }), [m("div", y(T.value.getContentProps(), { class: I.value.content }), [(C(!0), p(c, null, w(e.groups, (t, n) => (C(), p(c, { key: n }, [t.entries.length > 0 ? (C(), p("div", y({
355
+ key: 0,
356
+ ref_for: !0
357
+ }, t.heading ? T.value.getItemGroupProps({ id: `g${n}` }) : {}, { class: "glim-select-group" }), [t.heading ? (C(), p("div", y({
358
+ key: 0,
359
+ ref_for: !0
360
+ }, T.value.getItemGroupLabelProps({ htmlFor: `g${n}` }), { class: I.value.heading }), D(t.heading), 17)) : f("", !0), (C(!0), p(c, null, w(t.entries, (t, i) => (C(), p(c, { key: O(V)(t) ? `s${i}` : t.value }, [O(V)(t) ? (C(), d(ae, {
361
+ key: 0,
362
+ parent: O(S),
363
+ "parent-api": T.value,
364
+ "trigger-id": K(n, i),
365
+ entry: t,
366
+ value: e.value,
367
+ parts: I.value,
368
+ "hue-style": O(Q).style.value,
369
+ "hue-class": O(Q).className.value,
370
+ onChange: r[4] ||= (e) => v("change", e)
371
+ }, null, 8, [
372
+ "parent",
373
+ "parent-api",
374
+ "trigger-id",
375
+ "entry",
376
+ "value",
377
+ "parts",
378
+ "hue-style",
379
+ "hue-class"
380
+ ])) : (C(), d(ie, {
381
+ key: 1,
382
+ api: T.value,
383
+ option: t,
384
+ value: e.value,
385
+ parts: I.value,
386
+ onChange: r[5] ||= (e) => v("change", e)
387
+ }, null, 8, [
388
+ "api",
389
+ "option",
390
+ "value",
391
+ "parts"
392
+ ]))], 64))), 128))], 16)) : f("", !0)], 64))), 128))], 16)], 16)], 8, ["to"]))
393
+ ], 2));
394
+ }
395
+ }), le = /* @__PURE__ */ g({
396
+ __name: "Select",
397
+ props: /*@__PURE__*/ v({
398
+ label: {},
399
+ hideLabel: {
400
+ type: Boolean,
401
+ default: !1
402
+ },
403
+ options: {},
404
+ groups: {},
405
+ placeholder: {},
406
+ width: {},
407
+ size: { default: "field" },
408
+ rows: { default: "list" },
409
+ wrap: {
410
+ type: Boolean,
411
+ default: !1
412
+ },
413
+ id: {},
414
+ triggerAttrs: {},
415
+ listId: {},
416
+ disabled: {
417
+ type: Boolean,
418
+ default: !1
419
+ },
420
+ busy: {
421
+ type: Boolean,
422
+ default: !1
423
+ },
424
+ tip: {},
425
+ shake: {}
426
+ }, {
427
+ modelValue: { required: !0 },
428
+ modelModifiers: {}
429
+ }),
430
+ emits: ["update:modelValue"],
431
+ setup(t) {
432
+ let n = t, r = A(t, "modelValue"), i = u(() => n.groups ?? [{ entries: n.options ?? [] }]), a = e(() => n.label), o = u(() => n.label === void 0), s = u(() => ({
433
+ label: a.value ?? "",
434
+ hideLabel: n.hideLabel || o.value,
435
+ groups: i.value,
436
+ value: r.value,
437
+ placeholder: n.placeholder,
438
+ width: n.width ?? (o.value ? "steady" : F(n.size)),
439
+ rows: n.rows,
440
+ triggerClass: K(n.size, n.wrap),
441
+ id: n.id,
442
+ triggerAttrs: n.triggerAttrs,
443
+ listId: n.listId,
444
+ disabled: n.disabled,
445
+ busy: n.busy,
446
+ tip: n.tip,
447
+ shake: n.shake
448
+ }));
449
+ return (e, t) => O(z)(i.value) ? (C(), d(ce, y({
450
+ key: 0,
451
+ "data-glim": "Select"
452
+ }, s.value, { onChange: t[0] ||= (e) => r.value = e }), null, 16)) : (C(), d(ne, y({
453
+ key: 1,
454
+ "data-glim": "Select"
455
+ }, s.value, { onChange: t[1] ||= (e) => r.value = e }), null, 16));
456
+ }
457
+ });
458
+ export { le as t };
package/dist/Select.js CHANGED
@@ -1 +1 @@
1
- export { t as Select } from "./Select-D8Kf1NZa.js";
1
+ export { t as Select } from "./Select-CBScnONy.js";
@@ -0,0 +1,63 @@
1
+ import { t as e } from "./Button-BM5Dzboj.js";
2
+ import { h as t } from "./glyphs-DEch1yYd.js";
3
+ import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeProps as f, openBlock as p, renderList as m, toDisplayString as h, unref as g, useId as _, useModel as v } from "vue";
4
+ import { SIGNATURE_PAD_TEXT as y, pageDir as b } from "@glimstone/core";
5
+ import { normalizeProps as x, useMachine as S } from "@zag-js/vue";
6
+ import * as C from "@zag-js/signature-pad";
7
+ // src/SignaturePad.vue?vue&type=script&setup=true&lang.ts
8
+ var w = { class: "glim-signature-foot" }, T = /* @__PURE__ */ c({
9
+ __name: "SignaturePad",
10
+ props: /*@__PURE__*/ u({
11
+ label: {},
12
+ disabled: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ text: {}
17
+ }, {
18
+ modelValue: { required: !0 },
19
+ modelModifiers: {}
20
+ }),
21
+ emits: ["update:modelValue"],
22
+ setup(c) {
23
+ let u = c, T = v(c, "modelValue"), E = r(() => ({
24
+ ...y,
25
+ ...u.text
26
+ })), D = _(), O = S(C.machine, r(() => ({
27
+ id: D,
28
+ dir: b(),
29
+ paths: T.value,
30
+ disabled: u.disabled,
31
+ drawing: {
32
+ fill: "currentColor",
33
+ size: 2,
34
+ simulatePressure: !0
35
+ },
36
+ onDraw: (e) => e.currentPath === null && (T.value = e.paths),
37
+ translations: {
38
+ control: E.value.area,
39
+ clearTrigger: E.value.clear
40
+ }
41
+ }))), k = r(() => C.connect(O, x));
42
+ function A() {
43
+ k.value.clear(), T.value = [];
44
+ }
45
+ return (r, u) => (p(), a("div", d({ "data-glim": "SignaturePad" }, k.value.getRootProps(), { class: "glim-signature" }), [
46
+ o("label", d(k.value.getLabelProps(), { class: "glim-field-label" }), h(c.label), 17),
47
+ o("div", d(k.value.getControlProps(), { class: "glim-signature-pad" }), [(p(), a("svg", d(k.value.getSegmentProps(), { class: "glim-signature-ink" }), [(p(!0), a(n, null, m(k.value.paths, (e, t) => (p(), a("path", d({ key: t }, { ref_for: !0 }, k.value.getSegmentPathProps({ path: e })), null, 16))), 128)), k.value.currentPath ? (p(), a("path", f(d({ key: 0 }, k.value.getSegmentPathProps({ path: k.value.currentPath }))), null, 16)) : i("", !0)], 16)), o("div", d(k.value.getGuideProps(), { class: "glim-signature-guide" }), null, 16)], 16),
48
+ o("div", w, [s(e, {
49
+ label: E.value.clear,
50
+ "label-key": null,
51
+ glyph: g(t),
52
+ disabled: k.value.empty || c.disabled,
53
+ onClick: A
54
+ }, null, 8, [
55
+ "label",
56
+ "glyph",
57
+ "disabled"
58
+ ])]),
59
+ o("input", f(l(k.value.getHiddenInputProps({ value: k.value.paths.join(" ") }))), null, 16)
60
+ ], 16));
61
+ }
62
+ });
63
+ export { T as SignaturePad };
@@ -0,0 +1,19 @@
1
+ import { type SignaturePadText } from "@glimstone/core";
2
+ type __VLS_Props = {
3
+ label: string;
4
+ disabled?: boolean;
5
+ text?: Partial<SignaturePadText>;
6
+ };
7
+ type __VLS_ModelProps = {
8
+ modelValue: string[];
9
+ };
10
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:modelValue": (value: string[]) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
15
+ }>, {
16
+ disabled: boolean;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,46 @@
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, openBlock as c, renderList as l, renderSlot as u, useId as d, useModel as f } from "vue";
2
+ import { SPLITTER_TEXT as p, pageDir as m, splitterHandleId as h } from "@glimstone/core";
3
+ import { normalizeProps as g, useMachine as _ } from "@zag-js/vue";
4
+ import * as v from "@zag-js/splitter";
5
+ // src/Splitter.vue?vue&type=script&setup=true&lang.ts
6
+ var y = ["aria-label"], b = /* @__PURE__ */ a({
7
+ __name: "Splitter",
8
+ props: /*@__PURE__*/ o({
9
+ panels: {},
10
+ orientation: { default: "horizontal" },
11
+ text: {}
12
+ }, {
13
+ size: { required: !0 },
14
+ sizeModifiers: {}
15
+ }),
16
+ emits: ["update:size"],
17
+ setup(a) {
18
+ let o = a, b = f(a, "size"), x = t(() => ({
19
+ ...p,
20
+ ...o.text
21
+ })), S = d(), C = _(v.machine, t(() => ({
22
+ id: S,
23
+ dir: m(),
24
+ orientation: o.orientation,
25
+ panels: o.panels.map(({ id: e, minSize: t, maxSize: n, collapsible: r }) => ({
26
+ id: e,
27
+ minSize: t,
28
+ maxSize: n,
29
+ collapsible: r
30
+ })),
31
+ size: b.value,
32
+ onResize: (e) => b.value = e.size
33
+ }))), w = t(() => v.connect(C, g)), T = (e) => {
34
+ let t = o.panels[e + 1];
35
+ return t && h(o.panels[e], t);
36
+ };
37
+ return (t, o) => (c(), r("div", s({ "data-glim": "Splitter" }, w.value.getRootProps(), { class: "glim-splitter" }), [(c(!0), r(e, null, l(a.panels, (a, o) => (c(), r(e, { key: a.id }, [i("div", s({ ref_for: !0 }, w.value.getPanelProps({ id: a.id }), { class: "glim-splitter-panel" }), [u(t.$slots, "panel", { panel: a })], 16), T(o) ? (c(), r("div", s({
38
+ key: 0,
39
+ ref_for: !0
40
+ }, w.value.getResizeTriggerProps({ id: T(o) }), {
41
+ "aria-label": x.value.resize,
42
+ class: "glim-splitter-handle"
43
+ }), [i("span", s({ ref_for: !0 }, w.value.getResizeTriggerIndicator({ id: T(o) }), { class: "glim-splitter-grip" }), null, 16)], 16, y)) : n("", !0)], 64))), 128))], 16));
44
+ }
45
+ });
46
+ export { b as Splitter };
@@ -0,0 +1,31 @@
1
+ import { type SplitterPanel, type SplitterText } from "@glimstone/core";
2
+ declare const __VLS_export: <T extends SplitterPanel>(__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<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
+ panels: readonly T[];
5
+ orientation?: "horizontal" | "vertical";
6
+ text?: Partial<SplitterText>;
7
+ } & {
8
+ size: number[];
9
+ }) & {
10
+ "onUpdate:size"?: ((value: number[]) => any) | undefined;
11
+ }> & (typeof globalThis extends {
12
+ __VLS_PROPS_FALLBACK: infer P;
13
+ } ? P : {});
14
+ expose: (exposed: {}) => void;
15
+ attrs: any;
16
+ slots: {
17
+ panel(props: {
18
+ panel: T;
19
+ }): unknown;
20
+ };
21
+ emit: (event: "update:size", value: number[]) => void;
22
+ }>) => import("vue").VNode & {
23
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
24
+ };
25
+ declare const _default: typeof __VLS_export;
26
+ export default _default;
27
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
28
+ [K in keyof T]: T[K];
29
+ } : {
30
+ [K in keyof T as K]: T[K];
31
+ }) & {};