@kuina-ui/vue 0.1.0 → 0.2.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 (39) hide show
  1. package/dist/{elements → components}/alert/Alert.vue.d.ts +12 -3
  2. package/dist/{elements → components}/alert/alert.theme.d.ts +1 -0
  3. package/dist/components/avatar-group/AvatarGroup.vue.d.ts +1 -1
  4. package/dist/components/menu/Menu.vue.d.ts +87 -0
  5. package/dist/components/menu/MenuItemRow.vue.d.ts +18 -0
  6. package/dist/components/menu/MenuPanel.vue.d.ts +24 -0
  7. package/dist/components/menu/index.d.ts +3 -0
  8. package/dist/components/menu/menu.theme.d.ts +109 -0
  9. package/dist/components/menu/menuContext.d.ts +27 -0
  10. package/dist/components/menu/menuEntries.d.ts +10 -0
  11. package/dist/components/text-field/TextField.vue.d.ts +1 -1
  12. package/dist/components/textarea/Textarea.vue.d.ts +1 -1
  13. package/dist/elements/avatar/Avatar.vue.d.ts +3 -3
  14. package/dist/elements/badge/Badge.vue.d.ts +2 -2
  15. package/dist/elements/button/Button.vue.d.ts +4 -4
  16. package/dist/elements/checkbox/Checkbox.vue.d.ts +2 -2
  17. package/dist/elements/radio-group/RadioGroup.vue.d.ts +1 -1
  18. package/dist/elements/switch/Switch.vue.d.ts +2 -2
  19. package/dist/index.d.ts +7 -2
  20. package/dist/index.js +1 -1
  21. package/dist/nuxt.js +13 -8
  22. package/dist/shared/composables/useApplePlatform.d.ts +2 -0
  23. package/dist/shared/composables/useDismissOnOutsidePointerDown.d.ts +9 -0
  24. package/dist/shared/composables/useFloatingPosition.d.ts +20 -0
  25. package/dist/shared/composables/useShortcuts.d.ts +9 -0
  26. package/dist/shared/types/floating-position.d.ts +28 -0
  27. package/dist/shared/types/shortcut.d.ts +28 -0
  28. package/dist/shared/utils/computeFloatingPosition.d.ts +5 -0
  29. package/dist/shared/utils/createShortcutHandler.d.ts +3 -0
  30. package/dist/shared/utils/createTypeaheadSearch.d.ts +2 -0
  31. package/dist/shared/utils/editableFieldGuard.d.ts +3 -0
  32. package/dist/shared/utils/flipFloatingPosition.d.ts +3 -0
  33. package/dist/shared/utils/formatShortcut.d.ts +2 -0
  34. package/dist/shared/utils/isApplePlatform.d.ts +2 -0
  35. package/dist/shared/utils/isExternalUrl.d.ts +2 -0
  36. package/dist/shared/utils/parseShortcut.d.ts +3 -0
  37. package/dist/{src-CcuBQU4y.js → src-Cn6KXW0m.js} +2798 -1683
  38. package/package.json +5 -2
  39. /package/dist/{elements → components}/alert/index.d.ts +0 -0
@@ -1,166 +1,453 @@
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 _, toValue as v, unref as y, useId as b, useModel as x, useSlots as S, vModelCheckbox as C, vModelDynamic as w, vModelRadio as T, vModelText as E, withCtx as D, withDirectives as O } from "vue";
2
- import { tv as k } from "tailwind-variants";
3
- import { CircleAlert as A, CircleCheck as ee, Info as j, TriangleAlert as M } from "lucide-vue-next";
1
+ import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, inject as d, mergeModels as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, provide as x, readonly as S, renderList as C, renderSlot as w, resolveComponent as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, toValue as k, unref as A, useId as j, useModel as M, useSlots as N, useTemplateRef as P, vModelCheckbox as F, vModelDynamic as I, vModelRadio as L, vModelText as R, watch as z, withCtx as B, withDirectives as V, withModifiers as ee } from "vue";
2
+ import { Check as te, ChevronRight as ne, CircleAlert as H, CircleCheck as re, Info as U, TriangleAlert as W, X as ie } from "lucide-vue-next";
3
+ import { tv as G } from "tailwind-variants";
4
4
  // \0rolldown/runtime.js
