nuxt-ui-tools 1.24.0 → 1.25.1

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 (210) hide show
  1. package/dist/module.d.mts +3 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +8 -0
  4. package/dist/runtime/display/components/blocks/display-accordion.d.vue.ts +4 -0
  5. package/dist/runtime/display/components/blocks/display-accordion.vue +96 -0
  6. package/dist/runtime/display/components/blocks/display-accordion.vue.d.ts +4 -0
  7. package/dist/runtime/display/components/blocks/display-alert.d.vue.ts +4 -0
  8. package/dist/runtime/display/components/blocks/display-alert.vue +136 -0
  9. package/dist/runtime/display/components/blocks/display-alert.vue.d.ts +4 -0
  10. package/dist/runtime/display/components/blocks/display-breakdown.d.vue.ts +4 -0
  11. package/dist/runtime/display/components/blocks/display-breakdown.vue +184 -0
  12. package/dist/runtime/display/components/blocks/display-breakdown.vue.d.ts +4 -0
  13. package/dist/runtime/display/components/blocks/display-chart.d.vue.ts +4 -0
  14. package/dist/runtime/display/components/blocks/display-chart.vue +241 -0
  15. package/dist/runtime/display/components/blocks/display-chart.vue.d.ts +4 -0
  16. package/dist/runtime/display/components/blocks/display-code.d.vue.ts +4 -0
  17. package/dist/runtime/display/components/blocks/display-code.vue +144 -0
  18. package/dist/runtime/display/components/blocks/display-code.vue.d.ts +4 -0
  19. package/dist/runtime/display/components/blocks/display-date.d.vue.ts +4 -0
  20. package/dist/runtime/display/components/blocks/display-date.vue +179 -0
  21. package/dist/runtime/display/components/blocks/display-date.vue.d.ts +4 -0
  22. package/dist/runtime/display/components/blocks/display-diff.d.vue.ts +4 -0
  23. package/dist/runtime/display/components/blocks/display-diff.vue +154 -0
  24. package/dist/runtime/display/components/blocks/display-diff.vue.d.ts +4 -0
  25. package/dist/runtime/display/components/blocks/display-empty.d.vue.ts +4 -0
  26. package/dist/runtime/display/components/blocks/display-empty.vue +75 -0
  27. package/dist/runtime/display/components/blocks/display-empty.vue.d.ts +4 -0
  28. package/dist/runtime/display/components/blocks/display-facts.d.vue.ts +4 -0
  29. package/dist/runtime/display/components/blocks/display-facts.vue +195 -0
  30. package/dist/runtime/display/components/blocks/display-facts.vue.d.ts +4 -0
  31. package/dist/runtime/display/components/blocks/display-heading.d.vue.ts +4 -0
  32. package/dist/runtime/display/components/blocks/display-heading.vue +103 -0
  33. package/dist/runtime/display/components/blocks/display-heading.vue.d.ts +4 -0
  34. package/dist/runtime/display/components/blocks/display-list.d.vue.ts +4 -0
  35. package/dist/runtime/display/components/blocks/display-list.vue +301 -0
  36. package/dist/runtime/display/components/blocks/display-list.vue.d.ts +4 -0
  37. package/dist/runtime/display/components/blocks/display-media.d.vue.ts +4 -0
  38. package/dist/runtime/display/components/blocks/display-media.vue +336 -0
  39. package/dist/runtime/display/components/blocks/display-media.vue.d.ts +4 -0
  40. package/dist/runtime/display/components/blocks/display-meter.d.vue.ts +4 -0
  41. package/dist/runtime/display/components/blocks/display-meter.vue +302 -0
  42. package/dist/runtime/display/components/blocks/display-meter.vue.d.ts +4 -0
  43. package/dist/runtime/display/components/blocks/display-person.d.vue.ts +4 -0
  44. package/dist/runtime/display/components/blocks/display-person.vue +153 -0
  45. package/dist/runtime/display/components/blocks/display-person.vue.d.ts +4 -0
  46. package/dist/runtime/display/components/blocks/display-record.d.vue.ts +4 -0
  47. package/dist/runtime/display/components/blocks/display-record.vue +268 -0
  48. package/dist/runtime/display/components/blocks/display-record.vue.d.ts +4 -0
  49. package/dist/runtime/display/components/blocks/display-stat.d.vue.ts +4 -0
  50. package/dist/runtime/display/components/blocks/display-stat.vue +189 -0
  51. package/dist/runtime/display/components/blocks/display-stat.vue.d.ts +4 -0
  52. package/dist/runtime/display/components/blocks/display-table.d.vue.ts +4 -0
  53. package/dist/runtime/display/components/blocks/display-table.vue +136 -0
  54. package/dist/runtime/display/components/blocks/display-table.vue.d.ts +4 -0
  55. package/dist/runtime/display/components/blocks/display-text.d.vue.ts +4 -0
  56. package/dist/runtime/display/components/blocks/display-text.vue +141 -0
  57. package/dist/runtime/display/components/blocks/display-text.vue.d.ts +4 -0
  58. package/dist/runtime/display/components/blocks/display-timeline.d.vue.ts +4 -0
  59. package/dist/runtime/display/components/blocks/display-timeline.vue +238 -0
  60. package/dist/runtime/display/components/blocks/display-timeline.vue.d.ts +4 -0
  61. package/dist/runtime/display/components/display.d.vue.ts +24 -0
  62. package/dist/runtime/display/components/display.vue +21 -0
  63. package/dist/runtime/display/components/display.vue.d.ts +24 -0
  64. package/dist/runtime/display/components/parts/display-actions.d.vue.ts +9 -0
  65. package/dist/runtime/display/components/parts/display-actions.vue +27 -0
  66. package/dist/runtime/display/components/parts/display-actions.vue.d.ts +9 -0
  67. package/dist/runtime/display/components/parts/display-chip.d.vue.ts +11 -0
  68. package/dist/runtime/display/components/parts/display-chip.vue +71 -0
  69. package/dist/runtime/display/components/parts/display-chip.vue.d.ts +11 -0
  70. package/dist/runtime/display/components/parts/display-copy.d.vue.ts +6 -0
  71. package/dist/runtime/display/components/parts/display-copy.vue +27 -0
  72. package/dist/runtime/display/components/parts/display-copy.vue.d.ts +6 -0
  73. package/dist/runtime/display/components/parts/display-empty-line.d.vue.ts +7 -0
  74. package/dist/runtime/display/components/parts/display-empty-line.vue +21 -0
  75. package/dist/runtime/display/components/parts/display-empty-line.vue.d.ts +7 -0
  76. package/dist/runtime/display/components/parts/display-fact-value.d.vue.ts +7 -0
  77. package/dist/runtime/display/components/parts/display-fact-value.vue +36 -0
  78. package/dist/runtime/display/components/parts/display-fact-value.vue.d.ts +7 -0
  79. package/dist/runtime/display/components/parts/display-load-error.d.vue.ts +7 -0
  80. package/dist/runtime/display/components/parts/display-load-error.vue +29 -0
  81. package/dist/runtime/display/components/parts/display-load-error.vue.d.ts +7 -0
  82. package/dist/runtime/display/components/parts/display-more.d.vue.ts +10 -0
  83. package/dist/runtime/display/components/parts/display-more.vue +23 -0
  84. package/dist/runtime/display/components/parts/display-more.vue.d.ts +10 -0
  85. package/dist/runtime/display/components/parts/display-record-media.d.vue.ts +11 -0
  86. package/dist/runtime/display/components/parts/display-record-media.vue +61 -0
  87. package/dist/runtime/display/components/parts/display-record-media.vue.d.ts +11 -0
  88. package/dist/runtime/display/components/parts/display-render.d.ts +10 -0
  89. package/dist/runtime/display/components/parts/display-render.js +5 -0
  90. package/dist/runtime/display/components/parts/display-skeleton.d.vue.ts +7 -0
  91. package/dist/runtime/display/components/parts/display-skeleton.vue +67 -0
  92. package/dist/runtime/display/components/parts/display-skeleton.vue.d.ts +7 -0
  93. package/dist/runtime/display/composables/use-display-config.d.ts +6 -0
  94. package/dist/runtime/display/composables/use-display-config.js +11 -0
  95. package/dist/runtime/display/composables/use-display-file-preview.d.ts +9 -0
  96. package/dist/runtime/display/composables/use-display-file-preview.js +11 -0
  97. package/dist/runtime/display/composables/use-display-icons.d.ts +8 -0
  98. package/dist/runtime/display/composables/use-display-icons.js +62 -0
  99. package/dist/runtime/display/composables/use-display-locale.d.ts +5 -0
  100. package/dist/runtime/display/composables/use-display-locale.js +5 -0
  101. package/dist/runtime/display/composables/use-display-number.d.ts +2 -0
  102. package/dist/runtime/display/composables/use-display-number.js +7 -0
  103. package/dist/runtime/display/composables/use-display-reveal.d.ts +14 -0
  104. package/dist/runtime/display/composables/use-display-reveal.js +15 -0
  105. package/dist/runtime/display/composables/use-display-url.d.ts +26 -0
  106. package/dist/runtime/display/composables/use-display-url.js +46 -0
  107. package/dist/runtime/display/directives/reveal-truncated.d.ts +10 -0
  108. package/dist/runtime/display/directives/reveal-truncated.js +31 -0
  109. package/dist/runtime/display/index.d.ts +4 -0
  110. package/dist/runtime/display/index.js +3 -0
  111. package/dist/runtime/display/plugins/display-tones.d.ts +3 -0
  112. package/dist/runtime/display/plugins/display-tones.js +17 -0
  113. package/dist/runtime/display/types/blocks/accordion.d.ts +18 -0
  114. package/dist/runtime/display/types/blocks/accordion.js +0 -0
  115. package/dist/runtime/display/types/blocks/alert.d.ts +31 -0
  116. package/dist/runtime/display/types/blocks/alert.js +0 -0
  117. package/dist/runtime/display/types/blocks/breakdown.d.ts +36 -0
  118. package/dist/runtime/display/types/blocks/breakdown.js +0 -0
  119. package/dist/runtime/display/types/blocks/chart.d.ts +23 -0
  120. package/dist/runtime/display/types/blocks/chart.js +0 -0
  121. package/dist/runtime/display/types/blocks/code.d.ts +21 -0
  122. package/dist/runtime/display/types/blocks/code.js +0 -0
  123. package/dist/runtime/display/types/blocks/date.d.ts +27 -0
  124. package/dist/runtime/display/types/blocks/date.js +0 -0
  125. package/dist/runtime/display/types/blocks/diff.d.ts +20 -0
  126. package/dist/runtime/display/types/blocks/diff.js +0 -0
  127. package/dist/runtime/display/types/blocks/empty.d.ts +13 -0
  128. package/dist/runtime/display/types/blocks/empty.js +0 -0
  129. package/dist/runtime/display/types/blocks/facts.d.ts +52 -0
  130. package/dist/runtime/display/types/blocks/facts.js +0 -0
  131. package/dist/runtime/display/types/blocks/heading.d.ts +19 -0
  132. package/dist/runtime/display/types/blocks/heading.js +0 -0
  133. package/dist/runtime/display/types/blocks/list.d.ts +36 -0
  134. package/dist/runtime/display/types/blocks/list.js +0 -0
  135. package/dist/runtime/display/types/blocks/media.d.ts +42 -0
  136. package/dist/runtime/display/types/blocks/media.js +0 -0
  137. package/dist/runtime/display/types/blocks/meter.d.ts +48 -0
  138. package/dist/runtime/display/types/blocks/meter.js +0 -0
  139. package/dist/runtime/display/types/blocks/person.d.ts +34 -0
  140. package/dist/runtime/display/types/blocks/person.js +0 -0
  141. package/dist/runtime/display/types/blocks/record.d.ts +44 -0
  142. package/dist/runtime/display/types/blocks/record.js +0 -0
  143. package/dist/runtime/display/types/blocks/stat.d.ts +44 -0
  144. package/dist/runtime/display/types/blocks/stat.js +0 -0
  145. package/dist/runtime/display/types/blocks/table.d.ts +28 -0
  146. package/dist/runtime/display/types/blocks/table.js +0 -0
  147. package/dist/runtime/display/types/blocks/text.d.ts +22 -0
  148. package/dist/runtime/display/types/blocks/text.js +0 -0
  149. package/dist/runtime/display/types/blocks/timeline.d.ts +37 -0
  150. package/dist/runtime/display/types/blocks/timeline.js +0 -0
  151. package/dist/runtime/display/types/config.d.ts +60 -0
  152. package/dist/runtime/display/types/config.js +0 -0
  153. package/dist/runtime/display/types/index.d.ts +22 -0
  154. package/dist/runtime/display/types/index.js +0 -0
  155. package/dist/runtime/display/types/registry.d.ts +57 -0
  156. package/dist/runtime/display/types/registry.js +0 -0
  157. package/dist/runtime/display/types/shared.d.ts +80 -0
  158. package/dist/runtime/display/types/shared.js +0 -0
  159. package/dist/runtime/display/utils/classes.d.ts +3 -0
  160. package/dist/runtime/display/utils/classes.js +7 -0
  161. package/dist/runtime/display/utils/config.d.ts +11 -0
  162. package/dist/runtime/display/utils/config.js +17 -0
  163. package/dist/runtime/display/utils/content.d.ts +7 -0
  164. package/dist/runtime/display/utils/content.js +13 -0
  165. package/dist/runtime/display/utils/dates.d.ts +16 -0
  166. package/dist/runtime/display/utils/dates.js +34 -0
  167. package/dist/runtime/display/utils/json.d.ts +7 -0
  168. package/dist/runtime/display/utils/json.js +15 -0
  169. package/dist/runtime/display/utils/links.d.ts +12 -0
  170. package/dist/runtime/display/utils/links.js +9 -0
  171. package/dist/runtime/display/utils/meter.d.ts +7 -0
  172. package/dist/runtime/display/utils/meter.js +13 -0
  173. package/dist/runtime/display/utils/registry.d.ts +47 -0
  174. package/dist/runtime/display/utils/registry.js +64 -0
  175. package/dist/runtime/display/utils/tone-css.d.ts +7 -0
  176. package/dist/runtime/display/utils/tone-css.js +38 -0
  177. package/dist/runtime/display/utils/tone.d.ts +26 -0
  178. package/dist/runtime/display/utils/tone.js +38 -0
  179. package/dist/runtime/display/utils/urls.d.ts +10 -0
  180. package/dist/runtime/display/utils/urls.js +33 -0
  181. package/dist/runtime/file-preview/components/shell/file-preview-stage.vue +5 -3
  182. package/dist/runtime/file-preview/composables/use-file-preview-source.d.ts +7 -0
  183. package/dist/runtime/file-preview/composables/use-file-preview-source.js +7 -1
  184. package/dist/runtime/file-preview/index.d.ts +1 -0
  185. package/dist/runtime/file-preview/index.js +1 -0
  186. package/dist/runtime/file-preview/types/file.d.ts +9 -0
  187. package/dist/runtime/file-preview/utils/errors.d.ts +30 -0
  188. package/dist/runtime/file-preview/utils/errors.js +26 -0
  189. package/dist/runtime/form/components/utils/form-file-preview.vue +7 -2
  190. package/dist/runtime/form/composables/use-form-root.js +17 -4
  191. package/dist/runtime/form/composables/use-form-runtime.js +7 -2
  192. package/dist/runtime/form/fields/index.d.ts +5 -0
  193. package/dist/runtime/form/fields/info/component.vue +51 -19
  194. package/dist/runtime/form/fields/info/config.d.ts +5 -0
  195. package/dist/runtime/form/fields/info/config.js +2 -1
  196. package/dist/runtime/form/fields/info/types.d.ts +78 -4
  197. package/dist/runtime/form/fields/info/use-info-display.d.ts +20 -0
  198. package/dist/runtime/form/fields/info/use-info-display.js +82 -0
  199. package/dist/runtime/form/fields/upload/upload-item.vue +10 -2
  200. package/dist/runtime/form/types/api.d.ts +6 -0
  201. package/dist/runtime/form/types/runtime.d.ts +2 -0
  202. package/dist/runtime/form/utils/dynamic.d.ts +6 -0
  203. package/dist/runtime/form/utils/dynamic.js +7 -0
  204. package/dist/runtime/i18n/locales/en.js +27 -0
  205. package/dist/runtime/i18n/locales/fr.js +27 -0
  206. package/dist/runtime/i18n/types.d.ts +35 -0
  207. package/dist/runtime/shared/styles/tokens.css +1 -1
  208. package/dist/runtime/shared/utils/file.d.ts +1 -1
  209. package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
  210. package/package.json +16 -1
