@theh0n/ui 1.1.3 → 1.1.4

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as C, ref as O, computed as y, openBlock as a, createElementBlock as r, normalizeClass as w, Fragment as Z, renderList as ae, createElementVNode as m, renderSlot as k, toDisplayString as $, createCommentVNode as g, createVNode as z, Transition as D, withCtx as T, withDirectives as fe, vShow as he, watch as H, shallowRef as ie, createBlock as R, Teleport as J, unref as _, normalizeStyle as S, resolveDynamicComponent as K, normalizeProps as ve, mergeProps as X, createTextVNode as U, onMounted as G, onUnmounted as me, withModifiers as F, onBeforeUnmount as ye, nextTick as pe } from "vue";
1
+ import { defineComponent as I, ref as O, computed as y, openBlock as l, createElementBlock as u, normalizeClass as k, Fragment as Z, renderList as ae, createElementVNode as m, renderSlot as C, toDisplayString as x, createCommentVNode as b, createVNode as A, Transition as q, withCtx as H, withDirectives as he, vShow as ve, watch as E, shallowRef as ie, createBlock as V, Teleport as J, unref as _, normalizeStyle as R, resolveDynamicComponent as K, normalizeProps as me, mergeProps as X, createTextVNode as j, onMounted as G, onUnmounted as ye, withModifiers as F, onBeforeUnmount as pe, nextTick as ge } from "vue";
2
2
  import './index.css';const te = {
3
3
  colors: {
4
4
  primary: "#171f2a",
@@ -24,15 +24,15 @@ function _e(e) {
24
24
  const n = ne(te);
25
25
  return le(n, e);
26
26
  }
27
- function ge(e) {
27
+ function be(e) {
28
28
  if (typeof window > "u" || typeof document > "u")
29
29
  return;
30
- const n = document.documentElement, t = be(e);
31
- Object.entries(t).forEach(([i, o]) => {
32
- n.style.setProperty(i, o);
30
+ const n = document.documentElement, t = ke(e);
31
+ Object.entries(t).forEach(([r, o]) => {
32
+ n.style.setProperty(r, o);
33
33
  });
34
34
  }
35
- function be(e) {
35
+ function ke(e) {
36
36
  return {
37
37
  "--h0n-primary": e.colors.primary,
38
38
  "--h0n-secondary": e.colors.secondary,
@@ -51,14 +51,14 @@ function be(e) {
51
51
  }
52
52
  function le(e, n) {
53
53
  const t = Array.isArray(e) ? [...e] : { ...e };
54
- return n && Object.entries(n).forEach(([i, o]) => {
54
+ return n && Object.entries(n).forEach(([r, o]) => {
55
55
  if (o === void 0)
56
56
  return;
57
- const v = e[i];
58
- oe(v) && oe(o) ? t[i] = le(
57
+ const v = e[r];
58
+ oe(v) && oe(o) ? t[r] = le(
59
59
  v,
60
60
  o
61
- ) : t[i] = o;
61
+ ) : t[r] = o;
62
62
  }), t;
63
63
  }
64
64
  function ne(e) {
@@ -67,10 +67,10 @@ function ne(e) {
67
67
  function oe(e) {
68
68
  return Object.prototype.toString.call(e) === "[object Object]";
69
69
  }
70
- const ke = ["disabled", "aria-expanded", "aria-controls", "onClick"], $e = { class: "h0n-ui-accordion__title" }, we = { class: "h0n-ui-accordion__title-text" }, Ce = {
70
+ const $e = ["disabled", "aria-expanded", "aria-controls", "onClick"], we = { class: "h0n-ui-accordion__title" }, Ce = { class: "h0n-ui-accordion__title-text" }, xe = {
71
71
  key: 0,
72
72
  class: "h0n-ui-accordion__badge"
73
- }, xe = ["id", "aria-label"], Oe = { class: "h0n-ui-accordion__body-inner" }, Ie = { key: 0 }, Se = /* @__PURE__ */ C({
73
+ }, Oe = ["id", "aria-label"], Ie = { class: "h0n-ui-accordion__body-inner" }, Se = { key: 0 }, Be = /* @__PURE__ */ I({
74
74
  __name: "Accordion",
75
75
  props: {
76
76
  items: { default: () => [] },
@@ -81,85 +81,85 @@ const ke = ["disabled", "aria-expanded", "aria-controls", "onClick"], $e = { cla
81
81
  },
82
82
  emits: ["update:modelValue", "toggle"],
83
83
  setup(e, { emit: n }) {
84
- const t = e, i = n;
85
- function o(s) {
86
- return s == null ? [] : Array.isArray(s) ? t.multiple ? s : s.slice(0, 1) : [s];
84
+ const t = e, r = n;
85
+ function o(a) {
86
+ return a == null ? [] : Array.isArray(a) ? t.multiple ? a : a.slice(0, 1) : [a];
87
87
  }
88
- const v = O(o(t.defaultOpen)), d = y(
88
+ const v = O(o(t.defaultOpen)), f = y(
89
89
  () => t.modelValue !== void 0 ? o(t.modelValue) : v.value
90
- ), f = y(() => new Set(d.value));
91
- function u(s) {
92
- return f.value.has(s);
90
+ ), h = y(() => new Set(f.value));
91
+ function d(a) {
92
+ return h.value.has(a);
93
93
  }
94
- function l(s) {
95
- t.modelValue === void 0 && (v.value = s), i("update:modelValue", t.multiple ? s : s[0] ?? null);
94
+ function c(a) {
95
+ t.modelValue === void 0 && (v.value = a), r("update:modelValue", t.multiple ? a : a[0] ?? null);
96
96
  }
97
- function p(s) {
98
- const h = [...d.value];
97
+ function p(a) {
98
+ const i = [...f.value];
99
99
  if (t.multiple) {
100
- const b = new Set(h);
101
- b.has(s) ? b.delete(s) : b.add(s);
102
- const j = Array.from(b);
103
- l(j), i("toggle", { id: s, open: b.has(s) });
100
+ const w = new Set(i);
101
+ w.has(a) ? w.delete(a) : w.add(a);
102
+ const B = Array.from(w);
103
+ c(B), r("toggle", { id: a, open: w.has(a) });
104
104
  return;
105
105
  }
106
- const c = h[0] === s;
107
- l(c ? [] : [s]), i("toggle", { id: s, open: !c });
106
+ const s = i[0] === a;
107
+ c(s ? [] : [a]), r("toggle", { id: a, open: !s });
108
108
  }
109
- function x(s) {
110
- return `h0n-ui-accordion-body-${String(s)}`;
109
+ function S(a) {
110
+ return `h0n-ui-accordion-body-${String(a)}`;
111
111
  }
112
- function L(s) {
113
- return s.querySelector(".h0n-ui-accordion__body-inner");
112
+ function T(a) {
113
+ return a.querySelector(".h0n-ui-accordion__body-inner");
114
114
  }
115
- function V(s) {
116
- const h = s, c = L(h);
117
- c && (h.style.height = "0px", h.style.opacity = "0", requestAnimationFrame(() => {
118
- h.style.height = `${c.scrollHeight}px`, h.style.opacity = "1";
115
+ function L(a) {
116
+ const i = a, s = T(i);
117
+ s && (i.style.height = "0px", i.style.opacity = "0", requestAnimationFrame(() => {
118
+ i.style.height = `${s.scrollHeight}px`, i.style.opacity = "1";
119
119
  }));
120
120
  }
121
- function P(s) {
122
- const h = s;
123
- h.style.height = "auto", h.style.opacity = "";
121
+ function P(a) {
122
+ const i = a;
123
+ i.style.height = "auto", i.style.opacity = "";
124
124
  }
125
- function q(s) {
126
- const h = s, c = L(h);
127
- c && (h.style.height = `${c.scrollHeight}px`, h.style.opacity = "1", h.offsetHeight, requestAnimationFrame(() => {
128
- h.style.height = "0px", h.style.opacity = "0";
125
+ function D(a) {
126
+ const i = a, s = T(i);
127
+ s && (i.style.height = `${s.scrollHeight}px`, i.style.opacity = "1", i.offsetHeight, requestAnimationFrame(() => {
128
+ i.style.height = "0px", i.style.opacity = "0";
129
129
  }));
130
130
  }
131
- function N(s) {
132
- const h = s;
133
- h.style.height = "", h.style.opacity = "";
131
+ function g(a) {
132
+ const i = a;
133
+ i.style.height = "", i.style.opacity = "";
134
134
  }
135
- return (s, h) => (a(), r("div", {
136
- class: w(["h0n-ui-accordion", { "is-compact": e.compact }])
135
+ return (a, i) => (l(), u("div", {
136
+ class: k(["h0n-ui-accordion", { "is-compact": e.compact }])
137
137
  }, [
138
- (a(!0), r(Z, null, ae(e.items, (c) => (a(), r("div", {
139
- key: c.id,
140
- class: w(["h0n-ui-accordion__item", {
141
- "is-open": u(c.id),
142
- "is-disabled": !!c.disabled
138
+ (l(!0), u(Z, null, ae(e.items, (s) => (l(), u("div", {
139
+ key: s.id,
140
+ class: k(["h0n-ui-accordion__item", {
141
+ "is-open": d(s.id),
142
+ "is-disabled": !!s.disabled
143
143
  }])
144
144
  }, [
145
145
  m("button", {
146
146
  class: "h0n-ui-accordion__header",
147
147
  type: "button",
148
- disabled: c.disabled,
149
- "aria-expanded": u(c.id) ? "true" : "false",
150
- "aria-controls": x(c.id),
151
- onClick: (I) => p(c.id)
148
+ disabled: s.disabled,
149
+ "aria-expanded": d(s.id) ? "true" : "false",
150
+ "aria-controls": S(s.id),
151
+ onClick: ($) => p(s.id)
152
152
  }, [
153
- m("span", $e, [
154
- k(s.$slots, "header", {
155
- item: c,
156
- open: u(c.id)
153
+ m("span", we, [
154
+ C(a.$slots, "header", {
155
+ item: s,
156
+ open: d(s.id)
157
157
  }, () => [
158
- m("span", we, $(c.title), 1),
159
- c.badge ? (a(), r("span", Ce, $(c.badge), 1)) : g("", !0)
158
+ m("span", Ce, x(s.title), 1),
159
+ s.badge ? (l(), u("span", xe, x(s.badge), 1)) : b("", !0)
160
160
  ])
161
161
  ]),
162
- h[0] || (h[0] = m("svg", {
162
+ i[0] || (i[0] = m("svg", {
163
163
  class: "h0n-ui-accordion__chevron",
164
164
  viewBox: "0 0 20 20",
165
165
  "aria-hidden": "true"
@@ -173,31 +173,31 @@ const ke = ["disabled", "aria-expanded", "aria-controls", "onClick"], $e = { cla
173
173
  "stroke-linejoin": "round"
174
174
  })
175
175
  ], -1))
176
- ], 8, ke),
177
- z(D, {
176
+ ], 8, $e),
177
+ A(q, {
178
178
  name: "h0n-ui-accordion",
179
- onEnter: V,
179
+ onEnter: L,
180
180
  onAfterEnter: P,
181
- onLeave: q,
182
- onAfterLeave: N
181
+ onLeave: D,
182
+ onAfterLeave: g
183
183
  }, {
184
- default: T(() => [
185
- fe(m("div", {
184
+ default: H(() => [
185
+ he(m("div", {
186
186
  class: "h0n-ui-accordion__body",
187
- id: x(c.id),
187
+ id: S(s.id),
188
188
  role: "region",
189
- "aria-label": c.title
189
+ "aria-label": s.title
190
190
  }, [
191
- m("div", Oe, [
192
- k(s.$slots, "body", {
193
- item: c,
194
- open: u(c.id)
191
+ m("div", Ie, [
192
+ C(a.$slots, "body", {
193
+ item: s,
194
+ open: d(s.id)
195
195
  }, () => [
196
- c.body ? (a(), r("p", Ie, $(c.body), 1)) : g("", !0)
196
+ s.body ? (l(), u("p", Se, x(s.body), 1)) : b("", !0)
197
197
  ])
198
198
  ])
199
- ], 8, xe), [
200
- [he, u(c.id)]
199
+ ], 8, Oe), [
200
+ [ve, d(s.id)]
201
201
  ])
202
202
  ]),
203
203
  _: 2
@@ -209,60 +209,60 @@ const ke = ["disabled", "aria-expanded", "aria-controls", "onClick"], $e = { cla
209
209
  function Q() {
210
210
  return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).slice(2, 10);
211
211
  }
212
- const se = 1e4, B = O([]);
213
- function M() {
214
- const e = y(() => B.value.at(-1) ?? null);
215
- function n(f) {
216
- return B.value.findIndex((u) => u.id === f);
212
+ const se = 1e4, z = O([]);
213
+ function N() {
214
+ const e = y(() => z.value.at(-1) ?? null);
215
+ function n(h) {
216
+ return z.value.findIndex((d) => d.id === h);
217
217
  }
218
- function t(f) {
219
- const u = n(f);
220
- return u === -1 ? se : se + u * 2;
218
+ function t(h) {
219
+ const d = n(h);
220
+ return d === -1 ? se : se + d * 2;
221
221
  }
222
- function i(f) {
223
- return t(f) + 1;
222
+ function r(h) {
223
+ return t(h) + 1;
224
224
  }
225
- function o(f) {
226
- const u = f.id ?? Q();
227
- return v(u), B.value.push({
225
+ function o(h) {
226
+ const d = h.id ?? Q();
227
+ return v(d), z.value.push({
228
228
  showOverlay: !0,
229
229
  closeOnOverlay: !0,
230
230
  closeOnEsc: !0,
231
- ...f,
232
- id: u
233
- }), u;
231
+ ...h,
232
+ id: d
233
+ }), d;
234
234
  }
235
- function v(f) {
236
- const u = n(f);
237
- u !== -1 && B.value.splice(u, 1);
235
+ function v(h) {
236
+ const d = n(h);
237
+ d !== -1 && z.value.splice(d, 1);
238
238
  }
239
- function d() {
239
+ function f() {
240
240
  e.value?.onRequestClose?.();
241
241
  }
242
- return H(
243
- () => B.value.length,
244
- (f) => {
245
- document.documentElement.classList.toggle("no-scroll", f > 0);
242
+ return E(
243
+ () => z.value.length,
244
+ (h) => {
245
+ document.documentElement.classList.toggle("no-scroll", h > 0);
246
246
  },
247
247
  { immediate: !0 }
248
248
  ), {
249
- stack: B,
249
+ stack: z,
250
250
  top: e,
251
251
  push: o,
252
252
  remove: v,
253
- requestCloseTop: d,
253
+ requestCloseTop: f,
254
254
  getBackdropZIndex: t,
255
- getContentZIndex: i
255
+ getContentZIndex: r
256
256
  };
257
257
  }
258
- const A = ie(null);
258
+ const M = ie(null);
259
259
  let W = null;
260
- function Be() {
261
- const e = M();
262
- function n(i) {
260
+ function Re() {
261
+ const e = N();
262
+ function n(r) {
263
263
  return new Promise((o) => {
264
264
  const v = Q();
265
- W = o, A.value = { ...i, id: v }, e.push({
265
+ W = o, M.value = { ...r, id: v }, e.push({
266
266
  id: v,
267
267
  showOverlay: !0,
268
268
  closeOnOverlay: !0,
@@ -271,66 +271,66 @@ function Be() {
271
271
  });
272
272
  });
273
273
  }
274
- function t(i) {
275
- if (!A.value) return;
276
- const o = A.value.id;
277
- A.value = null, e.remove(o), W?.(i), W = null;
274
+ function t(r) {
275
+ if (!M.value) return;
276
+ const o = M.value.id;
277
+ M.value = null, e.remove(o), W?.(r), W = null;
278
278
  }
279
279
  return {
280
- active: A,
280
+ active: M,
281
281
  open: n,
282
282
  close: t
283
283
  };
284
284
  }
285
- const Re = {
285
+ const Te = {
286
286
  class: "h0n-alert",
287
287
  role: "dialog",
288
288
  "aria-modal": "true"
289
- }, ze = {
289
+ }, Le = {
290
290
  key: 0,
291
291
  class: "h0n-alert__header"
292
- }, Te = { class: "h0n-alert__title" }, Le = { class: "h0n-alert__body" }, Ve = { key: 1 }, Ae = /* @__PURE__ */ C({
292
+ }, ze = { class: "h0n-alert__title" }, Ee = { class: "h0n-alert__body" }, Ve = { key: 1 }, Ae = /* @__PURE__ */ I({
293
293
  __name: "Alert",
294
294
  setup(e) {
295
- const { active: n, close: t } = Be(), { getContentZIndex: i } = M(), o = () => t(!0), v = () => t(!1), d = () => t(!0), f = y(() => n.value?.type === "info"), u = y(
296
- () => n.value ? i(n.value.id) : void 0
295
+ const { active: n, close: t } = Re(), { getContentZIndex: r } = N(), o = () => t(!0), v = () => t(!1), f = () => t(!0), h = y(() => n.value?.type === "info"), d = y(
296
+ () => n.value ? r(n.value.id) : void 0
297
297
  );
298
- return (l, p) => (a(), R(J, { to: "body" }, [
299
- z(D, {
298
+ return (c, p) => (l(), V(J, { to: "body" }, [
299
+ A(q, {
300
300
  name: "h0n-alert-scale",
301
301
  appear: ""
302
302
  }, {
303
- default: T(() => [
304
- _(n) ? (a(), r("div", {
303
+ default: H(() => [
304
+ _(n) ? (l(), u("div", {
305
305
  key: 0,
306
306
  class: "h0n-alert-layer",
307
- style: S({ zIndex: u.value })
307
+ style: R({ zIndex: d.value })
308
308
  }, [
309
- m("section", Re, [
310
- _(n).title || l.$slots.header ? (a(), r("header", ze, [
311
- k(l.$slots, "header", {}, () => [
312
- m("h4", Te, $(_(n).title), 1)
309
+ m("section", Te, [
310
+ _(n).title || c.$slots.header ? (l(), u("header", Le, [
311
+ C(c.$slots, "header", {}, () => [
312
+ m("h4", ze, x(_(n).title), 1)
313
313
  ], !0)
314
- ])) : g("", !0),
315
- m("div", Le, [
316
- _(n).component ? (a(), R(K(_(n).component), ve(X({ key: 0 }, _(n).props)), null, 16)) : _(n).message ? (a(), r("p", Ve, $(_(n).message), 1)) : g("", !0)
314
+ ])) : b("", !0),
315
+ m("div", Ee, [
316
+ _(n).component ? (l(), V(K(_(n).component), me(X({ key: 0 }, _(n).props)), null, 16)) : _(n).message ? (l(), u("p", Ve, x(_(n).message), 1)) : b("", !0)
317
317
  ]),
318
318
  m("footer", {
319
- class: w(["h0n-alert__actions", { "is-single": f.value }])
319
+ class: k(["h0n-alert__actions", { "is-single": h.value }])
320
320
  }, [
321
- f.value ? (a(), r("button", {
321
+ h.value ? (l(), u("button", {
322
322
  key: 0,
323
323
  class: "h0n-alert__btn h0n-alert__btn--primary",
324
324
  type: "button",
325
- onClick: d
326
- }, " Ok ")) : (a(), r(Z, { key: 1 }, [
325
+ onClick: f
326
+ }, " Ok ")) : (l(), u(Z, { key: 1 }, [
327
327
  m("button", {
328
328
  class: "h0n-alert__btn is-danger",
329
329
  type: "button",
330
330
  onClick: v
331
331
  }, " Cancel "),
332
332
  m("button", {
333
- class: w(["h0n-alert__btn h0n-alert__btn--primary", {
333
+ class: k(["h0n-alert__btn h0n-alert__btn--primary", {
334
334
  "is-danger": _(n).type === "danger"
335
335
  }]),
336
336
  type: "button",
@@ -339,18 +339,18 @@ const Re = {
339
339
  ], 64))
340
340
  ], 2)
341
341
  ])
342
- ], 4)) : g("", !0)
342
+ ], 4)) : b("", !0)
343
343
  ]),
344
344
  _: 3
345
345
  })
346
346
  ]));
347
347
  }
348
- }), Ee = (e, n) => {
348
+ }), He = (e, n) => {
349
349
  const t = e.__vccOpts || e;
350
- for (const [i, o] of n)
351
- t[i] = o;
350
+ for (const [r, o] of n)
351
+ t[r] = o;
352
352
  return t;
353
- }, He = /* @__PURE__ */ Ee(Ae, [["__scopeId", "data-v-290cad87"]]), re = /* @__PURE__ */ C({
353
+ }, Pe = /* @__PURE__ */ He(Ae, [["__scopeId", "data-v-290cad87"]]), re = /* @__PURE__ */ I({
354
354
  __name: "Spinner",
355
355
  props: {
356
356
  size: {},
@@ -358,8 +358,8 @@ const Re = {
358
358
  },
359
359
  setup(e) {
360
360
  const t = e.size ?? "md";
361
- return (i, o) => (a(), r("div", {
362
- class: w(["h0n-ui-spinner", [`h0n-ui-spinner--${_(t)}`, e.color]]),
361
+ return (r, o) => (l(), u("div", {
362
+ class: k(["h0n-ui-spinner", [`h0n-ui-spinner--${_(t)}`, e.color]]),
363
363
  role: "status",
364
364
  "aria-label": "Loading"
365
365
  }, null, 2));
@@ -370,14 +370,14 @@ const Re = {
370
370
  }, Ue = {
371
371
  key: 1,
372
372
  class: "h0n-ui-btn__label"
373
- }, Pe = {
373
+ }, qe = {
374
374
  key: 2,
375
375
  class: "h0n-ui-btn__spinner",
376
376
  "aria-hidden": "true"
377
- }, qe = {
377
+ }, Ne = {
378
378
  key: 3,
379
379
  class: "h0n-ui-btn__icon h0n-ui-btn__icon--right"
380
- }, Ne = /* @__PURE__ */ C({
380
+ }, je = /* @__PURE__ */ I({
381
381
  __name: "Button",
382
382
  props: {
383
383
  text: {},
@@ -394,74 +394,74 @@ const Re = {
394
394
  },
395
395
  emits: ["click", "done", "error"],
396
396
  setup(e, { emit: n }) {
397
- const t = e, i = n, o = O(!1), v = y(() => t.loading !== void 0), d = y(
397
+ const t = e, r = n, o = O(!1), v = y(() => t.loading !== void 0), f = y(
398
398
  () => v.value ? !!t.loading : o.value
399
399
  );
400
- function f(l) {
401
- v.value || (o.value = l);
400
+ function h(c) {
401
+ v.value || (o.value = c);
402
402
  }
403
- async function u(l) {
404
- if (!(t.disabled || d.value) && (i("click", l), !!t.action))
403
+ async function d(c) {
404
+ if (!(t.disabled || f.value) && (r("click", c), !!t.action))
405
405
  try {
406
- f(!0), await t.action(), i("done");
406
+ h(!0), await t.action(), r("done");
407
407
  } catch (p) {
408
- i("error", p);
408
+ r("error", p);
409
409
  } finally {
410
- f(!1);
410
+ h(!1);
411
411
  }
412
412
  }
413
- return (l, p) => (a(), r("button", {
414
- class: w(["h0n-ui-btn", [
413
+ return (c, p) => (l(), u("button", {
414
+ class: k(["h0n-ui-btn", [
415
415
  `h0n-ui-btn--${e.variant}`,
416
416
  `h0n-ui-btn--${e.size}`,
417
417
  `h0n-ui-btn--text-${e.position}`,
418
418
  {
419
- "h0n-ui-btn--loading": d.value,
419
+ "h0n-ui-btn--loading": f.value,
420
420
  "h0n-ui-btn--pill": e.pill,
421
421
  "h0n-ui-btn--radius": e.border,
422
422
  "h0n-ui-btn--block": e.block
423
423
  }
424
424
  ]]),
425
425
  type: e.type,
426
- disabled: e.disabled || d.value,
427
- "aria-busy": d.value ? "true" : void 0,
428
- onClick: u
426
+ disabled: e.disabled || f.value,
427
+ "aria-busy": f.value ? "true" : void 0,
428
+ onClick: d
429
429
  }, [
430
- l.$slots.left && !d.value ? (a(), r("span", Me, [
431
- k(l.$slots, "left")
432
- ])) : g("", !0),
433
- d.value ? (a(), r("span", Pe, [
434
- z(re, { size: "sm" })
435
- ])) : (a(), r("span", Ue, [
436
- k(l.$slots, "default", {}, () => [
437
- U($(e.text), 1)
430
+ c.$slots.left && !f.value ? (l(), u("span", Me, [
431
+ C(c.$slots, "left")
432
+ ])) : b("", !0),
433
+ f.value ? (l(), u("span", qe, [
434
+ A(re, { size: "sm" })
435
+ ])) : (l(), u("span", Ue, [
436
+ C(c.$slots, "default", {}, () => [
437
+ j(x(e.text), 1)
438
438
  ])
439
439
  ])),
440
- l.$slots.right && !d.value ? (a(), r("span", qe, [
441
- k(l.$slots, "right")
442
- ])) : g("", !0)
440
+ c.$slots.right && !f.value ? (l(), u("span", Ne, [
441
+ C(c.$slots, "right")
442
+ ])) : b("", !0)
443
443
  ], 10, De));
444
444
  }
445
- }), je = { class: "h0n-ui-card" }, Fe = {
445
+ }), Fe = { class: "h0n-ui-card" }, We = {
446
446
  key: 0,
447
447
  class: "h0n-ui-card--title"
448
- }, We = /* @__PURE__ */ C({
448
+ }, Ze = /* @__PURE__ */ I({
449
449
  __name: "Card",
450
450
  props: {
451
451
  title: {}
452
452
  },
453
453
  setup(e) {
454
- return (n, t) => (a(), r("section", je, [
455
- e.title ? (a(), r("p", Fe, $(e.title), 1)) : g("", !0),
456
- k(n.$slots, "default")
454
+ return (n, t) => (l(), u("section", Fe, [
455
+ e.title ? (l(), u("p", We, x(e.title), 1)) : b("", !0),
456
+ C(n.$slots, "default")
457
457
  ]));
458
458
  }
459
- }), E = ie(null);
460
- function Ze() {
461
- const e = M();
462
- function n(i) {
459
+ }), U = ie(null);
460
+ function Je() {
461
+ const e = N();
462
+ function n(r) {
463
463
  const o = Q();
464
- E.value = { ...i, id: o }, e.push({
464
+ U.value = { ...r, id: o }, e.push({
465
465
  id: o,
466
466
  showOverlay: !0,
467
467
  closeOnOverlay: !0,
@@ -470,98 +470,140 @@ function Ze() {
470
470
  });
471
471
  }
472
472
  function t() {
473
- E.value && (e.remove(E.value.id), E.value = null);
473
+ U.value && (e.remove(U.value.id), U.value = null);
474
474
  }
475
475
  return {
476
- active: E,
476
+ active: U,
477
477
  open: n,
478
478
  close: t
479
479
  };
480
480
  }
481
- const Je = { class: "content-title-dialog" }, Ke = {
481
+ const Ke = { class: "content-title-dialog" }, Xe = {
482
482
  key: 0,
483
483
  class: "title-dialog"
484
- }, Xe = {
484
+ }, Ge = {
485
485
  key: 0,
486
486
  class: "h0n-dialog-bg-hero"
487
- }, Ge = { class: "h0n-dialog-content" }, Qe = /* @__PURE__ */ C({
487
+ }, Qe = { class: "h0n-dialog-content" }, Ye = /* @__PURE__ */ I({
488
488
  __name: "Dialog",
489
489
  setup(e) {
490
- const { active: n, close: t } = Ze(), { getContentZIndex: i } = M(), o = O("bottom");
491
- H(
490
+ const { active: n, close: t } = Je(), { getContentZIndex: r } = N(), o = O("bottom");
491
+ E(
492
492
  () => n.value?.side,
493
- (p) => {
494
- p && (o.value = p);
493
+ (g) => {
494
+ g && (o.value = g);
495
495
  },
496
496
  { immediate: !0 }
497
497
  );
498
- const v = y(() => `h0n-slide-${o.value}`), d = y(
499
- () => n.value ? i(n.value.id) : void 0
500
- ), f = y(() => n.value?.backgroundUrl?.trim() ?? ""), u = y(() => f.value.length > 0), l = y(() => u.value ? {
501
- "--h0n-dialog-bg-image": `url("${f.value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`
498
+ const v = y(() => `h0n-slide-${o.value}`), f = y(
499
+ () => n.value ? r(n.value.id) : void 0
500
+ ), h = y(() => n.value?.backgroundUrl?.trim() ?? ""), d = O(""), c = /* @__PURE__ */ new Set();
501
+ let p = 0;
502
+ const S = y(() => h.value.length > 0), T = y(
503
+ () => d.value.length > 0
504
+ ), L = (g) => new Promise((a) => {
505
+ setTimeout(a, g);
506
+ }), P = (g) => new Promise((a, i) => {
507
+ const s = new Image();
508
+ s.decoding = "async", s.fetchPriority = "low", s.onload = async () => {
509
+ try {
510
+ typeof s.decode == "function" && await s.decode();
511
+ } catch {
512
+ }
513
+ a();
514
+ }, s.onerror = () => {
515
+ i(new Error("Failed to load dialog background image"));
516
+ }, s.src = g;
517
+ }), D = y(() => T.value ? {
518
+ "--h0n-dialog-bg-image": `url("${d.value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`
502
519
  } : void 0);
503
- return (p, x) => (a(), R(J, { to: "body" }, [
504
- z(D, {
520
+ return E(
521
+ h,
522
+ async (g, a, i) => {
523
+ const s = ++p;
524
+ let $ = !1;
525
+ if (i(() => {
526
+ $ = !0;
527
+ }), d.value = "", !!g) {
528
+ if (c.has(g)) {
529
+ d.value = g;
530
+ return;
531
+ }
532
+ if (await L(140), !($ || s !== p))
533
+ try {
534
+ if (await P(g), $ || s !== p) return;
535
+ c.add(g), d.value = g;
536
+ } catch {
537
+ if ($ || s !== p) return;
538
+ d.value = "";
539
+ }
540
+ }
541
+ },
542
+ { immediate: !0 }
543
+ ), (g, a) => (l(), V(J, { to: "body" }, [
544
+ A(q, {
505
545
  name: v.value,
506
546
  appear: ""
507
547
  }, {
508
- default: T(() => [
509
- _(n) ? (a(), r("div", {
548
+ default: H(() => [
549
+ _(n) ? (l(), u("div", {
510
550
  key: 0,
511
- class: w(["h0n-dialog-layer", `is-${o.value}`]),
512
- style: S({ zIndex: d.value })
551
+ class: k(["h0n-dialog-layer", `is-${o.value}`]),
552
+ style: R({ zIndex: f.value })
513
553
  }, [
514
554
  m("section", {
515
- class: w(["h0n-dialog-panel", [
555
+ class: k(["h0n-dialog-panel", [
516
556
  `is-${_(n).side}`,
517
- { "has-background-image": u.value }
557
+ { "has-background-image": S.value }
518
558
  ]]),
519
- style: S(l.value)
559
+ style: R(D.value)
520
560
  }, [
521
561
  m("header", {
522
- class: w(["h0n-dialog-header", [
562
+ class: k(["h0n-dialog-header", [
523
563
  `is-${_(n).side}`,
524
- { "has-background-image": u.value }
564
+ { "has-background-image": S.value }
525
565
  ]])
526
566
  }, [
527
- m("div", Je, [
528
- _(n).title ? (a(), r("p", Ke, $(_(n).title), 1)) : g("", !0),
529
- k(p.$slots, "dialogHeader")
567
+ m("div", Ke, [
568
+ _(n).title ? (l(), u("p", Xe, x(_(n).title), 1)) : b("", !0),
569
+ C(g.$slots, "dialogHeader")
530
570
  ]),
531
571
  m("button", {
532
572
  class: "h0n-dialog-close",
533
- onClick: x[0] || (x[0] = (L) => _(t)())
573
+ onClick: a[0] || (a[0] = (i) => _(t)())
534
574
  }, " x ")
535
575
  ], 2),
536
- u.value ? (a(), r("div", Xe, [...x[1] || (x[1] = [
537
- m("div", { class: "h0n-dialog-bg-image" }, null, -1)
538
- ])])) : g("", !0),
539
- m("div", Ge, [
540
- (a(), R(K(_(n).component), X(_(n).props, { onClose: _(t) }), null, 16, ["onClose"]))
576
+ S.value ? (l(), u("div", Ge, [
577
+ m("div", {
578
+ class: k(["h0n-dialog-bg-image", { "is-loaded": T.value }])
579
+ }, null, 2)
580
+ ])) : b("", !0),
581
+ m("div", Qe, [
582
+ (l(), V(K(_(n).component), X(_(n).props, { onClose: _(t) }), null, 16, ["onClose"]))
541
583
  ])
542
584
  ], 6)
543
- ], 6)) : g("", !0)
585
+ ], 6)) : b("", !0)
544
586
  ]),
545
587
  _: 3
546
588
  }, 8, ["name"])
547
589
  ]));
548
590
  }
549
- }), Ye = { class: "h0n-ui-menu-item__left" }, et = {
591
+ }), et = { class: "h0n-ui-menu-item__left" }, tt = {
550
592
  key: 0,
551
593
  class: "h0n-ui-menu-item__icon"
552
- }, tt = { class: "h0n-ui-menu-item__text" }, nt = {
594
+ }, nt = { class: "h0n-ui-menu-item__text" }, ot = {
553
595
  key: 0,
554
596
  class: "h0n-ui-menu-item__desc"
555
- }, ot = {
597
+ }, st = {
556
598
  key: 0,
557
599
  class: "h0n-ui-menu-item__right"
558
- }, st = {
600
+ }, at = {
559
601
  key: 0,
560
602
  class: "h0n-ui-menu-item__right-text"
561
- }, at = {
603
+ }, it = {
562
604
  key: 0,
563
605
  class: "h0n-ui-menu-item__chevron"
564
- }, it = /* @__PURE__ */ C({
606
+ }, lt = /* @__PURE__ */ I({
565
607
  __name: "Menu",
566
608
  props: {
567
609
  title: {},
@@ -576,60 +618,60 @@ const Je = { class: "content-title-dialog" }, Ke = {
576
618
  },
577
619
  emits: ["click"],
578
620
  setup(e, { emit: n }) {
579
- const t = e, i = n, o = y(() => !!t.to), v = y(() => t.as ?? (o.value ? "a" : "div")), d = y(() => t.chevron !== void 0 ? t.chevron : o.value), f = y(() => t.disabled ? {
621
+ const t = e, r = n, o = y(() => !!t.to), v = y(() => t.as ?? (o.value ? "a" : "div")), f = y(() => t.chevron !== void 0 ? t.chevron : o.value), h = y(() => t.disabled ? {
580
622
  role: "button",
581
623
  tabindex: -1
582
624
  } : t.as ? t.to ? { to: t.to } : {} : o.value ? { href: "#" } : { role: "button", tabindex: 0 });
583
- function u(l) {
625
+ function d(c) {
584
626
  if (t.disabled) {
585
- l.preventDefault(), l.stopPropagation();
627
+ c.preventDefault(), c.stopPropagation();
586
628
  return;
587
629
  }
588
- !t.as && o.value && l.preventDefault(), i("click", l);
630
+ !t.as && o.value && c.preventDefault(), r("click", c);
589
631
  }
590
- return (l, p) => (a(), R(K(v.value), X({ class: "h0n-ui-menu-item" }, f.value, {
632
+ return (c, p) => (l(), V(K(v.value), X({ class: "h0n-ui-menu-item" }, h.value, {
591
633
  "aria-disabled": e.disabled || void 0,
592
- onClick: u
634
+ onClick: d
593
635
  }), {
594
- default: T(() => [
595
- m("div", Ye, [
596
- l.$slots.icon || e.icon ? (a(), r("div", et, [
597
- k(l.$slots, "icon", {}, () => [
598
- U($(e.icon), 1)
636
+ default: H(() => [
637
+ m("div", et, [
638
+ c.$slots.icon || e.icon ? (l(), u("div", tt, [
639
+ C(c.$slots, "icon", {}, () => [
640
+ j(x(e.icon), 1)
599
641
  ])
600
- ])) : g("", !0),
601
- m("div", tt, [
642
+ ])) : b("", !0),
643
+ m("div", nt, [
602
644
  m("p", {
603
- class: w(["h0n-ui-menu-item__title", { "is-danger": e.danger }])
645
+ class: k(["h0n-ui-menu-item__title", { "is-danger": e.danger }])
604
646
  }, [
605
- k(l.$slots, "title", {}, () => [
606
- U($(e.title), 1)
647
+ C(c.$slots, "title", {}, () => [
648
+ j(x(e.title), 1)
607
649
  ])
608
650
  ], 2),
609
- e.description || l.$slots.description ? (a(), r("p", nt, [
610
- k(l.$slots, "description", {}, () => [
611
- U($(e.description), 1)
651
+ e.description || c.$slots.description ? (l(), u("p", ot, [
652
+ C(c.$slots, "description", {}, () => [
653
+ j(x(e.description), 1)
612
654
  ])
613
- ])) : g("", !0)
655
+ ])) : b("", !0)
614
656
  ])
615
657
  ]),
616
- e.right || l.$slots.right || d.value ? (a(), r("div", ot, [
617
- k(l.$slots, "right", {}, () => [
618
- e.right ? (a(), r("p", st, $(e.right), 1)) : g("", !0)
658
+ e.right || c.$slots.right || f.value ? (l(), u("div", st, [
659
+ C(c.$slots, "right", {}, () => [
660
+ e.right ? (l(), u("p", at, x(e.right), 1)) : b("", !0)
619
661
  ]),
620
- d.value ? (a(), r("span", at, "›")) : g("", !0)
621
- ])) : g("", !0)
662
+ f.value ? (l(), u("span", it, "›")) : b("", !0)
663
+ ])) : b("", !0)
622
664
  ]),
623
665
  _: 3
624
666
  }, 16, ["aria-disabled"]));
625
667
  }
626
- }), lt = {
668
+ }), rt = {
627
669
  key: 0,
628
670
  class: "h0n-ui-image__loader"
629
- }, rt = {
671
+ }, ct = {
630
672
  key: 1,
631
673
  class: "h0n-ui-image__error"
632
- }, ct = ["src"], ut = ["src", "alt"], dt = /* @__PURE__ */ C({
674
+ }, ut = ["src"], dt = ["src", "alt"], ft = /* @__PURE__ */ I({
633
675
  __name: "Image",
634
676
  props: {
635
677
  src: {},
@@ -641,81 +683,81 @@ const Je = { class: "content-title-dialog" }, Ke = {
641
683
  },
642
684
  setup(e) {
643
685
  const n = e, t = O("loading");
644
- function i() {
686
+ function r() {
645
687
  t.value = "loading";
646
- const d = new Image();
647
- d.src = n.src, d.onload = () => {
688
+ const f = new Image();
689
+ f.src = n.src, f.onload = () => {
648
690
  t.value = "loaded";
649
- }, d.onerror = () => {
691
+ }, f.onerror = () => {
650
692
  t.value = "error";
651
693
  };
652
694
  }
653
695
  G(() => {
654
696
  if (n.lazy && "IntersectionObserver" in window) {
655
- const d = new IntersectionObserver(([f]) => {
656
- f.isIntersecting && (i(), d.disconnect());
697
+ const f = new IntersectionObserver(([h]) => {
698
+ h.isIntersecting && (r(), f.disconnect());
657
699
  });
658
- d.observe(document.body);
700
+ f.observe(document.body);
659
701
  } else
660
- i();
661
- }), H(() => n.src, i);
702
+ r();
703
+ }), E(() => n.src, r);
662
704
  const o = y(() => ({
663
705
  borderRadius: typeof n.radius == "number" ? `${n.radius}px` : n.radius
664
706
  })), v = y(() => ({
665
707
  objectFit: n.fit
666
708
  }));
667
- return (d, f) => (a(), r("div", {
668
- class: w(["h0n-ui-image", t.value]),
669
- style: S(o.value)
709
+ return (f, h) => (l(), u("div", {
710
+ class: k(["h0n-ui-image", t.value]),
711
+ style: R(o.value)
670
712
  }, [
671
- t.value === "loading" ? (a(), r("div", lt)) : t.value === "error" ? (a(), r("div", rt, [
672
- e.fallback ? (a(), r("img", {
713
+ t.value === "loading" ? (l(), u("div", rt)) : t.value === "error" ? (l(), u("div", ct, [
714
+ e.fallback ? (l(), u("img", {
673
715
  key: 0,
674
716
  src: e.fallback
675
- }, null, 8, ct)) : g("", !0)
676
- ])) : (a(), r("img", {
717
+ }, null, 8, ut)) : b("", !0)
718
+ ])) : (l(), u("img", {
677
719
  key: 2,
678
720
  src: e.src,
679
721
  alt: e.alt,
680
- style: S(v.value),
722
+ style: R(v.value),
681
723
  draggable: "false"
682
- }, null, 12, ut))
724
+ }, null, 12, dt))
683
725
  ], 6));
684
726
  }
685
- }), ft = /* @__PURE__ */ C({
727
+ }), ht = /* @__PURE__ */ I({
686
728
  __name: "Overlay",
687
729
  setup(e) {
688
- const { top: n, getBackdropZIndex: t, requestCloseTop: i } = M(), o = y(() => !!n.value && n.value.showOverlay !== !1), v = y(() => {
730
+ const { top: n, getBackdropZIndex: t, requestCloseTop: r } = N(), o = y(() => !!n.value && n.value.showOverlay !== !1), v = y(() => {
689
731
  if (n.value?.id)
690
732
  return t(n.value.id);
691
733
  });
692
- function d() {
734
+ function f() {
693
735
  }
694
- function f(l) {
736
+ function h(c) {
695
737
  const p = n.value;
696
- !p || p.closeOnOverlay === !1 || i();
738
+ !p || p.closeOnOverlay === !1 || r();
697
739
  }
698
- function u(l) {
740
+ function d(c) {
699
741
  const p = n.value;
700
- !p || p.closeOnEsc === !1 || l.key === "Escape" && i();
742
+ !p || p.closeOnEsc === !1 || c.key === "Escape" && r();
701
743
  }
702
- return G(() => window.addEventListener("keydown", u)), me(() => window.removeEventListener("keydown", u)), (l, p) => (a(), R(J, { to: "body" }, [
703
- z(D, { name: "h0n-ui-fade" }, {
704
- default: T(() => [
705
- o.value ? (a(), r("div", {
744
+ return G(() => window.addEventListener("keydown", d)), ye(() => window.removeEventListener("keydown", d)), (c, p) => (l(), V(J, { to: "body" }, [
745
+ A(q, { name: "h0n-ui-fade" }, {
746
+ default: H(() => [
747
+ o.value ? (l(), u("div", {
706
748
  key: 0,
707
749
  class: "h0n-ui-overlay",
708
- style: S({ zIndex: v.value }),
709
- onPointerdown: F(d, ["self", "prevent", "stop"]),
710
- onPointerup: F(d, ["self", "prevent", "stop"]),
711
- onClick: F(f, ["self", "prevent", "stop"])
712
- }, null, 36)) : g("", !0)
750
+ style: R({ zIndex: v.value }),
751
+ onPointerdown: F(f, ["self", "prevent", "stop"]),
752
+ onPointerup: F(f, ["self", "prevent", "stop"]),
753
+ onClick: F(h, ["self", "prevent", "stop"])
754
+ }, null, 36)) : b("", !0)
713
755
  ]),
714
756
  _: 1
715
757
  })
716
758
  ]));
717
759
  }
718
- }), ht = /* @__PURE__ */ C({
760
+ }), vt = /* @__PURE__ */ I({
719
761
  __name: "Skeleton",
720
762
  props: {
721
763
  width: { default: "100%" },
@@ -725,7 +767,7 @@ const Je = { class: "content-title-dialog" }, Ke = {
725
767
  animated: { type: Boolean, default: !0 }
726
768
  },
727
769
  setup(e) {
728
- const n = e, t = (o) => typeof o == "number" ? `${o}px` : o, i = y(() => {
770
+ const n = e, t = (o) => typeof o == "number" ? `${o}px` : o, r = y(() => {
729
771
  const o = {
730
772
  width: t(n.width),
731
773
  height: t(n.height),
@@ -733,15 +775,15 @@ const Je = { class: "content-title-dialog" }, Ke = {
733
775
  };
734
776
  return n.variant === "circle" ? { ...o, borderRadius: "999px" } : n.variant === "round" ? { ...o, borderRadius: "14px" } : o;
735
777
  });
736
- return (o, v) => (a(), r("div", {
737
- class: w(["h0n-skeleton", { "is-animated": e.animated }]),
738
- style: S(i.value)
778
+ return (o, v) => (l(), u("div", {
779
+ class: k(["h0n-skeleton", { "is-animated": e.animated }]),
780
+ style: R(r.value)
739
781
  }, null, 6));
740
782
  }
741
- }), vt = { class: "h0n-tabs" }, mt = ["onClick"], yt = { class: "h0n-tabs__label" }, pt = {
783
+ }), mt = { class: "h0n-tabs" }, yt = ["onClick"], pt = { class: "h0n-tabs__label" }, gt = {
742
784
  key: 0,
743
785
  class: "h0n-tabs__content"
744
- }, _t = /* @__PURE__ */ C({
786
+ }, _t = /* @__PURE__ */ I({
745
787
  __name: "Tabs",
746
788
  props: {
747
789
  modelValue: {},
@@ -749,60 +791,62 @@ const Je = { class: "content-title-dialog" }, Ke = {
749
791
  },
750
792
  emits: ["update:modelValue"],
751
793
  setup(e, { emit: n }) {
752
- const t = e, i = n, o = y(
753
- () => t.tabs.findIndex((s) => s.value === t.modelValue)
754
- ), v = O(null), d = O(null), f = O(0), u = O(0), l = O("forward");
794
+ const t = e, r = n, o = y(
795
+ () => t.tabs.findIndex((i) => i.value === t.modelValue)
796
+ ), v = O(null), f = O(null), h = O(0), d = O(0), c = O("forward");
755
797
  let p = 0;
756
- const x = () => {
757
- V("auto");
758
- }, L = () => {
759
- const s = d.value;
760
- return s ? s.querySelector(".h0n-tabs__tab.is-active") : null;
761
- }, V = async (s = "smooth") => {
762
- const h = ++p;
763
- if (await pe(), h !== p) return;
764
- const c = d.value, I = L(), b = v.value;
765
- if (!I || !c) {
766
- f.value = 0, u.value = 0;
798
+ const S = () => {
799
+ L("auto");
800
+ }, T = () => {
801
+ const i = f.value;
802
+ return i ? i.querySelector(".h0n-tabs__tab.is-active") : null;
803
+ }, L = async (i = "smooth") => {
804
+ const s = ++p;
805
+ if (await ge(), s !== p) return;
806
+ const $ = f.value, w = T(), B = v.value;
807
+ if (!w || !$) {
808
+ h.value = 0, d.value = 0;
767
809
  return;
768
810
  }
769
- const j = I.querySelector(".h0n-tabs__label") ?? I, ce = c.getBoundingClientRect(), Y = j.getBoundingClientRect();
770
- if (f.value = Y.left - ce.left, u.value = Y.width, !b) return;
771
- const ue = I.offsetLeft + I.offsetWidth / 2 - b.clientWidth / 2, de = Math.max(b.scrollWidth - b.clientWidth, 0), ee = Math.min(Math.max(ue, 0), de);
772
- Math.abs(b.scrollLeft - ee) < 1 || b.scrollTo({
811
+ const ce = w.querySelector(".h0n-tabs__label") ?? w, ue = $.getBoundingClientRect(), Y = ce.getBoundingClientRect();
812
+ if (h.value = Y.left - ue.left, d.value = Y.width, !B) return;
813
+ const de = w.offsetLeft + w.offsetWidth / 2 - B.clientWidth / 2, fe = Math.max(B.scrollWidth - B.clientWidth, 0), ee = Math.min(Math.max(de, 0), fe);
814
+ Math.abs(B.scrollLeft - ee) < 1 || B.scrollTo({
773
815
  left: ee,
774
- behavior: s
816
+ behavior: i
775
817
  });
776
818
  }, P = y(() => ({
777
819
  left: "0px",
778
- width: `${u.value}px`,
779
- transform: `translateX(${f.value}px)`
820
+ width: `${d.value}px`,
821
+ transform: `translateX(${h.value}px)`
780
822
  }));
781
- H(
823
+ E(
782
824
  () => o.value,
783
- (s, h) => {
784
- if (h === void 0 || h === -1 || s === -1) {
785
- l.value = "forward";
825
+ (i, s) => {
826
+ if (s === void 0 || s === -1 || i === -1) {
827
+ c.value = "forward";
786
828
  return;
787
829
  }
788
- l.value = s >= h ? "forward" : "backward";
830
+ c.value = i >= s ? "forward" : "backward";
789
831
  }
790
832
  );
791
- const q = y(
792
- () => l.value === "forward" ? "h0n-tabs-slide-left" : "h0n-tabs-slide-right"
793
- ), N = (s) => {
794
- i("update:modelValue", s);
833
+ const D = y(
834
+ () => c.value === "forward" ? "h0n-tabs-slide-left" : "h0n-tabs-slide-right"
835
+ ), g = y(
836
+ () => t.tabs.length > 0 && t.tabs.length <= 3
837
+ ), a = (i) => {
838
+ r("update:modelValue", i);
795
839
  };
796
840
  return G(() => {
797
- V("auto"), window.addEventListener("resize", x);
798
- }), ye(() => {
799
- p++, window.removeEventListener("resize", x);
800
- }), H(
841
+ L("auto"), window.addEventListener("resize", S);
842
+ }), pe(() => {
843
+ p++, window.removeEventListener("resize", S);
844
+ }), E(
801
845
  () => [t.modelValue, t.tabs.length],
802
846
  () => {
803
- V();
847
+ L();
804
848
  }
805
- ), (s, h) => (a(), r("div", vt, [
849
+ ), (i, s) => (l(), u("div", mt, [
806
850
  m("div", {
807
851
  ref_key: "scrollerRef",
808
852
  ref: v,
@@ -810,72 +854,72 @@ const Je = { class: "content-title-dialog" }, Ke = {
810
854
  }, [
811
855
  m("div", {
812
856
  ref_key: "listRef",
813
- ref: d,
814
- class: "h0n-tabs__list"
857
+ ref: f,
858
+ class: k(["h0n-tabs__list", { "is-even": g.value }])
815
859
  }, [
816
- (a(!0), r(Z, null, ae(e.tabs, (c, I) => (a(), r("button", {
817
- key: `${String(c.value)}-${I}`,
818
- class: w(["h0n-tabs__tab", { "is-active": c.value === e.modelValue }]),
860
+ (l(!0), u(Z, null, ae(e.tabs, ($, w) => (l(), u("button", {
861
+ key: `${String($.value)}-${w}`,
862
+ class: k(["h0n-tabs__tab", { "is-active": $.value === e.modelValue }]),
819
863
  type: "button",
820
- onClick: (b) => N(c.value)
864
+ onClick: (B) => a($.value)
821
865
  }, [
822
- m("span", yt, $(c.label), 1)
823
- ], 10, mt))), 128)),
866
+ m("span", pt, x($.label), 1)
867
+ ], 10, yt))), 128)),
824
868
  m("span", {
825
869
  class: "h0n-tabs__indicator",
826
- style: S(P.value)
870
+ style: R(P.value)
827
871
  }, null, 4)
828
- ], 512)
872
+ ], 2)
829
873
  ], 512),
830
- s.$slots.default ? (a(), r("div", pt, [
831
- z(D, {
832
- name: q.value,
874
+ i.$slots.default ? (l(), u("div", gt, [
875
+ A(q, {
876
+ name: D.value,
833
877
  mode: "out-in"
834
878
  }, {
835
- default: T(() => [
836
- (a(), r("div", {
879
+ default: H(() => [
880
+ (l(), u("div", {
837
881
  key: e.modelValue,
838
882
  class: "h0n-tabs__panel"
839
883
  }, [
840
- k(s.$slots, "default", { activeTab: e.modelValue })
884
+ C(i.$slots, "default", { activeTab: e.modelValue })
841
885
  ]))
842
886
  ]),
843
887
  _: 3
844
888
  }, 8, ["name"])
845
- ])) : g("", !0)
889
+ ])) : b("", !0)
846
890
  ]));
847
891
  }
848
892
  });
849
- function gt(e) {
850
- const n = bt(e);
893
+ function bt(e) {
894
+ const n = kt(e);
851
895
  return {
852
896
  install(t) {
853
- t.component("H0Accordion", Se), t.component("H0Alert", He), t.component("H0Button", Ne), t.component("H0Card", We), t.component("H0Dialog", Qe), t.component("H0Spinner", re), t.component("H0Menu", it), t.component("H0Image", dt), t.component("H0Overlay", ft), t.component("H0Skeleton", ht), t.component("H0Tabs", _t), ge(n.theme);
897
+ t.component("H0Accordion", Be), t.component("H0Alert", Pe), t.component("H0Button", je), t.component("H0Card", Ze), t.component("H0Dialog", Ye), t.component("H0Spinner", re), t.component("H0Menu", lt), t.component("H0Image", ft), t.component("H0Overlay", ht), t.component("H0Skeleton", vt), t.component("H0Tabs", _t), be(n.theme);
854
898
  }
855
899
  };
856
900
  }
857
- const wt = gt();
858
- function bt(e) {
901
+ const Ct = bt();
902
+ function kt(e) {
859
903
  return {
860
904
  autoRegisterComponents: e?.autoRegisterComponents ?? !0,
861
905
  theme: _e(e?.theme)
862
906
  };
863
907
  }
864
908
  export {
865
- Se as Accordion,
866
- He as Alert,
867
- Ne as Button,
868
- We as Card,
869
- Qe as Dialog,
870
- dt as Image,
871
- it as Menu,
872
- ft as Overlay,
873
- ht as Skeleton,
909
+ Be as Accordion,
910
+ Pe as Alert,
911
+ je as Button,
912
+ Ze as Card,
913
+ Ye as Dialog,
914
+ ft as Image,
915
+ lt as Menu,
916
+ ht as Overlay,
917
+ vt as Skeleton,
874
918
  re as Spinner,
875
919
  _t as Tabs,
876
- gt as createH0NPlugin,
877
- wt as h0nUi,
878
- M as useOverlayStack,
879
- Be as useWebAlert,
880
- Ze as useWebDialog
920
+ bt as createH0NPlugin,
921
+ Ct as h0nUi,
922
+ N as useOverlayStack,
923
+ Re as useWebAlert,
924
+ Je as useWebDialog
881
925
  };