@histoire/controls 0.2.5 → 0.3.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,19 +1,19 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
- tokens: Record<string, string | number>;
2
+ tokens: Record<string, string | number | any[] | Record<string, any>>;
3
3
  colSize?: number;
4
- getName?: (key: string, value: string | number) => string;
4
+ getName?: (key: string, value: string | number | any[] | Record<string, any>) => string;
5
5
  }>, {
6
6
  colSize: number;
7
7
  getName: any;
8
8
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
9
- tokens: Record<string, string | number>;
9
+ tokens: Record<string, string | number | any[] | Record<string, any>>;
10
10
  colSize?: number;
11
- getName?: (key: string, value: string | number) => string;
11
+ getName?: (key: string, value: string | number | any[] | Record<string, any>) => string;
12
12
  }>, {
13
13
  colSize: number;
14
14
  getName: any;
15
15
  }>>>, {
16
- getName: (key: string, value: string | number) => string;
16
+ getName: (key: string, value: string | number | any[] | Record<string, any>) => string;
17
17
  colSize: number;
18
18
  }>;
19
19
  export default _default;
@@ -1,9 +1,9 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- tokens: Record<string, string | number>;
3
- getName?: (key: string, value: string | number) => string;
2
+ tokens: Record<string, string | number | any[] | Record<string, any>>;
3
+ getName?: (key: string, value: string | number | any[] | Record<string, any>) => string;
4
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
- tokens: Record<string, string | number>;
6
- getName?: (key: string, value: string | number) => string;
5
+ tokens: Record<string, string | number | any[] | Record<string, any>>;
6
+ getName?: (key: string, value: string | number | any[] | Record<string, any>) => string;
7
7
  }>>>, {}>;
8
8
  export default _default;
9
9
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
package/dist/index.d.ts CHANGED
@@ -106,6 +106,57 @@ export declare const HstColorShades: import("vue").DefineComponent<{
106
106
  type: import("vue").PropType<string>;
107
107
  };
108
108
  }>>, {}>;
