@histoire/controls 0.7.4 → 0.7.7

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 (49) hide show
  1. package/.histoire/dist/__sandbox.html +2 -2
  2. package/.histoire/dist/assets/{BaseEmpty.d30f3079.js → BaseEmpty.c5ebb434.js} +2 -2
  3. package/.histoire/dist/assets/{HomeView.8e044be6.js → HomeView.2d2d0dfe.js} +2 -2
  4. package/.histoire/dist/assets/HstCheckbox.story.ccd10161.js +151 -0
  5. package/.histoire/dist/assets/{HstColorShades.story.68cf74d1.js → HstColorShades.story.d71deb80.js} +198 -190
  6. package/.histoire/dist/assets/{HstCopyIcon.e40e725e.js → HstCopyIcon.ef403c78.js} +22 -18
  7. package/.histoire/dist/assets/HstNumber.story.1e0e7b71.js +165 -0
  8. package/.histoire/dist/assets/HstSelect.story.8a2b4741.js +290 -0
  9. package/.histoire/dist/assets/HstSlider.story.4155f6ba.js +153 -0
  10. package/.histoire/dist/assets/HstText.story.43417ceb.js +143 -0
  11. package/.histoire/dist/assets/HstTextarea.story.3e39b89e.js +111 -0
  12. package/.histoire/dist/assets/HstTokenGrid.story.e2f237c4.js +156 -0
  13. package/.histoire/dist/assets/HstTokenList.story.bc7b0288.js +184 -0
  14. package/.histoire/dist/assets/{HstWrapper.246b6982.js → HstWrapper.fee42109.js} +31 -26
  15. package/.histoire/dist/assets/{SearchPane.daa2675c.js → SearchPane.37a81ba7.js} +6 -6
  16. package/.histoire/dist/assets/{StoryView.2f64dad1.js → StoryView.2c1f1961.js} +18 -16
  17. package/.histoire/dist/assets/{bundle-main.784e5bf7.js → bundle-main.c70a2b14.js} +6 -6
  18. package/.histoire/dist/assets/{bundle-sandbox.5e153933.js → bundle-sandbox.f56c0808.js} +3 -3
  19. package/.histoire/dist/assets/{const.268165fd.js → const.36730b48.js} +61 -2
  20. package/.histoire/dist/assets/{global-components.6736b2a9.js → global-components.d165b38c.js} +132 -48
  21. package/.histoire/dist/assets/{search-docs-data.b9a75539.js → search-docs-data.2e7ad186.js} +1 -1
  22. package/.histoire/dist/assets/{style.04507241.css → style.dc851298.css} +102 -32
  23. package/.histoire/dist/assets/{vendor.2833ae3d.js → vendor.31c91490.js} +508 -505
  24. package/.histoire/dist/index.html +3 -3
  25. package/histoire-dist/__sandbox.html +15 -0
  26. package/histoire-dist/assets/BaseEmpty.a84c14c8.js +1 -0
  27. package/histoire-dist/assets/HomeView.f524bd4b.js +1 -0
  28. package/histoire-dist/assets/HstCheckbox.story.9f622545.js +1 -0
  29. package/histoire-dist/assets/HstInput.story.945401ce.js +1 -0
  30. package/histoire-dist/assets/SearchModal.76c035f2.js +1 -0
  31. package/histoire-dist/assets/StoryView.e4c41518.js +15 -0
  32. package/histoire-dist/assets/global-components.84d0ab22.js +1 -0
  33. package/histoire-dist/assets/histoire-text-dark.a529813a.svg +89 -0
  34. package/histoire-dist/assets/histoire-text.1d4474b5.svg +89 -0
  35. package/histoire-dist/assets/histoire.8af7bd1f.svg +51 -0
  36. package/histoire-dist/assets/index.58f51dd0.js +1 -0
  37. package/histoire-dist/assets/preview-settings.a634d101.js +1 -0
  38. package/histoire-dist/assets/sandbox.2c60450a.js +1 -0
  39. package/histoire-dist/assets/style.7657d2ac.css +1 -0
  40. package/histoire-dist/assets/vendor.70a554f6.js +9 -0
  41. package/histoire-dist/index.html +15 -0
  42. package/package.json +2 -2
  43. package/.histoire/dist/assets/HstCheckbox.story.3d04d85b.js +0 -144
  44. package/.histoire/dist/assets/HstNumber.story.1e1964ff.js +0 -160
  45. package/.histoire/dist/assets/HstSelect.story.04860383.js +0 -277
  46. package/.histoire/dist/assets/HstText.story.c915d831.js +0 -137
  47. package/.histoire/dist/assets/HstTextarea.story.802b9c26.js +0 -105
  48. package/.histoire/dist/assets/HstTokenGrid.story.025819d6.js +0 -148
  49. package/.histoire/dist/assets/HstTokenList.story.d3aa6575.js +0 -176
