@glimstone/vue 4.1.0 → 4.1.1

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 (46) hide show
  1. package/dist/Button.vue.d.ts +23 -2
  2. package/dist/Card.vue.d.ts +2 -0
  3. package/dist/Combobox.js +32 -31
  4. package/dist/Combobox.vue.d.ts +1 -1
  5. package/dist/ContextMenu.vue.d.ts +2 -0
  6. package/dist/CopyField.vue.d.ts +4 -2
  7. package/dist/FieldRow.vue.d.ts +32 -0
  8. package/dist/FieldRowGroup.vue.d.ts +19 -0
  9. package/dist/GlyphField.vue.d.ts +35 -0
  10. package/dist/GlyphTile.vue.d.ts +13 -0
  11. package/dist/IconButton.vue.d.ts +18 -0
  12. package/dist/IconTipButton.vue.d.ts +2 -0
  13. package/dist/ListRow.vue.d.ts +26 -0
  14. package/dist/ListSelect.vue.d.ts +4 -1
  15. package/dist/MenuChoice.vue.d.ts +2 -1
  16. package/dist/MenuSelect.vue.d.ts +4 -1
  17. package/dist/MenuSubmenu.vue.d.ts +2 -1
  18. package/dist/Meter.vue.d.ts +1 -1
  19. package/dist/PasswordField.vue.d.ts +7 -1
  20. package/dist/PathField.vue.d.ts +40 -0
  21. package/dist/RowMark.vue.d.ts +6 -0
  22. package/dist/Select.js +241 -218
  23. package/dist/Select.vue.d.ts +10 -4
  24. package/dist/Selector.vue.d.ts +48 -50
  25. package/dist/SelectorSegment.vue.d.ts +1 -1
  26. package/dist/SidebarRow.vue.d.ts +19 -2
  27. package/dist/SidebarRowLink.vue.d.ts +17 -0
  28. package/dist/Slider.js +19 -18
  29. package/dist/Slider.vue.d.ts +1 -1
  30. package/dist/SubCard.vue.d.ts +1 -1
  31. package/dist/Table.vue.d.ts +32 -0
  32. package/dist/TextArea.vue.d.ts +21 -0
  33. package/dist/TextField.vue.d.ts +21 -0
  34. package/dist/ToastViewport.vue.d.ts +2 -1
  35. package/dist/Toggle.vue.d.ts +2 -1
  36. package/dist/Tree.vue.d.ts +23 -0
  37. package/dist/Window.vue.d.ts +5 -1
  38. package/dist/fieldName-DBygJJfe.js +8 -0
  39. package/dist/fieldName.d.ts +5 -0
  40. package/dist/{glyphs-Cgknt-k1.js → glyphs-CYhs4mrY.js} +2 -2
  41. package/dist/glyphs.d.ts +1 -0
  42. package/dist/index.d.ts +15 -2
  43. package/dist/index.js +1238 -657
  44. package/dist/selectorItem.d.ts +5 -3
  45. package/dist/windowParts.d.ts +6 -1
  46. package/package.json +2 -2
package/dist/Select.js CHANGED
@@ -1,15 +1,16 @@
1
- import { a as e, n as t } from "./glyphs-Cgknt-k1.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";
1
+ import { r as e } from "./fieldName-DBygJJfe.js";
2
+ import { a as t, n } from "./glyphs-CYhs4mrY.js";
3
+ import { n as r, r as i, t as a } from "./TipWrap-rNAEgvb0.js";
4
+ import { Fragment as o, Teleport as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, guardReactiveProps as h, mergeModels as g, mergeProps as _, normalizeClass as v, normalizeProps as y, onMounted as b, onScopeDispose as x, openBlock as S, renderList as C, resolveDynamicComponent as w, shallowRef as T, toDisplayString as E, unref as D, useId as O, useModel as k, watch as A, withCtx as j } from "vue";
5
+ import { SELECT_POSITIONING as M, closeOnPageMove as N, defaultWidth as P, enableWheelStep as F, faceLabels as I, flattenRuns as L, hasSubmenu as R, homeRow as z, isSubmenu as B, pageDir as V, readPortalHue as H, selectRootClass as U, selectRowParts as W, selectTriggerClass as G, shake as K, wheelValue as q } from "@glimstone/core";
6
+ import * as J from "@zag-js/select";
7
+ import { normalizeProps as Y, useMachine as X } from "@zag-js/vue";
8
+ import * as Z from "@zag-js/menu";
8
9
  // src/SelectFace.vue?vue&type=script&setup=true&lang.ts
