@loafacto/ui 0.8.3 → 0.8.5

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { readonly, ref, openBlock, createElementBlock, createStaticVNode, createElementVNode, defineComponent, computed, watch, onBeforeUnmount, normalizeStyle, createCommentVNode, Fragment, toDisplayString, createVNode, renderList, normalizeClass, renderSlot, unref, onUnmounted, createBlock, Teleport, TransitionGroup, withCtx, withModifiers, Transition, withDirectives, withKeys, vModelText, resolveDynamicComponent, createTextVNode, useModel, useId, mergeProps, vModelDynamic, mergeModels, useTemplateRef, onMounted, nextTick, vModelSelect, vModelCheckbox, vModelRadio, useSlots } from "vue";
1
+ import { readonly, ref, openBlock, createElementBlock, createStaticVNode, createElementVNode, defineComponent, computed, watch, onBeforeUnmount, normalizeStyle, createCommentVNode, Fragment, toDisplayString, createVNode, renderList, normalizeClass, renderSlot, unref, onUnmounted, createBlock, Teleport, TransitionGroup, withCtx, withModifiers, Transition, useTemplateRef, nextTick, createTextVNode, withDirectives, withKeys, vModelText, resolveDynamicComponent, useModel, useId, mergeProps, vModelDynamic, mergeModels, onMounted, vModelSelect, vModelCheckbox, vModelRadio, useSlots } from "vue";
2
2
  import { a as applyTheme, D as DARK_THEME, L as LIGHT_THEME } from "./applyTheme-EBr0eOKY.js";
3
3
  import { b, c, d, e, f, h, i, l } from "./applyTheme-EBr0eOKY.js";
4
4
  import { defineStore } from "pinia";
@@ -151,43 +151,47 @@ const _hoisted_10$1 = {
151
151
  viewBox: "0 0 24 24",
152
152
  "aria-hidden": "true"
153
153
  };
154
- const _hoisted_11$1 = ["d"];
154
+ const _hoisted_11 = ["d"];
155
155
  const _hoisted_12 = { class: "lf-switcher__label" };
156
156
  const _hoisted_13 = {
157
157
  key: 1,
158
158
  class: "admin-badge admin-badge--gray"
159
159
  };
160
- const _hoisted_14 = ["aria-expanded"];
161
- const _hoisted_15 = ["src"];
162
- const _hoisted_16 = {
160
+ const _hoisted_14 = {
161
+ key: 2,
162
+ class: "admin-badge admin-badge--yellow"
163
+ };
164
+ const _hoisted_15 = ["aria-expanded"];
165
+ const _hoisted_16 = ["src"];
166
+ const _hoisted_17 = {
163
167
  key: 1,
164
168
  class: "lf-user__avatar lf-user__avatar--fallback"
165
169
  };
166
- const _hoisted_17 = { class: "lf-user__name" };
167
- const _hoisted_18 = {
170
+ const _hoisted_18 = { class: "lf-user__name" };
171
+ const _hoisted_19 = {
168
172
  key: 0,
169
173
  class: "lf-user__email"
170
174
  };
171
- const _hoisted_19 = {
175
+ const _hoisted_20 = {
172
176
  key: 3,
173
177
  class: "lf-shortcuts",
174
178
  "aria-label": "바로가기"
175
179
  };
176
- const _hoisted_20 = ["href", "title", "aria-label"];
177
- const _hoisted_21 = {
180
+ const _hoisted_21 = ["href", "title", "aria-label"];
181
+ const _hoisted_22 = {
178
182
  viewBox: "0 0 24 24",
179
183
  "aria-hidden": "true"
180
184
  };
181
- const _hoisted_22 = ["d"];
182
- const _hoisted_23 = ["title", "aria-label"];
183
- const _hoisted_24 = {
185
+ const _hoisted_23 = ["d"];
186
+ const _hoisted_24 = ["title", "aria-label"];
187
+ const _hoisted_25 = {
184
188
  viewBox: "0 0 24 24",
185
189
  "aria-hidden": "true"
186
190
  };
187
- const _hoisted_25 = ["d"];
188
- const _hoisted_26 = { class: "lf-content" };
189
- const _hoisted_27 = { class: "site-footer" };
190
- const _hoisted_28 = { class: "site-footer-inner" };
191
+ const _hoisted_26 = ["d"];
192
+ const _hoisted_27 = { class: "lf-content" };
193
+ const _hoisted_28 = { class: "site-footer" };
194
+ const _hoisted_29 = { class: "site-footer-inner" };
191
195
  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";
192
196
  const ICON_MOON = "M12.3 3a7 7 0 1 0 8.7 8.7A9 9 0 1 1 12.3 3z";
193
197
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
@@ -334,10 +338,10 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
334
338
  createElementVNode("path", {
335
339
  d: svc.iconPath,
336
340
  fill: "currentColor"
337
- }, null, 8, _hoisted_11$1)
341
+ }, null, 8, _hoisted_11)
338
342
  ])) : createCommentVNode("", true),
