@histoire/controls 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/components/HstWrapper.vue.d.ts +16 -3
  2. package/dist/components/button/HstButton.story.vue.d.ts +2 -0
  3. package/dist/components/button/HstButton.vue.d.ts +15 -0
  4. package/dist/components/button/HstButtonGroup.story.vue.d.ts +2 -0
  5. package/dist/components/button/HstButtonGroup.vue.d.ts +24 -0
  6. package/dist/components/checkbox/HstCheckboxList.story.vue.d.ts +2 -0
  7. package/dist/components/checkbox/HstCheckboxList.vue.d.ts +24 -0
  8. package/dist/components/checkbox/HstSimpleCheckbox.story.vue.d.ts +2 -0
  9. package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +21 -0
  10. package/dist/index.d.ts +134 -0
  11. package/dist/index.es.js +543 -396
  12. package/dist/style-standalone.css +102 -23
  13. package/package.json +2 -2
  14. package/src/components/HstWrapper.vue +12 -4
  15. package/src/components/button/HstButton.story.vue +30 -0
  16. package/src/components/button/HstButton.vue +26 -0
  17. package/src/components/button/HstButtonGroup.story.vue +51 -0
  18. package/src/components/button/HstButtonGroup.vue +64 -0
  19. package/src/components/checkbox/HstCheckbox.story.vue +5 -1
  20. package/src/components/checkbox/HstCheckbox.vue +4 -50
  21. package/src/components/checkbox/HstCheckboxList.story.vue +49 -0
  22. package/src/components/checkbox/HstCheckboxList.vue +79 -0
  23. package/src/components/checkbox/HstSimpleCheckbox.story.vue +28 -0
  24. package/src/components/checkbox/HstSimpleCheckbox.vue +82 -0
  25. package/src/components/checkbox/__snapshots__/HstCheckbox.test.ts.snap +6 -6
  26. package/src/components/design-tokens/HstColorShades.story.vue +2 -1
  27. package/src/components/design-tokens/HstTokenGrid.story.vue +2 -1
  28. package/src/components/design-tokens/HstTokenList.story.vue +2 -1
  29. package/src/components/number/HstNumber.story.vue +1 -0
  30. package/src/components/number/HstNumber.vue +1 -2
  31. package/src/components/radio/HstRadio.story.vue +5 -1
  32. package/src/components/select/HstSelect.story.vue +1 -0
  33. package/src/components/slider/HstSlider.story.vue +2 -0
  34. package/src/components/text/HstText.story.vue +1 -0
  35. package/src/components/textarea/HstTextarea.story.vue +4 -1
  36. package/src/index.ts +9 -0
