@code-coaching/vuetiful 0.9.0 → 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.
@@ -1,18 +1,21 @@
1
- import { defineComponent, useAttrs, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createBlock, resolveDynamicComponent, withCtx, ref, reactive, readonly, toRefs, computed, onMounted, Fragment, createVNode, Transition, createCommentVNode, provide, createElementVNode, inject, mergeProps, toDisplayString, withDirectives, createTextVNode, resolveComponent, renderList, pushScopeId, popScopeId } from "vue";
2
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3
- __name: "VBadge",
4
- setup(__props) {
5
- const attrs = useAttrs();
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: {
@@ -27,7 +30,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
27
30
  },
28
31
  emits: ["click"],
29
32
  setup(__props, { emit }) {
30
- const attrs = useAttrs();
31
33
  const activate = () => {
32
34
  emit("click");
33
35
  };
@@ -48,11 +50,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
48
50
  }
49
51
  };
50
52
  return (_ctx, _cache) => {
51
- var _a;
52
53
  return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
53
54
  tabindex: "0",
54
55
  role: "button",
55
- class: normalizeClass(`vuetiful-button ${__props.icon ? "btn-icon" : "btn"} border-token hover:cursor-pointer ${(_a = unref(attrs).class) != null ? _a : ""}`),
56
+ class: normalizeClass(`vuetiful-button ${__props.icon ? "btn-icon" : "btn"} border-token hover:cursor-pointer`),
56
57
  onClick: clickHandler,
57
58
  onKeydown: keydownHandler,
58
59
  onKeyup: keyupHandler
@@ -65,20 +66,16 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
65
66
  };
66
67
  }
67
68
  });
68
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
69
- __name: "VChip",
70
- setup(__props) {
71
- const attrs = useAttrs();
72
- return (_ctx, _cache) => {
73
- var _a;
74
- return openBlock(), createElementBlock("div", {
75
- class: normalizeClass(`vuetiful-chip chip ${(_a = unref(attrs).class) != null ? _a : ""}`)
76
- }, [
77
- renderSlot(_ctx.$slots, "default")
78
- ], 2);
79
- };
80
- }
81
- });
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]]);
82
79
  const selectedRailTile = ref("");
83
80
  const useRail = () => {
84
81
  return {
@@ -112,7 +109,7 @@ const useDrawer = () => {
112
109
  close
113
110
  };
114
111
  };
115
- const _hoisted_1$4 = ["aria-labelledby", "aria-describedby"];
112
+ const _hoisted_1$5 = ["aria-labelledby", "aria-describedby"];
116
113
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
117
114
  __name: "VDrawer",
118
115
  props: {
@@ -136,7 +133,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
136
133
  setup(__props) {
137
134
  const props = __props;
138
135
  const { drawer: drawer2, close } = useDrawer();
139
- const attrs = useAttrs();
140
136
  const { regionBackdrop, regionDrawer, labelledby, describedby } = toRefs(props);
141
137
  const presets = {
142
138
  top: { alignment: "top-0", width: "w-full", height: "h-[50%]", rounded: "rounded-bl-container-token rounded-br-container-token" },
@@ -178,32 +174,30 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
178
174
  "aria-describedby": unref(describedby)
179
175
  }, [
180
176
  renderSlot(_ctx.$slots, "default")
181
- ], 10, _hoisted_1$4)) : createCommentVNode("", true)
177
+ ], 10, _hoisted_1$5)) : createCommentVNode("", true)
182
178
  ]),
183
179
  _: 3
184
180
  }, 8, ["name"]),
185
181
  createVNode(Transition, {
186
182
  name: `fade-${unref(drawer2).duration}`
187
183
  }, {
188
- default: withCtx(() => {
189
- var _a;
190
- return [
191
- unref(drawer2).open ? (openBlock(), createElementBlock("div", {
192
- key: 0,
193
- ref_key: "elemBackdrop",
194
- ref: elemBackdrop,
195
- class: normalizeClass(`drawer-backdrop backdrop-blur-xs fixed bottom-0 left-0 right-0 top-0 flex bg-surface-backdrop-token ${unref(regionBackdrop)} z-40 ${(_a = unref(attrs).class) != null ? _a : ""}`),
196
- onMousedown: onBackdropInteraction,
197
- onTouchstart: onBackdropInteraction
198
- }, null, 34)) : createCommentVNode("", true)
199
- ];
200
- }),
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
+ ]),
201
194
  _: 1
202
195
  }, 8, ["name"])
203
196
  ], 64);
204
197
  };
205
198
  }
206
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" };
207
201
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
208
202
  __name: "VRail",
209
203
  props: {
@@ -230,13 +224,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
230
224
  },