109
+ export declare const HstTokenList: import("vue").DefineComponent<{
110
+ tokens: {
111
+ type: import("vue").PropType<Record<string, string | number | any[] | Record<string, any>>>;
112
+ required: true;
113
+ };
114
+ getName: {
115
+ type: import("vue").PropType<(key: string, value: string | number | any[] | Record<string, any>) => string>;
116
+ };
117
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
118
+ tokens: {
119
+ type: import("vue").PropType<Record<string, string | number | any[] | Record<string, any>>>;
120
+ required: true;
121
+ };
122
+ getName: {
123
+ type: import("vue").PropType<(key: string, value: string | number | any[] | Record<string, any>) => string>;
124
+ };
125
+ }>>, {}>;
126
+ export declare const HstTokenGrid: import("vue").DefineComponent<{
127
+ getName: {
128
+ type: import("vue").PropType<(key: string, value: string | number | any[] | Record<string, any>) => string>;
129
+ } & {
130
+ default: any;
131
+ };
132
+ colSize: {
133
+ type: import("vue").PropType<number>;
134
+ } & {
135
+ default: number;
136
+ };
137
+ tokens: {
138
+ type: import("vue").PropType<Record<string, string | number | any[] | Record<string, any>>>;
139
+ required: true;
140
+ };
141
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
142
+ getName: {
143
+ type: import("vue").PropType<(key: string, value: string | number | any[] | Record<string, any>) => string>;
144
+ } & {
145
+ default: any;
146
+ };
147
+ colSize: {
148
+ type: import("vue").PropType<number>;
149
+ } & {
150
+ default: number;
151
+ };
152
+ tokens: {
153
+ type: import("vue").PropType<Record<string, string | number | any[] | Record<string, any>>>;
154
+ required: true;
155
+ };
156
+ }>>, {
157
+ getName: (key: string, value: string | number | any[] | Record<string, any>) => string;
158
+ colSize: number;
159
+ }>;
109
160
  export declare const HstCopyIcon: import("vue").DefineComponent<{
110
161
  content: {
111
162
  type: import("vue").PropType<string>;
package/dist/index.es.js CHANGED
@@ -1358,7 +1358,7 @@ var PrivatePopper = () => defineComponent({
1358
1358
  default: defaultPropFactory("strategy")
1359
1359
  },
1360
1360
  autoHide: {
1361
- type: Boolean,
1361
+ type: [Boolean, Function],
1362
1362
  default: defaultPropFactory("autoHide")
1363
1363
  },
1364
1364
  handleResize: {
@@ -1461,7 +1461,8 @@ var PrivatePopper = () => defineComponent({
1461
1461
  },
1462
1462
  transformOrigin: null
1463
1463
  },
1464
- shownChildren: /* @__PURE__ */ new Set()
1464
+ shownChildren: /* @__PURE__ */ new Set(),
1465
+ lastAutoHide: true
1465
1466
  };
1466
1467
  },
1467
1468
  computed: {
@@ -1477,7 +1478,7 @@ var PrivatePopper = () => defineComponent({
1477
1478
  isShown: this.isShown,
1478
1479
  shouldMountContent: this.shouldMountContent,
1479
1480
  skipTransition: this.skipTransition,
1480
- autoHide: this.autoHide,
1481
+ autoHide: typeof this.autoHide === "function" ? this.lastAutoHide : this.autoHide,
1481
1482
  show: this.show,
1482
1483
  hide: this.hide,
1483
1484
  handleResize: this.handleResize,
@@ -2127,7 +2128,15 @@ function isContainingEventTarget(popper, event) {
2127
2128
  return popper.$_mouseDownContains || popperContent.contains(event.target);
2128
2129
  }
2129
2130
  function shouldAutoHide(popper, contains2, event) {
2130
- return event.closeAllPopover || event.closePopover && contains2 || popper.autoHide && !contains2;
2131
+ return event.closeAllPopover || event.closePopover && contains2 || getAutoHideResult(popper, event) && !contains2;
2132
+ }
2133
+ function getAutoHideResult(popper, event) {
2134
+ if (typeof popper.autoHide === "function") {
2135
+ const result = popper.autoHide(event);
2136
+ popper.lastAutoHide = result;
2137
+ return result;
2138
+ }
2139
+ return popper.autoHide;
2131
2140
  }
2132
2141
  function computePositionAllShownPoppers(event) {
2133
2142
  for (let i = 0; i < shownPoppers.length; i++) {
@@ -2317,11 +2326,11 @@ const _hoisted_2$1$1 = {
2317
2326
  ref: "inner",
2318
2327
  class: "v-popper__inner"
2319
2328
  };
2320
- const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-outer" }, null, -1);
2321
- const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-inner" }, null, -1);
2322
- const _hoisted_5$1 = [
2323
- _hoisted_3$3,
2324
- _hoisted_4$1
2329
+ const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-outer" }, null, -1);
2330
+ const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-inner" }, null, -1);
2331
+ const _hoisted_5$3 = [
2332
+ _hoisted_3$5,
2333
+ _hoisted_4$3
2325
2334
  ];
2326
2335
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
2327
2336
  const _component_ResizeObserver = resolveComponent("ResizeObserver");
@@ -2380,7 +2389,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
2380
2389
  left: _ctx.toPx(_ctx.result.arrow.x),
2381
2390
  top: _ctx.toPx(_ctx.result.arrow.y)
2382
2391
  } : void 0)
2383
- }, _hoisted_5$1, 4)
2392
+ }, _hoisted_5$3, 4)
2384
2393
  ], 4)
2385
2394
  ], 46, _hoisted_1$1$1);
2386
2395
  }
@@ -2514,7 +2523,7 @@ defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
2514
2523
  name: "VTooltip",
2515
2524
  vPopperTheme: "tooltip"
2516
2525
  }));
