@loafacto/ui 0.16.0 → 0.16.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.
@@ -34,21 +34,21 @@ type __VLS_Props = {
34
34
  backgroundColor?: string;
35
35
  backgroundImage?: string;
36
36
  };
37
- declare var __VLS_11: {}, __VLS_13: {}, __VLS_15: {}, __VLS_17: {}, __VLS_19: {}, __VLS_21: {}, __VLS_23: {};
37
+ declare var __VLS_23: {}, __VLS_25: {}, __VLS_27: {}, __VLS_29: {}, __VLS_31: {}, __VLS_33: {}, __VLS_35: {};
38
38
  type __VLS_Slots = {} & {
39
- 'user-menu'?: (props: typeof __VLS_11) => any;
39
+ 'user-menu'?: (props: typeof __VLS_23) => any;
40
40
  } & {
41
- 'auth-actions'?: (props: typeof __VLS_13) => any;
41
+ 'auth-actions'?: (props: typeof __VLS_25) => any;
42
42
  } & {
43
- actions?: (props: typeof __VLS_15) => any;
43
+ actions?: (props: typeof __VLS_27) => any;
44
44
  } & {
45
- rail?: (props: typeof __VLS_17) => any;
45
+ rail?: (props: typeof __VLS_29) => any;
46
46
  } & {
47
- default?: (props: typeof __VLS_19) => any;
47
+ default?: (props: typeof __VLS_31) => any;
48
48
  } & {
49
- default?: (props: typeof __VLS_21) => any;
49
+ default?: (props: typeof __VLS_33) => any;
50
50
  } & {
51
- footer?: (props: typeof __VLS_23) => any;
51
+ footer?: (props: typeof __VLS_35) => any;
52
52
  };