@@ -5,12 +5,12 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1">
7
7
  <meta name="description" content="">
8
- <link rel="stylesheet" href="/assets/style.04507241.css">
8
+ <link rel="stylesheet" href="/assets/style.dc851298.css">
9
9
  <link rel="icon" type="image/svg+xml" href="/histoire.svg"/>
10
10
 
11
11
  </head>
12
12
  <body>
13
13
  <div id="app"></div>
14
- <script type="module" src="/assets/bundle-sandbox.5e153933.js"></script>
14
+ <script type="module" src="/assets/bundle-sandbox.f56c0808.js"></script>
15
15
  </body>
16
16
  </html>
@@ -1,5 +1,5 @@
1
- import { a as openBlock, b as createElementBlock, f as renderSlot } from "./vendor.2833ae3d.js";
2
- import { _ as _export_sfc } from "./bundle-main.784e5bf7.js";
1
+ import { a as openBlock, b as createElementBlock, f as renderSlot } from "./vendor.31c91490.js";
2
+ import { _ as _export_sfc } from "./bundle-main.c70a2b14.js";
3
3
  const _sfc_main = {};
4
4
  const _hoisted_1 = { class: "htw-base-empty htw-flex htw-flex-col htw-items-center htw-justify-center htw-space-y-4 htw-py-12 htw-h-full htw-text-center htw-text-gray-400 htw-text-lg" };
