@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.
- package/dist/components/HstWrapper.vue.d.ts +16 -3
- package/dist/components/button/HstButton.story.vue.d.ts +2 -0
- package/dist/components/button/HstButton.vue.d.ts +15 -0
- package/dist/components/button/HstButtonGroup.story.vue.d.ts +2 -0
- package/dist/components/button/HstButtonGroup.vue.d.ts +24 -0
- package/dist/components/checkbox/HstCheckboxList.story.vue.d.ts +2 -0
- package/dist/components/checkbox/HstCheckboxList.vue.d.ts +24 -0
- package/dist/components/checkbox/HstSimpleCheckbox.story.vue.d.ts +2 -0
- package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +21 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.es.js +543 -396
- package/dist/style-standalone.css +102 -23
- package/package.json +2 -2
- package/src/components/HstWrapper.vue +12 -4
- package/src/components/button/HstButton.story.vue +30 -0
- package/src/components/button/HstButton.vue +26 -0
- package/src/components/button/HstButtonGroup.story.vue +51 -0
- package/src/components/button/HstButtonGroup.vue +64 -0
- package/src/components/checkbox/HstCheckbox.story.vue +5 -1
- package/src/components/checkbox/HstCheckbox.vue +4 -50
- package/src/components/checkbox/HstCheckboxList.story.vue +49 -0
- package/src/components/checkbox/HstCheckboxList.vue +79 -0
- package/src/components/checkbox/HstSimpleCheckbox.story.vue +28 -0
- package/src/components/checkbox/HstSimpleCheckbox.vue +82 -0
- package/src/components/checkbox/__snapshots__/HstCheckbox.test.ts.snap +6 -6
- package/src/components/design-tokens/HstColorShades.story.vue +2 -1
- package/src/components/design-tokens/HstTokenGrid.story.vue +2 -1
- package/src/components/design-tokens/HstTokenList.story.vue +2 -1
- package/src/components/number/HstNumber.story.vue +1 -0
- package/src/components/number/HstNumber.vue +1 -2
- package/src/components/radio/HstRadio.story.vue +5 -1
- package/src/components/select/HstSelect.story.vue +1 -0
- package/src/components/slider/HstSlider.story.vue +2 -0
- package/src/components/text/HstText.story.vue +1 -0
- package/src/components/textarea/HstTextarea.story.vue +4 -1
- package/src/index.ts +9 -0
package/dist/index.es.js
CHANGED
|
@@ -1,199 +1,340 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VTooltip as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { useClipboard as
|
|
5
|
-
const
|
|
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
|
-
},
|
|
8
|
-
...
|
|
29
|
+
}, S = /* @__PURE__ */ y({
|
|
30
|
+
...tt,
|
|
9
31
|
props: {
|
|
10
|
-
title: null
|
|
32
|
+
title: null,
|
|
33
|
+
tag: { default: "label" }
|
|
11
34
|
},
|
|
12
|
-
setup(
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
39
|
-
...
|
|
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": (
|
|
164
|
+
"update:modelValue": (l) => !0
|
|
46
165
|
},
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
-
function
|
|
50
|
-
|
|
166
|
+
setup(l, { emit: c }) {
|
|
167
|
+
const n = l;
|
|
168
|
+
function a() {
|
|
169
|
+
c("update:modelValue", !n.modelValue);
|
|
51
170
|
}
|
|
52
|
-
|
|
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:
|
|
61
|
-
onClick:
|
|
175
|
+
title: l.title,
|
|
176
|
+
onClick: e[0] || (e[0] = (t) => a()),
|
|
62
177
|
onKeydown: [
|
|
63
|
-
|
|
64
|
-
|
|
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:
|
|
68
|
-
g(
|
|
182
|
+
actions: m(() => [
|
|
183
|
+
g(o.$slots, "actions")
|
|
69
184
|
]),
|
|
70
|
-
default:
|
|
71
|
-
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
101
|
-
...
|
|
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": (
|
|
248
|
+
"update:modelValue": (l) => !0
|
|
108
249
|
},
|
|
109
|
-
setup(
|
|
110
|
-
const
|
|
111
|
-
return (
|
|
112
|
-
title:
|
|
113
|
-
class:
|
|
114
|
-
style:
|
|
115
|
-
onClick:
|
|
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:
|
|
118
|
-
g(
|
|
258
|
+
actions: m(() => [
|
|
259
|
+
g(a.$slots, "actions")
|
|
119
260
|
]),
|
|
120
|
-
default:
|
|
121
|
-
|
|
261
|
+
default: m(() => [
|
|
262
|
+
h("input", L({
|
|
122
263
|
ref_key: "input",
|
|
123
|
-
ref:
|
|
124
|
-
}, { ...
|
|
264
|
+
ref: n
|
|
265
|
+
}, { ...a.$attrs, class: null, style: null }, {
|
|
125
266
|
type: "text",
|
|
126
|
-
value:
|
|
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:
|
|
129
|
-
}), null, 16,
|
|
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
|
-
}),
|
|
275
|
+
}), ft = {
|
|
135
276
|
name: "HstNumber",
|
|
136
277
|
inheritAttrs: !1
|
|
137
|
-
},
|
|
138
|
-
...
|
|
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": (
|
|
285
|
+
"update:modelValue": (l) => !0
|
|
145
286
|
},
|
|
146
|
-
setup(
|
|
147
|
-
const
|
|
148
|
-
get: () =>
|
|
149
|
-
set: (
|
|
150
|
-
|
|
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
|
-
}),
|
|
153
|
-
function
|
|
154
|
-
|
|
293
|
+
}), o = _();
|
|
294
|
+
function e() {
|
|
295
|
+
o.value.focus(), o.value.select();
|
|
155
296
|
}
|
|
156
|
-
const t =
|
|
157
|
-
let
|
|
158
|
-
function
|
|
159
|
-
t.value = !0,
|
|
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
|
|
162
|
-
let
|
|
163
|
-
isNaN(
|
|
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
|
|
166
|
-
t.value = !1, window.removeEventListener("mousemove",
|
|
306
|
+
function $() {
|
|
307
|
+
t.value = !1, window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", $);
|
|
167
308
|
}
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
}), (
|
|
171
|
-
class:
|
|
172
|
-
|
|
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:
|
|
176
|
-
style:
|
|
177
|
-
onClick:
|
|
178
|
-
onMousedown:
|
|
316
|
+
title: l.title,
|
|
317
|
+
style: V(x.$attrs.style),
|
|
318
|
+
onClick: e,
|
|
319
|
+
onMousedown: u
|
|
179
320
|
}, {
|
|
180
|
-
actions:
|
|
181
|
-
g(
|
|
321
|
+
actions: m(() => [
|
|
322
|
+
g(x.$slots, "actions")
|
|
182
323
|
]),
|
|
183
|
-
default:
|
|
184
|
-
|
|
324
|
+
default: m(() => [
|
|
325
|
+
C(h("input", L({
|
|
185
326
|
ref_key: "input",
|
|
186
|
-
ref:
|
|
187
|
-
}, {
|
|
188
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
196
|
-
|
|
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
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
], -1),
|
|
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
|
-
},
|
|
212
|
-
...
|
|
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": (
|
|
361
|
+
"update:modelValue": (l) => !0
|
|
221
362
|
},
|
|
222
|
-
setup(
|
|
223
|
-
const
|
|
224
|
-
get: () =>
|
|
225
|
-
set: (
|
|
226
|
-
|
|
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 =
|
|
229
|
-
left: 8 + (
|
|
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 (
|
|
232
|
-
class:
|
|
233
|
-
title:
|
|
234
|
-
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:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
377
|
+
default: m(() => [
|
|
378
|
+
h("div", vt, [
|
|
379
|
+
gt,
|
|
380
|
+
C(h("input", L({
|
|
240
381
|
ref_key: "input",
|
|
241
|
-
ref:
|
|
242
|
-
"onUpdate:modelValue":
|
|
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
|
-
}, { ...
|
|
246
|
-
onMouseover:
|
|
247
|
-
onMouseleave:
|
|
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
|
-
|
|
251
|
-
|
|
391
|
+
G,
|
|
392
|
+
d(e),
|
|
252
393
|
void 0,
|
|
253
394
|
{ number: !0 }
|
|
254
395
|
]
|
|
255
396
|
]),
|
|
256
|
-
|
|
397
|
+
a.value ? C((i(), w("div", {
|
|
257
398
|
key: 0,
|
|
258
399
|
class: "htw-absolute",
|
|
259
|
-
style:
|
|
400
|
+
style: V(d(r))
|
|
260
401
|
}, null, 4)), [
|
|
261
|
-
[
|
|
262
|
-
]) :
|
|
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
|
-
}),
|
|
409
|
+
}), $t = ["value"], xt = {
|
|
269
410
|
name: "HstTextarea",
|
|
270
411
|
inheritAttrs: !1
|
|
271
|
-
},
|
|
272
|
-
...
|
|
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": (
|
|
419
|
+
"update:modelValue": (l) => !0
|
|
279
420
|
},
|
|
280
|
-
setup(
|
|
281
|
-
const
|
|
282
|
-
return (
|
|
283
|
-
title:
|
|
284
|
-
class:
|
|
285
|
-
style:
|
|
286
|
-
onClick:
|
|
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:
|
|
289
|
-
g(
|
|
429
|
+
actions: m(() => [
|
|
430
|
+
g(a.$slots, "actions")
|
|
290
431
|
]),
|
|
291
|
-
default:
|
|
292
|
-
|
|
432
|
+
default: m(() => [
|
|
433
|
+
h("textarea", L({
|
|
293
434
|
ref_key: "input",
|
|
294
|
-
ref:
|
|
295
|
-
}, { ...
|
|
296
|
-
value:
|
|
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:
|
|
299
|
-
}), null, 16,
|
|
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
|
|
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
|
-
},
|
|
308
|
-
...
|
|
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(
|
|
315
|
-
const
|
|
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 =
|
|
458
|
+
return (t = a.value.find(([r]) => r === n.modelValue)) == null ? void 0 : t[1];
|
|
318
459
|
});
|
|
319
|
-
function
|
|
320
|
-
|
|
460
|
+
function e(t, r) {
|
|
461
|
+
c("update:modelValue", t), r();
|
|
321
462
|
}
|
|
322
|
-
return (t,
|
|
323
|
-
popper:
|
|
324
|
-
|
|
325
|
-
(i(!0),
|
|
326
|
-
key:
|
|
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":
|
|
469
|
+
"htw-bg-primary-200 dark:htw-bg-primary-800": n.modelValue === u
|
|
329
470
|
}],
|
|
330
|
-
onClick: (
|
|
331
|
-
}), k(
|
|
471
|
+
onClick: ($) => e(u, s)
|
|
472
|
+
}), k(p), 17, St))), 128))
|
|
332
473
|
])
|
|
333
474
|
]),
|
|
334
|
-
default:
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
g(t.$slots, "default", { label:
|
|
338
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
491
|
+
}), Tt = {
|
|
351
492
|
name: "HstSelect"
|
|
352
|
-
},
|
|
353
|
-
|
|
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(
|
|
361
|
-
return (
|
|
362
|
-
title:
|
|
363
|
-
class:
|
|
364
|
-
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:
|
|
367
|
-
g(
|
|
507
|
+
actions: m(() => [
|
|
508
|
+
g(n.$slots, "actions")
|
|
368
509
|
]),
|
|
369
|
-
default:
|
|
370
|
-
|
|
371
|
-
options:
|
|
372
|
-
"model-value":
|
|
373
|
-
"onUpdate:modelValue":
|
|
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
|
-
}),
|
|
520
|
+
}), zt = {
|
|
380
521
|
name: "HstCopyIcon"
|
|
381
|
-
},
|
|
382
|
-
...
|
|
522
|
+
}, z = /* @__PURE__ */ y({
|
|
523
|
+
...zt,
|
|
383
524
|
props: {
|
|
384
525
|
content: null
|
|
385
526
|
},
|
|
386
|
-
setup(
|
|
387
|
-
const
|
|
388
|
-
return (
|
|
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] = (
|
|
532
|
+
onClick: t[0] || (t[0] = (r) => o())
|
|
392
533
|
}, null, 512)), [
|
|
393
|
-
[
|
|
534
|
+
[d(O), {
|
|
394
535
|
content: "Copied!",
|
|
395
536
|
triggers: [],
|
|
396
|
-
shown:
|
|
537
|
+
shown: d(a),
|
|
397
538
|
distance: 12,
|
|
398
539
|
delay: 0
|
|
399
540
|
}]
|
|
400
541
|
]);
|
|
401
542
|
}
|
|
402
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
408
|
-
...
|
|
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(
|
|
415
|
-
const
|
|
416
|
-
const
|
|
417
|
-
return { ...
|
|
418
|
-
}, {}),
|
|
419
|
-
const t =
|
|
420
|
-
return Object.entries(
|
|
421
|
-
const
|
|
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:
|
|
424
|
-
color:
|
|
425
|
-
name:
|
|
564
|
+
key: u,
|
|
565
|
+
color: p,
|
|
566
|
+
name: $
|
|
426
567
|
};
|
|
427
568
|
});
|
|
428
|
-
}),
|
|
429
|
-
let t =
|
|
430
|
-
if (
|
|
431
|
-
const
|
|
432
|
-
t = t.filter(({ name:
|
|
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
|
-
}),
|
|
436
|
-
return (t,
|
|
437
|
-
(i(!0),
|
|
438
|
-
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: (
|
|
441
|
-
onMouseleave:
|
|
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:
|
|
585
|
+
color: s.color
|
|
445
586
|
}, () => [
|
|
446
|
-
|
|
587
|
+
h("div", {
|
|
447
588
|
class: "htw-rounded-full htw-w-16 htw-h-16",
|
|
448
|
-
style:
|
|
449
|
-
backgroundColor:
|
|
589
|
+
style: V({
|
|
590
|
+
backgroundColor: s.color
|
|
450
591
|
})
|
|
451
592
|
}, null, 4)
|
|
452
593
|
]),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
594
|
+
h("div", null, [
|
|
595
|
+
h("div", Bt, [
|
|
596
|
+
C((i(), w("pre", Lt, [
|
|
597
|
+
H(k(s.name), 1)
|
|
457
598
|
])), [
|
|
458
|
-
[
|
|
599
|
+
[d(O), s.name.length > 23 ? s.name : ""]
|
|
459
600
|
]),
|
|
460
|
-
|
|
601
|
+
e.value === s.key ? (i(), f(z, {
|
|
461
602
|
key: 0,
|
|
462
|
-
content:
|
|
603
|
+
content: s.name,
|
|
463
604
|
class: "htw-flex-none"
|
|
464
|
-
}, null, 8, ["content"])) :
|
|
605
|
+
}, null, 8, ["content"])) : M("", !0)
|
|
465
606
|
]),
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
607
|
+
h("div", jt, [
|
|
608
|
+
C((i(), w("pre", Dt, [
|
|
609
|
+
H(k(s.color), 1)
|
|
469
610
|
])), [
|
|
470
|
-
[
|
|
611
|
+
[d(O), s.color.length > 23 ? s.color : ""]
|
|
471
612
|
]),
|
|
472
|
-
|
|
613
|
+
e.value === s.key ? (i(), f(z, {
|
|
473
614
|
key: 0,
|
|
474
|
-
content:
|
|
615
|
+
content: s.color,
|
|
475
616
|
class: "htw-flex-none"
|
|
476
|
-
}, null, 8, ["content"])) :
|
|
617
|
+
}, null, 8, ["content"])) : M("", !0)
|
|
477
618
|
])
|
|
478
619
|
])
|
|
479
|
-
], 40,
|
|
480
|
-
])) :
|
|
620
|
+
], 40, Et))), 128))
|
|
621
|
+
])) : M("", !0);
|
|
481
622
|
}
|
|
482
|
-
}),
|
|
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
|
-
},
|
|
485
|
-
...
|
|
625
|
+
}, Jt = /* @__PURE__ */ y({
|
|
626
|
+
...Xt,
|
|
486
627
|
props: {
|
|
487
628
|
tokens: null,
|
|
488
629
|
getName: null
|
|
489
630
|
},
|
|
490
|
-
setup(
|
|
491
|
-
const
|
|
492
|
-
const
|
|
493
|
-
return Object.entries(
|
|
494
|
-
const
|
|
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:
|
|
498
|
-
value: typeof
|
|
638
|
+
name: s,
|
|
639
|
+
value: typeof r == "number" ? r.toString() : r
|
|
499
640
|
};
|
|
500
641
|
});
|
|
501
|
-
}),
|
|
502
|
-
return (
|
|
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: (
|
|
506
|
-
onMouseleave:
|
|
646
|
+
onMouseenter: (r) => a.value = t.key,
|
|
647
|
+
onMouseleave: e[0] || (e[0] = (r) => a.value = null)
|
|
507
648
|
}, [
|
|
508
|
-
g(
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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"])) :
|
|
657
|
+
}, null, 8, ["content"])) : M("", !0)
|
|
517
658
|
]),
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
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"])) :
|
|
665
|
+
}, null, 8, ["content"])) : M("", !0)
|
|
525
666
|
])
|
|
526
667
|
])
|
|
527
|
-
], 40,
|
|
668
|
+
], 40, It))), 128));
|
|
528
669
|
}
|
|
529
670
|
});
|
|
530
|
-
const
|
|
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
|
-
},
|
|
533
|
-
...
|
|
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(
|
|
540
|
-
const
|
|
541
|
-
const
|
|
542
|
-
return Object.entries(
|
|
543
|
-
const
|
|
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:
|
|
546
|
-
name:
|
|
547
|
-
value: typeof
|
|
686
|
+
key: r,
|
|
687
|
+
name: u,
|
|
688
|
+
value: typeof s == "number" ? s.toString() : s
|
|
548
689
|
};
|
|
549
690
|
});
|
|
550
|
-
}),
|
|
551
|
-
return (
|
|
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:
|
|
554
|
-
"--histoire-col-size":
|
|
694
|
+
style: V({
|
|
695
|
+
"--histoire-col-size": d(a)
|
|
555
696
|
})
|
|
556
697
|
}, [
|
|
557
|
-
(i(!0),
|
|
558
|
-
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: (
|
|
561
|
-
onMouseleave: t[0] || (t[0] = (
|
|
701
|
+
onMouseenter: (s) => o.value = r.key,
|
|
702
|
+
onMouseleave: t[0] || (t[0] = (s) => o.value = null)
|
|
562
703
|
}, [
|
|
563
|
-
g(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
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
|
-
[
|
|
710
|
+
[d(O), r.name.length > l.colSize / 8 ? r.name : ""]
|
|
570
711
|
]),
|
|
571
|
-
|
|
712
|
+
o.value === r.key ? (i(), f(z, {
|
|
572
713
|
key: 0,
|
|
573
|
-
content:
|
|
714
|
+
content: r.name,
|
|
574
715
|
class: "htw-flex-none"
|
|
575
|
-
}, null, 8, ["content"])) :
|
|
716
|
+
}, null, 8, ["content"])) : M("", !0)
|
|
576
717
|
]),
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
718
|
+
h("div", Zt, [
|
|
719
|
+
C((i(), w("pre", te, [
|
|
720
|
+
H(k(r.value), 1)
|
|
580
721
|
])), [
|
|
581
|
-
[
|
|
722
|
+
[d(O), r.value.length > l.colSize / 8 ? r.value : ""]
|
|
582
723
|
]),
|
|
583
|
-
|
|
724
|
+
o.value === r.key ? (i(), f(z, {
|
|
584
725
|
key: 0,
|
|
585
|
-
content: typeof
|
|
726
|
+
content: typeof r.value == "string" ? r.value : JSON.stringify(r.value),
|
|
586
727
|
class: "htw-flex-none"
|
|
587
|
-
}, null, 8, ["content"])) :
|
|
728
|
+
}, null, 8, ["content"])) : M("", !0)
|
|
588
729
|
])
|
|
589
730
|
])
|
|
590
|
-
], 40,
|
|
731
|
+
], 40, qt))), 128))
|
|
591
732
|
], 4));
|
|
592
733
|
}
|
|
593
|
-
}),
|
|
734
|
+
}), ne = { class: "-htw-my-1" }, se = ["id", "name", "value", "checked", "onChange"], oe = ["for", "onKeydown"], re = {
|
|
594
735
|
name: "HstRadio"
|
|
595
|
-
},
|
|
596
|
-
...
|
|
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(
|
|
604
|
-
const
|
|
605
|
-
function
|
|
606
|
-
|
|
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
|
|
609
|
-
return (t,
|
|
749
|
+
const e = _(!1);
|
|
750
|
+
return (t, r) => (i(), f(S, {
|
|
610
751
|
role: "group",
|
|
611
|
-
title:
|
|
612
|
-
class:
|
|
613
|
-
style:
|
|
752
|
+
title: l.title,
|
|
753
|
+
class: b(["htw-cursor-text", t.$attrs.class]),
|
|
754
|
+
style: V(t.$attrs.style)
|
|
614
755
|
}, {
|
|
615
|
-
actions:
|
|
756
|
+
actions: m(() => [
|
|
616
757
|
g(t.$slots, "actions")
|
|
617
758
|
]),
|
|
618
|
-
default:
|
|
619
|
-
|
|
620
|
-
(i(!0),
|
|
621
|
-
|
|
622
|
-
id: `${
|
|
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: `${
|
|
625
|
-
value:
|
|
626
|
-
checked:
|
|
765
|
+
name: `${u}-radio`,
|
|
766
|
+
value: u,
|
|
767
|
+
checked: u === l.modelValue,
|
|
627
768
|
class: "htw-hidden",
|
|
628
|
-
onChange: (
|
|
629
|
-
}, null, 40,
|
|
630
|
-
|
|
769
|
+
onChange: (p) => o(u)
|
|
770
|
+
}, null, 40, se),
|
|
771
|
+
h("label", {
|
|
631
772
|
tabindex: "0",
|
|
632
|
-
for: `${
|
|
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
|
-
|
|
636
|
-
|
|
776
|
+
E(B((p) => o(u), ["prevent"]), ["enter"]),
|
|
777
|
+
E(B((p) => o(u), ["prevent"]), ["space"])
|
|
637
778
|
]
|
|
638
779
|
}, [
|
|
639
|
-
(i(),
|
|
780
|
+
(i(), w("svg", {
|
|
640
781
|
width: "16",
|
|
641
782
|
height: "16",
|
|
642
783
|
viewBox: "-12 -12 24 24",
|
|
643
|
-
class:
|
|
644
|
-
|
|
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
|
-
|
|
788
|
+
h("circle", {
|
|
648
789
|
r: "7",
|
|
649
|
-
class:
|
|
650
|
-
|
|
790
|
+
class: b(["htw-will-change-transform", [
|
|
791
|
+
e.value ? "htw-transition-all" : "htw-transition-none",
|
|
651
792
|
{
|
|
652
|
-
"htw-delay-150":
|
|
793
|
+
"htw-delay-150": l.modelValue === u
|
|
653
794
|
},
|
|
654
|
-
|
|
795
|
+
l.modelValue === u ? "htw-fill-primary-500" : "htw-fill-transparent htw-scale-0"
|
|
655
796
|
]])
|
|
656
797
|
}, null, 2)
|
|
657
798
|
], 2)),
|
|
658
|
-
|
|
659
|
-
], 40,
|
|
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
|
-
}),
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
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
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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
|
};
|