53
53
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
54
  navigate: (payload: {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { readonly, ref, openBlock, createElementBlock, createStaticVNode, createElementVNode, defineComponent, computed, watch, onBeforeUnmount, normalizeClass, normalizeStyle, createCommentVNode, Fragment, toDisplayString, createVNode, renderList, renderSlot, unref, onUnmounted, createBlock, Teleport, TransitionGroup, withCtx, withModifiers, Transition, useTemplateRef, onMounted, nextTick, createTextVNode, withDirectives, withKeys, vModelText, resolveDynamicComponent, useAttrs, useModel, useId, mergeProps, isRef, vModelDynamic, mergeModels, vModelSelect, vModelCheckbox, vModelRadio, useSlots } from "vue";
1
+ import { readonly, ref, openBlock, createElementBlock, createStaticVNode, createElementVNode, defineComponent, computed, watch, onBeforeUnmount, normalizeClass, normalizeStyle, createCommentVNode, Fragment, toDisplayString, createVNode, Transition, withCtx, renderList, renderSlot, unref, nextTick, onUnmounted, createBlock, Teleport, TransitionGroup, withModifiers, useTemplateRef, onMounted, createTextVNode, withDirectives, withKeys, vModelText, resolveDynamicComponent, useAttrs, useModel, useId, mergeProps, isRef, vModelDynamic, mergeModels, vModelSelect, vModelCheckbox, vModelRadio, useSlots } from "vue";
2
2
  import { a as applyTheme, D as DARK_THEME, L as LIGHT_THEME } from "./applyTheme-8AxcQbPB.js";
3
3
  import { b, c, d, e, f, h, i, l } from "./applyTheme-8AxcQbPB.js";
4
4
  import { defineStore } from "pinia";
@@ -253,18 +253,14 @@ const _hoisted_24 = {
253
253
  };
254
254
  const _hoisted_25 = ["d"];
255
255
  const _hoisted_26 = ["title", "aria-label"];
256
- const _hoisted_27 = {
257
- viewBox: "0 0 24 24",
258
- "aria-hidden": "true"
259
- };
260
- const _hoisted_28 = ["d"];
261
- const _hoisted_29 = { class: "lf-content lf-content--rail" };
262
- const _hoisted_30 = {
256
+ const _hoisted_27 = ["d"];
257
+ const _hoisted_28 = { class: "lf-content lf-content--rail" };
258
+ const _hoisted_29 = {
263
259
  key: 2,
264
260
  class: "lf-content"
265
261
  };
266
- const _hoisted_31 = { class: "site-footer" };
267
- const _hoisted_32 = { class: "site-footer-inner" };
262
+ const _hoisted_30 = { class: "site-footer" };
263
+ const _hoisted_31 = { class: "site-footer-inner" };
268
264
  const ICON_SUN = "M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0-5v3h0V2zm0 17v3h0v-3zM2 11h3v2H2v-2zm17 0h3v2h-3v-2zM4.2 4.2l2.1 2.1L4.9 7.7 2.8 5.6l1.4-1.4zm13.5 13.5 2.1 2.1-1.4 1.4-2.1-2.1 1.4-1.4zM19.8 4.2l1.4 1.4-2.1 2.1-1.4-1.4 2.1-2.1zM6.3 17.7l1.4 1.4-2.1 2.1-1.4-1.4 2.1-2.1z";
269
265
  const ICON_MOON = "M12.3 3a7 7 0 1 0 8.7 8.7A9 9 0 1 1 12.3 3z";
270
266
  const RAIL_KEY = "lf-rail-hidden";
@@ -287,6 +283,28 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
287
283
  emits: ["navigate"],
288
284
  setup(__props, { emit: __emit }) {
289
285
  const { mode: mode2, toggle } = useTheme();
286
+ const spun = ref(false);
287
+ function onThemeClick() {
288
+ var _a;
289
+ spun.value = true;
290
+ const doc = document;
291
+ const reduce = typeof window !== "undefined" && ((_a = window.matchMedia) == null ? void 0 : _a.call(window, "(prefers-reduced-motion: reduce)").matches);
292
+ if (!doc.startViewTransition || reduce) {
293
+ toggle();
294
+ return;
295
+ }
296
+ const root = document.documentElement;
297
+ root.classList.add("lf-theme-switching");
298
+ try {
299
+ doc.startViewTransition(async () => {
300
+ toggle();
301
+ await nextTick();
302
+ }).finished.finally(() => root.classList.remove("lf-theme-switching"));
303
+ } catch {
304
+ root.classList.remove("lf-theme-switching");
305
+ toggle();
306
+ }
307
+ }
290
308
  const props = __props;
291
309
  const emit = __emit;
292
310
  const switcherOpen = ref(false);
@@ -395,7 +413,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
395
413
  title: railHidden.value ? "메뉴 열기" : "메뉴 닫기",
396
414
  "aria-expanded": !railHidden.value,
397
415
  onClick: toggleRail
398
- }, [..._cache[6] || (_cache[6] = [
416
+ }, [..._cache[5] || (_cache[5] = [
399
417
  createElementVNode("svg", {
400
418
  viewBox: "0 0 24 24",
401
419
  "aria-hidden": "true"
@@ -438,7 +456,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
438
456
  onClick: _cache[1] || (_cache[1] = ($event) => switcherOpen.value = !switcherOpen.value)
439
457
  }, [
440
458
  createElementVNode("span", null, toDisplayString(((_a = currentService.value) == null ? void 0 : _a.name) ?? "서비스"), 1),
441
- _cache[7] || (_cache[7] = createElementVNode("svg", {
459
+ _cache[6] || (_cache[6] = createElementVNode("svg", {
442
460
  class: "lf-switcher__caret",
443
461
  viewBox: "0 0 24 24",
444
462
  "aria-hidden": "true"
@@ -449,31 +467,36 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
449
467
  })
450
468
  ], -1))
451
469
  ], 8, _hoisted_7$a),
452
- switcherOpen.value ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
453
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.services, (svc) => {
454
- return openBlock(), createElementBlock("a", {
455
- key: svc.id,
456
- class: normalizeClass(["lf-switcher__item", {
457
- "lf-switcher__item--active": svc.id === __props.currentServiceId,
458
- "lf-switcher__item--disabled": svc.comingSoon
459
- }]),
460
- href: svc.comingSoon ? void 0 : svc.path,
461
- role: "menuitem",
462
- onClick: ($event) => onServiceClick($event, svc)
463
- }, [
464
- svc.iconPath ? (openBlock(), createElementBlock("svg", _hoisted_10$2, [
465
- createElementVNode("path", {
466
- d: svc.iconPath,
467
- fill: "currentColor"
468
- }, null, 8, _hoisted_11$1)
469
- ])) : createCommentVNode("", true),
470
- createElementVNode("span", _hoisted_12$1, toDisplayString(svc.name), 1),
471
- svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13$1, "준비 중")) : svc.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(svc.badge), 1)) : createCommentVNode("", true)
472
- ], 10, _hoisted_9$2);
473
- }), 128))
474
- ])) : createCommentVNode("", true)
470
+ createVNode(Transition, { name: "lf-shell-menu" }, {
471
+ default: withCtx(() => [
472
+ switcherOpen.value ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
473
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.services, (svc) => {
474
+ return openBlock(), createElementBlock("a", {
475
+ key: svc.id,
476
+ class: normalizeClass(["lf-switcher__item", {
477
+ "lf-switcher__item--active": svc.id === __props.currentServiceId,
478
+ "lf-switcher__item--disabled": svc.comingSoon
479
+ }]),
480
+ href: svc.comingSoon ? void 0 : svc.path,
481
+ role: "menuitem",
482
+ onClick: ($event) => onServiceClick($event, svc)
483
+ }, [
484
+ svc.iconPath ? (openBlock(), createElementBlock("svg", _hoisted_10$2, [
485
+ createElementVNode("path", {
486
+ d: svc.iconPath,
487
+ fill: "currentColor"
488
+ }, null, 8, _hoisted_11$1)
489
+ ])) : createCommentVNode("", true),
490
+ createElementVNode("span", _hoisted_12$1, toDisplayString(svc.name), 1),
491
+ svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13$1, "준비 중")) : svc.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(svc.badge), 1)) : createCommentVNode("", true)
492
+ ], 10, _hoisted_9$2);
493
+ }), 128))
494
+ ])) : createCommentVNode("", true)
495
+ ]),
496
+ _: 1
497
+ })
475
498
  ], 512)) : createCommentVNode("", true),