5
5
  function _sfc_render(_ctx, _cache) {
@@ -1,5 +1,5 @@
1
- import { d as defineComponent, c as computed, a as openBlock, b as createElementBlock, e as createBaseVNode, i as unref } from "./vendor.2833ae3d.js";
2
- import { h as histoireConfig, c as customLogos } from "./global-components.6736b2a9.js";
1
+ import { d as defineComponent, c as computed, a as openBlock, b as createElementBlock, e as createBaseVNode, i as unref } from "./vendor.31c91490.js";
2
+ import { h as histoireConfig, c as customLogos } from "./global-components.d165b38c.js";
3
3
  var HistoireLogo = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB3aWR0aD0iNTEyIgogICBoZWlnaHQ9IjUxMiIKICAgdmlld0JveD0iMCAwIDUxMiA1MTIiCiAgIHZlcnNpb249IjEuMSIKICAgaWQ9InN2ZzUiCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGRlZnMKICAgICBpZD0iZGVmczIiIC8+CiAgPGcKICAgICBpZD0ibGF5ZXIxIj4KICAgIDxyZWN0CiAgICAgICBzdHlsZT0ib3BhY2l0eTowLjU7ZmlsbDojMzRkMzk5O2ZpbGwtb3BhY2l0eToxO3N0cm9rZS13aWR0aDoxLjAwMzc1IgogICAgICAgaWQ9InJlY3QxMzcyIgogICAgICAgd2lkdGg9IjMxNC4zMDkyMyIKICAgICAgIGhlaWdodD0iNDA2LjYwOTAxIgogICAgICAgeD0iLTI2LjU2NTA2MyIKICAgICAgIHk9IjEzNC43NTA3OSIKICAgICAgIHRyYW5zZm9ybT0icm90YXRlKC0yMy44MjEyNjIpIgogICAgICAgcnk9IjgiIC8+CiAgICA8cmVjdAogICAgICAgc3R5bGU9ImZpbGw6IzM0ZDM5OTtmaWxsLW9wYWNpdHk6MTtzdHJva2Utd2lkdGg6MS4wMDM3NSIKICAgICAgIGlkPSJyZWN0ODUwIgogICAgICAgd2lkdGg9IjMxNC4zMDkyMyIKICAgICAgIGhlaWdodD0iNDA2LjYwOTAxIgogICAgICAgeD0iNzcuNTcxODM4IgogICAgICAgeT0iNzIuODA4NzA4IgogICAgICAgcnk9IjgiCiAgICAgICB0cmFuc2Zvcm09InJvdGF0ZSgtNC41NzQ0NTM0KSIgLz4KICA8L2c+CiAgPGcKICAgICBpZD0ibGF5ZXIzIj4KICAgIDxwYXRoCiAgICAgICBpZD0icGF0aDE2NTctMyIKICAgICAgIHN0eWxlPSJkaXNwbGF5OmlubGluZTtmaWxsOiNiNGZhZTI7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOiNiNGZhZTI7c3Ryb2tlLXdpZHRoOjguMzQ5MjM7c3Ryb2tlLWxpbmVjYXA6YnV0dDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIKICAgICAgIGQ9Ik0gMzU5LjM4OTQ3LDM1NS45NTEzNCAzMjAuNzI5MzUsMTc2LjUyOTQyIDIzOC4zNDYxMywyMzguOTQxMTggWiBNIDI3My42NDEyNCwyNzMuMDY2MDggMTUyLjU5Nzg4LDE1Ni4wNTU5MSAxOTEuMjU4MDQsMzM1LjQ3Nzg2IFoiIC8+CiAgPC9nPgogIDxnCiAgICAgaWQ9ImxheWVyMiIKICAgICBzdHlsZT0iZGlzcGxheTpub25lIj4KICAgIDxwYXRoCiAgICAgICBpZD0icGF0aDE2NTciCiAgICAgICBzdHlsZT0iZmlsbDojYjRmYWUyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojYjRmYWUyO3N0cm9rZS13aWR0aDo4O3N0cm9rZS1saW5lY2FwOmJ1dHQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICBkPSJtIDI5NiwxMDMuOTgyNDIgLTEzNS41MzEyNSwxNzcuOTY2OCBoIDg4LjcwMTE3IHogTSAyNjIuODMwMDgsMjMwLjA1MDc4IDIxNiw0MDguMDE3NTggMzUxLjUzMTI1LDIzMC4wNTA3OCBaIgogICAgICAgdHJhbnNmb3JtPSJyb3RhdGUoLTQuMTU2NTUzLDI1NiwyNTYuMDA2OTEpIiAvPgogIDwvZz4KPC9zdmc+Cg==";
4
4
  const _hoisted_1 = { class: "htw-flex htw-items-center htw-justify-center htw-h-full" };
5
5
  const _hoisted_2 = ["src"];
@@ -0,0 +1,151 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { d as defineComponent, r as ref, c as computed, w as watch, ax as _export_sfc, a as openBlock, j as createBlock, k as withCtx, f as renderSlot, e as createBaseVNode, n as normalizeClass, b as createElementBlock, v as withKeys, g as withModifiers, q as resolveComponent, l as createVNode } from "./vendor.31c91490.js";
21
+ import { H as HstWrapper } from "./HstWrapper.fee42109.js";
22
+ const __default__ = {
23
+ name: "HstCheckbox"
24
+ };
25
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
26
+ props: {
27
+ modelValue: { type: Boolean, required: true },
28
+ title: { type: String, required: false }
29
+ },
30
+ emits: {
31
+ "update:modelValue": (newValue) => true
32
+ },
33
+ setup(__props, { expose, emit }) {
34
+ expose();
35
+ const props = __props;
36
+ function toggle() {
37
+ emit("update:modelValue", !props.modelValue);
38
+ animationEnabled.value = true;
39
+ }
40
+ const path = ref();
41
+ const dasharray = ref(0);
42
+ const progress = computed(() => props.modelValue ? 1 : 0);
43
+ const dashoffset = computed(() => (1 - progress.value) * dasharray.value);
44
+ const animationEnabled = ref(false);
45
+ watch(path, (value) => {
46
+ var _a, _b, _c;
47
+ dasharray.value = (_c = (_b = (_a = path.value).getTotalLength) == null ? void 0 : _b.call(_a)) != null ? _c : 21.21;
48
+ });
49
+ const __returned__ = { props, emit, toggle, path, dasharray, progress, dashoffset, animationEnabled, HstWrapper };
50
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
51
+ return __returned__;
52
+ }
53
+ }));
54
+ const _hoisted_1 = { class: "htw-text-white htw-w-[16px] htw-h-[16px] htw-relative" };
55
+ const _hoisted_2 = {
56
+ width: "16",
57
+ height: "16",
58
+ viewBox: "0 0 24 24",
59
+ class: "htw-relative htw-z-10"
60
+ };
61
+ const _hoisted_3 = ["stroke-dasharray", "stroke-dashoffset"];
62
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
63
+ return openBlock(), createBlock($setup["HstWrapper"], {
64
+ role: "checkbox",
65
+ tabindex: "0",
66
+ class: "htw-cursor-pointer htw-items-center",
67
+ title: $props.title,
68
+ onClick: _cache[0] || (_cache[0] = ($event) => $setup.toggle()),
69
+ onKeydown: [
70
+ _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => $setup.toggle(), ["prevent"]), ["enter"])),
71
+ _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => $setup.toggle(), ["prevent"]), ["space"]))
72
+ ]
73
+ }, {
74
+ actions: withCtx(() => [
75
+ renderSlot(_ctx.$slots, "actions")
76
+ ]),
77
+ default: withCtx(() => [
78
+ createBaseVNode("div", _hoisted_1, [
79
+ createBaseVNode("div", {
80
+ 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", [
81
+ $props.modelValue ? "htw-border-primary-500 htw-border-8" : "htw-border-black/25 dark:htw-border-white/25 htw-delay-150"
82
+ ]])
83
+ }, null, 2),
84
+ (openBlock(), createElementBlock("svg", _hoisted_2, [
85
+ createBaseVNode("path", {
86
+ ref: "path",
87
+ d: "m 4 12 l 5 5 l 10 -10",
88
+ fill: "none",
89
+ class: normalizeClass(["htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out", [
90
+ $setup.animationEnabled ? "htw-transition-all" : "htw-transition-none",
91
+ {
92
+ "htw-delay-150": $props.modelValue
93
+ }
94
+ ]]),
95
+ "stroke-dasharray": $setup.dasharray,
96
+ "stroke-dashoffset": $setup.dashoffset
97
+ }, null, 10, _hoisted_3)
98
+ ]))
99
+ ])
100
+ ]),
101
+ _: 3
102
+ }, 8, ["title"]);
103
+ }
104
+ _sfc_main$1.__file = "src/components/checkbox/HstCheckbox.vue";
105
+ var HstCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/akryum/Projects/histoire/packages/histoire-controls/src/components/checkbox/HstCheckbox.vue"]]);
106
+ const _sfc_main = /* @__PURE__ */ defineComponent({
107
+ name: "HstCheckbox.story",
108
+ setup(__props, { expose }) {
109
+ expose();
110
+ function initState() {
111
+ return {
112
+ checked: false
113
+ };
114
+ }
115
+ const __returned__ = { initState, HstCheckbox };
116
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
117
+ return __returned__;
118
+ }
119
+ });
120
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
121
+ const _component_Variant = resolveComponent("Variant");
122
+ const _component_Story = resolveComponent("Story");
123
+ return openBlock(), createBlock(_component_Story, { title: "HstCheckbox" }, {
124
+ default: withCtx(() => [
125
+ createVNode(_component_Variant, {
126
+ title: "playground",
127
+ "init-state": $setup.initState
128
+ }, {
129
+ default: withCtx(({ state }) => [
130
+ createVNode($setup["HstCheckbox"], {
131
+ modelValue: state.checked,
132
+ "onUpdate:modelValue": ($event) => state.checked = $event,
133
+ title: "Label"
134
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
135
+ ]),
136
+ controls: withCtx(({ state }) => [
137
+ createVNode($setup["HstCheckbox"], {
138
+ modelValue: state.checked,
139
+ "onUpdate:modelValue": ($event) => state.checked = $event,
140
+ title: "Label"
141
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
142
+ ]),
143
+ _: 1
144
+ })
145
+ ]),
146
+ _: 1
147
+ });
148
+ }
149
+ _sfc_main.__file = "src/components/checkbox/HstCheckbox.story.vue";
150
+ var HstCheckbox_story = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/akryum/Projects/histoire/packages/histoire-controls/src/components/checkbox/HstCheckbox.story.vue"]]);
151
+ export { HstCheckbox_story as default };
@@ -17,17 +17,8 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { d as defineComponent, c as computed, r as ref, i as unref, a as openBlock, b as createElementBlock, F as Fragment, J as renderList, f as renderSlot, e as createBaseVNode, h as normalizeStyle, M as withDirectives, ay as VTooltip, R as createTextVNode, t as toDisplayString, j as createBlock, m as createCommentVNode, ax as _export_sfc, q as resolveComponent, k as withCtx, l as createVNode } from "./vendor.2833ae3d.js";
21
- import { H as HstCopyIcon } from "./HstCopyIcon.e40e725e.js";
22
- const _hoisted_1 = {
23
- key: 0,
24
- class: "htw-grid htw-gap-4 htw-grid-cols-[repeat(auto-fill,minmax(200px,1fr))] htw-m-4"
25
- };
26
- const _hoisted_2 = ["onMouseenter"];
27
- const _hoisted_3 = { class: "htw-flex htw-gap-1" };
28
- const _hoisted_4 = { class: "htw-my-0 htw-truncate htw-shrink" };
29
- const _hoisted_5 = { class: "htw-flex htw-gap-1" };
30
- const _hoisted_6 = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" };
20
+ import { d as defineComponent, c as computed, r as ref, ax as _export_sfc, ay as VTooltip, a as openBlock, b as createElementBlock, F as Fragment, J as renderList, f as renderSlot, e as createBaseVNode, h as normalizeStyle, M as withDirectives, R as createTextVNode, t as toDisplayString, j as createBlock, m as createCommentVNode, q as resolveComponent, k as withCtx, l as createVNode } from "./vendor.31c91490.js";
21
+ import { H as HstCopyIcon } from "./HstCopyIcon.ef403c78.js";
31
22
  const __default__ = {
32
23
  name: "HstColorShades"
33
24
  };
@@ -37,7 +28,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
37
28
  getName: { type: Function, required: false },
38
29
  search: { type: String, required: false }
39
30
  },
40
- setup(__props) {
31
+ setup(__props, { expose }) {
32
+ expose();
41
33
  const props = __props;
42
34
  const shadesWithName = computed(() => {
43
35
  const shades = props.shades;
@@ -60,62 +52,75 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
60
52
  return list;
61
53
  });
62
54
  const hover = ref(null);
63
- return (_ctx, _cache) => {
64
- return unref(displayedShades).length ? (openBlock(), createElementBlock("div", _hoisted_1, [
65
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayedShades), (shade) => {
66
- return openBlock(), createElementBlock("div", {
67
- key: shade.key,
68
- class: "htw-flex htw-flex-col htw-gap-2",
69
- onMouseenter: ($event) => hover.value = shade.key,
70
- onMouseleave: _cache[0] || (_cache[0] = ($event) => hover.value = null)
71
- }, [
72
- renderSlot(_ctx.$slots, "default", {
73
- color: shade.color
74
- }, () => [
75
- createBaseVNode("div", {
76
- class: "htw-rounded-full htw-w-16 htw-h-16",
77
- style: normalizeStyle({
78
- backgroundColor: shade.color
79
- })
80
- }, null, 4)
81
- ]),
82
- createBaseVNode("div", null, [
83
- createBaseVNode("div", _hoisted_3, [
84
- withDirectives((openBlock(), createElementBlock("pre", _hoisted_4, [
85
- createTextVNode(toDisplayString(shade.name), 1)
86
- ])), [
87
- [unref(VTooltip), shade.name.length > 23 ? shade.name : ""]
88
- ]),
89
- hover.value === shade.key ? (openBlock(), createBlock(HstCopyIcon, {
90
- key: 0,
91
- content: shade.name,
92
- class: "htw-flex-none"
93
- }, null, 8, ["content"])) : createCommentVNode("v-if", true)
94
- ]),
95
- createBaseVNode("div", _hoisted_5, [
96
- withDirectives((openBlock(), createElementBlock("pre", _hoisted_6, [
97
- createTextVNode(toDisplayString(shade.color), 1)
98
- ])), [
99
- [unref(VTooltip), shade.color.length > 23 ? shade.color : ""]
100
- ]),
101
- hover.value === shade.key ? (openBlock(), createBlock(HstCopyIcon, {
102
- key: 0,
103
- content: shade.color,
104
- class: "htw-flex-none"
105
- }, null, 8, ["content"])) : createCommentVNode("v-if", true)
106
- ])
107
- ])
108
- ], 40, _hoisted_2);
109
- }), 128))
110
- ])) : createCommentVNode("v-if", true);
111
- };
55
+ const __returned__ = { props, shadesWithName, displayedShades, hover, vTooltip: VTooltip, HstCopyIcon };
56
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
57
+ return __returned__;
112
58
  }
