@histoire/controls 0.15.8 → 0.16.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.
@@ -1,13 +1,13 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- modelValue?: boolean;
2
+ modelValue?: boolean | "true" | "false";
3
3
  title?: string;
4
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
- 'update:modelValue': (newValue: boolean) => true;
5
+ 'update:modelValue': (newValue: boolean | "true" | "false") => true;
6
6
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
- modelValue?: boolean;
7
+ modelValue?: boolean | "true" | "false";
8
8
  title?: string;
9
9
  }>>> & {
10
- "onUpdate:modelValue"?: (newValue: boolean) => any;
10
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
11
11
  }, {}>, {
12
12
  actions: (_: {}) => any;
13
13
  }>;
@@ -1,13 +1,13 @@
1
1
  import { HstControlOption } from '../../types';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
3
  title?: string;
4
- modelValue?: string;
4
+ modelValue?: any;
5
5
  options: Record<string, any> | string[] | HstControlOption[];
6
6
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
7
  "update:modelValue": (value: any) => void;
8
8
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
9
  title?: string;
10
- modelValue?: string;
10
+ modelValue?: any;
11
11
  options: Record<string, any> | string[] | HstControlOption[];
12
12
  }>>> & {
13
13
  "onUpdate:modelValue"?: (value: any) => any;
package/dist/index.d.ts CHANGED
@@ -170,13 +170,13 @@ export declare const HstCheckbox: {
170
170
  $data: {};
171
171
  $props: Partial<{}> & Omit<Readonly<import("@vue/runtime-core").ExtractPropTypes<{
172
172
  modelValue: {
173
- type: import("@vue/runtime-core").PropType<boolean>;
173
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
174
174
  };
175
175
  title: {
176
176
  type: import("@vue/runtime-core").PropType<string>;
177
177
  };
178
178
  }>> & {
179
- "onUpdate:modelValue"?: (newValue: boolean) => any;
179
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
180
180
  } & import("@vue/runtime-core").VNodeProps & import("@vue/runtime-core").AllowedComponentProps & import("@vue/runtime-core").ComponentCustomProps, never>;
181
181
  $attrs: {
182
182
  [x: string]: unknown;
@@ -189,19 +189,19 @@ export declare const HstCheckbox: {
189
189
  }>;
190
190
  $root: import("@vue/runtime-core").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("@vue/runtime-core").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
191
191
  $parent: import("@vue/runtime-core").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("@vue/runtime-core").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
192
- $emit: (event: "update:modelValue", newValue: boolean) => void;
192
+ $emit: (event: "update:modelValue", newValue: boolean | "true" | "false") => void;
193
193
  $el: any;
194
194
  $options: import("@vue/runtime-core").ComponentOptionsBase<Readonly<import("@vue/runtime-core").ExtractPropTypes<{
195
195
  modelValue: {
196
- type: import("@vue/runtime-core").PropType<boolean>;
196
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
197
197
  };
198
198
  title: {
199
199
  type: import("@vue/runtime-core").PropType<string>;
200
200
  };
201
201
  }>> & {
202
- "onUpdate:modelValue"?: (newValue: boolean) => any;
202
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
203
203
  }, {}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
204
- 'update:modelValue': (newValue: boolean) => true;
204
+ 'update:modelValue': (newValue: boolean | "true" | "false") => true;
205
205
  }, string, {}, {}, string> & {
206
206
  beforeCreate?: (() => void) | (() => void)[];
207
207
  created?: (() => void) | (() => void)[];
@@ -224,28 +224,28 @@ export declare const HstCheckbox: {
224
224
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("@vue/runtime-core").WatchOptions<boolean>): import("@vue/runtime-core").WatchStopHandle;
225
225
  } & Readonly<import("@vue/runtime-core").ExtractPropTypes<{
226
226
  modelValue: {
227
- type: import("@vue/runtime-core").PropType<boolean>;
227
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
228
228
  };
229
229
  title: {
230
230
  type: import("@vue/runtime-core").PropType<string>;
231
231
  };
232
232
  }>> & {
233
- "onUpdate:modelValue"?: (newValue: boolean) => any;
233
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
234
234
  } & import("@vue/reactivity").ShallowUnwrapRef<{}> & {} & import("@vue/runtime-core").ComponentCustomProperties & {};
235
235
  __isFragment?: never;
236
236
  __isTeleport?: never;
237
237
  __isSuspense?: never;
238
238
  } & import("@vue/runtime-core").ComponentOptionsBase<Readonly<import("@vue/runtime-core").ExtractPropTypes<{
239
239
  modelValue: {
240
- type: import("@vue/runtime-core").PropType<boolean>;
240
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
241
241
  };
242
242
  title: {
243
243
  type: import("@vue/runtime-core").PropType<string>;
244
244
  };
245
245
  }>> & {
246
- "onUpdate:modelValue"?: (newValue: boolean) => any;
246
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
247
247
  }, {}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
248
- 'update:modelValue': (newValue: boolean) => true;
248
+ 'update:modelValue': (newValue: boolean | "true" | "false") => true;
249
249
  }, string, {}, {}, string> & import("@vue/runtime-core").VNodeProps & import("@vue/runtime-core").AllowedComponentProps & import("@vue/runtime-core").ComponentCustomProps & (new () => {
250
250
  $slots: {
251
251
  actions: (_: {}) => any;
@@ -663,7 +663,7 @@ export declare const HstSelect: {
663
663
  type: import("@vue/runtime-core").PropType<string>;
664
664
  };
665
665
  modelValue: {
666
- type: import("@vue/runtime-core").PropType<string>;
666
+ type: import("@vue/runtime-core").PropType<any>;
667
667
  };
668
668
  options: {
669
669
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -690,7 +690,7 @@ export declare const HstSelect: {
690
690
  type: import("@vue/runtime-core").PropType<string>;
691
691
  };
692
692
  modelValue: {
693
- type: import("@vue/runtime-core").PropType<string>;
693
+ type: import("@vue/runtime-core").PropType<any>;
694
694
  };
695
695
  options: {
696
696
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -725,7 +725,7 @@ export declare const HstSelect: {
725
725
  type: import("@vue/runtime-core").PropType<string>;
726
726
  };
727
727
  modelValue: {
728
- type: import("@vue/runtime-core").PropType<string>;
728
+ type: import("@vue/runtime-core").PropType<any>;
729
729
  };
730
730
  options: {
731
731
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -742,7 +742,7 @@ export declare const HstSelect: {
742
742
  type: import("@vue/runtime-core").PropType<string>;
743
743
  };
744
744
  modelValue: {
745
- type: import("@vue/runtime-core").PropType<string>;
745
+ type: import("@vue/runtime-core").PropType<any>;
746
746
  };
747
747
  options: {
748
748
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -1435,13 +1435,13 @@ export declare const components: {
1435
1435
  $data: {};
1436
1436
  $props: Partial<{}> & Omit<Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1437
1437
  modelValue: {
1438
- type: import("@vue/runtime-core").PropType<boolean>;
1438
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
1439
1439
  };
1440
1440
  title: {
1441
1441
  type: import("@vue/runtime-core").PropType<string>;
1442
1442
  };
1443
1443
  }>> & {
1444
- "onUpdate:modelValue"?: (newValue: boolean) => any;
1444
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
1445
1445
  } & import("@vue/runtime-core").VNodeProps & import("@vue/runtime-core").AllowedComponentProps & import("@vue/runtime-core").ComponentCustomProps, never>;
1446
1446
  $attrs: {
1447
1447
  [x: string]: unknown;
@@ -1454,19 +1454,19 @@ export declare const components: {
1454
1454
  }>;
1455
1455
  $root: import("@vue/runtime-core").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("@vue/runtime-core").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
1456
1456
  $parent: import("@vue/runtime-core").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("@vue/runtime-core").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
1457
- $emit: (event: "update:modelValue", newValue: boolean) => void;
1457
+ $emit: (event: "update:modelValue", newValue: boolean | "true" | "false") => void;
1458
1458
  $el: any;
1459
1459
  $options: import("@vue/runtime-core").ComponentOptionsBase<Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1460
1460
  modelValue: {
1461
- type: import("@vue/runtime-core").PropType<boolean>;
1461
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
1462
1462
  };
1463
1463
  title: {
1464
1464
  type: import("@vue/runtime-core").PropType<string>;
1465
1465
  };
1466
1466
  }>> & {
1467
- "onUpdate:modelValue"?: (newValue: boolean) => any;
1467
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
1468
1468
  }, {}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1469
- 'update:modelValue': (newValue: boolean) => true;
1469
+ 'update:modelValue': (newValue: boolean | "true" | "false") => true;
1470
1470
  }, string, {}, {}, string> & {
1471
1471
  beforeCreate?: (() => void) | (() => void)[];
1472
1472
  created?: (() => void) | (() => void)[];
@@ -1489,28 +1489,28 @@ export declare const components: {
1489
1489
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("@vue/runtime-core").WatchOptions<boolean>): import("@vue/runtime-core").WatchStopHandle;
1490
1490
  } & Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1491
1491
  modelValue: {
1492
- type: import("@vue/runtime-core").PropType<boolean>;
1492
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
1493
1493
  };
1494
1494
  title: {
1495
1495
  type: import("@vue/runtime-core").PropType<string>;
1496
1496
  };
1497
1497
  }>> & {
1498
- "onUpdate:modelValue"?: (newValue: boolean) => any;
1498
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
1499
1499
  } & import("@vue/reactivity").ShallowUnwrapRef<{}> & {} & import("@vue/runtime-core").ComponentCustomProperties & {};
1500
1500
  __isFragment?: never;
1501
1501
  __isTeleport?: never;
1502
1502
  __isSuspense?: never;
1503
1503
  } & import("@vue/runtime-core").ComponentOptionsBase<Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1504
1504
  modelValue: {
1505
- type: import("@vue/runtime-core").PropType<boolean>;
1505
+ type: import("@vue/runtime-core").PropType<boolean | "true" | "false">;
1506
1506
  };
1507
1507
  title: {
1508
1508
  type: import("@vue/runtime-core").PropType<string>;
1509
1509
  };
1510
1510
  }>> & {
1511
- "onUpdate:modelValue"?: (newValue: boolean) => any;
1511
+ "onUpdate:modelValue"?: (newValue: boolean | "true" | "false") => any;
1512
1512
  }, {}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1513
- 'update:modelValue': (newValue: boolean) => true;
1513
+ 'update:modelValue': (newValue: boolean | "true" | "false") => true;
1514
1514
  }, string, {}, {}, string> & import("@vue/runtime-core").VNodeProps & import("@vue/runtime-core").AllowedComponentProps & import("@vue/runtime-core").ComponentCustomProps & (new () => {
1515
1515
  $slots: {
1516
1516
  actions: (_: {}) => any;
@@ -1928,7 +1928,7 @@ export declare const components: {
1928
1928
  type: import("@vue/runtime-core").PropType<string>;
1929
1929
  };
1930
1930
  modelValue: {
1931
- type: import("@vue/runtime-core").PropType<string>;
1931
+ type: import("@vue/runtime-core").PropType<any>;
1932
1932
  };
1933
1933
  options: {
1934
1934
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -1955,7 +1955,7 @@ export declare const components: {
1955
1955
  type: import("@vue/runtime-core").PropType<string>;
1956
1956
  };
1957
1957
  modelValue: {
1958
- type: import("@vue/runtime-core").PropType<string>;
1958
+ type: import("@vue/runtime-core").PropType<any>;
1959
1959
  };
1960
1960
  options: {
1961
1961
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -1990,7 +1990,7 @@ export declare const components: {
1990
1990
  type: import("@vue/runtime-core").PropType<string>;
1991
1991
  };
1992
1992
  modelValue: {
1993
- type: import("@vue/runtime-core").PropType<string>;
1993
+ type: import("@vue/runtime-core").PropType<any>;
1994
1994
  };
1995
1995
  options: {
1996
1996
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
@@ -2007,7 +2007,7 @@ export declare const components: {
2007
2007
  type: import("@vue/runtime-core").PropType<string>;
2008
2008
  };
2009
2009
  modelValue: {
2010
- type: import("@vue/runtime-core").PropType<string>;
2010
+ type: import("@vue/runtime-core").PropType<any>;
2011
2011
  };
2012
2012
  options: {
2013
2013
  type: import("@vue/runtime-core").PropType<string[] | import("./types").HstControlOption[] | Record<string, any>>;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as tt, openBlock as C, createElementBlock as _, normalizeClass as mt, renderSlot as ct, createBlock as Q, resolveDynamicComponent as ha, withCtx as q, withDirectives as Wt, createTextVNode as te, toDisplayString as Ct, unref as H, createElementVNode as R, computed as at, Fragment as fe, renderList as Be, watch as Yi, ref as rt, withKeys as _e, withModifiers as We, createVNode as vn, normalizeStyle as Pt, mergeProps as Xe, onUnmounted as aa, isRef as Ko, vModelText as Go, createCommentVNode as Xt, onMounted as ca, watchEffect as fa } from "@histoire/vendors/vue";
1
+ import { defineComponent as tt, openBlock as C, createElementBlock as _, normalizeClass as mt, renderSlot as ct, createBlock as Q, resolveDynamicComponent as ha, withCtx as q, withDirectives as Wt, createTextVNode as te, toDisplayString as Ct, unref as H, createElementVNode as R, computed as rt, Fragment as fe, renderList as Be, watch as Yi, ref as ot, withKeys as _e, withModifiers as We, createVNode as vn, normalizeStyle as Pt, mergeProps as Xe, onUnmounted as aa, isRef as Ko, vModelText as Go, createCommentVNode as Xt, onMounted as ca, watchEffect as fa } from "@histoire/vendors/vue";
2
2
  import { VTooltip as ue, Dropdown as ua } from "@histoire/vendors/floating-vue";
3
3
  import { Icon as zs } from "@histoire/vendors/iconify";
4
4
  import { useClipboard as da } from "@histoire/vendors/vue-use";
@@ -62,7 +62,7 @@ const pa = {
62
62
  },
63
63
  emits: ["update:modelValue"],
64
64
  setup(s, { emit: t }) {
65
- const e = s, i = at(() => Array.isArray(e.options) ? e.options.map((r) => typeof r == "string" || typeof r == "number" ? { value: r, label: String(r) } : r) : Object.keys(e.options).map((r) => ({
65
+ const e = s, i = rt(() => Array.isArray(e.options) ? e.options.map((r) => typeof r == "string" || typeof r == "number" ? { value: r, label: String(r) } : r) : Object.keys(e.options).map((r) => ({
66
66
  value: r,
67
67
  label: e.options[r]
68
68
  })));
@@ -121,7 +121,7 @@ const pa = {
121
121
  Yi(() => e.modelValue, () => {
122
122
  h.value = !0;
123
123
  });
124
- const n = rt(), r = rt(0), o = at(() => e.modelValue ? 1 : 0), l = at(() => (1 - o.value) * r.value), h = rt(!1);
124
+ const n = ot(), r = ot(0), o = rt(() => e.modelValue ? 1 : 0), l = rt(() => (1 - o.value) * r.value), h = ot(!1);
125
125
  return Yi(n, () => {
126
126
  var a, c;
127
127
  r.value = ((c = (a = n.value).getTotalLength) == null ? void 0 : c.call(a)) ?? 21.21;
@@ -157,7 +157,7 @@ const pa = {
157
157
  }, Oa = /* @__PURE__ */ tt({
158
158
  ...Aa,
159
159
  props: {
160
- modelValue: { type: Boolean },
160
+ modelValue: { type: [Boolean, String] },
161
161
  title: null
162
162
  },
163
163
  emits: {
@@ -166,24 +166,29 @@ const pa = {
166
166
  setup(s, { emit: t }) {
167
167
  const e = s;
168
168
  function i() {
169
+ if (typeof e.modelValue == "string") {
170
+ t("update:modelValue", e.modelValue === "false" ? "true" : "false");
171
+ return;
172
+ }
169
173
  t("update:modelValue", !e.modelValue);
170
174
  }
171
- return (n, r) => (C(), Q(qt, {
175
+ const n = rt(() => typeof e.modelValue == "string" ? e.modelValue !== "false" : e.modelValue);
176
+ return (r, o) => (C(), Q(qt, {
172
177
  role: "checkbox",
173
178
  tabindex: "0",
174
179
  class: "histoire-checkbox htw-cursor-pointer htw-items-center",
175
180
  title: s.title,
176
- onClick: r[0] || (r[0] = (o) => i()),
181
+ onClick: o[0] || (o[0] = (l) => i()),
177
182
  onKeydown: [
178
- r[1] || (r[1] = _e(We((o) => i(), ["prevent"]), ["enter"])),
179
- r[2] || (r[2] = _e(We((o) => i(), ["prevent"]), ["space"]))
183
+ o[1] || (o[1] = _e(We((l) => i(), ["prevent"]), ["enter"])),
184
+ o[2] || (o[2] = _e(We((l) => i(), ["prevent"]), ["space"]))
180
185
  ]
181
186
  }, {
182
187
  actions: q(() => [
183
- ct(n.$slots, "actions")
188
+ ct(r.$slots, "actions")
184
189
  ]),
185
190
  default: q(() => [
186
- vn(Qo, { "model-value": s.modelValue }, null, 8, ["model-value"])
191
+ vn(Qo, { "model-value": H(n) }, null, 8, ["model-value"])
187
192
  ]),
188
193
  _: 3
189
194
  }, 8, ["title"]));
@@ -199,7 +204,7 @@ const pa = {
199
204
  },
200
205
  emits: ["update:modelValue"],
201
206
  setup(s, { emit: t }) {
202
- const e = s, i = at(() => Array.isArray(e.options) ? Object.fromEntries(e.options.map((r) => typeof r == "string" ? [r, r] : [r.value, r.label])) : e.options);
207
+ const e = s, i = rt(() => Array.isArray(e.options) ? Object.fromEntries(e.options.map((r) => typeof r == "string" ? [r, r] : [r.value, r.label])) : e.options);
203
208
  function n(r) {
204
209
  e.modelValue.includes(r) ? t("update:modelValue", e.modelValue.filter((o) => o !== r)) : t("update:modelValue", [...e.modelValue, r]);
205
210
  }
@@ -248,7 +253,7 @@ const pa = {
248
253
  "update:modelValue": (s) => !0
249
254
  },
250
255
  setup(s, { emit: t }) {
251
- const e = rt();
256
+ const e = ot();
252
257
  return (i, n) => (C(), Q(qt, {
253
258
  title: s.title,
254
259
  class: mt(["histoire-text htw-cursor-text htw-items-center", i.$attrs.class]),
@@ -285,16 +290,16 @@ const pa = {
285
290
  "update:modelValue": (s) => !0
286
291
  },
287
292
  setup(s, { emit: t }) {
288
- const e = s, i = at({
293
+ const e = s, i = rt({
289
294
  get: () => e.modelValue,
290
295
  set: (u) => {
291
296
  t("update:modelValue", u);
292
297
  }
293
- }), n = rt();
298
+ }), n = ot();
294
299
  function r() {
295
300
  n.value.focus(), n.value.select();
296
301
  }
297
- const o = rt(!1);
302
+ const o = ot(!1);
298
303
  let l, h;
299
304
  function a(u) {
300
305
  o.value = !0, l = u.clientX, h = i.value, window.addEventListener("mousemove", c), window.addEventListener("mouseup", f);
@@ -360,12 +365,12 @@ const pa = {
360
365
  "update:modelValue": (s) => !0
361
366
  },
362
367
  setup(s, { emit: t }) {
363
- const e = s, i = rt(!1), n = rt(null), r = at({
368
+ const e = s, i = ot(!1), n = ot(null), r = rt({
364
369
  get: () => e.modelValue,
365
370
  set: (h) => {
366
371
  t("update:modelValue", h);
367
372
  }
368
- }), o = at(() => (e.modelValue - e.min) / (e.max - e.min)), l = at(() => n.value ? {
373
+ }), o = rt(() => (e.modelValue - e.min) / (e.max - e.min)), l = rt(() => n.value ? {
369
374
  left: 8 + (n.value.clientWidth - 16) * o.value + "px"
370
375
  } : {});
371
376
  return (h, a) => (C(), Q(qt, {
@@ -419,7 +424,7 @@ const Fa = ["value"], za = {
419
424
  "update:modelValue": (s) => !0
420
425
  },
421
426
  setup(s, { emit: t }) {
422
- const e = rt();
427
+ const e = ot();
423
428
  return (i, n) => (C(), Q(qt, {
424
429
  title: s.title,
425
430
  class: mt(["histoire-textarea htw-cursor-text", i.$attrs.class]),
@@ -452,7 +457,7 @@ const Fa = ["value"], za = {
452
457
  },
453
458
  emits: ["update:modelValue"],
454
459
  setup(s, { emit: t }) {
455
- const e = s, i = at(() => Array.isArray(e.options) ? e.options.map((o) => typeof o == "string" || typeof o == "number" ? [o, String(o)] : [o.value, o.label]) : Object.entries(e.options)), n = at(() => {
460
+ const e = s, i = rt(() => Array.isArray(e.options) ? e.options.map((o) => typeof o == "string" || typeof o == "number" ? [o, String(o)] : [o.value, o.label]) : Object.entries(e.options)), n = rt(() => {
456
461
  var o;
457
462
  return (o = i.value.find(([l]) => l === e.modelValue)) == null ? void 0 : o[1];
458
463
  });
@@ -562,7 +567,7 @@ const Qa = {
562
567
  const t = s, e = (o, l = "") => Object.entries(o).reduce((h, [a, c]) => {
563
568
  const f = l ? a === "DEFAULT" ? l : `${l}-${a}` : a, u = typeof c == "object" ? e(c, f) : { [f]: c };
564
569
  return { ...h, ...u };
565
- }, {}), i = at(() => {
570
+ }, {}), i = rt(() => {
566
571
  const o = t.shades, l = t.getName, h = e(o);
567
572
  return Object.entries(h).map(([a, c]) => {
568
573
  const f = l ? l(a, c) : a;
@@ -572,14 +577,14 @@ const Qa = {
572
577
  name: f
573
578
  };
574
579
  });
575
- }), n = at(() => {
580
+ }), n = rt(() => {
576
581
  let o = i.value;
577
582
  if (t.search) {
578
583
  const l = new RegExp(t.search, "i");
579
584
  o = o.filter(({ name: h }) => l.test(h));
580
585
  }
581
586
  return o;
582
- }), r = rt(null);
587
+ }), r = ot(null);
583
588
  return (o, l) => H(n).length ? (C(), _("div", Ya, [
584
589
  (C(!0), _(fe, null, Be(H(n), (h) => (C(), _("div", {
585
590
  key: h.key,
@@ -635,7 +640,7 @@ const Qa = {
635
640
  getName: { type: Function }
636
641
  },
637
642
  setup(s) {
638
- const t = s, e = at(() => {
643
+ const t = s, e = rt(() => {
639
644
  const n = t.tokens, r = t.getName;
640
645
  return Object.entries(n).map(([o, l]) => {
641
646
  const h = r ? r(o, l) : o;
@@ -645,7 +650,7 @@ const Qa = {
645
650
  value: typeof l == "number" ? l.toString() : l
646
651
  };
647
652
  });
648
- }), i = rt(null);
653
+ }), i = ot(null);
649
654
  return (n, r) => (C(!0), _(fe, null, Be(H(e), (o) => (C(), _("div", {
650
655
  key: o.key,
651
656
  class: "histoire-token-list htw-flex htw-flex-col htw-gap-2 htw-my-8",
@@ -683,7 +688,7 @@ const Qa = {
683
688
  getName: { type: Function, default: null }
684
689
  },
685
690
  setup(s) {
686
- const t = s, e = at(() => {
691
+ const t = s, e = rt(() => {
687
692
  const r = t.tokens, o = t.getName;
688
693
  return Object.entries(r).map(([l, h]) => {
689
694
  const a = o ? o(l, h) : l;
@@ -693,7 +698,7 @@ const Qa = {
693
698
  value: typeof h == "number" ? h.toString() : h
694
699
  };
695
700
  });
696
- }), i = at(() => `${t.colSize}px`), n = rt(null);
701
+ }), i = rt(() => `${t.colSize}px`), n = ot(null);
697
702
  return (r, o) => (C(), _("div", {
698
703
  class: "histoire-token-grid htw-bind-col-size htw-grid htw-gap-4 htw-m-4",
699
704
  style: Pt({
@@ -748,11 +753,11 @@ const xc = { class: "-htw-my-1" }, vc = ["id", "name", "value", "checked", "onCh
748
753
  },
749
754
  emits: ["update:modelValue"],
750
755
  setup(s, { emit: t }) {
751
- const e = s, i = at(() => Array.isArray(e.options) ? Object.fromEntries(e.options.map((o) => typeof o == "string" ? [o, o] : [o.value, o.label])) : e.options);
756
+ const e = s, i = rt(() => Array.isArray(e.options) ? Object.fromEntries(e.options.map((o) => typeof o == "string" ? [o, o] : [o.value, o.label])) : e.options);
752
757
  function n(o) {
753
758
  t("update:modelValue", o), r.value = !0;
754
759
  }
755
- const r = rt(!1);
760
+ const r = ot(!1);
756
761
  return (o, l) => (C(), Q(qt, {
757
762
  role: "group",
758
763
  title: s.title,
@@ -1518,16 +1523,16 @@ class Z extends Yt {
1518
1523
  if (r.done)
1519
1524
  break t;
1520
1525
  let c = Math.min(r.len, h - l);
1521
- ot(n, c, -1);
1526
+ lt(n, c, -1);
1522
1527
  let f = r.ins == -1 ? -1 : r.off == 0 ? r.ins : 0;
1523
- ot(e, c, f), f > 0 && oe(i, e, r.text), r.forward(c), l += c;
1528
+ lt(e, c, f), f > 0 && oe(i, e, r.text), r.forward(c), l += c;
1524
1529
  }
1525
1530
  let a = t[o++];
1526
1531
  for (; l < a; ) {
1527
1532
  if (r.done)
1528
1533
  break t;
1529
1534
  let c = Math.min(r.len, a - l);
1530
- ot(e, c, -1), ot(n, c, r.ins == -1 ? -1 : r.off == 0 ? r.ins : 0), r.forward(c), l += c;
1535
+ lt(e, c, -1), lt(n, c, r.ins == -1 ? -1 : r.off == 0 ? r.ins : 0), r.forward(c), l += c;
1531
1536
  }
1532
1537
  }
1533
1538
  return {
@@ -1555,7 +1560,7 @@ class Z extends Yt {
1555
1560
  function h(c = !1) {
1556
1561
  if (!c && !n.length)
1557
1562
  return;
1558
- o < e && ot(n, e - o, -1);
1563
+ o < e && lt(n, e - o, -1);
1559
1564
  let f = new Z(n, r);
1560
1565
  l = l ? l.compose(f.map(l)) : f, n = [], r = [], o = 0;
1561
1566
  }
@@ -1574,7 +1579,7 @@ class Z extends Yt {
1574
1579
  let p = d ? typeof d == "string" ? E.of(d.split(i || is)) : d : E.empty, w = p.length;
1575
1580
  if (f == u && w == 0)
1576
1581
  return;
1577
- f < o && h(), f > o && ot(n, f - o, -1), ot(n, u - f, w), oe(r, n, p), o = u;
1582
+ f < o && h(), f > o && lt(n, f - o, -1), lt(n, u - f, w), oe(r, n, p), o = u;
1578
1583
  }
1579
1584
  }
1580
1585
  return a(t), h(!l), l;
@@ -1618,7 +1623,7 @@ class Z extends Yt {
1618
1623
  return new Z(t, e);
1619
1624
  }
1620
1625
  }
1621
- function ot(s, t, e, i = !1) {
1626
+ function lt(s, t, e, i = !1) {
1622
1627
  if (t == 0 && e <= 0)
1623
1628
  return;
1624
1629
  let n = s.length - 2;
@@ -1655,12 +1660,12 @@ function ss(s, t, e, i = !1) {
1655
1660
  for (let h = -1; ; )
1656
1661
  if (o.ins == -1 && l.ins == -1) {
1657
1662
  let a = Math.min(o.len, l.len);
1658
- ot(n, a, -1), o.forward(a), l.forward(a);
1663
+ lt(n, a, -1), o.forward(a), l.forward(a);
1659
1664
  } else if (l.ins >= 0 && (o.ins < 0 || h == o.i || o.off == 0 && (l.len < o.len || l.len == o.len && !e))) {
1660
1665
  let a = l.len;
1661
- for (ot(n, l.ins, -1); a; ) {
1666
+ for (lt(n, l.ins, -1); a; ) {
1662
1667
  let c = Math.min(o.len, a);
1663
- o.ins >= 0 && h < o.i && o.len <= c && (ot(n, 0, o.ins), r && oe(r, n, o.text), h = o.i), o.forward(c), a -= c;
1668
+ o.ins >= 0 && h < o.i && o.len <= c && (lt(n, 0, o.ins), r && oe(r, n, o.text), h = o.i), o.forward(c), a -= c;
1664
1669
  }
1665
1670
  l.next();
1666
1671
  } else if (o.ins >= 0) {
@@ -1673,7 +1678,7 @@ function ss(s, t, e, i = !1) {
1673
1678
  c -= l.len, l.next();
1674
1679
  else
1675
1680
  break;
1676
- ot(n, a, h < o.i ? o.ins : 0), r && h < o.i && oe(r, n, o.text), h = o.i, o.forward(o.len - c);
1681
+ lt(n, a, h < o.i ? o.ins : 0), r && h < o.i && oe(r, n, o.text), h = o.i, o.forward(o.len - c);
1677
1682
  } else {
1678
1683
  if (o.done && l.done)
1679
1684
  return r ? Z.createSet(n, r) : Yt.create(n);
@@ -1686,9 +1691,9 @@ function el(s, t, e = !1) {
1686
1691
  if (r.done && o.done)
1687
1692
  return n ? Z.createSet(i, n) : Yt.create(i);
1688
1693
  if (r.ins == 0)
1689
- ot(i, r.len, 0, l), r.next();
1694
+ lt(i, r.len, 0, l), r.next();
1690
1695
  else if (o.len == 0 && !o.done)
1691
- ot(i, 0, o.ins, l), n && oe(n, i, o.text), o.next();
1696
+ lt(i, 0, o.ins, l), n && oe(n, i, o.text), o.next();
1692
1697
  else {
1693
1698
  if (r.done || o.done)
1694
1699
  throw new Error("Mismatched change set lengths");
@@ -1696,9 +1701,9 @@ function el(s, t, e = !1) {
1696
1701
  let h = Math.min(r.len2, o.len), a = i.length;
1697
1702
  if (r.ins == -1) {
1698
1703
  let c = o.ins == -1 ? -1 : o.off ? 0 : o.ins;
1699
- ot(i, h, c, l), n && c && oe(n, i, o.text);
1704
+ lt(i, h, c, l), n && c && oe(n, i, o.text);
1700
1705
  } else
1701
- o.ins == -1 ? (ot(i, r.off ? 0 : r.len, h, l), n && oe(n, i, r.textBit(h))) : (ot(i, r.off ? 0 : r.len, o.off ? 0 : o.ins, l), n && !o.off && oe(n, i, o.text));
1706
+ o.ins == -1 ? (lt(i, r.off ? 0 : r.len, h, l), n && oe(n, i, r.textBit(h))) : (lt(i, r.off ? 0 : r.len, o.off ? 0 : o.ins, l), n && !o.off && oe(n, i, o.text));
1702
1707
  l = (r.ins > h || o.ins >= 0 && o.len > h) && (l || i.length > a), r.forward2(h), o.forward(h);
1703
1708
  }
1704
1709
  }
@@ -2372,15 +2377,15 @@ class F {
2372
2377
  }
2373
2378
  F.reconfigure = /* @__PURE__ */ F.define();
2374
2379
  F.appendConfig = /* @__PURE__ */ F.define();
2375
- class lt {
2380
+ class ht {
2376
2381
  constructor(t, e, i, n, r, o) {
2377
- this.startState = t, this.changes = e, this.selection = i, this.effects = n, this.annotations = r, this.scrollIntoView = o, this._doc = null, this._state = null, i && il(i, e.newLength), r.some((l) => l.type == lt.time) || (this.annotations = r.concat(lt.time.of(Date.now())));
2382
+ this.startState = t, this.changes = e, this.selection = i, this.effects = n, this.annotations = r, this.scrollIntoView = o, this._doc = null, this._state = null, i && il(i, e.newLength), r.some((l) => l.type == ht.time) || (this.annotations = r.concat(ht.time.of(Date.now())));
2378
2383
  }
2379
2384
  /**
2380
2385
  @internal
2381
2386
  */
2382
2387
  static create(t, e, i, n, r, o) {
2383
- return new lt(t, e, i, n, r, o);
2388
+ return new ht(t, e, i, n, r, o);
2384
2389
  }
2385
2390
  /**
2386
2391
  The new document produced by the transaction. Contrary to
@@ -2442,14 +2447,14 @@ class lt {
2442
2447
  `"select.pointer"` will match it.
2443
2448
  */
2444
2449
  isUserEvent(t) {
2445
- let e = this.annotation(lt.userEvent);
2450
+ let e = this.annotation(ht.userEvent);
2446
2451
  return !!(e && (e == t || e.length > t.length && e.slice(0, t.length) == t && e[t.length] == "."));
2447
2452
  }
2448
2453
  }
2449
- lt.time = /* @__PURE__ */ bi.define();
2450
- lt.userEvent = /* @__PURE__ */ bi.define();
2451
- lt.addToHistory = /* @__PURE__ */ bi.define();
2452
- lt.remote = /* @__PURE__ */ bi.define();
2454
+ ht.time = /* @__PURE__ */ bi.define();
2455
+ ht.userEvent = /* @__PURE__ */ bi.define();
2456
+ ht.addToHistory = /* @__PURE__ */ bi.define();
2457
+ ht.remote = /* @__PURE__ */ bi.define();
2453
2458
  function Ec(s, t) {
2454
2459
  let e = [];
2455
2460
  for (let i = 0, n = 0; ; ) {
@@ -2476,7 +2481,7 @@ function fl(s, t, e) {
2476
2481
  }
2477
2482
  function ls(s, t, e) {
2478
2483
  let i = t.selection, n = He(t.annotations);
2479
- return t.userEvent && (n = n.concat(lt.userEvent.of(t.userEvent))), {
2484
+ return t.userEvent && (n = n.concat(ht.userEvent.of(t.userEvent))), {
2480
2485
  changes: t.changes instanceof Z ? t.changes : Z.of(t.changes || [], e, s.facet(ol)),
2481
2486
  selection: i && (i instanceof b ? i : b.single(i.anchor, i.head)),
2482
2487
  effects: He(t.effects),
@@ -2492,7 +2497,7 @@ function ul(s, t, e) {
2492
2497
  let o = !!t[r].sequential;
2493
2498
  i = fl(i, ls(s, t[r], o ? i.changes.newLength : s.doc.length), o);
2494
2499
  }
2495
- let n = lt.create(s, i.changes, i.selection, i.effects, i.annotations, i.scrollIntoView);
2500
+ let n = ht.create(s, i.changes, i.selection, i.effects, i.annotations, i.scrollIntoView);
2496
2501
  return Vc(e ? Nc(n) : n);
2497
2502
  }
2498
2503
  function Nc(s) {
@@ -2513,12 +2518,12 @@ function Nc(s) {
2513
2518
  let o = s.changes.filter(e);
2514
2519
  n = o.changes, r = o.filtered.mapDesc(o.changes).invertedDesc;
2515
2520
  }
2516
- s = lt.create(t, n, s.selection && s.selection.map(r), F.mapEffects(s.effects, r), s.annotations, s.scrollIntoView);
2521
+ s = ht.create(t, n, s.selection && s.selection.map(r), F.mapEffects(s.effects, r), s.annotations, s.scrollIntoView);
2517
2522
  }
2518
2523
  let i = t.facet(hl);
2519
2524
  for (let n = i.length - 1; n >= 0; n--) {
2520
2525
  let r = i[n](s);
2521
- r instanceof lt ? s = r : Array.isArray(r) && r.length == 1 && r[0] instanceof lt ? s = r[0] : s = ul(t, He(r), !1);
2526
+ r instanceof ht ? s = r : Array.isArray(r) && r.length == 1 && r[0] instanceof ht ? s = r[0] : s = ul(t, He(r), !1);
2522
2527
  }
2523
2528
  return s;
2524
2529
  }
@@ -2528,7 +2533,7 @@ function Vc(s) {
2528
2533
  let r = e[n](s);
2529
2534
  r && Object.keys(r).length && (i = fl(i, ls(t, r, s.changes.newLength), !0));
2530
2535
  }
2531
- return i == s ? s : lt.create(t, s.changes, s.selection, i.effects, i.annotations, i.scrollIntoView);
2536
+ return i == s ? s : ht.create(t, s.changes, s.selection, i.effects, i.annotations, i.scrollIntoView);
2532
2537
  }
2533
2538
  const Ic = [];
2534
2539
  function He(s) {
@@ -3826,15 +3831,15 @@ function tf(s, t) {
3826
3831
  i = sn(e), e = e.parentNode;
3827
3832
  }
3828
3833
  }
3829
- class ht {
3834
+ class at {
3830
3835
  constructor(t, e, i = !0) {
3831
3836
  this.node = t, this.offset = e, this.precise = i;
3832
3837
  }
3833
3838
  static before(t, e) {
3834
- return new ht(t.parentNode, sn(t), e);
3839
+ return new at(t.parentNode, sn(t), e);
3835
3840
  }
3836
3841
  static after(t, e) {
3837
- return new ht(t.parentNode, sn(t) + 1, e);
3842
+ return new at(t.parentNode, sn(t) + 1, e);
3838
3843
  }
3839
3844
  }
3840
3845
  const Gs = [];
@@ -4109,7 +4114,7 @@ class ge extends W {
4109
4114
  return t == this.dom ? e : e ? this.text.length : 0;
4110
4115
  }
4111
4116
  domAtPos(t) {
4112
- return new ht(this.dom, t);
4117
+ return new at(this.dom, t);
4113
4118
  }
4114
4119
  domBoundsAround(t, e, i) {
4115
4120
  return { from: i, to: i + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };
@@ -4205,7 +4210,7 @@ class le extends W {
4205
4210
  return i ? i.slice(n, n + this.length) : E.empty;
4206
4211
  }
4207
4212
  domAtPos(t) {
4208
- return t == 0 ? ht.before(this.dom) : ht.after(this.dom, t == this.length);
4213
+ return t == 0 ? at.before(this.dom) : at.after(this.dom, t == this.length);
4209
4214
  }
4210
4215
  domBoundsAround() {
4211
4216
  return null;
@@ -4228,7 +4233,7 @@ class le extends W {
4228
4233
  class Sl extends le {
4229
4234
  domAtPos(t) {
4230
4235
  let { topView: e, text: i } = this.widget;
4231
- return e ? ys(t, 0, e, i, (n, r) => n.domAtPos(r), (n) => new ht(i, Math.min(n, i.nodeValue.length))) : new ht(i, Math.min(t, i.nodeValue.length));
4236
+ return e ? ys(t, 0, e, i, (n, r) => n.domAtPos(r), (n) => new at(i, Math.min(n, i.nodeValue.length))) : new at(i, Math.min(t, i.nodeValue.length));
4232
4237
  }
4233
4238
  sync() {
4234
4239
  this.setDOM(this.widget.toDOM());
@@ -4311,7 +4316,7 @@ class Ge extends W {
4311
4316
  return this.side;
4312
4317
  }
4313
4318
  domAtPos(t) {
4314
- return ht.before(this.dom);
4319
+ return at.before(this.dom);
4315
4320
  }
4316
4321
  localPosFromDOM() {
4317
4322
  return 0;
@@ -4370,7 +4375,7 @@ function Al(s, t) {
4370
4375
  if (o.dom.parentNode == e)
4371
4376
  return o.domAtPos(0);
4372
4377
  }
4373
- return new ht(e, 0);
4378
+ return new at(e, 0);
4374
4379
  }
4375
4380
  function Ol(s, t, e) {
4376
4381
  let i, { children: n } = s;
@@ -4720,7 +4725,7 @@ class Ae extends W {
4720
4725
  return i && (!(i instanceof Ae) || !this.widget.compare(i.widget) || t > 0 && r <= 0 || e < this.length && o <= 0) ? !1 : (this.length = t + (i ? i.length : 0) + (this.length - e), !0);
4721
4726
  }
4722
4727
  domAtPos(t) {
4723
- return t == 0 ? ht.before(this.dom) : ht.after(this.dom, t == this.length);
4728
+ return t == 0 ? at.before(this.dom) : at.after(this.dom, t == this.length);
4724
4729
  }
4725
4730
  split(t) {
4726
4731
  let e = this.length - t;
@@ -5326,7 +5331,7 @@ class Er extends W {
5326
5331
  let n = this.view.state.selection.main, r = this.domAtPos(n.anchor), o = n.empty ? r : this.domAtPos(n.head);
5327
5332
  if (x.gecko && n.empty && gf(r)) {
5328
5333
  let h = document.createTextNode("");
5329
- this.view.observer.ignore(() => r.node.insertBefore(h, r.node.childNodes[r.offset] || null)), r = o = new ht(h, 0), i = !0;
5334
+ this.view.observer.ignore(() => r.node.insertBefore(h, r.node.childNodes[r.offset] || null)), r = o = new at(h, 0), i = !0;
5330
5335
  }
5331
5336
  let l = this.view.observer.selectionRange;
5332
5337
  (i || !l.focusNode || !nn(r.node, r.offset, l.anchorNode, l.anchorOffset) || !nn(o.node, o.offset, l.focusNode, l.focusOffset)) && (this.view.observer.ignore(() => {
@@ -5338,7 +5343,7 @@ class Er extends W {
5338
5343
  let a = yf(r.node, r.offset);
5339
5344
  if (a && a != 3) {
5340
5345
  let c = Wl(r.node, r.offset, a == 1 ? 1 : -1);
5341
- c && (r = new ht(c, a == 1 ? 0 : c.nodeValue.length));
5346
+ c && (r = new at(c, a == 1 ? 0 : c.nodeValue.length));
5342
5347
  }
5343
5348
  }
5344
5349
  h.collapse(r.node, r.offset), n.bidiLevel != null && l.cursorBidiLevel != null && (l.cursorBidiLevel = n.bidiLevel);
@@ -5352,7 +5357,7 @@ class Er extends W {
5352
5357
  let a = document.createRange();
5353
5358
  n.anchor > n.head && ([r, o] = [o, r]), a.setEnd(o.node, o.offset), a.setStart(r.node, r.offset), h.removeAllRanges(), h.addRange(a);
5354
5359
  }
5355
- }), this.view.observer.setSelectionRange(r, o)), this.impreciseAnchor = r.precise ? null : new ht(l.anchorNode, l.anchorOffset), this.impreciseHead = o.precise ? null : new ht(l.focusNode, l.focusOffset);
5360
+ }), this.view.observer.setSelectionRange(r, o)), this.impreciseAnchor = r.precise ? null : new at(l.anchorNode, l.anchorOffset), this.impreciseHead = o.precise ? null : new at(l.focusNode, l.focusOffset);
5356
5361
  }
5357
5362
  enforceCursorAssoc() {
5358
5363
  if (this.compositionDeco.size)
@@ -7686,7 +7691,7 @@ class A {
7686
7691
  return this.dom.ownerDocument.defaultView || window;
7687
7692
  }
7688
7693
  dispatch(...t) {
7689
- this._dispatch(t.length == 1 && t[0] instanceof lt ? t[0] : this.state.update(...t));
7694
+ this._dispatch(t.length == 1 && t[0] instanceof ht ? t[0] : this.state.update(...t));
7690
7695
  }
7691
7696
  /**
7692
7697
  Update the view for the given array of transactions. This will
@@ -8768,7 +8773,7 @@ const jn = /* @__PURE__ */ v.define({
8768
8773
  color: "white"
8769
8774
  },
8770
8775
  ".cm-tooltip-arrow": {
8771
- height: `${7}px`,
8776
+ height: "7px",
8772
8777
  width: `${7 * 2}px`,
8773
8778
  position: "absolute",
8774
8779
  zIndex: -1,
@@ -8778,26 +8783,26 @@ const jn = /* @__PURE__ */ v.define({
8778
8783
  position: "absolute",
8779
8784
  width: 0,
8780
8785
  height: 0,
8781
- borderLeft: `${7}px solid transparent`,
8782
- borderRight: `${7}px solid transparent`
8786
+ borderLeft: "7px solid transparent",
8787
+ borderRight: "7px solid transparent"
8783
8788
  },
8784
8789
  ".cm-tooltip-above &": {
8785
- bottom: `-${7}px`,
8790
+ bottom: "-7px",
8786
8791
  "&:before": {
8787
- borderTop: `${7}px solid #bbb`
8792
+ borderTop: "7px solid #bbb"
8788
8793
  },
8789
8794
  "&:after": {
8790
- borderTop: `${7}px solid #f5f5f5`,
8795
+ borderTop: "7px solid #f5f5f5",
8791
8796
  bottom: "1px"
8792
8797
  }
8793
8798
  },
8794
8799
  ".cm-tooltip-below &": {
8795
- top: `-${7}px`,
8800
+ top: "-7px",
8796
8801
  "&:before": {
8797
- borderBottom: `${7}px solid #bbb`
8802
+ borderBottom: "7px solid #bbb"
8798
8803
  },
8799
8804
  "&:after": {
8800
- borderBottom: `${7}px solid #f5f5f5`,
8805
+ borderBottom: "7px solid #f5f5f5",
8801
8806
  top: "1px"
8802
8807
  }
8803
8808
  }
@@ -13494,7 +13499,7 @@ class xn extends uh {
13494
13499
  /// @internal
13495
13500
  constructor(t) {
13496
13501
  if (super(), this.wrappers = [], t.version != 14)
13497
- throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (${14})`);
13502
+ throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);
13498
13503
  let e = t.nodeNames.split(" ");
13499
13504
  this.minRepeatTerm = e.length;
13500
13505
  for (let l = 0; l < t.repeatNodeCount; l++)
@@ -14324,7 +14329,7 @@ const Cg = /* @__PURE__ */ A.baseTheme({
14324
14329
  tag: m.invalid,
14325
14330
  color: Mg
14326
14331
  }
14327
- ]), la = rt(!1);
14332
+ ]), la = ot(!1);
14328
14333
  window.__hst_controls_dark || (window.__hst_controls_dark = []);
14329
14334
  window.__hst_controls_dark.push(la);
14330
14335
  var qo;
@@ -14344,7 +14349,7 @@ const Ng = {
14344
14349
  setup(s, { emit: t }) {
14345
14350
  const e = s;
14346
14351
  let i;
14347
- const n = rt(""), r = rt(!1), o = rt(), l = {
14352
+ const n = ot(""), r = ot(!1), o = ot(), l = {
14348
14353
  light: [A.baseTheme({}), bo(zd)],
14349
14354
  dark: [Lg, bo(Eg)]
14350
14355
  }, h = new yi(), a = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@histoire/controls",
3
- "version": "0.15.8",
3
+ "version": "0.16.0",
4
4
  "description": "Prebuilt controls components",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -55,7 +55,7 @@
55
55
  "postcss-import": "^14.1.0",
56
56
  "tailwindcss": "^3.0.23",
57
57
  "typescript": "^4.9.5",
58
- "vite": "^4.1.0",
58
+ "vite": "^4.2.0",
59
59
  "vue": "^3.2.47",
60
60
  "vue-tsc": "^1.0.24"
61
61
  },
@@ -3,7 +3,8 @@ import HstCheckbox from './HstCheckbox.vue'
3
3
 
4
4
  function initState () {
5
5
  return {
6
- checked: false,
6
+ booleanChecked: false,
7
+ stringChecked: 'false',
7
8
  }
8
9
  }
9
10
  </script>
@@ -20,15 +21,25 @@ function initState () {
20
21
  >
21
22
  <template #default="{ state }">
22
23
  <HstCheckbox
23
- v-model="state.checked"
24
- title="Label"
24
+ v-model="state.booleanChecked"
25
+ title="Boolean"
25
26
  />
27
+ {{ { value: state.booleanChecked } }}
28
+ <HstCheckbox
29
+ v-model="state.stringChecked"
30
+ title="String"
31
+ />
32
+ {{ { value: state.stringChecked } }}
26
33
  </template>
27
34
 
28
35
  <template #controls="{ state }">
29
36
  <HstCheckbox
30
- v-model="state.checked"
31
- title="Label"
37
+ v-model="state.booleanChecked"
38
+ title="Boolean"
39
+ />
40
+ <HstCheckbox
41
+ v-model="state.stringChecked"
42
+ title="String"
32
43
  />
33
44
  </template>
34
45
  </Variant>
@@ -7,19 +7,35 @@ export default {
7
7
  <script lang="ts" setup>
8
8
  import HstWrapper from '../HstWrapper.vue'
9
9
  import HstSimpleCheckbox from './HstSimpleCheckbox.vue'
10
+ import { computed } from 'vue'
11
+
12
+ type Booleanish = boolean | 'true' | 'false'
10
13
 
11
14
  const props = defineProps<{
12
- modelValue?: boolean
15
+ modelValue?: Booleanish
13
16
  title?: string
14
17
  }>()
15
18
 
16
19
  const emits = defineEmits({
17
- 'update:modelValue': (newValue: boolean) => true,
20
+ 'update:modelValue': (newValue: Booleanish) => true,
18
21
  })
19
22
 
20
23
  function toggle () {
24
+ if (typeof props.modelValue === 'string') {
25
+ emits('update:modelValue', props.modelValue === 'false' ? 'true' : 'false')
26
+ return
27
+ }
28
+
21
29
  emits('update:modelValue', !props.modelValue)
22
30
  }
31
+
32
+ const isTrue = computed(() => {
33
+ if (typeof props.modelValue === 'string') {
34
+ return props.modelValue !== 'false'
35
+ }
36
+
37
+ return props.modelValue
38
+ })
23
39
  </script>
24
40
 
25
41
  <template>
@@ -32,7 +48,7 @@ function toggle () {
32
48
  @keydown.enter.prevent="toggle()"
33
49
  @keydown.space.prevent="toggle()"
34
50
  >
35
- <HstSimpleCheckbox :model-value="modelValue" />
51
+ <HstSimpleCheckbox :model-value="isTrue" />
36
52
  <template #actions>
37
53
  <slot name="actions" />
38
54
  </template>
@@ -11,7 +11,7 @@ import { HstControlOption } from '../../types'
11
11
 
12
12
  defineProps<{
13
13
  title?: string
14
- modelValue?: string
14
+ modelValue?: any
15
15
  options: Record<string, any> | string[] | HstControlOption[]
16
16
  }>()
17
17