@@ -0,0 +1,141 @@
1
+ <script setup>
2
+ import UIcon from "@nuxt/ui/components/Icon.vue";
3
+ import { useResizeObserver } from "@vueuse/core";
4
+ import { computed, ref, useTemplateRef } from "vue";
5
+ import { useDisplayAppUi } from "../../composables/use-display-config";
6
+ import { useDisplayLocale } from "../../composables/use-display-locale";
7
+ import { vRevealTruncated } from "../../directives/reveal-truncated";
8
+ import { resolveDisplayClasses } from "../../utils/classes";
9
+ import { isDisplayContentEmpty } from "../../utils/content";
10
+ import { displayToneClass } from "../../utils/tone";
11
+ import DisplayRender from "../parts/display-render";
12
+ import DisplaySkeleton from "../parts/display-skeleton.vue";
13
+ const {
14
+ appearance = "body",
15
+ text = void 0,
16
+ paragraphs = void 0,
17
+ title = void 0,
18
+ icon = void 0,
19
+ author = void 0,
20
+ meta = void 0,
21
+ tone = void 0,
22
+ maxLines = void 0,
23
+ loading = false,
24
+ ui = void 0
25
+ } = defineProps({
26
+ appearance: { type: String, required: false },
27
+ text: { type: [String, Number, Function, Object, Boolean, null, Array], required: false, skipCheck: true },
28
+ paragraphs: { type: Array, required: false },
29
+ title: { type: [String, Number, Function, Object, Boolean, null, Array], required: false, skipCheck: true },
30
+ icon: { type: String, required: false },
31
+ author: { type: [String, Number, Function, Object, Boolean, null, Array], required: false, skipCheck: true },
32
+ meta: { type: [String, Number, Function, Object, Boolean, null, Array], required: false, skipCheck: true },
33
+ tone: { type: String, required: false },
34
+ maxLines: { type: Number, required: false },
35
+ loading: { type: Boolean, required: false },
36
+ ui: { type: Object, required: false }
37
+ });
38
+ const ROOT_CLASSES = {
39
+ body: "text-sm leading-relaxed text-default",
40
+ caption: "flex items-start gap-1.5 text-xs leading-snug text-dimmed",
41
+ lead: "text-base leading-snug text-highlighted",
42
+ legal: "rounded-e-[var(--nut-display-radius)] border border-s-[3px] border-muted border-s-[var(--nut-tone-line)] bg-elevated px-3.5 py-3",
43
+ muted: "text-sm leading-relaxed text-muted",
44
+ prose: "text-sm leading-relaxed text-default [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2 [&_b]:font-semibold [&_b]:text-highlighted [&_code]:rounded [&_code]:border [&_code]:border-muted [&_code]:bg-elevated [&_code]:px-1 [&_code]:text-[0.88em] [&_li]:my-0.5 [&_ol]:list-decimal [&_ol]:ps-5 [&_strong]:font-semibold [&_strong]:text-highlighted [&_ul]:list-disc [&_ul]:ps-5",
45
+ quote: "border-s-[3px] border-[var(--nut-tone)] ps-4"
46
+ };
47
+ const PARAGRAPH_CLASSES = {
48
+ body: "mt-2 first:mt-0",
49
+ caption: "",
50
+ lead: "mt-2 first:mt-0",
51
+ legal: "mt-1.5 text-xs leading-relaxed text-muted",
52
+ muted: "mt-2 first:mt-0",
53
+ prose: "mt-2 first:mt-0",
54
+ quote: "mt-2 text-[15px] leading-relaxed font-light text-highlighted first:mt-0"
55
+ };
56
+ const { t } = useDisplayLocale();
57
+ const appUi = useDisplayAppUi("text");
58
+ const body = useTemplateRef("body");
59
+ const expanded = ref(false);
60
+ const overflowing = ref(false);
61
+ const resolvedTone = computed(() => tone ?? (appearance === "quote" ? "primary" : "neutral"));
62
+ const blocks = computed(
63
+ () => [text, ...paragraphs ?? []].filter((content) => !isDisplayContentEmpty(content))
64
+ );
65
+ const clampStyle = computed(
66
+ () => maxLines && !expanded.value ? {
67
+ WebkitBoxOrient: "vertical",
68
+ WebkitLineClamp: maxLines,
69
+ display: "-webkit-box",
70
+ overflow: "hidden"
71
+ } : void 0
72
+ );
73
+ const classes = computed(
74
+ () => resolveDisplayClasses(
75
+ {
76
+ footer: "mt-2 text-xs text-muted",
77
+ header: "flex items-center gap-1.5 text-xs font-bold text-toned",
78
+ icon: appearance === "caption" ? "mt-px size-3.5 shrink-0" : "size-3.5 shrink-0",
79
+ paragraph: PARAGRAPH_CLASSES[appearance],
80
+ root: ROOT_CLASSES[appearance],
81
+ title: "min-w-0",
82
+ toggle: "mt-1 cursor-pointer text-xs font-semibold text-primary underline underline-offset-2"
83
+ },
84
+ appUi.value,
85
+ ui
86
+ )
87
+ );
88
+ useResizeObserver(body, () => {
89
+ const element = body.value;
90
+ if (element && !expanded.value)
91
+ overflowing.value = element.scrollHeight > element.clientHeight + 1;
92
+ });
93
+ </script>
94
+
95
+ <template>
96
+ <DisplaySkeleton v-if="loading" :count="Math.max(blocks.length, 2)" />
97
+ <div
98
+ v-else
99
+ :class="[classes.root, displayToneClass(resolvedTone)]"
100
+ :data-appearance="appearance"
101
+ data-display="text"
102
+ >
103
+ <div
104
+ v-if="appearance === 'legal' && (!isDisplayContentEmpty(title) || icon)"
105
+ :class="classes.header"
106
+ >
107
+ <UIcon v-if="icon" :name="icon" :class="classes.icon" />
108
+ <span v-reveal-truncated :class="classes.title"><DisplayRender :content="title" /></span>
109
+ </div>
110
+ <UIcon v-if="appearance === 'caption' && icon" :name="icon" :class="classes.icon" />
111
+ <div ref="body" :style="clampStyle">
112
+ <div
113
+ v-for="(content, index) in blocks"
114
+ :key="index"
115
+ v-reveal-truncated
116
+ :class="classes.paragraph"
117
+ >
118
+ <DisplayRender :content="content" />
119
+ </div>
120
+ </div>
121
+ <button
122
+ v-if="maxLines && (overflowing || expanded)"
123
+ type="button"
124
+ :class="classes.toggle"
125
+ :aria-expanded="expanded"
126
+ @click="expanded = !expanded"
127
+ >
128
+ {{ expanded ? t("display.readLess") : t("display.readMore") }}
129
+ </button>
130
+ <div
131
+ v-if="
132
+ appearance === 'quote' && (!isDisplayContentEmpty(author) || !isDisplayContentEmpty(meta))
133
+ "
134
+ :class="classes.footer"
135
+ >
136
+ <DisplayRender :content="author" />
137
+ <template v-if="!isDisplayContentEmpty(author) && !isDisplayContentEmpty(meta)"> · </template>
138
+ <DisplayRender :content="meta" />
139
+ </div>
140
+ </div>
141
+ </template>
@@ -0,0 +1,4 @@
1
+ import type { DisplayTextProps } from '../../types/index.js';
2
+ declare const __VLS_export: import("vue").DefineComponent<DisplayTextProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DisplayTextProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import type { DisplayTimelineProps } from '../../types/index.js';
2
+ declare const __VLS_export: import("vue").DefineComponent<DisplayTimelineProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DisplayTimelineProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,238 @@
1
+ <script setup>
2
+ import UAvatar from "@nuxt/ui/components/Avatar.vue";
3
+ import UIcon from "@nuxt/ui/components/Icon.vue";
4
+ import { computed } from "vue";
5
+ import { useDisplayAppUi } from "../../composables/use-display-config";
6
+ import { useDisplayIcons } from "../../composables/use-display-icons";
7
+ import { useDisplayLocale } from "../../composables/use-display-locale";
8
+ import { useDisplayReveal } from "../../composables/use-display-reveal";
9
+ import { vRevealTruncated } from "../../directives/reveal-truncated";
10
+ import { resolveDisplayClasses } from "../../utils/classes";
11
+ import { isDisplayContentEmpty, resolveDisplayText } from "../../utils/content";
12
+ import { formatDisplayDate, toDisplayDate } from "../../utils/dates";
13
+ import { displayToneClass, initialsOf, toneFromName } from "../../utils/tone";
14
+ import DisplayEmptyLine from "../parts/display-empty-line.vue";
15
+ import DisplayMore from "../parts/display-more.vue";
16
+ import DisplayRender from "../parts/display-render";
17
+ import DisplaySkeleton from "../parts/display-skeleton.vue";
18
+ const {
19
+ variant = "vertical",
20
+ items,
21
+ current = void 0,
22
+ now = void 0,
23
+ nowLabel = void 0,
24
+ dateFormat = void 0,
25
+ max = void 0,
26
+ step = void 0,
27
+ empty = void 0,
28
+ loading = false,
29
+ ui = void 0
30
+ } = defineProps({
31
+ variant: { type: String, required: false },
32
+ items: { type: Array, required: true },
33
+ current: { type: Number, required: false },
34
+ now: { type: [Date, String, Number], required: false },
35
+ nowLabel: { type: [String, Number, Function], required: false },
36
+ dateFormat: { type: null, required: false },
37
+ loading: { type: Boolean, required: false },
38
+ ui: { type: Object, required: false },
39
+ max: { type: Number, required: false },
40
+ step: { type: Number, required: false },
41
+ empty: { type: [String, Number, Function, Object, Boolean, null, Array], required: false, skipCheck: true }
42
+ });
43
+ const { t, code } = useDisplayLocale();
44
+ const icons = useDisplayIcons();
45
+ const appUi = useDisplayAppUi("timeline");
46
+ const reference = computed(() => toDisplayDate(now) ?? /* @__PURE__ */ new Date());
47
+ const entries = computed(
48
+ () => items.map((item, index) => {
49
+ const date = toDisplayDate(item.date);
50
+ return { ...item, resolvedState: stateOf(item, index, date), timeLabel: timeOf(item, date) };
51
+ })
52
+ );
53
+ const reveal = useDisplayReveal({ items: () => entries.value, max: () => max, step: () => step });
54
+ const nowIndex = computed(
55
+ () => variant === "schedule" ? reveal.visible.value.findIndex((entry) => entry.resolvedState === "upcoming") : -1
56
+ );
57
+ const nowText = computed(
58
+ () => resolveDisplayText(nowLabel) ?? `${t("display.today")} \xB7 ${formatDisplayDate(reference.value, code.value, { day: "numeric", month: "short" })}`
59
+ );
60
+ const classes = computed(
61
+ () => resolveDisplayClasses(
62
+ {
63
+ actor: "flex items-center gap-1.5",
64
+ body: "min-w-0",
65
+ connector: "absolute start-[7.5px] top-4 -bottom-px w-px bg-[var(--ui-border)]",
66
+ description: "mt-0.5 flex flex-wrap items-center gap-1.5 text-xs text-muted",
67
+ empty: "",
68
+ item: variant === "pipeline" ? "relative flex min-w-0 flex-1 flex-col items-center gap-1.5 text-center" : variant === "log" ? "flex items-center gap-2.5 px-3 py-1.5 text-sm" : "relative grid grid-cols-[1rem_minmax(0,1fr)] gap-x-3 pb-3.5 last:pb-0",
69
+ marker: variant === "pipeline" ? "relative z-[1] grid size-6 place-items-center rounded-full border-2 text-[10px] font-bold" : "relative z-[1] mt-1 ms-[3px] size-2.5 rounded-full",
70
+ more: "self-start",
71
+ now: "mb-3.5 flex items-center gap-2 text-[11px] font-bold tracking-[0.06em] text-[var(--nut-display-primary-ink)] uppercase before:h-0.5 before:w-4 before:rounded-full before:bg-[var(--nut-display-primary)] after:h-px after:flex-1 after:bg-[var(--nut-display-primary-line)]",
72
+ root: variant === "log" ? "flex min-w-0 flex-col divide-y divide-muted rounded-[var(--nut-display-radius)] border border-default" : "flex min-w-0 flex-col gap-2",
73
+ time: variant === "log" ? "w-11 shrink-0 font-mono text-[11px] text-dimmed" : "shrink-0 text-xs font-normal text-dimmed",
74
+ title: variant === "pipeline" ? "text-xs font-semibold text-highlighted" : "flex items-baseline justify-between gap-2 text-sm font-semibold text-highlighted"
75
+ },
76
+ appUi.value,
77
+ ui
78
+ )
79
+ );
80
+ function stateOf(item, index, date) {
81
+ if (item.state) return item.state;
82
+ if (variant === "pipeline" && current !== void 0)
83
+ return index < current ? "done" : index === current ? "current" : "upcoming";
84
+ if (date) return date.getTime() > reference.value.getTime() ? "upcoming" : "done";
85
+ return "done";
86
+ }
87
+ function timeOf(item, date) {
88
+ const text = resolveDisplayText(item.time);
89
+ if (text !== void 0 || !date) return text;
90
+ const options = dateFormat ?? (variant === "log" ? { hour: "2-digit", minute: "2-digit" } : { day: "numeric", month: "short" });
91
+ return formatDisplayDate(date, code.value, options);
92
+ }
93
+ function dotClass(state) {
94
+ if (state === "upcoming")
95
+ return "border-[1.5px] border-dashed border-[var(--ui-border-accented)] bg-default";
96
+ if (state === "current") return "bg-[var(--nut-tone)] ring-4 ring-[var(--nut-tone-soft)]";
97
+ return "bg-[var(--nut-tone)] ring-3 ring-[var(--nut-tone-soft)]";
98
+ }
99
+ function stageClass(state) {
100
+ if (state === "done") return "border-[var(--ui-bg-inverted)] bg-inverted text-inverted";
101
+ if (state === "current")
102
+ return "border-[var(--nut-tone)] bg-[var(--nut-tone)] text-[var(--nut-tone-contrast)] ring-4 ring-[var(--nut-tone-soft)]";
103
+ return "border-[var(--ui-border-accented)] bg-default text-dimmed";
104
+ }
105
+ function actorAvatar(name) {
106
+ return {
107
+ alt: name,
108
+ class: displayToneClass(toneFromName(name)),
109
+ size: "3xs",
110
+ text: initialsOf(name),
111
+ ui: {
112
+ fallback: "text-[8px] font-bold text-[var(--nut-tone-ink)]",
113
+ root: "bg-[var(--nut-tone-soft)]"
114
+ }
115
+ };
116
+ }
117
+ </script>
118
+
119
+ <template>
120
+ <DisplaySkeleton v-if="loading" :count="Math.min(Math.max(items.length, 2), 5)" />
121
+ <DisplayEmptyLine v-else-if="!items.length" :content="empty" :class="classes.empty" />
122
+ <div
123
+ v-else-if="variant === 'log'"
124
+ :class="classes.root"
125
+ data-display="timeline"
126
+ data-variant="log"
127
+ >
128
+ <div v-for="(entry, index) in reveal.visible.value" :key="index" :class="classes.item">
129
+ <time :class="classes.time">{{ entry.timeLabel }}</time>
130
+ <UAvatar
131
+ v-if="entry.actor"
132
+ v-bind="actorAvatar(resolveDisplayText(entry.actor.name) ?? '')"
133
+ :src="entry.actor.avatar?.src"
134
+ class="shrink-0"
135
+ />
136
+ <span class="min-w-0 flex-1 text-toned">
137
+ <b v-if="entry.actor" class="font-semibold text-highlighted">{{
138
+ resolveDisplayText(entry.actor.name)
139
+ }}</b>
140
+ {{ " " }}<DisplayRender :content="entry.title" />
141
+ </span>
142
+ </div>
143
+ </div>
144
+ <ol
145
+ v-else-if="variant === 'pipeline'"
146
+ class="m-0 flex list-none p-0"
147
+ data-display="timeline"
148
+ data-variant="pipeline"
149
+ >
150
+ <li
151
+ v-for="(entry, index) in entries"
152
+ :key="index"
153
+ :class="[classes.item, displayToneClass(entry.tone ?? 'primary')]"
154
+ :data-state="entry.resolvedState"
155
+ :aria-current="entry.resolvedState === 'current' ? 'step' : void 0"
156
+ >
157
+ <span
158
+ v-if="index > 0"
159
+ :class="[
160
+ 'absolute top-[11px] -start-1/2 h-0.5 w-full',
161
+ entry.resolvedState === 'upcoming' ? 'bg-[var(--ui-border)]' : 'bg-inverted'
162
+ ]"
163
+ aria-hidden="true"
164
+ />
165
+ <span :class="[classes.marker, stageClass(entry.resolvedState)]">
166
+ <UIcon
167
+ v-if="entry.resolvedState === 'done'"
168
+ :name="entry.icon ?? icons.check"
169
+ class="size-3"
170
+ />
171
+ <UIcon v-else-if="entry.icon" :name="entry.icon" class="size-3" />
172
+ <template v-else>{{ index + 1 }}</template>
173
+ </span>
174
+ <span
175
+ v-reveal-truncated
176
+ :class="[classes.title, entry.resolvedState === 'upcoming' ? 'font-medium text-muted' : '']"
177
+ >
178
+ <DisplayRender :content="entry.title" />
179
+ </span>
180
+ <span v-if="entry.timeLabel" :class="['-mt-1 text-[11px]', classes.time]">{{
181
+ entry.timeLabel
182
+ }}</span>
183
+ </li>
184
+ </ol>
185
+ <div v-else :class="classes.root" data-display="timeline" :data-variant="variant">
186
+ <ol class="m-0 list-none p-0">
187
+ <template v-for="(entry, index) in reveal.visible.value" :key="index">
188
+ <li v-if="index === nowIndex" :class="classes.now" data-display-now>{{ nowText }}</li>
189
+ <li
190
+ :class="[classes.item, displayToneClass(entry.tone ?? 'neutral')]"
191
+ :data-state="entry.resolvedState"
192
+ >
193
+ <span
194
+ v-if="index < reveal.visible.value.length - 1"
195
+ :class="[
196
+ classes.connector,
197
+ reveal.visible.value[index + 1]?.resolvedState === 'upcoming' ? 'bg-[repeating-linear-gradient(var(--ui-border-accented)_0_3px,transparent_3px_6px)]' : ''
198
+ ]"
199
+ aria-hidden="true"
200
+ />
201
+ <span :class="[classes.marker, dotClass(entry.resolvedState)]" aria-hidden="true" />
202
+ <div :class="classes.body">
203
+ <div
204
+ v-reveal-truncated
205
+ :class="[classes.title, entry.resolvedState === 'upcoming' ? 'text-muted' : '']"
206
+ >
207
+ <span class="min-w-0"><DisplayRender :content="entry.title" /></span>
208
+ <time v-if="entry.timeLabel" :class="classes.time">{{ entry.timeLabel }}</time>
209
+ </div>
210
+ <div
211
+ v-if="entry.actor || !isDisplayContentEmpty(entry.description)"
212
+ v-reveal-truncated
213
+ :class="classes.description"
214
+ >
215
+ <span v-if="entry.actor" :class="classes.actor">
216
+ <UAvatar
217
+ v-bind="actorAvatar(resolveDisplayText(entry.actor.name) ?? '')"
218
+ :src="entry.actor.avatar?.src"
219
+ />
220
+ {{ resolveDisplayText(entry.actor.name) }}
221
+ </span>
222
+ <template v-if="entry.actor && !isDisplayContentEmpty(entry.description)">
223
+ ·
224
+ </template>
225
+ <DisplayRender :content="entry.description" />
226
+ </div>
227
+ </div>
228
+ </li>
229
+ </template>
230
+ </ol>
231
+ <DisplayMore
232
+ v-if="reveal.hidden.value"
233
+ :count="reveal.next.value"
234
+ :class="classes.more"
235
+ @reveal="reveal.reveal"
236
+ />
237
+ </div>
238
+ </template>
@@ -0,0 +1,4 @@
1
+ import type { DisplayTimelineProps } from '../../types/index.js';
2
+ declare const __VLS_export: import("vue").DefineComponent<DisplayTimelineProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DisplayTimelineProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import type { DisplayKind, DisplayPropsMap } from '../types/index.js';
2
+ declare const __VLS_export: <TKind extends DisplayKind>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
4
+ display: TKind;
5
+ props: DisplayPropsMap[TKind];
6
+ /** Name of a preset in `appConfig.nuxtUiTools.display.presets[display]`; `props` override it. */
7
+ preset?: string;
8
+ }> & (typeof globalThis extends {
9
+ __VLS_PROPS_FALLBACK: infer P;
10
+ } ? P : {});
11
+ expose: (exposed: {}) => void;
12
+ attrs: any;
13
+ slots: {};
14
+ emit: {};
15
+ }>) => import("vue").VNode & {
16
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
17
+ };
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
21
+ [K in keyof T]: T[K];
22
+ } : {
23
+ [K in keyof T as K]: T[K];
24
+ }) & {};
@@ -0,0 +1,21 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { useDisplayConfig } from "../composables/use-display-config";
4
+ import { applyDisplayPreset } from "../utils/config";
5
+ import { DISPLAY_BLOCKS } from "../utils/registry";
6
+ const {
7
+ display,
8
+ props: blockProps,
9
+ preset = void 0
10
+ } = defineProps({
11
+ display: { type: null, required: true },
12
+ props: { type: null, required: true },
13
+ preset: { type: String, required: false }
14
+ });
15
+ const config = useDisplayConfig();
16
+ const resolved = computed(() => applyDisplayPreset(display, blockProps, preset, config.value));
17
+ </script>
18
+
19
+ <template>
20
+ <component :is="DISPLAY_BLOCKS[display]" v-bind="resolved" />
21
+ </template>
@@ -0,0 +1,24 @@
1
+ import type { DisplayKind, DisplayPropsMap } from '../types/index.js';
2
+ declare const __VLS_export: <TKind extends DisplayKind>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
4
+ display: TKind;
5
+ props: DisplayPropsMap[TKind];
6
+ /** Name of a preset in `appConfig.nuxtUiTools.display.presets[display]`; `props` override it. */
7
+ preset?: string;
8
+ }> & (typeof globalThis extends {
9
+ __VLS_PROPS_FALLBACK: infer P;
10
+ } ? P : {});
11
+ expose: (exposed: {}) => void;
12
+ attrs: any;
13
+ slots: {};
14
+ emit: {};
15
+ }>) => import("vue").VNode & {
16
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
17
+ };
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
21
+ [K in keyof T]: T[K];
22
+ } : {
23
+ [K in keyof T as K]: T[K];
24
+ }) & {};
@@ -0,0 +1,9 @@
1
+ import type { ButtonProps } from '@nuxt/ui/components/Button.vue';
2
+ import type { DisplayAction } from '../../types/index.js';
3
+ type __VLS_Props = {
4
+ actions: readonly DisplayAction[];
5
+ size?: ButtonProps['size'];
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,27 @@
1
+ <script setup>
2
+ import UButton from "@nuxt/ui/components/Button.vue";
3
+ import { computed } from "vue";
4
+ import { resolveDisplayText } from "../../utils/content";
5
+ import { isExternalLink } from "../../utils/links";
6
+ const { actions, size = "sm" } = defineProps({
7
+ actions: { type: Array, required: true },
8
+ size: { type: null, required: false }
9
+ });
10
+ const buttons = computed(
11
+ () => actions.map(({ label, ...action }) => ({
12
+ color: "neutral",
13
+ size,
14
+ variant: "outline",
15
+ ...action,
16
+ label: resolveDisplayText(label),
17
+ // A link out of the app opens in a new tab unless the action sets its own target.
18
+ target: action.target === void 0 && isExternalLink(action.to) ? "_blank" : action.target
19
+ }))
20
+ );
21
+ </script>
22
+
23
+ <template>
24
+ <div>
25
+ <UButton v-for="(button, index) in buttons" :key="index" v-bind="button" />
26
+ </div>
27
+ </template>
@@ -0,0 +1,9 @@
1
+ import type { ButtonProps } from '@nuxt/ui/components/Button.vue';
2
+ import type { DisplayAction } from '../../types/index.js';
3
+ type __VLS_Props = {
4
+ actions: readonly DisplayAction[];
5
+ size?: ButtonProps['size'];
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { DisplayChip, DisplayContent, DisplayText } from '../../types/index.js';
2
+ type __VLS_Props = {
3
+ chip: Omit<DisplayChip, 'label'> & {
4
+ label?: DisplayText;
5
+ };
6
+ /** Rich content drawn instead of the label. */
7
+ content?: DisplayContent;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,71 @@
1
+ <script setup>
2
+ import UBadge from "@nuxt/ui/components/Badge.vue";
3
+ import { twMerge } from "tailwind-merge";
4
+ import { computed } from "vue";
5
+ import { isString } from "../../../shared/utils/predicate";
6
+ import { useDisplayConfig } from "../../composables/use-display-config";
7
+ import { vRevealTruncated } from "../../directives/reveal-truncated";
8
+ import { resolveDisplayText } from "../../utils/content";
9
+ import { displayToneClass, isBuiltinTone } from "../../utils/tone";
10
+ import DisplayRender from "./display-render";
11
+ const { chip, content = void 0 } = defineProps({
12
+ chip: { type: Object, required: true },
13
+ content: { type: [String, Number, Function, Object, Boolean, null, Array], required: false, skipCheck: true }
14
+ });
15
+ const SOFT = "bg-[var(--nut-tone-soft)] text-[var(--nut-tone-ink)] ring-0";
16
+ const VARIANT_CLASSES = [
17
+ [
18
+ "outline",
19
+ "bg-transparent text-[var(--nut-tone-ink)] ring ring-inset ring-[var(--nut-tone-line)]"
20
+ ],
21
+ ["solid", "bg-[var(--nut-tone)] text-[var(--nut-tone-contrast)] ring-0"],
22
+ [
23
+ "subtle",
24
+ "bg-[var(--nut-tone-soft)] text-[var(--nut-tone-ink)] ring ring-inset ring-[var(--nut-tone-line)]"
25
+ ]
26
+ ];
27
+ const CHIP_SLOTS = [
28
+ "base",
29
+ "label",
30
+ "leadingIcon",
31
+ "leadingAvatar",
32
+ "leadingAvatarSize",
33
+ "trailingIcon"
34
+ ];
35
+ const config = useDisplayConfig();
36
+ const badge = computed(() => {
37
+ const { label, tone, ...rest } = chip;
38
+ const variant = rest.variant ?? "soft";
39
+ const custom = tone !== void 0 && !isBuiltinTone(tone);
40
+ return {
41
+ ...rest,
42
+ class: custom ? [displayToneClass(tone), variantClass(variant), rest.class] : rest.class,
43
+ color: custom ? "neutral" : rest.color ?? tone ?? "neutral",
44
+ label: content === void 0 ? resolveDisplayText(label) : void 0,
45
+ size: rest.size ?? "sm",
46
+ ui: chipUi(rest.ui),
47
+ variant
48
+ };
49
+ });
50
+ function chipUi(own) {
51
+ const app = config.value.ui?.chip;
52
+ if (!app) return own;
53
+ const merged = { ...own };
54
+ for (const slot of CHIP_SLOTS) {
55
+ const appClass = app[slot];
56
+ const ownClass = own?.[slot];
57
+ if (appClass !== void 0 && (ownClass === void 0 || isString(ownClass)))
58
+ merged[slot] = twMerge(appClass, ownClass);
59
+ }
60
+ return merged;
61
+ }
62
+ function variantClass(variant) {
63
+ return VARIANT_CLASSES.find(([name]) => name === variant)?.[1] ?? SOFT;
64
+ }
65
+ </script>
66
+
67
+ <template>
68
+ <UBadge v-reveal-truncated v-bind="badge" :data-tone="chip.tone">
69
+ <DisplayRender v-if="content !== void 0" :content="content" />
70
+ </UBadge>
71
+ </template>
@@ -0,0 +1,11 @@
1
+ import type { DisplayChip, DisplayContent, DisplayText } from '../../types/index.js';
2
+ type __VLS_Props = {
3
+ chip: Omit<DisplayChip, 'label'> & {
4
+ label?: DisplayText;
5
+ };
6
+ /** Rich content drawn instead of the label. */
7
+ content?: DisplayContent;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ value: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,27 @@
1
+ <script setup>
2
+ import UButton from "@nuxt/ui/components/Button.vue";
3
+ import { useClipboard } from "@vueuse/core";
4
+ import { useDisplayIcons } from "../../composables/use-display-icons";
5
+ import { useDisplayLocale } from "../../composables/use-display-locale";
6
+ const { value } = defineProps({
7
+ value: { type: String, required: true }
8
+ });
9
+ const { t } = useDisplayLocale();
10
+ const icons = useDisplayIcons();
11
+ const { copy, copied } = useClipboard({ copiedDuring: 1500, legacy: true });
12
+ </script>
13
+
14
+ <template>
15
+ <UButton
16
+ :icon="copied ? icons.copyCheck : icons.copy"
17
+ :aria-label="copied ? t('display.copied') : t('display.copy')"
18
+ :title="copied ? t('display.copied') : t('display.copy')"
19
+ :class="copied ? 'text-success' : 'text-dimmed'"
20
+ color="neutral"
21
+ variant="ghost"
22
+ size="xs"
23
+ square
24
+ data-display-copy
25
+ @click.stop="copy(value)"
26
+ />
27
+ </template>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ value: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;