@code-coaching/vuetiful 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/styles/all.css +387 -19
- package/dist/types/components/atoms/VBadge.vue.d.ts +1 -1
- package/dist/types/components/atoms/VButton.vue.d.ts +14 -7
- package/dist/types/components/atoms/VChip.vue.d.ts +1 -1
- package/dist/types/components/molecules/VShell.vue.d.ts +8 -0
- package/dist/types/services/drawer.service.test.d.ts +1 -0
- package/dist/types/services/rail.service.test.d.ts +1 -0
- package/dist/types/utils/code-block/code-block.vue.d.ts +13 -55
- package/dist/types/utils/dark-mode/dark-mode.vue.d.ts +1 -1
- package/dist/types/utils/theme/theme-switcher.vue.d.ts +1 -1
- package/dist/vuetiful.es.mjs +149 -172
- package/dist/vuetiful.umd.js +10 -10
- package/package.json +1 -1
- package/src/components/atoms/VBadge.vue +1 -6
- package/src/components/atoms/VButton.test.ts +109 -2
- package/src/components/atoms/VButton.vue +32 -5
- package/src/components/atoms/VChip.vue +1 -6
- package/src/components/molecules/VDrawer.vue +2 -6
- package/src/components/molecules/VRail.vue +2 -9
- package/src/components/molecules/VRailTile.vue +36 -25
- package/src/components/molecules/VShell.vue +1 -3
- package/src/services/rail.service.test.ts +5 -3
- package/src/utils/code-block/code-block.vue +25 -50
|
@@ -95,12 +95,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
95
95
|
default: string;
|
|
96
96
|
};
|
|
97
97
|
}>>, {
|
|
98
|
-
rounded: string;
|
|
99
98
|
bgLight: string;
|
|
100
99
|
bgDark: string;
|
|
101
100
|
width: string;
|
|
102
101
|
height: string;
|
|
103
102
|
ring: string;
|
|
103
|
+
rounded: string;
|
|
104
104
|
textOnLight: string;
|
|
105
105
|
textOnDark: string;
|
|
106
106
|
roundedContainer: string;
|
package/dist/vuetiful.es.mjs
CHANGED
|
@@ -1,61 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (_ctx, _cache) => {
|
|
7
|
-
var _a;
|
|
8
|
-
return openBlock(), createElementBlock("div", {
|
|
9
|
-
class: normalizeClass(`vuetiful-badge badge ${(_a = unref(attrs).class) != null ? _a : ""}`)
|
|
10
|
-
}, [
|
|
11
|
-
renderSlot(_ctx.$slots, "default")
|
|
12
|
-
], 2);
|
|
13
|
-
};
|
|
1
|
+
import { openBlock, createElementBlock, renderSlot, normalizeClass, defineComponent, createBlock, resolveDynamicComponent, withCtx, ref, reactive, readonly, toRefs, computed, onMounted, Fragment, createVNode, Transition, unref, createCommentVNode, provide, createElementVNode, useAttrs, inject, mergeProps, toDisplayString, withDirectives, createTextVNode, resolveComponent, renderList, pushScopeId, popScopeId } from "vue";
|
|
2
|
+
var _export_sfc = (sfc, props) => {
|
|
3
|
+
const target = sfc.__vccOpts || sfc;
|
|
4
|
+
for (const [key, val] of props) {
|
|
5
|
+
target[key] = val;
|
|
14
6
|
}
|
|
15
|
-
|
|
7
|
+
return target;
|
|
8
|
+
};
|
|
9
|
+
const _sfc_main$9 = {};
|
|
10
|
+
const _hoisted_1$7 = {
|
|
11
|
+
class: /* @__PURE__ */ normalizeClass(`vuetiful-badge badge`)
|
|
12
|
+
};
|
|
13
|
+
function _sfc_render$3(_ctx, _cache) {
|
|
14
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
15
|
+
renderSlot(_ctx.$slots, "default")
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
var VBadge = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$3]]);
|
|
16
19
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
17
20
|
__name: "VButton",
|
|
18
21
|
props: {
|
|
22
|
+
icon: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
19
26
|
tag: {
|
|
20
27
|
type: String,
|
|
21
28
|
default: "button"
|
|
22
|
-
},
|
|
23
|
-
msg: {
|
|
24
|
-
type: String
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
emits: ["click"],
|
|
32
|
+
setup(__props, { emit }) {
|
|
33
|
+
const activate = () => {
|
|
34
|
+
emit("click");
|
|
35
|
+
};
|
|
36
|
+
const clickHandler = (event) => {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
activate();
|
|
39
|
+
};
|
|
40
|
+
const keydownHandler = (event) => {
|
|
41
|
+
if (["Enter", " "].includes(event.key))
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
if (event.key === "Enter")
|
|
44
|
+
activate();
|
|
45
|
+
};
|
|
46
|
+
const keyupHandler = (event) => {
|
|
47
|
+
if (event.key === " ") {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
activate();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
29
52
|
return (_ctx, _cache) => {
|
|
30
|
-
var _a;
|
|
31
53
|
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
|
|
32
|
-
|
|
54
|
+
tabindex: "0",
|
|
55
|
+
role: "button",
|
|
56
|
+
class: normalizeClass(`vuetiful-button ${__props.icon ? "btn-icon" : "btn"} border-token hover:cursor-pointer`),
|
|
57
|
+
onClick: clickHandler,
|
|
58
|
+
onKeydown: keydownHandler,
|
|
59
|
+
onKeyup: keyupHandler
|
|
33
60
|
}, {
|
|
34
61
|
default: withCtx(() => [
|
|
35
|
-
__props.msg ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
36
|
-
createTextVNode(toDisplayString(__props.msg), 1)
|
|
37
|
-
], 64)) : createCommentVNode("", true),
|
|
38
62
|
renderSlot(_ctx.$slots, "default")
|
|
39
63
|
]),
|
|
40
64
|
_: 3
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
46
|
-
__name: "VChip",
|
|
47
|
-
setup(__props) {
|
|
48
|
-
const attrs = useAttrs();
|
|
49
|
-
return (_ctx, _cache) => {
|
|
50
|
-
var _a;
|
|
51
|
-
return openBlock(), createElementBlock("div", {
|
|
52
|
-
class: normalizeClass(`vuetiful-chip chip ${(_a = unref(attrs).class) != null ? _a : ""}`)
|
|
53
|
-
}, [
|
|
54
|
-
renderSlot(_ctx.$slots, "default")
|
|
55
|
-
], 2);
|
|
65
|
+
}, 40, ["class"]);
|
|
56
66
|
};
|
|
57
67
|
}
|
|
58
68
|
});
|
|
69
|
+
const _sfc_main$7 = {};
|
|
70
|
+
const _hoisted_1$6 = {
|
|
71
|
+
class: /* @__PURE__ */ normalizeClass(`vuetiful-chip chip`)
|
|
72
|
+
};
|
|
73
|
+
function _sfc_render$2(_ctx, _cache) {
|
|
74
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
75
|
+
renderSlot(_ctx.$slots, "default")
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
var VChip = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$2]]);
|
|
59
79
|
const selectedRailTile = ref("");
|
|
60
80
|
const useRail = () => {
|
|
61
81
|
return {
|
|
@@ -89,7 +109,7 @@ const useDrawer = () => {
|
|
|
89
109
|
close
|
|
90
110
|
};
|
|
91
111
|
};
|
|
92
|
-
const _hoisted_1$
|
|
112
|
+
const _hoisted_1$5 = ["aria-labelledby", "aria-describedby"];
|
|
93
113
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
94
114
|
__name: "VDrawer",
|
|
95
115
|
props: {
|
|
@@ -113,7 +133,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
113
133
|
setup(__props) {
|
|
114
134
|
const props = __props;
|
|
115
135
|
const { drawer: drawer2, close } = useDrawer();
|
|
116
|
-
const attrs = useAttrs();
|
|
117
136
|
const { regionBackdrop, regionDrawer, labelledby, describedby } = toRefs(props);
|
|
118
137
|
const presets = {
|
|
119
138
|
top: { alignment: "top-0", width: "w-full", height: "h-[50%]", rounded: "rounded-bl-container-token rounded-br-container-token" },
|
|
@@ -155,32 +174,30 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
155
174
|
"aria-describedby": unref(describedby)
|
|
156
175
|
}, [
|
|
157
176
|
renderSlot(_ctx.$slots, "default")
|
|
158
|
-
], 10, _hoisted_1$
|
|
177
|
+
], 10, _hoisted_1$5)) : createCommentVNode("", true)
|
|
159
178
|
]),
|
|
160
179
|
_: 3
|
|
161
180
|
}, 8, ["name"]),
|
|
162
181
|
createVNode(Transition, {
|
|
163
182
|
name: `fade-${unref(drawer2).duration}`
|
|
164
183
|
}, {
|
|
165
|
-
default: withCtx(() =>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}, null, 34)) : createCommentVNode("", true)
|
|
176
|
-
];
|
|
177
|
-
}),
|
|
184
|
+
default: withCtx(() => [
|
|
185
|
+
unref(drawer2).open ? (openBlock(), createElementBlock("div", {
|
|
186
|
+
key: 0,
|
|
187
|
+
ref_key: "elemBackdrop",
|
|
188
|
+
ref: elemBackdrop,
|
|
189
|
+
class: normalizeClass(`drawer-backdrop backdrop-blur-xs fixed bottom-0 left-0 right-0 top-0 flex bg-surface-backdrop-token z-40 ${unref(regionBackdrop)}`),
|
|
190
|
+
onMousedown: onBackdropInteraction,
|
|
191
|
+
onTouchstart: onBackdropInteraction
|
|
192
|
+
}, null, 34)) : createCommentVNode("", true)
|
|
193
|
+
]),
|
|
178
194
|
_: 1
|
|
179
195
|
}, 8, ["name"])
|
|
180
196
|
], 64);
|
|
181
197
|
};
|
|
182
198
|
}
|
|
183
199
|
});
|
|
200
|
+
const _hoisted_1$4 = { class: "v-rail grid h-full w-[70px] grid-rows-[auto_1fr_auto] gap-0 overflow-y-auto sm:w-20" };
|
|
184
201
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
185
202
|
__name: "VRail",
|
|
186
203
|
props: {
|
|
@@ -207,13 +224,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
207
224
|
},
|
|
208
225
|
setup(__props) {
|
|
209
226
|
const props = __props;
|
|
210
|
-
const attrs = useAttrs();
|
|
211
227
|
provide("active", props.active);
|
|
212
228
|
provide("hover", props.hover);
|
|
213
229
|
return (_ctx, _cache) => {
|
|
214
|
-
return openBlock(), createElementBlock("div",
|
|
215
|
-
class: normalizeClass(["v-rail", `grid h-full w-[70px] grid-rows-[auto_1fr_auto] gap-0 overflow-y-auto sm:w-20 ${unref(attrs).class || ""}`])
|
|
216
|
-
}, [
|
|
230
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
217
231
|
createElementVNode("div", {
|
|
218
232
|
class: normalizeClass(["v-bar-lead", __props.regionLead])
|
|
219
233
|
}, [
|
|
@@ -229,7 +243,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
229
243
|
}, [
|
|
230
244
|
renderSlot(_ctx.$slots, "trail")
|
|
231
245
|
], 2)
|
|
232
|
-
]
|
|
246
|
+
]);
|
|
233
247
|
};
|
|
234
248
|
}
|
|
235
249
|
});
|
|
@@ -264,47 +278,53 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
264
278
|
const { selectedRailTile: selectedRailTile2 } = useRail();
|
|
265
279
|
const active = inject("active");
|
|
266
280
|
const hover = inject("hover");
|
|
267
|
-
const
|
|
268
|
-
if (!props.value)
|
|
269
|
-
return;
|
|
281
|
+
const activate = () => {
|
|
270
282
|
selectedRailTile2.value = props.value;
|
|
271
283
|
emit("click");
|
|
272
284
|
};
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
285
|
+
const clickHandler = (event) => {
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
activate();
|
|
288
|
+
};
|
|
289
|
+
const keydownHandler = (event) => {
|
|
290
|
+
if (["Enter", " "].includes(event.key))
|
|
291
|
+
event.preventDefault();
|
|
292
|
+
if (event.key === "Enter")
|
|
293
|
+
activate();
|
|
294
|
+
};
|
|
295
|
+
const keyupHandler = (event) => {
|
|
296
|
+
if (event.key === " ") {
|
|
297
|
+
event.preventDefault();
|
|
298
|
+
activate();
|
|
299
|
+
}
|
|
280
300
|
};
|
|
281
301
|
return (_ctx, _cache) => {
|
|
282
|
-
return openBlock(),
|
|
283
|
-
onClick:
|
|
284
|
-
onKeydown:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
], 32);
|
|
302
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps({
|
|
303
|
+
onClick: clickHandler,
|
|
304
|
+
onKeydown: keydownHandler,
|
|
305
|
+
onKeyup: keyupHandler
|
|
306
|
+
}, unref(attrs), {
|
|
307
|
+
class: `app-rail-tile unstyled grid aspect-square w-full cursor-pointer place-content-center place-items-center space-y-1.5 ${unref(hover)} ${unref(selectedRailTile2) === __props.value ? `${unref(active)}` : ""}`
|
|
308
|
+
}), {
|
|
309
|
+
default: withCtx(() => [
|
|
310
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("div", {
|
|
311
|
+
key: 0,
|
|
312
|
+
class: normalizeClass(`app-rail-tile-icon ${__props.regionIcon}`)
|
|
313
|
+
}, [
|
|
314
|
+
renderSlot(_ctx.$slots, "default")
|
|
315
|
+
], 2)) : createCommentVNode("", true),
|
|
316
|
+
__props.label ? (openBlock(), createElementBlock("div", {
|
|
317
|
+
key: 1,
|
|
318
|
+
class: normalizeClass(`app-rail-tile-label text-center text-xs font-bold ${__props.regionLabel}`)
|
|
319
|
+
}, toDisplayString(__props.label), 3)) : createCommentVNode("", true)
|
|
320
|
+
]),
|
|
321
|
+
_: 3
|
|
322
|
+
}, 16, ["class"]);
|
|
304
323
|
};
|
|
305
324
|
}
|
|
306
325
|
});
|
|
307
|
-
const _hoisted_1$3 = { class: "vuetiful-shell
|
|
326
|
+
const _hoisted_1$3 = { class: "vuetiful-shell flex h-full w-full flex-col overflow-hidden" };
|
|
327
|
+
const _hoisted_2$3 = { class: "vuetiful-shell-content flex h-full w-full flex-auto overflow-hidden" };
|
|
308
328
|
const _sfc_main$3 = defineComponent({
|
|
309
329
|
__name: "VShell",
|
|
310
330
|
props: {
|
|
@@ -318,19 +338,16 @@ const _sfc_main$3 = defineComponent({
|
|
|
318
338
|
slotFixedFooter: { type: String, default: "" }
|
|
319
339
|
},
|
|
320
340
|
setup(__props) {
|
|
321
|
-
const attrs = useAttrs();
|
|
322
341
|
return (_ctx, _cache) => {
|
|
323
|
-
var _a
|
|
324
|
-
return openBlock(), createElementBlock("div",
|
|
325
|
-
class: normalizeClass(`vuetiful-shell flex h-full w-full flex-col overflow-hidden ${(_a = unref(attrs).class) != null ? _a : ""}`)
|
|
326
|
-
}, [
|
|
342
|
+
var _a;
|
|
343
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
327
344
|
_ctx.$slots.fixedHeader ? (openBlock(), createElementBlock("header", {
|
|
328
345
|
key: 0,
|
|
329
346
|
class: normalizeClass(`vuetiful-fixed-header ${__props.slotFixedHeader}`)
|
|
330
347
|
}, [
|
|
331
348
|
renderSlot(_ctx.$slots, "fixedHeader")
|
|
332
349
|
], 2)) : createCommentVNode("", true),
|
|
333
|
-
createElementVNode("div",
|
|
350
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
334
351
|
_ctx.$slots.sidebarLeft ? (openBlock(), createElementBlock("aside", {
|
|
335
352
|
key: 0,
|
|
336
353
|
class: normalizeClass(`vuetiful-sidebar-left overflow-y-auto overflow-x-hidden ${__props.slotSidebarLeft}`)
|
|
@@ -338,7 +355,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
338
355
|
renderSlot(_ctx.$slots, "sidebarLeft")
|
|
339
356
|
], 2)) : createCommentVNode("", true),
|
|
340
357
|
createElementVNode("div", {
|
|
341
|
-
class: normalizeClass(`vuetiful-page flex flex-1 flex-col overflow-x-hidden ${(
|
|
358
|
+
class: normalizeClass(`vuetiful-page flex flex-1 flex-col overflow-x-hidden ${(_a = __props.regionPage) != null ? _a : ""}`)
|
|
342
359
|
}, [
|
|
343
360
|
_ctx.$slots.pageHeader ? (openBlock(), createElementBlock("header", {
|
|
344
361
|
key: 0,
|
|
@@ -371,7 +388,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
371
388
|
}, [
|
|
372
389
|
renderSlot(_ctx.$slots, "fixedFooter")
|
|
373
390
|
], 2)) : createCommentVNode("", true)
|
|
374
|
-
]
|
|
391
|
+
]);
|
|
375
392
|
};
|
|
376
393
|
}
|
|
377
394
|
});
|
|
@@ -383,8 +400,8 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
383
400
|
VRailTile: _sfc_main$4,
|
|
384
401
|
VShell: _sfc_main$3,
|
|
385
402
|
VDrawer: _sfc_main$6,
|
|
386
|
-
VBadge
|
|
387
|
-
VChip
|
|
403
|
+
VBadge,
|
|
404
|
+
VChip
|
|
388
405
|
});
|
|
389
406
|
var main = "";
|
|
390
407
|
var tailwind = "";
|
|
@@ -46728,7 +46745,7 @@ const useHighlight = () => {
|
|
|
46728
46745
|
highlight: highlight2
|
|
46729
46746
|
};
|
|
46730
46747
|
};
|
|
46731
|
-
const _hoisted_1$2 = {
|
|
46748
|
+
const _hoisted_1$2 = { class: "code-block bg-neutral-900/90 text-sm text-white shadow rounded-container-token" };
|
|
46732
46749
|
const _hoisted_2$2 = {
|
|
46733
46750
|
class: /* @__PURE__ */ normalizeClass(`code-block-language`)
|
|
46734
46751
|
};
|
|
@@ -46744,39 +46761,21 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
46744
46761
|
type: String,
|
|
46745
46762
|
default: ""
|
|
46746
46763
|
},
|
|
46747
|
-
|
|
46748
|
-
type: String
|
|
46749
|
-
default: "bg-neutral-900/90"
|
|
46750
|
-
},
|
|
46751
|
-
blur: {
|
|
46752
|
-
type: String,
|
|
46753
|
-
default: ""
|
|
46754
|
-
},
|
|
46755
|
-
text: {
|
|
46756
|
-
type: String,
|
|
46757
|
-
default: "text-sm"
|
|
46758
|
-
},
|
|
46759
|
-
color: {
|
|
46760
|
-
type: String,
|
|
46761
|
-
default: "text-white"
|
|
46762
|
-
},
|
|
46763
|
-
rounded: {
|
|
46764
|
-
type: String,
|
|
46765
|
-
default: "rounded-container-token"
|
|
46764
|
+
headerClass: {
|
|
46765
|
+
type: String
|
|
46766
46766
|
},
|
|
46767
|
-
|
|
46768
|
-
type: String
|
|
46769
|
-
default: "shadow"
|
|
46767
|
+
preClass: {
|
|
46768
|
+
type: String
|
|
46770
46769
|
},
|
|
46771
|
-
|
|
46770
|
+
buttonClass: {
|
|
46772
46771
|
type: String,
|
|
46773
46772
|
default: "btn btn-sm variant-soft !text-white"
|
|
46774
46773
|
},
|
|
46775
|
-
|
|
46774
|
+
buttonText: {
|
|
46776
46775
|
type: String,
|
|
46777
46776
|
default: "Copy"
|
|
46778
46777
|
},
|
|
46779
|
-
|
|
46778
|
+
buttonCopiedText: {
|
|
46780
46779
|
type: String,
|
|
46781
46780
|
default: "\u{1F44D}"
|
|
46782
46781
|
}
|
|
@@ -46785,10 +46784,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
46785
46784
|
setup(__props, { emit }) {
|
|
46786
46785
|
const props = __props;
|
|
46787
46786
|
const { highlight: highlight2 } = useHighlight();
|
|
46788
|
-
const attrs = useAttrs();
|
|
46789
|
-
const cBase = "overflow-hidden shadow";
|
|
46790
|
-
const cHeader = "text-xs text-white/50 uppercase flex justify-between items-center p-2 pl-4 pb-0";
|
|
46791
|
-
const cPre = "whitespace-pre-wrap break-all p-4 pt-1";
|
|
46792
46787
|
const copyState = ref(false);
|
|
46793
46788
|
function languageFormatter(lang) {
|
|
46794
46789
|
if (lang === "js")
|
|
@@ -46806,41 +46801,30 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
46806
46801
|
}, 2e3);
|
|
46807
46802
|
emit("copy");
|
|
46808
46803
|
}
|
|
46809
|
-
const classesBase = computed(
|
|
46810
|
-
() => {
|
|
46811
|
-
var _a;
|
|
46812
|
-
return `${cBase} ${props.background} ${props.blur} ${props.text} ${props.color} ${props.rounded} ${props.shadow} ${(_a = attrs.class) != null ? _a : ""}`;
|
|
46813
|
-
}
|
|
46814
|
-
);
|
|
46815
46804
|
return (_ctx, _cache) => {
|
|
46816
|
-
return
|
|
46817
|
-
createElementVNode("
|
|
46818
|
-
class: normalizeClass(`code-block ${
|
|
46819
|
-
"data-testid": "code-block"
|
|
46805
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
46806
|
+
createElementVNode("header", {
|
|
46807
|
+
class: normalizeClass(`code-block-header flex items-center justify-between p-2 pb-0 pl-4 text-xs uppercase text-white/50 ${__props.headerClass}`)
|
|
46820
46808
|
}, [
|
|
46821
|
-
createElementVNode("
|
|
46822
|
-
|
|
46823
|
-
|
|
46824
|
-
|
|
46825
|
-
withDirectives((openBlock(), createElementBlock("button", {
|
|
46826
|
-
class: normalizeClass(`code-block-btn ${__props.button}`),
|
|
46827
|
-
onClick: _cache[0] || (_cache[0] = ($event) => onCopyClick())
|
|
46828
|
-
}, [
|
|
46829
|
-
createTextVNode(toDisplayString(!copyState.value ? __props.buttonLabel : __props.buttonCopied), 1)
|
|
46830
|
-
], 2)), [
|
|
46831
|
-
[unref(clipboard), props.code]
|
|
46832
|
-
])
|
|
46833
|
-
], 2),
|
|
46834
|
-
createElementVNode("pre", {
|
|
46835
|
-
class: normalizeClass(`code-block-pre ${cPre}`)
|
|
46809
|
+
createElementVNode("span", _hoisted_2$2, toDisplayString(languageFormatter(__props.language)), 1),
|
|
46810
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
46811
|
+
class: normalizeClass(`code-block-btn ${__props.buttonClass}`),
|
|
46812
|
+
onClick: _cache[0] || (_cache[0] = ($event) => onCopyClick())
|
|
46836
46813
|
}, [
|
|
46837
|
-
|
|
46838
|
-
|
|
46839
|
-
|
|
46840
|
-
|
|
46841
|
-
|
|
46814
|
+
createTextVNode(toDisplayString(!copyState.value ? __props.buttonText : __props.buttonCopiedText), 1)
|
|
46815
|
+
], 2)), [
|
|
46816
|
+
[unref(clipboard), props.code]
|
|
46817
|
+
])
|
|
46818
|
+
], 2),
|
|
46819
|
+
createElementVNode("pre", {
|
|
46820
|
+
class: normalizeClass(`code-block-pre whitespace-pre-wrap break-all p-4 pt-1 ${__props.preClass}`)
|
|
46821
|
+
}, [
|
|
46822
|
+
createElementVNode("code", {
|
|
46823
|
+
class: normalizeClass(`code-block-code language-${__props.language}`),
|
|
46824
|
+
innerHTML: unref(highlight2)(props.code, props.language)
|
|
46825
|
+
}, null, 10, _hoisted_3$1)
|
|
46842
46826
|
], 2)
|
|
46843
|
-
])
|
|
46827
|
+
]);
|
|
46844
46828
|
};
|
|
46845
46829
|
}
|
|
46846
46830
|
});
|
|
@@ -46930,13 +46914,6 @@ const useDarkMode = () => {
|
|
|
46930
46914
|
MODE
|
|
46931
46915
|
};
|
|
46932
46916
|
};
|
|
46933
|
-
var _export_sfc = (sfc, props) => {
|
|
46934
|
-
const target = sfc.__vccOpts || sfc;
|
|
46935
|
-
for (const [key, val] of props) {
|
|
46936
|
-
target[key] = val;
|
|
46937
|
-
}
|
|
46938
|
-
return target;
|
|
46939
|
-
};
|
|
46940
46917
|
const _sfc_main$1 = defineComponent({
|
|
46941
46918
|
props: {
|
|
46942
46919
|
bgLight: {
|
|
@@ -47307,4 +47284,4 @@ function install(app) {
|
|
|
47307
47284
|
}
|
|
47308
47285
|
}
|
|
47309
47286
|
var index = { install };
|
|
47310
|
-
export { _sfc_main$2 as CodeBlock, DarkModeSwitch, themeSwitcher as ThemeSwitcher,
|
|
47287
|
+
export { _sfc_main$2 as CodeBlock, DarkModeSwitch, themeSwitcher as ThemeSwitcher, VBadge, _sfc_main$8 as VButton, VChip, _sfc_main$6 as VDrawer, _sfc_main$5 as VRail, _sfc_main$4 as VRailTile, _sfc_main$3 as VShell, index as default, useDarkMode, useDrawer, useRail, useTheme, clipboard as vClipboard };
|