9
10
  var ee = {
10
11
  key: 0,
11
12
  class: "glim-select-glyph"
12
- }, te = { class: "glim-select-value" }, ne = ["aria-hidden"], Z = /* @__PURE__ */ p({
13
+ }, te = { class: "glim-select-value" }, ne = ["aria-hidden"], Q = /* @__PURE__ */ m({
13
14
  __name: "SelectFace",
14
15
  props: {
15
16
  all: {},
@@ -19,39 +20,36 @@ var ee = {
19
20
  glyphs: { type: Boolean }
20
21
  },
21
22
  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", {
23
+ let t = e, n = c(() => I(t.all, t.value, t.placeholder, t.width)), r = c(() => t.all.find((e) => e.value === t.value)?.glyph);
24
+ return (t, i) => (S(), d(o, null, [e.glyphs ? (S(), d("span", ee, [r.value ? (S(), l(w(r.value), { key: 0 })) : u("", !0)])) : u("", !0), f("span", te, [(S(!0), d(o, null, C(n.value.labels, (e) => (S(), d("span", {
24
25
  key: e,
25
26
  "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));
27
+ class: v(e === n.value.text ? void 0 : "glim-select-ghost")
28
+ }, E(e), 11, ne))), 128))])], 64));
28
29
  }
29
30
  });
30
31
  // 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" : "")
32
+ function $(e, t) {
33
+ let n = T(null);
34
+ return A(e, (e) => n.value = e && t.value ? H(t.value) : null, { flush: "sync" }), {
35
+ style: c(() => n.value ?? void 0),
36
+ className: c(() => n.value ? "glim-hue" : "")
36
37
  };
37
38
  }
38
- function $(e, t) {
39
+ function re(e, t) {
39
40
  let n;
40
- k(e, (e) => {
41
- n?.(), n = e ? P(e, (e) => {
41
+ A(e, (e) => {
42
+ n?.(), n = e ? F(e, (e) => {
42
43
  if (t.inert()) return;
43
- let n = K(t.all(), t.value(), e);
44
+ let n = q(t.all(), t.value(), e);
44
45
  n !== void 0 && t.onChange(n);
45
46
  }) : void 0;
46
- }, { immediate: !0 }), k(t.shakeCount, (t, n, r) => {
47
- e.value && t > 0 && r(G(e.value));
48
- }), b(() => n?.());
47
+ }, { immediate: !0 }), A(t.shakeCount, (t, n, r) => {
48
+ e.value && t > 0 && r(K(e.value));
49
+ }), x(() => n?.());
49
50
  }
50
51
  // 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({
52
+ var ie = ["aria-busy", "aria-describedby"], ae = /* @__PURE__ */ m({
55
53
  __name: "ListSelect",
56
54
  props: {
57
55
  label: {},
@@ -60,114 +58,123 @@ var re = ["aria-busy", "aria-describedby"], ie = {
60
58
  value: {},
61
59
  placeholder: {},
62
60
  width: {},
61
+ rows: {},
63
62
  triggerClass: {},
64
63
  id: {},
64
+ triggerAttrs: {},
65
+ listId: {},
65
66
  disabled: { type: Boolean },
66
67
  busy: { type: Boolean },
67
68
  tip: {},
68
69
  shake: {}
69
70
  },
70
71
  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,
72
+ setup(e, { expose: m, emit: g }) {
73
+ let b = e, x = g, k = O(), P = c(() => L(b.groups)), F = c(() => P.value.some((e) => e.glyph)), I = c(() => W(b.rows, F.value)), R = c(() => J.collection({
74
+ items: P.value,
74
75
  itemToValue: (e) => e.value,
75
76
  itemToString: (e) => e.label,
76
77
  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,
78
+ })), z = X(J.machine, c(() => ({
79
+ id: k,
80
+ ids: {
81
+ trigger: b.id,
82
+ content: b.listId
83
+ },
84
+ dir: V(),
85
+ collection: R.value,
86
+ value: b.value === null ? [] : [b.value],
87
+ disabled: b.disabled,
88
+ readOnly: b.busy,
85
89
  onValueChange: (e) => {
86
90
  let t = e.value[0];
87
- t !== void 0 && t !== y.value && b("change", t);
91
+ t !== void 0 && t !== b.value && x("change", t);
88
92
  },
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)));
93
+ positioning: M
94
+ }))), B = c(() => J.connect(z, Y)), H = T(null), G = i(() => b.tip, () => !!b.disabled);
95
+ re(H, {
96
+ all: () => P.value,
97
+ value: () => b.value,
98
+ inert: () => !!(b.disabled || b.busy),
99
+ onChange: (e) => x("change", e),
100
+ shakeCount: () => b.shake ?? 0
101
+ }), A(() => B.value.open, (e, t, n) => {
102
+ e && n(N(() => B.value.setOpen(!1)));
99
103
  });
100
- let W = Q(() => R.value.open, z);
101
- function G(e) {
102
- z.value = e, V.trigger.value = z.value;
104
+ let K = $(() => B.value.open, H);
105
+ function q(e) {
106
+ H.value = e, G.trigger.value = H.value;
103
107
  }
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
108
+ return m({ trigger: H }), (i, c) => (S(), d("div", _(B.value.getRootProps(), { class: D(U)(e.width) }), [
109
+ f("label", _(B.value.getLabelProps(), { class: e.hideLabel ? "glim-sr-only" : "glim-field-label" }), E(e.label), 17),
110
+ f("div", y(h(B.value.getControlProps())), [p(D(a), {
111
+ on: !!e.disabled && !!e.tip,
112
+ show: D(G).show,
113
+ hide: D(G).hide
110
114
  }, {
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
115
+ default: j(() => [f("button", _({
116
+ ...e.triggerAttrs,
117
+ ...B.value.getTriggerProps()
118
+ }, {
119
+ ref: q,
120
+ "aria-busy": e.busy || void 0,
121
+ "aria-describedby": D(G).describedBy.value,
122
+ class: e.triggerClass,
123
+ onMouseenter: c[0] ||= (...e) => D(G).show && D(G).show(...e),
124
+ onMouseleave: c[1] ||= (...e) => D(G).hide && D(G).hide(...e),
125
+ onFocus: c[2] ||= (...e) => D(G).showOnFocus && D(G).showOnFocus(...e),
126
+ onBlur: c[3] ||= (...e) => D(G).hide && D(G).hide(...e)
127
+ }), [p(Q, {
128
+ all: P.value,
129
+ value: e.value,
130
+ placeholder: e.placeholder,
131
+ width: e.width,
132
+ glyphs: F.value
126
133
  }, null, 8, [
127
134
  "all",
128
135
  "value",
129
136
  "placeholder",
130
137
  "width",
131
138
  "glyphs"
132
- ]), d("span", g(R.value.getIndicatorProps(), { class: "glim-select-indicator" }), [f(E(e))], 16)], 16, re)]),
139
+ ]), f("span", _(B.value.getIndicatorProps(), { class: "glim-select-indicator" }), [p(D(t))], 16)], 16, ie)]),
133
140
  _: 1
134
141
  }, 8, [
135
142
  "on",
136
143
  "show",
137
144
  "hide"
138
145
  ])], 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({
146
+ p(r, { state: D(G) }, null, 8, ["state"]),
147
+ (S(), l(s, { to: "body" }, [f("div", _(B.value.getPositionerProps(), {
148
+ style: D(K).style.value,
149
+ class: ["glim-select-positioner", D(K).className.value]
150
+ }), [f("div", _(B.value.getContentProps(), { class: I.value.content }), [(S(!0), d(o, null, C(e.groups, (e, t) => (S(), d(o, { key: t }, [e.entries.length > 0 ? (S(), d("div", _({
144
151
  key: 0,
145
152
  ref_for: !0
146
- }, e.heading ? R.value.getItemGroupProps({ id: `${E(O)}-g${n}` }) : {}, { class: "glim-select-group" }), [e.heading ? (x(), u("div", g({
153
+ }, e.heading ? B.value.getItemGroupProps({ id: `${D(k)}-g${t}` }) : {}, { class: "glim-select-group" }), [e.heading ? (S(), d("div", _({
147
154
  key: 0,
148
155
  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)
156
+ }, B.value.getItemGroupLabelProps({ htmlFor: `${D(k)}-g${t}` }), { class: I.value.heading }), E(e.heading), 17)) : u("", !0), (S(!0), d(o, null, C(e.entries, (e) => (S(), d("div", _({ key: e.value }, { ref_for: !0 }, B.value.getItemProps({ item: e }), { class: I.value.item }), [
157
+ I.value.glyph ? (S(), d("span", {
158
+ key: 0,
159
+ class: v(I.value.glyph)
160
+ }, [e.glyph ? (S(), l(w(e.glyph), { key: 0 })) : u("", !0)], 2)) : u("", !0),
161
+ f("span", _({ ref_for: !0 }, B.value.getItemTextProps({ item: e }), { class: I.value.label }), E(e.label), 17),
162
+ f("span", _({ ref_for: !0 }, B.value.getItemIndicatorProps({ item: e }), { class: I.value.check }), [p(D(n))], 16)
163
+ ], 16))), 128))], 16)) : u("", !0)], 64))), 128))], 16)], 16)])),
164
+ f("select", y(h(B.value.getHiddenSelectProps())), null, 16)
155
165
  ], 16));
156
166
  }
157
- }), oe = {
158
- key: 0,
159
- class: "glim-select-glyph"
160
- }, se = ["data-state"], ce = /* @__PURE__ */ p({
167
+ }), oe = ["data-state"], se = /* @__PURE__ */ m({
161
168
  __name: "MenuChoice",
162
169
  props: {
163
170
  api: {},
164
171
  option: {},
165
172
  value: {},
166
- glyphs: { type: Boolean }
173
+ parts: {}
167
174
  },
168
175
  emits: ["change"],
169
- setup(e, { emit: n }) {
170
- let r = e, i = n, a = s(() => r.option.value === r.value), o = s(() => ({
176
+ setup(e, { emit: t }) {
177
+ let r = e, i = t, a = c(() => r.option.value === r.value), o = c(() => ({
171
178
  type: "radio",
172
179
  value: r.option.value,
173
180
  valueText: r.option.label,
@@ -177,23 +184,20 @@ var re = ["aria-busy", "aria-describedby"], ie = {
177
184
  a.value || i("change", r.option.value);
178
185
  }
179
186
  }));
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", {
187
+ return (t, r) => (S(), d("div", _(e.api.getOptionItemProps(o.value), { class: e.parts.item }), [
188
+ e.parts.glyph ? (S(), d("span", {
189
+ key: 0,
190
+ class: v(e.parts.glyph)
191
+ }, [e.option.glyph ? (S(), l(w(e.option.glyph), { key: 0 })) : u("", !0)], 2)) : u("", !0),
192
+ f("span", _(e.api.getItemTextProps(o.value), { class: e.parts.label }), E(e.option.label), 17),
193
+ f("span", {
184
194
  "aria-hidden": "true",
185
195
  "data-state": a.value ? "checked" : "unchecked",
186
- class: "glim-select-check"
187
- }, [f(E(t))], 8, se)
196
+ class: v(e.parts.check)
197
+ }, [p(D(n))], 10, oe)
188
198
  ], 16));
189
199
  }
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({
200
+ }), ce = /* @__PURE__ */ m({
197
201
  __name: "MenuSubmenu",
198
202
  props: {
199
203
  parent: {},
@@ -201,53 +205,59 @@ var re = ["aria-busy", "aria-describedby"], ie = {
201
205
  triggerId: {},
202
206
  entry: {},
203
207
  value: {},
204
- glyphs: { type: Boolean },
208
+ parts: {},
205
209
  hueStyle: {},
206
210
  hueClass: {}
207
211
  },
208
212
  emits: ["change"],
209
- setup(t, { emit: n }) {
210
- let r = t, i = n, p = Y(X.machine, {
211
- id: D(),
213
+ setup(e, { emit: n }) {
214
+ let r = e, i = n, a = X(Z.machine, {
215
+ id: O(),
212
216
  ids: { trigger: r.triggerId },
213
- dir: B(),
217
+ dir: V(),
214
218
  "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,
219
+ }), m = c(() => Z.connect(a, Y));
220
+ return b(() => {
221
+ r.parentApi.setChild(a), m.value.setParent(r.parent);
222
+ }), (n, r) => (S(), d(o, null, [f("div", _(e.parentApi.getTriggerItemProps(m.value), { class: e.parts.item }), [
223
+ e.parts.glyph ? (S(), d("span", {
224
+ key: 0,
225
+ class: v(e.parts.glyph)
226
+ }, [e.entry.glyph ? (S(), l(w(e.entry.glyph), { key: 0 })) : u("", !0)], 2)) : u("", !0),
227
+ f("span", { class: v(e.parts.label) }, E(e.entry.label), 3),
228
+ f("span", {
229
+ "aria-hidden": "true",
230
+ class: v(e.parts.caret)
231
+ }, [p(D(t))], 2)
232
+ ], 16), (S(), l(s, { to: "body" }, [f("div", _(m.value.getPositionerProps(), {
233
+ style: e.hueStyle,
234
+ class: ["glim-select-positioner", e.hueClass]
235
+ }), [f("div", _(m.value.getContentProps(), { class: e.parts.content }), [(S(!0), d(o, null, C(e.entry.options, (t) => (S(), l(se, {
236
+ key: t.value,
227
237
  api: m.value,
228
- option: e,
229
- value: t.value,
230
- glyphs: t.glyphs,
238
+ option: t,
239
+ value: e.value,
240
+ parts: e.parts,
231
241
  onChange: r[0] ||= (e) => i("change", e)
232
242
  }, null, 8, [
233
243
  "api",
234
244
  "option",
235
245
  "value",
236
- "glyphs"
246
+ "parts"
237
247
  ]))), 128))], 16)], 16)]))], 64));
238
248
  }
239
- }), pe = {
249
+ }), le = {
240
250
  key: 0,
241
251
  "aria-hidden": "true",
242
252
  class: "glim-field-label"
243
- }, me = [
253
+ }, ue = [
244
254
  "disabled",
245
255
  "data-disabled",
246
256
  "data-readonly",
247
257
  "aria-busy",
248
258
  "aria-label",
249
259
  "aria-describedby"
250
- ], he = /* @__PURE__ */ p({
260
+ ], de = /* @__PURE__ */ m({
251
261
  __name: "MenuSelect",
252
262
  props: {
253
263
  label: {},
@@ -256,143 +266,150 @@ var re = ["aria-busy", "aria-describedby"], ie = {
256
266
  value: {},
257
267
  placeholder: {},
258
268
  width: {},
269
+ rows: {},
259
270
  triggerClass: {},
260
271
  id: {},
272
+ triggerAttrs: {},
273
+ listId: {},
261
274
  disabled: { type: Boolean },
262
275
  busy: { type: Boolean },
263
276
  tip: {},
264
277
  shake: {}
265
278
  },
266
279
  emits: ["change"],
267
- setup(t, { expose: p, emit: m }) {
268
- let h = t, v = m, y = D(), b = Y(X.machine, s(() => ({
280
+ setup(e, { expose: n, emit: m }) {
281
+ let h = e, g = m, y = O(), b = X(Z.machine, c(() => ({
269
282
  id: y,
270
- ids: h.id ? { trigger: h.id } : void 0,
271
- dir: B(),
283
+ ids: {
284
+ trigger: h.id,
285
+ content: h.listId
286
+ },
287
+ dir: V(),
272
288
  "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,
289
+ positioning: M
290
+ }))), x = c(() => Z.connect(b, Y)), w = c(() => L(h.groups)), k = c(() => w.value.some((e) => e.glyph)), P = c(() => W(h.rows, k.value)), F = c(() => I(w.value, h.value, h.placeholder, h.width).text), R = (e, t) => `${y}-sub-${e}-${t}`, H = T(null), G = i(() => h.tip, () => !!h.disabled);
291
+ re(H, {
292
+ all: () => w.value,
277
293
  value: () => h.value,
278
294
  inert: () => !!(h.disabled || h.busy),
279
- onChange: (e) => v("change", e),
295
+ onChange: (e) => g("change", e),
280
296
  shakeCount: () => h.shake ?? 0
281
297
  });
282
- let G = Q(() => C.value.open, V);
283
- k(() => C.value.open, (e, t, n) => {
298
+ let K = $(() => x.value.open, H);
299
+ A(() => x.value.open, (e, t, n) => {
284
300
  if (!e) return;
285
- n(M(() => C.value.setOpen(!1)));
286
- let r = R(h.groups, h.value, L);
301
+ n(N(() => x.value.setOpen(!1)));
302
+ let r = z(h.groups, h.value, R);
287
303
  if (r === null) return;
288
304
  let i = 0, a = requestAnimationFrame(() => {
289
- i = requestAnimationFrame(() => C.value.setHighlightedValue(r));
305
+ i = requestAnimationFrame(() => x.value.setHighlightedValue(r));
290
306
  });
291
307
  n(() => {
292
308
  cancelAnimationFrame(a), cancelAnimationFrame(i);
293
309
  });
294
310
  });
295
- let K = s(() => {
296
- let e = C.value.getTriggerProps(), t = (t) => (n) => {
311
+ let q = c(() => {
312
+ let e = x.value.getTriggerProps(), t = (t) => (n) => {
297
313
  h.busy ? n.preventDefault() : e[t]?.(n);
298
314
  };
299
315
  return {
316
+ ...h.triggerAttrs,
300
317
  ...e,
301
318
  onPointerdown: t("onPointerdown"),
302
319
  onClick: t("onClick"),
303
320
  onKeydown: t("onKeydown")
304
321
  };
305
322
  });
306
- function q(e) {
307
- V.value = e, W.trigger.value = V.value;
323
+ function J(e) {
324
+ H.value = e, G.trigger.value = H.value;
308
325
  }
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
326
+ return n({ trigger: H }), (n, i) => (S(), d("div", { class: v(D(U)(e.width)) }, [
327
+ e.hideLabel ? u("", !0) : (S(), d("span", le, E(e.label), 1)),
328
+ f("div", null, [p(D(a), {
329
+ on: !!e.disabled && !!e.tip,
330
+ show: D(G).show,
331
+ hide: D(G).hide
315
332
  }, {
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
333
+ default: j(() => [f("button", _(q.value, {
334
+ ref: J,
335
+ disabled: e.disabled,
336
+ "data-disabled": e.disabled ? "" : void 0,
337
+ "data-readonly": e.busy ? "" : void 0,
338
+ "aria-busy": e.busy || void 0,
339
+ "aria-label": `${e.label}: ${F.value}`,
340
+ "aria-describedby": D(G).describedBy.value,
341
+ class: e.triggerClass,
342
+ onMouseenter: i[0] ||= (...e) => D(G).show && D(G).show(...e),
343
+ onMouseleave: i[1] ||= (...e) => D(G).hide && D(G).hide(...e),
344
+ onFocus: i[2] ||= (...e) => D(G).showOnFocus && D(G).showOnFocus(...e),
345
+ onBlur: i[3] ||= (...e) => D(G).hide && D(G).hide(...e)
346
+ }), [p(Q, {
347
+ all: w.value,
348
+ value: e.value,
349
+ placeholder: e.placeholder,
350
+ width: e.width,
351
+ glyphs: k.value
335
352
  }, null, 8, [
336
353
  "all",
337
354
  "value",
338
355
  "placeholder",
339
356
  "width",
340
357
  "glyphs"
341
- ]), d("span", g(C.value.getIndicatorProps(), { class: "glim-select-indicator" }), [f(E(e))], 16)], 16, me)]),
358
+ ]), f("span", _(x.value.getIndicatorProps(), { class: "glim-select-indicator" }), [p(D(t))], 16)], 16, ue)]),
342
359
  _: 1
343
360
  }, 8, [
344
361
  "on",
345
362
  "show",
346
363
  "hide"
347
364
  ])]),
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({
365
+ p(r, { state: D(G) }, null, 8, ["state"]),
366
+ (S(), l(s, { to: "body" }, [f("div", _(x.value.getPositionerProps(), {
367
+ style: D(K).style.value,
368
+ class: ["glim-select-positioner", D(K).className.value]
369
+ }), [f("div", _(x.value.getContentProps(), { class: P.value.content }), [(S(!0), d(o, null, C(e.groups, (t, n) => (S(), d(o, { key: n }, [t.entries.length > 0 ? (S(), d("div", _({
353
370
  key: 0,
354
371
  ref_for: !0
355
- }, e.heading ? C.value.getItemGroupProps({ id: `g${n}` }) : {}, { class: "glim-select-group" }), [e.heading ? (x(), u("div", g({
372
+ }, t.heading ? x.value.getItemGroupProps({ id: `g${n}` }) : {}, { class: "glim-select-group" }), [t.heading ? (S(), d("div", _({
356
373
  key: 0,
357
374
  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, {
375
+ }, x.value.getItemGroupLabelProps({ htmlFor: `g${n}` }), { class: P.value.heading }), E(t.heading), 17)) : u("", !0), (S(!0), d(o, null, C(t.entries, (t, r) => (S(), d(o, { key: D(B)(t) ? `s${r}` : t.value }, [D(B)(t) ? (S(), l(ce, {
359
376
  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)
377
+ parent: D(b),
378
+ "parent-api": x.value,
379
+ "trigger-id": R(n, r),
380
+ entry: t,
381
+ value: e.value,
382
+ parts: P.value,
383
+ "hue-style": D(K).style.value,
384
+ "hue-class": D(K).className.value,
385
+ onChange: i[4] ||= (e) => g("change", e)
369
386
  }, null, 8, [
370
387
  "parent",
371
388
  "parent-api",
372
389
  "trigger-id",
373
390
  "entry",
374
391
  "value",
375
- "glyphs",
392
+ "parts",
376
393
  "hue-style",
377
394
  "hue-class"
378
- ])) : (x(), c(ce, {
395
+ ])) : (S(), l(se, {
379
396
  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)
397
+ api: x.value,
398
+ option: t,
399
+ value: e.value,
400
+ parts: P.value,
401
+ onChange: i[5] ||= (e) => g("change", e)
385
402
  }, null, 8, [
386
403
  "api",
387
404
  "option",
388
405
  "value",
389
- "glyphs"
390
- ]))], 64))), 128))], 16)) : l("", !0)], 64))), 128))], 16)], 16)]))
406
+ "parts"
407
+ ]))], 64))), 128))], 16)) : u("", !0)], 64))), 128))], 16)], 16)]))
391
408
  ], 2));
