@deck9/ui 0.17.0-next.1 → 0.17.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.
package/dist/src/ui.mjs CHANGED
@@ -1,167 +1,41 @@
1
- import { defineComponent as v, computed as w, openBlock as o, createBlock as k, unref as d, mergeProps as T, createCommentVNode as m, createElementBlock as u, normalizeClass as b, createElementVNode as c, toDisplayString as C, createVNode as y, ref as D, watch as I, Fragment as E, withDirectives as te, vModelText as le, normalizeStyle as G, withCtx as h, renderSlot as U, Teleport as se, Transition as O, normalizeProps as oe, guardReactiveProps as ne, resolveDynamicComponent as re, onMounted as ie, renderList as Z } from "vue";
2
- import { FontAwesomeIcon as de } from "@fortawesome/vue-fontawesome";
3
- import { library as F } from "@fortawesome/fontawesome-svg-core";
4
- import * as e from "@fortawesome/free-solid-svg-icons";
5
- import * as B from "@fortawesome/free-brands-svg-icons";
6
- import { v4 as Q } from "uuid";
7
- import { useEyeDropper as ue } from "@vueuse/core";
8
- import { Menu as ce, MenuButton as fe, MenuItems as me, MenuItem as pe, Listbox as be, ListboxButton as ge, ListboxOptions as ye, ListboxOption as he, Switch as ke } from "@headlessui/vue";
9
- import { useFloating as ve, autoUpdate as _e, offset as xe, flip as Ce, shift as we } from "@floating-ui/vue";
10
- var q = "fas", W = "numeric-input", J = 512, K = 512, A = [], X = "", Y = "m409.445 111 2.112.004c34.066.146 46.74 3.848 59.517 10.681 13.037 6.973 23.268 17.204 30.24 30.241l.415.782c6.705 12.782 10.271 25.9 10.271 60.847v72.002c-.15 34.066-3.852 46.74-10.685 59.517-6.973 13.037-17.204 23.268-30.241 30.24l-.782.415C457.51 382.434 444.392 386 409.445 386h-306.89l-2.112-.004c-34.066-.146-46.74-3.848-59.517-10.681-13.037-6.973-23.268-17.204-30.24-30.241l-.415-.782C3.566 331.51 0 318.392 0 283.445v-69.89c0-35.66 3.713-48.592 10.685-61.629 6.973-13.037 17.204-23.268 30.241-30.24l.782-.415C54.49 114.566 67.608 111 102.555 111h306.89Zm.806 36H102.555l-2.387.005c-22.69.089-31.789 1.488-39.667 5.128l-.523.246c-.696.332-1.385.683-2.074 1.052-6.764 3.617-11.856 8.71-15.473 15.473l-.282.533c-4.492 8.62-6.116 17.401-6.148 43.312v71.502l.012 3.09c.161 24.044 1.9 32.308 6.418 40.755 3.617 6.764 8.71 11.856 15.473 15.473l.533.282c8.62 4.492 17.401 6.116 43.312 6.149h307.696c27.078 0 35.763-1.677 44.651-6.43 6.764-3.618 11.856-8.71 15.473-15.474l.282-.533c4.492-8.62 6.116-17.401 6.149-43.312v-70.696c0-27.078-1.677-35.763-6.43-44.651-3.618-6.764-8.71-11.856-15.474-15.473l-.533-.282c-8.62-4.492-17.401-6.116-43.312-6.149Zm-164.715 19c11.682 0 22.013 1.976 30.994 5.929 8.98 3.952 16.005 9.38 21.074 16.284 5.07 6.904 7.578 14.797 7.527 23.677.103 8.829-2.92 16.066-9.07 21.713-6.15 5.646-13.935 8.983-23.353 10.01v1.231c12.764 1.386 22.362 5.274 28.794 11.665 6.433 6.39 9.598 14.411 9.496 24.061.051 9.24-2.715 17.427-8.299 24.562-5.584 7.135-13.33 12.73-23.236 16.785-9.907 4.055-21.319 6.083-34.236 6.083-12.454 0-23.506-2.143-33.156-6.43-9.65-4.285-17.227-10.201-22.734-17.747-5.506-7.545-8.286-16.22-8.337-26.025h43.23c.051 3.029.99 5.737 2.817 8.124 1.827 2.386 4.336 4.247 7.527 5.582 3.19 1.334 6.845 2.002 10.962 2.002 3.962 0 7.462-.706 10.498-2.118 3.037-1.411 5.404-3.375 7.102-5.89 1.699-2.515 2.522-5.39 2.47-8.623.052-3.183-.913-6.006-2.894-8.47-1.982-2.464-4.748-4.389-8.299-5.775-3.55-1.386-7.642-2.079-12.274-2.079h-16.057v-29.566h16.057c4.271 0 8.041-.693 11.31-2.08 3.267-1.385 5.815-3.31 7.642-5.774s2.714-5.287 2.663-8.47c.051-3.08-.695-5.8-2.239-8.161-1.544-2.361-3.692-4.21-6.446-5.544-2.753-1.334-5.93-2.002-9.533-2.002-3.912 0-7.398.693-10.46 2.08-3.063 1.385-5.468 3.31-7.218 5.774s-2.65 5.287-2.702 8.47h-41.068c.051-9.65 2.715-18.172 7.99-25.563 5.275-7.392 12.518-13.192 21.73-17.401 9.212-4.21 19.788-6.314 31.728-6.314Zm-133.074 0c12.615 0 23.55 2.017 32.807 6.05 9.257 4.033 16.41 9.698 21.462 16.994 5.051 7.296 7.577 15.851 7.577 25.665 0 6.063-1.257 12.087-3.77 18.073-2.512 5.986-7.025 12.601-13.538 19.846-6.513 7.245-15.77 15.877-27.77 25.896l-14.768 12.331v.925H176V326H55.077v-30.829l58.77-48.709c3.897-3.237 7.243-6.28 10.038-9.133 2.794-2.851 4.948-5.793 6.461-8.824 1.513-3.032 2.27-6.397 2.27-10.097 0-4.059-.86-7.527-2.578-10.404-1.717-2.877-4.09-5.1-7.115-6.667-3.026-1.567-6.513-2.35-10.461-2.35-3.95 0-7.424.796-10.424 2.389-3 1.593-5.32 3.93-6.961 7.013-1.641 3.083-2.462 6.834-2.462 11.253H52c0-11.099 2.487-20.655 7.462-28.67 4.974-8.016 12-14.182 21.076-18.498 9.077-4.316 19.718-6.474 31.924-6.474Z";
11
- const j = {
12
- prefix: q,
13
- iconName: W,
14
- icon: [J, K, A, X, Y]
15
- }, $e = {
16
- definition: j,
17
- faAlignJustify: j,
18
- prefix: q,
19
- iconName: W,
20
- width: J,
21
- height: K,
22
- ligatures: A,
23
- unicode: X,
24
- svgPathData: Y,
25
- aliases: A
26
- };
27
- F.add(
28
- e.faAlignCenter,
29
- e.faAlignLeft,
30
- e.faAlignRight,
31
- e.faArrowRight,
32
- e.faArrowUp19,
33
- e.faAsterisk,
34
- e.faAt,
35
- e.faBold,
36
- e.faBolt,
37
- e.faCalendar,
38
- e.faChartPie,
39
- e.faCheck,
40
- e.faCheckCircle,
41
- e.faChevronDown,
42
- e.faChevronLeft,
43
- e.faChevronRight,
44
- e.faChevronUp,
45
- e.faCircleCheck,
46
- e.faCircleNodes,
47
- e.faCircleNotch,
48
- e.faClipboard,
49
- e.faCloudDownload,
50
- e.faCloudUpload,
51
- e.faCode,
52
- e.faCodeBranch,
53
- e.faCodeFork,
54
- e.faCog,
55
- e.faCompass,
56
- e.faCrown,
57
- e.faDiagramProject,
58
- e.faDoorOpen,
59
- e.faDotCircle,
60
- e.faEllipsis,
61
- e.faEllipsisVertical,
62
- e.faEnvelope,
63
- e.faExclamationTriangle,
64
- e.faExternalLink,
65
- e.faEye,
66
- e.faEyeDropper,
67
- e.faEyeSlash,
68
- e.faFileLines,
69
- e.faFilePdf,
70
- e.faFileUpload,
71
- e.faFileVideo,
72
- e.faFileWaveform,
73
- e.faFilter,
74
- e.faFilter,
75
- e.faFingerprint,
76
- e.faFont,
77
- e.faGears,
78
- e.faGlobe,
79
- e.faGripHorizontal,
80
- e.faGripVertical,
81
- e.faHandPointRight,
82
- e.faHandPointRight,
83
- e.faHashtag,
84
- e.faHeading,
85
- e.faHeart,
86
- e.faImage,
87
- e.faInfoCircle,
88
- e.faItalic,
89
- e.faLayerGroup,
90
- e.faLink,
91
- e.faLinkSlash,
92
- e.faList,
93
- e.faListOl,
94
- e.faListUl,
95
- e.faLocationArrow,
96
- e.faLocationCrosshairs,
97
- e.faLock,
98
- e.faLockOpen,
99
- e.faMedal,
100
- e.faMessage,
101
- e.faMicrochip,
102
- e.faPencilAlt,
103
- e.faPenToSquare,
104
- e.faPhone,
105
- e.faPlayCircle,
106
- e.faPlus,
107
- e.faPlusCircle,
108
- e.faPoo,
109
- e.faPuzzlePiece,
110
- e.faQuestion,
111
- e.faQuoteLeft,
112
- e.faQuoteRight,
113
- e.faReply,
114
- e.faReplyAll,
115
- e.faRightLong,
116
- e.faRobot,
117
- e.faSave,
118
- e.faShield,
119
- e.faSignal,
120
- e.faSignature,
121
- e.faSignature,
122
- e.faSquareCheck,
123
- e.faStar,
124
- e.faStrikethrough,
125
- e.faTerminal,
126
- e.faTextSlash,
127
- e.faTimes,
128
- e.faTrash,
129
- e.faTree,
130
- e.faTrophy,
131
- e.faTurnDown,
132
- e.faUnderline,
133
- e.faUpload,
134
- e.faUser,
135
- e.faUserShield,
136
- e.faWandMagicSparkles,
137
- // Brands
138
- B.faTwitter,
139
- B.faInstagram,
140
- B.faGithub,
141
- B.faLinkedin,
142
- B.faFacebook,
143
- // Custom
144
- $e.definition
145
- );
146
- const Le = [...Object.keys(F.definitions.fas)].sort(), N = [...Object.keys(F.definitions.fab)].sort(), x = /* @__PURE__ */ v({
1
+ import { defineComponent as $, computed as D, openBlock as a, createBlock as C, unref as d, mergeProps as P, createCommentVNode as f, createElementBlock as i, normalizeClass as b, createElementVNode as c, toDisplayString as g, createVNode as k, ref as z, watch as I, Fragment as E, withDirectives as J, vModelText as Q, normalizeStyle as F, withCtx as x, renderSlot as T, Teleport as W, Transition as O, Comment as X, normalizeProps as Y, guardReactiveProps as Z, resolveDynamicComponent as ee, onMounted as R, createTextVNode as j, renderList as G, onUnmounted as te } from "vue";
2
+ import { library as se, findIconDefinition as U } from "@fortawesome/fontawesome-svg-core";
3
+ import { FontAwesomeIcon as le } from "@fortawesome/vue-fontawesome";
4
+ import { faCheck as oe, faChevronDown as ae, faCircleNotch as ne, faEllipsis as re, faEyeDropper as ie } from "@fortawesome/free-solid-svg-icons";
5
+ import { v4 as H } from "uuid";
6
+ import { useEyeDropper as de } from "@vueuse/core";
7
+ import { Menu as ue, MenuButton as ce, MenuItems as me, MenuItem as fe, Listbox as pe, ListboxButton as be, ListboxOptions as ge, ListboxOption as ye, Switch as he } from "@headlessui/vue";
8
+ import { useFloating as ke, autoUpdate as ve, offset as _e, flip as xe, shift as $e } from "@floating-ui/vue";
9
+ const K = [
10
+ oe,
11
+ ae,
12
+ ne,
13
+ re,
14
+ ie
15
+ ];
16
+ se.add(...K);
17
+ const yt = K.map(({ iconName: l }) => l), ht = [], w = /* @__PURE__ */ $({
147
18
  __name: "Icon",
148
19
  props: {
149
20
  name: { default: "user" }
150
21
  },
151
- setup(s) {
152
- const a = s, r = w(() => N.includes(a.name) ? "fab" : "fas"), l = w(() => Le.includes(a.name) || N.includes(a.name) ? !0 : (console.warn(
153
- "could not load icon, because it is not available",
154
- a.name
155
- ), !1));
156
- return (t, i) => l.value ? (o(), k(d(de), T({
22
+ setup(l) {
23
+ const n = l, e = D(() => {
24
+ const t = n.name, s = U({ prefix: "fab", iconName: t }) ?? U({ prefix: "fas", iconName: t });
25
+ return s || console.warn(
26
+ "could not load icon, because it is not available",
27
+ n.name
28
+ ), s;
29
+ });
30
+ return (t, s) => e.value ? (a(), C(d(le), P({
157
31
  key: 0,
158
- icon: [r.value, t.name]
159
- }, t.$attrs), null, 16, ["icon"])) : m("", !0);
32
+ icon: e.value
33
+ }, t.$attrs), null, 16, ["icon"])) : f("", !0);
160
34
  }
161
- }), De = ["aria-label", "disabled", "aria-busy"], Ve = {
35
+ }), we = ["aria-label", "disabled", "aria-disabled", "aria-busy"], Ce = {
162
36
  key: 0,
163
37
  class: "absolute inset-0 flex items-center justify-center"
164
- }, ya = /* @__PURE__ */ v({
38
+ }, kt = /* @__PURE__ */ $({
165
39
  __name: "Button",
166
40
  props: {
167
41
  label: {},
@@ -172,135 +46,146 @@ const Le = [...Object.keys(F.definitions.fas)].sort(), N = [...Object.keys(F.def
172
46
  icon: {},
173
47
  iconPosition: { default: "right" }
174
48
  },
175
- setup(s) {
176
- const a = s, r = w(() => {
177
- const t = {
178
- "text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": a.color === "primary",
179
- "text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": a.color === "light",
180
- "text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": a.color === "dark",
181
- "text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": a.color === "danger"
182
- }, i = {
183
- "pointer-events-none opacity-75 cursor-not-allowed": a.isDisabled
184
- }, f = {
185
- "px-4 py-1 text-xs leading-5 mono-100 rounded-lg": a.size === "small",
186
- "px-5 py-2 text-sm leading-4 font-medium rounded-lg": a.size === "medium",
187
- "px-8 py-3 text-base leading-6 font-medium rounded-lg": a.size === "large"
49
+ emits: ["click"],
50
+ setup(l, { emit: n }) {
51
+ const e = l, t = n, s = D(() => {
52
+ const o = {
53
+ "text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": e.color === "primary",
54
+ "text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": e.color === "light",
55
+ "text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": e.color === "dark",
56
+ "text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": e.color === "danger"
57
+ }, p = {
58
+ "pointer-events-none opacity-75 cursor-not-allowed": e.isDisabled,
59
+ "cursor-default": e.isLoading
60
+ }, _ = {
61
+ "px-4 py-1 text-xs leading-5 mono-100 rounded-lg": e.size === "small",
62
+ "px-5 py-2 text-sm leading-4 font-medium rounded-lg": e.size === "medium",
63
+ "px-8 py-3 text-base leading-6 font-medium rounded-lg": e.size === "large"
188
64
  };
189
65
  return {
190
- ...t,
191
- ...i,
192
- ...f
66
+ ...o,
67
+ ...p,
68
+ ..._
193
69
  };
194
- }), l = w(() => {
195
- const t = {
196
- "mr-2 -ml-1": ["small", "medium"].includes(a.size) && a.iconPosition === "left",
197
- "mr-4 -ml-2": ["large"].includes(a.size) && a.iconPosition === "left"
198
- }, i = {
199
- "ml-3 -mr-1": ["small", "medium"].includes(a.size) && a.iconPosition === "right",
200
- "ml-3 -mr-3": ["large"].includes(a.size) && a.iconPosition === "right"
201
- }, f = {
202
- "text-white": a.color === "primary",
203
- "text-blue-600": a.color === "light",
204
- "text-grey-50": a.color === "dark"
70
+ }), u = D(() => {
71
+ const o = {
72
+ "mr-2 -ml-1": ["small", "medium"].includes(e.size) && e.iconPosition === "left",
73
+ "mr-4 -ml-2": ["large"].includes(e.size) && e.iconPosition === "left"
74
+ }, p = {
75
+ "ml-3 -mr-1": ["small", "medium"].includes(e.size) && e.iconPosition === "right",
76
+ "ml-3 -mr-3": ["large"].includes(e.size) && e.iconPosition === "right"
77
+ }, _ = {
78
+ "text-white": e.color === "primary",
79
+ "text-blue-600": e.color === "light",
80
+ "text-grey-50": e.color === "dark"
205
81
  };
206
82
  return {
207
- ...t,
208
- ...i,
209
- ...f
83
+ ...o,
84
+ ...p,
85
+ ..._
210
86
  };
211
87
  });
212
- return (t, i) => (o(), u("button", {
213
- class: b(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", r.value]),
88
+ function v(o) {
89
+ if (e.isLoading) {
90
+ o.preventDefault();
91
+ return;
92
+ }
93
+ t("click", o);
94
+ }
95
+ return (o, p) => (a(), i("button", {
96
+ class: b(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", s.value]),
214
97
  type: "button",
215
- "aria-label": t.label,
216
- disabled: t.isDisabled || t.isLoading,
217
- "aria-busy": t.isLoading
98
+ "aria-label": o.label,
99
+ disabled: o.isDisabled,
100
+ "aria-disabled": o.isLoading || void 0,
101
+ "aria-busy": o.isLoading,
102
+ onClick: v
218
103
  }, [
219
104
  c("div", {
220
- class: b(!t.isLoading || "invisible")
105
+ class: b(!o.isLoading || "invisible")
221
106
  }, [
222
- t.icon && t.iconPosition === "left" ? (o(), k(x, {
107
+ o.icon && o.iconPosition === "left" ? (a(), C(w, {
223
108
  key: 0,
224
- name: t.icon,
225
- class: b(l.value)
226
- }, null, 8, ["name", "class"])) : m("", !0),
227
- c("span", null, C(t.label), 1),
228
- t.icon && t.iconPosition === "right" ? (o(), k(x, {
109
+ name: o.icon,
110
+ class: b(u.value)
111
+ }, null, 8, ["name", "class"])) : f("", !0),
112
+ c("span", null, g(o.label), 1),
113
+ o.icon && o.iconPosition === "right" ? (a(), C(w, {
229
114
  key: 1,
230
- name: t.icon,
231
- class: b(l.value)
232
- }, null, 8, ["name", "class"])) : m("", !0)
115
+ name: o.icon,
116
+ class: b(u.value)
117
+ }, null, 8, ["name", "class"])) : f("", !0)
233
118
  ], 2),
234
- t.isLoading ? (o(), u("span", Ve, [
235
- y(x, {
119
+ o.isLoading ? (a(), i("span", Ce, [
120
+ k(w, {
236
121
  class: "animate-spin",
237
122
  name: "circle-notch"
238
123
  })
239
- ])) : m("", !0)
240
- ], 10, De));
124
+ ])) : f("", !0)
125
+ ], 10, we));
241
126
  }
242
- }), Se = { class: "relative flex items-start" }, ze = ["checked", "id"], Pe = { class: "ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed" }, Be = ["for"], Me = {
127
+ }), Ve = { class: "relative flex items-start" }, De = ["checked", "id"], ze = { class: "ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed" }, Be = ["for"], Le = {
243
128
  key: 0,
244
129
  class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
245
- }, Ie = {
130
+ }, Se = {
246
131
  inheritAttrs: !1
247
- }, ha = /* @__PURE__ */ v({
248
- ...Ie,
132
+ }, vt = /* @__PURE__ */ $({
133
+ ...Se,
249
134
  __name: "Checkbox",
250
135
  props: {
251
- id: { default: () => Q() },
136
+ id: { default: () => H() },
252
137
  label: {},
253
138
  modelValue: { type: Boolean },
254
139
  description: {}
255
140
  },
256
141
  emits: ["update:modelValue"],
257
- setup(s, { emit: a }) {
258
- const r = a, l = (t) => {
259
- r("update:modelValue", t.target.checked);
142
+ setup(l, { emit: n }) {
143
+ const e = n, t = (s) => {
144
+ e("update:modelValue", s.target.checked);
260
145
  };
261
- return (t, i) => (o(), u("div", Se, [
262
- c("input", T({
146
+ return (s, u) => (a(), i("div", Ve, [
147
+ c("input", P({
263
148
  class: "peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",
264
149
  type: "checkbox",
265
- checked: t.modelValue,
266
- onChange: l,
267
- id: t.id
268
- }, t.$attrs), null, 16, ze),
269
- c("div", Pe, [
150
+ checked: s.modelValue,
151
+ onChange: t,
152
+ id: s.id
153
+ }, s.$attrs), null, 16, De),
154
+ c("div", ze, [
270
155
  c("label", {
271
- for: t.id,
156
+ for: s.id,
272
157
  class: "font-medium text-grey-700 dark:text-grey-200 casual-25"
273
- }, C(t.label), 9, Be),
274
- t.description ? (o(), u("p", Me, C(t.description), 1)) : m("", !0)
158
+ }, g(s.label), 9, Be),
159
+ s.description ? (a(), i("p", Le, g(s.description), 1)) : f("", !0)
275
160
  ])
276
161
  ]));
277
162
  }
278
163
  });
279
- function H(s) {
280
- const a = w(() => ({
281
- "pl-3 pr-10 py-2": !s.icon && s.type !== "color" && s.size === "small",
282
- "pl-4 pr-10 py-3": !s.icon && s.type !== "color" && s.size === "medium",
283
- "pl-6 pr-10 py-3": !s.icon && s.type !== "color" && s.size === "large",
284
- "pl-10 pr-10 py-1": (s.icon || s.type === "color") && s.size === "small",
285
- "pl-12 pr-10 py-3": (s.icon || s.type === "color") && (s.size === "medium" || s.size === "large"),
286
- "w-full block": s.block === !0
287
- })), r = w(() => ({
288
- "pointer-events-none opacity-50 cursor-not-allowed": s.isDisabled
289
- })), l = w(() => ({
290
- "text-xs leading-4": s.size === "small",
291
- "text-sm leading-4": s.size === "medium",
292
- "text-base leading-5": s.size === "large"
164
+ function A(l) {
165
+ const n = D(() => ({
166
+ "pl-3 pr-10 py-2": !l.icon && l.type !== "color" && l.size === "small",
167
+ "pl-4 pr-10 py-3": !l.icon && l.type !== "color" && l.size === "medium",
168
+ "pl-6 pr-10 py-3": !l.icon && l.type !== "color" && l.size === "large",
169
+ "pl-10 pr-10 py-1": (l.icon || l.type === "color") && l.size === "small",
170
+ "pl-12 pr-10 py-3": (l.icon || l.type === "color") && (l.size === "medium" || l.size === "large"),
171
+ "w-full block": l.block === !0
172
+ })), e = D(() => ({
173
+ "pointer-events-none opacity-50 cursor-not-allowed": l.isDisabled
174
+ })), t = D(() => ({
175
+ "text-xs leading-4": l.size === "small",
176
+ "text-sm leading-4": l.size === "medium",
177
+ "text-base leading-5": l.size === "large"
293
178
  }));
294
179
  return {
295
- inputClasses: a,
296
- disabledClasses: r,
297
- textSizeClasses: l
180
+ inputClasses: n,
181
+ disabledClasses: e,
182
+ textSizeClasses: t
298
183
  };
299
184
  }
300
- const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" }, Ee = ["disabled"], Fe = ["disabled"], He = {
185
+ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" }, Ie = ["disabled"], Te = ["disabled"], Ee = {
301
186
  inheritAttrs: !1
302
- }, ka = /* @__PURE__ */ v({
303
- ...He,
187
+ }, _t = /* @__PURE__ */ $({
188
+ ...Ee,
304
189
  __name: "Input",
305
190
  props: {
306
191
  modelValue: {},
@@ -315,187 +200,201 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
315
200
  showColorPicker: { type: Boolean }
316
201
  },
317
202
  emits: ["update:modelValue"],
318
- setup(s, { expose: a, emit: r }) {
319
- const l = s, t = D(null), i = D(l.modelValue ?? ""), f = (n) => l.type === "number" && n !== "" && n !== null ? Number(n) : n;
203
+ setup(l, { expose: n, emit: e }) {
204
+ const t = l, s = z(null), u = z(t.modelValue ?? ""), v = (r) => t.type === "number" && r !== "" && r !== null ? Number(r) : r;
320
205
  I(
321
- () => l.modelValue,
322
- (n) => {
323
- typeof n < "u" && n !== f(i.value) && (i.value = n);
206
+ () => t.modelValue,
207
+ (r) => {
208
+ typeof r < "u" && r !== v(u.value) && (u.value = r);
324
209
  }
325
210
  );
326
- const $ = r, { inputClasses: V, disabledClasses: L, textSizeClasses: z } = H(l), _ = w(() => l.type === "color" ? "text" : l.type), {
327
- isSupported: p,
328
- open: R,
329
- sRGBHex: g
330
- } = ue(), M = () => {
331
- R();
211
+ const o = e, { inputClasses: p, disabledClasses: _, textSizeClasses: V } = A(t), y = D(() => t.type === "color" ? "text" : t.type), {
212
+ isSupported: M,
213
+ open: m,
214
+ sRGBHex: N
215
+ } = de(), h = () => {
216
+ m();
332
217
  };
333
- I(g, (n) => {
334
- i.value = n, $("update:modelValue", n);
218
+ I(N, (r) => {
219
+ u.value = r, o("update:modelValue", r);
335
220
  });
336
- const P = function(n) {
337
- i.value = (n == null ? void 0 : n.target).value, $("update:modelValue", f(i.value));
338
- }, ee = function() {
339
- const n = f(i.value);
340
- if (typeof n != "number")
221
+ const B = function(r) {
222
+ u.value = (r == null ? void 0 : r.target).value, o("update:modelValue", v(u.value));
223
+ }, S = function() {
224
+ const r = v(u.value);
225
+ if (typeof r != "number")
341
226
  return;
342
- const S = Math.min(
343
- Math.max(n, l.min ?? -1 / 0),
344
- l.max ?? 1 / 0
227
+ const L = Math.min(
228
+ Math.max(r, t.min ?? -1 / 0),
229
+ t.max ?? 1 / 0
345
230
  );
346
- S !== n && (i.value = S, $("update:modelValue", S));
231
+ L !== r && (u.value = L, o("update:modelValue", L));
347
232
  };
348
- return a({
233
+ return n({
349
234
  focus: () => {
350
- var n;
351
- l.isDisabled || (n = t.value) == null || n.focus();
235
+ var r;
236
+ t.isDisabled || (r = s.value) == null || r.focus();
352
237
  }
353
- }), (n, S) => (o(), u("div", {
354
- class: b(["relative", [n.block ? "w-full block" : "inline-block"]])
238
+ }), (r, L) => (a(), i("div", {
239
+ class: b(["relative", [r.block ? "w-full block" : "inline-block"]])
355
240
  }, [
356
- c("input", T({
357
- class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(V), d(z), d(L)]],
358
- placeholder: n.placeholder,
359
- type: _.value,
360
- min: n.min,
361
- max: n.max,
362
- disabled: n.isDisabled,
363
- value: i.value
364
- }, n.$attrs, {
241
+ c("input", P({
242
+ class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(p), d(V), d(_)]],
243
+ placeholder: r.placeholder,
244
+ type: y.value,
245
+ min: r.min,
246
+ max: r.max,
247
+ disabled: r.isDisabled,
248
+ value: u.value
249
+ }, r.$attrs, {
365
250
  ref_key: "inputElement",
366
- ref: t,
367
- onInput: P,
368
- onChange: ee
369
- }), null, 16, Te),
370
- n.type === "color" ? (o(), u(E, { key: 0 }, [
371
- c("label", Ae, [
372
- te(c("input", {
251
+ ref: s,
252
+ onInput: B,
253
+ onChange: S
254
+ }), null, 16, Pe),
255
+ r.type === "color" ? (a(), i(E, { key: 0 }, [
256
+ c("label", Me, [
257
+ J(c("input", {
373
258
  class: "invisible",
374
259
  type: "color",
375
- disabled: n.isDisabled,
376
- "onUpdate:modelValue": S[0] || (S[0] = (ae) => i.value = ae),
377
- onInput: P
378
- }, null, 40, Ee), [
379
- [le, i.value]
260
+ disabled: r.isDisabled,
261
+ "onUpdate:modelValue": L[0] || (L[0] = (q) => u.value = q),
262
+ onInput: B
263
+ }, null, 40, Ie), [
264
+ [Q, u.value]
380
265
  ]),
381
266
  c("span", {
382
267
  class: "border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",
383
- style: G(`background-color: ${i.value}`)
268
+ style: F(`background-color: ${u.value}`)
384
269
  }, null, 4)
385
270
  ]),
386
- d(p) && n.showColorPicker ? (o(), u("button", {
271
+ d(M) && r.showColorPicker ? (a(), i("button", {
387
272
  key: 0,
388
273
  type: "button",
389
274
  class: "absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",
390
- disabled: n.isDisabled,
391
- onClick: M
275
+ disabled: r.isDisabled,
276
+ onClick: h
392
277
  }, [
393
- y(x, {
278
+ k(w, {
394
279
  size: "xs",
395
280
  name: "eyedropper"
396
281
  })
397
- ], 8, Fe)) : m("", !0)
398
- ], 64)) : n.icon ? (o(), u("span", {
282
+ ], 8, Te)) : f("", !0)
283
+ ], 64)) : r.icon ? (a(), i("span", {
399
284
  key: 1,
400
- class: b(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", d(z)])
285
+ class: b(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", d(V)])
401
286
  }, [
402
- y(x, { name: n.icon }, null, 8, ["name"])
403
- ], 2)) : m("", !0)
287
+ k(w, { name: r.icon }, null, 8, ["name"])
288
+ ], 2)) : f("", !0)
404
289
  ], 2));
405
290
  }
406
- }), Re = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" }, Ue = ["id", "for"], je = {
291
+ }), Ae = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" }, Ne = ["id", "for"], je = {
407
292
  key: 0,
408
293
  class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
409
- }, va = /* @__PURE__ */ v({
294
+ }, xt = /* @__PURE__ */ $({
410
295
  __name: "Label",
411
296
  props: {
412
297
  id: {},
413
298
  label: {},
414
299
  description: {}
415
300
  },
416
- setup(s) {
417
- return (a, r) => (o(), u("span", Re, [
301
+ setup(l) {
302
+ return (n, e) => (a(), i("span", Ae, [
418
303
  c("label", {
419
- id: a.id ? `${a.id}-label` : void 0,
420
- for: a.id
421
- }, C(a.label), 9, Ue),
422
- a.description ? (o(), u("span", je, C(a.description), 1)) : m("", !0)
304
+ id: n.id ? `${n.id}-label` : void 0,
305
+ for: n.id
306
+ }, g(n.label), 9, Ne),
307
+ n.description ? (a(), i("span", je, g(n.description), 1)) : f("", !0)
423
308
  ]));
424
309
  }
425
- }), _a = /* @__PURE__ */ v({
310
+ }), Ue = {
311
+ key: 0,
312
+ class: "sr-only"
313
+ }, $t = /* @__PURE__ */ $({
426
314
  __name: "MenuContainer",
427
315
  props: {
428
316
  position: { default: "left" },
429
- usePortal: { type: [Boolean, String], default: !1 }
317
+ usePortal: { type: [Boolean, String], default: !1 },
318
+ label: { default: "Open menu" }
430
319
  },
431
- setup(s) {
432
- const a = s, r = D(null), l = D(null), t = a.position === "left" ? "bottom-end" : "bottom-start", { floatingStyles: i } = ve(r, l, {
433
- placement: t,
434
- whileElementsMounted: _e,
435
- middleware: [xe(6), Ce(), we({ padding: 6 })]
320
+ setup(l) {
321
+ const n = l, e = (o = []) => o.some(
322
+ (p) => typeof p.children == "string" ? p.type !== X && p.children.trim() !== "" : Array.isArray(p.children) && e(p.children)
323
+ ), t = z(null), s = z(null), u = n.position === "left" ? "bottom-end" : "bottom-start", { floatingStyles: v } = ke(t, s, {
324
+ placement: u,
325
+ // left/top instead of a transform, so the transition's translate isn't overridden
326
+ transform: !1,
327
+ whileElementsMounted: ve,
328
+ middleware: [_e(6), xe(), $e({ padding: 6 })]
436
329
  });
437
- return (f, $) => (o(), k(d(ce), {
330
+ return (o, p) => (a(), C(d(ue), {
438
331
  as: "div",
439
332
  class: "inline-block text-left"
440
333
  }, {
441
- default: h(() => [
442
- y(d(fe), {
334
+ default: x(({ open: _ }) => [
335
+ k(d(ce), {
443
336
  class: "focus:outline-none",
444
337
  ref_key: "reference",
445
- ref: r
338
+ ref: t
446
339
  }, {
447
- default: h(() => [
448
- U(f.$slots, "button", {}, () => [
449
- y(d(x), {
450
- class: "fill-current",
451
- name: "ellipsis-h"
452
- })
453
- ])
454
- ]),
340
+ default: x(() => {
341
+ var V, y;
342
+ return [
343
+ T(o.$slots, "button", {}, () => [
344
+ k(d(w), {
345
+ class: "fill-current",
346
+ name: "ellipsis-h"
347
+ })
348
+ ]),
349
+ e((y = (V = o.$slots).button) == null ? void 0 : y.call(V)) ? f("", !0) : (a(), i("span", Ue, g(o.label), 1))
350
+ ];
351
+ }),
455
352
  _: 3
456
353
  }, 512),
457
- (o(), k(se, {
458
- to: typeof f.usePortal == "string" ? f.usePortal : "body",
459
- disabled: !f.usePortal
354
+ (a(), C(W, {
355
+ to: typeof o.usePortal == "string" ? o.usePortal : "body",
356
+ disabled: !o.usePortal
460
357
  }, [
461
- c("div", {
462
- class: "w-56 z-20",
463
- style: G(d(i)),
464
- ref_key: "floating",
465
- ref: l
466
- }, [
467
- y(O, {
468
- "enter-active-class": "transition duration-200 ease-in-out",
469
- "enter-from-class": "transform -translate-y-4 opacity-0",
470
- "enter-to-class": "transform opacity-100",
471
- "leave-active-class": "transition duration-100 ease-in-out",
472
- "leave-from-class": "transform opacity-100",
473
- "leave-to-class": "transform -translate-y-2 opacity-0"
474
- }, {
475
- default: h(() => [
476
- y(d(me), {
358
+ k(O, {
359
+ "enter-active-class": "transition duration-200 ease-in-out",
360
+ "enter-from-class": "transform -translate-y-4 opacity-0",
361
+ "enter-to-class": "transform opacity-100",
362
+ "leave-active-class": "transition duration-100 ease-in-out",
363
+ "leave-from-class": "transform opacity-100",
364
+ "leave-to-class": "transform -translate-y-2 opacity-0"
365
+ }, {
366
+ default: x(() => [
367
+ _ ? (a(), i("div", {
368
+ key: 0,
369
+ class: "w-56 z-20",
370
+ style: F(d(v)),
371
+ ref_key: "floating",
372
+ ref: s
373
+ }, [
374
+ k(d(me), {
375
+ static: "",
477
376
  class: b([
478
377
  "z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"
479
378
  ])
480
379
  }, {
481
- default: h(() => [
482
- U(f.$slots, "default")
380
+ default: x(() => [
381
+ T(o.$slots, "default")
483
382
  ]),
484
383
  _: 3
485
384
  })
486
- ]),
487
- _: 3
488
- })
489
- ], 4)
385
+ ], 4)) : f("", !0)
386
+ ]),
387
+ _: 2
388
+ }, 1024)
490
389
  ], 8, ["to", "disabled"]))
491
390
  ]),
492
391
  _: 3
493
392
  }));
494
393
  }
495
- }), Ne = {
394
+ }), Fe = {
496
395
  key: 0,
497
396
  class: "bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"
498
- }, xa = /* @__PURE__ */ v({
397
+ }, wt = /* @__PURE__ */ $({
499
398
  __name: "MenuLink",
500
399
  props: {
501
400
  label: {},
@@ -503,18 +402,18 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
503
402
  disabled: { type: Boolean },
504
403
  as: {}
505
404
  },
506
- setup(s) {
507
- return (a, r) => (o(), k(d(pe), oe(ne({ disabled: a.disabled })), {
508
- default: h(({ active: l }) => [
509
- (o(), k(re(a.as || "span"), {
405
+ setup(l) {
406
+ return (n, e) => (a(), C(d(fe), Y(Z({ disabled: n.disabled })), {
407
+ default: x(({ active: t }) => [
408
+ (a(), C(ee(n.as || "span"), {
510
409
  class: b(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
511
- l ? "bg-grey-200" : "",
512
- a.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
410
+ t ? "bg-grey-200" : "",
411
+ n.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
513
412
  ]])
514
413
  }, {
515
- default: h(() => [
516
- c("span", null, C(a.label), 1),
517
- a.meta ? (o(), u("span", Ne, C(a.meta), 1)) : m("", !0)
414
+ default: x(() => [
415
+ c("span", null, g(n.label), 1),
416
+ n.meta ? (a(), i("span", Fe, g(n.meta), 1)) : f("", !0)
518
417
  ]),
519
418
  _: 2
520
419
  }, 1032, ["class"]))
@@ -522,19 +421,19 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
522
421
  _: 1
523
422
  }, 16));
524
423
  }
525
- }), Ge = { class: "relative" }, Oe = {
424
+ }), Oe = { class: "relative" }, Re = {
526
425
  key: 0,
527
426
  class: "absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"
528
- }, Ze = {
427
+ }, Ge = {
529
428
  key: 1,
530
429
  class: "block truncate"
531
- }, Qe = ["innerHTML"], qe = {
430
+ }, He = {
532
431
  key: 2,
533
432
  class: "text-grey-500 truncate"
534
- }, We = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" }, Je = { class: "absolute right-2 inset-y-0 flex items-center" }, Ke = {
433
+ }, Ke = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" }, qe = { class: "absolute right-2 inset-y-0 flex items-center" }, Je = {
535
434
  key: 0,
536
435
  class: "bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"
537
- }, Xe = ["innerHTML"], Ca = /* @__PURE__ */ v({
436
+ }, Ct = /* @__PURE__ */ $({
538
437
  __name: "Select",
539
438
  props: {
540
439
  id: {},
@@ -544,54 +443,60 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
544
443
  placeholder: {},
545
444
  isDisabled: { type: Boolean, default: !1 },
546
445
  options: {},
547
- disabledBadge: {}
446
+ disabledBadge: {},
447
+ by: {}
548
448
  },
549
449
  emits: ["update:modelValue"],
550
- setup(s, { emit: a }) {
551
- const r = s, l = D(r.modelValue ?? null), t = a, { inputClasses: i, disabledClasses: f, textSizeClasses: $ } = H(r), V = D(!1), L = () => {
552
- V.value = !!r.id && !!document.getElementById(`${r.id}-label`);
450
+ setup(l, { emit: n }) {
451
+ const e = l, t = z(e.modelValue ?? null), s = n, u = (m) => typeof e.by == "string" ? m[e.by] : m.id, { inputClasses: v, disabledClasses: o, textSizeClasses: p } = A(e), _ = z(!1), V = () => {
452
+ _.value = !!e.id && !!document.getElementById(`${e.id}-label`);
553
453
  };
554
- ie(L), I(() => r.id, L, { flush: "post" });
555
- const z = w(
556
- () => V.value ? `${r.id}-label ${r.id}` : void 0
454
+ R(V), I(() => e.id, V, { flush: "post" });
455
+ const y = D(
456
+ () => _.value ? `${e.id}-label ${e.id}` : void 0
557
457
  );
558
458
  I(
559
- () => r.modelValue,
560
- (p) => {
561
- l.value = p ?? null;
459
+ () => e.modelValue,
460
+ (m) => {
461
+ t.value = m ?? null;
562
462
  }
563
463
  );
564
- const _ = (p) => {
565
- l.value = p, t("update:modelValue", p);
464
+ const M = (m) => {
465
+ t.value = m, s("update:modelValue", m);
566
466
  };
567
- return (p, R) => (o(), k(d(be), {
467
+ return (m, N) => (a(), C(d(pe), {
568
468
  as: "div",
569
- "model-value": l.value,
570
- "onUpdate:modelValue": _,
571
- disabled: p.isDisabled
469
+ "model-value": t.value,
470
+ "onUpdate:modelValue": M,
471
+ by: m.by,
472
+ disabled: m.isDisabled
572
473
  }, {
573
- default: h(() => [
574
- c("div", Ge, [
575
- y(d(ge), {
576
- id: p.id,
577
- "aria-labelledby": z.value,
578
- class: b(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [d(i), d($), d(f)]])
474
+ default: x(() => [
475
+ c("div", Oe, [
476
+ k(d(be), {
477
+ id: m.id,
478
+ "aria-labelledby": y.value,
479
+ class: b(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [d(v), d(p), d(o)]])
579
480
  }, {
580
- default: h(() => {
581
- var g;
481
+ default: x(() => {
482
+ var h;
582
483
  return [
583
- p.icon ? (o(), u("span", Oe, [
584
- y(x, {
585
- name: ((g = l.value) == null ? void 0 : g.icon) ?? p.icon
484
+ m.icon ? (a(), i("span", Re, [
485
+ k(w, {
486
+ name: ((h = t.value) == null ? void 0 : h.icon) ?? m.icon
586
487
  }, null, 8, ["name"])
587
- ])) : m("", !0),
588
- l.value ? (o(), u("span", Ze, [
589
- c("span", {
590
- innerHTML: l.value.label
591
- }, null, 8, Qe)
592
- ])) : (o(), u("span", qe, C(p.placeholder), 1)),
593
- c("span", We, [
594
- y(x, {
488
+ ])) : f("", !0),
489
+ t.value ? (a(), i("span", Ge, [
490
+ T(m.$slots, "option", {
491
+ option: t.value,
492
+ active: !1,
493
+ selected: !0
494
+ }, () => [
495
+ j(g(t.value.label), 1)
496
+ ])
497
+ ])) : (a(), i("span", He, g(m.placeholder), 1)),
498
+ c("span", Ke, [
499
+ k(w, {
595
500
  class: "text-grey-400",
596
501
  name: "chevron-down",
597
502
  "aria-hidden": "true"
@@ -599,89 +504,93 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
599
504
  ])
600
505
  ];
601
506
  }),
602
- _: 1
507
+ _: 3
603
508
  }, 8, ["id", "aria-labelledby", "class"]),
604
- y(O, {
509
+ k(O, {
605
510
  "leave-active-class": "transition ease-in duration-100",
606
511
  "leave-from-class": "opacity-100",
607
512
  "leave-to-class": "opacity-0"
608
513
  }, {
609
- default: h(() => [
610
- y(d(ye), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
611
- default: h(() => [
612
- (o(!0), u(E, null, Z(p.options, (g) => (o(), k(d(he), {
514
+ default: x(() => [
515
+ k(d(ge), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
516
+ default: x(() => [
517
+ (a(!0), i(E, null, G(m.options, (h) => (a(), C(d(ye), {
613
518
  as: "template",
614
- key: g.id,
615
- value: g,
616
- disabled: g.disabled
519
+ key: u(h),
520
+ value: h,
521
+ disabled: h.disabled
617
522
  }, {
618
- default: h(({ active: M, selected: P }) => [
523
+ default: x(({ active: B, selected: S }) => [
619
524
  c("li", {
620
525
  class: b([
621
- M ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
526
+ B ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
622
527
  "cursor-default select-none relative py-2 pl-3 pr-12",
623
- { "opacity-50 bg-grey-100": g.disabled }
528
+ { "opacity-50 bg-grey-100": h.disabled }
624
529
  ])
625
530
  }, [
626
- c("div", Je, [
627
- g.disabled && p.disabledBadge ? (o(), u("span", Ke, C(p.disabledBadge), 1)) : m("", !0)
531
+ c("div", qe, [
532
+ h.disabled && m.disabledBadge ? (a(), i("span", Je, g(m.disabledBadge), 1)) : f("", !0)
628
533
  ]),
629
534
  c("span", {
630
535
  class: b([
631
- P ? "font-semibold" : "font-normal",
536
+ S ? "font-semibold" : "font-normal",
632
537
  "block truncate"
633
538
  ])
634
539
  }, [
635
- g.icon ? (o(), k(x, {
540
+ h.icon ? (a(), C(w, {
636
541
  key: 0,
637
542
  class: "inline-block mr-1",
638
- name: g.icon
639
- }, null, 8, ["name"])) : m("", !0),
640
- c("span", {
641
- innerHTML: g.label
642
- }, null, 8, Xe)
543
+ name: h.icon
544
+ }, null, 8, ["name"])) : f("", !0),
545
+ T(m.$slots, "option", {
546
+ option: h,
547
+ active: B,
548
+ selected: S
549
+ }, () => [
550
+ j(g(h.label), 1)
551
+ ])
643
552
  ], 2),
644
- P ? (o(), u("span", {
553
+ S ? (a(), i("span", {
645
554
  key: 0,
646
555
  class: b([
647
- M ? "text-blue-100" : "text-blue-500",
556
+ B ? "text-blue-100" : "text-blue-500",
648
557
  "absolute inset-y-0 right-0 flex items-center pr-4"
649
558
  ])
650
559
  }, [
651
- y(x, {
560
+ k(w, {
652
561
  name: "check",
653
562
  class: "h-5 w-5",
654
563
  "aria-hidden": "true"
655
564
  })
656
- ], 2)) : m("", !0)
565
+ ], 2)) : f("", !0)
657
566
  ], 2)
658
567
  ]),
659
568
  _: 2
660
569
  }, 1032, ["value", "disabled"]))), 128))
661
570
  ]),
662
- _: 1
571
+ _: 3
663
572
  })
664
573
  ]),
665
- _: 1
574
+ _: 3
666
575
  })
667
576
  ])
668
577
  ]),
669
- _: 1
670
- }, 8, ["model-value", "disabled"]));
578
+ _: 3
579
+ }, 8, ["model-value", "by", "disabled"]));
671
580
  }
672
- }), Ye = { class: "animate-pulse" }, ea = { class: "flex items-center justify-between space-x-4" }, aa = {
581
+ }), Qe = { class: "animate-pulse" }, We = { class: "flex items-center justify-between space-x-4" }, Xe = {
673
582
  key: 0,
674
583
  class: "w-12 h-12 bg-current rounded-full shrink-0"
675
- }, ta = {
584
+ }, Ye = {
676
585
  key: 1,
677
586
  class: "w-full h-8 bg-current rounded-lg"
678
- }, la = {
587
+ }, Ze = {
679
588
  key: 0,
680
589
  class: "mt-6 space-y-2"
681
- }, sa = {
590
+ }, et = {
682
591
  key: 1,
683
592
  class: "w-1/3 h-10 mt-6 bg-current rounded-lg"
684
- }, wa = /* @__PURE__ */ v({
593
+ }, Vt = /* @__PURE__ */ $({
685
594
  __name: "Skeleton",
686
595
  props: {
687
596
  avatar: { type: Boolean, default: !1 },
@@ -689,71 +598,86 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
689
598
  lines: { default: 3 },
690
599
  footer: { type: Boolean, default: !1 }
691
600
  },
692
- setup(s) {
693
- const a = s, r = new Array(a.lines).fill(void 0).map(() => {
694
- const l = [4, 5, 6, 8, 10, 16, 24, 32];
695
- return {
696
- margin: `mr-${l[Math.floor(Math.random() * l.length)]}`
697
- };
698
- });
699
- return (l, t) => (o(), u("div", Ye, [
700
- c("div", ea, [
701
- l.avatar ? (o(), u("div", aa)) : m("", !0),
702
- l.title ? (o(), u("div", ta)) : m("", !0)
601
+ setup(l) {
602
+ const n = l, e = ["mr-4", "mr-5", "mr-6", "mr-8", "mr-10", "mr-16", "mr-24", "mr-32"], t = D(
603
+ () => Array.from({ length: Math.max(0, Math.floor(n.lines)) }, () => ({
604
+ margin: e[Math.floor(Math.random() * e.length)]
605
+ }))
606
+ );
607
+ return (s, u) => (a(), i("div", Qe, [
608
+ c("div", We, [
609
+ s.avatar ? (a(), i("div", Xe)) : f("", !0),
610
+ s.title ? (a(), i("div", Ye)) : f("", !0)
703
611
  ]),
704
- l.lines > 0 ? (o(), u("div", la, [
705
- (o(!0), u(E, null, Z(d(r), (i, f) => (o(), u("div", {
706
- class: b(["h-4 bg-current rounded-lg", i.margin]),
707
- key: f
612
+ t.value.length > 0 ? (a(), i("div", Ze, [
613
+ (a(!0), i(E, null, G(t.value, (v, o) => (a(), i("div", {
614
+ class: b(["h-4 bg-current rounded-lg", v.margin]),
615
+ key: o
708
616
  }, null, 2))), 128))
709
- ])) : m("", !0),
710
- l.footer ? (o(), u("div", sa)) : m("", !0)
617
+ ])) : f("", !0),
618
+ s.footer ? (a(), i("div", et)) : f("", !0)
711
619
  ]));
712
620
  }
713
- }), $a = /* @__PURE__ */ v({
621
+ }), tt = {
622
+ role: "status",
623
+ class: "inline-flex align-[-0.125em]"
624
+ }, st = { class: "sr-only" }, lt = {
625
+ inheritAttrs: !1
626
+ }, Dt = /* @__PURE__ */ $({
627
+ ...lt,
714
628
  __name: "Spinner",
715
- setup(s) {
716
- return (a, r) => (o(), k(d(x), {
717
- class: "animate-spin",
718
- name: "circle-notch"
719
- }));
629
+ props: {
630
+ label: { default: "Loading" }
631
+ },
632
+ setup(l) {
633
+ const n = z(!1);
634
+ let e;
635
+ return R(() => {
636
+ e = setTimeout(() => n.value = !0, 100);
637
+ }), te(() => clearTimeout(e)), (t, s) => (a(), i("span", tt, [
638
+ k(d(w), P({
639
+ class: "animate-spin",
640
+ name: "circle-notch"
641
+ }, t.$attrs), null, 16),
642
+ c("span", st, g(n.value ? t.label : ""), 1)
643
+ ]));
720
644
  }
721
- }), oa = { class: "sr-only" }, La = /* @__PURE__ */ v({
645
+ }), ot = { class: "sr-only" }, zt = /* @__PURE__ */ $({
722
646
  __name: "Switch",
723
647
  props: {
724
- id: { default: () => Q() },
648
+ id: { default: () => H() },
725
649
  label: {},
726
650
  modelValue: { type: Boolean },
727
651
  onLabel: { default: "on" },
728
652
  offLabel: { default: "off" }
729
653
  },
730
654
  emits: ["update:modelValue", "change"],
731
- setup(s, { emit: a }) {
732
- const r = a, l = (t) => {
733
- r("update:modelValue", t), r("change", t);
655
+ setup(l, { emit: n }) {
656
+ const e = n, t = (s) => {
657
+ e("update:modelValue", s), e("change", s);
734
658
  };
735
- return (t, i) => (o(), k(d(ke), {
736
- id: t.id,
737
- modelValue: t.modelValue,
738
- class: b([t.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
739
- "onUpdate:modelValue": l
659
+ return (s, u) => (a(), C(d(he), {
660
+ id: s.id,
661
+ modelValue: s.modelValue,
662
+ class: b([s.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
663
+ "onUpdate:modelValue": t
740
664
  }, {
741
- default: h(() => [
665
+ default: x(() => [
742
666
  c("span", {
743
- class: b(["absolute text-xs text-center text-white inset-x-2", t.modelValue ? "pr-3" : "pl-3"])
744
- }, C(t.modelValue === !0 ? t.onLabel : t.offLabel), 3),
745
- c("span", oa, C(t.label), 1),
667
+ class: b(["absolute text-xs text-center text-white inset-x-2", s.modelValue ? "pr-3" : "pl-3"])
668
+ }, g(s.modelValue === !0 ? s.onLabel : s.offLabel), 3),
669
+ c("span", ot, g(s.label), 1),
746
670
  c("span", {
747
- class: b([t.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
671
+ class: b([s.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
748
672
  }, null, 2)
749
673
  ]),
750
674
  _: 1
751
675
  }, 8, ["id", "modelValue", "class"]));
752
676
  }
753
- }), na = { class: "relative" }, ra = ["disabled", "value"], ia = {
677
+ }), at = { class: "relative" }, nt = ["disabled", "value"], rt = {
754
678
  inheritAttrs: !1
755
- }, Da = /* @__PURE__ */ v({
756
- ...ia,
679
+ }, Bt = /* @__PURE__ */ $({
680
+ ...rt,
757
681
  __name: "Textarea",
758
682
  props: {
759
683
  modelValue: {},
@@ -762,43 +686,43 @@ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { cl
762
686
  block: { type: Boolean }
763
687
  },
764
688
  emits: ["update:modelValue"],
765
- setup(s, { expose: a, emit: r }) {
766
- const l = s, t = r, { inputClasses: i, disabledClasses: f, textSizeClasses: $ } = H(l), V = function(_) {
767
- t("update:modelValue", (_ == null ? void 0 : _.target).value);
768
- }, L = D(null);
769
- return a({
689
+ setup(l, { expose: n, emit: e }) {
690
+ const t = l, s = e, { inputClasses: u, disabledClasses: v, textSizeClasses: o } = A(t), p = function(y) {
691
+ s("update:modelValue", (y == null ? void 0 : y.target).value);
692
+ }, _ = z(null);
693
+ return n({
770
694
  focus: () => {
771
- l.isDisabled || L.value.focus();
695
+ t.isDisabled || _.value.focus();
772
696
  }
773
- }), (_, p) => (o(), u("div", na, [
774
- c("textarea", T({
775
- class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(i), d($), d(f)]],
776
- disabled: _.isDisabled,
777
- value: _.modelValue ?? ""
778
- }, _.$attrs, {
697
+ }), (y, M) => (a(), i("div", at, [
698
+ c("textarea", P({
699
+ class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(u), d(o), d(v)]],
700
+ disabled: y.isDisabled,
701
+ value: y.modelValue ?? ""
702
+ }, y.$attrs, {
779
703
  ref_key: "input",
780
- ref: L,
704
+ ref: _,
781
705
  cols: "56",
782
706
  rows: "8",
783
- onInput: V
707
+ onInput: p
784
708
  }), `
785
- `, 16, ra)
709
+ `, 16, nt)
786
710
  ]));
787
711
  }
788
712
  });
789
713
  export {
790
- ya as D9Button,
791
- ha as D9Checkbox,
792
- x as D9Icon,
793
- ka as D9Input,
794
- va as D9Label,
795
- _a as D9Menu,
796
- xa as D9MenuLink,
797
- Ca as D9Select,
798
- wa as D9Skeleton,
799
- $a as D9Spinner,
800
- La as D9Switch,
801
- Da as D9Textarea,
802
- N as brands,
803
- Le as icons
714
+ kt as D9Button,
715
+ vt as D9Checkbox,
716
+ w as D9Icon,
717
+ _t as D9Input,
718
+ xt as D9Label,
719
+ $t as D9Menu,
720
+ wt as D9MenuLink,
721
+ Ct as D9Select,
722
+ Vt as D9Skeleton,
723
+ Dt as D9Spinner,
724
+ zt as D9Switch,
725
+ Bt as D9Textarea,
726
+ ht as brands,
727
+ yt as icons
804
728
  };