2517
- const _sfc_main$7 = defineComponent({
2526
+ const _sfc_main$9 = defineComponent({
2518
2527
  name: "VTooltipDirective",
2519
2528
  components: {
2520
2529
  Popper: PrivatePopper(),
@@ -2605,8 +2614,8 @@ const _sfc_main$7 = defineComponent({
2605
2614
  }
2606
2615
  }
2607
2616
  });
2608
- const _hoisted_1$5 = ["innerHTML"];
2609
- const _hoisted_2$3 = ["textContent"];
2617
+ const _hoisted_1$7 = ["innerHTML"];
2618
+ const _hoisted_2$5 = ["textContent"];
2610
2619
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2611
2620
  const _component_PopperContent = resolveComponent("PopperContent");
2612
2621
  const _component_Popper = resolveComponent("Popper");
@@ -2649,10 +2658,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2649
2658
  _ctx.html ? (openBlock(), createElementBlock("div", {
2650
2659
  key: 0,
2651
2660
  innerHTML: _ctx.finalContent
2652
- }, null, 8, _hoisted_1$5)) : (openBlock(), createElementBlock("div", {
2661
+ }, null, 8, _hoisted_1$7)) : (openBlock(), createElementBlock("div", {
2653
2662
  key: 1,
2654
2663
  textContent: toDisplayString(_ctx.finalContent)
2655
- }, null, 8, _hoisted_2$3))
2664
+ }, null, 8, _hoisted_2$5))
2656
2665
  ]),
2657
2666
  _: 2
2658
2667
  }, 1032, ["class", "popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
@@ -2660,7 +2669,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2660
2669
  _: 1
2661
2670
  }, 16, ["theme", "popper-node", "onApplyShow", "onApplyHide"]);
2662
2671
  }
2663
- var PrivateTooltipDirective = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render]]);
2672
+ var PrivateTooltipDirective = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render]]);
2664
2673
  const TARGET_CLASS = "v-popper--has-tooltip";
2665
2674
  function getPlacement(options2, modifiers) {
2666
2675
  let result = options2.placement;
@@ -2785,20 +2794,20 @@ var PrivateVTooltip = {
2785
2794
  }
2786
2795
  };
2787
2796
  const VTooltip = PrivateVTooltip;
