@cfasim-ui/components 0.6.4 → 0.7.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.
@@ -0,0 +1,569 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useModel as y, withCtx as b, withModifiers as x } from "vue";
2
+ import { ComboboxAnchor as ee, ComboboxContent as te, ComboboxEmpty as ne, ComboboxInput as re, ComboboxItem as ie, ComboboxItemIndicator as ae, ComboboxPortal as oe, ComboboxRoot as se, ComboboxTrigger as ce, ComboboxViewport as le, Primitive as S, SelectContent as C, SelectItem as w, SelectItemIndicator as T, SelectItemText as E, SelectPortal as D, SelectRoot as O, SelectTrigger as k, SelectValue as A, SelectViewport as j, TooltipArrow as M, TooltipContent as N, TooltipPortal as P, TooltipProvider as F, TooltipRoot as I, TooltipTrigger as L, useId as R } from "reka-ui";
3
+ //#region src/Box/Box.vue?vue&type=script&setup=true&lang.ts
4
+ var z = ["role"], B = /* @__PURE__ */ c({
5
+ __name: "Box",
6
+ props: {
7
+ variant: {},
8
+ bgColor: {},
9
+ textColor: {},
10
+ role: {}
11
+ },
12
+ setup(e) {
13
+ return (t, n) => (p(), i("div", {
14
+ class: d(["box", e.variant ? `box-${e.variant}` : void 0]),
15
+ style: f({
16
+ backgroundColor: e.bgColor,
17
+ color: e.textColor
18
+ }),
19
+ role: e.role
20
+ }, [h(t.$slots, "default", {}, void 0, !0)], 14, z));
21
+ }
22
+ }), V = (e, t) => {
23
+ let n = e.__vccOpts || e;
24
+ for (let [e, r] of t) n[e] = r;
25
+ return n;
26
+ }, H = /* @__PURE__ */ V(B, [["__scopeId", "data-v-d7342c02"]]), U = /* @__PURE__ */ V(/* @__PURE__ */ c({
27
+ __name: "Button",
28
+ props: {
29
+ label: {},
30
+ variant: { default: "primary" },
31
+ asChild: { type: Boolean },
32
+ as: { default: "button" }
33
+ },
34
+ emits: ["click"],
35
+ setup(e) {
36
+ return (t, r) => (p(), n(v(S), {
37
+ class: "button",
38
+ "data-variant": e.variant,
39
+ as: e.as,
40
+ "as-child": e.asChild,
41
+ onClick: r[0] ||= (e) => t.$emit("click", e)
42
+ }, {
43
+ default: b(() => [h(t.$slots, "default", {}, () => [o(_(e.label), 1)], !0)]),
44
+ _: 3
45
+ }, 8, [
46
+ "data-variant",
47
+ "as",
48
+ "as-child"
49
+ ]));
50
+ }
51
+ }), [["__scopeId", "data-v-250eab18"]]), W = /* @__PURE__ */ new Map();
52
+ function ue(e) {
53
+ return typeof e == "object" && e && "outline" in e ? e : { outline: e };
54
+ }
55
+ function G(e) {
56
+ for (let [t, n] of Object.entries(e)) W.set(t, ue(n));
57
+ }
58
+ function de(e, t = !1) {
59
+ let n = W.get(e);
60
+ if (n) return t && n.fill ? n.fill : n.outline;
61
+ }
62
+ function K(e) {
63
+ return W.has(e);
64
+ }
65
+ var q = /* @__PURE__ */ new Set();
66
+ function fe(e) {
67
+ let t = /^[a-zA-Z_$][\w$]*$/.test(e), n = t ? e : `icon_${e.replace(/[^\w$]/g, "_")}`;
68
+ return ` import ${n} from "@material-symbols/svg-400/outlined/${e}.svg?component";\n import { registerIcons } from "@cfasim-ui/components";\n registerIcons(${t ? `{ ${e} }` : `{ "${e}": ${n} }`});`;
69
+ }
70
+ function pe(e) {
71
+ q.has(e) || (q.add(e), console.warn(`[cfasim-ui] Icon "${e}" is not registered — nothing will render.\nRegister it once at startup:\n\n${fe(e)}\n\nRequires dev deps "@material-symbols/svg-400" + "vite-svg-loader".\nDocs: https://cdcgov.github.io/cfa-simulator/docs/cfasim-ui/components/icon#registering-icons`));
72
+ }
73
+ //#endregion
74
+ //#region ../../node_modules/.pnpm/@material-symbols+svg-400@0.44.10/node_modules/@material-symbols/svg-400/outlined/help.svg?component
75
+ var me = {
76
+ xmlns: "http://www.w3.org/2000/svg",
77
+ viewBox: "0 -960 960 960"
78
+ };
79
+ function he(e, t) {
80
+ return p(), i("svg", me, [...t[0] ||= [a("path", { d: "M511-258q11-11 11-27t-11-27-27-11-27 11-11 27 11 27 27 11 27-11m-62-135h59q0-26 6.5-47.5T555-490q31-26 44-51t13-55q0-53-34.5-85T486-713q-49 0-86.5 24.5T345-621l53 20q11-28 33-43.5t52-15.5q34 0 55 18.5t21 47.5q0 22-13 41.5T508-512q-30 26-44.5 51.5T449-393m31 313q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80m0-60q142 0 241-99.5T820-480q0-142-99-241t-241-99q-141 0-240.5 99T140-480q0 141 99.5 240.5T480-140m0-340" }, null, -1)]]);
81
+ }
82
+ var ge = { render: he }, _e = {
83
+ xmlns: "http://www.w3.org/2000/svg",
84
+ viewBox: "0 -960 960 960"
85
+ };
86
+ function ve(e, t) {
87
+ return p(), i("svg", _e, [...t[0] ||= [a("path", { d: "m480-121-41-37q-105.77-97.12-174.88-167.56Q195-396 154-451.5T96.5-552 80-643q0-90.15 60.5-150.58Q201-854 290-854q57 0 105.5 27t84.5 78q42-54 89-79.5T670-854q89 0 149.5 60.42Q880-733.15 880-643q0 46-16.5 91T806-451.5 695.88-325.56Q626.77-255.12 521-158zm0-79q101.24-93 166.62-159.5T750.5-476t54-89.14q15.5-39.13 15.5-77.72 0-66.14-42-108.64T670.22-794q-51.52 0-95.37 31.5T504-674h-49q-26-56-69.85-88t-95.37-32Q224-794 182-751.5t-42 108.82q0 38.68 15.5 78.18t54 90T314-358t166 158m0-297" }, null, -1)]]);
88
+ }
89
+ var ye = { render: ve }, be = {
90
+ xmlns: "http://www.w3.org/2000/svg",
91
+ viewBox: "0 -960 960 960"
92
+ };
93
+ function xe(e, t) {
94
+ return p(), i("svg", be, [...t[0] ||= [a("path", { d: "m480-121-41-37q-106-97-175-167.5t-110-126T96.5-552 80-643q0-90 60.5-150.5T290-854q57 0 105.5 27t84.5 78q42-54 89-79.5T670-854q89 0 149.5 60.5T880-643q0 46-16.5 91T806-451.5t-110 126T521-158z" }, null, -1)]]);
95
+ }
96
+ var Se = { render: xe }, Ce = {
97
+ xmlns: "http://www.w3.org/2000/svg",
98
+ viewBox: "0 -960 960 960"
99
+ };
100
+ function we(e, t) {
101
+ return p(), i("svg", Ce, [...t[0] ||= [a("path", { d: "M480-120q-150 0-255-105T120-480t105-255 255-105q8 0 17 .5t23 1.5q-36 32-56 79t-20 99q0 90 63 153t153 63q52 0 99-18.5t79-51.5q1 12 1.5 19.5t.5 14.5q0 150-105 255T480-120m0-60q109 0 190-67.5T771-406q-25 11-53.67 16.5Q688.67-384 660-384q-114.69 0-195.34-80.66Q384-545.31 384-660q0-24 5-51.5t18-62.5q-98 27-162.5 109.5T180-480q0 125 87.5 212.5T480-180m-4-297" }, null, -1)]]);
102
+ }
103
+ var Te = { render: we }, Ee = {
104
+ xmlns: "http://www.w3.org/2000/svg",
105
+ viewBox: "0 -960 960 960"
106
+ };
107
+ function De(e, t) {
108
+ return p(), i("svg", Ee, [...t[0] ||= [a("path", { d: "M579-381q41-41 41-99t-41-99-99-41-99 41-41 99 41 99 99 41 99-41m-240.5 42.5Q280-397 280-480t58.5-141.5T480-680t141.5 58.5T680-480t-58.5 141.5T480-280t-141.5-58.5M200-450H40v-60h160zm720 0H760v-60h160zM450-760v-160h60v160zm0 720v-160h60v160zM262-658l-100-97 43-44 96 100zm494 496-98-100 41-41 99 98zm-99-537 98-99 44 42-99 98zM162-205l99-98 42 42-98 99zm318-275" }, null, -1)]]);
109
+ }
110
+ var Oe = { render: De }, ke = {
111
+ xmlns: "http://www.w3.org/2000/svg",
112
+ viewBox: "0 -960 960 960"
113
+ };
114
+ function Ae(e, t) {
115
+ return p(), i("svg", ke, [...t[0] ||= [a("path", { d: "M561-240 320-481l241-241 43 43-198 198 198 198z" }, null, -1)]]);
116
+ }
117
+ var je = { render: Ae }, Me = {
118
+ xmlns: "http://www.w3.org/2000/svg",
119
+ viewBox: "0 -960 960 960"
120
+ };
121
+ function Ne(e, t) {
122
+ return p(), i("svg", Me, [...t[0] ||= [a("path", { d: "M530-481 332-679l43-43 241 241-241 241-43-43z" }, null, -1)]]);
123
+ }
124
+ var Pe = { render: Ne }, Fe = {
125
+ xmlns: "http://www.w3.org/2000/svg",
126
+ viewBox: "0 -960 960 960"
127
+ };
128
+ function Ie(e, t) {
129
+ return p(), i("svg", Fe, [...t[0] ||= [a("path", { d: "M480-554 283-357l-43-43 240-240 240 240-43 43z" }, null, -1)]]);
130
+ }
131
+ var Le = { render: Ie }, Re = {
132
+ xmlns: "http://www.w3.org/2000/svg",
133
+ viewBox: "0 -960 960 960"
134
+ };
135
+ function ze(e, t) {
136
+ return p(), i("svg", Re, [...t[0] ||= [a("path", { d: "M480-344 240-584l43-43 197 197 197-197 43 43z" }, null, -1)]]);
137
+ }
138
+ var Be = { render: ze }, Ve = {
139
+ xmlns: "http://www.w3.org/2000/svg",
140
+ viewBox: "0 -960 960 960"
141
+ };
142
+ function He(e, t) {
143
+ return p(), i("svg", Ve, [...t[0] ||= [a("path", { d: "M453-241 213-481l240-240 42 42-198 198 198 198zm253 0L466-481l240-240 42 42-198 198 198 198z" }, null, -1)]]);
144
+ }
145
+ var Ue = { render: He }, We = {
146
+ xmlns: "http://www.w3.org/2000/svg",
147
+ viewBox: "0 -960 960 960"
148
+ };
149
+ function Ge(e, t) {
150
+ return p(), i("svg", We, [...t[0] ||= [a("path", { d: "M411-481 213-679l42-42 240 240-240 240-42-42zm253 0L466-679l42-42 240 240-240 240-42-42z" }, null, -1)]]);
151
+ }
152
+ var Ke = { render: Ge }, qe = {
153
+ xmlns: "http://www.w3.org/2000/svg",
154
+ viewBox: "0 -960 960 960"
155
+ };
156
+ function Je(e, t) {
157
+ return p(), i("svg", qe, [...t[0] ||= [a("path", { d: "M450-160v-526L202-438l-42-42 320-320 320 320-42 42-248-248v526z" }, null, -1)]]);
158
+ }
159
+ var Ye = { render: Je }, Xe = {
160
+ xmlns: "http://www.w3.org/2000/svg",
161
+ viewBox: "0 -960 960 960"
162
+ };
163
+ function Ze(e, t) {
164
+ return p(), i("svg", Xe, [...t[0] ||= [a("path", { d: "M450-800v526L202-522l-42 42 320 320 320-320-42-42-248 248v-526z" }, null, -1)]]);
165
+ }
166
+ var Qe = { render: Ze }, $e = {
167
+ xmlns: "http://www.w3.org/2000/svg",
168
+ viewBox: "0 -960 960 960"
169
+ };
170
+ function et(e, t) {
171
+ return p(), i("svg", $e, [...t[0] ||= [a("path", { d: "m274-450 248 248-42 42-320-320 320-320 42 42-248 248h526v60z" }, null, -1)]]);
172
+ }
173
+ var tt = { render: et }, nt = {
174
+ xmlns: "http://www.w3.org/2000/svg",
175
+ viewBox: "0 -960 960 960"
176
+ };
177
+ function rt(e, t) {
178
+ return p(), i("svg", nt, [...t[0] ||= [a("path", { d: "M686-450H160v-60h526L438-758l42-42 320 320-320 320-42-42z" }, null, -1)]]);
179
+ }
180
+ var it = { render: rt }, at = {
181
+ xmlns: "http://www.w3.org/2000/svg",
182
+ viewBox: "0 -960 960 960"
183
+ };
184
+ function ot(e, t) {
185
+ return p(), i("svg", at, [...t[0] ||= [a("path", { d: "M120-240v-60h720v60zm0-210v-60h720v60zm0-210v-60h720v60z" }, null, -1)]]);
186
+ }
187
+ var st = { render: ot }, ct = {
188
+ xmlns: "http://www.w3.org/2000/svg",
189
+ viewBox: "0 -960 960 960"
190
+ };
191
+ function lt(e, t) {
192
+ return p(), i("svg", ct, [...t[0] ||= [a("path", { d: "M479.86-160Q460-160 446-174.14t-14-34T446.14-242t34-14T514-241.86t14 34T513.86-174t-34 14m0-272Q460-432 446-446.14t-14-34T446.14-514t34-14T514-513.86t14 34T513.86-446t-34 14m0-272Q460-704 446-718.14t-14-34T446.14-786t34-14T514-785.86t14 34T513.86-718t-34 14" }, null, -1)]]);
193
+ }
194
+ var ut = { render: lt }, dt = {
195
+ xmlns: "http://www.w3.org/2000/svg",
196
+ viewBox: "0 -960 960 960"
197
+ };
198
+ function ft(e, t) {
199
+ return p(), i("svg", dt, [...t[0] ||= [a("path", { d: "M207.86-432Q188-432 174-446.14t-14-34T174.14-514t34-14T242-513.86t14 34T241.86-446t-34 14m272 0Q460-432 446-446.14t-14-34T446.14-514t34-14T514-513.86t14 34T513.86-446t-34 14m272 0Q732-432 718-446.14t-14-34T718.14-514t34-14T786-513.86t14 34T785.86-446t-34 14" }, null, -1)]]);
200
+ }
201
+ var pt = { render: ft }, mt = {
202
+ xmlns: "http://www.w3.org/2000/svg",
203
+ viewBox: "0 -960 960 960"
204
+ };
205
+ function ht(e, t) {
206
+ return p(), i("svg", mt, [...t[0] ||= [a("path", { d: "M450-450H200v-60h250v-250h60v250h250v60H510v250h-60z" }, null, -1)]]);
207
+ }
208
+ var gt = { render: ht }, _t = {
209
+ xmlns: "http://www.w3.org/2000/svg",
210
+ viewBox: "0 -960 960 960"
211
+ };
212
+ function vt(e, t) {
213
+ return p(), i("svg", _t, [...t[0] ||= [a("path", { d: "M180-180h44l472-471-44-44-472 471zm-60 60v-128l575-574q8-8 19-12.5t23-4.5q11 0 22 4.5t20 12.5l44 44q9 9 13 20t4 22-4.5 22.5T823-694L248-120zm659-617-41-41zm-105 64-22-22 44 44z" }, null, -1)]]);
214
+ }
215
+ var yt = { render: vt }, bt = {
216
+ xmlns: "http://www.w3.org/2000/svg",
217
+ viewBox: "0 -960 960 960"
218
+ };
219
+ function xt(e, t) {
220
+ return p(), i("svg", bt, [...t[0] ||= [a("path", { d: "M261-120q-24.75 0-42.37-17.63Q201-155.25 201-180v-570h-41v-60h188v-30h264v30h188v60h-41v570q0 24-18 42t-42 18zm438-630H261v570h438zM367-266h60v-399h-60zm166 0h60v-399h-60zM261-750v570z" }, null, -1)]]);
221
+ }
222
+ var St = { render: xt }, Ct = {
223
+ xmlns: "http://www.w3.org/2000/svg",
224
+ viewBox: "0 -960 960 960"
225
+ };
226
+ function wt(e, t) {
227
+ return p(), i("svg", Ct, [...t[0] ||= [a("path", { d: "m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z" }, null, -1)]]);
228
+ }
229
+ var Tt = { render: wt }, Et = {
230
+ xmlns: "http://www.w3.org/2000/svg",
231
+ viewBox: "0 -960 960 960"
232
+ };
233
+ function Dt(e, t) {
234
+ return p(), i("svg", Et, [...t[0] ||= [a("path", { d: "M378-246 154-470l43-43 181 181 384-384 43 43z" }, null, -1)]]);
235
+ }
236
+ var Ot = { render: Dt }, kt = {
237
+ xmlns: "http://www.w3.org/2000/svg",
238
+ viewBox: "0 -960 960 960"
239
+ };
240
+ function At(e, t) {
241
+ return p(), i("svg", kt, [...t[0] ||= [a("path", { d: "M796-121 533-384q-30 26-70 40.5T378-329q-108 0-183-75t-75-181 75-181 182-75q106 0 180.5 75T632-585q0 43-14 83t-42 75l264 262zM377-389q81 0 138-57.5T572-585t-57-138.5T377-781q-82 0-139.5 57.5T180-585t57.5 138.5T377-389" }, null, -1)]]);
242
+ }
243
+ var jt = { render: At }, Mt = {
244
+ xmlns: "http://www.w3.org/2000/svg",
245
+ viewBox: "0 -960 960 960"
246
+ };
247
+ function Nt(e, t) {
248
+ return p(), i("svg", Mt, [...t[0] ||= [a("path", { d: "M427-120v-225h60v83h353v60H487v82zm-307-82v-60h247v60zm187-166v-82H120v-60h187v-84h60v226zm120-82v-60h413v60zm166-165v-225h60v82h187v60H653v83zm-473-83v-60h413v60z" }, null, -1)]]);
249
+ }
250
+ var Pt = { render: Nt }, Ft = {
251
+ xmlns: "http://www.w3.org/2000/svg",
252
+ viewBox: "0 -960 960 960"
253
+ };
254
+ function It(e, t) {
255
+ return p(), i("svg", Ft, [...t[0] ||= [a("path", { d: "M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43zM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18z" }, null, -1)]]);
256
+ }
257
+ var Lt = { render: It }, Rt = {
258
+ xmlns: "http://www.w3.org/2000/svg",
259
+ viewBox: "0 0 24 24"
260
+ };
261
+ function J(e, t) {
262
+ return p(), i("svg", Rt, [...t[0] ||= [a("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }, null, -1)]]);
263
+ }
264
+ //#endregion
265
+ //#region src/Icon/defaultIcons.ts
266
+ var zt = {
267
+ help: ge,
268
+ favorite: {
269
+ outline: ye,
270
+ fill: Se
271
+ },
272
+ dark_mode: Te,
273
+ light_mode: Oe,
274
+ chevron_left: je,
275
+ chevron_right: Pe,
276
+ keyboard_arrow_up: Le,
277
+ keyboard_arrow_down: Be,
278
+ keyboard_double_arrow_left: Ue,
279
+ keyboard_double_arrow_right: Ke,
280
+ arrow_upward: Ye,
281
+ arrow_downward: Qe,
282
+ arrow_back: tt,
283
+ arrow_forward: it,
284
+ menu: st,
285
+ more_vert: ut,
286
+ more_horiz: pt,
287
+ add: gt,
288
+ edit: yt,
289
+ delete: St,
290
+ close: Tt,
291
+ check: Ot,
292
+ search: jt,
293
+ tune: Pt,
294
+ download: Lt,
295
+ github: { render: J }
296
+ }, Y = !1;
297
+ function Bt() {
298
+ if (!Y) {
299
+ Y = !0;
300
+ for (let [e, t] of Object.entries(zt)) K(e) || G({ [e]: t });
301
+ }
302
+ }
303
+ //#endregion
304
+ //#region src/Icon/Icon.vue?vue&type=script&setup=true&lang.ts
305
+ var Vt = [
306
+ "data-size",
307
+ "data-inline",
308
+ "aria-hidden",
309
+ "aria-label",
310
+ "role"
311
+ ], X = /* @__PURE__ */ c({
312
+ __name: "Icon",
313
+ props: {
314
+ icon: {},
315
+ size: { default: "md" },
316
+ fill: {
317
+ type: Boolean,
318
+ default: !1
319
+ },
320
+ weight: {},
321
+ grade: {},
322
+ decorative: {
323
+ type: Boolean,
324
+ default: !0
325
+ },
326
+ ariaLabel: {},
327
+ inline: {
328
+ type: Boolean,
329
+ default: !1
330
+ }
331
+ },
332
+ setup(e) {
333
+ Bt();
334
+ let a = e, o = t(() => typeof a.size == "string" ? a.size : void 0), s = t(() => typeof a.size == "number" ? {
335
+ width: `${a.size}px`,
336
+ height: `${a.size}px`
337
+ } : {}), c = t(() => {
338
+ let e = de(a.icon, a.fill);
339
+ return e || pe(a.icon), e;
340
+ });
341
+ return (t, a) => (p(), i("span", {
342
+ class: "Icon",
343
+ "data-size": o.value,
344
+ "data-inline": e.inline ? "true" : void 0,
345
+ style: f(s.value),
346
+ "aria-hidden": e.decorative ? !0 : void 0,
347
+ "aria-label": e.decorative ? void 0 : e.ariaLabel,
348
+ role: e.decorative ? void 0 : "img"
349
+ }, [c.value ? (p(), n(g(c.value), { key: 0 })) : r("", !0)], 12, Vt));
350
+ }
351
+ }), Z = /* @__PURE__ */ V(/* @__PURE__ */ c({
352
+ __name: "Hint",
353
+ props: { text: {} },
354
+ setup(e) {
355
+ return (t, r) => (p(), n(v(F), null, {
356
+ default: b(() => [s(v(I), {
357
+ "delay-duration": 0,
358
+ "disable-closing-trigger": ""
359
+ }, {
360
+ default: b(() => [s(v(L), { "as-child": "" }, {
361
+ default: b(() => [a("button", {
362
+ type: "button",
363
+ class: "HintTrigger",
364
+ "aria-label": "More info",
365
+ onPointerdown: r[0] ||= x(() => {}, ["prevent"])
366
+ }, [s(X, {
367
+ icon: "help",
368
+ size: 16
369
+ })], 32)]),
370
+ _: 1
371
+ }), s(v(P), null, {
372
+ default: b(() => [s(v(N), {
373
+ class: "HintContent",
374
+ side: "top",
375
+ "side-offset": 4
376
+ }, {
377
+ default: b(() => [o(_(e.text) + " ", 1), s(v(M), {
378
+ class: "HintArrow",
379
+ width: 10,
380
+ height: 5
381
+ })]),
382
+ _: 1
383
+ })]),
384
+ _: 1
385
+ })]),
386
+ _: 1
387
+ })]),
388
+ _: 1
389
+ }));
390
+ }
391
+ }), [["__scopeId", "data-v-9dbf1c25"]]), Ht = ["id", "for"], Q = /* @__PURE__ */ c({
392
+ __name: "FieldLabel",
393
+ props: {
394
+ label: {},
395
+ labelId: {},
396
+ hideLabel: { type: Boolean },
397
+ hint: {},
398
+ htmlFor: {}
399
+ },
400
+ setup(e) {
401
+ return (t, a) => e.label ? (p(), i("label", {
402
+ key: 0,
403
+ id: e.labelId,
404
+ for: e.htmlFor,
405
+ class: d({ "visually-hidden": e.hideLabel })
406
+ }, [o(_(e.label) + " ", 1), e.hint && !e.hideLabel ? (p(), n(Z, {
407
+ key: 0,
408
+ text: e.hint
409
+ }, null, 8, ["text"])) : r("", !0)], 10, Ht)) : r("", !0);
410
+ }
411
+ });
412
+ //#endregion
413
+ //#region src/_internal/field.ts
414
+ function $(e) {
415
+ let n = R(), r = `${n}-label`;
416
+ return {
417
+ id: n,
418
+ labelId: r,
419
+ ariaProps: t(() => ({
420
+ "aria-labelledby": e.label ? r : void 0,
421
+ "aria-label": e.label ? void 0 : e.ariaLabel
422
+ }))
423
+ };
424
+ }
425
+ //#endregion
426
+ //#region src/SelectBox/SelectBox.vue?vue&type=script&setup=true&lang.ts
427
+ var Ut = { class: "select-box" }, Wt = {
428
+ class: "select-icon",
429
+ "aria-hidden": "true"
430
+ }, Gt = {
431
+ class: "select-icon",
432
+ "aria-hidden": "true"
433
+ }, Kt = /* @__PURE__ */ V(/* @__PURE__ */ c({
434
+ __name: "SelectBox",
435
+ props: /* @__PURE__ */ l({
436
+ options: {},
437
+ placeholder: {},
438
+ autocomplete: { type: Boolean },
439
+ label: {},
440
+ hideLabel: { type: Boolean },
441
+ ariaLabel: {},
442
+ hint: {}
443
+ }, {
444
+ modelValue: {},
445
+ modelModifiers: {}
446
+ }),
447
+ emits: ["update:modelValue"],
448
+ setup(t) {
449
+ let r = y(t, "modelValue"), c = t, { id: l, labelId: d, ariaProps: f } = $(c);
450
+ function h(e) {
451
+ return c.options.find((t) => t.value === e)?.label ?? "";
452
+ }
453
+ return (c, g) => (p(), i("div", Ut, [s(Q, {
454
+ class: "select-label",
455
+ label: t.label,
456
+ "label-id": v(d),
457
+ "hide-label": t.hideLabel,
458
+ hint: t.hint,
459
+ "html-for": t.autocomplete ? `${v(l)}-input` : void 0
460
+ }, null, 8, [
461
+ "label",
462
+ "label-id",
463
+ "hide-label",
464
+ "hint",
465
+ "html-for"
466
+ ]), t.autocomplete ? (p(), n(v(se), {
467
+ key: 0,
468
+ modelValue: r.value,
469
+ "onUpdate:modelValue": g[0] ||= (e) => r.value = e,
470
+ "open-on-click": "",
471
+ class: "select-combobox-root"
472
+ }, {
473
+ default: b(() => [s(v(ee), { class: "select-anchor" }, {
474
+ default: b(() => [s(v(re), u({
475
+ id: `${v(l)}-input`,
476
+ class: "select-input",
477
+ "display-value": h,
478
+ placeholder: t.placeholder
479
+ }, v(f)), null, 16, ["id", "placeholder"]), s(v(ce), {
480
+ class: "select-icon-button",
481
+ "aria-label": "Toggle options"
482
+ }, {
483
+ default: b(() => [a("span", Wt, [s(X, {
484
+ icon: "keyboard_arrow_down",
485
+ size: 16
486
+ })])]),
487
+ _: 1
488
+ })]),
489
+ _: 1
490
+ }), s(v(oe), null, {
491
+ default: b(() => [s(v(te), {
492
+ class: "cfasim-listbox-content select-content-autocomplete",
493
+ position: "popper",
494
+ "side-offset": 4,
495
+ "body-lock": !1
496
+ }, {
497
+ default: b(() => [s(v(le), { class: "cfasim-listbox-viewport" }, {
498
+ default: b(() => [s(v(ne), { class: "cfasim-listbox-empty" }, {
499
+ default: b(() => [...g[2] ||= [o(" No matches ", -1)]]),
500
+ _: 1
501
+ }), (p(!0), i(e, null, m(t.options, (e) => (p(), n(v(ie), {
502
+ key: e.value,
503
+ value: e.value,
504
+ class: "cfasim-listbox-item"
505
+ }, {
506
+ default: b(() => [a("span", null, _(e.label), 1), s(v(ae), { class: "cfasim-listbox-indicator" }, {
507
+ default: b(() => [s(X, {
508
+ icon: "check",
509
+ size: 14
510
+ })]),
511
+ _: 1
512
+ })]),
513
+ _: 2
514
+ }, 1032, ["value"]))), 128))]),
515
+ _: 1
516
+ })]),
517
+ _: 1
518
+ })]),
519
+ _: 1
520
+ })]),
521
+ _: 1
522
+ }, 8, ["modelValue"])) : (p(), n(v(O), {
523
+ key: 1,
524
+ modelValue: r.value,
525
+ "onUpdate:modelValue": g[1] ||= (e) => r.value = e
526
+ }, {
527
+ default: b(() => [s(v(k), u({ class: "select-trigger" }, v(f)), {
528
+ default: b(() => [s(v(A), { placeholder: t.placeholder }, null, 8, ["placeholder"]), a("span", Gt, [s(X, {
529
+ icon: "keyboard_arrow_down",
530
+ size: 16
531
+ })])]),
532
+ _: 1
533
+ }, 16), s(v(D), null, {
534
+ default: b(() => [s(v(C), {
535
+ class: "cfasim-listbox-content select-content",
536
+ position: "popper",
537
+ "side-offset": 4,
538
+ "body-lock": !1
539
+ }, {
540
+ default: b(() => [s(v(j), { class: "cfasim-listbox-viewport" }, {
541
+ default: b(() => [(p(!0), i(e, null, m(t.options, (e) => (p(), n(v(w), {
542
+ key: e.value,
543
+ value: e.value,
544
+ class: "cfasim-listbox-item"
545
+ }, {
546
+ default: b(() => [s(v(E), null, {
547
+ default: b(() => [o(_(e.label), 1)]),
548
+ _: 2
549
+ }, 1024), s(v(T), { class: "cfasim-listbox-indicator" }, {
550
+ default: b(() => [s(X, {
551
+ icon: "check",
552
+ size: 14
553
+ })]),
554
+ _: 1
555
+ })]),
556
+ _: 2
557
+ }, 1032, ["value"]))), 128))]),
558
+ _: 1
559
+ })]),
560
+ _: 1
561
+ })]),
562
+ _: 1
563
+ })]),
564
+ _: 1
565
+ }, 8, ["modelValue"]))]));
566
+ }
567
+ }), [["__scopeId", "data-v-7fd46006"]]);
568
+ //#endregion
569
+ export { X as a, U as c, Z as i, H as l, $ as n, K as o, Q as r, G as s, Kt as t, V as u };
@@ -1,9 +1,8 @@
1
- type __VLS_Props = {
2
- label?: string;
3
- hideLabel?: boolean;
1
+ import { FieldProps } from '../_internal/field';
2
+ interface Props extends FieldProps {
4
3
  placeholder?: string;
5
- hint?: string;
6
- };
4
+ }
5
+ type __VLS_Props = Props;
7
6
  type __VLS_PublicProps = {
8
7
  modelValue?: string;
9
8
  } & __VLS_Props;
@@ -1,18 +1,16 @@
1
+ import { FieldProps } from '../_internal/field';
1
2
  export interface ToggleGroupOption {
2
3
  value: string;
3
4
  label: string;
4
5
  disabled?: boolean;
5
6
  }
6
- type __VLS_Props = {
7
+ interface Props extends FieldProps {
7
8
  options: ToggleGroupOption[];
8
9
  multiple?: boolean;
9
- label?: string;
10
- hideLabel?: boolean;
11
- ariaLabel?: string;
12
- hint?: string;
13
10
  disabled?: boolean;
14
11
  orientation?: "horizontal" | "vertical";
15
- };
12
+ }
13
+ type __VLS_Props = Props;
16
14
  type __VLS_PublicProps = {
17
15
  modelValue?: string | string[];
18
16
  } & __VLS_Props;
@@ -0,0 +1,10 @@
1
+ type __VLS_Props = {
2
+ label?: string;
3
+ labelId?: string;
4
+ hideLabel?: boolean;
5
+ hint?: string;
6
+ /** `for` attribute, for fields whose control is a real labelable element. */
7
+ htmlFor?: string;
8
+ };
9
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
10
+ export default _default;
@@ -0,0 +1,22 @@
1
+ /** Props shared by every labeled form field. */
2
+ export interface FieldProps {
3
+ label?: string;
4
+ /** Visually hide the label while keeping it for assistive tech. */
5
+ hideLabel?: boolean;
6
+ /** Accessible name used when no visible `label` is provided. */
7
+ ariaLabel?: string;
8
+ hint?: string;
9
+ }
10
+ /**
11
+ * Generated field/label ids plus the aria attributes that point a control
12
+ * at its label: `aria-labelledby` when a visible `label` exists, else
13
+ * `aria-label`. Spread onto the control with `v-bind="ariaProps.value"`.
14
+ */
15
+ export declare function useField(props: FieldProps): {
16
+ id: string;
17
+ labelId: string;
18
+ ariaProps: import('vue').ComputedRef<{
19
+ "aria-labelledby": string | undefined;
20
+ "aria-label": string | undefined;
21
+ }>;
22
+ };