package/dist/index.es.js CHANGED
@@ -1,199 +1,340 @@
1
- import { defineComponent as _, openBlock as i, createElementBlock as m, withDirectives as V, createTextVNode as M, toDisplayString as k, unref as w, createElementVNode as c, renderSlot as g, ref as b, computed as y, watch as K, createBlock as f, withKeys as A, withModifiers as j, withCtx as v, normalizeClass as x, normalizeStyle as S, mergeProps as O, onUnmounted as R, isRef as D, vModelText as B, createCommentVNode as H, Fragment as E, renderList as L, createVNode as I } from "@histoire/vendors/vue";
2
- import { VTooltip as N, Dropdown as G } from "@histoire/vendors/floating-vue";
3
- import { Icon as U } from "@histoire/vendors/iconify";
4
- import { useClipboard as P } from "@histoire/vendors/vue-use";
5
- const W = { class: "htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap" }, X = { class: "htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0" }, J = { class: "htw-grow htw-flex htw-items-center htw-gap-1" }, q = { class: "htw-block htw-grow" }, Q = {
1
+ import { defineComponent as y, openBlock as i, createElementBlock as w, normalizeClass as b, renderSlot as g, createBlock as f, resolveDynamicComponent as P, withCtx as m, withDirectives as C, createTextVNode as H, toDisplayString as k, unref as d, createElementVNode as h, computed as v, Fragment as N, renderList as A, watch as D, ref as _, withKeys as E, withModifiers as B, createVNode as j, normalizeStyle as V, mergeProps as L, onUnmounted as W, isRef as K, vModelText as G, createCommentVNode as M } from "@histoire/vendors/vue";
2
+ import { VTooltip as O, Dropdown as X } from "@histoire/vendors/floating-vue";
3
+ import { Icon as I } from "@histoire/vendors/iconify";
4
+ import { useClipboard as J } from "@histoire/vendors/vue-use";
5
+ const q = {
6
+ name: "HstButton"
7
+ }, U = /* @__PURE__ */ y({
8
+ ...q,
9
+ props: {
10
+ color: null
11
+ },
12
+ setup(l) {
13
+ const c = {
14
+ default: "htw-bg-gray-200 dark:htw-bg-gray-750 htw-text-gray-900 dark:htw-text-gray-100 hover:htw-bg-primary-200 dark:hover:htw-bg-primary-900",
15
+ primary: "htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black",
16
+ flat: "htw-bg-transparent hover:htw-bg-gray-500/20 htw-text-gray-900 dark:htw-text-gray-100"
17
+ };
18
+ return (n, a) => {
19
+ var o;
20
+ return i(), w("button", {
21
+ class: b(["htw-cursor-pointer htw-rounded-sm", c[(o = l.color) != null ? o : "default"]])
22
+ }, [
23
+ g(n.$slots, "default")
24
+ ], 2);
25
+ };
26
+ }
27
+ }), Q = { class: "htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0" }, Y = { class: "htw-grow htw-flex htw-items-center htw-gap-1" }, Z = { class: "htw-block htw-grow" }, tt = {
6
28
  name: "HstWrapper"
7
- }, z = /* @__PURE__ */ _({
8
- ...Q,
29
+ }, S = /* @__PURE__ */ y({
30
+ ...tt,
9
31
  props: {
10
- title: null
32
+ title: null,
33
+ tag: { default: "label" }
11
34
  },
12
- setup(s) {
13
- return (h, a) => (i(), m("label", W, [
14
- V((i(), m("span", X, [
15
- M(k(s.title), 1)
16
- ])), [
17
- [w(N), {
18
- content: s.title,
19
- placement: "left",
20
- distance: 12
21
- }]
22
- ]),
23
- c("span", J, [
24
- c("span", q, [
25
- g(h.$slots, "default")
35
+ setup(l) {
36
+ return (c, n) => (i(), f(P(l.tag), { class: "htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap" }, {
37
+ default: m(() => [
38
+ C((i(), w("span", Q, [
39
+ H(k(l.title), 1)
40
+ ])), [
41
+ [d(O), {
42
+ content: l.title,
43
+ placement: "left",
44
+ distance: 12
45
+ }]
26
46
  ]),
27
- g(h.$slots, "actions")
28
- ])
29
- ]));
47
+ h("span", Y, [
48
+ h("span", Z, [
49
+ g(c.$slots, "default")
50
+ ]),
51
+ g(c.$slots, "actions")
52
+ ])
53
+ ]),
54
+ _: 3
55
+ }));
30
56
  }
31
- }), Y = { class: "htw-text-white htw-w-[16px] htw-h-[16px] htw-relative" }, Z = {
57
+ }), et = { class: "htw-flex htw-gap-px htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 htw-rounded-sm htw-p-px" }, lt = {
58
+ name: "HstButtonGroup"
59
+ }, nt = /* @__PURE__ */ y({
60
+ ...lt,
61
+ props: {
62
+ title: null,
63
+ modelValue: null,
64
+ options: null
65
+ },
66
+ emits: ["update:modelValue"],
67
+ setup(l, { emit: c }) {
68
+ const n = l, a = v(() => Array.isArray(n.options) ? Object.fromEntries(n.options.map((e) => typeof e == "string" ? [e, e] : [e.value, e.label])) : n.options);
69
+ function o(e) {
70
+ c("update:modelValue", e);
71
+ }
72
+ return (e, t) => (i(), f(S, {
73
+ tag: "div",
74
+ role: "group",
75
+ title: l.title,
76
+ class: "htw-flex-nowrap htw-items-center"
77
+ }, {
78
+ actions: m(() => [
79
+ g(e.$slots, "actions")
80
+ ]),
81
+ default: m(() => [
82
+ h("div", et, [
83
+ (i(!0), w(N, null, A(d(a), (r, s) => (i(), f(U, {
84
+ key: s,
85
+ class: "htw-px-1 htw-h-[22px] htw-flex-1 !htw-rounded-[3px]",
86
+ color: s === l.modelValue ? "primary" : "flat",
87
+ rounded: !1,
88
+ onClick: (u) => o(s)
89
+ }, {
90
+ default: m(() => [
91
+ H(k(r), 1)
92
+ ]),
93
+ _: 2
94
+ }, 1032, ["color", "onClick"]))), 128))
95
+ ])
96
+ ]),
97
+ _: 3
98
+ }, 8, ["title"]));
99
+ }
100
+ }), st = {
32
101
  width: "16",
33
102
  height: "16",
34
103
  viewBox: "0 0 24 24",
35
104
  class: "htw-relative htw-z-10"
36
- }, tt = ["stroke-dasharray", "stroke-dashoffset"], et = {
105
+ }, ot = ["stroke-dasharray", "stroke-dashoffset"], rt = {
106
+ name: "HstSimpleCheckbox"
107
+ }, F = /* @__PURE__ */ y({
108
+ ...rt,
109
+ props: {
110
+ modelValue: { type: Boolean },
111
+ withToggle: { type: Boolean }
112
+ },
113
+ emits: {
114
+ "update:modelValue": (l) => !0
115
+ },
116
+ setup(l, { emit: c }) {
117
+ const n = l;
118
+ function a() {
119
+ !n.withToggle || c("update:modelValue", !n.modelValue);
120
+ }
121
+ D(() => n.modelValue, () => {
122
+ s.value = !0;
123
+ });
124
+ const o = _(), e = _(0), t = v(() => n.modelValue ? 1 : 0), r = v(() => (1 - t.value) * e.value), s = _(!1);
125
+ return D(o, () => {
126
+ var u, p, $;
127
+ e.value = ($ = (p = (u = o.value).getTotalLength) == null ? void 0 : p.call(u)) != null ? $ : 21.21;
128
+ }), (u, p) => (i(), w("div", {
129
+ class: b(["htw-group htw-text-white htw-w-[16px] htw-h-[16px] htw-relative", { "htw-cursor-pointer": l.withToggle }]),
130
+ onClick: a
131
+ }, [
132
+ h("div", {
133
+ class: b(["htw-border htw-border-solid group-active:htw-bg-gray-500/20 htw-rounded-sm htw-box-border htw-absolute htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out group-hover:htw-border-primary-500 group-hover:dark:htw-border-primary-500", [
134
+ l.modelValue ? "htw-border-primary-500 htw-border-8" : "htw-border-black/25 dark:htw-border-white/25 htw-delay-150"
135
+ ]])
136
+ }, null, 2),
137
+ (i(), w("svg", st, [
138
+ h("path", {
139
+ ref_key: "path",
140
+ ref: o,
141
+ d: "m 4 12 l 5 5 l 10 -10",
142
+ fill: "none",
143
+ class: b(["htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out", [
144
+ s.value ? "htw-transition-all" : "htw-transition-none",
145
+ {
146
+ "htw-delay-150": l.modelValue
147
+ }
148
+ ]]),
149
+ "stroke-dasharray": e.value,
150
+ "stroke-dashoffset": d(r)
151
+ }, null, 10, ot)
152
+ ]))
153
+ ], 2));
154
+ }
155
+ }), at = {
37
156
  name: "HstCheckbox"
38
- }, st = /* @__PURE__ */ _({
39
- ...et,
157
+ }, ut = /* @__PURE__ */ y({
158
+ ...at,
40
159
  props: {
41
160
  modelValue: { type: Boolean },
42
161
  title: null
43
162
  },
44
163
  emits: {
45
- "update:modelValue": (s) => !0
164
+ "update:modelValue": (l) => !0
46
165
  },
47
- setup(s, { emit: h }) {
48
- const a = s;
49
- function o() {
50
- h("update:modelValue", !a.modelValue), l.value = !0;
166
+ setup(l, { emit: c }) {
167
+ const n = l;
168
+ function a() {
169
+ c("update:modelValue", !n.modelValue);
51
170
  }
52
- const n = b(), u = b(0), t = y(() => a.modelValue ? 1 : 0), e = y(() => (1 - t.value) * u.value), l = b(!1);
53
- return K(n, () => {
54
- var r, d, p;
55
- u.value = (p = (d = (r = n.value).getTotalLength) == null ? void 0 : d.call(r)) != null ? p : 21.21;
56
- }), (r, d) => (i(), f(z, {
171
+ return (o, e) => (i(), f(S, {
57
172
  role: "checkbox",
58
173
  tabindex: "0",
59
174
  class: "htw-cursor-pointer htw-items-center",
60
- title: s.title,
61
- onClick: d[0] || (d[0] = (p) => o()),
175
+ title: l.title,
176
+ onClick: e[0] || (e[0] = (t) => a()),
62
177
  onKeydown: [
63
- d[1] || (d[1] = A(j((p) => o(), ["prevent"]), ["enter"])),
64
- d[2] || (d[2] = A(j((p) => o(), ["prevent"]), ["space"]))
178
+ e[1] || (e[1] = E(B((t) => a(), ["prevent"]), ["enter"])),
179
+ e[2] || (e[2] = E(B((t) => a(), ["prevent"]), ["space"]))
65
180
  ]
66
181
  }, {
67
- actions: v(() => [
68
- g(r.$slots, "actions")
182
+ actions: m(() => [
183
+ g(o.$slots, "actions")
69
184
  ]),
70
- default: v(() => [
71
- c("div", Y, [
72
- c("div", {
73
- class: x(["htw-border htw-border-solid group-active:htw-bg-gray-500/20 htw-rounded-sm htw-box-border htw-absolute htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out", [
74
- s.modelValue ? "htw-border-primary-500 htw-border-8" : "htw-border-black/25 dark:htw-border-white/25 htw-delay-150"
75
- ]])
76
- }, null, 2),
77
- (i(), m("svg", Z, [
78
- c("path", {
79
- ref_key: "path",
80
- ref: n,
81
- d: "m 4 12 l 5 5 l 10 -10",
82
- fill: "none",
83
- class: x(["htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out", [
84
- l.value ? "htw-transition-all" : "htw-transition-none",
85
- {
86
- "htw-delay-150": s.modelValue
87
- }
88
- ]]),
89
- "stroke-dasharray": u.value,
90
- "stroke-dashoffset": w(e)
91
- }, null, 10, tt)
92
- ]))
93
- ])
185
+ default: m(() => [
186
+ j(F, { "model-value": l.modelValue }, null, 8, ["model-value"])
94
187
  ]),
95
188
  _: 3
96
189
  }, 8, ["title"]));
97
190
  }
98
- }), lt = ["value"], nt = {
191
+ }), it = { class: "-htw-my-1" }, ct = ["for", "onKeydown", "onClick"], ht = {
192
+ name: "HstCheckboxList"
193
+ }, dt = /* @__PURE__ */ y({
194
+ ...ht,
195
+ props: {
196
+ title: null,
197
+ modelValue: null,
198
+ options: null
199
+ },
200
+ emits: ["update:modelValue"],
201
+ setup(l, { emit: c }) {
202
+ const n = l, a = v(() => Array.isArray(n.options) ? Object.fromEntries(n.options.map((e) => typeof e == "string" ? [e, e] : [e.value, e.label])) : n.options);
203
+ function o(e) {
204
+ n.modelValue.includes(e) ? c("update:modelValue", n.modelValue.filter((t) => t !== e)) : c("update:modelValue", [...n.modelValue, e]);
205
+ }
206
+ return (e, t) => (i(), f(S, {
207
+ role: "group",
208
+ title: l.title,
209
+ class: b(["htw-cursor-text", e.$attrs.class]),
210
+ style: V(e.$attrs.style)
211
+ }, {
212
+ actions: m(() => [
213
+ g(e.$slots, "actions")
214
+ ]),
215
+ default: m(() => [
216
+ h("div", it, [
217
+ (i(!0), w(N, null, A(d(a), (r, s) => (i(), w("label", {
218
+ key: s,
219
+ tabindex: "0",
220
+ for: `${s}-radio`,
221
+ class: "htw-cursor-pointer htw-flex htw-items-center htw-relative htw-py-1 htw-group",
222
+ onKeydown: [
223
+ E(B((u) => o(s), ["prevent"]), ["enter"]),
224
+ E(B((u) => o(s), ["prevent"]), ["space"])
225
+ ],
226
+ onClick: (u) => o(s)
227
+ }, [
228
+ j(F, {
229
+ "model-value": l.modelValue.includes(s),
230
+ class: "htw-mr-2"
231
+ }, null, 8, ["model-value"]),
232
+ H(" " + k(r), 1)
233
+ ], 40, ct))), 128))
234
+ ])
235
+ ]),
236
+ _: 3
237
+ }, 8, ["title", "class", "style"]));
238
+ }
239
+ }), wt = ["value"], pt = {
99
240
  name: "HstText"
100
- }, ot = /* @__PURE__ */ _({
101
- ...nt,
241
+ }, mt = /* @__PURE__ */ y({
242
+ ...pt,
102
243
  props: {
103
244
  title: null,
104
245
  modelValue: null
105
246
  },
106
247
  emits: {
107
- "update:modelValue": (s) => !0
248
+ "update:modelValue": (l) => !0
108
249
  },
109
- setup(s, { emit: h }) {
110
- const a = b();
111
- return (o, n) => (i(), f(z, {
112
- title: s.title,
113
- class: x(["htw-cursor-text htw-items-center", o.$attrs.class]),
114
- style: S(o.$attrs.style),
115
- onClick: n[1] || (n[1] = (u) => a.value.focus())
250
+ setup(l, { emit: c }) {
251
+ const n = _();
252
+ return (a, o) => (i(), f(S, {
253
+ title: l.title,
254
+ class: b(["htw-cursor-text htw-items-center", a.$attrs.class]),
255
+ style: V(a.$attrs.style),
256
+ onClick: o[1] || (o[1] = (e) => n.value.focus())
116
257
  }, {
117
- actions: v(() => [
118
- g(o.$slots, "actions")
258
+ actions: m(() => [
259
+ g(a.$slots, "actions")
119
260
  ]),
120
- default: v(() => [
121
- c("input", O({
261
+ default: m(() => [
262
+ h("input", L({
122
263
  ref_key: "input",
123
- ref: a
124
- }, { ...o.$attrs, class: null, style: null }, {
264
+ ref: n
265
+ }, { ...a.$attrs, class: null, style: null }, {
125
266
  type: "text",
126
- value: s.modelValue,
267
+ value: l.modelValue,
127
268
  class: "htw-text-inherit htw-bg-transparent htw-w-full htw-outline-none htw-px-2 htw-py-1 -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 focus:htw-border-primary-500 dark:focus:htw-border-primary-500 htw-rounded-sm",
128
- onInput: n[0] || (n[0] = (u) => h("update:modelValue", u.target.value))
129
- }), null, 16, lt)
269
+ onInput: o[0] || (o[0] = (e) => c("update:modelValue", e.target.value))
270
+ }), null, 16, wt)
130
271
  ]),
131
272
  _: 3
132
273
  }, 8, ["title", "class", "style"]));
133
274
  }
134
- }), rt = {
275
+ }), ft = {
135
276
  name: "HstNumber",
136
277
  inheritAttrs: !1
137
- }, at = /* @__PURE__ */ _({
138
- ...rt,
278
+ }, yt = /* @__PURE__ */ y({
279
+ ...ft,
139
280
  props: {
140
281
  title: null,
141
282
  modelValue: null
142
283
  },
143
284
  emits: {
144
- "update:modelValue": (s) => !0
285
+ "update:modelValue": (l) => !0
145
286
  },
146
- setup(s, { emit: h }) {
147
- const a = s, o = y({
148
- get: () => a.modelValue,
149
- set: ($) => {
150
- h("update:modelValue", $);
287
+ setup(l, { emit: c }) {
288
+ const n = l, a = v({
289
+ get: () => n.modelValue,
290
+ set: (x) => {
291
+ c("update:modelValue", x);
151
292
  }
152
- }), n = b();
153
- function u() {
154
- n.value.focus(), n.value.select();
293
+ }), o = _();
294
+ function e() {
295
+ o.value.focus(), o.value.select();
155
296
  }
156
- const t = b(!1);
157
- let e, l;
158
- function r($) {
159
- t.value = !0, e = $.clientX, l = o.value, window.addEventListener("mousemove", d), window.addEventListener("mouseup", p);
297
+ const t = _(!1);
298
+ let r, s;
299
+ function u(x) {
300
+ t.value = !0, r = x.clientX, s = a.value, window.addEventListener("mousemove", p), window.addEventListener("mouseup", $);
160
301
  }
161
- function d($) {
162
- let C = parseFloat(n.value.step);
163
- isNaN(C) && (C = 1), o.value = l + Math.round(($.clientX - e) / 10 / C) * C;
302
+ function p(x) {
303
+ let T = parseFloat(o.value.step);
304
+ isNaN(T) && (T = 1), a.value = s + Math.round((x.clientX - r) / 10 / T) * T;
164
305
  }
165
- function p() {
166
- t.value = !1, window.removeEventListener("mousemove", d), window.removeEventListener("mouseup", p);
306
+ function $() {
307
+ t.value = !1, window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", $);
167
308
  }
168
- return R(() => {
169
- p();
170
- }), ($, C) => (i(), f(z, {
171
- class: x(["htw-cursor-ew-resize htw-items-center", [
172
- $.$attrs.class,
309
+ return W(() => {
310
+ $();
311
+ }), (x, T) => (i(), f(S, {
312
+ class: b(["htw-cursor-ew-resize htw-items-center", [
313
+ x.$attrs.class,
173
314
  { "htw-select-none": t.value }
174
315
  ]]),
175
- title: s.title,
176
- style: S($.$attrs.style),
177
- onClick: u,
178
- onMousedown: r
316
+ title: l.title,
317
+ style: V(x.$attrs.style),
318
+ onClick: e,
319
+ onMousedown: u
179
320
  }, {
180
- actions: v(() => [
181
- g($.$slots, "actions")
321
+ actions: m(() => [
322
+ g(x.$slots, "actions")
182
323
  ]),
183
- default: v(() => [
184
- V(c("input", O({
324
+ default: m(() => [
325
+ C(h("input", L({
185
326
  ref_key: "input",
186
- ref: n
187
- }, { ...$.$attrs, class: null, style: null }, {
188
- "onUpdate:modelValue": C[0] || (C[0] = (F) => D(o) ? o.value = F : null),
327
+ ref: o
328
+ }, { ...x.$attrs, class: null, style: null }, {
329
+ "onUpdate:modelValue": T[0] || (T[0] = (R) => K(a) ? a.value = R : null),
189
330
  type: "number",
190
331
  class: [{
191
332
  "htw-select-none": t.value
192
- }, "htw-text-inherit htw-bg-transparent htw-w-full htw-outline-none htw-pl-2 htw-py-1 -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 focus:htw-border-primary-500 dark:focus:htw-border-primary-500 htw-rounded-sm htw-cursor-ew-resize"]
333
+ }, "htw-text-inherit htw-bg-transparent htw-w-full htw-outline-none htw-pl-2 htw-py-1 -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 focus:htw-border-primary-500 dark:focus:htw-border-primary-500 htw-rounded-sm htw-cursor-ew-resize htw-box-border"]
193
334
  }), null, 16), [
194
335
  [
195
- B,
196
- w(o),
336
+ G,
337
+ d(a),
197
338
  void 0,
198
339
  { number: !0 }
199
340
  ]
@@ -203,13 +344,13 @@ const W = { class: "htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-8
203
344
  }, 8, ["title", "class", "style"]));
204
345
  }
205
346
  });
206
- const ut = { class: "htw-relative htw-w-full htw-flex htw-items-center" }, it = /* @__PURE__ */ c("div", { class: "htw-absolute htw-inset-0 htw-flex htw-items-center" }, [
207
- /* @__PURE__ */ c("div", { class: "htw-border htw-border-black/25 dark:htw-border-white/25 htw-h-1 htw-w-full htw-rounded-full" })
208
- ], -1), ht = {
347
+ const vt = { class: "htw-relative htw-w-full htw-flex htw-items-center" }, gt = /* @__PURE__ */ h("div", { class: "htw-absolute htw-inset-0 htw-flex htw-items-center" }, [
348
+ /* @__PURE__ */ h("div", { class: "htw-border htw-border-black/25 dark:htw-border-white/25 htw-h-1 htw-w-full htw-rounded-full" })
349
+ ], -1), bt = {
209
350
  name: "HstSlider",
210
351
  inheritAttrs: !1
211
- }, ct = /* @__PURE__ */ _({
212
- ...ht,
352
+ }, _t = /* @__PURE__ */ y({
353
+ ...bt,
213
354
  props: {
214
355
  title: null,
215
356
  modelValue: null,
@@ -217,128 +358,128 @@ const ut = { class: "htw-relative htw-w-full htw-flex htw-items-center" }, it =
217
358
  max: null
218
359
  },
219
360
  emits: {
220
- "update:modelValue": (s) => !0
361
+ "update:modelValue": (l) => !0
221
362
  },
222
- setup(s, { emit: h }) {
223
- const a = s, o = b(!1), n = b(null), u = y({
224
- get: () => a.modelValue,
225
- set: (l) => {
226
- h("update:modelValue", l);
363
+ setup(l, { emit: c }) {
364
+ const n = l, a = _(!1), o = _(null), e = v({
365
+ get: () => n.modelValue,
366
+ set: (s) => {
367
+ c("update:modelValue", s);
227
368
  }
228
- }), t = y(() => (a.modelValue - a.min) / (a.max - a.min)), e = y(() => n.value ? {
229
- left: 8 + (n.value.clientWidth - 16) * t.value + "px"
369
+ }), t = v(() => (n.modelValue - n.min) / (n.max - n.min)), r = v(() => o.value ? {
370
+ left: 8 + (o.value.clientWidth - 16) * t.value + "px"
230
371
  } : {});
231
- return (l, r) => (i(), f(z, {
232
- class: x(["htw-items-center", l.$attrs.class]),
233
- title: s.title,
234
- style: S(l.$attrs.style)
372
+ return (s, u) => (i(), f(S, {
373
+ class: b(["htw-items-center", s.$attrs.class]),
374
+ title: l.title,
375
+ style: V(s.$attrs.style)
235
376
  }, {
236
- default: v(() => [
237
- c("div", ut, [
238
- it,
239
- V(c("input", O({
377
+ default: m(() => [
378
+ h("div", vt, [
379
+ gt,
380
+ C(h("input", L({
240
381
  ref_key: "input",
241
- ref: n,
242
- "onUpdate:modelValue": r[0] || (r[0] = (d) => D(u) ? u.value = d : null),
382
+ ref: o,
383
+ "onUpdate:modelValue": u[0] || (u[0] = (p) => K(e) ? e.value = p : null),
243
384
  class: "htw-range-input htw-appearance-none htw-border-0 htw-bg-transparent htw-cursor-pointer htw-relative htw-w-full htw-m-0 htw-text-gray-700",
244
385
  type: "range"
245
- }, { ...l.$attrs, class: null, style: null, min: s.min, max: s.max }, {
246
- onMouseover: r[1] || (r[1] = (d) => o.value = !0),
247
- onMouseleave: r[2] || (r[2] = (d) => o.value = !1)
386
+ }, { ...s.$attrs, class: null, style: null, min: l.min, max: l.max }, {
387
+ onMouseover: u[1] || (u[1] = (p) => a.value = !0),
388
+ onMouseleave: u[2] || (u[2] = (p) => a.value = !1)
248
389
  }), null, 16), [
249
390
  [
250
- B,
251
- w(u),
391
+ G,
392
+ d(e),
252
393
  void 0,
253
394
  { number: !0 }
254
395
  ]
255
396
  ]),
256
- o.value ? V((i(), m("div", {
397
+ a.value ? C((i(), w("div", {
257
398
  key: 0,
258
399
  class: "htw-absolute",
259
- style: S(w(e))
400
+ style: V(d(r))
260
401
  }, null, 4)), [
261
- [w(N), { content: s.modelValue.toString(), shown: !0, distance: 16, delay: 0 }]
262
- ]) : H("", !0)
402
+ [d(O), { content: l.modelValue.toString(), shown: !0, distance: 16, delay: 0 }]
403
+ ]) : M("", !0)
263
404
  ])
264
405
  ]),
265
406
  _: 1
266
407
  }, 8, ["title", "class", "style"]));
267
408
  }
268
- }), dt = ["value"], wt = {
409
+ }), $t = ["value"], xt = {
269
410
  name: "HstTextarea",
270
411
  inheritAttrs: !1
271
- }, mt = /* @__PURE__ */ _({
272
- ...wt,
412
+ }, kt = /* @__PURE__ */ y({
413
+ ...xt,
273
414
  props: {
274
415
  title: null,
275
416
  modelValue: null
276
417
  },
277
418
  emits: {
278
- "update:modelValue": (s) => !0
419
+ "update:modelValue": (l) => !0
279
420
  },
280
- setup(s, { emit: h }) {
281
- const a = b();
282
- return (o, n) => (i(), f(z, {
283
- title: s.title,
284
- class: x(["htw-cursor-text", o.$attrs.class]),
285
- style: S(o.$attrs.style),
286
- onClick: n[1] || (n[1] = (u) => a.value.focus())
421
+ setup(l, { emit: c }) {
422
+ const n = _();
423
+ return (a, o) => (i(), f(S, {
424
+ title: l.title,
425
+ class: b(["htw-cursor-text", a.$attrs.class]),
426
+ style: V(a.$attrs.style),
427
+ onClick: o[1] || (o[1] = (e) => n.value.focus())
287
428
  }, {
288
- actions: v(() => [
289
- g(o.$slots, "actions")
429
+ actions: m(() => [
430
+ g(a.$slots, "actions")
290
431
  ]),
291
- default: v(() => [
292
- c("textarea", O({
432
+ default: m(() => [
433
+ h("textarea", L({
293
434
  ref_key: "input",
294
- ref: a
295
- }, { ...o.$attrs, class: null, style: null }, {
296
- value: s.modelValue,
435
+ ref: n
436
+ }, { ...a.$attrs, class: null, style: null }, {
437
+ value: l.modelValue,
297
438
  class: "htw-text-inherit htw-bg-transparent htw-w-full htw-outline-none htw-px-2 htw-py-1 -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 focus:htw-border-primary-500 dark:focus:htw-border-primary-500 htw-rounded-sm htw-box-border htw-resize-y htw-min-h-[26px]",
298
- onInput: n[0] || (n[0] = (u) => h("update:modelValue", u.target.value))
299
- }), null, 16, dt)
439
+ onInput: o[0] || (o[0] = (e) => c("update:modelValue", e.target.value))
440
+ }), null, 16, $t)
300
441
  ]),
301
442
  _: 3
302
443
  }, 8, ["title", "class", "style"]));
303
444
  }
304
445
  });
305
- const pt = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw-h-[27px] -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 hover:htw-border-primary-500 dark:hover:htw-border-primary-500 htw-rounded-sm htw-flex htw-gap-2 htw-items-center htw-leading-normal" }, ft = { class: "htw-flex-1 htw-truncate" }, vt = { class: "htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700" }, yt = ["onClick"], bt = {
446
+ const Vt = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw-h-[27px] -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 hover:htw-border-primary-500 dark:hover:htw-border-primary-500 htw-rounded-sm htw-flex htw-gap-2 htw-items-center htw-leading-normal" }, Ct = { class: "htw-flex-1 htw-truncate" }, Ht = { class: "htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700" }, St = ["onClick"], Mt = {
306
447
  name: "CustomSelect"
307
- }, _t = /* @__PURE__ */ _({
308
- ...bt,
448
+ }, Nt = /* @__PURE__ */ y({
449
+ ...Mt,
309
450
  props: {
310
451
  modelValue: null,
311
452
  options: null
312
453
  },
313
454
  emits: ["update:modelValue"],
314
- setup(s, { emit: h }) {
315
- const a = s, o = y(() => Array.isArray(a.options) ? a.options.map((t) => typeof t == "string" ? [t, t] : [t.value, t.label]) : Object.entries(a.options)), n = y(() => {
455
+ setup(l, { emit: c }) {
456
+ const n = l, a = v(() => Array.isArray(n.options) ? n.options.map((t) => typeof t == "string" ? [t, t] : [t.value, t.label]) : Object.entries(n.options)), o = v(() => {
316
457
  var t;
317
- return (t = o.value.find(([e]) => e === a.modelValue)) == null ? void 0 : t[1];
458
+ return (t = a.value.find(([r]) => r === n.modelValue)) == null ? void 0 : t[1];
318
459
  });
319
- function u(t, e) {
320
- h("update:modelValue", t), e();
460
+ function e(t, r) {
461
+ c("update:modelValue", t), r();
321
462
  }
322
- return (t, e) => (i(), f(w(G), { "auto-size": "" }, {
323
- popper: v(({ hide: l }) => [
324
- c("div", vt, [
325
- (i(!0), m(E, null, L(w(o), ([r, d]) => (i(), m("div", O({ ...t.$attrs, class: null, style: null }, {
326
- key: d,
463
+ return (t, r) => (i(), f(d(X), { "auto-size": "" }, {
464
+ popper: m(({ hide: s }) => [
465
+ h("div", Ht, [
466
+ (i(!0), w(N, null, A(d(a), ([u, p]) => (i(), w("div", L({ ...t.$attrs, class: null, style: null }, {
467
+ key: p,
327
468
  class: ["htw-px-2 htw-py-1 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700", {
328
- "htw-bg-primary-200 dark:htw-bg-primary-800": a.modelValue === r
469
+ "htw-bg-primary-200 dark:htw-bg-primary-800": n.modelValue === u
329
470
  }],
330
- onClick: (p) => u(r, l)
331
- }), k(d), 17, yt))), 128))
471
+ onClick: ($) => e(u, s)
472
+ }), k(p), 17, St))), 128))
332
473
  ])
333
474
  ]),
334
- default: v(() => [
335
- c("div", pt, [
336
- c("div", ft, [
337
- g(t.$slots, "default", { label: w(n) }, () => [
338
- M(k(w(n)), 1)
475
+ default: m(() => [
476
+ h("div", Vt, [
477
+ h("div", Ct, [
478
+ g(t.$slots, "default", { label: d(o) }, () => [
479
+ H(k(d(o)), 1)
339
480
  ])
340
481
  ]),
341
- I(w(U), {
482
+ j(d(I), {
342
483
  icon: "carbon:chevron-sort",
343
484
  class: "htw-w-4 htw-h-4 htw-flex-none htw-ml-auto"
344
485
  })
@@ -347,346 +488,352 @@ const pt = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw
347
488
  _: 3
348
489
  }));
349
490
  }
350
- }), $t = {
491
+ }), Tt = {
351
492
  name: "HstSelect"
352
- }, gt = /* @__PURE__ */ _({
353
- ...$t,
493
+ }, Ot = /* @__PURE__ */ y({
494
+ ...Tt,
354
495
  props: {
355
496
  title: null,
356
497
  modelValue: null,
357
498
  options: null
358
499
  },
359
500
  emits: ["update:modelValue"],
360
- setup(s, { emit: h }) {
361
- return (a, o) => (i(), f(z, {
362
- title: s.title,
363
- class: x(["htw-cursor-text htw-items-center", a.$attrs.class]),
364
- style: S(a.$attrs.style)
501
+ setup(l, { emit: c }) {
502
+ return (n, a) => (i(), f(S, {
503
+ title: l.title,
504
+ class: b(["htw-cursor-text htw-items-center", n.$attrs.class]),
505
+ style: V(n.$attrs.style)
365
506
  }, {
366
- actions: v(() => [
367
- g(a.$slots, "actions")
507
+ actions: m(() => [
508
+ g(n.$slots, "actions")
368
509
  ]),
369
- default: v(() => [
370
- I(_t, {
371
- options: s.options,
372
- "model-value": s.modelValue,
373
- "onUpdate:modelValue": o[0] || (o[0] = (n) => h("update:modelValue", n))
510
+ default: m(() => [
511
+ j(Nt, {
512
+ options: l.options,
513
+ "model-value": l.modelValue,
514
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => c("update:modelValue", o))
374
515
  }, null, 8, ["options", "model-value"])
375
516
  ]),
376
517
  _: 3
377
518
  }, 8, ["title", "class", "style"]));
378
519
  }
379
- }), xt = {
520
+ }), zt = {
380
521
  name: "HstCopyIcon"
381
- }, T = /* @__PURE__ */ _({
382
- ...xt,
522
+ }, z = /* @__PURE__ */ y({
523
+ ...zt,
383
524
  props: {
384
525
  content: null
385
526
  },
386
- setup(s) {
387
- const h = s, { copy: a, copied: o } = P(), n = () => a(h.content);
388
- return (u, t) => V((i(), f(w(U), {
527
+ setup(l) {
528
+ const c = l, { copy: n, copied: a } = J(), o = () => n(c.content);
529
+ return (e, t) => C((i(), f(d(I), {
389
530
  icon: "carbon:copy-file",
390
531
  class: "htw-w-4 htw-h-4 htw-opacity-50 hover:htw-opacity-100 hover:htw-text-primary-500 htw-cursor-pointer",
391
- onClick: t[0] || (t[0] = (e) => n())
532
+ onClick: t[0] || (t[0] = (r) => o())
392
533
  }, null, 512)), [
393
- [w(N), {
534
+ [d(O), {
394
535
  content: "Copied!",
395
536
  triggers: [],
396
- shown: w(o),
537
+ shown: d(a),
397
538
  distance: 12,
398
539
  delay: 0
399
540
  }]
400
541
  ]);
401
542
  }
402
- }), kt = {
543
+ }), At = {
403
544
  key: 0,
404
545
  class: "htw-grid htw-gap-4 htw-grid-cols-[repeat(auto-fill,minmax(200px,1fr))] htw-m-4"
405
- }, Vt = ["onMouseenter"], St = { class: "htw-flex htw-gap-1" }, Ht = { class: "htw-my-0 htw-truncate htw-shrink" }, Ct = { class: "htw-flex htw-gap-1" }, Mt = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" }, Nt = {
546
+ }, Et = ["onMouseenter"], Bt = { class: "htw-flex htw-gap-1" }, Lt = { class: "htw-my-0 htw-truncate htw-shrink" }, jt = { class: "htw-flex htw-gap-1" }, Dt = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" }, Kt = {
406
547
  name: "HstColorShades"
407
- }, Tt = /* @__PURE__ */ _({
408
- ...Nt,
548
+ }, Gt = /* @__PURE__ */ y({
549
+ ...Kt,
409
550
  props: {
410
551
  shades: null,
411
552
  getName: null,
412
553
  search: null
413
554
  },
414
- setup(s) {
415
- const h = s, a = (t, e = "") => Object.entries(t).reduce((l, [r, d]) => {
416
- const p = e ? r === "DEFAULT" ? e : `${e}-${r}` : r, $ = typeof d == "object" ? a(d, p) : { [p]: d };
417
- return { ...l, ...$ };
418
- }, {}), o = y(() => {
419
- const t = h.shades, e = h.getName, l = a(t);
420
- return Object.entries(l).map(([r, d]) => {
421
- const p = e ? e(r, d) : r;
555
+ setup(l) {
556
+ const c = l, n = (t, r = "") => Object.entries(t).reduce((s, [u, p]) => {
557
+ const $ = r ? u === "DEFAULT" ? r : `${r}-${u}` : u, x = typeof p == "object" ? n(p, $) : { [$]: p };
558
+ return { ...s, ...x };
559
+ }, {}), a = v(() => {
560
+ const t = c.shades, r = c.getName, s = n(t);
561
+ return Object.entries(s).map(([u, p]) => {
562
+ const $ = r ? r(u, p) : u;
422
563
  return {
423
- key: r,
424
- color: d,
425
- name: p
564
+ key: u,
565
+ color: p,
566
+ name: $
426
567
  };
427
568
  });
428
- }), n = y(() => {
429
- let t = o.value;
430
- if (h.search) {
431
- const e = new RegExp(h.search, "i");
432
- t = t.filter(({ name: l }) => e.test(l));
569
+ }), o = v(() => {
570
+ let t = a.value;
571
+ if (c.search) {
572
+ const r = new RegExp(c.search, "i");
573
+ t = t.filter(({ name: s }) => r.test(s));
433
574
  }
434
575
  return t;
435
- }), u = b(null);
436
- return (t, e) => w(n).length ? (i(), m("div", kt, [
437
- (i(!0), m(E, null, L(w(n), (l) => (i(), m("div", {
438
- key: l.key,
576
+ }), e = _(null);
577
+ return (t, r) => d(o).length ? (i(), w("div", At, [
578
+ (i(!0), w(N, null, A(d(o), (s) => (i(), w("div", {
579
+ key: s.key,
439
580
  class: "htw-flex htw-flex-col htw-gap-2",
440
- onMouseenter: (r) => u.value = l.key,
441
- onMouseleave: e[0] || (e[0] = (r) => u.value = null)
581
+ onMouseenter: (u) => e.value = s.key,
582
+ onMouseleave: r[0] || (r[0] = (u) => e.value = null)
442
583
  }, [
443
584
  g(t.$slots, "default", {
444
- color: l.color
585
+ color: s.color
445
586
  }, () => [
446
- c("div", {
587
+ h("div", {
447
588
  class: "htw-rounded-full htw-w-16 htw-h-16",
448
- style: S({
449
- backgroundColor: l.color
589
+ style: V({
590
+ backgroundColor: s.color
450
591
  })
451
592
  }, null, 4)
452
593
  ]),
453
- c("div", null, [
454
- c("div", St, [
455
- V((i(), m("pre", Ht, [
456
- M(k(l.name), 1)
594
+ h("div", null, [
595
+ h("div", Bt, [
596
+ C((i(), w("pre", Lt, [
597
+ H(k(s.name), 1)
457
598
  ])), [
458
- [w(N), l.name.length > 23 ? l.name : ""]
599
+ [d(O), s.name.length > 23 ? s.name : ""]
459
600
  ]),
460
- u.value === l.key ? (i(), f(T, {
601
+ e.value === s.key ? (i(), f(z, {
461
602
  key: 0,
462
- content: l.name,
603
+ content: s.name,
463
604
  class: "htw-flex-none"
464
- }, null, 8, ["content"])) : H("", !0)
605
+ }, null, 8, ["content"])) : M("", !0)
465
606
  ]),
466
- c("div", Ct, [
467
- V((i(), m("pre", Mt, [
468
- M(k(l.color), 1)
607
+ h("div", jt, [
608
+ C((i(), w("pre", Dt, [
609
+ H(k(s.color), 1)
469
610
  ])), [
470
- [w(N), l.color.length > 23 ? l.color : ""]
611
+ [d(O), s.color.length > 23 ? s.color : ""]
471
612
  ]),
472
- u.value === l.key ? (i(), f(T, {
613
+ e.value === s.key ? (i(), f(z, {
473
614
  key: 0,
474
- content: l.color,
615
+ content: s.color,
475
616
  class: "htw-flex-none"
476
- }, null, 8, ["content"])) : H("", !0)
617
+ }, null, 8, ["content"])) : M("", !0)
477
618
  ])
478
619
  ])
479
- ], 40, Vt))), 128))
480
- ])) : H("", !0);
620
+ ], 40, Et))), 128))
621
+ ])) : M("", !0);
481
622
  }
482
- }), zt = ["onMouseenter"], Et = { class: "htw-mx-4" }, Ot = { class: "htw-flex htw-gap-1" }, Lt = { class: "htw-my-0 htw-truncate htw-shrink" }, At = { class: "htw-flex htw-gap-1" }, jt = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" }, Dt = {
623
+ }), It = ["onMouseenter"], Ut = { class: "htw-mx-4" }, Ft = { class: "htw-flex htw-gap-1" }, Rt = { class: "htw-my-0 htw-truncate htw-shrink" }, Pt = { class: "htw-flex htw-gap-1" }, Wt = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" }, Xt = {
483
624
  name: "HstTokenList"
484
- }, Bt = /* @__PURE__ */ _({
485
- ...Dt,
625
+ }, Jt = /* @__PURE__ */ y({
626
+ ...Xt,
486
627
  props: {
487
628
  tokens: null,
488
629
  getName: null
489
630
  },
490
- setup(s) {
491
- const h = s, a = y(() => {
492
- const n = h.tokens, u = h.getName;
493
- return Object.entries(n).map(([t, e]) => {
494
- const l = u ? u(t, e) : t;
631
+ setup(l) {
632
+ const c = l, n = v(() => {
633
+ const o = c.tokens, e = c.getName;
634
+ return Object.entries(o).map(([t, r]) => {
635
+ const s = e ? e(t, r) : t;
495
636
  return {
496
637
  key: t,
497
- name: l,
498
- value: typeof e == "number" ? e.toString() : e
638
+ name: s,
639
+ value: typeof r == "number" ? r.toString() : r
499
640
  };
500
641
  });
501
- }), o = b(null);
502
- return (n, u) => (i(!0), m(E, null, L(w(a), (t) => (i(), m("div", {
642
+ }), a = _(null);
643
+ return (o, e) => (i(!0), w(N, null, A(d(n), (t) => (i(), w("div", {
503
644
  key: t.key,
504
645
  class: "htw-flex htw-flex-col htw-gap-2 htw-my-8",
505
- onMouseenter: (e) => o.value = t.key,
506
- onMouseleave: u[0] || (u[0] = (e) => o.value = null)
646
+ onMouseenter: (r) => a.value = t.key,
647
+ onMouseleave: e[0] || (e[0] = (r) => a.value = null)
507
648
  }, [
508
- g(n.$slots, "default", { token: t }),
509
- c("div", Et, [
510
- c("div", Ot, [
511
- c("pre", Lt, k(t.name), 1),
512
- o.value === t.key ? (i(), f(T, {
649
+ g(o.$slots, "default", { token: t }),
650
+ h("div", Ut, [
651
+ h("div", Ft, [
652
+ h("pre", Rt, k(t.name), 1),
653
+ a.value === t.key ? (i(), f(z, {
513
654
  key: 0,
514
655
  content: t.name,
515
656
  class: "htw-flex-none"
516
- }, null, 8, ["content"])) : H("", !0)
657
+ }, null, 8, ["content"])) : M("", !0)
517
658
  ]),
518
- c("div", At, [
519
- c("pre", jt, k(t.value), 1),
520
- o.value === t.key ? (i(), f(T, {
659
+ h("div", Pt, [
660
+ h("pre", Wt, k(t.value), 1),
661
+ a.value === t.key ? (i(), f(z, {
521
662
  key: 0,
522
663
  content: typeof t.value == "string" ? t.value : JSON.stringify(t.value),
523
664
  class: "htw-flex-none"
524
- }, null, 8, ["content"])) : H("", !0)
665
+ }, null, 8, ["content"])) : M("", !0)
525
666
  ])
526
667
  ])
527
- ], 40, zt))), 128));
668
+ ], 40, It))), 128));
528
669
  }
529
670
  });
530
- const It = ["onMouseenter"], Ut = { class: "htw-flex htw-gap-1" }, Ft = { class: "htw-my-0 htw-truncate htw-shrink" }, Kt = { class: "htw-flex htw-gap-1" }, Rt = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" }, Gt = {
671
+ const qt = ["onMouseenter"], Qt = { class: "htw-flex htw-gap-1" }, Yt = { class: "htw-my-0 htw-truncate htw-shrink" }, Zt = { class: "htw-flex htw-gap-1" }, te = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" }, ee = {
531
672
  name: "HstTokenGrid"
532
- }, Pt = /* @__PURE__ */ _({
533
- ...Gt,
673
+ }, le = /* @__PURE__ */ y({
674
+ ...ee,
534
675
  props: {
535
676
  tokens: null,
536
677
  colSize: { default: 180 },
537
678
  getName: { type: Function, default: null }
538
679
  },
539
- setup(s) {
540
- const h = s, a = y(() => {
541
- const u = h.tokens, t = h.getName;
542
- return Object.entries(u).map(([e, l]) => {
543
- const r = t ? t(e, l) : e;
680
+ setup(l) {
681
+ const c = l, n = v(() => {
682
+ const e = c.tokens, t = c.getName;
683
+ return Object.entries(e).map(([r, s]) => {
684
+ const u = t ? t(r, s) : r;
544
685
  return {
545
- key: e,
546
- name: r,
547
- value: typeof l == "number" ? l.toString() : l
686
+ key: r,
687
+ name: u,
688
+ value: typeof s == "number" ? s.toString() : s
548
689
  };
549
690
  });
550
- }), o = y(() => `${h.colSize}px`), n = b(null);
551
- return (u, t) => (i(), m("div", {
691
+ }), a = v(() => `${c.colSize}px`), o = _(null);
692
+ return (e, t) => (i(), w("div", {
552
693
  class: "htw-bind-col-size htw-grid htw-gap-4 htw-m-4",
553
- style: S({
554
- "--histoire-col-size": w(o)
694
+ style: V({
695
+ "--histoire-col-size": d(a)
555
696
  })
556
697
  }, [
557
- (i(!0), m(E, null, L(w(a), (e) => (i(), m("div", {
558
- key: e.key,
698
+ (i(!0), w(N, null, A(d(n), (r) => (i(), w("div", {
699
+ key: r.key,
559
700
  class: "htw-flex htw-flex-col htw-gap-2",
560
- onMouseenter: (l) => n.value = e.key,
561
- onMouseleave: t[0] || (t[0] = (l) => n.value = null)
701
+ onMouseenter: (s) => o.value = r.key,
702
+ onMouseleave: t[0] || (t[0] = (s) => o.value = null)
562
703
  }, [
563
- g(u.$slots, "default", { token: e }),
564
- c("div", null, [
565
- c("div", Ut, [
566
- V((i(), m("pre", Ft, [
567
- M(k(e.name), 1)
704
+ g(e.$slots, "default", { token: r }),
705
+ h("div", null, [
706
+ h("div", Qt, [
707
+ C((i(), w("pre", Yt, [
708
+ H(k(r.name), 1)
568
709
  ])), [
569
- [w(N), e.name.length > s.colSize / 8 ? e.name : ""]
710
+ [d(O), r.name.length > l.colSize / 8 ? r.name : ""]
570
711
  ]),
571
- n.value === e.key ? (i(), f(T, {
712
+ o.value === r.key ? (i(), f(z, {
572
713
  key: 0,
573
- content: e.name,
714
+ content: r.name,
574
715
  class: "htw-flex-none"
575
- }, null, 8, ["content"])) : H("", !0)
716
+ }, null, 8, ["content"])) : M("", !0)
576
717
  ]),
577
- c("div", Kt, [
578
- V((i(), m("pre", Rt, [
579
- M(k(e.value), 1)
718
+ h("div", Zt, [
719
+ C((i(), w("pre", te, [
720
+ H(k(r.value), 1)
580
721
  ])), [
581
- [w(N), e.value.length > s.colSize / 8 ? e.value : ""]
722
+ [d(O), r.value.length > l.colSize / 8 ? r.value : ""]
582
723
  ]),
583
- n.value === e.key ? (i(), f(T, {
724
+ o.value === r.key ? (i(), f(z, {
584
725
  key: 0,
585
- content: typeof e.value == "string" ? e.value : JSON.stringify(e.value),
726
+ content: typeof r.value == "string" ? r.value : JSON.stringify(r.value),
586
727
  class: "htw-flex-none"
587
- }, null, 8, ["content"])) : H("", !0)
728
+ }, null, 8, ["content"])) : M("", !0)
588
729
  ])
589
730
  ])
590
- ], 40, It))), 128))
731
+ ], 40, qt))), 128))
591
732
  ], 4));
592
733
  }
593
- }), Wt = { class: "-htw-my-1" }, Xt = ["id", "name", "value", "checked", "onChange"], Jt = ["for", "onKeydown"], qt = {
734
+ }), ne = { class: "-htw-my-1" }, se = ["id", "name", "value", "checked", "onChange"], oe = ["for", "onKeydown"], re = {
594
735
  name: "HstRadio"
595
- }, Qt = /* @__PURE__ */ _({
596
- ...qt,
736
+ }, ae = /* @__PURE__ */ y({
737
+ ...re,
597
738
  props: {
598
739
  title: null,
599
740
  modelValue: null,
600
741
  options: null
601
742
  },
602
743
  emits: ["update:modelValue"],
603
- setup(s, { emit: h }) {
604
- const a = s, o = y(() => Array.isArray(a.options) ? Object.fromEntries(a.options.map((t) => typeof t == "string" ? [t, t] : [t.value, t.label])) : a.options);
605
- function n(t) {
606
- h("update:modelValue", t), u.value = !0;
744
+ setup(l, { emit: c }) {
745
+ const n = l, a = v(() => Array.isArray(n.options) ? Object.fromEntries(n.options.map((t) => typeof t == "string" ? [t, t] : [t.value, t.label])) : n.options);
746
+ function o(t) {
747
+ c("update:modelValue", t), e.value = !0;
607
748
  }
608
- const u = b(!1);
609
- return (t, e) => (i(), f(z, {
749
+ const e = _(!1);
750
+ return (t, r) => (i(), f(S, {
610
751
  role: "group",
611
- title: s.title,
612
- class: x(["htw-cursor-text", t.$attrs.class]),
613
- style: S(t.$attrs.style)
752
+ title: l.title,
753
+ class: b(["htw-cursor-text", t.$attrs.class]),
754
+ style: V(t.$attrs.style)
614
755
  }, {
615
- actions: v(() => [
756
+ actions: m(() => [
616
757
  g(t.$slots, "actions")
617
758
  ]),
618
- default: v(() => [
619
- c("div", Wt, [
620
- (i(!0), m(E, null, L(w(o), (l, r) => (i(), m(E, { key: r }, [
621
- c("input", {
622
- id: `${r}-radio`,
759
+ default: m(() => [
760
+ h("div", ne, [
761
+ (i(!0), w(N, null, A(d(a), (s, u) => (i(), w(N, { key: u }, [
762
+ h("input", {
763
+ id: `${u}-radio`,
623
764
  type: "radio",
624
- name: `${r}-radio`,
625
- value: r,
626
- checked: r === s.modelValue,
765
+ name: `${u}-radio`,
766
+ value: u,
767
+ checked: u === l.modelValue,
627
768
  class: "htw-hidden",
628
- onChange: (d) => n(r)
629
- }, null, 40, Xt),
630
- c("label", {
769
+ onChange: (p) => o(u)
770
+ }, null, 40, se),
771
+ h("label", {
631
772
  tabindex: "0",
632
- for: `${r}-radio`,
773
+ for: `${u}-radio`,
633
774
  class: "htw-cursor-pointer htw-flex htw-items-center htw-relative htw-py-1 htw-group",
634
775
  onKeydown: [
635
- A(j((d) => n(r), ["prevent"]), ["enter"]),
636
- A(j((d) => n(r), ["prevent"]), ["space"])
776
+ E(B((p) => o(u), ["prevent"]), ["enter"]),
777
+ E(B((p) => o(u), ["prevent"]), ["space"])
637
778
  ]
638
779
  }, [
639
- (i(), m("svg", {
780
+ (i(), w("svg", {
640
781
  width: "16",
641
782
  height: "16",
642
783
  viewBox: "-12 -12 24 24",
643
- class: x(["htw-relative htw-z-10 htw-border htw-border-solid htw-text-inherit htw-rounded-full htw-box-border htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out htw-mr-2 group-hover:htw-border-primary-500", [
644
- s.modelValue === r ? "htw-border-primary-500" : "htw-border-black/25 dark:htw-border-white/25"
784
+ class: b(["htw-relative htw-z-10 htw-border htw-border-solid htw-text-inherit htw-rounded-full htw-box-border htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out htw-mr-2 group-hover:htw-border-primary-500", [
785
+ l.modelValue === u ? "htw-border-primary-500" : "htw-border-black/25 dark:htw-border-white/25"
645
786
  ]])
646
787
  }, [
647
- c("circle", {
788
+ h("circle", {
648
789
  r: "7",
649
- class: x(["htw-will-change-transform", [
650
- u.value ? "htw-transition-all" : "htw-transition-none",
790
+ class: b(["htw-will-change-transform", [
791
+ e.value ? "htw-transition-all" : "htw-transition-none",
651
792
  {
652
- "htw-delay-150": s.modelValue === r
793
+ "htw-delay-150": l.modelValue === u
653
794
  },
654
- s.modelValue === r ? "htw-fill-primary-500" : "htw-fill-transparent htw-scale-0"
795
+ l.modelValue === u ? "htw-fill-primary-500" : "htw-fill-transparent htw-scale-0"
655
796
  ]])
656
797
  }, null, 2)
657
798
  ], 2)),
658
- M(" " + k(l), 1)
659
- ], 40, Jt)
799
+ H(" " + k(s), 1)
800
+ ], 40, oe)
660
801
  ], 64))), 128))
661
802
  ])
662
803
  ]),
663
804
  _: 3
664
805
  }, 8, ["title", "class", "style"]));
665
806
  }
666
- }), Yt = st, Zt = ot, te = at, ee = ct, se = mt, le = gt, ne = Tt, oe = Bt, re = Pt, ae = T, ue = Qt, we = {
667
- HstCheckbox: Yt,
668
- HstText: Zt,
669
- HstNumber: te,
670
- HstSlider: ee,
671
- HstTextarea: se,
672
- HstSelect: le,
673
- HstColorShades: ne,
674
- HstTokenList: oe,
675
- HstTokenGrid: re,
676
- HstCopyIcon: ae,
677
- HstRadio: ue
807
+ }), ue = U, ie = nt, ce = ut, he = dt, de = mt, we = yt, pe = _t, me = kt, fe = Ot, ye = Gt, ve = Jt, ge = le, be = z, _e = ae, Ce = {
808
+ HstButton: ue,
809
+ HstButtonGroup: ie,
810
+ HstCheckbox: ce,
811
+ HstCheckboxList: he,
812
+ HstText: de,
813
+ HstNumber: we,
814
+ HstSlider: pe,
815
+ HstTextarea: me,
816
+ HstSelect: fe,
817
+ HstColorShades: ye,
818
+ HstTokenList: ve,
819
+ HstTokenGrid: ge,
820
+ HstCopyIcon: be,
821
+ HstRadio: _e
678
822
  };
679
823
  export {
680
- Yt as HstCheckbox,
681
- ne as HstColorShades,
682
- ae as HstCopyIcon,
683
- te as HstNumber,
684
- ue as HstRadio,
685
- le as HstSelect,
686
- ee as HstSlider,
687
- Zt as HstText,
688
- se as HstTextarea,
689
- re as HstTokenGrid,
690
- oe as HstTokenList,
691
- we as components
824
+ ue as HstButton,
825
+ ie as HstButtonGroup,
826
+ ce as HstCheckbox,
827
+ he as HstCheckboxList,
828
+ ye as HstColorShades,
829
+ be as HstCopyIcon,
830
+ we as HstNumber,
831
+ _e as HstRadio,
832
+ fe as HstSelect,
833
+ pe as HstSlider,
834
+ de as HstText,
835
+ me as HstTextarea,
836
+ ge as HstTokenGrid,
837
+ ve as HstTokenList,
838
+ Ce as components
692
839
  };