@poveste/controls 0.13.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/{HstJson-Dz6cYiFP.es.js → HstJson-3DiXqRjL.es.js} +1555 -1543
  3. package/dist/components/HstCopyIcon.story.vue.d.ts +2 -1
  4. package/dist/components/HstCopyIcon.vue.d.ts +3 -2
  5. package/dist/components/HstWrapper.vue.d.ts +10 -9
  6. package/dist/components/button/HstButton.story.vue.d.ts +2 -1
  7. package/dist/components/button/HstButton.vue.d.ts +4 -3
  8. package/dist/components/button/HstButtonGroup.story.vue.d.ts +2 -1
  9. package/dist/components/button/HstButtonGroup.vue.d.ts +3 -2
  10. package/dist/components/checkbox/HstCheckbox.story.vue.d.ts +2 -1
  11. package/dist/components/checkbox/HstCheckbox.vue.d.ts +4 -3
  12. package/dist/components/checkbox/HstCheckboxList.story.vue.d.ts +2 -1
  13. package/dist/components/checkbox/HstCheckboxList.vue.d.ts +3 -2
  14. package/dist/components/checkbox/HstSimpleCheckbox.story.vue.d.ts +2 -1
  15. package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +8 -7
  16. package/dist/components/colorselect/HstColorSelect.story.vue.d.ts +2 -1
  17. package/dist/components/colorselect/HstColorSelect.vue.d.ts +4 -3
  18. package/dist/components/design-tokens/HstColorShades.story.vue.d.ts +2 -1
  19. package/dist/components/design-tokens/HstColorShades.vue.d.ts +3 -2
  20. package/dist/components/design-tokens/HstTokenGrid.story.vue.d.ts +2 -1
  21. package/dist/components/design-tokens/HstTokenGrid.vue.d.ts +3 -3
  22. package/dist/components/design-tokens/HstTokenList.story.vue.d.ts +2 -1
  23. package/dist/components/design-tokens/HstTokenList.vue.d.ts +3 -2
  24. package/dist/components/json/HstJson.story.vue.d.ts +2 -1
  25. package/dist/components/json/HstJson.vue.d.ts +3 -2
  26. package/dist/components/json/serialize.d.ts +7 -13
  27. package/dist/components/number/HstNumber.story.vue.d.ts +2 -1
  28. package/dist/components/number/HstNumber.vue.d.ts +4 -3
  29. package/dist/components/radio/HstRadio.story.vue.d.ts +2 -1
  30. package/dist/components/radio/HstRadio.vue.d.ts +3 -2
  31. package/dist/components/select/CustomSelect.vue.d.ts +4 -3
  32. package/dist/components/select/HstSelect.story.vue.d.ts +2 -1
  33. package/dist/components/select/HstSelect.vue.d.ts +3 -2
  34. package/dist/components/slider/HstSlider.story.vue.d.ts +2 -1
  35. package/dist/components/slider/HstSlider.vue.d.ts +3 -2
  36. package/dist/components/text/HstText.story.vue.d.ts +2 -1
  37. package/dist/components/text/HstText.vue.d.ts +4 -3
  38. package/dist/components/textarea/HstTextarea.story.vue.d.ts +2 -1
  39. package/dist/components/textarea/HstTextarea.vue.d.ts +4 -3
  40. package/dist/index.d.ts +37 -43
  41. package/dist/index.es.css +1 -1
  42. package/dist/index.es.js +75 -74
  43. package/dist/style-standalone.css +6 -0
  44. package/package.json +8 -8
package/dist/index.es.js CHANGED
@@ -2,7 +2,7 @@ import { t as e } from "./HstWrapper-C557fRoN.es.js";
2
2
  import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineAsyncComponent as l, defineComponent as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, onUnmounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withKeys as T, withModifiers as E } from "@poveste/vendors/vue";
3
3
  import { Dropdown as ee, VTooltip as D } from "@poveste/vendors/floating-vue";
4
4
  import { Icon as O } from "@poveste/vendors/iconify";
5
- import { useClipboard as te } from "@poveste/vendors/vue-use";
5
+ import { useClipboard as te, useLiveAnnouncer as ne } from "@poveste/vendors/vue-use";
6
6
  //#endregion
7
7
  //#region src/components/button/HstButton.vue
