@histoire/controls 1.0.0-alpha.1 → 1.0.0-alpha.2

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 (45) hide show
  1. package/dist/components/HstWrapper.vue.d.ts +4 -4
  2. package/dist/components/button/HstButton.vue.d.ts +3 -3
  3. package/dist/components/button/HstButtonGroup.vue.d.ts +3 -3
  4. package/dist/components/checkbox/HstCheckbox.vue.d.ts +3 -3
  5. package/dist/components/checkbox/HstCheckboxList.vue.d.ts +3 -3
  6. package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +3 -1
  7. package/dist/components/colorselect/HstColorSelect.vue.d.ts +3 -3
  8. package/dist/components/design-tokens/HstColorShades.vue.d.ts +4 -4
  9. package/dist/components/design-tokens/HstTokenGrid.vue.d.ts +4 -4
  10. package/dist/components/design-tokens/HstTokenList.vue.d.ts +4 -4
  11. package/dist/components/json/HstJson.vue.d.ts +6 -4
  12. package/dist/components/number/HstNumber.vue.d.ts +6 -4
  13. package/dist/components/radio/HstRadio.vue.d.ts +3 -3
  14. package/dist/components/select/CustomSelect.vue.d.ts +4 -4
  15. package/dist/components/select/HstSelect.vue.d.ts +3 -3
  16. package/dist/components/slider/HstSlider.vue.d.ts +3 -1
  17. package/dist/components/text/HstText.vue.d.ts +6 -4
  18. package/dist/components/textarea/HstTextarea.vue.d.ts +6 -4
  19. package/dist/index.d.ts +64 -44
  20. package/dist/index.es.js +1876 -1815
  21. package/package.json +3 -3
  22. package/.histoire/dist/__sandbox.html +0 -16
  23. package/.histoire/dist/assets/BaseEmpty.d30f3079.js +0 -11
  24. package/.histoire/dist/assets/HomeView.8e044be6.js +0 -24
  25. package/.histoire/dist/assets/HstCheckbox.story.3d04d85b.js +0 -144
  26. package/.histoire/dist/assets/HstColorShades.story.68cf74d1.js +0 -532
  27. package/.histoire/dist/assets/HstCopyIcon.e40e725e.js +0 -51
  28. package/.histoire/dist/assets/HstNumber.story.1e1964ff.js +0 -160
  29. package/.histoire/dist/assets/HstSelect.story.04860383.js +0 -277
  30. package/.histoire/dist/assets/HstText.story.c915d831.js +0 -137
  31. package/.histoire/dist/assets/HstTextarea.story.802b9c26.js +0 -105
  32. package/.histoire/dist/assets/HstTokenGrid.story.025819d6.js +0 -148
  33. package/.histoire/dist/assets/HstTokenList.story.d3aa6575.js +0 -176
  34. package/.histoire/dist/assets/HstWrapper.246b6982.js +0 -56
  35. package/.histoire/dist/assets/SearchPane.daa2675c.js +0 -426
  36. package/.histoire/dist/assets/StoryView.2f64dad1.js +0 -2260
  37. package/.histoire/dist/assets/bundle-main.784e5bf7.js +0 -1156
  38. package/.histoire/dist/assets/bundle-sandbox.5e153933.js +0 -84
  39. package/.histoire/dist/assets/const.268165fd.js +0 -658
  40. package/.histoire/dist/assets/global-components.6736b2a9.js +0 -5722
  41. package/.histoire/dist/assets/search-docs-data.b9a75539.js +0 -6
  42. package/.histoire/dist/assets/style.04507241.css +0 -2504
  43. package/.histoire/dist/assets/vendor.2833ae3d.js +0 -28970
  44. package/.histoire/dist/histoire.svg +0 -51
  45. package/.histoire/dist/index.html +0 -16