476
- _cache[9] || (_cache[9] = createElementVNode("div", { class: "lf-topbar__spacer" }, null, -1)),
499
+ _cache[8] || (_cache[8] = createElementVNode("div", { class: "lf-topbar__spacer" }, null, -1)),
477
500
  __props.user ? (openBlock(), createElementBlock("div", {
478
501
  key: 2,
479
502
  ref_key: "userEl",
@@ -494,7 +517,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
494
517
  class: "lf-user__avatar"
495
518
  }, null, 8, _hoisted_16)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(userInitial.value), 1)),
496
519
  createElementVNode("span", _hoisted_18, toDisplayString(__props.user.displayName), 1),
497
- _cache[8] || (_cache[8] = createElementVNode("svg", {
520
+ _cache[7] || (_cache[7] = createElementVNode("svg", {
498
521
  class: "lf-user__caret",
499
522
  viewBox: "0 0 24 24",
500
523
  "aria-hidden": "true"
@@ -505,24 +528,29 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
505
528
  })
506
529
  ], -1))
507
530
  ], 8, _hoisted_15),
508
- userOpen.value ? (openBlock(), createElementBlock("div", {
509
- key: 0,
510
- class: "lf-user__menu",
511
- role: "menu",
512
- onClick: _cache[3] || (_cache[3] = ($event) => userOpen.value = false)
513
- }, [
514
- __props.user.email ? (openBlock(), createElementBlock("p", _hoisted_19, toDisplayString(__props.user.email), 1)) : createCommentVNode("", true),
515
- __props.myPageHref ? (openBlock(), createElementBlock("a", {
516
- key: 1,
517
- href: __props.myPageHref
518
- }, "내 정보", 8, _hoisted_20)) : createCommentVNode("", true),
519
- renderSlot(_ctx.$slots, "user-menu", {}, void 0, true),
520
- __props.logoutHref ? (openBlock(), createElementBlock("a", {
521
- key: 2,
522
- class: "lf-user__logout",
523
- href: __props.logoutHref
524
- }, "로그아웃", 8, _hoisted_21)) : createCommentVNode("", true)
525
- ])) : createCommentVNode("", true)
531
+ createVNode(Transition, { name: "lf-shell-menu" }, {
532
+ default: withCtx(() => [
533
+ userOpen.value ? (openBlock(), createElementBlock("div", {
534
+ key: 0,
535
+ class: "lf-user__menu",
536
+ role: "menu",
537
+ onClick: _cache[3] || (_cache[3] = ($event) => userOpen.value = false)
538
+ }, [
539
+ __props.user.email ? (openBlock(), createElementBlock("p", _hoisted_19, toDisplayString(__props.user.email), 1)) : createCommentVNode("", true),
540
+ __props.myPageHref ? (openBlock(), createElementBlock("a", {
541
+ key: 1,
542
+ href: __props.myPageHref
543
+ }, "내 정보", 8, _hoisted_20)) : createCommentVNode("", true),
544
+ renderSlot(_ctx.$slots, "user-menu", {}, void 0, true),
545
+ __props.logoutHref ? (openBlock(), createElementBlock("a", {
546
+ key: 2,
547
+ class: "lf-user__logout",
548
+ href: __props.logoutHref
549
+ }, "로그아웃", 8, _hoisted_21)) : createCommentVNode("", true)
550
+ ])) : createCommentVNode("", true)
551
+ ]),
552
+ _: 3
553
+ })
526
554
  ], 512)) : renderSlot(_ctx.$slots, "auth-actions", {}, void 0, true, 3),