231
225
  setup(__props) {
232
226
  const props = __props;
233
- const attrs = useAttrs();
234
227
  provide("active", props.active);
235
228
  provide("hover", props.hover);
236
229
  return (_ctx, _cache) => {
237
- return openBlock(), createElementBlock("div", {
238
- 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 || ""}`])
239
- }, [
230
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
240
231
  createElementVNode("div", {
241
232
  class: normalizeClass(["v-bar-lead", __props.regionLead])
242
233
  }, [
@@ -252,7 +243,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
252
243
  }, [
253
244
  renderSlot(_ctx.$slots, "trail")
254
245
  ], 2)
255
- ], 2);
246
+ ]);
256
247
  };
257
248
  }
258
249
  });
@@ -308,35 +299,32 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
308
299
  }
309
300
  };
310
301
  return (_ctx, _cache) => {
311
- return openBlock(), createElementBlock("div", {
312
- role: "button",
313
- tabindex: "0",
302
+ return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps({
314
303
  onClick: clickHandler,
315
304
  onKeydown: keydownHandler,
316
305
  onKeyup: keyupHandler
317
- }, [
318
- (openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps(unref(attrs), {
319
- 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)}` : ""} ${unref(attrs).class || ""}`
320
- }), {
321
- default: withCtx(() => [
322
- _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
323
- key: 0,
324
- class: normalizeClass(`app-rail-tile-icon ${__props.regionIcon}`)
325
- }, [
326
- renderSlot(_ctx.$slots, "default")
327
- ], 2)) : createCommentVNode("", true),
328
- __props.label ? (openBlock(), createElementBlock("div", {
329
- key: 1,
330
- class: normalizeClass(`app-rail-tile-label text-center text-xs font-bold ${__props.regionLabel}`)
331
- }, toDisplayString(__props.label), 3)) : createCommentVNode("", true)
332
- ]),
333
- _: 3
334
- }, 16, ["class"]))
335
- ], 32);
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"]);
336
323
  };
337
324
  }
338
325
  });
339
- const _hoisted_1$3 = { class: "vuetiful-shell-content flex h-full w-full flex-auto overflow-hidden" };
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" };
340
328
  const _sfc_main$3 = defineComponent({
341
329
  __name: "VShell",
342
330
  props: {
@@ -350,19 +338,16 @@ const _sfc_main$3 = defineComponent({
350
338
  slotFixedFooter: { type: String, default: "" }
351
339
  },
352
340
  setup(__props) {
353
- const attrs = useAttrs();
354
341
  return (_ctx, _cache) => {
355
- var _a, _b;
356
- return openBlock(), createElementBlock("div", {
357
- class: normalizeClass(`vuetiful-shell flex h-full w-full flex-col overflow-hidden ${(_a = unref(attrs).class) != null ? _a : ""}`)
358
- }, [
342
+ var _a;
343
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
359
344
  _ctx.$slots.fixedHeader ? (openBlock(), createElementBlock("header", {
360
345
  key: 0,
361
346
  class: normalizeClass(`vuetiful-fixed-header ${__props.slotFixedHeader}`)
362
347
  }, [
363
348
  renderSlot(_ctx.$slots, "fixedHeader")
364
349
  ], 2)) : createCommentVNode("", true),
365
- createElementVNode("div", _hoisted_1$3, [
350
+ createElementVNode("div", _hoisted_2$3, [
366
351
  _ctx.$slots.sidebarLeft ? (openBlock(), createElementBlock("aside", {
367
352
  key: 0,
368
353
  class: normalizeClass(`vuetiful-sidebar-left overflow-y-auto overflow-x-hidden ${__props.slotSidebarLeft}`)
@@ -370,7 +355,7 @@ const _sfc_main$3 = defineComponent({
370
355
  renderSlot(_ctx.$slots, "sidebarLeft")
371
356
  ], 2)) : createCommentVNode("", true),
372
357
  createElementVNode("div", {
373
- class: normalizeClass(`vuetiful-page flex flex-1 flex-col overflow-x-hidden ${(_b = __props.regionPage) != null ? _b : ""}`)
358
+ class: normalizeClass(`vuetiful-page flex flex-1 flex-col overflow-x-hidden ${(_a = __props.regionPage) != null ? _a : ""}`)
374
359
  }, [
375
360
  _ctx.$slots.pageHeader ? (openBlock(), createElementBlock("header", {
376
361
  key: 0,
@@ -403,7 +388,7 @@ const _sfc_main$3 = defineComponent({
403
388
  }, [
404
389
  renderSlot(_ctx.$slots, "fixedFooter")
405
390
  ], 2)) : createCommentVNode("", true)
406
- ], 2);
391
+ ]);
407
392
  };
408
393
  }
409
394
  });
@@ -415,8 +400,8 @@ var components = /* @__PURE__ */ Object.freeze({
415
400
  VRailTile: _sfc_main$4,
416
401
  VShell: _sfc_main$3,
417
402
  VDrawer: _sfc_main$6,
418
- VBadge: _sfc_main$9,
419
- VChip: _sfc_main$7
403
+ VBadge,
404
+ VChip
420
405
  });
421
406
  var main = "";
422
407
  var tailwind = "";
@@ -46760,7 +46745,7 @@ const useHighlight = () => {
46760
46745
  highlight: highlight2
46761
46746
  };
46762
46747
  };
46763
- const _hoisted_1$2 = { key: 0 };
46748
+ const _hoisted_1$2 = { class: "code-block bg-neutral-900/90 text-sm text-white shadow rounded-container-token" };
46764
46749
  const _hoisted_2$2 = {
46765
46750
  class: /* @__PURE__ */ normalizeClass(`code-block-language`)
46766
46751
  };
@@ -46776,39 +46761,21 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
46776
46761
  type: String,
46777
46762
  default: ""
46778
46763
  },
46779
- background: {
46780
- type: String,
46781
- default: "bg-neutral-900/90"
46782
- },
46783
- blur: {
46784
- type: String,
46785
- default: ""
46786
- },
46787
- text: {
46788
- type: String,
46789
- default: "text-sm"
46790
- },
46791
- color: {
46792
- type: String,
46793
- default: "text-white"
46794
- },
46795
- rounded: {
46796
- type: String,
46797
- default: "rounded-container-token"
46764
+ headerClass: {
46765
+ type: String
46798
46766
  },
46799
- shadow: {
46800
- type: String,
46801
- default: "shadow"
46767
+ preClass: {
46768
+ type: String
46802
46769
  },
46803
- button: {
46770
+ buttonClass: {
46804
46771
  type: String,
46805
46772
  default: "btn btn-sm variant-soft !text-white"
46806
46773
  },
46807
- buttonLabel: {
46774
+ buttonText: {
46808
46775
  type: String,
46809
46776
  default: "Copy"
46810
46777
  },
46811
- buttonCopied: {
46778
+ buttonCopiedText: {
46812
46779
  type: String,
46813
46780
  default: "\u{1F44D}"
46814
46781
  }
@@ -46817,10 +46784,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
46817
46784
  setup(__props, { emit }) {
46818
46785
  const props = __props;
46819
46786
  const { highlight: highlight2 } = useHighlight();
46820
- const attrs = useAttrs();
46821
- const cBase = "overflow-hidden shadow";
46822
- const cHeader = "text-xs text-white/50 uppercase flex justify-between items-center p-2 pl-4 pb-0";
46823
- const cPre = "whitespace-pre-wrap break-all p-4 pt-1";
46824
46787
  const copyState = ref(false);
46825
46788
  function languageFormatter(lang) {
46826
46789
  if (lang === "js")
@@ -46838,41 +46801,30 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
46838
46801
  }, 2e3);
46839
46802
  emit("copy");
46840
46803
  }
46841
- const classesBase = computed(
46842
- () => {
46843
- var _a;
46844
- return `${cBase} ${props.background} ${props.blur} ${props.text} ${props.color} ${props.rounded} ${props.shadow} ${(_a = attrs.class) != null ? _a : ""}`;
46845
- }
46846
- );
46847
46804
  return (_ctx, _cache) => {
46848
- return __props.language && __props.code ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
46849
- createElementVNode("div", {
46850
- class: normalizeClass(`code-block ${unref(classesBase)}`),
46851
- "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}`)
46852
46808
  }, [
46853
- createElementVNode("header", {
46854
- class: normalizeClass(`code-block-header ${cHeader}`)
46855
- }, [
46856
- createElementVNode("span", _hoisted_2$2, toDisplayString(languageFormatter(__props.language)), 1),
46857
- withDirectives((openBlock(), createElementBlock("button", {
46858
- class: normalizeClass(`code-block-btn ${__props.button}`),
46859
- onClick: _cache[0] || (_cache[0] = ($event) => onCopyClick())
46860
- }, [
46861
- createTextVNode(toDisplayString(!copyState.value ? __props.buttonLabel : __props.buttonCopied), 1)
46862
- ], 2)), [
46863
- [unref(clipboard), props.code]
46864
- ])
46865
- ], 2),
46866
- createElementVNode("pre", {
46867
- 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())
46868
46813
  }, [
46869
- createElementVNode("code", {
46870
- class: normalizeClass(`code-block-code language-${__props.language}`),
46871
- innerHTML: unref(highlight2)(props.code, props.language)
46872
- }, null, 10, _hoisted_3$1)
46873
- ], 2)
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)
46874
46826
  ], 2)
46875
- ])) : createCommentVNode("", true);
46827
+ ]);
46876
46828
  };
46877
46829
  }
46878
46830
  });
@@ -46962,13 +46914,6 @@ const useDarkMode = () => {
46962
46914
  MODE
46963
46915
  };
46964
46916
  };
46965
- var _export_sfc = (sfc, props) => {
46966
- const target = sfc.__vccOpts || sfc;
46967
- for (const [key, val] of props) {
46968
- target[key] = val;
46969
- }
46970
- return target;
46971
- };
46972
46917
  const _sfc_main$1 = defineComponent({
46973
46918
  props: {
46974
46919
  bgLight: {
@@ -47339,4 +47284,4 @@ function install(app) {
47339
47284
  }
47340
47285
  }
47341
47286
  var index = { install };
47342
- export { _sfc_main$2 as CodeBlock, DarkModeSwitch, themeSwitcher as ThemeSwitcher, _sfc_main$9 as VBadge, _sfc_main$8 as VButton, _sfc_main$7 as 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 };
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 };