2788
- const _hoisted_1$4 = { class: "htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap" };
2789
- const _hoisted_2$2 = { class: "htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0" };
2790
- const _hoisted_3$2 = { class: "htw-block htw-grow" };
2791
- const __default__$6 = {
2797
+ const _hoisted_1$6 = { class: "htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap" };
2798
+ const _hoisted_2$4 = { class: "htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0" };
2799
+ const _hoisted_3$4 = { class: "htw-block htw-grow" };
2800
+ const __default__$8 = {
2792
2801
  name: "HstWrapper"
2793
2802
  };
2794
- const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$6), {
2803
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$8), {
2795
2804
  props: {
2796
2805
  title: null
2797
2806
  },
2798
2807
  setup(__props) {
2799
2808
  return (_ctx, _cache) => {
2800
- return openBlock(), createElementBlock("label", _hoisted_1$4, [
2801
- withDirectives((openBlock(), createElementBlock("span", _hoisted_2$2, [
2809
+ return openBlock(), createElementBlock("label", _hoisted_1$6, [
2810
+ withDirectives((openBlock(), createElementBlock("span", _hoisted_2$4, [
2802
2811
  createTextVNode(toDisplayString(__props.title), 1)
2803
2812
  ])), [
2804
2813
  [unref(VTooltip), {
@@ -2807,25 +2816,25 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2807
2816
  distance: 12
2808
2817
  }]
2809
2818
  ]),
2810
- createElementVNode("span", _hoisted_3$2, [
2819
+ createElementVNode("span", _hoisted_3$4, [
2811
2820
  renderSlot(_ctx.$slots, "default")
2812
2821
  ])
2813
2822
  ]);
2814
2823
  };
2815
2824
  }
2816
2825
  }));
2817
- const _hoisted_1$3 = { class: "htw-text-white htw-w-[16px] htw-h-[16px] htw-relative" };
2818
- const _hoisted_2$1 = {
2826
+ const _hoisted_1$5 = { class: "htw-text-white htw-w-[16px] htw-h-[16px] htw-relative" };
2827
+ const _hoisted_2$3 = {
2819
2828
  width: "16",
2820
2829
  height: "16",
2821
2830
  viewBox: "0 0 24 24",
2822
2831
  class: "htw-relative htw-z-10"
2823
2832
  };
2824
- const _hoisted_3$1 = ["stroke-dasharray", "stroke-dashoffset"];
2825
- const __default__$5 = {
2833
+ const _hoisted_3$3 = ["stroke-dasharray", "stroke-dashoffset"];
2834
+ const __default__$7 = {
2826
2835
  name: "HstCheckbox"
2827
2836
  };
2828
- const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
2837
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$7), {
2829
2838
  props: {
2830
2839
  modelValue: { type: Boolean },
2831
2840
  title: null
@@ -2849,7 +2858,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2849
2858
  dasharray.value = (_c = (_b2 = (_a2 = path.value).getTotalLength) == null ? void 0 : _b2.call(_a2)) != null ? _c : 21.21;
2850
2859
  });
2851
2860
  return (_ctx, _cache) => {
2852
- return openBlock(), createBlock(_sfc_main$6, {
2861
+ return openBlock(), createBlock(_sfc_main$8, {
2853
2862
  role: "checkbox",
2854
2863
  tabindex: "0",
2855
2864
  class: "htw-cursor-pointer htw-items-center",
@@ -2861,13 +2870,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2861
2870
  ]
2862
2871
  }, {
2863
2872
  default: withCtx(() => [
2864
- createElementVNode("div", _hoisted_1$3, [
2873
+ createElementVNode("div", _hoisted_1$5, [
2865
2874
  createElementVNode("div", {
2866
2875
  class: normalizeClass(["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", [
2867
2876
  __props.modelValue ? "htw-border-primary-500 htw-border-8" : "htw-border-black/25 dark:htw-border-white/25 htw-delay-150"
2868
2877
  ]])
2869
2878
  }, null, 2),
2870
- (openBlock(), createElementBlock("svg", _hoisted_2$1, [
2879
+ (openBlock(), createElementBlock("svg", _hoisted_2$3, [
2871
2880
  createElementVNode("path", {
2872
2881
  ref_key: "path",
2873
2882
  ref: path,
@@ -2881,7 +2890,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2881
2890
  ]]),
2882
2891
  "stroke-dasharray": dasharray.value,
2883
2892
  "stroke-dashoffset": unref(dashoffset)
2884
- }, null, 10, _hoisted_3$1)
2893
+ }, null, 10, _hoisted_3$3)
2885
2894
  ]))
2886
2895
  ])
2887
2896
  ]),
@@ -2890,11 +2899,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2890
2899
  };
2891
2900
  }
2892
2901
  }));
2893
- const _hoisted_1$2 = ["value"];
2894
- const __default__$4 = {
2902
+ const _hoisted_1$4 = ["value"];
2903
+ const __default__$6 = {
2895
2904
  name: "HstText"
2896
2905
  };
2897
- const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
2906
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$6), {
2898
2907
  props: {
2899
2908
  title: null,
2900
2909
  modelValue: null
@@ -2905,7 +2914,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2905
2914
  setup(__props, { emit }) {
2906
2915
  const input = ref();
2907
2916
  return (_ctx, _cache) => {
2908
- return openBlock(), createBlock(_sfc_main$6, {
2917
+ return openBlock(), createBlock(_sfc_main$8, {
2909
2918
  title: __props.title,
2910
2919
  class: normalizeClass(["htw-cursor-text htw-items-center", _ctx.$attrs.class]),
2911
2920
  style: normalizeStyle(_ctx.$attrs.style),
@@ -2920,18 +2929,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2920
2929
  value: __props.modelValue,
2921
2930
  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",
2922
2931
  onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value))
2923
- }), null, 16, _hoisted_1$2)
2932
+ }), null, 16, _hoisted_1$4)
2924
2933
  ]),
2925
2934
  _: 1
2926
2935
  }, 8, ["title", "class", "style"]);
2927
2936
  };
2928
2937
  }