5
- var N = Object.defineProperty, te = (e, t) => {
5
+ var K = Object.defineProperty, ae = (e, t) => {
6
6
  let n = {};
7
- for (var r in e) N(n, r, {
7
+ for (var r in e) K(n, r, {
8
8
  get: e[r],
9
9
  enumerable: !0
10
10
  });
11
- return t || N(n, Symbol.toStringTag, { value: "Module" }), n;
12
- }, P = {
11
+ return t || K(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, q = {
13
13
  "3xs": {
14
- sizeVariable: "[--avatar-size:22px]",
15
- radius: "rounded-md"
14
+ height: "h-5.5",
15
+ width: "w-5.5",
16
+ gutter: "px-1.5",
17
+ pillGutter: "px-2",
18
+ radius: "rounded-md",
19
+ fontSize: "text-xs/none",
20
+ contentGap: "gap-0.75",
21
+ iconSize: "size-3.5",
22
+ leadingIconOffset: "-ml-px",
23
+ trailingIconOffset: "-mr-px",
24
+ loadingIndicatorSize: "text-[11px]"
16
25
  },
17
26
  "2xs": {
18
- sizeVariable: "[--avatar-size:24px]",
19
- radius: "rounded-md"
27
+ height: "h-6",
28
+ width: "w-6",
29
+ gutter: "px-2",
30
+ pillGutter: "px-2.75",
31
+ radius: "rounded-md",
32
+ fontSize: "text-xs/none",
33
+ contentGap: "gap-1",
34
+ iconSize: "size-4",
35
+ leadingIconOffset: "-ml-px",
36
+ trailingIconOffset: "-mr-px",
37
+ loadingIndicatorSize: "text-xs"
20
38
  },
21
39
  xs: {
22
- sizeVariable: "[--avatar-size:26px]",
23
- radius: "rounded-md"
40
+ height: "h-6.5",
41
+ width: "w-6.5",
42
+ gutter: "px-2",
43
+ pillGutter: "px-2.75",
44
+ radius: "rounded-md",
45
+ fontSize: "text-sm/none",
46
+ contentGap: "gap-1",
47
+ iconSize: "size-4",
48
+ leadingIconOffset: "-ml-px",
49
+ trailingIconOffset: "-mr-px",
50
+ loadingIndicatorSize: "text-[13px]"
24
51
  },
25
52
  sm: {
26
- sizeVariable: "[--avatar-size:28px]",
27
- radius: "rounded-md"
53
+ height: "h-7",
54
+ width: "w-7",
55
+ gutter: "px-2.5",
56
+ pillGutter: "px-3.25",
57
+ radius: "rounded-md",
58
+ fontSize: "text-sm/none",
59
+ contentGap: "gap-1",
60
+ iconSize: "size-4.5",
61
+ leadingIconOffset: "-ml-px",
62
+ trailingIconOffset: "-mr-px",
63
+ loadingIndicatorSize: "text-[15px]"
28
64
  },
29
65
  md: {
30
- sizeVariable: "[--avatar-size:32px]",
31
- radius: "rounded-lg"
66
+ height: "h-8",
67
+ width: "w-8",
68
+ gutter: "px-3",
69
+ pillGutter: "px-4",
70
+ radius: "rounded-lg",
71
+ fontSize: "text-sm/none",
72
+ contentGap: "gap-1.5",
73
+ iconSize: "size-4.5",
74
+ leadingIconOffset: "-ml-px",
75
+ trailingIconOffset: "-mr-px",
76
+ loadingIndicatorSize: "text-base"
32
77
  },
33
78
  lg: {
34
- sizeVariable: "[--avatar-size:36px]",
35
- radius: "rounded-lg"
79
+ height: "h-9",
80
+ width: "w-9",
81
+ gutter: "px-3",
82
+ pillGutter: "px-4",
83
+ radius: "rounded-lg",
84
+ fontSize: "text-sm/none",
85
+ contentGap: "gap-1.5",
86
+ iconSize: "size-4.5",
87
+ leadingIconOffset: "-ml-px",
88
+ trailingIconOffset: "-mr-px",
89
+ loadingIndicatorSize: "text-base"
36
90
  },
37
91
  xl: {
38
- sizeVariable: "[--avatar-size:40px]",
39
- radius: "rounded-[10px]"
92
+ height: "h-10",
93
+ width: "w-10",
94
+ gutter: "px-3.5",
95
+ pillGutter: "px-4.75",
96
+ radius: "rounded-[10px]",
97
+ fontSize: "text-sm/none",
98
+ contentGap: "gap-1.5",
99
+ iconSize: "size-4.5",
100
+ leadingIconOffset: "-ml-px",
101
+ trailingIconOffset: "-mr-px",
102
+ loadingIndicatorSize: "text-lg"
40
103
  },
41
104
  "2xl": {
42
- sizeVariable: "[--avatar-size:44px]",
43
- radius: "rounded-xl"
105
+ height: "h-11",
106
+ width: "w-11",
107
+ gutter: "px-3.5",
108
+ pillGutter: "px-4.75",
109
+ radius: "rounded-xl",
110
+ fontSize: "text-base/none",
111
+ contentGap: "gap-1.5",
112
+ iconSize: "size-5",
113
+ leadingIconOffset: "-ml-0.5",
114
+ trailingIconOffset: "-mr-0.5",
115
+ loadingIndicatorSize: "text-lg"
44
116
  },
45
117
  "3xl": {
46
- sizeVariable: "[--avatar-size:48px]",
47
- radius: "rounded-xl"
118
+ height: "h-12",
119
+ width: "w-12",
120
+ gutter: "px-4",
121
+ pillGutter: "px-5.25",
122
+ radius: "rounded-xl",
123
+ fontSize: "text-base/none",
124
+ contentGap: "gap-1.5",
125
+ iconSize: "size-5",
126
+ leadingIconOffset: "-ml-0.5",
127
+ trailingIconOffset: "-mr-0.5",
128
+ loadingIndicatorSize: "text-xl"
48
129
  },
49
130
  "4xl": {
50
- sizeVariable: "[--avatar-size:56px]",
51
- radius: "rounded-2xl"
52
- },
53
- "5xl": {
54
- sizeVariable: "[--avatar-size:64px]",
55
- radius: "rounded-2xl"
56
- },
57
- "6xl": {
58
- sizeVariable: "[--avatar-size:80px]",
59
- radius: "rounded-3xl"
131
+ height: "h-14",
132
+ width: "w-14",
133
+ gutter: "px-4.5",
134
+ pillGutter: "px-6",
135
+ radius: "rounded-2xl",
136
+ fontSize: "text-base/none",
137
+ contentGap: "gap-3",
138
+ iconSize: "size-6",
139
+ leadingIconOffset: "-ml-0.5",
140
+ trailingIconOffset: "-mr-0.5",
141
+ loadingIndicatorSize: "text-2xl"
60
142
  }
61
- }, F = Object.keys(P), I = {
62
- soft: {
63
- primary: "light:bg-stone-200 dark:bg-stone-700",
64
- secondary: "bg-secondary/16 text-secondary",
65
- gray: "light:bg-stone-200 dark:bg-stone-700",
66
- success: "light:bg-green-100 light:text-green-700 dark:bg-green-950 dark:text-green-400",
67
- info: "light:bg-blue-100 light:text-blue-700 dark:bg-blue-950 dark:text-blue-300",
68
- discovery: "light:bg-purple-100 light:text-purple-700 dark:bg-purple-950 dark:text-purple-300",
69
- danger: "light:bg-red-100 light:text-red-700 dark:bg-red-950 dark:text-red-400"
70
- },
143
+ }, J = Object.keys(q), Y = {
144
+ surface: "light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
145
+ selectedSurface: "light:before:bg-stone-950/12 dark:before:bg-stone-200/16",
146
+ text: "",
147
+ selectedText: "",
148
+ interaction: "light:hover:before:bg-stone-950/12 dark:hover:before:bg-stone-200/16 light:active:before:bg-stone-950/16 dark:active:before:bg-stone-200/20"
149
+ }, X = {
71
150
  solid: {
72
- primary: "light:bg-neutral-900 light:text-white dark:bg-stone-200 dark:text-stone-950",
73
- secondary: "bg-secondary light:text-white dark:text-stone-950",
74
- gray: "light:bg-stone-600 light:text-white dark:bg-stone-600 dark:text-white",
75
- success: "light:bg-green-600 light:text-white dark:bg-green-600 dark:text-white",
76
- info: "light:bg-blue-600 light:text-white dark:bg-blue-500 dark:text-white",
77
- discovery: "light:bg-purple-600 light:text-white dark:bg-purple-500 dark:text-white",
78
- danger: "light:bg-red-600 light:text-white dark:bg-red-600 dark:text-white"
79
- }
80
- }, ne = Object.keys(I), re = Object.keys(I.soft), ie = Object.fromEntries(F.map((e) => [e, { base: P[e].sizeVariable }])), ae = F.flatMap((e) => [{
81
- size: e,
82
- pill: !0,
83
- class: { base: "rounded-full" }
84
- }, {
85
- size: e,
86
- pill: !1,
87
- class: { base: P[e].radius }
88
- }]), oe = ne.flatMap((e) => re.map((t) => ({
89
- variant: e,
90
- color: t,
91
- class: { base: I[e][t] }
92
- }))), se = k({
93
- slots: {
94
- base: "relative inline-flex size-(--avatar-size) shrink-0 items-center justify-center overflow-hidden select-none",
95
- image: "absolute inset-0 size-full rounded-[inherit] object-cover",
96
- icon: "size-[calc(var(--avatar-size)*0.55)] shrink-0",
97
- label: "font-semibold",
98
- overflowSign: "relative -top-[calc(var(--avatar-size)/24)] -ml-px"
99
- },
100
- variants: {
101
- variant: {
102
- soft: "",
103
- solid: ""
151
+ primary: {
152
+ surface: "before:bg-primary",
153
+ selectedSurface: "before:bg-primary before:brightness-90",
154
+ text: "light:text-white dark:text-stone-950",
155
+ selectedText: "light:text-white dark:text-stone-950",
156
+ interaction: "hover:before:brightness-90"
104
157
  },
105
- color: {
106
- primary: "",
107
- secondary: "",
108
- gray: "",
109
- success: "",
110
- info: "",
111
- discovery: "",
112
- danger: ""
158
+ secondary: {
159
+ surface: "before:bg-secondary",
160
+ selectedSurface: "before:bg-secondary before:brightness-90",
161
+ text: "light:text-white dark:text-stone-950",
162
+ selectedText: "light:text-white dark:text-stone-950",
163
+ interaction: "hover:before:brightness-90"
113
164
  },
114
- size: ie,
115
- pill: { true: "" },
116
- hasImage: { true: { base: "after:absolute after:inset-0 after:rounded-[inherit] after:border light:after:border-black/4 dark:after:border-white/15" } },
117
- isLink: { true: { base: "outline-primary focus-visible:outline-2 focus-visible:outline-offset-2" } },
118
- isOverflow: { true: { label: "flex" } },
119
- labelCharacterCount: {
120
- one: "",
121
- two: "",
122
- many: { label: "text-[length:calc(var(--avatar-size)*0.3)]/none" }
165
+ neutral: {
166
+ surface: "light:before:bg-neutral-900 dark:before:bg-stone-200",
167
+ selectedSurface: "light:before:bg-neutral-800 dark:before:bg-stone-300",
168
+ text: "light:text-white dark:text-stone-950",
169
+ selectedText: "light:text-white dark:text-stone-950",
170
+ interaction: "light:hover:before:bg-neutral-800 dark:hover:before:bg-stone-300 light:active:before:bg-neutral-700"
171
+ },
172
+ gray: {
173
+ surface: "light:before:bg-stone-600 dark:before:bg-stone-700",
174
+ selectedSurface: "light:before:bg-stone-700 dark:before:bg-stone-600",
175
+ text: "light:text-white dark:text-white",
176
+ selectedText: "light:text-white dark:text-white",
177
+ interaction: "light:hover:before:bg-stone-700 dark:hover:before:bg-stone-600 light:active:before:bg-stone-800"
178
+ },
179
+ danger: {
180
+ surface: "light:before:bg-red-600 dark:before:bg-red-600",
181
+ selectedSurface: "light:before:bg-red-700 dark:before:bg-red-700",
182
+ text: "light:text-white dark:text-white",
183
+ selectedText: "light:text-white dark:text-white",
184
+ interaction: "light:hover:before:bg-red-700 dark:hover:before:bg-red-700"
123
185
  }
124
186
  },
125
- compoundVariants: [
126
- ...ae,
127
- ...oe,
128
- {
129
- isOverflow: !1,
130
- labelCharacterCount: "one",
131
- class: { label: "text-[length:calc(var(--avatar-size)*0.5)]/none" }
132
- },
133
- {
134
- isOverflow: !1,
135
- labelCharacterCount: "two",
136
- class: { label: "text-[length:calc(var(--avatar-size)*0.4)]/none" }
187
+ soft: {
188
+ primary: {
189
+ surface: "before:bg-primary/16",
190
+ selectedSurface: "before:bg-primary/30",
191
+ text: "text-primary",
192
+ selectedText: "text-primary",
193
+ interaction: "hover:before:bg-primary/30"
137
194
  },
138
- {
139
- isOverflow: !0,
140
- labelCharacterCount: "one",
141
- class: { label: "text-[length:calc(var(--avatar-size)*0.45)]/none" }
195
+ secondary: {
196
+ surface: "before:bg-secondary/16",
197
+ selectedSurface: "before:bg-secondary/30",
198
+ text: "text-secondary",
199
+ selectedText: "text-secondary",
200
+ interaction: "hover:before:bg-secondary/30"
142
201
  },
143
- {
144
- isOverflow: !0,
145
- labelCharacterCount: "two",
146
- class: { label: "text-[length:calc(var(--avatar-size)*0.37)]/none" }
202
+ neutral: Y,
203
+ gray: Y,
204
+ danger: {
205
+ surface: "light:before:bg-red-500/16 dark:before:bg-red-400/16",
206
+ selectedSurface: "light:before:bg-red-500/30 dark:before:bg-red-400/30",
207
+ text: "light:text-red-600 dark:text-red-400",
208
+ selectedText: "light:text-red-600 dark:text-red-400",
209
+ interaction: "light:hover:before:bg-red-500/30 dark:hover:before:bg-red-400/30"
210
+ }
211
+ },
212
+ outline: {
213
+ primary: {
214
+ surface: "before:border before:border-primary",
215
+ selectedSurface: "before:border before:border-primary before:bg-primary/8",
216
+ text: "text-primary",
217
+ selectedText: "text-primary",
218
+ interaction: "hover:before:bg-primary/8"
219
+ },
220
+ secondary: {
221
+ surface: "before:border before:border-secondary",
222
+ selectedSurface: "before:border before:border-secondary before:bg-secondary/8",
223
+ text: "text-secondary",
224
+ selectedText: "text-secondary",
225
+ interaction: "hover:before:bg-secondary/8"
226
+ },
227
+ neutral: {
228
+ surface: "before:border light:before:border-stone-950/16 dark:before:border-stone-200/25",
229
+ selectedSurface: "before:border light:before:border-stone-950/20 dark:before:border-stone-200/30 light:before:bg-stone-950/2 dark:before:bg-stone-200/4",
230
+ text: "",
231
+ selectedText: "",
232
+ interaction: "light:hover:before:border-stone-950/20 dark:hover:before:border-stone-200/30 light:hover:before:bg-stone-950/2 dark:hover:before:bg-stone-200/4 light:active:before:bg-stone-950/4 dark:active:before:bg-stone-200/6"
233
+ },
234
+ gray: {
235
+ surface: "before:border light:before:border-stone-950/16 dark:before:border-stone-200/25",
236
+ selectedSurface: "before:border light:before:border-stone-950/20 dark:before:border-stone-200/30 light:before:bg-stone-950/2 dark:before:bg-stone-200/4",
237
+ text: "text-muted",
238
+ selectedText: "",
239
+ interaction: "hover:text-inherit light:hover:before:border-stone-950/20 dark:hover:before:border-stone-200/30 light:hover:before:bg-stone-950/2 dark:hover:before:bg-stone-200/4 light:active:before:bg-stone-950/4 dark:active:before:bg-stone-200/6"
240
+ },
241
+ danger: {
242
+ surface: "before:border light:before:border-red-600 dark:before:border-red-400",
243
+ selectedSurface: "before:border light:before:border-red-600 dark:before:border-red-400 light:before:bg-red-500/8 dark:before:bg-red-400/8",
244
+ text: "light:text-red-600 dark:text-red-400",
245
+ selectedText: "light:text-red-600 dark:text-red-400",
246
+ interaction: "light:hover:before:bg-red-500/8 dark:hover:before:bg-red-400/8"
247
+ }
248
+ },
249
+ ghost: {
250
+ primary: {
251
+ surface: "before:scale-96 before:opacity-0 before:bg-primary/16",
252
+ selectedSurface: "before:bg-primary/16",
253
+ text: "text-primary",
254
+ selectedText: "text-primary",
255
+ interaction: "hover:before:scale-100 hover:before:opacity-100"
256
+ },
257
+ secondary: {
258
+ surface: "before:scale-96 before:opacity-0 before:bg-secondary/16",
259
+ selectedSurface: "before:bg-secondary/16",
260
+ text: "text-secondary",
261
+ selectedText: "text-secondary",
262
+ interaction: "hover:before:scale-100 hover:before:opacity-100"
263
+ },
264
+ neutral: {
265
+ surface: "before:scale-96 before:opacity-0 light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
266
+ selectedSurface: "light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
267
+ text: "",
268
+ selectedText: "",
269
+ interaction: "hover:before:scale-100 hover:before:opacity-100 light:active:before:bg-stone-950/12 dark:active:before:bg-stone-200/16"
270
+ },
271
+ gray: {
272
+ surface: "before:scale-96 before:opacity-0 light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
273
+ selectedSurface: "light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
274
+ text: "text-muted",
275
+ selectedText: "",
276
+ interaction: "hover:text-inherit hover:before:scale-100 hover:before:opacity-100 light:active:before:bg-stone-950/12 dark:active:before:bg-stone-200/16"
277
+ },
278
+ danger: {
279
+ surface: "before:scale-96 before:opacity-0 light:before:bg-red-500/16 dark:before:bg-red-400/16",
280
+ selectedSurface: "light:before:bg-red-500/16 dark:before:bg-red-400/16",
281
+ text: "light:text-red-600 dark:text-red-400",
282
+ selectedText: "light:text-red-600 dark:text-red-400",
283
+ interaction: "hover:before:scale-100 hover:before:opacity-100"
284
+ }
285
+ }
286
+ }, oe = Object.keys(X), se = Object.keys(X.solid);
287
+ function ce(e) {
288
+ return {
289
+ base: [e.height, e.fontSize],
290
+ content: e.contentGap,
291
+ leadingIcon: e.iconSize,
292
+ trailingIcon: e.iconSize,
293
+ loadingIndicator: e.loadingIndicatorSize
294
+ };
295
+ }
296
+ function le(e) {
297
+ let t = q[e];
298
+ return [
299
+ {
300
+ size: e,
301
+ square: !1,
302
+ pill: !0,
303
+ class: { base: ["rounded-full", t.pillGutter] }
304
+ },
305
+ {
306
+ size: e,
307
+ square: !1,
308
+ pill: !1,
309
+ class: { base: [t.radius, t.gutter] }
310
+ },
311
+ {
312
+ size: e,
313
+ square: !0,
314
+ class: { base: t.width }
315
+ },
316
+ {
317
+ size: e,
318
+ square: !0,
319
+ pill: !1,
320
+ class: { base: t.radius }
321
+ },
322
+ {
323
+ size: e,
324
+ square: !1,
325
+ class: {
326
+ leadingIcon: t.leadingIconOffset,
327
+ trailingIcon: t.trailingIconOffset
328
+ }
329
+ }
330
+ ];
331
+ }
332
+ function ue(e, t) {
333
+ let n = X[e][t];
334
+ return [
335
+ {
336
+ variant: e,
337
+ color: t,
338
+ disabled: !1,
339
+ selected: !1,
340
+ class: { base: [n.surface, n.text] }
341
+ },
342
+ {
343
+ variant: e,
344
+ color: t,
345
+ disabled: !1,
346
+ selected: !0,
347
+ class: { base: [n.selectedSurface, n.selectedText] }
348
+ },
349
+ {
350
+ variant: e,
351
+ color: t,
352
+ disabled: !1,
353
+ loading: !1,
354
+ class: { base: n.interaction }
355
+ }
356
+ ];
357
+ }
358
+ var de = Object.fromEntries(J.map((e) => [e, ce(q[e])])), fe = J.flatMap(le), pe = oe.flatMap((e) => se.flatMap((t) => ue(e, t))), me = G({
359
+ slots: {
360
+ base: "relative inline-flex shrink-0 cursor-pointer items-center justify-center font-medium whitespace-nowrap outline-primary transition-colors duration-150 select-none before:absolute before:inset-0 before:rounded-[inherit] before:transition before:duration-150 focus-visible:outline-2",
361
+ loadingOverlay: "absolute inset-0 flex items-center justify-center",
362
+ loadingIndicator: "loading-indicator",
363
+ content: "relative flex size-full items-center justify-center",
364
+ label: "",
365
+ leadingIcon: "shrink-0",
366
+ trailingIcon: "shrink-0"
367
+ },
368
+ variants: {
369
+ variant: {
370
+ solid: { base: "focus-visible:outline-offset-2" },
371
+ soft: { base: "focus-visible:outline-offset-2" },
372
+ outline: { base: "focus-visible:-outline-offset-1" },
373
+ ghost: { base: "focus-visible:-outline-offset-1" }
374
+ },
375
+ color: {
376
+ primary: "",
377
+ secondary: "",
378
+ neutral: "",
379
+ gray: "",
380
+ danger: ""
381
+ },
382
+ size: de,
383
+ square: { true: "" },
384
+ pill: { true: "" },
385
+ block: { true: { base: "w-full" } },
386
+ disabled: { true: { base: "cursor-not-allowed light:text-stone-400 dark:text-stone-500" } },
387
+ loading: { true: {
388
+ base: "pointer-events-none",
389
+ content: "opacity-0"
390
+ } },
391
+ selected: { true: "" }
392
+ },
393
+ compoundVariants: [
394
+ ...fe,
395
+ ...pe,
396
+ {
397
+ square: !0,
398
+ pill: !0,
399
+ class: { base: "rounded-full" }
400
+ },
401
+ {
402
+ disabled: !0,
403
+ variant: ["solid", "soft"],
404
+ class: { base: "light:before:bg-stone-950/5 dark:before:bg-stone-200/5" }
405
+ },
406
+ {
407
+ disabled: !0,
408
+ variant: "outline",
409
+ class: { base: "before:border light:before:border-stone-950/6 dark:before:border-stone-200/6" }
410
+ },
411
+ {
412
+ disabled: !1,
413
+ loading: !1,
414
+ square: !0,
415
+ class: { base: "active:before:scale-96" }
416
+ },
417
+ {
418
+ disabled: !1,
419
+ loading: !1,
420
+ square: !1,
421
+ block: !0,
422
+ class: { base: "active:before:scale-[0.995]" }
423
+ },
424
+ {
425
+ disabled: !1,
426
+ loading: !1,
427
+ square: !1,
428
+ block: !1,
429
+ class: { base: "active:before:scale-97" }
147
430
  }
148
431
  ]
149
- }), ce = ["src"], L = /* @__PURE__ */ c({
150
- __name: "Avatar",
432
+ }), Z = /* @__PURE__ */ l({
433
+ __name: "Button",
151
434
  props: {
152
- name: { default: "" },
153
- imageUrl: {},
154
- icon: {},
155
- initials: {},
156
- overflowCount: { default: 0 },
157
- variant: { default: "soft" },
158
- color: { default: "gray" },
435
+ label: {},
436
+ variant: { default: "solid" },
437
+ color: { default: "neutral" },
159
438
  size: { default: "md" },
439
+ leadingIcon: {},
440
+ trailingIcon: {},
441
+ square: { type: Boolean },
160
442
  pill: {
161
443
  type: Boolean,
162
444
  default: !0
163
445
  },
446
+ block: { type: Boolean },
447
+ disabled: { type: Boolean },
448
+ loading: { type: Boolean },
449
+ selected: { type: Boolean },
450
+ type: { default: "button" },
164
451
  href: {},
165
452
  ui: {},
166
453
  class: { type: [
@@ -172,73 +459,157 @@ var N = Object.defineProperty, te = (e, t) => {
172
459
  ] }
173
460
  },
174
461
  setup(e) {
175
- let r = e, s = t(() => r.overflowCount > 0), c = t(() => r.overflowCount >= 1e6 ? `${Math.round(r.overflowCount / 1e6)}m` : r.overflowCount >= 1e3 ? `${Math.round(r.overflowCount / 1e3)}k` : String(r.overflowCount)), l = t(() => r.initials || r.name.charAt(0).toUpperCase()), f = t(() => r.name || (s.value ? `${r.overflowCount} more` : "")), m = t(() => {
176
- let e = s.value ? c.value.length : l.value.length;
177
- return e <= 1 ? "one" : e === 2 ? "two" : "many";
178
- }), h = t(() => se({
179
- variant: r.variant,
180
- color: r.color,
181
- size: r.size,
182
- pill: r.pill,
183
- hasImage: !!r.imageUrl,
184
- isLink: !!r.href,
185
- isOverflow: s.value,
186
- labelCharacterCount: m.value
187
- })), v = t(() => r.href ? "a" : "span"), y = t(() => r.href ? {
188
- href: r.href,
189
- "aria-label": f.value || void 0
190
- } : f.value ? {
191
- role: "img",
192
- "aria-label": f.value
193
- } : { "aria-hidden": "true" });
194
- return (t, f) => (p(), n(g(v.value), u(y.value, { class: h.value.base({ class: [e.ui?.base, r.class] }) }), {
195
- default: D(() => [e.imageUrl ? (p(), i("img", {
462
+ let t = e, c = n(() => me({
463
+ variant: t.variant,
464
+ color: t.color,
465
+ size: t.size,
466
+ square: t.square,
467
+ pill: t.pill,
468
+ block: t.block,
469
+ disabled: t.disabled,
470
+ loading: t.loading,
471
+ selected: t.selected
472
+ })), l = n(() => t.href ? "a" : "button"), u = n(() => {
473
+ let e = t.square ? { "aria-label": t.label } : {};
474
+ return t.href ? t.disabled ? {
475
+ ...e,
476
+ role: "link",
477
+ "aria-disabled": "true"
478
+ } : {
479
+ ...e,
480
+ href: t.href
481
+ } : {
482
+ ...e,
483
+ type: t.type,
484
+ disabled: t.disabled || t.loading,
485
+ "aria-busy": t.loading || void 0,
486
+ "aria-pressed": t.selected || void 0
487
+ };
488
+ });
489
+ return (n, d) => (b(), r(E(l.value), p(u.value, { class: c.value.base({ class: [e.ui?.base, t.class] }) }), {
490
+ default: B(() => [e.loading ? (b(), a("span", {
196
491
  key: 0,
197
- src: e.imageUrl,
198
- alt: "",
199
- class: d(h.value.image({ class: e.ui?.image }))
200
- }, null, 10, ce)) : e.icon ? (p(), n(g(e.icon), {
201
- key: 1,
202
- class: d(h.value.icon({ class: e.ui?.icon }))
203
- }, null, 8, ["class"])) : s.value ? (p(), i("span", {
204
- key: 2,
205
- "aria-hidden": "true",
206
- class: d(h.value.label({ class: e.ui?.label }))
207
- }, [a("span", { class: d(h.value.overflowSign({ class: e.ui?.overflowSign })) }, "+", 2), o(" " + _(c.value), 1)], 2)) : (p(), i("span", {
208
- key: 3,
209
- "aria-hidden": "true",
210
- class: d(h.value.label({ class: e.ui?.label }))
211
- }, _(l.value), 3))]),
212
- _: 1
492
+ class: h(c.value.loadingOverlay({ class: e.ui?.loadingOverlay }))
493
+ }, [o("span", { class: h(c.value.loadingIndicator({ class: e.ui?.loadingIndicator })) }, null, 2)], 2)) : i("", !0), o("span", { class: h(c.value.content({ class: e.ui?.content })) }, [
494
+ e.leadingIcon ? (b(), r(E(e.leadingIcon), {
495
+ key: 0,
496
+ class: h(c.value.leadingIcon({ class: e.ui?.leadingIcon }))
497
+ }, null, 8, ["class"])) : i("", !0),
498
+ !e.square && (e.label || n.$slots.default) ? (b(), a("span", {
499
+ key: 1,
500
+ class: h(c.value.label({ class: e.ui?.label }))
501
+ }, [w(n.$slots, "default", {}, () => [s(O(e.label), 1)])], 2)) : i("", !0),
502
+ e.trailingIcon && !e.square ? (b(), r(E(e.trailingIcon), {
503
+ key: 2,
504
+ class: h(c.value.trailingIcon({ class: e.ui?.trailingIcon }))
505
+ }, null, 8, ["class"])) : i("", !0)
506
+ ], 2)]),
507
+ _: 3
213
508
  }, 16, ["class"]));
214
509
  }
215
- }), le = k({
216
- slots: { base: "flex *:ring-3" },
510
+ }), he = {
511
+ outline: {
512
+ primary: "inset-ring inset-ring-line",
513
+ success: "inset-ring light:inset-ring-green-600 light:text-green-700 dark:inset-ring-green-500 dark:text-green-400",
514
+ warning: "inset-ring light:inset-ring-orange-600 light:text-orange-700 dark:inset-ring-orange-500 dark:text-orange-400",
515
+ caution: "inset-ring light:inset-ring-yellow-600 light:text-yellow-700 dark:inset-ring-yellow-500 dark:text-yellow-400",
516
+ danger: "inset-ring light:inset-ring-red-600 light:text-red-600 dark:inset-ring-red-500 dark:text-red-400",
517
+ info: "inset-ring light:inset-ring-blue-600 light:text-blue-600 dark:inset-ring-blue-400 dark:text-blue-300",
518
+ discovery: "inset-ring light:inset-ring-purple-600 light:text-purple-600 dark:inset-ring-purple-400 dark:text-purple-300"
519
+ },
520
+ soft: {
521
+ primary: "inset-ring light:bg-stone-950/4 light:inset-ring-stone-950/6 dark:bg-white/6 dark:inset-ring-white/8",
522
+ success: "inset-ring light:bg-green-500/6 light:inset-ring-green-500/16 light:text-green-700 dark:bg-green-400/10 dark:inset-ring-green-400/20 dark:text-green-400",
523
+ warning: "inset-ring light:bg-orange-500/6 light:inset-ring-orange-500/16 light:text-orange-700 dark:bg-orange-400/10 dark:inset-ring-orange-400/20 dark:text-orange-400",
524
+ caution: "inset-ring light:bg-yellow-500/8 light:inset-ring-yellow-500/20 light:text-yellow-800 dark:bg-yellow-400/10 dark:inset-ring-yellow-400/20 dark:text-yellow-400",
525
+ danger: "inset-ring light:bg-red-500/6 light:inset-ring-red-500/16 light:text-red-600 dark:bg-red-400/10 dark:inset-ring-red-400/20 dark:text-red-400",
526
+ info: "inset-ring light:bg-blue-500/6 light:inset-ring-blue-500/16 light:text-blue-600 dark:bg-blue-400/10 dark:inset-ring-blue-400/20 dark:text-blue-300",
527
+ discovery: "inset-ring light:bg-purple-500/6 light:inset-ring-purple-500/16 light:text-purple-600 dark:bg-purple-400/10 dark:inset-ring-purple-400/20 dark:text-purple-300"
528
+ },
529
+ solid: {
530
+ primary: "light:bg-neutral-900 light:text-white dark:bg-stone-200 dark:text-stone-950",
531
+ success: "light:bg-green-600 light:text-white dark:bg-green-600 dark:text-white",
532
+ warning: "light:bg-orange-600 light:text-white dark:bg-orange-600 dark:text-white",
533
+ caution: "light:bg-yellow-700 light:text-white dark:bg-yellow-700 dark:text-white",
534
+ danger: "light:bg-red-600 light:text-white dark:bg-red-600 dark:text-white",
535
+ info: "light:bg-blue-600 light:text-white dark:bg-blue-500 dark:text-white",
536
+ discovery: "light:bg-purple-600 light:text-white dark:bg-purple-500 dark:text-white"
537
+ }
538
+ }, ge = Object.keys(he), _e = Object.keys(he.outline), ve = ge.flatMap((e) => _e.map((t) => ({
539
+ variant: e,
540
+ color: t,
541
+ class: { root: he[e][t] }
542
+ }))), ye = G({
543
+ slots: {
544
+ root: "@container w-full rounded-xl p-4 text-sm leading-5",
545
+ body: "flex gap-3",
546
+ icon: "size-5 shrink-0",
547
+ content: "min-w-0 flex-1",
548
+ wrapper: "min-w-0 flex-1",
549
+ title: "font-semibold text-pretty",
550
+ description: "text-pretty",
551
+ actions: "flex shrink-0 gap-2",
552
+ closeButton: "shrink-0"
553
+ },
217
554
  variants: {
218
- stack: {
219
- start: { base: "flex-row-reverse justify-end *:not-first:-me-[calc(var(--avatar-size)/4)]" },
220
- end: { base: "*:not-first:-ms-[calc(var(--avatar-size)/4)]" }
555
+ variant: {
556
+ outline: "",
557
+ soft: "",
558
+ solid: ""
221
559
  },
222
- surface: {
223
- widget: { base: "*:ring-widget" },
224
- canvas: { base: "*:ring-canvas" }
560
+ color: {
561
+ primary: "",
562
+ success: "",
563
+ warning: "",
564
+ caution: "",
565
+ danger: "",
566
+ info: "",
567
+ discovery: ""
225
568
  },
226
- hasOverflow: { true: "" }
569
+ actionsPlacement: {
570
+ end: "",
571
+ bottom: ""
572
+ },
573
+ hasActions: {
574
+ true: "",
575
+ false: { body: "items-center" }
576
+ },
577
+ hasTitle: { true: { description: "mt-0.5" } }
227
578
  },
228
- compoundVariants: [{
229
- stack: "start",
230
- hasOverflow: !0,
231
- class: { base: "*:first:z-10" }
232
- }]
233
- }), ue = ["role", "aria-label"], R = /* @__PURE__ */ c({
234
- __name: "AvatarGroup",
235
- props: {
236
- avatars: {},
237
- label: {},
238
- size: { default: "md" },
239
- stack: { default: "start" },
240
- overflowCount: { default: 0 },
241
- surface: { default: "widget" },
579
+ compoundVariants: [
580
+ ...ve,
581
+ {
582
+ hasActions: !0,
583
+ actionsPlacement: "end",
584
+ class: {
585
+ body: "items-start @md:items-center",
586
+ content: "@md:flex @md:items-center @md:justify-between",
587
+ actions: "mt-4 @md:mt-0 @md:ml-4"
588
+ }
589
+ },
590
+ {
591
+ hasActions: !0,
592
+ actionsPlacement: "bottom",
593
+ class: {
594
+ body: "items-start",
595
+ actions: "mt-4"
596
+ }
597
+ }
598
+ ]
599
+ }), be = ["role"], xe = /* @__PURE__ */ l({
600
+ __name: "Alert",
601
+ props: /*@__PURE__*/ f({
602
+ title: {},
603
+ description: {},
604
+ variant: { default: "outline" },
605
+ color: { default: "primary" },
606
+ icon: {},
607
+ showIcon: {
608
+ type: Boolean,
609
+ default: !0
610
+ },
611
+ actionsPlacement: { default: "end" },
612
+ closable: { type: Boolean },
242
613
  ui: {},
243
614
  class: { type: [
244
615
  Array,
@@ -247,411 +618,1274 @@ var N = Object.defineProperty, te = (e, t) => {
247
618
  Number,
248
619
  Boolean
249
620
  ] }
250
- },
251
- setup(r) {
252
- let a = r, o = t(() => a.overflowCount > 0), s = t(() => {
253
- let e = (o.value ? [...a.avatars, { overflowCount: a.overflowCount }] : [...a.avatars]).map((e, t) => ({
254
- avatarProps: e,
255
- avatarPosition: t
256
- }));
257
- return a.stack === "start" ? e.reverse() : e;
258
- }), c = t(() => le({
259
- stack: a.stack,
260
- surface: a.surface,
261
- hasOverflow: o.value
621
+ }, {
622
+ open: {
623
+ type: Boolean,
624
+ default: !0
625
+ },
626
+ openModifiers: {}
627
+ }),
628
+ emits: ["update:open"],
629
+ setup(e) {
630
+ let t = e, c = M(e, "open"), l = N(), u = {
631
+ warning: W,
632
+ caution: W,
633
+ danger: W,
634
+ success: re
635
+ }, d = n(() => t.icon ?? u[t.color] ?? U), f = n(() => !!(t.title || l.title)), p = n(() => !!(t.description || l.description)), m = n(() => !!l.actions), g = n(() => ye({
636
+ variant: t.variant,
637
+ color: t.color,
638
+ actionsPlacement: t.actionsPlacement,
639
+ hasActions: m.value,
640
+ hasTitle: f.value
262
641
  }));
263
- return (t, o) => (p(), i("div", {
264
- role: r.label ? "group" : void 0,
265
- "aria-label": r.label || void 0,
266
- class: d(c.value.base({ class: [r.ui?.base, a.class] }))
267
- }, [(p(!0), i(e, null, m(s.value, (e) => (p(), n(y(L), u({ key: e.avatarPosition }, { ref_for: !0 }, e.avatarProps, { size: r.size }), null, 16, ["size"]))), 128))], 10, ue));
642
+ return (n, l) => c.value ? (b(), a("div", {
643
+ key: 0,
644
+ role: e.color === "danger" ? "alert" : void 0,
645
+ class: h(g.value.root({ class: [e.ui?.root, t.class] }))
646
+ }, [o("div", { class: h(g.value.body({ class: e.ui?.body })) }, [
647
+ e.showIcon ? (b(), r(E(d.value), {
648
+ key: 0,
649
+ class: h(g.value.icon({ class: e.ui?.icon }))
650
+ }, null, 8, ["class"])) : i("", !0),
651
+ o("div", { class: h(g.value.content({ class: e.ui?.content })) }, [o("div", { class: h(g.value.wrapper({ class: e.ui?.wrapper })) }, [f.value ? (b(), a("div", {
652
+ key: 0,
653
+ class: h(g.value.title({ class: e.ui?.title }))
654
+ }, [w(n.$slots, "title", {}, () => [s(O(e.title), 1)])], 2)) : i("", !0), p.value ? (b(), a("div", {
655
+ key: 1,
656
+ class: h(g.value.description({ class: e.ui?.description }))
657
+ }, [w(n.$slots, "description", {}, () => [s(O(e.description), 1)])], 2)) : i("", !0)], 2), m.value ? (b(), a("div", {
658
+ key: 0,
659
+ class: h(g.value.actions({ class: e.ui?.actions }))
660
+ }, [w(n.$slots, "actions")], 2)) : i("", !0)], 2),
661
+ e.closable ? (b(), r(A(Z), {
662
+ key: 1,
663
+ label: "Close",
664
+ size: "xs",
665
+ variant: "ghost",
666
+ color: "gray",
667
+ square: "",
668
+ "leading-icon": A(ie),
669
+ class: h(g.value.closeButton({ class: e.ui?.closeButton })),
670
+ onClick: l[0] ||= (e) => c.value = !1
671
+ }, null, 8, ["leading-icon", "class"])) : i("", !0)
672
+ ], 2)], 10, be)) : i("", !0);
268
673
  }
269
- });
270
- // src/shared/composables/useFieldDescription.ts
271
- function z(e) {
272
- let n = b(), r = t(() => e.id ?? n), i = t(() => `${r.value}-hint`), a = t(() => `${r.value}-error`);
273
- return {
274
- fieldId: r,
275
- hintId: i,
276
- errorMessageId: a,
277
- isInvalid: t(() => !!(e.invalid || e.errorMessage)),
278
- describingElementId: t(() => {
279
- if (e.errorMessage) return a.value;
280
- if (e.hint) return i.value;
281
- })
282
- };
283
- }
284
- // src/components/text-field/text-field.theme.ts
285
- var B = {
674
+ }), Se = {
675
+ "3xs": {
676
+ sizeVariable: "[--avatar-size:22px]",
677
+ radius: "rounded-md"
678
+ },
679
+ "2xs": {
680
+ sizeVariable: "[--avatar-size:24px]",
681
+ radius: "rounded-md"
682
+ },
683
+ xs: {
684
+ sizeVariable: "[--avatar-size:26px]",
685
+ radius: "rounded-md"
686
+ },
687
+ sm: {
688
+ sizeVariable: "[--avatar-size:28px]",
689
+ radius: "rounded-md"
690
+ },
286
691
  md: {
287
- height: "h-8",
288
- fontSize: "text-sm",
289
- labelFontSize: "text-[11px] peer-placeholder-shown:text-sm peer-focus:text-[11px]",
290
- trailingActionFontSize: "text-sm",
291
- iconSize: "size-3",
292
- pillShape: {
293
- corners: "rounded-full",
294
- leadingPadding: "pl-4",
295
- leadingPaddingWithIcon: "pl-9",
296
- trailingPadding: "pr-4",
297
- trailingPaddingWithIcon: "pr-9",
298
- trailingPaddingWithAction: "pr-12",
299
- labelOffset: "left-3",
300
- labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-8 peer-focus:left-3",
301
- leadingIconOffset: "left-4",
302
- trailingIconOffset: "right-4",
303
- trailingActionOffset: "right-3"
304
- },
305
- roundedShape: {
306
- corners: "rounded-lg",
307
- leadingPadding: "pl-3",
308
- leadingPaddingWithIcon: "pl-8",
309
- trailingPadding: "pr-3",
310
- trailingPaddingWithIcon: "pr-8",
311
- trailingPaddingWithAction: "pr-11",
312
- labelOffset: "left-2",
313
- labelOffsetWithLeadingIcon: "left-2 peer-placeholder-shown:left-7 peer-focus:left-2",
314
- leadingIconOffset: "left-3",
315
- trailingIconOffset: "right-3",
316
- trailingActionOffset: "right-2"
317
- }
692
+ sizeVariable: "[--avatar-size:32px]",
693
+ radius: "rounded-lg"
318
694
  },
319
695
  lg: {
320
- height: "h-9",
321
- fontSize: "text-sm",
322
- labelFontSize: "text-[11px] peer-placeholder-shown:text-sm peer-focus:text-[11px]",
323
- trailingActionFontSize: "text-sm",
324
- iconSize: "size-3",
325
- pillShape: {
326
- corners: "rounded-full",
327
- leadingPadding: "pl-4",
328
- leadingPaddingWithIcon: "pl-9",
329
- trailingPadding: "pr-4",
330
- trailingPaddingWithIcon: "pr-9",
331
- trailingPaddingWithAction: "pr-12",
332
- labelOffset: "left-3",
333
- labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-8 peer-focus:left-3",
334
- leadingIconOffset: "left-4",
335
- trailingIconOffset: "right-4",
336
- trailingActionOffset: "right-3"
337
- },
338
- roundedShape: {
339
- corners: "rounded-lg",
340
- leadingPadding: "pl-3",
341
- leadingPaddingWithIcon: "pl-8",
342
- trailingPadding: "pr-3",
343
- trailingPaddingWithIcon: "pr-8",
344
- trailingPaddingWithAction: "pr-11",
345
- labelOffset: "left-2",
346
- labelOffsetWithLeadingIcon: "left-2 peer-placeholder-shown:left-7 peer-focus:left-2",
347
- leadingIconOffset: "left-3",
348
- trailingIconOffset: "right-3",
349
- trailingActionOffset: "right-2"
350
- }
696
+ sizeVariable: "[--avatar-size:36px]",
697
+ radius: "rounded-lg"
351
698
  },
352
699
  xl: {
353
- height: "h-10",
354
- fontSize: "text-base",
355
- labelFontSize: "text-[11px] peer-placeholder-shown:text-base peer-focus:text-[11px]",
356
- trailingActionFontSize: "text-sm",
357
- iconSize: "size-3.5",
358
- pillShape: {
359
- corners: "rounded-full",
360
- leadingPadding: "pl-4.75",
361
- leadingPaddingWithIcon: "pl-10.25",
362
- trailingPadding: "pr-4.75",
363
- trailingPaddingWithIcon: "pr-10.25",
364
- trailingPaddingWithAction: "pr-13",
365
- labelOffset: "left-3.75",
366
- labelOffsetWithLeadingIcon: "left-3.75 peer-placeholder-shown:left-9.25 peer-focus:left-3.75",
367
- leadingIconOffset: "left-4.75",
368
- trailingIconOffset: "right-4.75",
369
- trailingActionOffset: "right-3.75"
370
- },
371
- roundedShape: {
372
- corners: "rounded-[10px]",
373
- leadingPadding: "pl-3.5",
374
- leadingPaddingWithIcon: "pl-9",
375
- trailingPadding: "pr-3.5",
376
- trailingPaddingWithIcon: "pr-9",
377
- trailingPaddingWithAction: "pr-12",
378
- labelOffset: "left-2.5",
379
- labelOffsetWithLeadingIcon: "left-2.5 peer-placeholder-shown:left-8 peer-focus:left-2.5",
380
- leadingIconOffset: "left-3.5",
381
- trailingIconOffset: "right-3.5",
382
- trailingActionOffset: "right-2.5"
383
- }
700
+ sizeVariable: "[--avatar-size:40px]",
701
+ radius: "rounded-[10px]"
384
702
  },
385
703
  "2xl": {
386
- height: "h-11",
387
- fontSize: "text-base",
388
- labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
389
- trailingActionFontSize: "text-sm",
390
- iconSize: "size-4",
391
- pillShape: {
392
- corners: "rounded-full",
393
- leadingPadding: "pl-5.25",
394
- leadingPaddingWithIcon: "pl-11.25",
395
- trailingPadding: "pr-5.25",
396
- trailingPaddingWithIcon: "pr-11.25",
397
- trailingPaddingWithAction: "pr-14",
398
- labelOffset: "left-4.25",
399
- labelOffsetWithLeadingIcon: "left-4.25 peer-placeholder-shown:left-10.25 peer-focus:left-4.25",
400
- leadingIconOffset: "left-5.25",
401
- trailingIconOffset: "right-5.25",
402
- trailingActionOffset: "right-4.25"
403
- },
404
- roundedShape: {
405
- corners: "rounded-xl",
406
- leadingPadding: "pl-4",
407
- leadingPaddingWithIcon: "pl-10",
408
- trailingPadding: "pr-4",
409
- trailingPaddingWithIcon: "pr-10",
410
- trailingPaddingWithAction: "pr-12",
411
- labelOffset: "left-3",
412
- labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-9 peer-focus:left-3",
413
- leadingIconOffset: "left-4",
414
- trailingIconOffset: "right-4",
415
- trailingActionOffset: "right-3"
416
- }
704
+ sizeVariable: "[--avatar-size:44px]",
705
+ radius: "rounded-xl"
417
706
  },
418
707
  "3xl": {
419
- height: "h-12",
420
- fontSize: "text-base",
421
- labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
422
- trailingActionFontSize: "text-sm",
423
- iconSize: "size-4",
424
- pillShape: {
425
- corners: "rounded-full",
426
- leadingPadding: "pl-5.25",
427
- leadingPaddingWithIcon: "pl-11.25",
428
- trailingPadding: "pr-5.25",
429
- trailingPaddingWithIcon: "pr-11.25",
430
- trailingPaddingWithAction: "pr-14",
431
- labelOffset: "left-4.25",
432
- labelOffsetWithLeadingIcon: "left-4.25 peer-placeholder-shown:left-10.25 peer-focus:left-4.25",
433
- leadingIconOffset: "left-5.25",
434
- trailingIconOffset: "right-5.25",
435
- trailingActionOffset: "right-4.25"
708
+ sizeVariable: "[--avatar-size:48px]",
709
+ radius: "rounded-xl"
710
+ },
711
+ "4xl": {
712
+ sizeVariable: "[--avatar-size:56px]",
713
+ radius: "rounded-2xl"
714
+ },
715
+ "5xl": {
716
+ sizeVariable: "[--avatar-size:64px]",
717
+ radius: "rounded-2xl"
718
+ },
719
+ "6xl": {
720
+ sizeVariable: "[--avatar-size:80px]",
721
+ radius: "rounded-3xl"
722
+ }
723
+ }, Ce = Object.keys(Se), we = {
724
+ soft: {
725
+ primary: "light:bg-stone-200 dark:bg-stone-700",
726
+ secondary: "bg-secondary/16 text-secondary",
727
+ gray: "light:bg-stone-200 dark:bg-stone-700",
728
+ success: "light:bg-green-100 light:text-green-700 dark:bg-green-950 dark:text-green-400",
729
+ info: "light:bg-blue-100 light:text-blue-700 dark:bg-blue-950 dark:text-blue-300",
730
+ discovery: "light:bg-purple-100 light:text-purple-700 dark:bg-purple-950 dark:text-purple-300",
731
+ danger: "light:bg-red-100 light:text-red-700 dark:bg-red-950 dark:text-red-400"
732
+ },
733
+ solid: {
734
+ primary: "light:bg-neutral-900 light:text-white dark:bg-stone-200 dark:text-stone-950",
735
+ secondary: "bg-secondary light:text-white dark:text-stone-950",
736
+ gray: "light:bg-stone-600 light:text-white dark:bg-stone-600 dark:text-white",
737
+ success: "light:bg-green-600 light:text-white dark:bg-green-600 dark:text-white",
738
+ info: "light:bg-blue-600 light:text-white dark:bg-blue-500 dark:text-white",
739
+ discovery: "light:bg-purple-600 light:text-white dark:bg-purple-500 dark:text-white",
740
+ danger: "light:bg-red-600 light:text-white dark:bg-red-600 dark:text-white"
741
+ }
742
+ }, Te = Object.keys(we), Ee = Object.keys(we.soft), De = Object.fromEntries(Ce.map((e) => [e, { base: Se[e].sizeVariable }])), Oe = Ce.flatMap((e) => [{
743
+ size: e,
744
+ pill: !0,
745
+ class: { base: "rounded-full" }
746
+ }, {
747
+ size: e,
748
+ pill: !1,
749
+ class: { base: Se[e].radius }
750
+ }]), ke = Te.flatMap((e) => Ee.map((t) => ({
751
+ variant: e,
752
+ color: t,
753
+ class: { base: we[e][t] }
754
+ }))), Ae = G({
755
+ slots: {
756
+ base: "relative inline-flex size-(--avatar-size) shrink-0 items-center justify-center overflow-hidden select-none",
757
+ image: "absolute inset-0 size-full rounded-[inherit] object-cover",
758
+ icon: "size-[calc(var(--avatar-size)*0.55)] shrink-0",
759
+ label: "font-semibold",
760
+ overflowSign: "relative -top-[calc(var(--avatar-size)/24)] -ml-px"
761
+ },
762
+ variants: {
763
+ variant: {
764
+ soft: "",
765
+ solid: ""
436
766
  },
437
- roundedShape: {
438
- corners: "rounded-xl",
439
- leadingPadding: "pl-4",
440
- leadingPaddingWithIcon: "pl-10",
441
- trailingPadding: "pr-4",
442
- trailingPaddingWithIcon: "pr-10",
443
- trailingPaddingWithAction: "pr-12",
444
- labelOffset: "left-3",
445
- labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-9 peer-focus:left-3",
446
- leadingIconOffset: "left-4",
447
- trailingIconOffset: "right-4",
448
- trailingActionOffset: "right-3"
767
+ color: {
768
+ primary: "",
769
+ secondary: "",
770
+ gray: "",
771
+ success: "",
772
+ info: "",
773
+ discovery: "",
774
+ danger: ""
775
+ },
776
+ size: De,
777
+ pill: { true: "" },
778
+ hasImage: { true: { base: "after:absolute after:inset-0 after:rounded-[inherit] after:border light:after:border-black/4 dark:after:border-white/15" } },
779
+ isLink: { true: { base: "outline-primary focus-visible:outline-2 focus-visible:outline-offset-2" } },
780
+ isOverflow: { true: { label: "flex" } },
781
+ labelCharacterCount: {
782
+ one: "",
783
+ two: "",
784
+ many: { label: "text-[length:calc(var(--avatar-size)*0.3)]/none" }
449
785
  }
450
786
  },
451
- "4xl": {
452
- height: "h-14",
453
- fontSize: "text-base",
454
- labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
455
- trailingActionFontSize: "text-sm",
456
- iconSize: "size-4",
457
- pillShape: {
458
- corners: "rounded-full",
459
- leadingPadding: "pl-6",
460
- leadingPaddingWithIcon: "pl-12",
461
- trailingPadding: "pr-6",
462
- trailingPaddingWithIcon: "pr-12",
463
- trailingPaddingWithAction: "pr-16",
464
- labelOffset: "left-5",
465
- labelOffsetWithLeadingIcon: "left-5 peer-placeholder-shown:left-11 peer-focus:left-5",
466
- leadingIconOffset: "left-6",
467
- trailingIconOffset: "right-6",
468
- trailingActionOffset: "right-5"
787
+ compoundVariants: [
788
+ ...Oe,
789
+ ...ke,
790
+ {
791
+ isOverflow: !1,
792
+ labelCharacterCount: "one",
793
+ class: { label: "text-[length:calc(var(--avatar-size)*0.5)]/none" }
469
794
  },
470
- roundedShape: {
471
- corners: "rounded-2xl",
472
- leadingPadding: "pl-4.5",
473
- leadingPaddingWithIcon: "pl-10.5",
474
- trailingPadding: "pr-4.5",
475
- trailingPaddingWithIcon: "pr-10.5",
476
- trailingPaddingWithAction: "pr-13",
477
- labelOffset: "left-3.5",
478
- labelOffsetWithLeadingIcon: "left-3.5 peer-placeholder-shown:left-9.5 peer-focus:left-3.5",
479
- leadingIconOffset: "left-4.5",
480
- trailingIconOffset: "right-4.5",
481
- trailingActionOffset: "right-3.5"
795
+ {
796
+ isOverflow: !1,
797
+ labelCharacterCount: "two",
798
+ class: { label: "text-[length:calc(var(--avatar-size)*0.4)]/none" }
799
+ },
800
+ {
801
+ isOverflow: !0,
802
+ labelCharacterCount: "one",
803
+ class: { label: "text-[length:calc(var(--avatar-size)*0.45)]/none" }
804
+ },
805
+ {
806
+ isOverflow: !0,
807
+ labelCharacterCount: "two",
808
+ class: { label: "text-[length:calc(var(--avatar-size)*0.37)]/none" }
482
809
  }
810
+ ]
811
+ }), je = ["src"], Me = /* @__PURE__ */ l({
812
+ __name: "Avatar",
813
+ props: {
814
+ name: { default: "" },
815
+ imageUrl: {},
816
+ icon: {},
817
+ initials: {},
818
+ overflowCount: { default: 0 },
819
+ variant: { default: "soft" },
820
+ color: { default: "gray" },
821
+ size: { default: "md" },
822
+ pill: {
823
+ type: Boolean,
824
+ default: !0
825
+ },
826
+ href: {},
827
+ ui: {},
828
+ class: { type: [
829
+ Array,
830
+ String,
831
+ null,
832
+ Number,
833
+ Boolean
834
+ ] }
835
+ },
836
+ setup(e) {
837
+ let t = e, i = n(() => t.overflowCount > 0), c = n(() => t.overflowCount >= 1e6 ? `${Math.round(t.overflowCount / 1e6)}m` : t.overflowCount >= 1e3 ? `${Math.round(t.overflowCount / 1e3)}k` : String(t.overflowCount)), l = n(() => t.initials || t.name.charAt(0).toUpperCase()), u = n(() => t.name || (i.value ? `${t.overflowCount} more` : "")), d = n(() => {
838
+ let e = i.value ? c.value.length : l.value.length;
839
+ return e <= 1 ? "one" : e === 2 ? "two" : "many";
840
+ }), f = n(() => Ae({
841
+ variant: t.variant,
842
+ color: t.color,
843
+ size: t.size,
844
+ pill: t.pill,
845
+ hasImage: !!t.imageUrl,
846
+ isLink: !!t.href,
847
+ isOverflow: i.value,
848
+ labelCharacterCount: d.value
849
+ })), m = n(() => t.href ? "a" : "span"), g = n(() => t.href ? {
850
+ href: t.href,
851
+ "aria-label": u.value || void 0
852
+ } : u.value ? {
853
+ role: "img",
854
+ "aria-label": u.value
855
+ } : { "aria-hidden": "true" });
856
+ return (n, u) => (b(), r(E(m.value), p(g.value, { class: f.value.base({ class: [e.ui?.base, t.class] }) }), {
857
+ default: B(() => [e.imageUrl ? (b(), a("img", {
858
+ key: 0,
859
+ src: e.imageUrl,
860
+ alt: "",
861
+ class: h(f.value.image({ class: e.ui?.image }))
862
+ }, null, 10, je)) : e.icon ? (b(), r(E(e.icon), {
863
+ key: 1,
864
+ class: h(f.value.icon({ class: e.ui?.icon }))
865
+ }, null, 8, ["class"])) : i.value ? (b(), a("span", {
866
+ key: 2,
867
+ "aria-hidden": "true",
868
+ class: h(f.value.label({ class: e.ui?.label }))
869
+ }, [o("span", { class: h(f.value.overflowSign({ class: e.ui?.overflowSign })) }, "+", 2), s(" " + O(c.value), 1)], 2)) : (b(), a("span", {
870
+ key: 3,
871
+ "aria-hidden": "true",
872
+ class: h(f.value.label({ class: e.ui?.label }))
873
+ }, O(l.value), 3))]),
874
+ _: 1
875
+ }, 16, ["class"]));
483
876
  }
484
- }, V = Object.keys(B);
485
- function de(e) {
877
+ }), Ne = G({
878
+ slots: { base: "flex *:ring-3" },
879
+ variants: {
880
+ stack: {
881
+ start: { base: "flex-row-reverse justify-end *:not-first:-me-[calc(var(--avatar-size)/4)]" },
882
+ end: { base: "*:not-first:-ms-[calc(var(--avatar-size)/4)]" }
883
+ },
884
+ surface: {
885
+ widget: { base: "*:ring-widget" },
886
+ canvas: { base: "*:ring-canvas" }
887
+ },
888
+ hasOverflow: { true: "" }
889
+ },
890
+ compoundVariants: [{
891
+ stack: "start",
892
+ hasOverflow: !0,
893
+ class: { base: "*:first:z-10" }
894
+ }]
895
+ }), Pe = ["role", "aria-label"], Fe = /* @__PURE__ */ l({
896
+ __name: "AvatarGroup",
897
+ props: {
898
+ avatars: {},
899
+ label: {},
900
+ size: { default: "md" },
901
+ stack: { default: "start" },
902
+ overflowCount: { default: 0 },
903
+ surface: { default: "widget" },
904
+ ui: {},
905
+ class: { type: [
906
+ Array,
907
+ String,
908
+ null,
909
+ Number,
910
+ Boolean
911
+ ] }
912
+ },
913
+ setup(t) {
914
+ let i = t, o = n(() => i.overflowCount > 0), s = n(() => {
915
+ let e = (o.value ? [...i.avatars, { overflowCount: i.overflowCount }] : [...i.avatars]).map((e, t) => ({
916
+ avatarProps: e,
917
+ avatarPosition: t
918
+ }));
919
+ return i.stack === "start" ? e.reverse() : e;
920
+ }), c = n(() => Ne({
921
+ stack: i.stack,
922
+ surface: i.surface,
923
+ hasOverflow: o.value
924
+ }));
925
+ return (n, o) => (b(), a("div", {
926
+ role: t.label ? "group" : void 0,
927
+ "aria-label": t.label || void 0,
928
+ class: h(c.value.base({ class: [t.ui?.base, i.class] }))
929
+ }, [(b(!0), a(e, null, C(s.value, (e) => (b(), r(A(Me), p({ key: e.avatarPosition }, { ref_for: !0 }, e.avatarProps, { size: t.size }), null, 16, ["size"]))), 128))], 10, Pe));
930
+ }
931
+ });
932
+ // src/shared/utils/isApplePlatform.ts
933
+ function Ie() {
934
+ return /mac|iphone|ipad|ipod/i.test(navigator.platform || navigator.userAgent);
935
+ }
936
+ // src/shared/composables/useApplePlatform.ts
937
+ function Le() {
938
+ let e = D(!1);
939
+ return y(() => {
940
+ e.value = Ie();
941
+ }), S(e);
942
+ }
943
+ // src/shared/composables/useDismissOnOutsidePointerDown.ts
944
+ function Re(e, t) {
945
+ function n(n) {
946
+ let r = n.target;
947
+ r instanceof Node && (e.some((e) => k(e)?.contains(r)) || t.onDismiss());
948
+ }
949
+ y(() => {
950
+ z(() => k(t.active), (e, t, r) => {
951
+ e && (document.addEventListener("pointerdown", n, { capture: !0 }), r(() => document.removeEventListener("pointerdown", n, { capture: !0 })));
952
+ }, { immediate: !0 });
953
+ });
954
+ }
955
+ // src/shared/utils/parseShortcut.ts
956
+ var ze = /* @__PURE__ */ new Set([
957
+ "ctrl",
958
+ "meta",
959
+ "alt",
960
+ "shift",
961
+ "mod"
962
+ ]), Be = {
963
+ space: " ",
964
+ plus: "+"
965
+ }, Ve = /* @__PURE__ */ new Set([
966
+ "escape",
967
+ "enter",
968
+ "tab",
969
+ "backspace",
970
+ "delete",
971
+ "insert",
972
+ "arrowup",
973
+ "arrowdown",
974
+ "arrowleft",
975
+ "arrowright",
976
+ "home",
977
+ "end",
978
+ "pageup",
979
+ "pagedown"
980
+ ]), He = /^f([1-9]|1\d|2[0-4])$/;
981
+ function Ue(e) {
982
+ return ze.has(e);
983
+ }
984
+ function We(e) {
985
+ return [...e].length === 1 || Ve.has(e) || He.test(e);
986
+ }
987
+ function Ge(e, t) {
988
+ let n = e.toLowerCase().split("+"), r = n.pop() ?? "", i = Be[r] ?? r;
989
+ if (!We(i)) throw Error(`Unknown key "${r}" in shortcut "${t}".`);
990
+ let a = n.map((e) => {
991
+ if (!Ue(e)) throw Error(`Unknown modifier "${e}" in shortcut "${t}".`);
992
+ return e;
993
+ });
486
994
  return {
487
- base: [e.height, e.fontSize],
488
- label: e.labelFontSize,
489
- leadingIcon: e.iconSize,
490
- trailingIcon: e.iconSize,
491
- trailingAction: e.trailingActionFontSize
995
+ key: i,
996
+ modifiers: new Set(a)
492
997
  };
493
998
  }
494
- function fe(e) {
495
- let t = B[e];
496
- return [!0, !1].flatMap((n) => {
497
- let r = n ? t.pillShape : t.roundedShape;
498
- return [
499
- {
500
- size: e,
501
- pill: n,
502
- class: {
503
- base: r.corners,
504
- leadingIcon: r.leadingIconOffset,
505
- trailingIconButton: r.trailingIconOffset,
506
- trailingAction: r.trailingActionOffset
507
- }
508
- },
509
- {
510
- size: e,
511
- pill: n,
512
- hasLeadingIcon: !1,
513
- class: {
514
- base: r.leadingPadding,
515
- label: r.labelOffset
516
- }
517
- },
518
- {
519
- size: e,
520
- pill: n,
521
- hasLeadingIcon: !0,
522
- class: {
523
- base: r.leadingPaddingWithIcon,
524
- label: r.labelOffsetWithLeadingIcon
525
- }
526
- },
527
- {
528
- size: e,
529
- pill: n,
530
- trailingContent: "none",
531
- class: { base: r.trailingPadding }
532
- },
533
- {
534
- size: e,
535
- pill: n,
536
- trailingContent: ["icon", "iconButton"],
537
- class: { base: r.trailingPaddingWithIcon }
999
+ function Ke(e) {
1000
+ return e.trim().split(/\s+/).map((t) => Ge(t, e));
1001
+ }
1002
+ // src/shared/utils/createShortcutHandler.ts
1003
+ var qe = 1e3, Je = /* @__PURE__ */ new Set([
1004
+ "shift",
1005
+ "control",
1006
+ "alt",
1007
+ "meta",
1008
+ "altgraph",
1009
+ "capslock",
1010
+ "fn"
1011
+ ]), Ye = /^(?:Key|Digit)(.)$/;
1012
+ function Xe(e) {
1013
+ return [...e].length === 1 && e.toLowerCase() === e.toUpperCase();
1014
+ }
1015
+ function Ze(e, t) {
1016
+ if (e.key.toLowerCase() === t) return !0;
1017
+ let n = Ye.exec(e.code)?.[1]?.toLowerCase();
1018
+ return e.altKey && n === t;
1019
+ }
1020
+ function Qe(e, t) {
1021
+ let { modifiers: n } = t, r = Ie(), i = Xe(t.key), a = i && e.getModifierState("AltGraph"), o = n.has("ctrl") || n.has("mod") && !r, s = n.has("meta") || n.has("mod") && r;
1022
+ return e.metaKey === s && (a || e.ctrlKey === o) && (a || e.altKey === n.has("alt")) && (i || e.shiftKey === n.has("shift"));
1023
+ }
1024
+ function $e(e, t) {
1025
+ return t ? Ze(e, t.key) && Qe(e, t) : !1;
1026
+ }
1027
+ function et(e, t) {
1028
+ let n = typeof t == "function" ? { handler: t } : t;
1029
+ return {
1030
+ shortcut: e,
1031
+ keySequence: Ke(e),
1032
+ handler: n.handler,
1033
+ preventDefault: n.preventDefault ?? !0,
1034
+ allowInEditable: n.allowInEditable ?? !1
1035
+ };
1036
+ }
1037
+ function tt(e, t = {}) {
1038
+ let n = Object.entries(e).map(([e, t]) => et(e, t)), r = t.guards ?? [], i = t.sequenceTimeout ?? qe, a = /* @__PURE__ */ new Map(), o;
1039
+ function s(e, t) {
1040
+ let n = a.get(t) ?? 0;
1041
+ return $e(e, t.keySequence[n]) ? n + 1 : +!!$e(e, t.keySequence[0]);
1042
+ }
1043
+ function c(e, t) {
1044
+ t.preventDefault && e.preventDefault(), t.handler(e, { shortcut: t.shortcut });
1045
+ }
1046
+ function l() {
1047
+ clearTimeout(o), a.size > 0 && (o = setTimeout(() => a.clear(), i));
1048
+ }
1049
+ return function(e) {
1050
+ if (e instanceof KeyboardEvent && !e.isComposing && !Je.has(e.key.toLowerCase())) {
1051
+ for (let t of n) {
1052
+ let n = r.every((n) => n(e, t)) ? s(e, t) : 0;
1053
+ n === t.keySequence.length ? (a.delete(t), c(e, t)) : n > 0 ? a.set(t, n) : a.delete(t);
1054
+ }
1055
+ l();
1056
+ }
1057
+ };
1058
+ }
1059
+ // src/shared/utils/computeFloatingPosition.ts
1060
+ function Q(e, t, n, r) {
1061
+ return r.align === "center" ? e + (t - n) / 2 : r.align === "end" ? e + t - n - r.alignOffset : e + r.alignOffset;
1062
+ }
1063
+ var nt = {
1064
+ top: ({ anchorRect: e, floatingSize: t }, n) => ({
1065
+ x: Q(e.x, e.width, t.width, n),
1066
+ y: e.y - t.height - n.sideOffset
1067
+ }),
1068
+ bottom: ({ anchorRect: e, floatingSize: t }, n) => ({
1069
+ x: Q(e.x, e.width, t.width, n),
1070
+ y: e.y + e.height + n.sideOffset
1071
+ }),
1072
+ left: ({ anchorRect: e, floatingSize: t }, n) => ({
1073
+ x: e.x - t.width - n.sideOffset,
1074
+ y: Q(e.y, e.height, t.height, n)
1075
+ }),
1076
+ right: ({ anchorRect: e, floatingSize: t }, n) => ({
1077
+ x: e.x + e.width + n.sideOffset,
1078
+ y: Q(e.y, e.height, t.height, n)
1079
+ })
1080
+ };
1081
+ function rt(e, t) {
1082
+ return {
1083
+ ...nt[t.side](e, t),
1084
+ placement: t
1085
+ };
1086
+ }
1087
+ function it(e, t, n = []) {
1088
+ return n.reduce((t, n) => n(t, e), rt(e, t));
1089
+ }
1090
+ // src/shared/composables/useFloatingPosition.ts
1091
+ function at(e, t) {
1092
+ if (t === "fixed") return {
1093
+ x: 0,
1094
+ y: 0
1095
+ };
1096
+ let n = e.offsetParent;
1097
+ if (!(n instanceof HTMLElement) || (n === document.body || n === document.documentElement) && getComputedStyle(n).position === "static") return {
1098
+ x: -window.scrollX,
1099
+ y: -window.scrollY
1100
+ };
1101
+ let r = n.getBoundingClientRect();
1102
+ return {
1103
+ x: r.x + n.clientLeft - n.scrollLeft,
1104
+ y: r.y + n.clientTop - n.scrollTop
1105
+ };
1106
+ }
1107
+ function ot(e) {
1108
+ return Math.round(e * window.devicePixelRatio) / window.devicePixelRatio;
1109
+ }
1110
+ function st(e, t) {
1111
+ return e?.x === t.x && e.y === t.y && e.placement.side === t.placement.side && e.placement.align === t.placement.align;
1112
+ }
1113
+ function ct(e, t, r) {
1114
+ let i = D(), a = D(0), o = n(() => k(r.strategy) ?? "absolute"), s = n(() => ({
1115
+ side: k(r.side) ?? "bottom",
1116
+ align: k(r.align) ?? "start",
1117
+ sideOffset: k(r.sideOffset) ?? 0,
1118
+ alignOffset: k(r.alignOffset) ?? 0
1119
+ }));
1120
+ function c() {
1121
+ let n = k(e), l = k(t);
1122
+ if (!k(r.open) || !n || !l) return;
1123
+ let u = n.getBoundingClientRect();
1124
+ if (u.width !== a.value) {
1125
+ a.value = u.width, m(c);
1126
+ return;
1127
+ }
1128
+ let d = it({
1129
+ anchorRect: {
1130
+ x: u.x,
1131
+ y: u.y,
1132
+ width: u.width,
1133
+ height: u.height
538
1134
  },
539
- {
540
- size: e,
541
- pill: n,
542
- trailingContent: "icon",
543
- class: { trailingIcon: r.trailingIconOffset }
1135
+ floatingSize: {
1136
+ width: l.offsetWidth,
1137
+ height: l.offsetHeight
544
1138
  },
545
- {
546
- size: e,
547
- pill: n,
548
- trailingContent: "action",
549
- class: { base: r.trailingPaddingWithAction }
1139
+ viewportSize: {
1140
+ width: document.documentElement.clientWidth,
1141
+ height: document.documentElement.clientHeight
550
1142
  }
551
- ];
1143
+ }, s.value, k(r.positionModifiers)), f = at(l, o.value), p = {
1144
+ x: ot(d.x - f.x),
1145
+ y: ot(d.y - f.y),
1146
+ placement: d.placement
1147
+ };
1148
+ st(i.value, p) || (i.value = p);
1149
+ }
1150
+ function l(t) {
1151
+ let n = t.target;
1152
+ if (n === document || n === document.documentElement) {
1153
+ o.value === "fixed" && c();
1154
+ return;
1155
+ }
1156
+ let r = k(e);
1157
+ r && n instanceof Node && n.contains(r) && c();
1158
+ }
1159
+ y(() => {
1160
+ z(() => [
1161
+ k(r.open),
1162
+ k(e),
1163
+ k(t)
1164
+ ], ([e, t, n], r, i) => {
1165
+ if (!e || !t || !n) return;
1166
+ c();
1167
+ let a = new ResizeObserver(() => c());
1168
+ a.observe(t), a.observe(n), window.addEventListener("scroll", l, {
1169
+ capture: !0,
1170
+ passive: !0
1171
+ }), window.addEventListener("resize", c, { passive: !0 }), i(() => {
1172
+ a.disconnect(), window.removeEventListener("scroll", l, { capture: !0 }), window.removeEventListener("resize", c);
1173
+ });
1174
+ }, {
1175
+ immediate: !0,
1176
+ flush: "post"
1177
+ }), z([
1178
+ s,
1179
+ o,
1180
+ () => k(r.positionModifiers)
1181
+ ], c, { flush: "post" });
552
1182
  });
1183
+ let u = n(() => i.value !== void 0);
1184
+ return {
1185
+ floatingStyles: n(() => ({
1186
+ position: o.value,
1187
+ top: `${i.value?.y ?? 0}px`,
1188
+ left: `${i.value?.x ?? 0}px`,
1189
+ visibility: u.value ? void 0 : "hidden",
1190
+ "--floating-anchor-width": `${a.value}px`
1191
+ })),
1192
+ floatingPlacement: n(() => i.value?.placement ?? s.value),
1193
+ isPositioned: u,
1194
+ updatePosition: c
1195
+ };
1196
+ }
1197
+ // src/shared/utils/createTypeaheadSearch.ts
1198
+ function lt(e = 500) {
1199
+ let t = "", n;
1200
+ return function(r, i, a) {
1201
+ clearTimeout(n), t += r.toLowerCase(), n = setTimeout(() => {
1202
+ t = "";
1203
+ }, e);
1204
+ let o = t.charAt(0), s = [...t].every((e) => e === o) ? o : t, c = s.length === 1 ? a + 1 : Math.max(a, 0);
1205
+ for (let e = 0; e < i.length; e++) {
1206
+ let t = (c + e) % i.length;
1207
+ if (i[t]?.toLowerCase().startsWith(s)) return t;
1208
+ }
1209
+ return -1;
1210
+ };
1211
+ }
1212
+ // src/shared/utils/flipFloatingPosition.ts
1213
+ var ut = {
1214
+ top: "bottom",
1215
+ bottom: "top",
1216
+ left: "right",
1217
+ right: "left"
1218
+ };
1219
+ function dt(e, { floatingSize: t, viewportSize: n }, r) {
1220
+ return {
1221
+ top: r - e.y,
1222
+ bottom: e.y + t.height - (n.height - r),
1223
+ left: r - e.x,
1224
+ right: e.x + t.width - (n.width - r)
1225
+ }[e.placement.side];
1226
+ }
1227
+ function ft(e = 8) {
1228
+ return (t, n) => {
1229
+ let r = dt(t, n, e);
1230
+ if (r <= 0) return t;
1231
+ let i = rt(n, {
1232
+ ...t.placement,
1233
+ side: ut[t.placement.side]
1234
+ });
1235
+ return dt(i, n, e) < r ? i : t;
1236
+ };
1237
+ }
1238
+ // src/shared/utils/formatShortcut.ts
1239
+ var pt = [
1240
+ ["ctrl", "⌃"],
1241
+ ["alt", "⌥"],
1242
+ ["shift", "⇧"],
1243
+ ["meta", "⌘"]
1244
+ ], mt = [
1245
+ ["ctrl", "Ctrl"],
1246
+ ["alt", "Alt"],
1247
+ ["shift", "Shift"],
1248
+ ["meta", "Win"]
1249
+ ], ht = {
1250
+ " ": {
1251
+ apple: "Space",
1252
+ other: "Space"
1253
+ },
1254
+ escape: {
1255
+ apple: "Esc",
1256
+ other: "Esc"
1257
+ },
1258
+ enter: {
1259
+ apple: "↩",
1260
+ other: "Enter"
1261
+ },
1262
+ tab: {
1263
+ apple: "⇥",
1264
+ other: "Tab"
1265
+ },
1266
+ backspace: {
1267
+ apple: "⌫",
1268
+ other: "Backspace"
1269
+ },
1270
+ delete: {
1271
+ apple: "⌦",
1272
+ other: "Delete"
1273
+ },
1274
+ insert: {
1275
+ apple: "Insert",
1276
+ other: "Insert"
1277
+ },
1278
+ arrowup: {
1279
+ apple: "↑",
1280
+ other: "↑"
1281
+ },
1282
+ arrowdown: {
1283
+ apple: "↓",
1284
+ other: "↓"
1285
+ },
1286
+ arrowleft: {
1287
+ apple: "←",
1288
+ other: "←"
1289
+ },
1290
+ arrowright: {
1291
+ apple: "→",
1292
+ other: "→"
1293
+ },
1294
+ home: {
1295
+ apple: "Home",
1296
+ other: "Home"
1297
+ },
1298
+ end: {
1299
+ apple: "End",
1300
+ other: "End"
1301
+ },
1302
+ pageup: {
1303
+ apple: "Page Up",
1304
+ other: "Page Up"
1305
+ },
1306
+ pagedown: {
1307
+ apple: "Page Down",
1308
+ other: "Page Down"
1309
+ }
1310
+ };
1311
+ function gt(e, t) {
1312
+ let n = ht[e];
1313
+ return n ? t ? n.apple : n.other : e.toUpperCase();
1314
+ }
1315
+ function _t(e, t) {
1316
+ let n = new Set([...e.modifiers].map((e) => e === "mod" ? t ? "meta" : "ctrl" : e)), r = gt(e.key, t);
1317
+ return t ? pt.filter(([e]) => n.has(e)).map(([, e]) => e).join("") + r : [...mt.filter(([e]) => n.has(e)).map(([, e]) => e), r].join("+");
1318
+ }
1319
+ function vt(e, t) {
1320
+ return Ke(e).map((e) => _t(e, t)).join(" ");
1321
+ }
1322
+ // src/shared/utils/isExternalUrl.ts
1323
+ function yt(e) {
1324
+ return /^https?:\/\//.test(e);
1325
+ }
1326
+ // src/components/menu/menuContext.ts
1327
+ var bt = Symbol("menuContext");
1328
+ function xt() {
1329
+ let e = d(bt);
1330
+ if (!e) throw Error("A menu panel must be rendered inside KMenu.");
1331
+ return e;
1332
+ }
1333
+ // src/components/menu/MenuItemRow.vue
1334
+ var St = /* @__PURE__ */ l({
1335
+ __name: "MenuItemRow",
1336
+ props: {
1337
+ menuItem: {},
1338
+ menuThemeSlots: {},
1339
+ submenuKey: {},
1340
+ submenuId: {},
1341
+ isSubmenuOpen: { type: Boolean }
1342
+ },
1343
+ emits: ["select", "selectAction"],
1344
+ setup(t, { emit: s }) {
1345
+ let c = t, l = s, { menuSettings: u, usesApplePlatform: d } = xt(), f = {
1346
+ checkbox: "menuitemcheckbox",
1347
+ radio: "menuitemradio"
1348
+ }, m = n(() => u.value.ui), g = n(() => c.menuItem.type !== void 0), _ = n(() => !!c.menuItem.submenu), v = n(() => !!c.menuItem.actions?.length), y = n(() => !!c.menuItem.disabled), x = n(() => !!c.menuItem.checked), S = n(() => !!c.menuItem.href && !g.value && !_.value && !v.value), w = n(() => S.value && yt(c.menuItem.href ?? "")), T = n(() => c.menuItem.shortcut ? vt(c.menuItem.shortcut, d.value) : void 0), D = n(() => {
1349
+ let e = {
1350
+ role: c.menuItem.type ? f[c.menuItem.type] : "menuitem",
1351
+ tabindex: -1,
1352
+ "aria-disabled": y.value || void 0,
1353
+ "data-menu-item-label": c.menuItem.label
1354
+ };
1355
+ return S.value ? {
1356
+ ...e,
1357
+ href: y.value ? void 0 : c.menuItem.href,
1358
+ target: w.value ? "_blank" : void 0,
1359
+ rel: w.value ? "noopener noreferrer" : void 0
1360
+ } : _.value ? {
1361
+ ...e,
1362
+ "aria-haspopup": "menu",
1363
+ "aria-expanded": String(!!c.isSubmenuOpen),
1364
+ "aria-controls": c.isSubmenuOpen ? c.submenuId : void 0,
1365
+ "data-submenu-key": c.submenuKey
1366
+ } : {
1367
+ ...e,
1368
+ "aria-checked": g.value ? String(x.value) : void 0
1369
+ };
1370
+ });
1371
+ return (n, s) => (b(), r(E(S.value ? "a" : "div"), p(D.value, {
1372
+ class: t.menuThemeSlots.item({
1373
+ color: t.menuItem.color,
1374
+ disabled: y.value,
1375
+ hasActions: v.value,
1376
+ class: m.value?.item
1377
+ }),
1378
+ onClick: s[0] ||= (e) => l("select", e)
1379
+ }), {
1380
+ default: B(() => [o("span", { class: h(t.menuThemeSlots.itemContent({
1381
+ hasIndicator: g.value,
1382
+ class: m.value?.itemContent
1383
+ })) }, [
1384
+ g.value ? (b(), a("span", {
1385
+ key: 0,
1386
+ "aria-hidden": "true",
1387
+ class: h(t.menuThemeSlots.indicatorWrapper({ class: m.value?.indicatorWrapper }))
1388
+ }, [o("span", { class: h(t.menuThemeSlots.indicator({
1389
+ type: t.menuItem.type,
1390
+ checked: x.value,
1391
+ class: m.value?.indicator
1392
+ })) }, [x.value ? (b(), a(e, { key: 0 }, [t.menuItem.type === "radio" ? (b(), a("span", {
1393
+ key: 0,
1394
+ class: h(t.menuThemeSlots.radioDot({ class: m.value?.radioDot }))
1395
+ }, null, 2)) : (b(), r(A(te), {
1396
+ key: 1,
1397
+ class: h(t.menuThemeSlots.indicatorCheckIcon({ class: m.value?.indicatorCheckIcon }))
1398
+ }, null, 8, ["class"]))], 64)) : i("", !0)], 2)], 2)) : i("", !0),
1399
+ t.menuItem.icon ? (b(), r(E(t.menuItem.icon), {
1400
+ key: 1,
1401
+ class: h(t.menuThemeSlots.itemIcon({ class: m.value?.itemIcon }))
1402
+ }, null, 8, ["class"])) : i("", !0),
1403
+ o("span", { class: h(t.menuThemeSlots.itemText({ class: m.value?.itemText })) }, [o("span", { class: h(t.menuThemeSlots.itemLabel({ class: m.value?.itemLabel })) }, O(t.menuItem.label), 3), t.menuItem.description ? (b(), a("span", {
1404
+ key: 0,
1405
+ class: h(t.menuThemeSlots.itemDescription({ class: m.value?.itemDescription }))
1406
+ }, O(t.menuItem.description), 3)) : i("", !0)], 2),
1407
+ T.value ? (b(), a("kbd", {
1408
+ key: 2,
1409
+ class: h(t.menuThemeSlots.itemShortcut({ class: m.value?.itemShortcut }))
1410
+ }, O(T.value), 3)) : i("", !0),
1411
+ v.value ? (b(), a("span", {
1412
+ key: 3,
1413
+ class: h(t.menuThemeSlots.itemActions({ class: m.value?.itemActions }))
1414
+ }, [(b(!0), a(e, null, C(t.menuItem.actions, (e, t) => (b(), r(A(Z), {
1415
+ key: t,
1416
+ label: e.label,
1417
+ "leading-icon": e.icon,
1418
+ variant: "ghost",
1419
+ color: "gray",
1420
+ size: "xs",
1421
+ square: "",
1422
+ pill: !1,
1423
+ tabindex: "-1",
1424
+ "data-menu-item-action": "",
1425
+ onClick: ee((t) => l("selectAction", e, t), ["stop"])
1426
+ }, null, 8, [
1427
+ "label",
1428
+ "leading-icon",
1429
+ "onClick"
1430
+ ]))), 128))], 2)) : i("", !0),
1431
+ _.value ? (b(), r(A(ne), {
1432
+ key: 4,
1433
+ class: h(t.menuThemeSlots.submenuIcon({ class: m.value?.submenuIcon }))
1434
+ }, null, 8, ["class"])) : i("", !0)
1435
+ ], 2), w.value ? (b(), a("span", {
1436
+ key: 0,
1437
+ class: h(t.menuThemeSlots.newTabHint({ class: m.value?.newTabHint }))
1438
+ }, "(opens in a new tab)", 2)) : i("", !0)]),
1439
+ _: 1
1440
+ }, 16, ["class"]));
1441
+ }
1442
+ });
1443
+ // src/components/menu/menuEntries.ts
1444
+ function Ct(e) {
1445
+ return "separator" in e;
1446
+ }
1447
+ function $(e) {
1448
+ return "items" in e;
553
1449
  }
554
- var pe = Object.fromEntries(V.map((e) => [e, de(B[e])])), me = V.flatMap(fe), he = k({
1450
+ function wt(e) {
1451
+ return "readOnly" in e;
1452
+ }
1453
+ function Tt(e) {
1454
+ return !Ct(e) && !$(e) && !wt(e);
1455
+ }
1456
+ function Et(e) {
1457
+ return e.flatMap((e) => $(e) ? Et(e.items) : Tt(e) ? [e, ...Et(e.submenu ?? [])] : []);
1458
+ }
1459
+ function Dt(e) {
1460
+ let t = {};
1461
+ for (let n of Et(e)) {
1462
+ let e = n.onSelect;
1463
+ n.shortcut && !n.disabled && e && (t[n.shortcut] = (t) => e(t));
1464
+ }
1465
+ return t;
1466
+ }
1467
+ // src/components/menu/menu.theme.ts
1468
+ var Ot = "inset-ring light:inset-ring-stone-950/16 dark:inset-ring-stone-200/25 light:group-focus-within/menu-item:inset-ring-stone-950/25", kt = G({
555
1469
  slots: {
556
- root: "",
557
- container: "relative",
558
- base: "peer w-full border bg-field outline-hidden transition-colors",
559
- label: "pointer-events-none absolute top-0 -translate-y-1/2 bg-linear-to-b from-canvas from-50% to-field to-50% px-1 transition-colors peer-placeholder-shown:top-1/2 peer-placeholder-shown:transition-all peer-focus:transition-all peer-placeholder-shown:bg-none peer-focus:top-0 peer-focus:bg-linear-to-b",
560
- leadingIcon: "pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted",
561
- trailingIcon: "",
562
- trailingIconButton: "absolute top-1/2 flex -translate-y-1/2 cursor-pointer rounded-full text-muted outline-primary transition-colors hover:text-inherit focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed",
563
- trailingAction: "absolute top-1/2 -translate-y-1/2 cursor-pointer font-medium text-primary disabled:cursor-not-allowed aria-disabled:cursor-not-allowed",
564
- hint: "mt-2 text-xs text-muted",
565
- errorMessage: "mt-2 flex items-start gap-x-1.5 text-xs light:text-red-600 dark:text-red-400",
566
- errorIcon: "mt-px size-3.5 shrink-0"
1470
+ root: "inline-flex h-fit",
1471
+ panel: "z-10 rounded-xl border border-line bg-widget p-1.5 text-left text-sm leading-5 font-normal shadow-lg outline-hidden transition duration-350 ease-[cubic-bezier(0.19,1,0.22,1)] starting:scale-95 starting:opacity-0",
1472
+ separator: "-mx-1.5 my-1.5 h-px bg-line",
1473
+ groupLabel: "px-2 py-1.5 text-muted",
1474
+ header: "px-2 py-1.5",
1475
+ headerLabel: "truncate font-medium",
1476
+ headerDescription: "truncate text-muted",
1477
+ item: "group/menu-item relative flex w-full rounded-md px-2 py-1.5 outline-hidden select-none before:absolute before:inset-0 before:rounded-md before:transition before:duration-150 before:ease-[cubic-bezier(0.19,1,0.22,1)] light:before:bg-stone-950/8 dark:before:bg-stone-200/10",
1478
+ itemContent: "relative flex min-w-0 flex-1 items-start",
1479
+ itemIcon: "my-px size-4.5 shrink-0 stroke-[1.5px]",
1480
+ itemText: "min-w-0 flex-1",
1481
+ itemLabel: "block truncate",
1482
+ itemDescription: "block truncate text-muted",
1483
+ itemShortcut: "shrink-0 pl-2 font-sans text-muted",
1484
+ itemActions: "-mr-1.25 flex h-5 shrink-0 items-center gap-0.5 opacity-0 transition-opacity duration-150 group-hover/menu-item:opacity-100 group-focus-within/menu-item:opacity-100",
1485
+ submenuIcon: "my-0.5 -mr-0.5 size-4 shrink-0 opacity-75 transition-opacity group-hover/menu-item:opacity-100 group-focus-within/menu-item:opacity-100 group-aria-expanded/menu-item:opacity-100",
1486
+ indicatorWrapper: "flex h-5 shrink-0 items-center",
1487
+ indicator: "flex size-4.5 items-center justify-center",
1488
+ indicatorCheckIcon: "",
1489
+ radioDot: "size-2 rounded-full transition-transform duration-400 ease-[cubic-bezier(0.19,1,0.22,1)] dark:bg-stone-950 starting:scale-0 light:bg-white",
1490
+ newTabHint: "sr-only"
567
1491
  },
568
1492
  variants: {
569
- variant: {
570
- outline: "",
571
- soft: ""
1493
+ side: {
1494
+ top: "",
1495
+ bottom: "",
1496
+ left: "",
1497
+ right: ""
1498
+ },
1499
+ align: {
1500
+ start: "",
1501
+ center: "",
1502
+ end: ""
1503
+ },
1504
+ width: {
1505
+ trigger: { panel: "w-(--floating-anchor-width)" },
1506
+ auto: { panel: "w-max max-w-80" },
1507
+ sm: { panel: "w-48" },
1508
+ md: { panel: "w-56" },
1509
+ lg: { panel: "w-64" },
1510
+ xl: { panel: "w-72" }
1511
+ },
1512
+ indicatorPosition: {
1513
+ start: "",
1514
+ end: { indicatorWrapper: "order-last" }
1515
+ },
1516
+ indicatorVariant: {
1517
+ solid: {
1518
+ indicator: "rounded-full transition-shadow",
1519
+ indicatorCheckIcon: "size-3.5"
1520
+ },
1521
+ ghost: { indicatorCheckIcon: "size-4" }
1522
+ },
1523
+ color: { danger: { item: "light:text-red-600 dark:text-red-400 light:before:bg-red-600/8 dark:before:bg-red-400/12" } },
1524
+ type: {
1525
+ checkbox: "",
1526
+ radio: { indicator: "rounded-full transition-shadow" }
1527
+ },
1528
+ checked: {
1529
+ true: "",
1530
+ false: ""
1531
+ },
1532
+ disabled: {
1533
+ true: { item: "cursor-not-allowed opacity-50 before:hidden" },
1534
+ false: { item: "cursor-pointer before:scale-98 before:opacity-0 focus-within:before:scale-100 focus-within:before:opacity-100 aria-expanded:before:scale-100 aria-expanded:before:opacity-100 active:before:scale-98" }
1535
+ },
1536
+ hasIndicator: {
1537
+ true: { itemContent: "gap-2" },
1538
+ false: { itemContent: "gap-1.5" }
1539
+ },
1540
+ hasActions: { true: { item: "has-[button:hover]:before:opacity-40" } }
1541
+ },
1542
+ compoundVariants: [
1543
+ {
1544
+ side: "bottom",
1545
+ align: "start",
1546
+ class: { panel: "origin-top-left" }
1547
+ },
1548
+ {
1549
+ side: "bottom",
1550
+ align: "center",
1551
+ class: { panel: "origin-top" }
1552
+ },
1553
+ {
1554
+ side: "bottom",
1555
+ align: "end",
1556
+ class: { panel: "origin-top-right" }
1557
+ },
1558
+ {
1559
+ side: "top",
1560
+ align: "start",
1561
+ class: { panel: "origin-bottom-left" }
1562
+ },
1563
+ {
1564
+ side: "top",
1565
+ align: "center",
1566
+ class: { panel: "origin-bottom" }
1567
+ },
1568
+ {
1569
+ side: "top",
1570
+ align: "end",
1571
+ class: { panel: "origin-bottom-right" }
1572
+ },
1573
+ {
1574
+ side: "right",
1575
+ align: "start",
1576
+ class: { panel: "origin-top-left" }
1577
+ },
1578
+ {
1579
+ side: "right",
1580
+ align: "center",
1581
+ class: { panel: "origin-left" }
1582
+ },
1583
+ {
1584
+ side: "right",
1585
+ align: "end",
1586
+ class: { panel: "origin-bottom-left" }
572
1587
  },
573
- size: pe,
574
- pill: { true: "" },
575
- hasLeadingIcon: { true: "" },
576
- trailingContent: {
577
- none: "",
578
- icon: { trailingIcon: "pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted" },
579
- iconButton: "",
580
- action: ""
1588
+ {
1589
+ side: "left",
1590
+ align: "start",
1591
+ class: { panel: "origin-top-right" }
581
1592
  },
582
- invalid: { true: {
583
- base: "light:border-red-600 dark:border-red-500 light:selection:bg-red-500/16 dark:selection:bg-red-400/16",
584
- label: "light:text-red-600 dark:text-red-400"
585
- } },
586
- disabled: { true: { container: "opacity-50" } }
587
- },
588
- compoundVariants: [
589
- ...me,
590
1593
  {
591
- invalid: !1,
592
- disabled: !1,
593
- variant: "outline",
594
- class: {
595
- base: "border-line light:not-focus:hover:border-stone-950/20 dark:not-focus:hover:border-white/20 focus:border-primary",
596
- label: "text-muted peer-focus:text-primary"
597
- }
1594
+ side: "left",
1595
+ align: "center",
1596
+ class: { panel: "origin-right" }
598
1597
  },
599
1598
  {
600
- invalid: !1,
601
- disabled: !1,
602
- variant: "soft",
603
- class: {
604
- base: "border-transparent focus:border-primary",
605
- label: "text-muted peer-focus:text-primary"
606
- }
1599
+ side: "left",
1600
+ align: "end",
1601
+ class: { panel: "origin-bottom-right" }
607
1602
  },
608
1603
  {
609
- invalid: !1,
610
- disabled: !0,
611
- variant: "outline",
612
- class: {
613
- base: "cursor-not-allowed border-line",
614
- label: "text-muted"
615
- }
1604
+ type: "radio",
1605
+ checked: !1,
1606
+ class: { indicator: Ot }
616
1607
  },
617
1608
  {
618
- invalid: !1,
619
- disabled: !0,
620
- variant: "soft",
621
- class: {
622
- base: "cursor-not-allowed border-transparent",
623
- label: "text-muted"
1609
+ type: "radio",
1610
+ checked: !0,
1611
+ class: { indicator: "light:bg-neutral-900 dark:bg-stone-200" }
1612
+ },
1613
+ {
1614
+ type: "checkbox",
1615
+ indicatorVariant: "solid",
1616
+ checked: !1,
1617
+ class: { indicator: Ot }
1618
+ },
1619
+ {
1620
+ type: "checkbox",
1621
+ indicatorVariant: "solid",
1622
+ checked: !0,
1623
+ class: { indicator: "light:bg-neutral-900 light:text-white dark:bg-stone-200 dark:text-stone-950" }
1624
+ }
1625
+ ],
1626
+ defaultVariants: {
1627
+ side: "bottom",
1628
+ align: "start",
1629
+ width: "md",
1630
+ indicatorPosition: "end",
1631
+ indicatorVariant: "solid",
1632
+ checked: !1,
1633
+ disabled: !1,
1634
+ hasIndicator: !1
1635
+ }
1636
+ }), At = ["id", "aria-label"], jt = ["aria-label"], Mt = 150, Nt = /* @__PURE__ */ l({
1637
+ __name: "MenuPanel",
1638
+ props: {
1639
+ panelId: {},
1640
+ label: {},
1641
+ entries: {},
1642
+ anchorElement: {},
1643
+ side: {},
1644
+ align: {},
1645
+ width: {},
1646
+ sideOffset: {},
1647
+ alignOffset: {},
1648
+ focusRequest: {},
1649
+ isSubmenu: { type: Boolean }
1650
+ },
1651
+ emits: ["requestClose", "pointerEntered"],
1652
+ setup(s, { emit: c }) {
1653
+ let l = s, u = c, d = xt(), f = P("menuPanel"), p = j(), m = D(), g = lt(), y, { floatingStyles: x, floatingPlacement: S, isPositioned: w } = ct(() => l.anchorElement, f, {
1654
+ open: !0,
1655
+ side: () => l.side,
1656
+ align: () => l.align,
1657
+ sideOffset: () => l.sideOffset,
1658
+ alignOffset: () => l.alignOffset,
1659
+ strategy: () => d.menuSettings.value.strategy,
1660
+ positionModifiers: n(() => d.menuSettings.value.flip ? [ft()] : [])
1661
+ }), E = n(() => kt({
1662
+ side: S.value.side,
1663
+ align: S.value.align,
1664
+ width: l.width,
1665
+ indicatorPosition: d.menuSettings.value.indicatorPosition,
1666
+ indicatorVariant: d.menuSettings.value.indicatorVariant
1667
+ })), k = n(() => d.menuSettings.value.ui), M = n(() => {
1668
+ let e = /* @__PURE__ */ new Map();
1669
+ return l.entries.forEach((t, n) => {
1670
+ $(t) ? t.items.forEach((t, r) => {
1671
+ t.submenu && e.set(`${n}.${r}`, t);
1672
+ }) : Tt(t) && t.submenu && e.set(String(n), t);
1673
+ }), e;
1674
+ }), N = n(() => {
1675
+ if (m.value) return f.value?.querySelector(`[data-submenu-key="${m.value.submenuKey}"]`);
1676
+ });
1677
+ function F() {
1678
+ return Array.from(f.value?.querySelectorAll("[role^=\"menuitem\"]:not([aria-disabled=\"true\"])") ?? []);
1679
+ }
1680
+ function I() {
1681
+ let e = document.activeElement;
1682
+ return !(e instanceof HTMLElement) || !f.value?.contains(e) ? null : e.closest("[role^=\"menuitem\"]");
1683
+ }
1684
+ function L(e) {
1685
+ let t = F();
1686
+ ({
1687
+ panel: f.value,
1688
+ firstItem: t.at(0),
1689
+ lastItem: t.at(-1)
1690
+ }[e] ?? f.value)?.focus({ preventScroll: !0 });
1691
+ }
1692
+ function R(e) {
1693
+ let t = F(), n = t.findIndex((e) => e === I());
1694
+ n === -1 ? L(e === 1 ? "firstItem" : "lastItem") : t[(n + e + t.length) % t.length]?.focus();
1695
+ }
1696
+ function B(e, t) {
1697
+ let n = M.value.get(e);
1698
+ n && !n.disabled && (clearTimeout(y), (m.value?.submenuKey !== e || t) && (m.value = {
1699
+ submenuKey: e,
1700
+ menuItem: n,
1701
+ focusRequest: t ? { focusTarget: t } : void 0
1702
+ }));
1703
+ }
1704
+ function V({ focusParentItem: e }) {
1705
+ clearTimeout(y);
1706
+ let t = N.value;
1707
+ m.value = void 0, e && t?.focus();
1708
+ }
1709
+ function ee() {
1710
+ m.value && (clearTimeout(y), y = setTimeout(() => V({ focusParentItem: !1 }), Mt));
1711
+ }
1712
+ function te() {
1713
+ clearTimeout(y);
1714
+ }
1715
+ function ne() {
1716
+ let e = I(), t = e?.dataset.submenuKey;
1717
+ if (!e) return;
1718
+ if (t) {
1719
+ B(t, "firstItem");
1720
+ return;
624
1721
  }
1722
+ let n = Array.from(e.querySelectorAll("[data-menu-item-action]"));
1723
+ n[n.findIndex((e) => e === document.activeElement) + 1]?.focus();
625
1724
  }
626
- ]
627
- }), ge = [
628
- "id",
629
- "type",
630
- "disabled",
631
- "aria-describedby",
632
- "aria-invalid"
633
- ], _e = ["for"], ve = ["aria-label", "disabled"], ye = ["id"], be = ["id"], H = /* @__PURE__ */ c({
634
- inheritAttrs: !1,
635
- __name: "TextField",
636
- props: /*@__PURE__*/ l({
1725
+ function H() {
1726
+ let e = I(), t = Array.from(e?.querySelectorAll("[data-menu-item-action]") ?? []), n = t.findIndex((e) => e === document.activeElement);
1727
+ n > 0 ? t[n - 1]?.focus() : n === 0 ? e?.focus() : l.isSubmenu && u("requestClose");
1728
+ }
1729
+ function re(e) {
1730
+ if (document.activeElement === f.value) {
1731
+ e.preventDefault();
1732
+ return;
1733
+ }
1734
+ let t = F().find((e) => e === document.activeElement);
1735
+ t && (e.preventDefault(), t.dataset.submenuKey ? B(t.dataset.submenuKey, "firstItem") : t.click());
1736
+ }
1737
+ let U = {
1738
+ handler: () => d.closeMenu({ restoreFocus: !0 }),
1739
+ preventDefault: !1
1740
+ }, W = {
1741
+ handler: re,
1742
+ preventDefault: !1
1743
+ }, ie = tt({
1744
+ arrowdown: () => R(1),
1745
+ arrowup: () => R(-1),
1746
+ home: () => L("firstItem"),
1747
+ end: () => L("lastItem"),
1748
+ arrowright: ne,
1749
+ arrowleft: H,
1750
+ escape: () => l.isSubmenu ? u("requestClose") : d.closeMenu({ restoreFocus: !0 }),
1751
+ tab: U,
1752
+ "shift+tab": U,
1753
+ enter: W,
1754
+ space: W
1755
+ });
1756
+ function G(e) {
1757
+ let t = [...e.key].length === 1 && e.key !== " ", n = e.ctrlKey || e.metaKey || e.altKey;
1758
+ if (e.defaultPrevented || !t || n) return;
1759
+ let r = F(), i = r.findIndex((e) => e === I()), a = r.map((e) => e.dataset.menuItemLabel ?? "");
1760
+ r[g(e.key, a, i)]?.focus();
1761
+ }
1762
+ function K(e) {
1763
+ ie(e), G(e);
1764
+ }
1765
+ function ae(e) {
1766
+ let t = e.target instanceof Element ? e.target.closest("[role^=\"menuitem\"]") : null, n = t !== null && t.getAttribute("aria-disabled") !== "true", r = n ? t.dataset.submenuKey : void 0;
1767
+ if (r ? B(r) : ee(), t?.contains(document.activeElement)) return;
1768
+ let i = n ? t : f.value;
1769
+ i && document.activeElement !== i && i.focus({ preventScroll: !0 });
1770
+ }
1771
+ function q() {
1772
+ f.value?.contains(document.activeElement) && f.value.focus({ preventScroll: !0 });
1773
+ }
1774
+ function J(e, t, n) {
1775
+ e.submenu ? B(t, n.detail === 0 ? "firstItem" : void 0) : d.selectMenuItem(e, n);
1776
+ }
1777
+ function Y(e, t) {
1778
+ d.selectMenuItemAction(e, t);
1779
+ }
1780
+ return z([w, () => l.focusRequest], ([e, t]) => {
1781
+ e && t && L(t.focusTarget);
1782
+ }, { flush: "post" }), v(() => clearTimeout(y)), (n, c) => {
1783
+ let l = T("MenuPanel", !0);
1784
+ return b(), a("div", {
1785
+ id: s.panelId,
1786
+ ref_key: "menuPanel",
1787
+ ref: f,
1788
+ role: "menu",
1789
+ "aria-label": s.label,
1790
+ tabindex: "-1",
1791
+ style: _(A(x)),
1792
+ class: h(E.value.panel({ class: k.value?.panel })),
1793
+ onKeydown: K,
1794
+ onPointermove: ae,
1795
+ onPointerleave: q,
1796
+ onPointerenter: c[1] ||= (e) => u("pointerEntered")
1797
+ }, [(b(!0), a(e, null, C(s.entries, (t, n) => (b(), a(e, { key: n }, [A(Ct)(t) ? (b(), a("div", {
1798
+ key: 0,
1799
+ role: "separator",
1800
+ class: h(E.value.separator({ class: k.value?.separator }))
1801
+ }, null, 2)) : A($)(t) ? (b(), a("div", {
1802
+ key: 1,
1803
+ role: "group",
1804
+ "aria-label": t.label
1805
+ }, [o("div", {
1806
+ "aria-hidden": "true",
1807
+ class: h(E.value.groupLabel({ class: k.value?.groupLabel }))
1808
+ }, O(t.label), 3), (b(!0), a(e, null, C(t.items, (e, t) => (b(), r(St, {
1809
+ key: t,
1810
+ "menu-item": e,
1811
+ "menu-theme-slots": E.value,
1812
+ "submenu-key": `${n}.${t}`,
1813
+ "submenu-id": A(p),
1814
+ "is-submenu-open": m.value?.submenuKey === `${n}.${t}`,
1815
+ onSelect: (r) => J(e, `${n}.${t}`, r),
1816
+ onSelectAction: Y
1817
+ }, null, 8, [
1818
+ "menu-item",
1819
+ "menu-theme-slots",
1820
+ "submenu-key",
1821
+ "submenu-id",
1822
+ "is-submenu-open",
1823
+ "onSelect"
1824
+ ]))), 128))], 8, jt)) : A(wt)(t) ? (b(), a("div", {
1825
+ key: 2,
1826
+ class: h(E.value.header({ class: k.value?.header }))
1827
+ }, [o("div", { class: h(E.value.headerLabel({ class: k.value?.headerLabel })) }, O(t.label), 3), t.description ? (b(), a("div", {
1828
+ key: 0,
1829
+ class: h(E.value.headerDescription({ class: k.value?.headerDescription }))
1830
+ }, O(t.description), 3)) : i("", !0)], 2)) : (b(), r(St, {
1831
+ key: 3,
1832
+ "menu-item": t,
1833
+ "menu-theme-slots": E.value,
1834
+ "submenu-key": String(n),
1835
+ "submenu-id": A(p),
1836
+ "is-submenu-open": m.value?.submenuKey === String(n),
1837
+ onSelect: (e) => J(t, String(n), e),
1838
+ onSelectAction: Y
1839
+ }, null, 8, [
1840
+ "menu-item",
1841
+ "menu-theme-slots",
1842
+ "submenu-key",
1843
+ "submenu-id",
1844
+ "is-submenu-open",
1845
+ "onSelect"
1846
+ ]))], 64))), 128)), m.value?.menuItem.submenu ? (b(), r(t, {
1847
+ key: 0,
1848
+ to: A(d).menuLayer.value
1849
+ }, [(b(), r(l, {
1850
+ key: m.value.submenuKey,
1851
+ "panel-id": A(p),
1852
+ label: m.value.menuItem.label,
1853
+ entries: m.value.menuItem.submenu,
1854
+ "anchor-element": N.value,
1855
+ side: "right",
1856
+ align: "start",
1857
+ width: "auto",
1858
+ "side-offset": 4,
1859
+ "align-offset": -7,
1860
+ "focus-request": m.value.focusRequest,
1861
+ "is-submenu": "",
1862
+ onRequestClose: c[0] ||= (e) => V({ focusParentItem: !0 }),
1863
+ onPointerEntered: te
1864
+ }, null, 8, [
1865
+ "panel-id",
1866
+ "label",
1867
+ "entries",
1868
+ "anchor-element",
1869
+ "focus-request"
1870
+ ]))], 8, ["to"])) : i("", !0)], 46, At);
1871
+ };
1872
+ }
1873
+ }), Pt = /* @__PURE__ */ l({
1874
+ __name: "Menu",
1875
+ props: /*@__PURE__*/ f({
637
1876
  label: {},
638
- id: {},
639
- type: { default: "text" },
640
- variant: { default: "outline" },
641
- size: { default: "4xl" },
642
- pill: {
1877
+ items: {},
1878
+ trigger: {},
1879
+ side: { default: "bottom" },
1880
+ align: { default: "start" },
1881
+ width: { default: "md" },
1882
+ indicatorPosition: { default: "end" },
1883
+ indicatorVariant: { default: "solid" },
1884
+ strategy: { default: "absolute" },
1885
+ flip: {
643
1886
  type: Boolean,
644
1887
  default: !0
645
1888
  },
646
- leadingIcon: {},
647
- trailingIcon: {},
648
- trailingIconLabel: {},
649
- trailingActionLabel: {},
650
- trailingActionHref: {},
651
- hint: {},
652
- errorMessage: {},
653
- invalid: { type: Boolean },
654
- disabled: { type: Boolean },
655
1889
  ui: {},
656
1890
  class: { type: [
657
1891
  Array,
@@ -661,616 +1895,486 @@ var pe = Object.fromEntries(V.map((e) => [e, de(B[e])])), me = V.flatMap(fe), he
661
1895
  Boolean
662
1896
  ] }
663
1897
  }, {
664
- modelValue: {},
665
- modelModifiers: {}
1898
+ open: {
1899
+ type: Boolean,
1900
+ default: !1
1901
+ },
1902
+ openModifiers: {}
666
1903
  }),
667
- emits: /*@__PURE__*/ l(["trailingIconClick", "trailingActionClick"], ["update:modelValue"]),
668
- setup(e, { emit: c }) {
669
- let l = e, f = c, m = x(e, "modelValue"), { fieldId: h, hintId: v, errorMessageId: b, isInvalid: S, describingElementId: C } = z(l), T = t(() => l.trailingActionLabel ? "action" : l.trailingIcon ? l.trailingIconLabel ? "iconButton" : "icon" : "none"), E = t(() => he({
670
- variant: l.variant,
671
- size: l.size,
672
- pill: l.pill,
673
- hasLeadingIcon: !!l.leadingIcon,
674
- trailingContent: T.value,
675
- invalid: S.value,
676
- disabled: l.disabled
677
- })), k = t(() => l.trailingActionHref ? "a" : "button"), ee = t(() => l.trailingActionHref ? l.disabled ? {
678
- role: "link",
679
- "aria-disabled": "true"
680
- } : { href: l.trailingActionHref } : {
681
- type: "button",
682
- disabled: l.disabled
1904
+ emits: ["update:open"],
1905
+ setup(e) {
1906
+ let o = e, s = M(e, "open"), l = j(), d = P("menuRoot"), f = P("menuLayer"), m = D(), _ = Le(), v = n(() => ({
1907
+ ui: o.ui,
1908
+ indicatorPosition: o.indicatorPosition,
1909
+ indicatorVariant: o.indicatorVariant,
1910
+ strategy: o.strategy,
1911
+ flip: o.flip
1912
+ })), y = n(() => kt().root({ class: [o.ui?.root, o.class] }));
1913
+ function S() {
1914
+ return d.value?.querySelector("button, [href], [tabindex]:not([tabindex=\"-1\"])");
1915
+ }
1916
+ function C(e) {
1917
+ m.value = { focusTarget: e }, s.value = !0;
1918
+ }
1919
+ function T({ restoreFocus: e }) {
1920
+ s.value = !1, e && S()?.focus();
1921
+ }
1922
+ function E(e) {
1923
+ s.value ? T({ restoreFocus: !1 }) : C(e.detail === 0 ? "firstItem" : "panel");
1924
+ }
1925
+ let O = tt({
1926
+ arrowdown: () => C("firstItem"),
1927
+ arrowup: () => C("lastItem")
683
1928
  });
684
- function j(e) {
685
- l.disabled || f("trailingActionClick", e);
1929
+ function k(e, t) {
1930
+ e.disabled ? t.preventDefault() : (e.onSelect?.(t), e.type !== "checkbox" && T({ restoreFocus: !0 }));
686
1931
  }
687
- return (t, c) => (p(), i("div", { class: d(E.value.root({ class: [e.ui?.root, l.class] })) }, [a("div", { class: d(E.value.container({ class: e.ui?.container })) }, [
688
- O(a("input", u(t.$attrs, {
689
- id: y(h),
690
- "onUpdate:modelValue": c[0] ||= (e) => m.value = e,
691
- type: e.type,
692
- disabled: e.disabled,
693
- "aria-describedby": y(C),
694
- "aria-invalid": y(S) || void 0,
695
- placeholder: " ",
696
- class: E.value.base({ class: e.ui?.base })
697
- }), null, 16, ge), [[w, m.value]]),
698
- a("label", {
699
- for: y(h),
700
- class: d(E.value.label({ class: e.ui?.label }))
701
- }, _(e.label), 11, _e),
702
- e.leadingIcon ? (p(), n(g(e.leadingIcon), {
703
- key: 0,
704
- class: d(E.value.leadingIcon({ class: e.ui?.leadingIcon }))
705
- }, null, 8, ["class"])) : r("", !0),
706
- T.value === "action" ? (p(), n(g(k.value), u({ key: 1 }, ee.value, {
707
- class: E.value.trailingAction({ class: e.ui?.trailingAction }),
708
- onClick: j
709
- }), {
710
- default: D(() => [o(_(e.trailingActionLabel), 1)]),
711
- _: 1
712
- }, 16, ["class"])) : T.value === "iconButton" ? (p(), i("button", {
713
- key: 2,
714
- type: "button",
715
- "aria-label": e.trailingIconLabel,
716
- disabled: e.disabled,
717
- class: d(E.value.trailingIconButton({ class: e.ui?.trailingIconButton })),
718
- onClick: c[1] ||= (e) => f("trailingIconClick", e)
719
- }, [(p(), n(g(e.trailingIcon), { class: d(E.value.trailingIcon({ class: e.ui?.trailingIcon })) }, null, 8, ["class"]))], 10, ve)) : T.value === "icon" ? (p(), n(g(e.trailingIcon), {
720
- key: 3,
721
- class: d(E.value.trailingIcon({ class: e.ui?.trailingIcon }))
722
- }, null, 8, ["class"])) : r("", !0)
723
- ], 2), e.errorMessage ? (p(), i("p", {
1932
+ function N(e, t) {
1933
+ e.onSelect?.(t), T({ restoreFocus: !0 });
1934
+ }
1935
+ let F = n(() => ({
1936
+ open: s.value,
1937
+ triggerAttributes: {
1938
+ "aria-haspopup": "menu",
1939
+ "aria-expanded": s.value,
1940
+ "aria-controls": s.value ? l : void 0,
1941
+ onClick: E,
1942
+ onKeydown: O
1943
+ }
1944
+ }));
1945
+ return x(bt, {
1946
+ menuSettings: v,
1947
+ menuLayer: f,
1948
+ usesApplePlatform: _,
1949
+ closeMenu: T,
1950
+ selectMenuItem: k,
1951
+ selectMenuItemAction: N
1952
+ }), Re([d, f], {
1953
+ active: s,
1954
+ onDismiss: () => T({ restoreFocus: !1 })
1955
+ }), (n, o) => (b(), a("div", {
1956
+ ref_key: "menuRoot",
1957
+ ref: d,
1958
+ class: h(y.value)
1959
+ }, [w(n.$slots, "trigger", g(u(F.value)), () => [c(A(Z), p({
1960
+ ...e.trigger,
1961
+ ...F.value.triggerAttributes
1962
+ }, {
1963
+ label: e.label,
1964
+ selected: s.value,
1965
+ "aria-pressed": void 0
1966
+ }), null, 16, ["label", "selected"])]), (b(), r(t, { to: "body" }, [s.value ? (b(), a("div", {
724
1967
  key: 0,
725
- id: y(b),
726
- class: d(E.value.errorMessage({ class: e.ui?.errorMessage }))
727
- }, [s(y(A), { class: d(E.value.errorIcon({ class: e.ui?.errorIcon })) }, null, 8, ["class"]), o(" " + _(e.errorMessage), 1)], 10, ye)) : e.hint ? (p(), i("p", {
728
- key: 1,
729
- id: y(v),
730
- class: d(E.value.hint({ class: e.ui?.hint }))
731
- }, _(e.hint), 11, be)) : r("", !0)], 2));
1968
+ ref_key: "menuLayer",
1969
+ ref: f
1970
+ }, [c(Nt, {
1971
+ "panel-id": A(l),
1972
+ label: e.label,
1973
+ entries: e.items,
1974
+ "anchor-element": d.value,
1975
+ side: e.side,
1976
+ align: e.align,
1977
+ width: e.width,
1978
+ "side-offset": 6,
1979
+ "align-offset": 0,
1980
+ "focus-request": m.value
1981
+ }, null, 8, [
1982
+ "panel-id",
1983
+ "label",
1984
+ "entries",
1985
+ "anchor-element",
1986
+ "side",
1987
+ "align",
1988
+ "width",
1989
+ "focus-request"
1990
+ ])], 512)) : i("", !0)]))], 2));
732
1991
  }
733
- }), U = {
1992
+ });
1993
+ // src/shared/composables/useFieldDescription.ts
1994
+ function Ft(e) {
1995
+ let t = j(), r = n(() => e.id ?? t), i = n(() => `${r.value}-hint`), a = n(() => `${r.value}-error`);
1996
+ return {
1997
+ fieldId: r,
1998
+ hintId: i,
1999
+ errorMessageId: a,
2000
+ isInvalid: n(() => !!(e.invalid || e.errorMessage)),
2001
+ describingElementId: n(() => {
2002
+ if (e.errorMessage) return a.value;
2003
+ if (e.hint) return i.value;
2004
+ })
2005
+ };
2006
+ }
2007
+ // src/components/text-field/text-field.theme.ts
2008
+ var It = {
734
2009
  md: {
2010
+ height: "h-8",
735
2011
  fontSize: "text-sm",
736
- verticalPadding: "py-1.25",
737
2012
  labelFontSize: "text-[11px] peer-placeholder-shown:text-sm peer-focus:text-[11px]",
738
- labelRestingTop: "peer-placeholder-shown:top-4",
739
- autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+12px)] max-h-[calc(var(--textarea-max-rows)*1lh+12px)]",
2013
+ trailingActionFontSize: "text-sm",
2014
+ iconSize: "size-3",
740
2015
  pillShape: {
741
- corners: "rounded-2xl",
742
- horizontalPadding: "px-4",
743
- labelOffset: "left-3"
2016
+ corners: "rounded-full",
2017
+ leadingPadding: "pl-4",
2018
+ leadingPaddingWithIcon: "pl-9",
2019
+ trailingPadding: "pr-4",
2020
+ trailingPaddingWithIcon: "pr-9",
2021
+ trailingPaddingWithAction: "pr-12",
2022
+ labelOffset: "left-3",
2023
+ labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-8 peer-focus:left-3",
2024
+ leadingIconOffset: "left-4",
2025
+ trailingIconOffset: "right-4",
2026
+ trailingActionOffset: "right-3"
744
2027
  },
745
2028
  roundedShape: {
746
2029
  corners: "rounded-lg",
747
- horizontalPadding: "px-3",
748
- labelOffset: "left-2"
2030
+ leadingPadding: "pl-3",
2031
+ leadingPaddingWithIcon: "pl-8",
2032
+ trailingPadding: "pr-3",
2033
+ trailingPaddingWithIcon: "pr-8",
2034
+ trailingPaddingWithAction: "pr-11",
2035
+ labelOffset: "left-2",
2036
+ labelOffsetWithLeadingIcon: "left-2 peer-placeholder-shown:left-7 peer-focus:left-2",
2037
+ leadingIconOffset: "left-3",
2038
+ trailingIconOffset: "right-3",
2039
+ trailingActionOffset: "right-2"
749
2040
  }
750
2041
  },
751
2042
  lg: {
2043
+ height: "h-9",
752
2044
  fontSize: "text-sm",
753
- verticalPadding: "py-1.75",
754
2045
  labelFontSize: "text-[11px] peer-placeholder-shown:text-sm peer-focus:text-[11px]",
755
- labelRestingTop: "peer-placeholder-shown:top-4.5",
756
- autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+16px)] max-h-[calc(var(--textarea-max-rows)*1lh+16px)]",
2046
+ trailingActionFontSize: "text-sm",
2047
+ iconSize: "size-3",
757
2048
  pillShape: {
758
- corners: "rounded-[18px]",
759
- horizontalPadding: "px-4",
760
- labelOffset: "left-3"
2049
+ corners: "rounded-full",
2050
+ leadingPadding: "pl-4",
2051
+ leadingPaddingWithIcon: "pl-9",
2052
+ trailingPadding: "pr-4",
2053
+ trailingPaddingWithIcon: "pr-9",
2054
+ trailingPaddingWithAction: "pr-12",
2055
+ labelOffset: "left-3",
2056
+ labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-8 peer-focus:left-3",
2057
+ leadingIconOffset: "left-4",
2058
+ trailingIconOffset: "right-4",
2059
+ trailingActionOffset: "right-3"
761
2060
  },
762
2061
  roundedShape: {
763
2062
  corners: "rounded-lg",
764
- horizontalPadding: "px-3",
765
- labelOffset: "left-2"
2063
+ leadingPadding: "pl-3",
2064
+ leadingPaddingWithIcon: "pl-8",
2065
+ trailingPadding: "pr-3",
2066
+ trailingPaddingWithIcon: "pr-8",
2067
+ trailingPaddingWithAction: "pr-11",
2068
+ labelOffset: "left-2",
2069
+ labelOffsetWithLeadingIcon: "left-2 peer-placeholder-shown:left-7 peer-focus:left-2",
2070
+ leadingIconOffset: "left-3",
2071
+ trailingIconOffset: "right-3",
2072
+ trailingActionOffset: "right-2"
766
2073
  }
767
2074
  },
768
2075
  xl: {
2076
+ height: "h-10",
769
2077
  fontSize: "text-base",
770
- verticalPadding: "py-1.75",
771
2078
  labelFontSize: "text-[11px] peer-placeholder-shown:text-base peer-focus:text-[11px]",
772
- labelRestingTop: "peer-placeholder-shown:top-5",
773
- autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+16px)] max-h-[calc(var(--textarea-max-rows)*1lh+16px)]",
2079
+ trailingActionFontSize: "text-sm",
2080
+ iconSize: "size-3.5",
774
2081
  pillShape: {
775
- corners: "rounded-[20px]",
776
- horizontalPadding: "px-4.75",
777
- labelOffset: "left-3.75"
2082
+ corners: "rounded-full",
2083
+ leadingPadding: "pl-4.75",
2084
+ leadingPaddingWithIcon: "pl-10.25",
2085
+ trailingPadding: "pr-4.75",
2086
+ trailingPaddingWithIcon: "pr-10.25",
2087
+ trailingPaddingWithAction: "pr-13",
2088
+ labelOffset: "left-3.75",
2089
+ labelOffsetWithLeadingIcon: "left-3.75 peer-placeholder-shown:left-9.25 peer-focus:left-3.75",
2090
+ leadingIconOffset: "left-4.75",
2091
+ trailingIconOffset: "right-4.75",
2092
+ trailingActionOffset: "right-3.75"
778
2093
  },
779
2094
  roundedShape: {
780
2095
  corners: "rounded-[10px]",
781
- horizontalPadding: "px-3.5",
782
- labelOffset: "left-2.5"
2096
+ leadingPadding: "pl-3.5",
2097
+ leadingPaddingWithIcon: "pl-9",
2098
+ trailingPadding: "pr-3.5",
2099
+ trailingPaddingWithIcon: "pr-9",
2100
+ trailingPaddingWithAction: "pr-12",
2101
+ labelOffset: "left-2.5",
2102
+ labelOffsetWithLeadingIcon: "left-2.5 peer-placeholder-shown:left-8 peer-focus:left-2.5",
2103
+ leadingIconOffset: "left-3.5",
2104
+ trailingIconOffset: "right-3.5",
2105
+ trailingActionOffset: "right-2.5"
783
2106
  }
784
2107
  },
785
2108
  "2xl": {
2109
+ height: "h-11",
786
2110
  fontSize: "text-base",
787
- verticalPadding: "py-2.25",
788
2111
  labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
789
- labelRestingTop: "peer-placeholder-shown:top-5.5",
790
- autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+20px)] max-h-[calc(var(--textarea-max-rows)*1lh+20px)]",
2112
+ trailingActionFontSize: "text-sm",
2113
+ iconSize: "size-4",
791
2114
  pillShape: {
792
- corners: "rounded-[22px]",
793
- horizontalPadding: "px-5.25",
794
- labelOffset: "left-4.25"
2115
+ corners: "rounded-full",
2116
+ leadingPadding: "pl-5.25",
2117
+ leadingPaddingWithIcon: "pl-11.25",
2118
+ trailingPadding: "pr-5.25",
2119
+ trailingPaddingWithIcon: "pr-11.25",
2120
+ trailingPaddingWithAction: "pr-14",
2121
+ labelOffset: "left-4.25",
2122
+ labelOffsetWithLeadingIcon: "left-4.25 peer-placeholder-shown:left-10.25 peer-focus:left-4.25",
2123
+ leadingIconOffset: "left-5.25",
2124
+ trailingIconOffset: "right-5.25",
2125
+ trailingActionOffset: "right-4.25"
795
2126
  },
796
2127
  roundedShape: {
797
2128
  corners: "rounded-xl",
798
- horizontalPadding: "px-4",
799
- labelOffset: "left-3"
2129
+ leadingPadding: "pl-4",
2130
+ leadingPaddingWithIcon: "pl-10",
2131
+ trailingPadding: "pr-4",
2132
+ trailingPaddingWithIcon: "pr-10",
2133
+ trailingPaddingWithAction: "pr-12",
2134
+ labelOffset: "left-3",
2135
+ labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-9 peer-focus:left-3",
2136
+ leadingIconOffset: "left-4",
2137
+ trailingIconOffset: "right-4",
2138
+ trailingActionOffset: "right-3"
800
2139
  }
801
2140
  },
802
2141
  "3xl": {
2142
+ height: "h-12",
803
2143
  fontSize: "text-base",
804
- verticalPadding: "py-2.75",
805
2144
  labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
806
- labelRestingTop: "peer-placeholder-shown:top-6",
807
- autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+24px)] max-h-[calc(var(--textarea-max-rows)*1lh+24px)]",
2145
+ trailingActionFontSize: "text-sm",
2146
+ iconSize: "size-4",
808
2147
  pillShape: {
809
- corners: "rounded-3xl",
810
- horizontalPadding: "px-5.25",
811
- labelOffset: "left-4.25"
2148
+ corners: "rounded-full",
2149
+ leadingPadding: "pl-5.25",
2150
+ leadingPaddingWithIcon: "pl-11.25",
2151
+ trailingPadding: "pr-5.25",
2152
+ trailingPaddingWithIcon: "pr-11.25",
2153
+ trailingPaddingWithAction: "pr-14",
2154
+ labelOffset: "left-4.25",
2155
+ labelOffsetWithLeadingIcon: "left-4.25 peer-placeholder-shown:left-10.25 peer-focus:left-4.25",
2156
+ leadingIconOffset: "left-5.25",
2157
+ trailingIconOffset: "right-5.25",
2158
+ trailingActionOffset: "right-4.25"
812
2159
  },
813
2160
  roundedShape: {
814
2161
  corners: "rounded-xl",
815
- horizontalPadding: "px-4",
816
- labelOffset: "left-3"
2162
+ leadingPadding: "pl-4",
2163
+ leadingPaddingWithIcon: "pl-10",
2164
+ trailingPadding: "pr-4",
2165
+ trailingPaddingWithIcon: "pr-10",
2166
+ trailingPaddingWithAction: "pr-12",
2167
+ labelOffset: "left-3",
2168
+ labelOffsetWithLeadingIcon: "left-3 peer-placeholder-shown:left-9 peer-focus:left-3",
2169
+ leadingIconOffset: "left-4",
2170
+ trailingIconOffset: "right-4",
2171
+ trailingActionOffset: "right-3"
817
2172
  }
818
2173
  },
819
2174
  "4xl": {
2175
+ height: "h-14",
820
2176
  fontSize: "text-base",
821
- verticalPadding: "py-3.75",
822
2177
  labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
823
- labelRestingTop: "peer-placeholder-shown:top-7",
824
- autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+32px)] max-h-[calc(var(--textarea-max-rows)*1lh+32px)]",
2178
+ trailingActionFontSize: "text-sm",
2179
+ iconSize: "size-4",
825
2180
  pillShape: {
826
- corners: "rounded-[28px]",
827
- horizontalPadding: "px-6",
828
- labelOffset: "left-5"
2181
+ corners: "rounded-full",
2182
+ leadingPadding: "pl-6",
2183
+ leadingPaddingWithIcon: "pl-12",
2184
+ trailingPadding: "pr-6",
2185
+ trailingPaddingWithIcon: "pr-12",
2186
+ trailingPaddingWithAction: "pr-16",
2187
+ labelOffset: "left-5",
2188
+ labelOffsetWithLeadingIcon: "left-5 peer-placeholder-shown:left-11 peer-focus:left-5",
2189
+ leadingIconOffset: "left-6",
2190
+ trailingIconOffset: "right-6",
2191
+ trailingActionOffset: "right-5"
829
2192
  },
830
2193
  roundedShape: {
831
2194
  corners: "rounded-2xl",
832
- horizontalPadding: "px-4.5",
833
- labelOffset: "left-3.5"
2195
+ leadingPadding: "pl-4.5",
2196
+ leadingPaddingWithIcon: "pl-10.5",
2197
+ trailingPadding: "pr-4.5",
2198
+ trailingPaddingWithIcon: "pr-10.5",
2199
+ trailingPaddingWithAction: "pr-13",
2200
+ labelOffset: "left-3.5",
2201
+ labelOffsetWithLeadingIcon: "left-3.5 peer-placeholder-shown:left-9.5 peer-focus:left-3.5",
2202
+ leadingIconOffset: "left-4.5",
2203
+ trailingIconOffset: "right-4.5",
2204
+ trailingActionOffset: "right-3.5"
834
2205
  }
835
2206
  }
836
- }, W = Object.keys(U);
837
- function xe(e) {
2207
+ }, Lt = Object.keys(It);
2208
+ function Rt(e) {
838
2209
  return {
839
- base: [e.fontSize, e.verticalPadding],
840
- label: [e.labelFontSize, e.labelRestingTop]
2210
+ base: [e.height, e.fontSize],
2211
+ label: e.labelFontSize,
2212
+ leadingIcon: e.iconSize,
2213
+ trailingIcon: e.iconSize,
2214
+ trailingAction: e.trailingActionFontSize
841
2215
  };
842
- }
843
- function Se(e) {
844
- let t = U[e];
845
- return [
846
- {
847
- size: e,
848
- pill: !0,
849
- class: {
850
- base: [t.pillShape.corners, t.pillShape.horizontalPadding],
851
- label: t.pillShape.labelOffset
852
- }
853
- },
854
- {
855
- size: e,
856
- pill: !1,
857
- class: {
858
- base: [t.roundedShape.corners, t.roundedShape.horizontalPadding],
859
- label: t.roundedShape.labelOffset
860
- }
861
- },
862
- {
863
- size: e,
864
- autoResize: !0,
865
- class: { base: t.autoResizeHeights }
866
- }
867
- ];
868
- }
869
- var Ce = Object.fromEntries(W.map((e) => [e, xe(U[e])])), we = W.flatMap(Se), Te = k({
870
- slots: {
871
- root: "",
872
- container: "relative",
873
- base: "peer block w-full resize-none border bg-field outline-hidden transition-colors",
874
- label: "pointer-events-none absolute top-0 -translate-y-1/2 bg-linear-to-b from-canvas from-50% to-field to-50% px-1 transition-colors peer-placeholder-shown:bg-none peer-placeholder-shown:transition-all peer-focus:top-0 peer-focus:bg-linear-to-b peer-focus:transition-all",
875
- footer: "mt-2 flex items-start gap-x-4 text-xs",
876
- hint: "text-muted",
877
- errorMessage: "flex items-start gap-x-1.5 light:text-red-600 dark:text-red-400",
878
- errorIcon: "mt-px size-3.5 shrink-0",
879
- characterCount: "ml-auto shrink-0 text-muted tabular-nums"
880
- },
881
- variants: {
882
- variant: {
883
- outline: "",
884
- soft: ""
885
- },
886
- size: Ce,
887
- pill: { true: "" },
888
- autoResize: { true: { base: "field-sizing-content" } },
889
- invalid: { true: {
890
- base: "light:border-red-600 dark:border-red-500 light:selection:bg-red-500/16 dark:selection:bg-red-400/16",
891
- label: "light:text-red-600 dark:text-red-400"
892
- } },
893
- disabled: { true: { container: "opacity-50" } }
894
- },
895
- compoundVariants: [
896
- ...we,
897
- {
898
- invalid: !1,
899
- disabled: !1,
900
- variant: "outline",
901
- class: {
902
- base: "border-line light:not-focus:hover:border-stone-950/20 dark:not-focus:hover:border-white/20 focus:border-primary",
903
- label: "text-muted peer-focus:text-primary"
904
- }
905
- },
906
- {
907
- invalid: !1,
908
- disabled: !1,
909
- variant: "soft",
910
- class: {
911
- base: "border-transparent focus:border-primary",
912
- label: "text-muted peer-focus:text-primary"
913
- }
914
- },
915
- {
916
- invalid: !1,
917
- disabled: !0,
918
- variant: "outline",
919
- class: {
920
- base: "cursor-not-allowed border-line",
921
- label: "text-muted"
922
- }
923
- },
924
- {
925
- invalid: !1,
926
- disabled: !0,
927
- variant: "soft",
928
- class: {
929
- base: "cursor-not-allowed border-transparent",
930
- label: "text-muted"
931
- }
932
- }
933
- ]
934
- }), Ee = [
935
- "id",
936
- "rows",
937
- "maxlength",
938
- "disabled",
939
- "aria-describedby",
940
- "aria-invalid"
941
- ], De = ["for"], Oe = ["id"], ke = ["id"], G = /* @__PURE__ */ c({
942
- inheritAttrs: !1,
943
- __name: "Textarea",
944
- props: /*@__PURE__*/ l({
945
- label: {},
946
- id: {},
947
- rows: { default: 3 },
948
- autoResize: { type: Boolean },
949
- maxRows: { default: 10 },
950
- maxlength: {},
951
- variant: { default: "outline" },
952
- size: { default: "4xl" },
953
- pill: {
954
- type: Boolean,
955
- default: !0
956
- },
957
- hint: {},
958
- errorMessage: {},
959
- invalid: { type: Boolean },
960
- disabled: { type: Boolean },
961
- ui: {},
962
- class: { type: [
963
- Array,
964
- String,
965
- null,
966
- Number,
967
- Boolean
968
- ] }
969
- }, {
970
- modelValue: {},
971
- modelModifiers: {}
972
- }),
973
- emits: ["update:modelValue"],
974
- setup(e) {
975
- let n = e, c = x(e, "modelValue"), { fieldId: l, hintId: f, errorMessageId: m, isInvalid: h, describingElementId: g } = z(n), v = t(() => Te({
976
- variant: n.variant,
977
- size: n.size,
978
- pill: n.pill,
979
- autoResize: n.autoResize,
980
- invalid: h.value,
981
- disabled: n.disabled
982
- })), b = t(() => n.autoResize ? {
983
- "--textarea-min-rows": n.rows,
984
- "--textarea-max-rows": n.maxRows
985
- } : void 0), S = t(() => c.value?.length ?? 0), C = t(() => !!(n.errorMessage || n.hint || n.maxlength));
986
- return (t, x) => (p(), i("div", { class: d(v.value.root({ class: [e.ui?.root, n.class] })) }, [a("div", { class: d(v.value.container({ class: e.ui?.container })) }, [O(a("textarea", u(t.$attrs, {
987
- id: y(l),
988
- "onUpdate:modelValue": x[0] ||= (e) => c.value = e,
989
- rows: e.rows,
990
- maxlength: e.maxlength,
991
- disabled: e.disabled,
992
- "aria-describedby": y(g),
993
- "aria-invalid": y(h) || void 0,
994
- style: b.value,
995
- placeholder: " ",
996
- class: v.value.base({ class: e.ui?.base })
997
- }), null, 16, Ee), [[E, c.value]]), a("label", {
998
- for: y(l),
999
- class: d(v.value.label({ class: e.ui?.label }))
1000
- }, _(e.label), 11, De)], 2), C.value ? (p(), i("div", {
1001
- key: 0,
1002
- class: d(v.value.footer({ class: e.ui?.footer }))
1003
- }, [e.errorMessage ? (p(), i("p", {
1004
- key: 0,
1005
- id: y(m),
1006
- class: d(v.value.errorMessage({ class: e.ui?.errorMessage }))
1007
- }, [s(y(A), { class: d(v.value.errorIcon({ class: e.ui?.errorIcon })) }, null, 8, ["class"]), o(" " + _(e.errorMessage), 1)], 10, Oe)) : e.hint ? (p(), i("p", {
1008
- key: 1,
1009
- id: y(f),
1010
- class: d(v.value.hint({ class: e.ui?.hint }))
1011
- }, _(e.hint), 11, ke)) : r("", !0), e.maxlength ? (p(), i("p", {
1012
- key: 2,
1013
- class: d(v.value.characterCount({ class: e.ui?.characterCount }))
1014
- }, _(S.value) + "/" + _(e.maxlength), 3)) : r("", !0)], 2)) : r("", !0)], 2));
1015
- }
1016
- }), K = {
1017
- outline: {
1018
- primary: "inset-ring inset-ring-line",
1019
- success: "inset-ring light:inset-ring-green-600 light:text-green-700 dark:inset-ring-green-500 dark:text-green-400",
1020
- warning: "inset-ring light:inset-ring-orange-600 light:text-orange-700 dark:inset-ring-orange-500 dark:text-orange-400",
1021
- caution: "inset-ring light:inset-ring-yellow-600 light:text-yellow-700 dark:inset-ring-yellow-500 dark:text-yellow-400",
1022
- danger: "inset-ring light:inset-ring-red-600 light:text-red-600 dark:inset-ring-red-500 dark:text-red-400",
1023
- info: "inset-ring light:inset-ring-blue-600 light:text-blue-600 dark:inset-ring-blue-400 dark:text-blue-300",
1024
- discovery: "inset-ring light:inset-ring-purple-600 light:text-purple-600 dark:inset-ring-purple-400 dark:text-purple-300"
1025
- },
1026
- soft: {
1027
- primary: "inset-ring light:bg-stone-950/4 light:inset-ring-stone-950/6 dark:bg-white/6 dark:inset-ring-white/8",
1028
- success: "inset-ring light:bg-green-500/6 light:inset-ring-green-500/16 light:text-green-700 dark:bg-green-400/10 dark:inset-ring-green-400/20 dark:text-green-400",
1029
- warning: "inset-ring light:bg-orange-500/6 light:inset-ring-orange-500/16 light:text-orange-700 dark:bg-orange-400/10 dark:inset-ring-orange-400/20 dark:text-orange-400",
1030
- caution: "inset-ring light:bg-yellow-500/8 light:inset-ring-yellow-500/20 light:text-yellow-800 dark:bg-yellow-400/10 dark:inset-ring-yellow-400/20 dark:text-yellow-400",
1031
- danger: "inset-ring light:bg-red-500/6 light:inset-ring-red-500/16 light:text-red-600 dark:bg-red-400/10 dark:inset-ring-red-400/20 dark:text-red-400",
1032
- info: "inset-ring light:bg-blue-500/6 light:inset-ring-blue-500/16 light:text-blue-600 dark:bg-blue-400/10 dark:inset-ring-blue-400/20 dark:text-blue-300",
1033
- discovery: "inset-ring light:bg-purple-500/6 light:inset-ring-purple-500/16 light:text-purple-600 dark:bg-purple-400/10 dark:inset-ring-purple-400/20 dark:text-purple-300"
1034
- },
1035
- solid: {
1036
- primary: "light:bg-neutral-900 light:text-white dark:bg-stone-200 dark:text-stone-950",
1037
- success: "light:bg-green-600 light:text-white dark:bg-green-600 dark:text-white",
1038
- warning: "light:bg-orange-600 light:text-white dark:bg-orange-600 dark:text-white",
1039
- caution: "light:bg-yellow-700 light:text-white dark:bg-yellow-700 dark:text-white",
1040
- danger: "light:bg-red-600 light:text-white dark:bg-red-600 dark:text-white",
1041
- info: "light:bg-blue-600 light:text-white dark:bg-blue-500 dark:text-white",
1042
- discovery: "light:bg-purple-600 light:text-white dark:bg-purple-500 dark:text-white"
1043
- }
1044
- }, Ae = Object.keys(K), je = Object.keys(K.outline), Me = Ae.flatMap((e) => je.map((t) => ({
1045
- variant: e,
1046
- color: t,
1047
- class: { root: K[e][t] }
1048
- }))), Ne = k({
2216
+ }
2217
+ function zt(e) {
2218
+ let t = It[e];
2219
+ return [!0, !1].flatMap((n) => {
2220
+ let r = n ? t.pillShape : t.roundedShape;
2221
+ return [
2222
+ {
2223
+ size: e,
2224
+ pill: n,
2225
+ class: {
2226
+ base: r.corners,
2227
+ leadingIcon: r.leadingIconOffset,
2228
+ trailingIconButton: r.trailingIconOffset,
2229
+ trailingAction: r.trailingActionOffset
2230
+ }
2231
+ },
2232
+ {
2233
+ size: e,
2234
+ pill: n,
2235
+ hasLeadingIcon: !1,
2236
+ class: {
2237
+ base: r.leadingPadding,
2238
+ label: r.labelOffset
2239
+ }
2240
+ },
2241
+ {
2242
+ size: e,
2243
+ pill: n,
2244
+ hasLeadingIcon: !0,
2245
+ class: {
2246
+ base: r.leadingPaddingWithIcon,
2247
+ label: r.labelOffsetWithLeadingIcon
2248
+ }
2249
+ },
2250
+ {
2251
+ size: e,
2252
+ pill: n,
2253
+ trailingContent: "none",
2254
+ class: { base: r.trailingPadding }
2255
+ },
2256
+ {
2257
+ size: e,
2258
+ pill: n,
2259
+ trailingContent: ["icon", "iconButton"],
2260
+ class: { base: r.trailingPaddingWithIcon }
2261
+ },
2262
+ {
2263
+ size: e,
2264
+ pill: n,
2265
+ trailingContent: "icon",
2266
+ class: { trailingIcon: r.trailingIconOffset }
2267
+ },
2268
+ {
2269
+ size: e,
2270
+ pill: n,
2271
+ trailingContent: "action",
2272
+ class: { base: r.trailingPaddingWithAction }
2273
+ }
2274
+ ];
2275
+ });
2276
+ }
2277
+ var Bt = Object.fromEntries(Lt.map((e) => [e, Rt(It[e])])), Vt = Lt.flatMap(zt), Ht = G({
1049
2278
  slots: {
1050
- root: "@container w-full rounded-xl p-4 text-sm leading-5",
1051
- body: "flex gap-3",
1052
- icon: "size-5 shrink-0",
1053
- content: "min-w-0 flex-1",
1054
- wrapper: "min-w-0 flex-1",
1055
- title: "font-semibold text-pretty",
1056
- description: "text-pretty",
1057
- actions: "flex shrink-0 gap-2"
2279
+ root: "",
2280
+ container: "relative",
2281
+ base: "peer w-full border bg-field outline-hidden transition-colors",
2282
+ label: "pointer-events-none absolute top-0 -translate-y-1/2 bg-linear-to-b from-canvas from-50% to-field to-50% px-1 transition-colors peer-placeholder-shown:top-1/2 peer-placeholder-shown:transition-all peer-focus:transition-all peer-placeholder-shown:bg-none peer-focus:top-0 peer-focus:bg-linear-to-b",
2283
+ leadingIcon: "pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted",
2284
+ trailingIcon: "",
2285
+ trailingIconButton: "absolute top-1/2 flex -translate-y-1/2 cursor-pointer rounded-full text-muted outline-primary transition-colors hover:text-inherit focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed",
2286
+ trailingAction: "absolute top-1/2 -translate-y-1/2 cursor-pointer font-medium text-primary disabled:cursor-not-allowed aria-disabled:cursor-not-allowed",
2287
+ hint: "mt-2 text-xs text-muted",
2288
+ errorMessage: "mt-2 flex items-start gap-x-1.5 text-xs light:text-red-600 dark:text-red-400",
2289
+ errorIcon: "mt-px size-3.5 shrink-0"
1058
2290
  },
1059
2291
  variants: {
1060
2292
  variant: {
1061
2293
  outline: "",
1062
- soft: "",
1063
- solid: ""
1064
- },
1065
- color: {
1066
- primary: "",
1067
- success: "",
1068
- warning: "",
1069
- caution: "",
1070
- danger: "",
1071
- info: "",
1072
- discovery: ""
1073
- },
1074
- actionsPlacement: {
1075
- end: "",
1076
- bottom: ""
2294
+ soft: ""
1077
2295
  },
1078
- hasActions: {
1079
- true: "",
1080
- false: { body: "items-center" }
2296
+ size: Bt,
2297
+ pill: { true: "" },
2298
+ hasLeadingIcon: { true: "" },
2299
+ trailingContent: {
2300
+ none: "",
2301
+ icon: { trailingIcon: "pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted" },
2302
+ iconButton: "",
2303
+ action: ""
1081
2304
  },
1082
- hasTitle: { true: { description: "mt-0.5" } }
2305
+ invalid: { true: {
2306
+ base: "light:border-red-600 dark:border-red-500 light:selection:bg-red-500/16 dark:selection:bg-red-400/16",
2307
+ label: "light:text-red-600 dark:text-red-400"
2308
+ } },
2309
+ disabled: { true: { container: "opacity-50" } }
1083
2310
  },
1084
2311
  compoundVariants: [
1085
- ...Me,
2312
+ ...Vt,
1086
2313
  {
1087
- hasActions: !0,
1088
- actionsPlacement: "end",
2314
+ invalid: !1,
2315
+ disabled: !1,
2316
+ variant: "outline",
1089
2317
  class: {
1090
- body: "items-start @md:items-center",
1091
- content: "@md:flex @md:items-center @md:justify-between",
1092
- actions: "mt-4 @md:mt-0 @md:ml-4"
2318
+ base: "border-line light:not-focus:hover:border-stone-950/20 dark:not-focus:hover:border-white/20 focus:border-primary",
2319
+ label: "text-muted peer-focus:text-primary"
1093
2320
  }
1094
2321
  },
1095
2322
  {
1096
- hasActions: !0,
1097
- actionsPlacement: "bottom",
2323
+ invalid: !1,
2324
+ disabled: !1,
2325
+ variant: "soft",
1098
2326
  class: {
1099
- body: "items-start",
1100
- actions: "mt-4"
2327
+ base: "border-transparent focus:border-primary",
2328
+ label: "text-muted peer-focus:text-primary"
1101
2329
  }
1102
- }
1103
- ]
1104
- }), Pe = ["role"], q = /* @__PURE__ */ c({
1105
- __name: "Alert",
1106
- props: {
1107
- title: {},
1108
- description: {},
1109
- variant: { default: "outline" },
1110
- color: { default: "primary" },
1111
- icon: {},
1112
- showIcon: {
1113
- type: Boolean,
1114
- default: !0
1115
- },
1116
- actionsPlacement: { default: "end" },
1117
- ui: {},
1118
- class: { type: [
1119
- Array,
1120
- String,
1121
- null,
1122
- Number,
1123
- Boolean
1124
- ] }
1125
- },
1126
- setup(e) {
1127
- let s = e, c = S(), l = {
1128
- warning: M,
1129
- caution: M,
1130
- danger: M,
1131
- success: ee
1132
- }, u = t(() => s.icon ?? l[s.color] ?? j), f = t(() => !!(s.title || c.title)), m = t(() => !!(s.description || c.description)), v = t(() => !!c.actions), y = t(() => Ne({
1133
- variant: s.variant,
1134
- color: s.color,
1135
- actionsPlacement: s.actionsPlacement,
1136
- hasActions: v.value,
1137
- hasTitle: f.value
1138
- }));
1139
- return (t, c) => (p(), i("div", {
1140
- role: e.color === "danger" ? "alert" : void 0,
1141
- class: d(y.value.root({ class: [e.ui?.root, s.class] }))
1142
- }, [a("div", { class: d(y.value.body({ class: e.ui?.body })) }, [e.showIcon ? (p(), n(g(u.value), {
1143
- key: 0,
1144
- class: d(y.value.icon({ class: e.ui?.icon }))
1145
- }, null, 8, ["class"])) : r("", !0), a("div", { class: d(y.value.content({ class: e.ui?.content })) }, [a("div", { class: d(y.value.wrapper({ class: e.ui?.wrapper })) }, [f.value ? (p(), i("div", {
1146
- key: 0,
1147
- class: d(y.value.title({ class: e.ui?.title }))
1148
- }, [h(t.$slots, "title", {}, () => [o(_(e.title), 1)])], 2)) : r("", !0), m.value ? (p(), i("div", {
1149
- key: 1,
1150
- class: d(y.value.description({ class: e.ui?.description }))
1151
- }, [h(t.$slots, "description", {}, () => [o(_(e.description), 1)])], 2)) : r("", !0)], 2), v.value ? (p(), i("div", {
1152
- key: 0,
1153
- class: d(y.value.actions({ class: e.ui?.actions }))
1154
- }, [h(t.$slots, "actions")], 2)) : r("", !0)], 2)], 2)], 10, Pe));
1155
- }
1156
- }), J = {
1157
- sm: {
1158
- height: "h-5",
1159
- fontSize: "text-xs/none tracking-wide",
1160
- gutter: "px-1.25",
1161
- pillGutter: "px-1.75",
1162
- radius: "rounded-sm",
1163
- iconSize: "size-3",
1164
- dotSize: "size-1.5"
1165
- },
1166
- md: {
1167
- height: "h-5.5",
1168
- fontSize: "text-sm/none",
1169
- gutter: "px-1.5",
1170
- pillGutter: "px-2",
1171
- radius: "rounded-sm",
1172
- iconSize: "size-4",
1173
- dotSize: "size-1.5"
1174
- },
1175
- lg: {
1176
- height: "h-6",
1177
- fontSize: "text-sm/none",
1178
- gutter: "px-2",
1179
- pillGutter: "px-2.75",
1180
- radius: "rounded-md",
1181
- iconSize: "size-4",
1182
- dotSize: "size-2"
1183
- }
1184
- }, Fe = Object.keys(J), Y = {
1185
- soft: {
1186
- secondary: "bg-secondary/16 text-secondary",
1187
- gray: "light:bg-stone-950/8 dark:bg-stone-200/12",
1188
- success: "light:bg-green-500/16 light:text-green-700 dark:bg-green-400/16 dark:text-green-400",
1189
- warning: "light:bg-orange-500/16 light:text-orange-700 dark:bg-orange-400/16 dark:text-orange-400",
1190
- danger: "light:bg-red-500/16 light:text-red-600 dark:bg-red-400/16 dark:text-red-400",
1191
- info: "light:bg-blue-500/16 light:text-blue-600 dark:bg-blue-400/16 dark:text-blue-300",
1192
- discovery: "light:bg-purple-500/16 light:text-purple-600 dark:bg-purple-400/16 dark:text-purple-300"
1193
- },
1194
- solid: {
1195
- secondary: "bg-secondary light:text-white dark:text-stone-950",
1196
- gray: "light:bg-stone-600 light:text-white dark:bg-stone-600 dark:text-white",
1197
- success: "light:bg-green-600 light:text-white dark:bg-green-600 dark:text-white",
1198
- warning: "light:bg-orange-600 light:text-white dark:bg-orange-600 dark:text-white",
1199
- danger: "light:bg-red-600 light:text-white dark:bg-red-600 dark:text-white",
1200
- info: "light:bg-blue-600 light:text-white dark:bg-blue-500 dark:text-white",
1201
- discovery: "light:bg-purple-600 light:text-white dark:bg-purple-500 dark:text-white"
1202
- },
1203
- outline: {
1204
- secondary: "inset-ring inset-ring-secondary text-secondary",
1205
- gray: "inset-ring text-muted light:inset-ring-stone-950/16 dark:inset-ring-stone-200/25",
1206
- success: "inset-ring light:inset-ring-green-600 light:text-green-700 dark:inset-ring-green-500 dark:text-green-400",
1207
- warning: "inset-ring light:inset-ring-orange-600 light:text-orange-700 dark:inset-ring-orange-500 dark:text-orange-400",
1208
- danger: "inset-ring light:inset-ring-red-600 light:text-red-600 dark:inset-ring-red-500 dark:text-red-400",
1209
- info: "inset-ring light:inset-ring-blue-600 light:text-blue-600 dark:inset-ring-blue-400 dark:text-blue-300",
1210
- discovery: "inset-ring light:inset-ring-purple-600 light:text-purple-600 dark:inset-ring-purple-400 dark:text-purple-300"
1211
- }
1212
- }, Ie = Object.keys(Y), Le = Object.keys(Y.soft);
1213
- function Re(e) {
1214
- return {
1215
- base: [e.height, e.fontSize],
1216
- dot: e.dotSize,
1217
- leadingIcon: e.iconSize,
1218
- trailingIcon: e.iconSize
1219
- };
1220
- }
1221
- function ze(e) {
1222
- let t = J[e];
1223
- return [{
1224
- size: e,
1225
- pill: !0,
1226
- class: { base: ["rounded-full", t.pillGutter] }
1227
- }, {
1228
- size: e,
1229
- pill: !1,
1230
- class: { base: [t.radius, t.gutter] }
1231
- }];
1232
- }
1233
- var Be = Object.fromEntries(Fe.map((e) => [e, Re(J[e])])), Ve = Fe.flatMap(ze), He = Ie.flatMap((e) => Le.map((t) => ({
1234
- variant: e,
1235
- color: t,
1236
- class: { base: Y[e][t] }
1237
- }))), Ue = k({
1238
- slots: {
1239
- base: "inline-flex shrink-0 items-center gap-1 font-semibold whitespace-nowrap",
1240
- dot: "shrink-0 rounded-full bg-current",
1241
- leadingIcon: "-ml-px shrink-0",
1242
- trailingIcon: "-mr-px shrink-0"
1243
- },
1244
- variants: {
1245
- variant: {
1246
- soft: "",
1247
- solid: "",
1248
- outline: ""
1249
2330
  },
1250
- color: {
1251
- secondary: "",
1252
- gray: "",
1253
- success: "",
1254
- warning: "",
1255
- danger: "",
1256
- info: "",
1257
- discovery: ""
2331
+ {
2332
+ invalid: !1,
2333
+ disabled: !0,
2334
+ variant: "outline",
2335
+ class: {
2336
+ base: "cursor-not-allowed border-line",
2337
+ label: "text-muted"
2338
+ }
1258
2339
  },
1259
- size: Be,
1260
- pill: { true: "" }
1261
- },
1262
- compoundVariants: [...Ve, ...He]
1263
- }), We = /* @__PURE__ */ c({
1264
- __name: "Badge",
1265
- props: {
2340
+ {
2341
+ invalid: !1,
2342
+ disabled: !0,
2343
+ variant: "soft",
2344
+ class: {
2345
+ base: "cursor-not-allowed border-transparent",
2346
+ label: "text-muted"
2347
+ }
2348
+ }
2349
+ ]
2350
+ }), Ut = [
2351
+ "id",
2352
+ "type",
2353
+ "disabled",
2354
+ "aria-describedby",
2355
+ "aria-invalid"
2356
+ ], Wt = ["for"], Gt = ["aria-label", "disabled"], Kt = ["id"], qt = ["id"], Jt = /* @__PURE__ */ l({
2357
+ inheritAttrs: !1,
2358
+ __name: "TextField",
2359
+ props: /*@__PURE__*/ f({
1266
2360
  label: {},
1267
- variant: { default: "soft" },
1268
- color: { default: "gray" },
1269
- size: { default: "sm" },
2361
+ id: {},
2362
+ type: { default: "text" },
2363
+ variant: { default: "outline" },
2364
+ size: { default: "4xl" },
2365
+ pill: {
2366
+ type: Boolean,
2367
+ default: !0
2368
+ },
1270
2369
  leadingIcon: {},
1271
2370
  trailingIcon: {},
1272
- dot: { type: Boolean },
1273
- pill: { type: Boolean },
2371
+ trailingIconLabel: {},
2372
+ trailingActionLabel: {},
2373
+ trailingActionHref: {},
2374
+ hint: {},
2375
+ errorMessage: {},
2376
+ invalid: { type: Boolean },
2377
+ disabled: { type: Boolean },
1274
2378
  ui: {},
1275
2379
  class: { type: [
1276
2380
  Array,
@@ -1279,471 +2383,477 @@ var Be = Object.fromEntries(Fe.map((e) => [e, Re(J[e])])), Ve = Fe.flatMap(ze),
1279
2383
  Number,
1280
2384
  Boolean
1281
2385
  ] }
1282
- },
1283
- setup(e) {
1284
- let a = e, s = t(() => Ue({
1285
- variant: a.variant,
1286
- color: a.color,
1287
- size: a.size,
1288
- pill: a.pill
1289
- }));
1290
- return (t, c) => (p(), i("span", { class: d(s.value.base({ class: [e.ui?.base, a.class] })) }, [
1291
- e.dot ? (p(), i("span", {
2386
+ }, {
2387
+ modelValue: {},
2388
+ modelModifiers: {}
2389
+ }),
2390
+ emits: /*@__PURE__*/ f(["trailingIconClick", "trailingActionClick"], ["update:modelValue"]),
2391
+ setup(e, { emit: t }) {
2392
+ let l = e, u = t, d = M(e, "modelValue"), { fieldId: f, hintId: m, errorMessageId: g, isInvalid: _, describingElementId: v } = Ft(l), y = n(() => l.trailingActionLabel ? "action" : l.trailingIcon ? l.trailingIconLabel ? "iconButton" : "icon" : "none"), x = n(() => Ht({
2393
+ variant: l.variant,
2394
+ size: l.size,
2395
+ pill: l.pill,
2396
+ hasLeadingIcon: !!l.leadingIcon,
2397
+ trailingContent: y.value,
2398
+ invalid: _.value,
2399
+ disabled: l.disabled
2400
+ })), S = n(() => l.trailingActionHref ? "a" : "button"), C = n(() => l.trailingActionHref ? l.disabled ? {
2401
+ role: "link",
2402
+ "aria-disabled": "true"
2403
+ } : { href: l.trailingActionHref } : {
2404
+ type: "button",
2405
+ disabled: l.disabled
2406
+ });
2407
+ function w(e) {
2408
+ l.disabled || u("trailingActionClick", e);
2409
+ }
2410
+ return (t, n) => (b(), a("div", { class: h(x.value.root({ class: [e.ui?.root, l.class] })) }, [o("div", { class: h(x.value.container({ class: e.ui?.container })) }, [
2411
+ V(o("input", p(t.$attrs, {
2412
+ id: A(f),
2413
+ "onUpdate:modelValue": n[0] ||= (e) => d.value = e,
2414
+ type: e.type,
2415
+ disabled: e.disabled,
2416
+ "aria-describedby": A(v),
2417
+ "aria-invalid": A(_) || void 0,
2418
+ placeholder: " ",
2419
+ class: x.value.base({ class: e.ui?.base })
2420
+ }), null, 16, Ut), [[I, d.value]]),
2421
+ o("label", {
2422
+ for: A(f),
2423
+ class: h(x.value.label({ class: e.ui?.label }))
2424
+ }, O(e.label), 11, Wt),
2425
+ e.leadingIcon ? (b(), r(E(e.leadingIcon), {
1292
2426
  key: 0,
1293
- "aria-hidden": "true",
1294
- class: d(s.value.dot({ class: e.ui?.dot }))
1295
- }, null, 2)) : r("", !0),
1296
- e.leadingIcon ? (p(), n(g(e.leadingIcon), {
1297
- key: 1,
1298
- class: d(s.value.leadingIcon({ class: e.ui?.leadingIcon }))
1299
- }, null, 8, ["class"])) : r("", !0),
1300
- h(t.$slots, "default", {}, () => [o(_(e.label), 1)]),
1301
- e.trailingIcon ? (p(), n(g(e.trailingIcon), {
2427
+ class: h(x.value.leadingIcon({ class: e.ui?.leadingIcon }))
2428
+ }, null, 8, ["class"])) : i("", !0),
2429
+ y.value === "action" ? (b(), r(E(S.value), p({ key: 1 }, C.value, {
2430
+ class: x.value.trailingAction({ class: e.ui?.trailingAction }),
2431
+ onClick: w
2432
+ }), {
2433
+ default: B(() => [s(O(e.trailingActionLabel), 1)]),
2434
+ _: 1
2435
+ }, 16, ["class"])) : y.value === "iconButton" ? (b(), a("button", {
1302
2436
  key: 2,
1303
- class: d(s.value.trailingIcon({ class: e.ui?.trailingIcon }))
1304
- }, null, 8, ["class"])) : r("", !0)
1305
- ], 2));
2437
+ type: "button",
2438
+ "aria-label": e.trailingIconLabel,
2439
+ disabled: e.disabled,
2440
+ class: h(x.value.trailingIconButton({ class: e.ui?.trailingIconButton })),
2441
+ onClick: n[1] ||= (e) => u("trailingIconClick", e)
2442
+ }, [(b(), r(E(e.trailingIcon), { class: h(x.value.trailingIcon({ class: e.ui?.trailingIcon })) }, null, 8, ["class"]))], 10, Gt)) : y.value === "icon" ? (b(), r(E(e.trailingIcon), {
2443
+ key: 3,
2444
+ class: h(x.value.trailingIcon({ class: e.ui?.trailingIcon }))
2445
+ }, null, 8, ["class"])) : i("", !0)
2446
+ ], 2), e.errorMessage ? (b(), a("p", {
2447
+ key: 0,
2448
+ id: A(g),
2449
+ class: h(x.value.errorMessage({ class: e.ui?.errorMessage }))
2450
+ }, [c(A(H), { class: h(x.value.errorIcon({ class: e.ui?.errorIcon })) }, null, 8, ["class"]), s(" " + O(e.errorMessage), 1)], 10, Kt)) : e.hint ? (b(), a("p", {
2451
+ key: 1,
2452
+ id: A(m),
2453
+ class: h(x.value.hint({ class: e.ui?.hint }))
2454
+ }, O(e.hint), 11, qt)) : i("", !0)], 2));
1306
2455
  }
1307
- }), X = {
1308
- "3xs": {
1309
- height: "h-5.5",
1310
- width: "w-5.5",
1311
- gutter: "px-1.5",
1312
- pillGutter: "px-2",
1313
- radius: "rounded-md",
1314
- fontSize: "text-xs/none",
1315
- contentGap: "gap-0.75",
1316
- iconSize: "size-3.5",
1317
- leadingIconOffset: "-ml-px",
1318
- trailingIconOffset: "-mr-px",
1319
- loadingIndicatorSize: "text-[11px]"
1320
- },
1321
- "2xs": {
1322
- height: "h-6",
1323
- width: "w-6",
1324
- gutter: "px-2",
1325
- pillGutter: "px-2.75",
1326
- radius: "rounded-md",
1327
- fontSize: "text-xs/none",
1328
- contentGap: "gap-1",
1329
- iconSize: "size-4",
1330
- leadingIconOffset: "-ml-px",
1331
- trailingIconOffset: "-mr-px",
1332
- loadingIndicatorSize: "text-xs"
1333
- },
1334
- xs: {
1335
- height: "h-6.5",
1336
- width: "w-6.5",
1337
- gutter: "px-2",
1338
- pillGutter: "px-2.75",
1339
- radius: "rounded-md",
1340
- fontSize: "text-sm/none",
1341
- contentGap: "gap-1",
1342
- iconSize: "size-4",
1343
- leadingIconOffset: "-ml-px",
1344
- trailingIconOffset: "-mr-px",
1345
- loadingIndicatorSize: "text-[13px]"
1346
- },
1347
- sm: {
1348
- height: "h-7",
1349
- width: "w-7",
1350
- gutter: "px-2.5",
1351
- pillGutter: "px-3.25",
1352
- radius: "rounded-md",
1353
- fontSize: "text-sm/none",
1354
- contentGap: "gap-1",
1355
- iconSize: "size-4.5",
1356
- leadingIconOffset: "-ml-px",
1357
- trailingIconOffset: "-mr-px",
1358
- loadingIndicatorSize: "text-[15px]"
1359
- },
2456
+ }), Yt = {
1360
2457
  md: {
1361
- height: "h-8",
1362
- width: "w-8",
1363
- gutter: "px-3",
1364
- pillGutter: "px-4",
1365
- radius: "rounded-lg",
1366
- fontSize: "text-sm/none",
1367
- contentGap: "gap-1.5",
1368
- iconSize: "size-4.5",
1369
- leadingIconOffset: "-ml-px",
1370
- trailingIconOffset: "-mr-px",
1371
- loadingIndicatorSize: "text-base"
1372
- },
1373
- lg: {
1374
- height: "h-9",
1375
- width: "w-9",
1376
- gutter: "px-3",
1377
- pillGutter: "px-4",
1378
- radius: "rounded-lg",
1379
- fontSize: "text-sm/none",
1380
- contentGap: "gap-1.5",
1381
- iconSize: "size-4.5",
1382
- leadingIconOffset: "-ml-px",
1383
- trailingIconOffset: "-mr-px",
1384
- loadingIndicatorSize: "text-base"
1385
- },
1386
- xl: {
1387
- height: "h-10",
1388
- width: "w-10",
1389
- gutter: "px-3.5",
1390
- pillGutter: "px-4.75",
1391
- radius: "rounded-[10px]",
1392
- fontSize: "text-sm/none",
1393
- contentGap: "gap-1.5",
1394
- iconSize: "size-4.5",
1395
- leadingIconOffset: "-ml-px",
1396
- trailingIconOffset: "-mr-px",
1397
- loadingIndicatorSize: "text-lg"
1398
- },
1399
- "2xl": {
1400
- height: "h-11",
1401
- width: "w-11",
1402
- gutter: "px-3.5",
1403
- pillGutter: "px-4.75",
1404
- radius: "rounded-xl",
1405
- fontSize: "text-base/none",
1406
- contentGap: "gap-1.5",
1407
- iconSize: "size-5",
1408
- leadingIconOffset: "-ml-0.5",
1409
- trailingIconOffset: "-mr-0.5",
1410
- loadingIndicatorSize: "text-lg"
1411
- },
1412
- "3xl": {
1413
- height: "h-12",
1414
- width: "w-12",
1415
- gutter: "px-4",
1416
- pillGutter: "px-5.25",
1417
- radius: "rounded-xl",
1418
- fontSize: "text-base/none",
1419
- contentGap: "gap-1.5",
1420
- iconSize: "size-5",
1421
- leadingIconOffset: "-ml-0.5",
1422
- trailingIconOffset: "-mr-0.5",
1423
- loadingIndicatorSize: "text-xl"
1424
- },
1425
- "4xl": {
1426
- height: "h-14",
1427
- width: "w-14",
1428
- gutter: "px-4.5",
1429
- pillGutter: "px-6",
1430
- radius: "rounded-2xl",
1431
- fontSize: "text-base/none",
1432
- contentGap: "gap-3",
1433
- iconSize: "size-6",
1434
- leadingIconOffset: "-ml-0.5",
1435
- trailingIconOffset: "-mr-0.5",
1436
- loadingIndicatorSize: "text-2xl"
1437
- }
1438
- }, Ge = Object.keys(X), Ke = {
1439
- surface: "light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
1440
- selectedSurface: "light:before:bg-stone-950/12 dark:before:bg-stone-200/16",
1441
- text: "",
1442
- selectedText: "",
1443
- interaction: "light:hover:before:bg-stone-950/12 dark:hover:before:bg-stone-200/16 light:active:before:bg-stone-950/16 dark:active:before:bg-stone-200/20"
1444
- }, Z = {
1445
- solid: {
1446
- primary: {
1447
- surface: "before:bg-primary",
1448
- selectedSurface: "before:bg-primary before:brightness-90",
1449
- text: "light:text-white dark:text-stone-950",
1450
- selectedText: "light:text-white dark:text-stone-950",
1451
- interaction: "hover:before:brightness-90"
1452
- },
1453
- secondary: {
1454
- surface: "before:bg-secondary",
1455
- selectedSurface: "before:bg-secondary before:brightness-90",
1456
- text: "light:text-white dark:text-stone-950",
1457
- selectedText: "light:text-white dark:text-stone-950",
1458
- interaction: "hover:before:brightness-90"
1459
- },
1460
- neutral: {
1461
- surface: "light:before:bg-neutral-900 dark:before:bg-stone-200",
1462
- selectedSurface: "light:before:bg-neutral-800 dark:before:bg-stone-300",
1463
- text: "light:text-white dark:text-stone-950",
1464
- selectedText: "light:text-white dark:text-stone-950",
1465
- interaction: "light:hover:before:bg-neutral-800 dark:hover:before:bg-stone-300 light:active:before:bg-neutral-700"
1466
- },
1467
- gray: {
1468
- surface: "light:before:bg-stone-600 dark:before:bg-stone-700",
1469
- selectedSurface: "light:before:bg-stone-700 dark:before:bg-stone-600",
1470
- text: "light:text-white dark:text-white",
1471
- selectedText: "light:text-white dark:text-white",
1472
- interaction: "light:hover:before:bg-stone-700 dark:hover:before:bg-stone-600 light:active:before:bg-stone-800"
1473
- },
1474
- danger: {
1475
- surface: "light:before:bg-red-600 dark:before:bg-red-600",
1476
- selectedSurface: "light:before:bg-red-700 dark:before:bg-red-700",
1477
- text: "light:text-white dark:text-white",
1478
- selectedText: "light:text-white dark:text-white",
1479
- interaction: "light:hover:before:bg-red-700 dark:hover:before:bg-red-700"
2458
+ fontSize: "text-sm",
2459
+ verticalPadding: "py-1.25",
2460
+ labelFontSize: "text-[11px] peer-placeholder-shown:text-sm peer-focus:text-[11px]",
2461
+ labelRestingTop: "peer-placeholder-shown:top-4",
2462
+ autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+12px)] max-h-[calc(var(--textarea-max-rows)*1lh+12px)]",
2463
+ pillShape: {
2464
+ corners: "rounded-2xl",
2465
+ horizontalPadding: "px-4",
2466
+ labelOffset: "left-3"
2467
+ },
2468
+ roundedShape: {
2469
+ corners: "rounded-lg",
2470
+ horizontalPadding: "px-3",
2471
+ labelOffset: "left-2"
1480
2472
  }
1481
2473
  },
1482
- soft: {
1483
- primary: {
1484
- surface: "before:bg-primary/16",
1485
- selectedSurface: "before:bg-primary/30",
1486
- text: "text-primary",
1487
- selectedText: "text-primary",
1488
- interaction: "hover:before:bg-primary/30"
1489
- },
1490
- secondary: {
1491
- surface: "before:bg-secondary/16",
1492
- selectedSurface: "before:bg-secondary/30",
1493
- text: "text-secondary",
1494
- selectedText: "text-secondary",
1495
- interaction: "hover:before:bg-secondary/30"
2474
+ lg: {
2475
+ fontSize: "text-sm",
2476
+ verticalPadding: "py-1.75",
2477
+ labelFontSize: "text-[11px] peer-placeholder-shown:text-sm peer-focus:text-[11px]",
2478
+ labelRestingTop: "peer-placeholder-shown:top-4.5",
2479
+ autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+16px)] max-h-[calc(var(--textarea-max-rows)*1lh+16px)]",
2480
+ pillShape: {
2481
+ corners: "rounded-[18px]",
2482
+ horizontalPadding: "px-4",
2483
+ labelOffset: "left-3"
1496
2484
  },
1497
- neutral: Ke,
1498
- gray: Ke,
1499
- danger: {
1500
- surface: "light:before:bg-red-500/16 dark:before:bg-red-400/16",
1501
- selectedSurface: "light:before:bg-red-500/30 dark:before:bg-red-400/30",
1502
- text: "light:text-red-600 dark:text-red-400",
1503
- selectedText: "light:text-red-600 dark:text-red-400",
1504
- interaction: "light:hover:before:bg-red-500/30 dark:hover:before:bg-red-400/30"
2485
+ roundedShape: {
2486
+ corners: "rounded-lg",
2487
+ horizontalPadding: "px-3",
2488
+ labelOffset: "left-2"
1505
2489
  }
1506
2490
  },
1507
- outline: {
1508
- primary: {
1509
- surface: "before:border before:border-primary",
1510
- selectedSurface: "before:border before:border-primary before:bg-primary/8",
1511
- text: "text-primary",
1512
- selectedText: "text-primary",
1513
- interaction: "hover:before:bg-primary/8"
1514
- },
1515
- secondary: {
1516
- surface: "before:border before:border-secondary",
1517
- selectedSurface: "before:border before:border-secondary before:bg-secondary/8",
1518
- text: "text-secondary",
1519
- selectedText: "text-secondary",
1520
- interaction: "hover:before:bg-secondary/8"
1521
- },
1522
- neutral: {
1523
- surface: "before:border light:before:border-stone-950/16 dark:before:border-stone-200/25",
1524
- selectedSurface: "before:border light:before:border-stone-950/20 dark:before:border-stone-200/30 light:before:bg-stone-950/2 dark:before:bg-stone-200/4",
1525
- text: "",
1526
- selectedText: "",
1527
- interaction: "light:hover:before:border-stone-950/20 dark:hover:before:border-stone-200/30 light:hover:before:bg-stone-950/2 dark:hover:before:bg-stone-200/4 light:active:before:bg-stone-950/4 dark:active:before:bg-stone-200/6"
1528
- },
1529
- gray: {
1530
- surface: "before:border light:before:border-stone-950/16 dark:before:border-stone-200/25",
1531
- selectedSurface: "before:border light:before:border-stone-950/20 dark:before:border-stone-200/30 light:before:bg-stone-950/2 dark:before:bg-stone-200/4",
1532
- text: "text-muted",
1533
- selectedText: "",
1534
- interaction: "hover:text-inherit light:hover:before:border-stone-950/20 dark:hover:before:border-stone-200/30 light:hover:before:bg-stone-950/2 dark:hover:before:bg-stone-200/4 light:active:before:bg-stone-950/4 dark:active:before:bg-stone-200/6"
2491
+ xl: {
2492
+ fontSize: "text-base",
2493
+ verticalPadding: "py-1.75",
2494
+ labelFontSize: "text-[11px] peer-placeholder-shown:text-base peer-focus:text-[11px]",
2495
+ labelRestingTop: "peer-placeholder-shown:top-5",
2496
+ autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+16px)] max-h-[calc(var(--textarea-max-rows)*1lh+16px)]",
2497
+ pillShape: {
2498
+ corners: "rounded-[20px]",
2499
+ horizontalPadding: "px-4.75",
2500
+ labelOffset: "left-3.75"
1535
2501
  },
1536
- danger: {
1537
- surface: "before:border light:before:border-red-600 dark:before:border-red-400",
1538
- selectedSurface: "before:border light:before:border-red-600 dark:before:border-red-400 light:before:bg-red-500/8 dark:before:bg-red-400/8",
1539
- text: "light:text-red-600 dark:text-red-400",
1540
- selectedText: "light:text-red-600 dark:text-red-400",
1541
- interaction: "light:hover:before:bg-red-500/8 dark:hover:before:bg-red-400/8"
2502
+ roundedShape: {
2503
+ corners: "rounded-[10px]",
2504
+ horizontalPadding: "px-3.5",
2505
+ labelOffset: "left-2.5"
1542
2506
  }
1543
2507
  },
1544
- ghost: {
1545
- primary: {
1546
- surface: "before:scale-96 before:opacity-0 before:bg-primary/16",
1547
- selectedSurface: "before:bg-primary/16",
1548
- text: "text-primary",
1549
- selectedText: "text-primary",
1550
- interaction: "hover:before:scale-100 hover:before:opacity-100"
1551
- },
1552
- secondary: {
1553
- surface: "before:scale-96 before:opacity-0 before:bg-secondary/16",
1554
- selectedSurface: "before:bg-secondary/16",
1555
- text: "text-secondary",
1556
- selectedText: "text-secondary",
1557
- interaction: "hover:before:scale-100 hover:before:opacity-100"
2508
+ "2xl": {
2509
+ fontSize: "text-base",
2510
+ verticalPadding: "py-2.25",
2511
+ labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
2512
+ labelRestingTop: "peer-placeholder-shown:top-5.5",
2513
+ autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+20px)] max-h-[calc(var(--textarea-max-rows)*1lh+20px)]",
2514
+ pillShape: {
2515
+ corners: "rounded-[22px]",
2516
+ horizontalPadding: "px-5.25",
2517
+ labelOffset: "left-4.25"
1558
2518
  },
1559
- neutral: {
1560
- surface: "before:scale-96 before:opacity-0 light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
1561
- selectedSurface: "light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
1562
- text: "",
1563
- selectedText: "",
1564
- interaction: "hover:before:scale-100 hover:before:opacity-100 light:active:before:bg-stone-950/12 dark:active:before:bg-stone-200/16"
2519
+ roundedShape: {
2520
+ corners: "rounded-xl",
2521
+ horizontalPadding: "px-4",
2522
+ labelOffset: "left-3"
2523
+ }
2524
+ },
2525
+ "3xl": {
2526
+ fontSize: "text-base",
2527
+ verticalPadding: "py-2.75",
2528
+ labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
2529
+ labelRestingTop: "peer-placeholder-shown:top-6",
2530
+ autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+24px)] max-h-[calc(var(--textarea-max-rows)*1lh+24px)]",
2531
+ pillShape: {
2532
+ corners: "rounded-3xl",
2533
+ horizontalPadding: "px-5.25",
2534
+ labelOffset: "left-4.25"
1565
2535
  },
1566
- gray: {
1567
- surface: "before:scale-96 before:opacity-0 light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
1568
- selectedSurface: "light:before:bg-stone-950/8 dark:before:bg-stone-200/12",
1569
- text: "text-muted",
1570
- selectedText: "",
1571
- interaction: "hover:text-inherit hover:before:scale-100 hover:before:opacity-100 light:active:before:bg-stone-950/12 dark:active:before:bg-stone-200/16"
2536
+ roundedShape: {
2537
+ corners: "rounded-xl",
2538
+ horizontalPadding: "px-4",
2539
+ labelOffset: "left-3"
2540
+ }
2541
+ },
2542
+ "4xl": {
2543
+ fontSize: "text-base",
2544
+ verticalPadding: "py-3.75",
2545
+ labelFontSize: "text-xs peer-placeholder-shown:text-base peer-focus:text-xs",
2546
+ labelRestingTop: "peer-placeholder-shown:top-7",
2547
+ autoResizeHeights: "min-h-[calc(var(--textarea-min-rows)*1lh+32px)] max-h-[calc(var(--textarea-max-rows)*1lh+32px)]",
2548
+ pillShape: {
2549
+ corners: "rounded-[28px]",
2550
+ horizontalPadding: "px-6",
2551
+ labelOffset: "left-5"
1572
2552
  },
1573
- danger: {
1574
- surface: "before:scale-96 before:opacity-0 light:before:bg-red-500/16 dark:before:bg-red-400/16",
1575
- selectedSurface: "light:before:bg-red-500/16 dark:before:bg-red-400/16",
1576
- text: "light:text-red-600 dark:text-red-400",
1577
- selectedText: "light:text-red-600 dark:text-red-400",
1578
- interaction: "hover:before:scale-100 hover:before:opacity-100"
2553
+ roundedShape: {
2554
+ corners: "rounded-2xl",
2555
+ horizontalPadding: "px-4.5",
2556
+ labelOffset: "left-3.5"
1579
2557
  }
1580
2558
  }
1581
- }, qe = Object.keys(Z), Je = Object.keys(Z.solid);
1582
- function Ye(e) {
2559
+ }, Xt = Object.keys(Yt);
2560
+ function Zt(e) {
1583
2561
  return {
1584
- base: [e.height, e.fontSize],
1585
- content: e.contentGap,
1586
- leadingIcon: e.iconSize,
1587
- trailingIcon: e.iconSize,
1588
- loadingIndicator: e.loadingIndicatorSize
2562
+ base: [e.fontSize, e.verticalPadding],
2563
+ label: [e.labelFontSize, e.labelRestingTop]
1589
2564
  };
1590
2565
  }
1591
- function Xe(e) {
1592
- let t = X[e];
2566
+ function Qt(e) {
2567
+ let t = Yt[e];
1593
2568
  return [
1594
2569
  {
1595
2570
  size: e,
1596
- square: !1,
1597
2571
  pill: !0,
1598
- class: { base: ["rounded-full", t.pillGutter] }
1599
- },
1600
- {
1601
- size: e,
1602
- square: !1,
1603
- pill: !1,
1604
- class: { base: [t.radius, t.gutter] }
1605
- },
1606
- {
1607
- size: e,
1608
- square: !0,
1609
- class: { base: t.width }
2572
+ class: {
2573
+ base: [t.pillShape.corners, t.pillShape.horizontalPadding],
2574
+ label: t.pillShape.labelOffset
2575
+ }
1610
2576
  },
1611
2577
  {
1612
2578
  size: e,
1613
- square: !0,
1614
2579
  pill: !1,
1615
- class: { base: t.radius }
1616
- },
1617
- {
1618
- size: e,
1619
- square: !1,
1620
2580
  class: {
1621
- leadingIcon: t.leadingIconOffset,
1622
- trailingIcon: t.trailingIconOffset
2581
+ base: [t.roundedShape.corners, t.roundedShape.horizontalPadding],
2582
+ label: t.roundedShape.labelOffset
1623
2583
  }
1624
- }
1625
- ];
1626
- }
1627
- function Ze(e, t) {
1628
- let n = Z[e][t];
1629
- return [
1630
- {
1631
- variant: e,
1632
- color: t,
1633
- disabled: !1,
1634
- selected: !1,
1635
- class: { base: [n.surface, n.text] }
1636
- },
1637
- {
1638
- variant: e,
1639
- color: t,
1640
- disabled: !1,
1641
- selected: !0,
1642
- class: { base: [n.selectedSurface, n.selectedText] }
1643
2584
  },
1644
2585
  {
1645
- variant: e,
1646
- color: t,
1647
- disabled: !1,
1648
- loading: !1,
1649
- class: { base: n.interaction }
2586
+ size: e,
2587
+ autoResize: !0,
2588
+ class: { base: t.autoResizeHeights }
1650
2589
  }
1651
2590
  ];
1652
2591
  }
1653
- var Qe = Object.fromEntries(Ge.map((e) => [e, Ye(X[e])])), $e = Ge.flatMap(Xe), et = qe.flatMap((e) => Je.flatMap((t) => Ze(e, t))), tt = k({
2592
+ var $t = Object.fromEntries(Xt.map((e) => [e, Zt(Yt[e])])), en = Xt.flatMap(Qt), tn = G({
1654
2593
  slots: {
1655
- base: "relative inline-flex shrink-0 cursor-pointer items-center justify-center font-medium whitespace-nowrap outline-primary transition-colors duration-150 select-none before:absolute before:inset-0 before:rounded-[inherit] before:transition before:duration-150 focus-visible:outline-2",
1656
- loadingOverlay: "absolute inset-0 flex items-center justify-center",
1657
- loadingIndicator: "loading-indicator",
1658
- content: "relative flex size-full items-center justify-center",
1659
- label: "",
1660
- leadingIcon: "shrink-0",
1661
- trailingIcon: "shrink-0"
2594
+ root: "",
2595
+ container: "relative",
2596
+ base: "peer block w-full resize-none border bg-field outline-hidden transition-colors",
2597
+ label: "pointer-events-none absolute top-0 -translate-y-1/2 bg-linear-to-b from-canvas from-50% to-field to-50% px-1 transition-colors peer-placeholder-shown:bg-none peer-placeholder-shown:transition-all peer-focus:top-0 peer-focus:bg-linear-to-b peer-focus:transition-all",
2598
+ footer: "mt-2 flex items-start gap-x-4 text-xs",
2599
+ hint: "text-muted",
2600
+ errorMessage: "flex items-start gap-x-1.5 light:text-red-600 dark:text-red-400",
2601
+ errorIcon: "mt-px size-3.5 shrink-0",
2602
+ characterCount: "ml-auto shrink-0 text-muted tabular-nums"
1662
2603
  },
1663
- variants: {
1664
- variant: {
1665
- solid: { base: "focus-visible:outline-offset-2" },
1666
- soft: { base: "focus-visible:outline-offset-2" },
1667
- outline: { base: "focus-visible:-outline-offset-1" },
1668
- ghost: { base: "focus-visible:-outline-offset-1" }
1669
- },
1670
- color: {
1671
- primary: "",
1672
- secondary: "",
1673
- neutral: "",
1674
- gray: "",
1675
- danger: ""
2604
+ variants: {
2605
+ variant: {
2606
+ outline: "",
2607
+ soft: ""
1676
2608
  },
1677
- size: Qe,
1678
- square: { true: "" },
2609
+ size: $t,
1679
2610
  pill: { true: "" },
1680
- block: { true: { base: "w-full" } },
1681
- disabled: { true: { base: "cursor-not-allowed light:text-stone-400 dark:text-stone-500" } },
1682
- loading: { true: {
1683
- base: "pointer-events-none",
1684
- content: "opacity-0"
2611
+ autoResize: { true: { base: "field-sizing-content" } },
2612
+ invalid: { true: {
2613
+ base: "light:border-red-600 dark:border-red-500 light:selection:bg-red-500/16 dark:selection:bg-red-400/16",
2614
+ label: "light:text-red-600 dark:text-red-400"
1685
2615
  } },
1686
- selected: { true: "" }
2616
+ disabled: { true: { container: "opacity-50" } }
1687
2617
  },
1688
2618
  compoundVariants: [
1689
- ...$e,
1690
- ...et,
2619
+ ...en,
1691
2620
  {
1692
- square: !0,
1693
- pill: !0,
1694
- class: { base: "rounded-full" }
1695
- },
1696
- {
1697
- disabled: !0,
1698
- variant: ["solid", "soft"],
1699
- class: { base: "light:before:bg-stone-950/5 dark:before:bg-stone-200/5" }
1700
- },
1701
- {
1702
- disabled: !0,
2621
+ invalid: !1,
2622
+ disabled: !1,
1703
2623
  variant: "outline",
1704
- class: { base: "before:border light:before:border-stone-950/6 dark:before:border-stone-200/6" }
2624
+ class: {
2625
+ base: "border-line light:not-focus:hover:border-stone-950/20 dark:not-focus:hover:border-white/20 focus:border-primary",
2626
+ label: "text-muted peer-focus:text-primary"
2627
+ }
1705
2628
  },
1706
2629
  {
2630
+ invalid: !1,
1707
2631
  disabled: !1,
1708
- loading: !1,
1709
- square: !0,
1710
- class: { base: "active:before:scale-96" }
2632
+ variant: "soft",
2633
+ class: {
2634
+ base: "border-transparent focus:border-primary",
2635
+ label: "text-muted peer-focus:text-primary"
2636
+ }
1711
2637
  },
1712
2638
  {
1713
- disabled: !1,
1714
- loading: !1,
1715
- square: !1,
1716
- block: !0,
1717
- class: { base: "active:before:scale-[0.995]" }
2639
+ invalid: !1,
2640
+ disabled: !0,
2641
+ variant: "outline",
2642
+ class: {
2643
+ base: "cursor-not-allowed border-line",
2644
+ label: "text-muted"
2645
+ }
1718
2646
  },
1719
2647
  {
1720
- disabled: !1,
1721
- loading: !1,
1722
- square: !1,
1723
- block: !1,
1724
- class: { base: "active:before:scale-97" }
2648
+ invalid: !1,
2649
+ disabled: !0,
2650
+ variant: "soft",
2651
+ class: {
2652
+ base: "cursor-not-allowed border-transparent",
2653
+ label: "text-muted"
2654
+ }
1725
2655
  }
1726
2656
  ]
1727
- }), nt = /* @__PURE__ */ c({
1728
- __name: "Button",
1729
- props: {
2657
+ }), nn = [
2658
+ "id",
2659
+ "rows",
2660
+ "maxlength",
2661
+ "disabled",
2662
+ "aria-describedby",
2663
+ "aria-invalid"
2664
+ ], rn = ["for"], an = ["id"], on = ["id"], sn = /* @__PURE__ */ l({
2665
+ inheritAttrs: !1,
2666
+ __name: "Textarea",
2667
+ props: /*@__PURE__*/ f({
1730
2668
  label: {},
1731
- variant: { default: "solid" },
1732
- color: { default: "neutral" },
1733
- size: { default: "md" },
1734
- leadingIcon: {},
1735
- trailingIcon: {},
1736
- square: { type: Boolean },
2669
+ id: {},
2670
+ rows: { default: 3 },
2671
+ autoResize: { type: Boolean },
2672
+ maxRows: { default: 10 },
2673
+ maxlength: {},
2674
+ variant: { default: "outline" },
2675
+ size: { default: "4xl" },
1737
2676
  pill: {
1738
2677
  type: Boolean,
1739
2678
  default: !0
1740
2679
  },
1741
- block: { type: Boolean },
2680
+ hint: {},
2681
+ errorMessage: {},
2682
+ invalid: { type: Boolean },
1742
2683
  disabled: { type: Boolean },
1743
- loading: { type: Boolean },
1744
- selected: { type: Boolean },
1745
- type: { default: "button" },
1746
- href: {},
2684
+ ui: {},
2685
+ class: { type: [
2686
+ Array,
2687
+ String,
2688
+ null,
2689
+ Number,
2690
+ Boolean
2691
+ ] }
2692
+ }, {
2693
+ modelValue: {},
2694
+ modelModifiers: {}
2695
+ }),
2696
+ emits: ["update:modelValue"],
2697
+ setup(e) {
2698
+ let t = e, r = M(e, "modelValue"), { fieldId: l, hintId: u, errorMessageId: d, isInvalid: f, describingElementId: m } = Ft(t), g = n(() => tn({
2699
+ variant: t.variant,
2700
+ size: t.size,
2701
+ pill: t.pill,
2702
+ autoResize: t.autoResize,
2703
+ invalid: f.value,
2704
+ disabled: t.disabled
2705
+ })), _ = n(() => t.autoResize ? {
2706
+ "--textarea-min-rows": t.rows,
2707
+ "--textarea-max-rows": t.maxRows
2708
+ } : void 0), v = n(() => r.value?.length ?? 0), y = n(() => !!(t.errorMessage || t.hint || t.maxlength));
2709
+ return (n, x) => (b(), a("div", { class: h(g.value.root({ class: [e.ui?.root, t.class] })) }, [o("div", { class: h(g.value.container({ class: e.ui?.container })) }, [V(o("textarea", p(n.$attrs, {
2710
+ id: A(l),
2711
+ "onUpdate:modelValue": x[0] ||= (e) => r.value = e,
2712
+ rows: e.rows,
2713
+ maxlength: e.maxlength,
2714
+ disabled: e.disabled,
2715
+ "aria-describedby": A(m),
2716
+ "aria-invalid": A(f) || void 0,
2717
+ style: _.value,
2718
+ placeholder: " ",
2719
+ class: g.value.base({ class: e.ui?.base })
2720
+ }), null, 16, nn), [[R, r.value]]), o("label", {
2721
+ for: A(l),
2722
+ class: h(g.value.label({ class: e.ui?.label }))
2723
+ }, O(e.label), 11, rn)], 2), y.value ? (b(), a("div", {
2724
+ key: 0,
2725
+ class: h(g.value.footer({ class: e.ui?.footer }))
2726
+ }, [e.errorMessage ? (b(), a("p", {
2727
+ key: 0,
2728
+ id: A(d),
2729
+ class: h(g.value.errorMessage({ class: e.ui?.errorMessage }))
2730
+ }, [c(A(H), { class: h(g.value.errorIcon({ class: e.ui?.errorIcon })) }, null, 8, ["class"]), s(" " + O(e.errorMessage), 1)], 10, an)) : e.hint ? (b(), a("p", {
2731
+ key: 1,
2732
+ id: A(u),
2733
+ class: h(g.value.hint({ class: e.ui?.hint }))
2734
+ }, O(e.hint), 11, on)) : i("", !0), e.maxlength ? (b(), a("p", {
2735
+ key: 2,
2736
+ class: h(g.value.characterCount({ class: e.ui?.characterCount }))
2737
+ }, O(v.value) + "/" + O(e.maxlength), 3)) : i("", !0)], 2)) : i("", !0)], 2));
2738
+ }
2739
+ }), cn = {
2740
+ sm: {
2741
+ height: "h-5",
2742
+ fontSize: "text-xs/none tracking-wide",
2743
+ gutter: "px-1.25",
2744
+ pillGutter: "px-1.75",
2745
+ radius: "rounded-sm",
2746
+ iconSize: "size-3",
2747
+ dotSize: "size-1.5"
2748
+ },
2749
+ md: {
2750
+ height: "h-5.5",
2751
+ fontSize: "text-sm/none",
2752
+ gutter: "px-1.5",
2753
+ pillGutter: "px-2",
2754
+ radius: "rounded-sm",
2755
+ iconSize: "size-4",
2756
+ dotSize: "size-1.5"
2757
+ },
2758
+ lg: {
2759
+ height: "h-6",
2760
+ fontSize: "text-sm/none",
2761
+ gutter: "px-2",
2762
+ pillGutter: "px-2.75",
2763
+ radius: "rounded-md",
2764
+ iconSize: "size-4",
2765
+ dotSize: "size-2"
2766
+ }
2767
+ }, ln = Object.keys(cn), un = {
2768
+ soft: {
2769
+ secondary: "bg-secondary/16 text-secondary",
2770
+ gray: "light:bg-stone-950/8 dark:bg-stone-200/12",
2771
+ success: "light:bg-green-500/16 light:text-green-700 dark:bg-green-400/16 dark:text-green-400",
2772
+ warning: "light:bg-orange-500/16 light:text-orange-700 dark:bg-orange-400/16 dark:text-orange-400",
2773
+ danger: "light:bg-red-500/16 light:text-red-600 dark:bg-red-400/16 dark:text-red-400",
2774
+ info: "light:bg-blue-500/16 light:text-blue-600 dark:bg-blue-400/16 dark:text-blue-300",
2775
+ discovery: "light:bg-purple-500/16 light:text-purple-600 dark:bg-purple-400/16 dark:text-purple-300"
2776
+ },
2777
+ solid: {
2778
+ secondary: "bg-secondary light:text-white dark:text-stone-950",
2779
+ gray: "light:bg-stone-600 light:text-white dark:bg-stone-600 dark:text-white",
2780
+ success: "light:bg-green-600 light:text-white dark:bg-green-600 dark:text-white",
2781
+ warning: "light:bg-orange-600 light:text-white dark:bg-orange-600 dark:text-white",
2782
+ danger: "light:bg-red-600 light:text-white dark:bg-red-600 dark:text-white",
2783
+ info: "light:bg-blue-600 light:text-white dark:bg-blue-500 dark:text-white",
2784
+ discovery: "light:bg-purple-600 light:text-white dark:bg-purple-500 dark:text-white"
2785
+ },
2786
+ outline: {
2787
+ secondary: "inset-ring inset-ring-secondary text-secondary",
2788
+ gray: "inset-ring text-muted light:inset-ring-stone-950/16 dark:inset-ring-stone-200/25",
2789
+ success: "inset-ring light:inset-ring-green-600 light:text-green-700 dark:inset-ring-green-500 dark:text-green-400",
2790
+ warning: "inset-ring light:inset-ring-orange-600 light:text-orange-700 dark:inset-ring-orange-500 dark:text-orange-400",
2791
+ danger: "inset-ring light:inset-ring-red-600 light:text-red-600 dark:inset-ring-red-500 dark:text-red-400",
2792
+ info: "inset-ring light:inset-ring-blue-600 light:text-blue-600 dark:inset-ring-blue-400 dark:text-blue-300",
2793
+ discovery: "inset-ring light:inset-ring-purple-600 light:text-purple-600 dark:inset-ring-purple-400 dark:text-purple-300"
2794
+ }
2795
+ }, dn = Object.keys(un), fn = Object.keys(un.soft);
2796
+ function pn(e) {
2797
+ return {
2798
+ base: [e.height, e.fontSize],
2799
+ dot: e.dotSize,
2800
+ leadingIcon: e.iconSize,
2801
+ trailingIcon: e.iconSize
2802
+ };
2803
+ }
2804
+ function mn(e) {
2805
+ let t = cn[e];
2806
+ return [{
2807
+ size: e,
2808
+ pill: !0,
2809
+ class: { base: ["rounded-full", t.pillGutter] }
2810
+ }, {
2811
+ size: e,
2812
+ pill: !1,
2813
+ class: { base: [t.radius, t.gutter] }
2814
+ }];
2815
+ }
2816
+ var hn = Object.fromEntries(ln.map((e) => [e, pn(cn[e])])), gn = ln.flatMap(mn), _n = dn.flatMap((e) => fn.map((t) => ({
2817
+ variant: e,
2818
+ color: t,
2819
+ class: { base: un[e][t] }
2820
+ }))), vn = G({
2821
+ slots: {
2822
+ base: "inline-flex shrink-0 items-center gap-1 font-semibold whitespace-nowrap",
2823
+ dot: "shrink-0 rounded-full bg-current",
2824
+ leadingIcon: "-ml-px shrink-0",
2825
+ trailingIcon: "-mr-px shrink-0"
2826
+ },
2827
+ variants: {
2828
+ variant: {
2829
+ soft: "",
2830
+ solid: "",
2831
+ outline: ""
2832
+ },
2833
+ color: {
2834
+ secondary: "",
2835
+ gray: "",
2836
+ success: "",
2837
+ warning: "",
2838
+ danger: "",
2839
+ info: "",
2840
+ discovery: ""
2841
+ },
2842
+ size: hn,
2843
+ pill: { true: "" }
2844
+ },
2845
+ compoundVariants: [...gn, ..._n]
2846
+ }), yn = /* @__PURE__ */ l({
2847
+ __name: "Badge",
2848
+ props: {
2849
+ label: {},
2850
+ variant: { default: "soft" },
2851
+ color: { default: "gray" },
2852
+ size: { default: "sm" },
2853
+ leadingIcon: {},
2854
+ trailingIcon: {},
2855
+ dot: { type: Boolean },
2856
+ pill: { type: Boolean },
1747
2857
  ui: {},
1748
2858
  class: { type: [
1749
2859
  Array,
@@ -1754,65 +2864,40 @@ var Qe = Object.fromEntries(Ge.map((e) => [e, Ye(X[e])])), $e = Ge.flatMap(Xe),
1754
2864
  ] }
1755
2865
  },
1756
2866
  setup(e) {
1757
- let s = e, c = t(() => tt({
1758
- variant: s.variant,
1759
- color: s.color,
1760
- size: s.size,
1761
- square: s.square,
1762
- pill: s.pill,
1763
- block: s.block,
1764
- disabled: s.disabled,
1765
- loading: s.loading,
1766
- selected: s.selected
1767
- })), l = t(() => s.href ? "a" : "button"), f = t(() => {
1768
- let e = s.square ? { "aria-label": s.label } : {};
1769
- return s.href ? s.disabled ? {
1770
- ...e,
1771
- role: "link",
1772
- "aria-disabled": "true"
1773
- } : {
1774
- ...e,
1775
- href: s.href
1776
- } : {
1777
- ...e,
1778
- type: s.type,
1779
- disabled: s.disabled || s.loading,
1780
- "aria-busy": s.loading || void 0,
1781
- "aria-pressed": s.selected || void 0
1782
- };
1783
- });
1784
- return (t, m) => (p(), n(g(l.value), u(f.value, { class: c.value.base({ class: [e.ui?.base, s.class] }) }), {
1785
- default: D(() => [e.loading ? (p(), i("span", {
2867
+ let t = e, o = n(() => vn({
2868
+ variant: t.variant,
2869
+ color: t.color,
2870
+ size: t.size,
2871
+ pill: t.pill
2872
+ }));
2873
+ return (n, c) => (b(), a("span", { class: h(o.value.base({ class: [e.ui?.base, t.class] })) }, [
2874
+ e.dot ? (b(), a("span", {
1786
2875
  key: 0,
1787
- class: d(c.value.loadingOverlay({ class: e.ui?.loadingOverlay }))
1788
- }, [a("span", { class: d(c.value.loadingIndicator({ class: e.ui?.loadingIndicator })) }, null, 2)], 2)) : r("", !0), a("span", { class: d(c.value.content({ class: e.ui?.content })) }, [
1789
- e.leadingIcon ? (p(), n(g(e.leadingIcon), {
1790
- key: 0,
1791
- class: d(c.value.leadingIcon({ class: e.ui?.leadingIcon }))
1792
- }, null, 8, ["class"])) : r("", !0),
1793
- !e.square && (e.label || t.$slots.default) ? (p(), i("span", {
1794
- key: 1,
1795
- class: d(c.value.label({ class: e.ui?.label }))
1796
- }, [h(t.$slots, "default", {}, () => [o(_(e.label), 1)])], 2)) : r("", !0),
1797
- e.trailingIcon && !e.square ? (p(), n(g(e.trailingIcon), {
1798
- key: 2,
1799
- class: d(c.value.trailingIcon({ class: e.ui?.trailingIcon }))
1800
- }, null, 8, ["class"])) : r("", !0)
1801
- ], 2)]),
1802
- _: 3
1803
- }, 16, ["class"]));
2876
+ "aria-hidden": "true",
2877
+ class: h(o.value.dot({ class: e.ui?.dot }))
2878
+ }, null, 2)) : i("", !0),
2879
+ e.leadingIcon ? (b(), r(E(e.leadingIcon), {
2880
+ key: 1,
2881
+ class: h(o.value.leadingIcon({ class: e.ui?.leadingIcon }))
2882
+ }, null, 8, ["class"])) : i("", !0),
2883
+ w(n.$slots, "default", {}, () => [s(O(e.label), 1)]),
2884
+ e.trailingIcon ? (b(), r(E(e.trailingIcon), {
2885
+ key: 2,
2886
+ class: h(o.value.trailingIcon({ class: e.ui?.trailingIcon }))
2887
+ }, null, 8, ["class"])) : i("", !0)
2888
+ ], 2));
1804
2889
  }
1805
2890
  });
1806
2891
  // src/shared/composables/useCustomColor.ts
1807
- function Q(e, n) {
1808
- let r = t(() => v(e) in n);
2892
+ function bn(e, t) {
2893
+ let r = n(() => k(e) in t);
1809
2894
  return {
1810
- themeColor: t(() => r.value ? v(e) : "primary"),
1811
- customColorVariable: t(() => r.value ? void 0 : { "--color-primary": v(e) })
2895
+ themeColor: n(() => r.value ? k(e) : "primary"),
2896
+ customColorVariable: n(() => r.value ? void 0 : { "--color-primary": k(e) })
1812
2897
  };
1813
2898
  }
1814
2899
  // src/elements/checkbox/checkbox.theme.ts
1815
- var rt = k({
2900
+ var xn = G({
1816
2901
  slots: {
1817
2902
  root: "flex cursor-pointer items-start gap-x-2 text-sm leading-5",
1818
2903
  base: "relative top-px size-4.5 shrink-0 rounded-sm border outline-primary transition-colors has-focus-visible:outline-2 has-focus-visible:outline-offset-2 light:border-stone-300 light:not-has-checked:hover:border-stone-400 dark:border-stone-600 dark:not-has-checked:hover:border-stone-500",
@@ -1829,10 +2914,10 @@ var rt = k({
1829
2914
  end: ""
1830
2915
  }
1831
2916
  }
1832
- }), it = ["checked"], at = /* @__PURE__ */ c({
2917
+ }), Sn = ["checked"], Cn = /* @__PURE__ */ l({
1833
2918
  inheritAttrs: !1,
1834
2919
  __name: "Checkbox",
1835
- props: /*@__PURE__*/ l({
2920
+ props: /*@__PURE__*/ f({
1836
2921
  label: {},
1837
2922
  color: { default: "neutral" },
1838
2923
  labelPosition: { default: "end" },
@@ -1853,28 +2938,28 @@ var rt = k({
1853
2938
  }),
1854
2939
  emits: ["update:modelValue"],
1855
2940
  setup(e) {
1856
- let n = e, r = x(e, "modelValue"), { themeColor: s, customColorVariable: c } = Q(() => n.color, rt.variants.color), l = t(() => rt({
1857
- color: s.value,
1858
- labelPosition: n.labelPosition
2941
+ let t = e, r = M(e, "modelValue"), { themeColor: i, customColorVariable: c } = bn(() => t.color, xn.variants.color), l = n(() => xn({
2942
+ color: i.value,
2943
+ labelPosition: t.labelPosition
1859
2944
  }));
1860
- return (t, s) => (p(), i("label", {
1861
- class: d(l.value.root({ class: [e.ui?.root, n.class] })),
1862
- style: f(y(c))
1863
- }, [a("span", { class: d(l.value.base({ class: e.ui?.base })) }, [O(a("input", u(t.$attrs, {
1864
- "onUpdate:modelValue": s[0] ||= (e) => r.value = e,
2945
+ return (n, i) => (b(), a("label", {
2946
+ class: h(l.value.root({ class: [e.ui?.root, t.class] })),
2947
+ style: _(A(c))
2948
+ }, [o("span", { class: h(l.value.base({ class: e.ui?.base })) }, [V(o("input", p(n.$attrs, {
2949
+ "onUpdate:modelValue": i[0] ||= (e) => r.value = e,
1865
2950
  checked: r.value,
1866
2951
  type: "checkbox",
1867
2952
  class: "peer sr-only"
1868
- }), null, 16, it), [[C, r.value]]), a("span", {
2953
+ }), null, 16, Sn), [[F, r.value]]), o("span", {
1869
2954
  "aria-hidden": "true",
1870
- class: d(l.value.checkMark({ class: e.ui?.checkMark }))
1871
- }, null, 2)], 2), o(" " + _(e.label), 1)], 6));
2955
+ class: h(l.value.checkMark({ class: e.ui?.checkMark }))
2956
+ }, null, 2)], 2), s(" " + O(e.label), 1)], 6));
1872
2957
  }
1873
- }), ot = k({ slots: {
2958
+ }), wn = G({ slots: {
1874
2959
  base: "size-7 -rotate-90 fill-none stroke-2",
1875
2960
  track: "stroke-primary/15",
1876
2961
  indicator: "stroke-primary transition-[stroke-dashoffset] duration-300"
1877
- } }), st = ["aria-label", "aria-valuenow"], ct = ["stroke-dashoffset"], lt = /* @__PURE__ */ c({
2962
+ } }), Tn = ["aria-label", "aria-valuenow"], En = ["stroke-dashoffset"], Dn = /* @__PURE__ */ l({
1878
2963
  __name: "CircularProgress",
1879
2964
  props: {
1880
2965
  progress: {},
@@ -1889,31 +2974,31 @@ var rt = k({
1889
2974
  ] }
1890
2975
  },
1891
2976
  setup(e) {
1892
- let n = e, r = ot(), o = t(() => Math.min(Math.max(n.progress, 0), 100)), s = t(() => 50 - 50 * o.value / 100);
1893
- return (t, c) => (p(), i("svg", {
2977
+ let t = e, r = wn(), i = n(() => Math.min(Math.max(t.progress, 0), 100)), s = n(() => 50 - 50 * i.value / 100);
2978
+ return (n, c) => (b(), a("svg", {
1894
2979
  viewBox: "0 0 20 20",
1895
2980
  role: "progressbar",
1896
2981
  "aria-label": e.label,
1897
2982
  "aria-valuemin": "0",
1898
2983
  "aria-valuemax": "100",
1899
- "aria-valuenow": o.value,
1900
- class: d(y(r).base({ class: [e.ui?.base, n.class] }))
1901
- }, [a("circle", {
2984
+ "aria-valuenow": i.value,
2985
+ class: h(A(r).base({ class: [e.ui?.base, t.class] }))
2986
+ }, [o("circle", {
1902
2987
  cx: "10",
1903
2988
  cy: "10",
1904
2989
  r: "8",
1905
- class: d(y(r).track({ class: e.ui?.track }))
1906
- }, null, 2), a("circle", {
2990
+ class: h(A(r).track({ class: e.ui?.track }))
2991
+ }, null, 2), o("circle", {
1907
2992
  cx: "10",
1908
2993
  cy: "10",
1909
2994
  r: "8",
1910
2995
  "stroke-dasharray": 50,
1911
2996
  "stroke-dashoffset": s.value,
1912
2997
  "stroke-linecap": "round",
1913
- class: d(y(r).indicator({ class: e.ui?.indicator }))
1914
- }, null, 10, ct)], 10, st));
2998
+ class: h(A(r).indicator({ class: e.ui?.indicator }))
2999
+ }, null, 10, En)], 10, Tn));
1915
3000
  }
1916
- }), ut = k({ slots: { base: "flex loading-dots h-lh items-center gap-1" } }), dt = ["aria-label"], ft = /* @__PURE__ */ c({
3001
+ }), On = G({ slots: { base: "flex loading-dots h-lh items-center gap-1" } }), kn = ["aria-label"], An = /* @__PURE__ */ l({
1917
3002
  __name: "LoadingDots",
1918
3003
  props: {
1919
3004
  label: { default: "Loading" },
@@ -1927,14 +3012,14 @@ var rt = k({
1927
3012
  ] }
1928
3013
  },
1929
3014
  setup(t) {
1930
- let n = t, r = ut();
1931
- return (o, s) => (p(), i("div", {
3015
+ let n = t, r = On();
3016
+ return (i, s) => (b(), a("div", {
1932
3017
  role: "status",
1933
3018
  "aria-label": t.label,
1934
- class: d(y(r).base({ class: [t.ui?.base, n.class] }))
1935
- }, [(p(), i(e, null, m(3, (e) => a("span", { key: e })), 64))], 10, dt));
3019
+ class: h(A(r).base({ class: [t.ui?.base, n.class] }))
3020
+ }, [(b(), a(e, null, C(3, (e) => o("span", { key: e })), 64))], 10, kn));
1936
3021
  }
1937
- }), pt = k({ slots: { base: "loading-indicator" } }), mt = ["aria-label"], ht = /* @__PURE__ */ c({
3022
+ }), jn = G({ slots: { base: "loading-indicator" } }), Mn = ["aria-label"], Nn = /* @__PURE__ */ l({
1938
3023
  __name: "LoadingIndicator",
1939
3024
  props: {
1940
3025
  label: { default: "Loading" },
@@ -1948,14 +3033,14 @@ var rt = k({
1948
3033
  ] }
1949
3034
  },
1950
3035
  setup(e) {
1951
- let t = e, n = pt();
1952
- return (r, a) => (p(), i("div", {
3036
+ let t = e, n = jn();
3037
+ return (r, i) => (b(), a("div", {
1953
3038
  role: "status",
1954
3039
  "aria-label": e.label,
1955
- class: d(y(n).base({ class: [e.ui?.base, t.class] }))
1956
- }, null, 10, mt));
3040
+ class: h(A(n).base({ class: [e.ui?.base, t.class] }))
3041
+ }, null, 10, Mn));
1957
3042
  }
1958
- }), gt = k({
3043
+ }), Pn = G({
1959
3044
  slots: {
1960
3045
  root: "min-w-0",
1961
3046
  legend: "",
@@ -2077,19 +3162,19 @@ var rt = k({
2077
3162
  class: { base: "light:border-stone-300 light:not-has-checked:hover:border-stone-400 dark:border-stone-600 dark:not-has-checked:hover:border-stone-500" }
2078
3163
  }
2079
3164
  ]
2080
- }), _t = [
3165
+ }), Fn = [
2081
3166
  "disabled",
2082
3167
  "aria-invalid",
2083
3168
  "aria-describedby"
2084
- ], vt = [
3169
+ ], In = [
2085
3170
  "name",
2086
3171
  "value",
2087
3172
  "disabled",
2088
3173
  "aria-labelledby",
2089
3174
  "aria-describedby"
2090
- ], yt = ["id"], bt = ["id"], xt = /* @__PURE__ */ c({
3175
+ ], Ln = ["id"], Rn = ["id"], zn = /* @__PURE__ */ l({
2091
3176
  __name: "RadioGroup",
2092
- props: /*@__PURE__*/ l({
3177
+ props: /*@__PURE__*/ f({
2093
3178
  label: {},
2094
3179
  options: {},
2095
3180
  name: {},
@@ -2112,70 +3197,70 @@ var rt = k({
2112
3197
  modelModifiers: {}
2113
3198
  }),
2114
3199
  emits: ["update:modelValue"],
2115
- setup(n) {
2116
- let c = n, l = x(n, "modelValue"), { themeColor: u, customColorVariable: h } = Q(() => c.color, gt.variants.color), g = b(), v = `${g}-error`, S = t(() => c.name ?? g), C = t(() => gt({
2117
- variant: c.variant,
2118
- direction: c.direction,
3200
+ setup(t) {
3201
+ let r = t, l = M(t, "modelValue"), { themeColor: u, customColorVariable: d } = bn(() => r.color, Pn.variants.color), f = j(), p = `${f}-error`, m = n(() => r.name ?? f), g = n(() => Pn({
3202
+ variant: r.variant,
3203
+ direction: r.direction,
2119
3204
  color: u.value,
2120
- hideLabel: c.hideLabel,
2121
- hasDescriptions: c.options.some((e) => e.description),
2122
- invalid: !!c.errorMessage
3205
+ hideLabel: r.hideLabel,
3206
+ hasDescriptions: r.options.some((e) => e.description),
3207
+ invalid: !!r.errorMessage
2123
3208
  }));
2124
- function w(e) {
2125
- return `${g}-option-${e}`;
3209
+ function v(e) {
3210
+ return `${f}-option-${e}`;
2126
3211
  }
2127
- function E(e) {
2128
- return c.disabled || !!e.disabled;
3212
+ function y(e) {
3213
+ return r.disabled || !!e.disabled;
2129
3214
  }
2130
- return (t, u) => (p(), i("fieldset", {
3215
+ return (n, u) => (b(), a("fieldset", {
2131
3216
  role: "radiogroup",
2132
- disabled: n.disabled,
2133
- "aria-invalid": n.errorMessage ? "true" : void 0,
2134
- "aria-describedby": n.errorMessage ? v : void 0,
2135
- class: d(C.value.root({ class: [n.ui?.root, c.class] })),
2136
- style: f(y(h))
3217
+ disabled: t.disabled,
3218
+ "aria-invalid": t.errorMessage ? "true" : void 0,
3219
+ "aria-describedby": t.errorMessage ? p : void 0,
3220
+ class: h(g.value.root({ class: [t.ui?.root, r.class] })),
3221
+ style: _(A(d))
2137
3222
  }, [
2138
- a("legend", { class: d(C.value.legend({ class: n.ui?.legend })) }, _(n.label), 3),
2139
- a("div", { class: d(C.value.optionList({ class: n.ui?.optionList })) }, [(p(!0), i(e, null, m(n.options, (t, r) => (p(), i("label", {
2140
- key: t.value,
2141
- class: d(C.value.option({
2142
- optionDisabled: E(t),
2143
- optionHasDescription: !!t.description,
2144
- class: n.ui?.option
3223
+ o("legend", { class: h(g.value.legend({ class: t.ui?.legend })) }, O(t.label), 3),
3224
+ o("div", { class: h(g.value.optionList({ class: t.ui?.optionList })) }, [(b(!0), a(e, null, C(t.options, (n, r) => (b(), a("label", {
3225
+ key: n.value,
3226
+ class: h(g.value.option({
3227
+ optionDisabled: y(n),
3228
+ optionHasDescription: !!n.description,
3229
+ class: t.ui?.option
2145
3230
  }))
2146
- }, [a("span", { class: d(C.value.container({ class: n.ui?.container })) }, [a("span", { class: d(C.value.base({
2147
- optionDisabled: E(t),
2148
- class: n.ui?.base
2149
- })) }, [O(a("input", {
3231
+ }, [o("span", { class: h(g.value.container({ class: t.ui?.container })) }, [o("span", { class: h(g.value.base({
3232
+ optionDisabled: y(n),
3233
+ class: t.ui?.base
3234
+ })) }, [V(o("input", {
2150
3235
  "onUpdate:modelValue": u[0] ||= (e) => l.value = e,
2151
3236
  type: "radio",
2152
- name: S.value,
2153
- value: t.value,
2154
- disabled: t.disabled,
2155
- "aria-labelledby": t.description ? `${w(r)}-label` : void 0,
2156
- "aria-describedby": t.description ? `${w(r)}-description` : void 0,
3237
+ name: m.value,
3238
+ value: n.value,
3239
+ disabled: n.disabled,
3240
+ "aria-labelledby": n.description ? `${v(r)}-label` : void 0,
3241
+ "aria-describedby": n.description ? `${v(r)}-description` : void 0,
2157
3242
  class: "peer sr-only"
2158
- }, null, 8, vt), [[T, l.value]]), a("span", {
3243
+ }, null, 8, In), [[L, l.value]]), o("span", {
2159
3244
  "aria-hidden": "true",
2160
- class: d(C.value.indicator({ class: n.ui?.indicator }))
2161
- }, null, 2)], 2)], 2), t.description ? (p(), i("span", {
3245
+ class: h(g.value.indicator({ class: t.ui?.indicator }))
3246
+ }, null, 2)], 2)], 2), n.description ? (b(), a("span", {
2162
3247
  key: 0,
2163
- class: d(C.value.wrapper({ class: n.ui?.wrapper }))
2164
- }, [a("span", {
2165
- id: `${w(r)}-label`,
2166
- class: d(C.value.label({ class: n.ui?.label }))
2167
- }, _(t.label), 11, yt), a("span", {
2168
- id: `${w(r)}-description`,
2169
- class: d(C.value.description({ class: n.ui?.description }))
2170
- }, _(t.description), 11, bt)], 2)) : (p(), i(e, { key: 1 }, [o(_(t.label), 1)], 64))], 2))), 128))], 2),
2171
- n.errorMessage ? (p(), i("p", {
3248
+ class: h(g.value.wrapper({ class: t.ui?.wrapper }))
3249
+ }, [o("span", {
3250
+ id: `${v(r)}-label`,
3251
+ class: h(g.value.label({ class: t.ui?.label }))
3252
+ }, O(n.label), 11, Ln), o("span", {
3253
+ id: `${v(r)}-description`,
3254
+ class: h(g.value.description({ class: t.ui?.description }))
3255
+ }, O(n.description), 11, Rn)], 2)) : (b(), a(e, { key: 1 }, [s(O(n.label), 1)], 64))], 2))), 128))], 2),
3256
+ t.errorMessage ? (b(), a("p", {
2172
3257
  key: 0,
2173
- id: v,
2174
- class: d(C.value.errorMessage({ class: n.ui?.errorMessage }))
2175
- }, [s(y(A), { class: d(C.value.errorIcon({ class: n.ui?.errorIcon })) }, null, 8, ["class"]), o(" " + _(n.errorMessage), 1)], 2)) : r("", !0)
2176
- ], 14, _t));
3258
+ id: p,
3259
+ class: h(g.value.errorMessage({ class: t.ui?.errorMessage }))
3260
+ }, [c(A(H), { class: h(g.value.errorIcon({ class: t.ui?.errorIcon })) }, null, 8, ["class"]), s(" " + O(t.errorMessage), 1)], 2)) : i("", !0)
3261
+ ], 14, Fn));
2177
3262
  }
2178
- }), St = k({
3263
+ }), Bn = G({
2179
3264
  slots: {
2180
3265
  root: "flex items-start text-sm leading-5 select-none",
2181
3266
  base: "relative h-4.75 w-8 shrink-0 rounded-full outline-primary transition-colors duration-250 ease-[cubic-bezier(0.65,0,0.35,1)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 light:bg-stone-200 dark:bg-stone-700",
@@ -2208,15 +3293,15 @@ var rt = k({
2208
3293
  },
2209
3294
  hasLabel: { true: { base: "top-px" } }
2210
3295
  }
2211
- }), Ct = [
3296
+ }), Vn = [
2212
3297
  "checked",
2213
3298
  "disabled",
2214
3299
  "aria-labelledby",
2215
3300
  "aria-describedby"
2216
- ], wt = /* @__PURE__ */ c({
3301
+ ], Hn = /* @__PURE__ */ l({
2217
3302
  inheritAttrs: !1,
2218
3303
  __name: "Switch",
2219
- props: /*@__PURE__*/ l({
3304
+ props: /*@__PURE__*/ f({
2220
3305
  label: {},
2221
3306
  description: {},
2222
3307
  color: { default: "neutral" },
@@ -2239,41 +3324,41 @@ var rt = k({
2239
3324
  modelModifiers: {}
2240
3325
  }),
2241
3326
  emits: ["update:modelValue"],
2242
- setup(n) {
2243
- let s = n, c = x(n, "modelValue"), { themeColor: l, customColorVariable: m } = Q(() => s.color, St.variants.color), h = b(), g = `${h}-label`, v = `${h}-description`, S = t(() => !!(s.label && s.description)), w = t(() => St({
3327
+ setup(t) {
3328
+ let r = t, c = M(t, "modelValue"), { themeColor: l, customColorVariable: u } = bn(() => r.color, Bn.variants.color), d = j(), f = `${d}-label`, m = `${d}-description`, g = n(() => !!(r.label && r.description)), v = n(() => Bn({
2244
3329
  color: l.value,
2245
- labelPosition: s.labelPosition,
2246
- block: s.block,
2247
- disabled: s.disabled,
2248
- hasLabel: !!s.label
3330
+ labelPosition: r.labelPosition,
3331
+ block: r.block,
3332
+ disabled: r.disabled,
3333
+ hasLabel: !!r.label
2249
3334
  }));
2250
- return (t, l) => (p(), i("label", {
2251
- class: d(w.value.root({ class: [n.ui?.root, s.class] })),
2252
- style: f(y(m))
2253
- }, [a("span", { class: d(w.value.base({ class: n.ui?.base })) }, [O(a("input", u(t.$attrs, {
3335
+ return (n, l) => (b(), a("label", {
3336
+ class: h(v.value.root({ class: [t.ui?.root, r.class] })),
3337
+ style: _(A(u))
3338
+ }, [o("span", { class: h(v.value.base({ class: t.ui?.base })) }, [V(o("input", p(n.$attrs, {
2254
3339
  "onUpdate:modelValue": l[0] ||= (e) => c.value = e,
2255
3340
  checked: c.value,
2256
3341
  type: "checkbox",
2257
3342
  role: "switch",
2258
- disabled: n.disabled,
2259
- "aria-labelledby": S.value ? g : void 0,
2260
- "aria-describedby": S.value ? v : void 0,
3343
+ disabled: t.disabled,
3344
+ "aria-labelledby": g.value ? f : void 0,
3345
+ "aria-describedby": g.value ? m : void 0,
2261
3346
  class: "peer sr-only"
2262
- }), null, 16, Ct), [[C, c.value]]), a("span", {
3347
+ }), null, 16, Vn), [[F, c.value]]), o("span", {
2263
3348
  "aria-hidden": "true",
2264
- class: d(w.value.thumb({ class: n.ui?.thumb }))
2265
- }, null, 2)], 2), S.value ? (p(), i("span", {
3349
+ class: h(v.value.thumb({ class: t.ui?.thumb }))
3350
+ }, null, 2)], 2), g.value ? (b(), a("span", {
2266
3351
  key: 0,
2267
- class: d(w.value.wrapper({ class: n.ui?.wrapper }))
2268
- }, [a("span", {
2269
- id: g,
2270
- class: d(w.value.label({ class: n.ui?.label }))
2271
- }, _(n.label), 3), a("span", {
2272
- id: v,
2273
- class: d(w.value.description({ class: n.ui?.description }))
2274
- }, _(n.description), 3)], 2)) : n.label ? (p(), i(e, { key: 1 }, [o(_(n.label), 1)], 64)) : r("", !0)], 6));
3352
+ class: h(v.value.wrapper({ class: t.ui?.wrapper }))
3353
+ }, [o("span", {
3354
+ id: f,
3355
+ class: h(v.value.label({ class: t.ui?.label }))
3356
+ }, O(t.label), 3), o("span", {
3357
+ id: m,
3358
+ class: h(v.value.description({ class: t.ui?.description }))
3359
+ }, O(t.description), 3)], 2)) : t.label ? (b(), a(e, { key: 1 }, [s(O(t.label), 1)], 64)) : i("", !0)], 6));
2275
3360
  }
2276
- }), Tt = k({
3361
+ }), Un = G({
2277
3362
  slots: {
2278
3363
  base: "rounded-sm wrap-anywhere outline-primary transition-colors focus-visible:outline-2 focus-visible:outline-offset-1",
2279
3364
  leadingIcon: "size-[1em] shrink-0",
@@ -2294,11 +3379,11 @@ var rt = k({
2294
3379
  underline: { true: { base: "underline decoration-current/70 underline-offset-[0.1em]" } },
2295
3380
  hasIcon: { true: { base: "inline-flex items-center gap-0.5" } }
2296
3381
  }
2297
- }), Et = [
3382
+ }), Wn = [
2298
3383
  "href",
2299
3384
  "target",
2300
3385
  "rel"
2301
- ], $ = /* @__PURE__ */ c({
3386
+ ], Gn = /* @__PURE__ */ l({
2302
3387
  __name: "TextLink",
2303
3388
  props: {
2304
3389
  label: {},
@@ -2325,47 +3410,77 @@ var rt = k({
2325
3410
  ] }
2326
3411
  },
2327
3412
  setup(e) {
2328
- let a = e, s = t(() => a.underline ?? a.color !== "primary"), c = t(() => a.external ?? /^https?:\/\//.test(a.href)), l = t(() => Tt({
2329
- color: a.color,
2330
- weight: a.weight,
2331
- underline: s.value,
2332
- hasIcon: !!(a.leadingIcon || a.trailingIcon)
3413
+ let t = e, o = n(() => t.underline ?? t.color !== "primary"), c = n(() => t.external ?? yt(t.href)), l = n(() => Un({
3414
+ color: t.color,
3415
+ weight: t.weight,
3416
+ underline: o.value,
3417
+ hasIcon: !!(t.leadingIcon || t.trailingIcon)
2333
3418
  }));
2334
- return (t, s) => (p(), i("a", {
3419
+ return (n, o) => (b(), a("a", {
2335
3420
  href: e.href,
2336
3421
  target: c.value ? "_blank" : void 0,
2337
3422
  rel: c.value ? "noopener noreferrer" : void 0,
2338
- class: d(l.value.base({ class: [e.ui?.base, a.class] }))
3423
+ class: h(l.value.base({ class: [e.ui?.base, t.class] }))
2339
3424
  }, [
2340
- e.leadingIcon ? (p(), n(g(e.leadingIcon), {
3425
+ e.leadingIcon ? (b(), r(E(e.leadingIcon), {
2341
3426
  key: 0,
2342
- class: d(l.value.leadingIcon({ class: e.ui?.leadingIcon }))
2343
- }, null, 8, ["class"])) : r("", !0),
2344
- h(t.$slots, "default", {}, () => [o(_(e.label), 1)]),
2345
- e.trailingIcon ? (p(), n(g(e.trailingIcon), {
3427
+ class: h(l.value.leadingIcon({ class: e.ui?.leadingIcon }))
3428
+ }, null, 8, ["class"])) : i("", !0),
3429
+ w(n.$slots, "default", {}, () => [s(O(e.label), 1)]),
3430
+ e.trailingIcon ? (b(), r(E(e.trailingIcon), {
2346
3431
  key: 1,
2347
- class: d(l.value.trailingIcon({ class: e.ui?.trailingIcon }))
2348
- }, null, 8, ["class"])) : r("", !0),
2349
- c.value ? (p(), i("span", {
3432
+ class: h(l.value.trailingIcon({ class: e.ui?.trailingIcon }))
3433
+ }, null, 8, ["class"])) : i("", !0),
3434
+ c.value ? (b(), a("span", {
2350
3435
  key: 2,
2351
- class: d(l.value.newTabHint({ class: e.ui?.newTabHint }))
2352
- }, "(opens in a new tab)", 2)) : r("", !0)
2353
- ], 10, Et));
3436
+ class: h(l.value.newTabHint({ class: e.ui?.newTabHint }))
3437
+ }, "(opens in a new tab)", 2)) : i("", !0)
3438
+ ], 10, Wn));
2354
3439
  }
2355
- }), Dt = /* @__PURE__ */ te({
2356
- KAlert: () => q,
2357
- KAvatar: () => L,
2358
- KAvatarGroup: () => R,
2359
- KBadge: () => We,
2360
- KButton: () => nt,
2361
- KCheckbox: () => at,
2362
- KCircularProgress: () => lt,
2363
- KLoadingDots: () => ft,
2364
- KLoadingIndicator: () => ht,
2365
- KRadioGroup: () => xt,
2366
- KSwitch: () => wt,
2367
- KTextField: () => H,
2368
- KTextLink: () => $,
2369
- KTextarea: () => G
3440
+ }), Kn = /* @__PURE__ */ new Set([
3441
+ "INPUT",
3442
+ "TEXTAREA",
3443
+ "SELECT"
3444
+ ]);
3445
+ function qn(e) {
3446
+ return e instanceof HTMLElement && (e.isContentEditable || Kn.has(e.tagName));
3447
+ }
3448
+ var Jn = (e, t) => t.allowInEditable || !qn(e.target);
3449
+ // src/shared/composables/useShortcuts.ts
3450
+ function Yn(e, t = {}) {
3451
+ function n() {
3452
+ return t.target === void 0 ? document : k(t.target);
3453
+ }
3454
+ y(() => {
3455
+ z(() => [
3456
+ k(e),
3457
+ n(),
3458
+ k(t.enabled) ?? !0
3459
+ ], ([e, n, r], i, a) => {
3460
+ if (!r || !n) return;
3461
+ let o = tt(e, { guards: [Jn, ...t.guards ?? []] });
3462
+ n.addEventListener("keydown", o), a(() => n.removeEventListener("keydown", o));
3463
+ }, { immediate: !0 });
3464
+ });
3465
+ }
3466
+ // src/index.ts
3467
+ var Xn = /* @__PURE__ */ ae({
3468
+ KAlert: () => xe,
3469
+ KAvatar: () => Me,
3470
+ KAvatarGroup: () => Fe,
3471
+ KBadge: () => yn,
3472
+ KButton: () => Z,
3473
+ KCheckbox: () => Cn,
3474
+ KCircularProgress: () => Dn,
3475
+ KLoadingDots: () => An,
3476
+ KLoadingIndicator: () => Nn,
3477
+ KMenu: () => Pt,
3478
+ KRadioGroup: () => zn,
3479
+ KSwitch: () => Hn,
3480
+ KTextField: () => Jt,
3481
+ KTextLink: () => Gn,
3482
+ KTextarea: () => sn,
3483
+ extractMenuShortcuts: () => Dt,
3484
+ useShortcuts: () => Yn
2370
3485
  });
2371
- export { ht as a, at as c, q as d, G as f, L as h, xt as i, nt as l, R as m, $ as n, ft as o, H as p, wt as r, lt as s, Dt as t, We as u };
3486
+ export { xe as _, zn as a, Dn as c, sn as d, Jt as f, Me as g, Fe as h, Hn as i, Cn as l, Dt as m, Yn as n, Nn as o, Pt as p, Gn as r, An as s, Xn as t, yn as u, Z as v };