113
59
  }));
60
+ const _hoisted_1 = {
61
+ key: 0,
62
+ class: "htw-grid htw-gap-4 htw-grid-cols-[repeat(auto-fill,minmax(200px,1fr))] htw-m-4"
63
+ };
64
+ const _hoisted_2 = ["onMouseenter"];
65
+ const _hoisted_3 = { class: "htw-flex htw-gap-1" };
66
+ const _hoisted_4 = { class: "htw-my-0 htw-truncate htw-shrink" };
67
+ const _hoisted_5 = { class: "htw-flex htw-gap-1" };
68
+ const _hoisted_6 = { class: "htw-my-0 htw-opacity-50 htw-truncate htw-shrink" };
69
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
70
+ return $setup.displayedShades.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
71
+ (openBlock(true), createElementBlock(Fragment, null, renderList($setup.displayedShades, (shade) => {
72
+ return openBlock(), createElementBlock("div", {
73
+ key: shade.key,
74
+ class: "htw-flex htw-flex-col htw-gap-2",
75
+ onMouseenter: ($event) => $setup.hover = shade.key,
76
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => $setup.hover = null)
77
+ }, [
78
+ renderSlot(_ctx.$slots, "default", {
79
+ color: shade.color
80
+ }, () => [
81
+ createBaseVNode("div", {
82
+ class: "htw-rounded-full htw-w-16 htw-h-16",
83
+ style: normalizeStyle({
84
+ backgroundColor: shade.color
85
+ })
86
+ }, null, 4)
87
+ ]),
88
+ createBaseVNode("div", null, [
89
+ createBaseVNode("div", _hoisted_3, [
90
+ withDirectives((openBlock(), createElementBlock("pre", _hoisted_4, [
91
+ createTextVNode(toDisplayString(shade.name), 1)
92
+ ])), [
93
+ [$setup["vTooltip"], shade.name.length > 23 ? shade.name : ""]
94
+ ]),
95
+ $setup.hover === shade.key ? (openBlock(), createBlock($setup["HstCopyIcon"], {
96
+ key: 0,
97
+ content: shade.name,
98
+ class: "htw-flex-none"
99
+ }, null, 8, ["content"])) : createCommentVNode("v-if", true)
100
+ ]),
101
+ createBaseVNode("div", _hoisted_5, [
102
+ withDirectives((openBlock(), createElementBlock("pre", _hoisted_6, [
103
+ createTextVNode(toDisplayString(shade.color), 1)
104
+ ])), [
105
+ [$setup["vTooltip"], shade.color.length > 23 ? shade.color : ""]
106
+ ]),
107
+ $setup.hover === shade.key ? (openBlock(), createBlock($setup["HstCopyIcon"], {
108
+ key: 0,
109
+ content: shade.color,
110
+ class: "htw-flex-none"
111
+ }, null, 8, ["content"])) : createCommentVNode("v-if", true)
112
+ ])
113
+ ])
114
+ ], 40, _hoisted_2);
115
+ }), 128))
116
+ ])) : createCommentVNode("v-if", true);
117
+ }
114
118
  _sfc_main$1.__file = "src/components/design-tokens/HstColorShades.vue";