2929
2938
  }));
2930
- const __default__$3 = {
2939
+ const __default__$5 = {
2931
2940
  name: "HstNumber",
2932
2941
  inheritAttrs: false
2933
2942
  };
2934
- const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
2943
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
2935
2944
  props: {
2936
2945
  title: null,
2937
2946
  modelValue: null
@@ -2978,7 +2987,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
2978
2987
  stopDragging();
2979
2988
  });
2980
2989
  return (_ctx, _cache) => {
2981
- return openBlock(), createBlock(_sfc_main$6, {
2990
+ return openBlock(), createBlock(_sfc_main$8, {
2982
2991
  class: normalizeClass(["htw-cursor-ew-resize htw-items-center", [
2983
2992
  _ctx.$attrs.class,
2984
2993
  { "htw-select-none": isDragging.value }
@@ -3012,12 +3021,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3012
3021
  };
3013
3022
  }
3014
3023
  }));
3015
- const _hoisted_1$1 = ["value"];
3016
- const __default__$2 = {
3024
+ const _hoisted_1$3 = ["value"];
3025
+ const __default__$4 = {
3017
3026
  name: "HstTextarea",
3018
3027
  inheritAttrs: false
3019
3028
  };
3020
- const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
3029
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
3021
3030
  props: {
3022
3031
  title: null,
3023
3032
  modelValue: null
@@ -3028,7 +3037,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3028
3037
  setup(__props, { emit }) {
3029
3038
  const input = ref();
3030
3039
  return (_ctx, _cache) => {
3031
- return openBlock(), createBlock(_sfc_main$6, {
3040
+ return openBlock(), createBlock(_sfc_main$8, {
3032
3041
  title: __props.title,
3033
3042
  class: normalizeClass(["htw-cursor-text", _ctx.$attrs.class]),
3034
3043
  style: normalizeStyle(_ctx.$attrs.style),
@@ -3042,7 +3051,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3042
3051
  value: __props.modelValue,
3043
3052
  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]",
3044
3053
  onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value))
3045
- }), null, 16, _hoisted_1$1)
3054
+ }), null, 16, _hoisted_1$3)
3046
3055
  ]),
3047
3056
  _: 1
3048
3057
  }, 8, ["title", "class", "style"]);
@@ -4997,10 +5006,10 @@ _global[globalKey] = _global[globalKey] || {};
4997
5006
  _global[globalKey];
4998
5007
  var _a, _b;
4999
5008
  isClient && (window == null ? void 0 : window.navigator) && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.platform) && /iP(ad|hone|od)/.test((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.platform);
5000
- const __default__$1 = {
5009
+ const __default__$3 = {
5001
5010
  name: "HstCopyIcon"
5002
5011
  };
5003
- const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
5012
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
5004
5013
  props: {
5005
5014
  content: null
5006
5015
  },
@@ -5025,18 +5034,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
5025
5034
  };
5026
5035
  }
5027
5036
  }));
5028
- const _hoisted_1 = {
5037
+ const _hoisted_1$2 = {
5029
5038
  key: 0,
5030
5039
  class: "htw-grid htw-gap-4 htw-grid-cols-[repeat(auto-fill,minmax(200px,1fr))] htw-m-4"
5031
5040
  };
5032
- const _hoisted_2 = { class: "htw-flex htw-gap-1" };
5033
- const _hoisted_3 = { class: "htw-my-0 htw-truncate htw-shrink" };
5034
- const _hoisted_4 = { class: "htw-flex htw-gap-1" };
5035
- const _hoisted_5 = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" };
5036
- const __default__ = {
5041
+ const _hoisted_2$2 = ["onMouseenter"];
5042
+ const _hoisted_3$2 = { class: "htw-flex htw-gap-1" };
5043
+ const _hoisted_4$2 = { class: "htw-my-0 htw-truncate htw-shrink" };
5044
+ const _hoisted_5$2 = { class: "htw-flex htw-gap-1" };
5045
+ const _hoisted_6$1 = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" };
5046
+ const __default__$2 = {
5037
5047
  name: "HstColorShades"
5038
5048
  };
5039
- const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
5049
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
5040
5050
  props: {
5041
5051
  shades: null,
5042
5052
  getName: null,
@@ -5064,12 +5074,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
5064
5074
  }
5065
5075
  return list;
5066
5076
  });