527
555
  __props.shortcuts.length ? (openBlock(), createElementBlock("nav", _hoisted_22, [
528
556
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.shortcuts, (s) => {
@@ -550,15 +578,19 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
550
578
  class: "lf-glass lf-icon-btn",
551
579
  title: unref(mode2) === "dark" ? "밝은 테마로" : "어두운 테마로",
552
580
  "aria-label": unref(mode2) === "dark" ? "밝은 테마로 전환" : "어두운 테마로 전환",
553
- onClick: _cache[4] || (_cache[4] = //@ts-ignore
554
- (...args) => unref(toggle) && unref(toggle)(...args))
581
+ onClick: onThemeClick
555
582
  }, [
556
- (openBlock(), createElementBlock("svg", _hoisted_27, [
583
+ (openBlock(), createElementBlock("svg", {
584
+ key: unref(mode2),
585
+ viewBox: "0 0 24 24",
586
+ "aria-hidden": "true",
587
+ class: normalizeClass({ "lf-theme-icon--spin": spun.value })
588
+ }, [
557
589
  createElementVNode("path", {
558
590
  d: unref(mode2) === "dark" ? ICON_MOON : ICON_SUN,
559
591
  fill: "currentColor"
560
- }, null, 8, _hoisted_28)
561
- ]))
592
+ }, null, 8, _hoisted_27)
593
+ ], 2))
562
594
  ], 8, _hoisted_26)) : createCommentVNode("", true),
563
595
  renderSlot(_ctx.$slots, "actions", {}, void 0, true)
564
596
  ])
@@ -570,20 +602,20 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
570
602
  createElementVNode("nav", {
571
603
  class: normalizeClass(["lf-rail", { "lf-rail--open": railOpen.value, "lf-rail--hidden": railHidden.value, "lf-rail--overlay": railOverlay.value }]),
572
604
  "aria-label": "메뉴",
573
- onClick: _cache[5] || (_cache[5] = ($event) => railOpen.value = false)
605
+ onClick: _cache[4] || (_cache[4] = ($event) => railOpen.value = false)
574
606
  }, [
575
607
  renderSlot(_ctx.$slots, "rail", {}, void 0, true)
576
608
  ], 2),
577
- createElementVNode("main", _hoisted_29, [
609
+ createElementVNode("main", _hoisted_28, [
578
610
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
579
611
  ])
580
- ], 2)) : (openBlock(), createElementBlock("main", _hoisted_30, [
612
+ ], 2)) : (openBlock(), createElementBlock("main", _hoisted_29, [
581
613
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
582
614
  ])),
583
- createElementVNode("footer", _hoisted_31, [
584
- createElementVNode("div", _hoisted_32, [
615
+ createElementVNode("footer", _hoisted_30, [
616
+ createElementVNode("div", _hoisted_31, [
585
617
  renderSlot(_ctx.$slots, "footer", {}, () => [
586
- _cache[10] || (_cache[10] = createElementVNode("p", { class: "site-footer-copy" }, "© Loafacto. All rights reserved.", -1))
618
+ _cache[9] || (_cache[9] = createElementVNode("p", { class: "site-footer-copy" }, "© Loafacto. All rights reserved.", -1))
587
619
  ], true)
588
620
  ])
589
621
  ])
@@ -591,7 +623,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
591
623
  };
592
624
  }
593
625
  });
594
- const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-7b2df3a9"]]);
626
+ const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-ff76069c"]]);
595
627
  function generateId() {
596
628
  return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
597
629
  }