115
- var HstColorShades = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/akryum/Projects/histoire/packages/histoire-controls/src/components/design-tokens/HstColorShades.vue"]]);
119
+ var HstColorShades = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/akryum/Projects/histoire/packages/histoire-controls/src/components/design-tokens/HstColorShades.vue"]]);
116
120
  const _sfc_main = /* @__PURE__ */ defineComponent({
117
121
  name: "HstColorShades.story",
118
- setup(__props) {
122
+ setup(__props, { expose }) {
123
+ expose();
119
124
  const colors = {
120
125
  slate: {
121
126
  50: "#f8fafc",
@@ -397,136 +402,139 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
397
402
  900: "#881337"
398
403
  }
399
404
  };
400
- return (_ctx, _cache) => {
401
- const _component_Variant = resolveComponent("Variant");
402
- const _component_HstText = resolveComponent("HstText");
403
- const _component_Story = resolveComponent("Story");
404
- return openBlock(), createBlock(_component_Story, {
405
- title: "design-tokens/HstColorShades",
406
- "responsive-disabled": ""
405
+ const __returned__ = { colors, HstColorShades };
406
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
407
+ return __returned__;
408
+ }
409
+ });
410
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
411
+ const _component_Variant = resolveComponent("Variant");
412
+ const _component_HstText = resolveComponent("HstText");
413
+ const _component_Story = resolveComponent("Story");
414
+ return openBlock(), createBlock(_component_Story, {
415
+ title: "design-tokens/HstColorShades",
416
+ "responsive-disabled": ""
417
+ }, {
418
+ default: withCtx(() => [
419
+ createVNode(_component_Variant, { title: "default" }, {
420
+ default: withCtx(() => [
421
+ (openBlock(), createElementBlock(Fragment, null, renderList($setup.colors, (shades, key) => {
422
+ return createVNode($setup["HstColorShades"], {
423
+ key,
424
+ shades,
425
+ "get-name": (shade) => `${key}-${shade}`
426
+ }, null, 8, ["shades", "get-name"]);
427
+ }), 64))
428
+ ]),
429
+ _: 1
430
+ }),
431
+ createVNode(_component_Variant, { title: "background" }, {
432
+ default: withCtx(() => [
433
+ (openBlock(), createElementBlock(Fragment, null, renderList($setup.colors, (shades, key) => {
434
+ return createVNode($setup["HstColorShades"], {
435
+ key,
436
+ shades,
437
+ "get-name": (shade) => `${key}-${shade}`
438
+ }, {
439
+ default: withCtx(({ color }) => [
440
+ createBaseVNode("div", {
441
+ class: "htw-rounded htw-h-[100px]",
442
+ style: normalizeStyle({
443
+ backgroundColor: color
444
+ })
445
+ }, null, 4)
446
+ ]),
447
+ _: 2
448
+ }, 1032, ["shades", "get-name"]);
449
+ }), 64))
450
+ ]),
451
+ _: 1
452
+ }),
453
+ createVNode(_component_Variant, { title: "text" }, {
454
+ default: withCtx(() => [
455
+ (openBlock(), createElementBlock(Fragment, null, renderList($setup.colors, (shades, key) => {
456
+ return createVNode($setup["HstColorShades"], {
457
+ key,
458
+ shades,
459
+ "get-name": (shade) => `${key}-${shade}`
460
+ }, {
461
+ default: withCtx(({ color }) => [
462
+ createBaseVNode("div", {
463
+ class: "htw-rounded htw-h-[100px] htw-text-5xl htw-flex htw-items-end",
464
+ style: normalizeStyle({
465
+ color
466
+ })
467
+ }, " Aa ", 4)
468
+ ]),
469
+ _: 2
470
+ }, 1032, ["shades", "get-name"]);
471
+ }), 64))
472
+ ]),
473
+ _: 1
474
+ }),
475
+ createVNode(_component_Variant, { title: "border" }, {
476
+ default: withCtx(() => [
477
+ (openBlock(), createElementBlock(Fragment, null, renderList($setup.colors, (shades, key) => {
478
+ return createVNode($setup["HstColorShades"], {
479
+ key,
480
+ shades,
481
+ "get-name": (shade) => `${key}-${shade}`
482
+ }, {
483
+ default: withCtx(({ color }) => [
484
+ createBaseVNode("div", {
485
+ class: "htw-rounded htw-h-[100px] htw-border-solid htw-border-2",
486
+ style: normalizeStyle({
487
+ borderColor: color
488
+ })
489
+ }, null, 4)
490
+ ]),
491
+ _: 2
492
+ }, 1032, ["shades", "get-name"]);
493
+ }), 64))
494
+ ]),
495
+ _: 1
496
+ }),
497
+ createVNode(_component_Variant, {
498
+ title: "with search",
499
+ "init-state": () => ({
500
+ search: ""
501
+ })
407
502
  }, {
503
+ default: withCtx(({ state }) => [
504
+ (openBlock(), createElementBlock(Fragment, null, renderList($setup.colors, (shades, key) => {
505
+ return createVNode($setup["HstColorShades"], {
506
+ key,
507
+ shades,
508
+ "get-name": (shade) => `${key}-${shade}`,
509
+ search: state.search
510
+ }, null, 8, ["shades", "get-name", "search"]);
511
+ }), 64))
512
+ ]),
513
+ controls: withCtx(({ state }) => [
514
+ createVNode(_component_HstText, {
515
+ modelValue: state.search,
516
+ "onUpdate:modelValue": ($event) => state.search = $event,
517
+ title: "Filter colors..."
518
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
519
+ ]),
520
+ _: 1
521
+ }, 8, ["init-state"]),
522
+ createVNode(_component_Variant, { title: "long names" }, {
408
523
  default: withCtx(() => [
409
- createVNode(_component_Variant, { title: "default" }, {
410
- default: withCtx(() => [
411
- (openBlock(), createElementBlock(Fragment, null, renderList(colors, (shades, key) => {
412
- return createVNode(HstColorShades, {
413
- key,
414
- shades,
415
- "get-name": (shade) => `${key}-${shade}`
416
- }, null, 8, ["shades", "get-name"]);
417
- }), 64))
418
- ]),
419
- _: 1
420
- }),
421
- createVNode(_component_Variant, { title: "background" }, {
422
- default: withCtx(() => [
423
- (openBlock(), createElementBlock(Fragment, null, renderList(colors, (shades, key) => {
424
- return createVNode(HstColorShades, {
425
- key,
426
- shades,
427
- "get-name": (shade) => `${key}-${shade}`
428
- }, {
429
- default: withCtx(({ color }) => [
430
- createBaseVNode("div", {
431
- class: "htw-rounded htw-h-[100px]",
432
- style: normalizeStyle({
433
- backgroundColor: color
434
- })
435
- }, null, 4)
436
- ]),
437
- _: 2
438
- }, 1032, ["shades", "get-name"]);
439
- }), 64))
440
- ]),
441
- _: 1
442
- }),
443
- createVNode(_component_Variant, { title: "text" }, {
444
- default: withCtx(() => [
445
- (openBlock(), createElementBlock(Fragment, null, renderList(colors, (shades, key) => {
446
- return createVNode(HstColorShades, {
447
- key,
448
- shades,
449
- "get-name": (shade) => `${key}-${shade}`
450
- }, {
451
- default: withCtx(({ color }) => [
452
- createBaseVNode("div", {
453
- class: "htw-rounded htw-h-[100px] htw-text-5xl htw-flex htw-items-end",
454
- style: normalizeStyle({
455
- color
456
- })
457
- }, " Aa ", 4)
458
- ]),
459
- _: 2
460
- }, 1032, ["shades", "get-name"]);
461
- }), 64))
462
- ]),
463
- _: 1
464
- }),
465
- createVNode(_component_Variant, { title: "border" }, {
466
- default: withCtx(() => [
467
- (openBlock(), createElementBlock(Fragment, null, renderList(colors, (shades, key) => {
468
- return createVNode(HstColorShades, {
469
- key,
470
- shades,
471
- "get-name": (shade) => `${key}-${shade}`
472
- }, {
473
- default: withCtx(({ color }) => [
474
- createBaseVNode("div", {
475
- class: "htw-rounded htw-h-[100px] htw-border-solid htw-border-2",
476
- style: normalizeStyle({
477
- borderColor: color
478
- })
479
- }, null, 4)
480
- ]),
481
- _: 2
482
- }, 1032, ["shades", "get-name"]);
483
- }), 64))
484
- ]),
485
- _: 1
486
- }),
487
- createVNode(_component_Variant, {
488
- title: "with search",
489
- "init-state": () => ({
490
- search: ""
491
- })
492
- }, {
493
- default: withCtx(({ state }) => [
494
- (openBlock(), createElementBlock(Fragment, null, renderList(colors, (shades, key) => {
495
- return createVNode(HstColorShades, {
496
- key,
497
- shades,
498
- "get-name": (shade) => `${key}-${shade}`,
499
- search: state.search
500
- }, null, 8, ["shades", "get-name", "search"]);
501
- }), 64))
502
- ]),
503
- controls: withCtx(({ state }) => [
504
- createVNode(_component_HstText, {
505
- modelValue: state.search,
506
- "onUpdate:modelValue": ($event) => state.search = $event,
507
- title: "Filter colors..."
508
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
509
- ]),
510
- _: 1
511
- }, 8, ["init-state"]),
512
- createVNode(_component_Variant, { title: "long names" }, {
513
- default: withCtx(() => [
514
- (openBlock(), createElementBlock(Fragment, null, renderList(colors, (shades, key) => {
515
- return createVNode(HstColorShades, {
516
- key,
517
- shades,
518
- "get-name": (shade) => `${"'very-".repeat(5)}long-${key}-${shade}`
519
- }, null, 8, ["shades", "get-name"]);
520
- }), 64))
521
- ]),
522
- _: 1
523
- })
524
+ (openBlock(), createElementBlock(Fragment, null, renderList($setup.colors, (shades, key) => {
525
+ return createVNode($setup["HstColorShades"], {
526
+ key,
527
+ shades,
528
+ "get-name": (shade) => `${"'very-".repeat(5)}long-${key}-${shade}`
529
+ }, null, 8, ["shades", "get-name"]);
530
+ }), 64))
524
531
  ]),
525
532
  _: 1
526
- });
527
- };
528
- }
529
- });
533
+ })
534
+ ]),
535
+ _: 1
536
+ });
537
+ }
530
538
  _sfc_main.__file = "src/components/design-tokens/HstColorShades.story.vue";
531
- var HstColorShades_story = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/akryum/Projects/histoire/packages/histoire-controls/src/components/design-tokens/HstColorShades.story.vue"]]);
539
+ var HstColorShades_story = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/akryum/Projects/histoire/packages/histoire-controls/src/components/design-tokens/HstColorShades.story.vue"]]);
532
540
  export { HstColorShades_story as default };
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { d as defineComponent, az as useClipboard, M as withDirectives, i as unref, ay as VTooltip, a as openBlock, j as createBlock, I as Icon, ax as _export_sfc } from "./vendor.2833ae3d.js";
20
+ import { d as defineComponent, az as useClipboard, I as Icon, ay as VTooltip, ax as _export_sfc, M as withDirectives, a as openBlock, j as createBlock } from "./vendor.31c91490.js";
21
21
  const __default__ = {
22
22
  name: "HstCopyIcon"
23
23
  };
@@ -25,27 +25,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
25
25
  props: {
26
26
  content: { type: String, required: true }
27
27
  },
28
- setup(__props) {
28
+ setup(__props, { expose }) {
29
+ expose();
29
30
  const props = __props;
30
31
  const { copy, copied } = useClipboard();
31
32
  const action = () => copy(props.content);
32
- return (_ctx, _cache) => {
33
- return withDirectives((openBlock(), createBlock(unref(Icon), {
34
- icon: "carbon:copy-file",
35
- class: "htw-w-4 htw-h-4 htw-opacity-50 hover:htw-opacity-100 hover:htw-text-primary-500 htw-cursor-pointer",
36
- onClick: _cache[0] || (_cache[0] = ($event) => action())
37
- }, null, 512)), [
38
- [unref(VTooltip), {
39
- content: "Copied!",
40
- triggers: [],
41
- shown: unref(copied),
42
- distance: 12,
43
- delay: 0
44
- }]
45
- ]);
46
- };
33
+ const __returned__ = { props, copy, copied, action, Icon, vTooltip: VTooltip };
34
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
35
+ return __returned__;
47
36
  }
48
37
  }));
38
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
39
+ return withDirectives((openBlock(), createBlock($setup["Icon"], {
40
+ icon: "carbon:copy-file",
41
+ class: "htw-w-4 htw-h-4 htw-opacity-50 hover:htw-opacity-100 hover:htw-text-primary-500 htw-cursor-pointer",
42
+ onClick: _cache[0] || (_cache[0] = ($event) => $setup.action())
43
+ }, null, 512)), [
44
+ [$setup["vTooltip"], {
45
+ content: "Copied!",
46
+ triggers: [],
47
+ shown: $setup.copied,
48
+ distance: 12,
49
+ delay: 0
50
+ }]
51
+ ]);
52
+ }
49
53
  _sfc_main.__file = "src/components/HstCopyIcon.vue";
50
- var HstCopyIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/akryum/Projects/histoire/packages/histoire-controls/src/components/HstCopyIcon.vue"]]);
54
+ var HstCopyIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/akryum/Projects/histoire/packages/histoire-controls/src/components/HstCopyIcon.vue"]]);
51
55
  export { HstCopyIcon as H };