8
8
  var k = /* @__PURE__ */ u({
@@ -16,7 +16,7 @@ var k = /* @__PURE__ */ u({
16
16
  };
17
17
  return (n, r) => (h(), a("button", { class: f(["poveste-button cursor-pointer rounded-sm border-none", t[e.color ?? "default"]]) }, [v(n.$slots, "default")], 2));
18
18
  }
19
- }), ne = { class: "flex gap-px border border-solid border-black/25 dark:border-white/25 rounded-sm p-px" }, re = /* @__PURE__ */ u({
19
+ }), re = { class: "flex gap-px border border-solid border-black/25 dark:border-white/25 rounded-sm p-px" }, ie = /* @__PURE__ */ u({
20
20
  name: "HstButtonGroup",
21
21
  props: {
22
22
  title: {},
@@ -28,9 +28,9 @@ var k = /* @__PURE__ */ u({
28
28
  let l = i, u = c, d = n(() => Array.isArray(l.options) ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? {
29
29
  value: e,
30
30
  label: String(e)
31
- } : e) : Object.keys(l.options).map((e) => ({
31
+ } : e) : Object.entries(l.options).map(([e, t]) => ({
32
32
  value: e,
33
- label: l.options[e]
33
+ label: String(t)
34
34
  })));
35
35
  function f(e) {
36
36
  u("update:modelValue", e);
@@ -42,7 +42,7 @@ var k = /* @__PURE__ */ u({
42
42
  class: "poveste-button-group flex-nowrap items-center"
43
43
  }, {
44
44
  actions: C(() => [v(n.$slots, "actions")]),
45
- default: C(() => [o("div", ne, [(h(!0), a(t, null, _(d.value, ({ label: e, value: t }) => (h(), r(k, {
45
+ default: C(() => [o("div", re, [(h(!0), a(t, null, _(d.value, ({ label: e, value: t }) => (h(), r(k, {
46
46
  key: t,
47
47
  class: "px-1 h-[22px] flex-1 rounded-[3px]!",
48
48
  color: t === i.modelValue ? "primary" : "flat",
@@ -55,12 +55,12 @@ var k = /* @__PURE__ */ u({
55
55
  _: 3
56
56
  }, 8, ["title"]));
57
57
  }
58
- }), ie = {
58
+ }), ae = {
59
59
  width: "16",
60
60
  height: "16",
61
61
  viewBox: "0 0 24 24",
62
62
  class: "relative z-10"
63
- }, ae = ["stroke-dasharray", "stroke-dashoffset"], A = /* @__PURE__ */ u({
63
+ }, oe = ["stroke-dasharray", "stroke-dashoffset"], A = /* @__PURE__ */ u({
64
64
  name: "HstSimpleCheckbox",
65
65
  props: {
66
66
  modelValue: { type: Boolean },
@@ -77,11 +77,11 @@ var k = /* @__PURE__ */ u({
77
77
  });
78
78
  let c = g(), l = g(0), u = n(() => +!!r.modelValue), d = n(() => (1 - u.value) * l.value), p = g(!1);
79
79
  return S(c, () => {
80
- l.value = c.value.getTotalLength?.() ?? 21.21;
80
+ l.value = c.value?.getTotalLength?.() ?? 21.21;
81
81
  }), (t, n) => (h(), a("div", {
82
82
  class: f(["poveste-simple-checkbox group text-white w-[16px] h-[16px] relative", { "cursor-pointer": e.withToggle }]),
83
83
  onClick: s
84
- }, [o("div", { class: f(["border border-solid group-active:bg-gray-500/20 rounded-sm box-border absolute inset-0 transition-border duration-150 ease-out group-hover:border-primary-500 group-hover:dark:border-primary-500", [e.modelValue ? "border-primary-500 border-8" : "border-black/25 dark:border-white/25 delay-150"]]) }, null, 2), (h(), a("svg", ie, [o("path", {
84
+ }, [o("div", { class: f(["border border-solid group-active:bg-gray-500/20 rounded-sm box-border absolute inset-0 transition-border duration-150 ease-out group-hover:border-primary-500 group-hover:dark:border-primary-500", [e.modelValue ? "border-primary-500 border-8" : "border-black/25 dark:border-white/25 delay-150"]]) }, null, 2), (h(), a("svg", ae, [o("path", {
85
85
  ref_key: "path",
86
86
  ref: c,
87
87
  d: "m 4 12 l 5 5 l 10 -10",
@@ -89,9 +89,9 @@ var k = /* @__PURE__ */ u({
89
89
  class: f(["stroke-white stroke-2 duration-200 ease-in-out", [p.value ? "transition-all" : "transition-none", { "delay-150": e.modelValue }]]),
90
90
  "stroke-dasharray": l.value,
91
91
  "stroke-dashoffset": d.value
92
- }, null, 10, ae)]))], 2));
92
+ }, null, 10, oe)]))], 2));
93
93
  }
94
- }), oe = /* @__PURE__ */ u({
94
+ }), se = /* @__PURE__ */ u({
95
95
  name: "HstCheckbox",
96
96
  props: {
97
97
  modelValue: { type: [
@@ -111,7 +111,7 @@ var k = /* @__PURE__ */ u({
111
111
  }
112
112
  o("update:modelValue", !a.modelValue);
113
113
  }
114
- let l = n(() => typeof a.modelValue == "string" ? a.modelValue !== "false" : a.modelValue);
114
+ let l = n(() => typeof a.modelValue == "string" ? a.modelValue !== "false" : a.modelValue ?? void 0);
115
115
  return (n, i) => (h(), r(e, {
116
116
  tag: "div",
117
117
  role: "checkbox",
@@ -127,11 +127,11 @@ var k = /* @__PURE__ */ u({
127
127
  _: 3
128
128
  }, 8, ["aria-checked", "title"]));
129
129
  }
130
- }), se = { class: "-my-1" }, ce = [
130
+ }), ce = { class: "-my-1" }, le = [
131
131
  "for",
132
132
  "onKeydown",
133
133
  "onClick"
134
- ], le = /* @__PURE__ */ u({
134
+ ], ue = /* @__PURE__ */ u({
135
135
  name: "HstCheckboxList",
136
136
  props: {
137
137
  title: {},
@@ -151,7 +151,7 @@ var k = /* @__PURE__ */ u({
151
151
  style: p(n.$attrs.style)
152
152
  }, {
153
153
  actions: C(() => [v(n.$slots, "actions")]),
154
- default: C(() => [o("div", se, [(h(!0), a(t, null, _(m.value, (e, t) => (h(), a("label", {
154
+ default: C(() => [o("div", ce, [(h(!0), a(t, null, _(m.value, (e, t) => (h(), a("label", {
155
155
  key: t,
156
156
  tabindex: "0",
157
157
  for: `${t}-radio`,
@@ -161,7 +161,7 @@ var k = /* @__PURE__ */ u({
161
161
  }, [c(A, {
162
162
  "model-value": i.modelValue.includes(t),
163
163
  class: "mr-2"
164
- }, null, 8, ["model-value"]), s(" " + y(e), 1)], 40, ce))), 128))])]),
164
+ }, null, 8, ["model-value"]), s(" " + y(e), 1)], 40, le))), 128))])]),
165
165
  _: 3
166
166
  }, 8, [
167
167
  "title",
@@ -169,7 +169,7 @@ var k = /* @__PURE__ */ u({
169
169
  "style"
170
170
  ]));
171
171
  }
172
- }), ue = { class: "flex flex-row gap-1" }, de = ["value"], fe = /* @__PURE__ */ u({
172
+ }), de = { class: "flex flex-row gap-1" }, fe = ["value"], pe = /* @__PURE__ */ u({
173
173
  name: "HstColorSelect",
174
174
  inheritAttrs: !1,
175
175
  props: {
@@ -185,7 +185,7 @@ var k = /* @__PURE__ */ u({
185
185
  }
186
186
  });
187
187
  function l(e, t = 15) {
188
- let n = !1, r, i = () => {
188
+ let n = !1, r = null, i = () => {
189
189
  r == null ? n = !1 : (e(...r), r = null, setTimeout(i, t));
190
190
  };
191
191
  return (...a) => {
@@ -208,7 +208,7 @@ var k = /* @__PURE__ */ u({
208
208
  style: p(n.$attrs.style)
209
209
  }, {
210
210
  actions: C(() => [v(n.$slots, "actions")]),
211
- default: C(() => [o("div", ue, [w(o("input", d({
211
+ default: C(() => [o("div", de, [w(o("input", d({
212
212
  ...n.$attrs,
213
213
  class: null,
214
214
  style: null
@@ -220,7 +220,7 @@ var k = /* @__PURE__ */ u({
220
220
  type: "color",
221
221
  value: t.modelValue,
222
222
  onInput: i[1] ||= ((e) => m(e.target.value))
223
- }, null, 40, de)])]),
223
+ }, null, 40, fe)])]),
224
224
  _: 3
225
225
  }, 8, [
226
226
  "title",
@@ -232,27 +232,31 @@ var k = /* @__PURE__ */ u({
232
232
  name: "HstCopyIcon",
233
233
  props: { content: { type: [String, Function] } },
234
234
  setup(e) {
235
- let t = e, { copy: n, copied: i } = te();
236
- async function a() {
235
+ let t = e, { copy: n, copied: r } = te(), { polite: i } = ne();
236
+ async function o() {
237
237
  let e = typeof t.content == "function" ? await t.content() : t.content;
238
- n(e);
238
+ await n(e), r.value && i("Copied");
239
239
  }
240
- return (e, t) => w((h(), r(b(O), {
240
+ return (e, t) => w((h(), a("button", {
241
+ type: "button",
242
+ "aria-label": "Copy",
243
+ class: "flex p-0 bg-transparent border-0 text-inherit opacity-50 hover:opacity-100 focus-visible:opacity-100 hover:text-primary-500 cursor-pointer",
244
+ onClick: t[0] ||= (e) => o()
245
+ }, [c(b(O), {
241
246
  icon: "carbon:copy-file",
242
- class: "w-4 h-4 opacity-50 hover:opacity-100 hover:text-primary-500 cursor-pointer",
243
- onClick: t[0] ||= (e) => a()
244
- }, null, 512)), [[b(D), {
247
+ class: "w-4 h-4"
248
+ })])), [[b(D), {
245
249
  content: "Copied!",
246
250
  triggers: [],
247
- shown: b(i),
251
+ shown: b(r),
248
252
  distance: 12,
249
253
  delay: 0
250
254
  }]]);
251
255
  }
252
- }), pe = {
256
+ }), me = {
253
257
  key: 0,
254
258
  class: "poveste-color-shades grid gap-4 grid-cols-[repeat(auto-fill,minmax(200px,1fr))] m-4"
255
- }, me = ["onMouseenter"], he = { class: "flex gap-1" }, ge = { class: "my-0 truncate shrink" }, _e = { class: "flex gap-1" }, M = { class: "my-0 opacity-50 truncate shrink" }, N = /* @__PURE__ */ u({
259
+ }, he = ["onMouseenter"], ge = { class: "flex gap-1" }, _e = { class: "my-0 truncate shrink" }, M = { class: "flex gap-1" }, N = { class: "my-0 opacity-50 truncate shrink" }, P = /* @__PURE__ */ u({
256
260
  name: "HstColorShades",
257
261
  props: {
258
262
  shades: {},
@@ -285,7 +289,7 @@ var k = /* @__PURE__ */ u({
285
289
  }
286
290
  return e;
287
291
  }), f = g(null);
288
- return (e, n) => d.value.length ? (h(), a("div", pe, [(h(!0), a(t, null, _(d.value, (t) => (h(), a("div", {
292
+ return (e, n) => d.value.length ? (h(), a("div", me, [(h(!0), a(t, null, _(d.value, (t) => (h(), a("div", {
289
293
  key: t.key,
290
294
  class: "flex flex-col gap-2",
291
295
  onMouseenter: (e) => f.value = t.key,
@@ -293,25 +297,22 @@ var k = /* @__PURE__ */ u({
293
297
  }, [v(e.$slots, "default", { color: t.color }, () => [o("div", {
294
298
  class: "rounded-full w-16 h-16",
295
299
  style: p({ backgroundColor: t.color })
296
- }, null, 4)]), o("div", null, [o("div", he, [w((h(), a("pre", ge, [s(y(t.name), 1)])), [[b(D), t.name.length > 23 ? t.name : ""]]), f.value === t.key ? (h(), r(j, {
300
+ }, null, 4)]), o("div", null, [o("div", ge, [w((h(), a("pre", _e, [s(y(t.name), 1)])), [[b(D), t.name.length > 23 ? t.name : ""]]), f.value === t.key ? (h(), r(j, {
297
301
  key: 0,
298
302
  content: t.name,
299
303
  class: "flex-none"
300
- }, null, 8, ["content"])) : i("", !0)]), o("div", _e, [w((h(), a("pre", M, [s(y(t.color), 1)])), [[b(D), t.color.length > 23 ? t.color : ""]]), f.value === t.key ? (h(), r(j, {
304
+ }, null, 8, ["content"])) : i("", !0)]), o("div", M, [w((h(), a("pre", N, [s(y(t.color), 1)])), [[b(D), t.color.length > 23 ? t.color : ""]]), f.value === t.key ? (h(), r(j, {
301
305
  key: 0,
302
306
  content: t.color,
303
307
  class: "flex-none"
304
- }, null, 8, ["content"])) : i("", !0)])])], 40, me))), 128))])) : i("", !0);
308
+ }, null, 8, ["content"])) : i("", !0)])])], 40, he))), 128))])) : i("", !0);
305
309
  }
306
- }), P = ["onMouseenter"], F = { class: "flex gap-1" }, I = { class: "my-0 truncate shrink" }, ve = { class: "flex gap-1" }, ye = { class: "my-0 opacity-50 truncate shrink" }, be = /* @__PURE__ */ u({
310
+ }), F = ["onMouseenter"], I = { class: "flex gap-1" }, ve = { class: "my-0 truncate shrink" }, ye = { class: "flex gap-1" }, be = { class: "my-0 opacity-50 truncate shrink" }, xe = /* @__PURE__ */ u({
307
311
  name: "HstTokenGrid",
308
312
  props: {
309
313
  tokens: {},
310
314
  colSize: { default: 180 },
311
- getName: {
312
- type: Function,
313
- default: null
314
- }
315
+ getName: {}
315
316
  },
316
317
  setup(e) {
317
318
  let c = e, l = n(() => {
@@ -330,17 +331,17 @@ var k = /* @__PURE__ */ u({
330
331
  class: "flex flex-col gap-2",
331
332
  onMouseenter: (e) => d.value = t.key,
332
333
  onMouseleave: c[0] ||= (e) => d.value = null
333
- }, [v(n.$slots, "default", { token: t }), o("div", null, [o("div", F, [w((h(), a("pre", I, [s(y(t.name), 1)])), [[b(D), t.name.length > e.colSize / 8 ? t.name : ""]]), d.value === t.key ? (h(), r(j, {
334
+ }, [v(n.$slots, "default", { token: t }), o("div", null, [o("div", I, [w((h(), a("pre", ve, [s(y(t.name), 1)])), [[b(D), t.name.length > e.colSize / 8 ? t.name : ""]]), d.value === t.key ? (h(), r(j, {
334
335
  key: 0,
335
336
  content: t.name,
336
337
  class: "flex-none"
337
- }, null, 8, ["content"])) : i("", !0)]), o("div", ve, [w((h(), a("pre", ye, [s(y(t.value), 1)])), [[b(D), t.value.length > e.colSize / 8 ? t.value : ""]]), d.value === t.key ? (h(), r(j, {
338
+ }, null, 8, ["content"])) : i("", !0)]), o("div", ye, [w((h(), a("pre", be, [s(y(t.value), 1)])), [[b(D), t.value.length > e.colSize / 8 ? t.value : ""]]), d.value === t.key ? (h(), r(j, {
338
339
  key: 0,
339
340
  content: typeof t.value == "string" ? t.value : JSON.stringify(t.value),
340
341
  class: "flex-none"
341
- }, null, 8, ["content"])) : i("", !0)])])], 40, P))), 128))], 4));
342
+ }, null, 8, ["content"])) : i("", !0)])])], 40, F))), 128))], 4));
342
343
  }
343
- }), xe = ["onMouseenter"], Se = { class: "mx-4" }, Ce = { class: "flex gap-1" }, we = { class: "my-0 truncate shrink" }, Te = { class: "flex gap-1" }, Ee = { class: "my-0 opacity-50 truncate shrink" }, De = /* @__PURE__ */ u({
344
+ }), Se = ["onMouseenter"], Ce = { class: "mx-4" }, we = { class: "flex gap-1" }, Te = { class: "my-0 truncate shrink" }, Ee = { class: "flex gap-1" }, De = { class: "my-0 opacity-50 truncate shrink" }, Oe = /* @__PURE__ */ u({
344
345
  name: "HstTokenList",
345
346
  props: {
346
347
  tokens: {},
@@ -360,17 +361,17 @@ var k = /* @__PURE__ */ u({
360
361
  class: "poveste-token-list flex flex-col gap-2 my-8",
361
362
  onMouseenter: (e) => l.value = t.key,
362
363
  onMouseleave: n[0] ||= (e) => l.value = null
363
- }, [v(e.$slots, "default", { token: t }), o("div", Se, [o("div", Ce, [o("pre", we, y(t.name), 1), l.value === t.key ? (h(), r(j, {
364
+ }, [v(e.$slots, "default", { token: t }), o("div", Ce, [o("div", we, [o("pre", Te, y(t.name), 1), l.value === t.key ? (h(), r(j, {
364
365
  key: 0,
365
366
  content: t.name,
366
367
  class: "flex-none"
367
- }, null, 8, ["content"])) : i("", !0)]), o("div", Te, [o("pre", Ee, y(t.value), 1), l.value === t.key ? (h(), r(j, {
368
+ }, null, 8, ["content"])) : i("", !0)]), o("div", Ee, [o("pre", De, y(t.value), 1), l.value === t.key ? (h(), r(j, {
368
369
  key: 0,
369
370
  content: typeof t.value == "string" ? t.value : JSON.stringify(t.value),
370
371
  class: "flex-none"
371
- }, null, 8, ["content"])) : i("", !0)])])], 40, xe))), 128));
372
+ }, null, 8, ["content"])) : i("", !0)])])], 40, Se))), 128));
372
373
  }
373
- }), Oe = /* @__PURE__ */ u({
374
+ }), L = /* @__PURE__ */ u({
374
375
  name: "HstNumber",
375
376
  inheritAttrs: !1,
376
377
  props: {
@@ -386,14 +387,14 @@ var k = /* @__PURE__ */ u({
386
387
  }
387
388
  }), l = g();
388
389
  function u() {
389
- l.value.focus(), l.value.select();
390
+ l.value?.focus(), l.value?.select();
390
391
  }
391
392
  let _ = g(!1), y, b;
392
393
  function S(e) {
393
- _.value = !0, y = e.clientX, b = c.value, window.addEventListener("mousemove", T), window.addEventListener("mouseup", E);
394
+ _.value = !0, y = e.clientX, b = c.value ?? 0, window.addEventListener("mousemove", T), window.addEventListener("mouseup", E);
394
395
  }
395
396
  function T(e) {
396
- let t = Number.parseFloat(l.value.step);
397
+ let t = Number.parseFloat(l.value?.step ?? "");
397
398
  Number.isNaN(t) && (t = 1), c.value = b + Math.round((e.clientX - y) / 10 / t) * t;
398
399
  }
399
400
  function E() {
@@ -433,13 +434,13 @@ var k = /* @__PURE__ */ u({
433
434
  "style"
434
435
  ]));
435
436
  }
436
- }), L = { class: "-my-1" }, ke = [
437
+ }), ke = { class: "-my-1" }, Ae = [
437
438
  "id",
438
439
  "name",
439
440
  "value",
440
441
  "checked",
441
442
  "onChange"
442
- ], Ae = ["for", "onKeydown"], je = /* @__PURE__ */ u({
443
+ ], je = ["for", "onKeydown"], Me = /* @__PURE__ */ u({
443
444
  name: "HstRadio",
444
445
  props: {
445
446
  title: {},
@@ -460,7 +461,7 @@ var k = /* @__PURE__ */ u({
460
461
  style: p(n.$attrs.style)
461
462
  }, {
462
463
  actions: C(() => [v(n.$slots, "actions")]),
463
- default: C(() => [o("div", L, [(h(!0), a(t, null, _(d.value, (e, n) => (h(), a(t, { key: n }, [o("input", {
464
+ default: C(() => [o("div", ke, [(h(!0), a(t, null, _(d.value, (e, n) => (h(), a(t, { key: n }, [o("input", {
464
465
  id: `${n}-radio_${i.title}`,
465
466
  type: "radio",
466
467
  name: `${n}-radio_${i.title}`,
@@ -468,7 +469,7 @@ var k = /* @__PURE__ */ u({
468
469
  checked: n === i.modelValue,
469
470
  class: "hidden!",
470
471
  onChange: (e) => m(n)
471
- }, null, 40, ke), o("label", {
472
+ }, null, 40, Ae), o("label", {
472
473
  tabindex: "0",
473
474
  for: `${n}-radio_${i.title}`,
474
475
  class: "cursor-pointer flex items-center relative py-1 group",
@@ -485,7 +486,7 @@ var k = /* @__PURE__ */ u({
485
486
  { "delay-150": i.modelValue === n },
486
487
  i.modelValue === n ? "fill-primary-500" : "fill-transparent scale-0"
487
488
  ]])
488
- }, null, 2)], 2)), s(" " + y(e), 1)], 40, Ae)], 64))), 128))])]),
489
+ }, null, 2)], 2)), s(" " + y(e), 1)], 40, je)], 64))), 128))])]),
489
490
  _: 3
490
491
  }, 8, [
491
492
  "title",
@@ -493,7 +494,7 @@ var k = /* @__PURE__ */ u({
493
494
  "style"
494
495
  ]));
495
496
  }
496
- }), Me = { class: "cursor-pointer w-full outline-none px-2 h-[27px] -my-1 border border-solid border-black/25 dark:border-white/25 hover:border-primary-500 dark:hover:border-primary-500 rounded-sm flex gap-2 items-center leading-normal" }, Ne = { class: "flex-1 truncate" }, Pe = { class: "flex flex-col bg-gray-50 dark:bg-gray-700" }, Fe = ["onClick"], Ie = /* @__PURE__ */ u({
497
+ }), Ne = { class: "cursor-pointer w-full outline-none px-2 h-[27px] -my-1 border border-solid border-black/25 dark:border-white/25 hover:border-primary-500 dark:hover:border-primary-500 rounded-sm flex gap-2 items-center leading-normal" }, Pe = { class: "flex-1 truncate" }, Fe = { class: "flex flex-col bg-gray-50 dark:bg-gray-700" }, Ie = ["onClick"], Le = /* @__PURE__ */ u({
497
498
  name: "CustomSelect",
498
499
  props: {
499
500
  modelValue: {},
@@ -509,7 +510,7 @@ var k = /* @__PURE__ */ u({
509
510
  "auto-size": "",
510
511
  "auto-boundary-max-size": ""
511
512
  }, {
512
- popper: C(({ hide: n }) => [o("div", Pe, [(h(!0), a(t, null, _(f.value, ([t, r]) => (h(), a("div", d({ ref_for: !0 }, {
513
+ popper: C(({ hide: n }) => [o("div", Fe, [(h(!0), a(t, null, _(f.value, ([t, r]) => (h(), a("div", d({ ref_for: !0 }, {
513
514
  ...e.$attrs,
514
515
  class: null,
515
516
  style: null
@@ -517,15 +518,15 @@ var k = /* @__PURE__ */ u({
517
518
  key: r,
518
519
  class: ["px-2 py-1 cursor-pointer hover:bg-primary-100 dark:hover:bg-primary-700", { "bg-primary-200 dark:bg-primary-800": l.modelValue === t }],
519
520
  onClick: (e) => m(t, n)
520
- }), y(r), 17, Fe))), 128))])]),
521
- default: C(() => [o("div", Me, [o("div", Ne, [v(e.$slots, "default", { label: p.value }, () => [s(y(p.value), 1)])]), c(b(O), {
521
+ }), y(r), 17, Ie))), 128))])]),
522
+ default: C(() => [o("div", Ne, [o("div", Pe, [v(e.$slots, "default", { label: p.value }, () => [s(y(p.value), 1)])]), c(b(O), {
522
523
  icon: "carbon:chevron-sort",
523
524
  class: "w-4 h-4 flex-none ml-auto"
524
525
  })])]),
525
526
  _: 3
526
527
  }));
527
528
  }
528
- }), Le = /* @__PURE__ */ u({
529
+ }), Re = /* @__PURE__ */ u({
529
530
  name: "HstSelect",
530
531
  props: {
531
532
  title: {},
@@ -541,7 +542,7 @@ var k = /* @__PURE__ */ u({
541
542
  style: p(n.$attrs.style)
542
543
  }, {
543
544
  actions: C(() => [v(n.$slots, "actions")]),
544
- default: C(() => [c(Ie, {
545
+ default: C(() => [c(Le, {
545
546
  options: t.options,
546
547
  "model-value": t.modelValue,
547
548
  "onUpdate:modelValue": a[0] ||= (e) => i("update:modelValue", e)
@@ -553,7 +554,7 @@ var k = /* @__PURE__ */ u({
553
554
  "style"
554
555
  ]));
555
556
  }
556
- }), Re = { class: "relative w-full flex items-center" }, ze = /* @__PURE__ */ u({
557
+ }), ze = { class: "relative w-full flex items-center" }, Be = /* @__PURE__ */ u({
557
558
  name: "HstSlider",
558
559
  inheritAttrs: !1,
559
560
  props: {
@@ -569,13 +570,13 @@ var k = /* @__PURE__ */ u({
569
570
  set: (e) => {
570
571
  l("update:modelValue", e);
571
572
  }
572
- }), v = n(() => (c.modelValue - c.min) / (c.max - c.min)), y = n(() => m.value ? { left: `${8 + (m.value.clientWidth - 16) * v.value}px` } : {});
573
+ }), v = n(() => ((c.modelValue ?? c.min) - c.min) / (c.max - c.min)), y = n(() => m.value ? { left: `${8 + (m.value.clientWidth - 16) * v.value}px` } : {});
573
574
  return (n, s) => (h(), r(e, {
574
575
  class: f(["poveste-slider items-center", n.$attrs.class]),
575
576
  title: t.title,
576
577
  style: p(n.$attrs.style)
577
578
  }, {
578
- default: C(() => [o("div", Re, [
579
+ default: C(() => [o("div", ze, [
579
580
  s[3] ||= o("div", { class: "absolute inset-0 flex items-center" }, [o("div", { class: "border border-black/25 dark:border-white/25 h-1 w-full rounded-full" })], -1),
580
581
  w(o("input", d({
581
582
  ref_key: "input",
@@ -603,7 +604,7 @@ var k = /* @__PURE__ */ u({
603
604
  class: "absolute",
604
605
  style: p(y.value)
605
606
  }, null, 4)), [[b(D), {
606
- content: t.modelValue.toString(),
607
+ content: String(t.modelValue ?? ""),
607
608
  shown: !0,
608
609
  distance: 16,
609
610
  delay: 0
@@ -616,7 +617,7 @@ var k = /* @__PURE__ */ u({
616
617
  "style"
617
618
  ]));
618
619
  }
619
- }), Be = ["value"], Ve = /* @__PURE__ */ u({
620
+ }), Ve = ["value"], He = /* @__PURE__ */ u({
620
621
  name: "HstText",
621
622
  props: {
622
623
  title: {},
@@ -629,7 +630,7 @@ var k = /* @__PURE__ */ u({
629
630
  title: t.title,
630
631
  class: f(["poveste-text cursor-text items-center", n.$attrs.class]),
631
632
  style: p(n.$attrs.style),
632
- onClick: s[1] ||= (e) => a.value.focus()
633
+ onClick: s[1] ||= (e) => a.value?.focus()
633
634
  }, {
634
635
  actions: C(() => [v(n.$slots, "actions")]),
635
636
  default: C(() => [o("input", d({
@@ -644,7 +645,7 @@ var k = /* @__PURE__ */ u({
644
645
  value: t.modelValue,
645
646
  class: "text-inherit bg-transparent w-full outline-none px-2 py-1 -my-1 border border-solid border-black/25 dark:border-white/25 focus:border-primary-500 dark:focus:border-primary-500 rounded-sm",
646
647
  onInput: s[0] ||= (e) => i("update:modelValue", e.target.value)
647
- }), null, 16, Be)]),
648
+ }), null, 16, Ve)]),
648
649
  _: 3
649
650
  }, 8, [
650
651
  "title",
@@ -652,7 +653,7 @@ var k = /* @__PURE__ */ u({
652
653
  "style"
653
654
  ]));
654
655
  }
655
- }), He = ["value"], Ue = /* @__PURE__ */ u({
656
+ }), Ue = ["value"], We = /* @__PURE__ */ u({
656
657
  name: "HstTextarea",
657
658
  inheritAttrs: !1,
658
659
  props: {
@@ -666,7 +667,7 @@ var k = /* @__PURE__ */ u({
666
667
  title: t.title,
667
668
  class: f(["poveste-textarea cursor-text", n.$attrs.class]),
668
669
  style: p(n.$attrs.style),
669
- onClick: s[1] ||= (e) => a.value.focus()
670
+ onClick: s[1] ||= (e) => a.value?.focus()
670
671
  }, {
671
672
  actions: C(() => [v(n.$slots, "actions")]),
672
673
  default: C(() => [o("textarea", d({
@@ -680,7 +681,7 @@ var k = /* @__PURE__ */ u({
680
681
  value: t.modelValue,
681
682
  class: "text-inherit bg-transparent w-full outline-none px-2 py-1 -my-1 border border-solid border-black/25 dark:border-white/25 focus:border-primary-500 dark:focus:border-primary-500 rounded-sm box-border resize-y min-h-[26px]",
682
683
  onInput: s[0] ||= (e) => i("update:modelValue", e.target.value)
683
- }), null, 16, He)]),
684
+ }), null, 16, Ue)]),
684
685
  _: 3
685
686
  }, 8, [
686
687
  "title",
@@ -688,10 +689,10 @@ var k = /* @__PURE__ */ u({
688
689
  "style"
689
690
  ]));
690
691
  }
691
- }), R = k, z = re, B = oe, V = le, H = Ve, U = Oe, W = ze, G = Ue, K = Le, q = N, J = De, Y = be, X = j, Z = je, Q = Object.assign(l(() => import("./HstJson-Dz6cYiFP.es.js")), {
692
+ }), R = k, z = ie, B = se, V = ue, H = He, U = L, W = Be, G = We, K = Re, q = P, J = Oe, Y = xe, X = j, Z = Me, Q = Object.assign(l(() => import("./HstJson-3DiXqRjL.es.js")), {
692
693
  name: "HstJson",
693
694
  emits: ["update:modelValue"]
694
- }), $ = fe, We = {
695
+ }), $ = pe, Ge = {
695
696
  HstButton: R,
696
697
  HstButtonGroup: z,
697
698
  HstCheckbox: B,
@@ -710,4 +711,4 @@ var k = /* @__PURE__ */ u({
710
711
  HstColorSelect: $
711
712
  };
712
713
  //#endregion
713
- export { R as HstButton, z as HstButtonGroup, B as HstCheckbox, V as HstCheckboxList, $ as HstColorSelect, q as HstColorShades, X as HstCopyIcon, Q as HstJson, U as HstNumber, Z as HstRadio, K as HstSelect, W as HstSlider, H as HstText, G as HstTextarea, Y as HstTokenGrid, J as HstTokenList, We as components };
714
+ export { R as HstButton, z as HstButtonGroup, B as HstCheckbox, V as HstCheckboxList, $ as HstColorSelect, q as HstColorShades, X as HstCopyIcon, Q as HstJson, U as HstNumber, Z as HstRadio, K as HstSelect, W as HstSlider, H as HstText, G as HstTextarea, Y as HstTokenGrid, J as HstTokenList, Ge as components };
@@ -518,6 +518,9 @@
518
518
  .stroke-2 {
519
519
  stroke-width: 2;
520
520
  }
521
+ .p-0 {
522
+ padding: 0px;
523
+ }
521
524
  .p-2 {
522
525
  padding: calc(var(--spacing) * 2);
523
526
  }
@@ -675,6 +678,9 @@
675
678
  .focus\:border-primary-500:focus {
676
679
  border-color: var(--color-primary-500);
677
680
  }
681
+ .focus-visible\:opacity-100:focus-visible {
682
+ opacity: 100%;
683
+ }
678
684
  .dark\:border-gray-850:where(.ptw-dark, .ptw-dark *) {
679
685
  border-color: var(--color-gray-850);
680
686
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poveste/controls",
3
3
  "type": "module",
4
- "version": "0.13.1",
4
+ "version": "0.15.0",
5
5
  "description": "Prebuilt controls components",
6
6
  "author": {
7
7
  "name": "Sorin Gitlan",
@@ -52,8 +52,8 @@
52
52
  "@codemirror/state": "^6.4.1",
53
53
  "@codemirror/theme-one-dark": "^6.1.2",
54
54
  "@codemirror/view": "^6.35.0",
55
- "@poveste/shared": "^0.13.1",
56
- "@poveste/vendors": "^0.13.1"
55
+ "@poveste/shared": "^0.15.0",
56
+ "@poveste/vendors": "^0.15.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@tailwindcss/cli": "^4.3.3",
@@ -62,17 +62,17 @@
62
62
  "@vitejs/plugin-vue": "^6.0.0",
63
63
  "@vue/runtime-dom": "^3.5.26",
64
64
  "@vue/test-utils": "^2.4.6",
65
- "@vueuse/core": "^14.4.0",
66
- "concurrently": "^9.1.0",
65
+ "@vueuse/core": "^15.0.0",
66
+ "concurrently": "^10.0.5",
67
67
  "floating-vue": "5.2.2",
68
68
  "jsdom": "^30.0.1",
69
69
  "postcss": "^8.5.23",
70
70
  "tailwindcss": "^4.3.3",
71
- "typescript": "5.6.3",
71
+ "typescript": "6.0.3",
72
72
  "vite": "^8.2.0",
73
- "vitest": "^4.1.10",
73
+ "vitest": "^5.0.0",
74
74
  "vue": "^3.5.26",
75
- "vue-tsc": "^2.1.10"
75
+ "vue-tsc": "^3.3.11"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "rimraf dist && pnpm run build:css && vite build && pnpm run build:types",