5077
+ const hover = ref(null);
5067
5078
  return (_ctx, _cache) => {
5068
- return unref(displayedShades).length ? (openBlock(), createElementBlock("div", _hoisted_1, [
5079
+ return unref(displayedShades).length ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
5069
5080
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayedShades), (shade) => {
5070
5081
  return openBlock(), createElementBlock("div", {
5071
5082
  key: shade.key,
5072
- class: "htw-flex htw-flex-col htw-gap-2 htw-group"
5083
+ class: "htw-flex htw-flex-col htw-gap-2",
5084
+ onMouseenter: ($event) => hover.value = shade.key,
5085
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => hover.value = null)
5073
5086
  }, [
5074
5087
  renderSlot(_ctx.$slots, "default", {
5075
5088
  color: shade.color
@@ -5082,45 +5095,191 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
5082
5095
  }, null, 4)
5083
5096
  ]),
5084
5097
  createElementVNode("div", null, [
5085
- createElementVNode("div", _hoisted_2, [
5086
- withDirectives((openBlock(), createElementBlock("pre", _hoisted_3, [
5098
+ createElementVNode("div", _hoisted_3$2, [
5099
+ withDirectives((openBlock(), createElementBlock("pre", _hoisted_4$2, [
5087
5100
  createTextVNode(toDisplayString(shade.name), 1)
5088
5101
  ])), [
5089
5102
  [unref(VTooltip), shade.name.length > 23 ? shade.name : ""]
5090
5103
  ]),
5091
- createVNode(_sfc_main$1, {
5104
+ hover.value === shade.key ? (openBlock(), createBlock(_sfc_main$3, {
5105
+ key: 0,
5092
5106
  content: shade.name,
5093
- class: "htw-hidden group-hover:htw-block htw-flex-none"
5094
- }, null, 8, ["content"])
5107
+ class: "htw-flex-none"
5108
+ }, null, 8, ["content"])) : createCommentVNode("", true)
5095
5109
  ]),
5096
- createElementVNode("div", _hoisted_4, [
5097
- withDirectives((openBlock(), createElementBlock("pre", _hoisted_5, [
5110
+ createElementVNode("div", _hoisted_5$2, [
5111
+ withDirectives((openBlock(), createElementBlock("pre", _hoisted_6$1, [
5098
5112
  createTextVNode(toDisplayString(shade.color), 1)
5099
5113
  ])), [
5100
5114
  [unref(VTooltip), shade.color.length > 23 ? shade.color : ""]
5101
5115
  ]),
5102
- createVNode(_sfc_main$1, {
5116
+ hover.value === shade.key ? (openBlock(), createBlock(_sfc_main$3, {
5117
+ key: 0,
5103
5118
  content: shade.color,
5104
- class: "htw-hidden group-hover:htw-block htw-flex-none"
5105
- }, null, 8, ["content"])
5119
+ class: "htw-flex-none"
5120
+ }, null, 8, ["content"])) : createCommentVNode("", true)
5106
5121
  ])
5107
5122
  ])
5108
- ]);
5123
+ ], 40, _hoisted_2$2);
5109
5124
  }), 128))
5110
5125
  ])) : createCommentVNode("", true);
5111
5126
  };
5112
5127
  }
5113
5128
  }));
