@loafacto/ui 0.18.0 → 0.18.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.
@@ -1,4 +1,4 @@
1
- import type { ServiceDescriptor, ShellUser, ShortcutLink } from '../types';
1
+ import type { AppShellLabels, ServiceDescriptor, ShellUser, ShortcutLink } from '../types';
2
2
  type __VLS_Props = {
3
3
  services?: ServiceDescriptor[];
4
4
  currentServiceId?: string;
@@ -33,6 +33,11 @@ type __VLS_Props = {
33
33
  user?: ShellUser | null;
34
34
  backgroundColor?: string;
35
35
  backgroundImage?: string;
36
+ /**
37
+ * 셸이 직접 쓰는 글자(다국어). 주지 않은 것은 한국어 기본값 — 영어 화면을 내는 서비스(공장 시스템 등)가
38
+ * 「서비스」「로그아웃」만 한국어로 남는 일이 없게 한다(0.18.1).
39
+ */
40
+ labels?: Partial<AppShellLabels>;
36
41
  };
37
42
  declare var __VLS_23: {}, __VLS_25: {}, __VLS_27: {}, __VLS_29: {}, __VLS_31: {}, __VLS_33: {}, __VLS_35: {};
38
43
  type __VLS_Slots = {} & {
package/dist/index.d.ts CHANGED
@@ -72,4 +72,4 @@ export { applyTheme, DARK_THEME, LIGHT_THEME, DEFAULT_THEME, type ThemeConfig, }
72
72
  export { initTheme, useTheme, type ThemeMode } from './theme/useTheme';
73
73
  export { deriveSemanticPalette, applySemanticPalette, isLightBackground, colorToRgb, hexToRgb, luminance, contrastRatio, type SemanticPalette, } from './theme/themeColors';
74
74
  export { LOAFACTO_SERVICES, serviceIdForPath, isServicePath, } from './services';
75
- export type { ServiceDescriptor, ShellUser, RailItem, ShortcutLink, LfOption, LfTableColumn, LfTableSort, LfTreeNode, LfStep, LfStepStatus, LfDescriptionItem, LfDateRangeValue, } from './types';
75
+ export type { ServiceDescriptor, ShellUser, RailItem, AppShellLabels, ShortcutLink, LfOption, LfTableColumn, LfTableSort, LfTreeNode, LfStep, LfStepStatus, LfDescriptionItem, LfDateRangeValue, } from './types';
package/dist/index.js CHANGED
@@ -236,11 +236,7 @@ const _hoisted_19 = {
236
236
  };
237
237
  const _hoisted_20 = ["href"];
238
238
  const _hoisted_21 = ["href"];
239
- const _hoisted_22 = {
240
- key: 4,
241
- class: "lf-shortcuts",
242
- "aria-label": "바로가기"
243
- };
239
+ const _hoisted_22 = ["aria-label"];
244
240
  const _hoisted_23 = ["href", "title", "aria-label"];
245
241
  const _hoisted_24 = {
246
242
  viewBox: "0 0 24 24",
@@ -249,13 +245,14 @@ const _hoisted_24 = {
249
245
  const _hoisted_25 = ["d"];
250
246
  const _hoisted_26 = ["title", "aria-label"];
251
247
  const _hoisted_27 = ["d"];
252
- const _hoisted_28 = { class: "lf-content lf-content--rail" };
253
- const _hoisted_29 = {
248
+ const _hoisted_28 = ["aria-label"];
249
+ const _hoisted_29 = { class: "lf-content lf-content--rail" };
250
+ const _hoisted_30 = {
254
251
  key: 2,
255
252
  class: "lf-content"
256
253
  };
257
- const _hoisted_30 = { class: "site-footer" };
258
- const _hoisted_31 = { class: "site-footer-inner" };
254
+ const _hoisted_31 = { class: "site-footer" };
255
+ const _hoisted_32 = { class: "site-footer-inner" };
259
256
  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";
260
257
  const ICON_MOON = "M12.3 3a7 7 0 1 0 8.7 8.7A9 9 0 1 1 12.3 3z";
261
258
  const RAIL_KEY = "lf-rail-hidden";
@@ -273,7 +270,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
273
270
  logoUrl: {},
274
271
  user: { default: null },
275
272
  backgroundColor: {},
276
- backgroundImage: {}
273
+ backgroundImage: {},
274
+ labels: {}
277
275
  },
278
276
  emits: ["navigate"],
279
277
  setup(__props, { emit: __emit }) {
@@ -302,6 +300,22 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
302
300
  }
303
301
  const props = __props;
304
302
  const emit = __emit;
303
+ const DEFAULT_LABELS = {
304
+ services: "서비스",
305
+ comingSoon: "준비 중",
306
+ menu: "메뉴",
307
+ menuOpen: "메뉴 열기",
308
+ menuClose: "메뉴 닫기",
309
+ myPage: "내 정보",
310
+ logout: "로그아웃",
311
+ shortcuts: "바로가기",
312
+ newTab: "새 탭에서 열림",
313
+ toLight: "밝은 테마로",
314
+ toDark: "어두운 테마로",
315
+ toLightLong: "밝은 테마로 전환",
316
+ toDarkLong: "어두운 테마로 전환"
317
+ };
318
+ const t = computed(() => ({ ...DEFAULT_LABELS, ...props.labels }));
305
319
  const switcherOpen = ref(false);
306
320
  const switcherEl = ref(null);
307
321
  const userOpen = ref(false);
@@ -404,8 +418,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
404
418
  key: 0,
405
419
  type: "button",
406
420
  class: "lf-rail-toggle",
407
- "aria-label": railHidden.value ? "메뉴 열기" : "메뉴 닫기",
408
- title: railHidden.value ? "메뉴 열기" : "메뉴 닫기",
421
+ "aria-label": railHidden.value ? t.value.menuOpen : t.value.menuClose,
422
+ title: railHidden.value ? t.value.menuOpen : t.value.menuClose,
409
423
  "aria-expanded": !railHidden.value,
410
424
  onClick: toggleRail
411
425
  }, [..._cache[5] || (_cache[5] = [
@@ -450,7 +464,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
450
464
  "aria-haspopup": "menu",
451
465
  onClick: _cache[1] || (_cache[1] = ($event) => switcherOpen.value = !switcherOpen.value)
452
466
  }, [
453
- createElementVNode("span", null, toDisplayString(((_a = currentService.value) == null ? void 0 : _a.name) ?? "서비스"), 1),
467
+ createElementVNode("span", null, toDisplayString(((_a = currentService.value) == null ? void 0 : _a.name) ?? t.value.services), 1),
454
468
  _cache[6] || (_cache[6] = createElementVNode("svg", {
455
469
  class: "lf-switcher__caret",
456
470
  viewBox: "0 0 24 24",
@@ -483,7 +497,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
483
497
  }, null, 8, _hoisted_11$1)
484
498
  ])) : createCommentVNode("", true),
485
499
  createElementVNode("span", _hoisted_12$1, toDisplayString(svc.name), 1),
486
- svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13$1, "준비 중")) : svc.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(svc.badge), 1)) : createCommentVNode("", true)
500
+ svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13$1, toDisplayString(t.value.comingSoon), 1)) : svc.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(svc.badge), 1)) : createCommentVNode("", true)
487
501
  ], 10, _hoisted_9$3);