339
343
  createElementVNode("span", _hoisted_12, toDisplayString(svc.name), 1),
340
- svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13, "준비 중")) : createCommentVNode("", true)
344
+ svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13, "준비 중")) : svc.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(svc.badge), 1)) : createCommentVNode("", true)
341
345
  ], 10, _hoisted_9$1);
342
346
  }), 128))
343
347
  ])) : createCommentVNode("", true)
@@ -361,8 +365,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
361
365
  src: __props.user.avatarUrl,
362
366
  alt: "",
363
367
  class: "lf-user__avatar"
364
- }, null, 8, _hoisted_15)) : (openBlock(), createElementBlock("span", _hoisted_16, toDisplayString(userInitial.value), 1)),
365
- createElementVNode("span", _hoisted_17, toDisplayString(__props.user.displayName), 1),
368
+ }, null, 8, _hoisted_16)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(userInitial.value), 1)),
369
+ createElementVNode("span", _hoisted_18, toDisplayString(__props.user.displayName), 1),
366
370
  _cache[6] || (_cache[6] = createElementVNode("svg", {
367
371
  class: "lf-user__caret",
368
372
  viewBox: "0 0 24 24",
@@ -373,18 +377,18 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
373
377
  fill: "currentColor"
374
378
  })
375
379
  ], -1))
376
- ], 8, _hoisted_14),
380
+ ], 8, _hoisted_15),
377
381
  userOpen.value ? (openBlock(), createElementBlock("div", {
378
382
  key: 0,
379
383
  class: "lf-user__menu",
380
384
  role: "menu",
381
385
  onClick: _cache[3] || (_cache[3] = ($event) => userOpen.value = false)
382
386
  }, [
383
- __props.user.email ? (openBlock(), createElementBlock("p", _hoisted_18, toDisplayString(__props.user.email), 1)) : createCommentVNode("", true),
387
+ __props.user.email ? (openBlock(), createElementBlock("p", _hoisted_19, toDisplayString(__props.user.email), 1)) : createCommentVNode("", true),
384
388
  renderSlot(_ctx.$slots, "user-menu", {}, void 0, true)
385
389
  ])) : createCommentVNode("", true)
386
390
  ], 512)) : renderSlot(_ctx.$slots, "auth-actions", {}, void 0, true, 2),
387
- __props.shortcuts.length ? (openBlock(), createElementBlock("nav", _hoisted_19, [
391
+ __props.shortcuts.length ? (openBlock(), createElementBlock("nav", _hoisted_20, [
388
392
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.shortcuts, (s) => {
389
393
  return openBlock(), createElementBlock("a", {
390
394
  key: s.id,
@@ -395,13 +399,13 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
395
399
  title: s.label,
396
400
  "aria-label": `${s.label} (새 탭에서 열림)`
397
401
  }, [
398
- (openBlock(), createElementBlock("svg", _hoisted_21, [
402
+ (openBlock(), createElementBlock("svg", _hoisted_22, [
399
403
  createElementVNode("path", {
400
404
  d: s.iconPath,
401
405
  fill: "currentColor"
402
- }, null, 8, _hoisted_22)
406
+ }, null, 8, _hoisted_23)
403
407
  ]))
404
- ], 8, _hoisted_20);
408
+ ], 8, _hoisted_21);
405
409
  }), 128))
406
410
  ])) : createCommentVNode("", true),
407
411
  __props.themeToggle ? (openBlock(), createElementBlock("button", {
@@ -413,21 +417,21 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
413
417
  onClick: _cache[4] || (_cache[4] = //@ts-ignore
414
418
  (...args) => unref(toggle) && unref(toggle)(...args))
415
419
  }, [
416
- (openBlock(), createElementBlock("svg", _hoisted_24, [
420
+ (openBlock(), createElementBlock("svg", _hoisted_25, [
417
421
  createElementVNode("path", {
418
422
  d: unref(mode2) === "dark" ? ICON_MOON : ICON_SUN,
419
423
  fill: "currentColor"
420
- }, null, 8, _hoisted_25)
424
+ }, null, 8, _hoisted_26)
421
425
  ]))
422
- ], 8, _hoisted_23)) : createCommentVNode("", true),
426
+ ], 8, _hoisted_24)) : createCommentVNode("", true),
423
427
  renderSlot(_ctx.$slots, "actions", {}, void 0, true)
424
428
  ])
425
429
  ]),