@@ -1,532 +0,0 @@
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, 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" };
31
- const __default__ = {
32
- name: "HstColorShades"
33
- };
34
- const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
35
- props: {
36
- shades: { type: Object, required: true },
37
- getName: { type: Function, required: false },
38
- search: { type: String, required: false }
39
- },
40
- setup(__props) {
41
- const props = __props;
42
- const shadesWithName = computed(() => {
43
- const shades = props.shades;
44
- const getName = props.getName;
45
- return Object.entries(shades).map(([key, color]) => {
46
- const name = getName ? getName(key, color) : key;
47
- return {
48
- key,
49
- color,
50
- name
51
- };
52
- });
53
- });
54
- const displayedShades = computed(() => {
55
- let list = shadesWithName.value;
56
- if (props.search) {
57
- const reg = new RegExp(props.search, "i");
58
- list = list.filter(({ name }) => reg.test(name));
59
- }
60
- return list;
61
- });
62
- 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
- };
112
- }
113
- }));
114
- _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"]]);
116
- const _sfc_main = /* @__PURE__ */ defineComponent({
117
- name: "HstColorShades.story",
118
- setup(__props) {
119
- const colors = {
120
- slate: {
121
- 50: "#f8fafc",
122
- 100: "#f1f5f9",
123
- 200: "#e2e8f0",
124
- 300: "#cbd5e1",
125
- 400: "#94a3b8",
126
- 500: "#64748b",
127
- 600: "#475569",
128
- 700: "#334155",
129
- 750: "#283548",
130
- 800: "#1e293b",
131
- 850: "#151f32",
132
- 900: "#0f172a",
133
- 950: "#09101f"
134
- },
135
- gray: {
136
- 50: "#f9fafb",
137
- 100: "#f3f4f6",
138
- 200: "#e5e7eb",
139
- 300: "#d1d5db",
140
- 400: "#9ca3af",
141
- 500: "#6b7280",
142
- 600: "#4b5563",
143
- 700: "#374151",
144
- 750: "#2b3546",
145
- 800: "#1f2937",
146
- 850: "#18212f",
147
- 900: "#111827",
148
- 950: "#0c101d"
149
- },
150
- zinc: {
151
- 50: "#fafafa",
152
- 100: "#f4f4f5",
153
- 200: "#e4e4e7",
154
- 300: "#d4d4d8",
155
- 400: "#a1a1aa",
156
- 500: "#71717a",
157
- 600: "#52525b",
158
- 700: "#3f3f46",
159
- 750: "#323238",
160
- 800: "#27272a",
161
- 850: "#1f1f21",
162
- 900: "#18181b",
163
- 950: "#101012"
164
- },
165
- neutral: {
166
- 50: "#fafafa",
167
- 100: "#f5f5f5",
168
- 200: "#e5e5e5",
169
- 300: "#d4d4d4",
170
- 400: "#a3a3a3",
171
- 500: "#737373",
172
- 600: "#525252",
173
- 700: "#404040",
174
- 750: "#333333",
175
- 800: "#262626",
176
- 850: "#1f1f1f",
177
- 900: "#171717",
178
- 950: "#0f0f0f"
179
- },
180
- stone: {
181
- 50: "#fafaf9",
182
- 100: "#f5f5f4",
183
- 200: "#e7e5e4",
184
- 300: "#d6d3d1",
185
- 400: "#a8a29e",
186
- 500: "#78716c",
187
- 600: "#57534e",
188
- 700: "#44403c",
189
- 750: "#363230",
190
- 800: "#292524",
191
- 850: "#211e1c",
192
- 900: "#1c1917",
193
- 950: "#171412"
194
- },
195
- red: {
196
- 50: "#fef2f2",
197
- 100: "#fee2e2",
198
- 200: "#fecaca",
199
- 300: "#fca5a5",
200
- 400: "#f87171",
201
- 500: "#ef4444",
202
- 600: "#dc2626",
203
- 700: "#b91c1c",
204
- 800: "#991b1b",
205
- 900: "#7f1d1d"
206
- },
207
- orange: {
208
- 50: "#fff7ed",
209
- 100: "#ffedd5",
210
- 200: "#fed7aa",
211
- 300: "#fdba74",
212
- 400: "#fb923c",
213
- 500: "#f97316",
214
- 600: "#ea580c",
215
- 700: "#c2410c",
216
- 800: "#9a3412",
217
- 900: "#7c2d12"
218
- },
219
- amber: {
220
- 50: "#fffbeb",
221
- 100: "#fef3c7",
222
- 200: "#fde68a",
223
- 300: "#fcd34d",
224
- 400: "#fbbf24",
225
- 500: "#f59e0b",
226
- 600: "#d97706",
227
- 700: "#b45309",
228
- 800: "#92400e",
229
- 900: "#78350f"
230
- },
231
- yellow: {
232
- 50: "#fefce8",
233
- 100: "#fef9c3",
234
- 200: "#fef08a",
235
- 300: "#fde047",
236
- 400: "#facc15",
237
- 500: "#eab308",
238
- 600: "#ca8a04",
239
- 700: "#a16207",
240
- 800: "#854d0e",
241
- 900: "#713f12"
242
- },
243
- lime: {
244
- 50: "#f7fee7",
245
- 100: "#ecfccb",
246
- 200: "#d9f99d",
247
- 300: "#bef264",
248
- 400: "#a3e635",
249
- 500: "#84cc16",
250
- 600: "#65a30d",
251
- 700: "#4d7c0f",
252
- 800: "#3f6212",
253
- 900: "#365314"
254
- },
255
- green: {
256
- 50: "#f0fdf4",
257
- 100: "#dcfce7",
258
- 200: "#bbf7d0",
259
- 300: "#86efac",
260
- 400: "#4ade80",
261
- 500: "#22c55e",
262
- 600: "#16a34a",
263
- 700: "#15803d",
264
- 800: "#166534",
265
- 900: "#14532d"
266
- },
267
- emerald: {
268
- 50: "#ecfdf5",
269
- 100: "#d1fae5",
270
- 200: "#a7f3d0",
271
- 300: "#6ee7b7",
272
- 400: "#34d399",
273
- 500: "#10b981",
274
- 600: "#059669",
275
- 700: "#047857",
276
- 800: "#065f46",
277
- 900: "#064e3b"
278
- },
279
- teal: {
280
- 50: "#f0fdfa",
281
- 100: "#ccfbf1",
282
- 200: "#99f6e4",
283
- 300: "#5eead4",
284
- 400: "#2dd4bf",
285
- 500: "#14b8a6",
286
- 600: "#0d9488",
287
- 700: "#0f766e",
288
- 800: "#115e59",
289
- 900: "#134e4a"
290
- },
291
- cyan: {
292
- 50: "#ecfeff",
293
- 100: "#cffafe",
294
- 200: "#a5f3fc",
295
- 300: "#67e8f9",
296
- 400: "#22d3ee",
297
- 500: "#06b6d4",
298
- 600: "#0891b2",
299
- 700: "#0e7490",
300
- 800: "#155e75",
301
- 900: "#164e63"
302
- },
303
- sky: {
304
- 50: "#f0f9ff",
305
- 100: "#e0f2fe",
306
- 200: "#bae6fd",
307
- 300: "#7dd3fc",
308
- 400: "#38bdf8",
309
- 500: "#0ea5e9",
310
- 600: "#0284c7",
311
- 700: "#0369a1",
312
- 800: "#075985",
313
- 900: "#0c4a6e"
314
- },
315
- blue: {
316
- 50: "#eff6ff",
317
- 100: "#dbeafe",
318
- 200: "#bfdbfe",
319
- 300: "#93c5fd",
320
- 400: "#60a5fa",
321
- 500: "#3b82f6",
322
- 600: "#2563eb",
323
- 700: "#1d4ed8",
324
- 800: "#1e40af",
325
- 900: "#1e3a8a"
326
- },
327
- indigo: {
328
- 50: "#eef2ff",
329
- 100: "#e0e7ff",
330
- 200: "#c7d2fe",
331
- 300: "#a5b4fc",
332
- 400: "#818cf8",
333
- 500: "#6366f1",
334
- 600: "#4f46e5",
335
- 700: "#4338ca",
336
- 800: "#3730a3",
337
- 900: "#312e81"
338
- },
339
- violet: {
340
- 50: "#f5f3ff",
341
- 100: "#ede9fe",
342
- 200: "#ddd6fe",
343
- 300: "#c4b5fd",
344
- 400: "#a78bfa",
345
- 500: "#8b5cf6",
346
- 600: "#7c3aed",
347
- 700: "#6d28d9",
348
- 800: "#5b21b6",
349
- 900: "#4c1d95"
350
- },
351
- purple: {
352
- 50: "#faf5ff",
353
- 100: "#f3e8ff",
354
- 200: "#e9d5ff",
355
- 300: "#d8b4fe",
356
- 400: "#c084fc",
357
- 500: "#a855f7",
358
- 600: "#9333ea",
359
- 700: "#7e22ce",
360
- 800: "#6b21a8",
361
- 900: "#581c87"
362
- },
363
- fuchsia: {
364
- 50: "#fdf4ff",
365
- 100: "#fae8ff",
366
- 200: "#f5d0fe",
367
- 300: "#f0abfc",
368
- 400: "#e879f9",
369
- 500: "#d946ef",
370
- 600: "#c026d3",
371
- 700: "#a21caf",
372
- 800: "#86198f",
373
- 900: "#701a75"
374
- },
375
- pink: {
376
- 50: "#fdf2f8",
377
- 100: "#fce7f3",
378
- 200: "#fbcfe8",
379
- 300: "#f9a8d4",
380
- 400: "#f472b6",
381
- 500: "#ec4899",
382
- 600: "#db2777",
383
- 700: "#be185d",
384
- 800: "#9d174d",
385
- 900: "#831843"
386
- },
387
- rose: {
388
- 50: "#fff1f2",
389
- 100: "#ffe4e6",
390
- 200: "#fecdd3",
391
- 300: "#fda4af",
392
- 400: "#fb7185",
393
- 500: "#f43f5e",
394
- 600: "#e11d48",
395
- 700: "#be123c",
396
- 800: "#9f1239",
397
- 900: "#881337"
398
- }
399
- };
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": ""
407
- }, {
408
- 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
- ]),
525
- _: 1
526
- });
527
- };
528
- }
529
- });
530
- _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"]]);
532
- export { HstColorShades_story as default };
@@ -1,51 +0,0 @@
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, 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";
21
- const __default__ = {
22
- name: "HstCopyIcon"
23
- };
24
- const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
25
- props: {
26
- content: { type: String, required: true }
27
- },
28
- setup(__props) {
29
- const props = __props;
30
- const { copy, copied } = useClipboard();
31
- 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
- };
47
- }
48
- }));
49
- _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"]]);
51
- export { HstCopyIcon as H };