392
409
  }
393
- }), ge = /* @__PURE__ */ p({
410
+ }), fe = /* @__PURE__ */ m({
394
411
  __name: "Select",
395
- props: /*@__PURE__*/ h({
412
+ props: /*@__PURE__*/ g({
396
413
  label: {},
397
414
  hideLabel: {
398
415
  type: Boolean,
@@ -403,11 +420,14 @@ var re = ["aria-busy", "aria-describedby"], ie = {
403
420
  placeholder: {},
404
421
  width: {},
405
422
  size: { default: "field" },
423
+ rows: { default: "list" },
406
424
  wrap: {
407
425
  type: Boolean,
408
426
  default: !1
409
427
  },
410
428
  id: {},
429
+ triggerAttrs: {},
430
+ listId: {},
411
431
  disabled: {
412
432
  type: Boolean,
413
433
  default: !1
@@ -423,22 +443,25 @@ var re = ["aria-busy", "aria-describedby"], ie = {
423
443
  modelModifiers: {}
424
444
  }),
425
445
  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
446
+ setup(t) {
447
+ let n = t, r = k(t, "modelValue"), i = c(() => n.groups ?? [{ entries: n.options ?? [] }]), a = e(() => n.label), o = c(() => n.label === void 0), s = c(() => ({
448
+ label: a.value ?? "",
449
+ hideLabel: n.hideLabel || o.value,
450
+ groups: i.value,
451
+ value: r.value,
452
+ placeholder: n.placeholder,
453
+ width: n.width ?? (o.value ? "steady" : P(n.size)),
454
+ rows: n.rows,
455
+ triggerClass: G(n.size, n.wrap),
456
+ id: n.id,
457
+ triggerAttrs: n.triggerAttrs,
458
+ listId: n.listId,
459
+ disabled: n.disabled,
460
+ busy: n.busy,
461
+ tip: n.tip,
462
+ shake: n.shake
440
463
  }));
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));
464
+ return (e, t) => D(R)(i.value) ? (S(), l(de, _({ key: 0 }, s.value, { onChange: t[0] ||= (e) => r.value = e }), null, 16)) : (S(), l(ae, _({ key: 1 }, s.value, { onChange: t[1] ||= (e) => r.value = e }), null, 16));
442
465
  }
443
466
  });
444
- export { ge as Select };
467
+ export { fe as Select };