426
- createElementVNode("main", _hoisted_26, [
430
+ createElementVNode("main", _hoisted_27, [
427
431
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
428
432
  ]),
429
- createElementVNode("footer", _hoisted_27, [
430
- createElementVNode("div", _hoisted_28, [
433
+ createElementVNode("footer", _hoisted_28, [
434
+ createElementVNode("div", _hoisted_29, [
431
435
  renderSlot(_ctx.$slots, "footer", {}, () => [
432
436
  _cache[8] || (_cache[8] = createElementVNode("p", { class: "site-footer-copy" }, "© Loafacto. All rights reserved.", -1))
433
437
  ], true)
@@ -437,7 +441,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
437
441
  };
438
442
  }
439
443
  });
440
- const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-f1af4c05"]]);
444
+ const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-dc328b6e"]]);
441
445
  function generateId() {
442
446
  return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
443
447
  }
@@ -676,13 +680,22 @@ const _hoisted_7$6 = {
676
680
  class: "app-confirm__require"
677
681
  };
678
682
  const _hoisted_8$1 = { class: "app-confirm__require-label" };
679
- const _hoisted_9 = ["placeholder"];
680
- const _hoisted_10 = { class: "app-confirm__actions" };
681
- const _hoisted_11 = ["disabled"];
683
+ const _hoisted_9 = { class: "app-confirm__actions" };
684
+ const _hoisted_10 = ["disabled"];
682
685
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
683
686
  __name: "AppConfirmModal",
684
687
  setup(__props) {
685
688
  const store = useConfirmStore();
689
+ const requireInput = useTemplateRef("requireInput");
690
+ watch(
691
+ () => store.open,
692
+ async (open) => {
693
+ var _a;
694
+ if (!open || !store.requireText) return;
695
+ await nextTick();
696
+ (_a = requireInput.value) == null ? void 0 : _a.focus();
697
+ }
698
+ );
686
699
  return (_ctx, _cache) => {
687
700
  return openBlock(), createBlock(Teleport, { to: "body" }, [
688
701
  createVNode(Transition, { name: "app-confirm-fade" }, {
@@ -695,21 +708,25 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
695
708
  createElementVNode("div", _hoisted_5$a, [
696
709
  createElementVNode("p", _hoisted_6$7, toDisplayString(unref(store).message), 1),
697
710
  unref(store).requireText ? (openBlock(), createElementBlock("label", _hoisted_7$6, [
698
- createElementVNode("span", _hoisted_8$1, toDisplayString(unref(store).requireLabel || `계속하려면 ${unref(store).requireText} 를 입력하세요`), 1),
711
+ createElementVNode("span", _hoisted_8$1, [
712
+ createTextVNode(toDisplayString(unref(store).requireLabel || "확인을 위해 입력") + ": ", 1),
713
+ createElementVNode("code", null, toDisplayString(unref(store).requireText), 1)
714
+ ]),
699
715
  withDirectives(createElementVNode("input", {
716
+ ref_key: "requireInput",
717
+ ref: requireInput,
700
718
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(store).typedText = $event),
701
719
  class: "app-confirm__input",
702
720
  type: "text",
703
721
  autocomplete: "off",
704
722
  spellcheck: "false",
705
- placeholder: unref(store).requireText,
706
723
  onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => unref(store).resolve(true), ["prevent"]), ["enter"]))
707
- }, null, 40, _hoisted_9), [
724
+ }, null, 544), [
708
725
  [vModelText, unref(store).typedText]
709
726
  ])
710
727
  ])) : createCommentVNode("", true)
711
728
  ]),
712
- createElementVNode("div", _hoisted_10, [
729
+ createElementVNode("div", _hoisted_9, [
713
730
  createElementVNode("button", {
714
731
  type: "button",
715
732
  class: "app-confirm__btn app-confirm__btn--ghost",
@@ -720,7 +737,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
720
737
  class: normalizeClass(["app-confirm__btn", unref(store).danger ? "app-confirm__btn--danger" : "app-confirm__btn--primary"]),
721
738
  disabled: !unref(store).canConfirm,
722
739
  onClick: _cache[3] || (_cache[3] = ($event) => unref(store).resolve(true))
723
- }, toDisplayString(unref(store).confirmText), 11, _hoisted_11)
740
+ }, toDisplayString(unref(store).confirmText), 11, _hoisted_10)
724
741
  ])
725
742
  ])
726
743
  ])) : createCommentVNode("", true)
@@ -731,7 +748,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
731
748
  };
732
749
  }
733
750
  });
734
- const AppConfirmModal = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-c92e7e61"]]);
751
+ const AppConfirmModal = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-0f5ba1a6"]]);
735
752
  const LF_ICONS = {
736
753
  close: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",
737
754
  search: "M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19 15.5 14zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z",