5114
- const HstCheckbox = _sfc_main$5;
5115
- const HstText = _sfc_main$4;
5116
- const HstNumber = _sfc_main$3;
5117
- const HstTextarea = _sfc_main$2;
5118
- const HstColorShades = _sfc_main;
5119
- const HstCopyIcon = _sfc_main$1;
5129
+ const _hoisted_1$1 = ["onMouseenter"];
5130
+ const _hoisted_2$1 = { class: "htw-mx-4" };
5131
+ const _hoisted_3$1 = { class: "htw-flex htw-gap-1" };
5132
+ const _hoisted_4$1 = { class: "htw-my-0 htw-truncate htw-shrink" };
5133
+ const _hoisted_5$1 = { class: "htw-flex htw-gap-1" };
5134
+ const _hoisted_6 = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" };
5135
+ const __default__$1 = {
5136
+ name: "HstTokenList"
5137
+ };
5138
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
5139
+ props: {
5140
+ tokens: null,
5141
+ getName: null
5142
+ },
5143
+ setup(__props) {
5144
+ const props = __props;
5145
+ const processedTokens = computed(() => {
5146
+ const list = props.tokens;
5147
+ const getName = props.getName;
5148
+ return Object.entries(list).map(([key, value]) => {
5149
+ const name = getName ? getName(key, value) : key;
5150
+ return {
5151
+ key,
5152
+ name,
5153
+ value: typeof value === "number" ? value.toString() : value
5154
+ };
5155
+ });
5156
+ });
5157
+ const hover = ref(null);
5158
+ return (_ctx, _cache) => {
5159
+ return openBlock(true), createElementBlock(Fragment, null, renderList(unref(processedTokens), (token) => {
5160
+ return openBlock(), createElementBlock("div", {
5161
+ key: token.key,
5162
+ class: "htw-flex htw-flex-col htw-gap-2 htw-my-8",
5163
+ onMouseenter: ($event) => hover.value = token.key,
5164
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => hover.value = null)
5165
+ }, [
5166
+ renderSlot(_ctx.$slots, "default", { token }),
5167
+ createElementVNode("div", _hoisted_2$1, [
5168
+ createElementVNode("div", _hoisted_3$1, [
5169
+ createElementVNode("pre", _hoisted_4$1, toDisplayString(token.name), 1),
5170
+ hover.value === token.key ? (openBlock(), createBlock(_sfc_main$3, {
5171
+ key: 0,
5172
+ content: token.name,
5173
+ class: "htw-flex-none"
5174
+ }, null, 8, ["content"])) : createCommentVNode("", true)
5175
+ ]),
5176
+ createElementVNode("div", _hoisted_5$1, [
5177
+ createElementVNode("pre", _hoisted_6, toDisplayString(token.value), 1),
5178
+ hover.value === token.key ? (openBlock(), createBlock(_sfc_main$3, {
5179
+ key: 0,
5180
+ content: typeof token.value === "string" ? token.value : JSON.stringify(token.value),
5181
+ class: "htw-flex-none"
5182
+ }, null, 8, ["content"])) : createCommentVNode("", true)
5183
+ ])
5184
+ ])
5185
+ ], 40, _hoisted_1$1);
5186
+ }), 128);
5187
+ };
5188
+ }
5189
+ }));
5190
+ var HstTokenGrid_vue_vue_type_style_index_0_lang = "";
5191
+ const _hoisted_1 = ["onMouseenter"];
5192
+ const _hoisted_2 = { class: "htw-flex htw-gap-1" };
5193
+ const _hoisted_3 = { class: "htw-my-0 htw-truncate htw-shrink" };
5194
+ const _hoisted_4 = { class: "htw-flex htw-gap-1" };
5195
+ const _hoisted_5 = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" };
5196
+ const __default__ = {
5197
+ name: "HstTokenGrid"
5198
+ };
5199
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
5200
+ props: {
5201
+ tokens: null,
5202
+ colSize: { default: 180 },
5203
+ getName: { type: Function, default: null }
5204
+ },
5205
+ setup(__props) {
5206
+ const props = __props;
5207
+ const processedTokens = computed(() => {
5208
+ const list = props.tokens;
5209
+ const getName = props.getName;
5210
+ return Object.entries(list).map(([key, value]) => {
5211
+ const name = getName ? getName(key, value) : key;
5212
+ return {
5213
+ key,
5214
+ name,
5215
+ value: typeof value === "number" ? value.toString() : value
5216
+ };
5217
+ });
5218
+ });
5219
+ const colSizePx = computed(() => `${props.colSize}px`);
5220
+ const hover = ref(null);
5221
+ return (_ctx, _cache) => {
5222
+ return openBlock(), createElementBlock("div", {
5223
+ class: "htw-bind-col-size htw-grid htw-gap-4 htw-m-4",
5224
+ style: normalizeStyle({
5225
+ "--histoire-col-size": unref(colSizePx)
5226
+ })
5227
+ }, [
5228
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(processedTokens), (token) => {
5229
+ return openBlock(), createElementBlock("div", {
5230
+ key: token.key,
5231
+ class: "htw-flex htw-flex-col htw-gap-2",
5232
+ onMouseenter: ($event) => hover.value = token.key,
5233
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => hover.value = null)
5234
+ }, [
5235
+ renderSlot(_ctx.$slots, "default", { token }),
5236
+ createElementVNode("div", null, [
5237
+ createElementVNode("div", _hoisted_2, [
5238
+ withDirectives((openBlock(), createElementBlock("pre", _hoisted_3, [
5239
+ createTextVNode(toDisplayString(token.name), 1)
5240
+ ])), [
5241
+ [unref(VTooltip), token.name.length > __props.colSize / 8 ? token.name : ""]
5242
+ ]),
5243
+ hover.value === token.key ? (openBlock(), createBlock(_sfc_main$3, {
5244
+ key: 0,
5245
+ content: token.name,
5246
+ class: "htw-flex-none"
5247
+ }, null, 8, ["content"])) : createCommentVNode("", true)
5248
+ ]),
5249
+ createElementVNode("div", _hoisted_4, [
5250
+ withDirectives((openBlock(), createElementBlock("pre", _hoisted_5, [
5251
+ createTextVNode(toDisplayString(token.value), 1)
5252
+ ])), [
5253
+ [unref(VTooltip), token.value.length > __props.colSize / 8 ? token.value : ""]
5254
+ ]),
5255
+ hover.value === token.key ? (openBlock(), createBlock(_sfc_main$3, {
5256
+ key: 0,
5257
+ content: typeof token.value === "string" ? token.value : JSON.stringify(token.value),
5258
+ class: "htw-flex-none"
5259
+ }, null, 8, ["content"])) : createCommentVNode("", true)
5260
+ ])
5261
+ ])
5262
+ ], 40, _hoisted_1);
5263
+ }), 128))
5264
+ ], 4);
5265
+ };
5266
+ }
5267
+ }));
5268
+ const HstCheckbox = _sfc_main$7;
5269
+ const HstText = _sfc_main$6;
5270
+ const HstNumber = _sfc_main$5;
5271
+ const HstTextarea = _sfc_main$4;
5272
+ const HstColorShades = _sfc_main$2;
5273
+ const HstTokenList = _sfc_main$1;
5274
+ const HstTokenGrid = _sfc_main;
5275
+ const HstCopyIcon = _sfc_main$3;
5120
5276
  function registerVueComponents(app) {
5121
- app.component("HstCheckbox", _sfc_main$5);
5122
- app.component("HstText", _sfc_main$4);
5123
- app.component("HstNumber", _sfc_main$3);
5124
- app.component("HstTextarea", _sfc_main$2);
5125
- }
5126
- export { HstCheckbox, HstColorShades, HstCopyIcon, HstNumber, HstText, HstTextarea, registerVueComponents };
5277
+ app.component("HstCheckbox", _sfc_main$7);
5278
+ app.component("HstText", _sfc_main$6);
5279
+ app.component("HstNumber", _sfc_main$5);
5280
+ app.component("HstTextarea", _sfc_main$4);
5281
+ app.component("HstColorShades", _sfc_main$2);
5282
+ app.component("HstTokenList", _sfc_main$1);
5283
+ app.component("HstTokenGrid", _sfc_main);
5284
+ }
5285
+ export { HstCheckbox, HstColorShades, HstCopyIcon, HstNumber, HstText, HstTextarea, HstTokenGrid, HstTokenList, registerVueComponents };