488
502
  }), 128))
489
503
  ])) : createCommentVNode("", true)
@@ -535,19 +549,23 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
535
549
  __props.myPageHref ? (openBlock(), createElementBlock("a", {
536
550
  key: 1,
537
551
  href: __props.myPageHref
538
- }, "내 정보", 8, _hoisted_20)) : createCommentVNode("", true),
552
+ }, toDisplayString(t.value.myPage), 9, _hoisted_20)) : createCommentVNode("", true),
539
553
  renderSlot(_ctx.$slots, "user-menu", {}, void 0, true),
540
554
  __props.logoutHref ? (openBlock(), createElementBlock("a", {
541
555
  key: 2,
542
556
  class: "lf-user__logout",
543
557
  href: __props.logoutHref
544
- }, "로그아웃", 8, _hoisted_21)) : createCommentVNode("", true)
558
+ }, toDisplayString(t.value.logout), 9, _hoisted_21)) : createCommentVNode("", true)
545
559
  ])) : createCommentVNode("", true)
546
560
  ]),
547
561
  _: 3
548
562
  })
549
563
  ], 512)) : renderSlot(_ctx.$slots, "auth-actions", {}, void 0, true, 3),
550
- __props.shortcuts.length ? (openBlock(), createElementBlock("nav", _hoisted_22, [
564
+ __props.shortcuts.length ? (openBlock(), createElementBlock("nav", {
565
+ key: 4,
566
+ class: "lf-shortcuts",
567
+ "aria-label": t.value.shortcuts
568
+ }, [
551
569
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.shortcuts, (s) => {
552
570
  return openBlock(), createElementBlock("a", {
553
571
  key: s.id,
@@ -556,7 +574,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
556
574
  target: "_blank",
557
575
  rel: "noopener noreferrer",
558
576
  title: s.label,
559
- "aria-label": `${s.label} (새 탭에서 열림)`
577
+ "aria-label": `${s.label} (${t.value.newTab})`
560
578
  }, [
561
579
  (openBlock(), createElementBlock("svg", _hoisted_24, [
562
580
  createElementVNode("path", {
@@ -566,13 +584,13 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
566
584
  ]))
567
585
  ], 8, _hoisted_23);
568
586
  }), 128))
569
- ])) : createCommentVNode("", true),
587
+ ], 8, _hoisted_22)) : createCommentVNode("", true),
570
588
  __props.themeToggle ? (openBlock(), createElementBlock("button", {
571
589
  key: 5,
572
590
  type: "button",
573
591
  class: "lf-glass lf-icon-btn",
574
- title: unref(mode2) === "dark" ? "밝은 테마로" : "어두운 테마로",
575
- "aria-label": unref(mode2) === "dark" ? "밝은 테마로 전환" : "어두운 테마로 전환",
592
+ title: unref(mode2) === "dark" ? t.value.toLight : t.value.toDark,
593
+ "aria-label": unref(mode2) === "dark" ? t.value.toLightLong : t.value.toDarkLong,
576
594
  onClick: onThemeClick
577
595
  }, [
578
596
  (openBlock(), createElementBlock("svg", {
@@ -596,19 +614,19 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
596
614
  }, [
597
615
  createElementVNode("nav", {
598
616
  class: normalizeClass(["lf-rail", { "lf-rail--open": railOpen.value, "lf-rail--hidden": railHidden.value, "lf-rail--overlay": railOverlay.value }]),
599
- "aria-label": "메뉴",
617
+ "aria-label": t.value.menu,
600
618
  onClick: _cache[4] || (_cache[4] = ($event) => railOpen.value = false)
601
619
  }, [
602
620
  renderSlot(_ctx.$slots, "rail", {}, void 0, true)
603
- ], 2),
604
- createElementVNode("main", _hoisted_28, [
621
+ ], 10, _hoisted_28),
622
+ createElementVNode("main", _hoisted_29, [
605
623
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
606
624
  ])
607
- ], 2)) : (openBlock(), createElementBlock("main", _hoisted_29, [
625
+ ], 2)) : (openBlock(), createElementBlock("main", _hoisted_30, [
608
626
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
609
627
  ])),
610
- createElementVNode("footer", _hoisted_30, [
611
- createElementVNode("div", _hoisted_31, [
628
+ createElementVNode("footer", _hoisted_31, [
629
+ createElementVNode("div", _hoisted_32, [
612
630
  renderSlot(_ctx.$slots, "footer", {}, () => [
613
631
  _cache[9] || (_cache[9] = createElementVNode("p", { class: "site-footer-copy" }, "© Loafacto. All rights reserved.", -1))
614
632
  ], true)
@@ -618,7 +636,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
618
636
  };
619
637
  }
620
638
  });
621
- const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-ff76069c"]]);
639
+ const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-b8a57f75"]]);
622
640
  function generateId() {
623
641
  return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
624
642
  }