@ichaingo/header 1.5.25 → 1.5.26

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,53 +1,57 @@
1
1
  'use client';
2
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
3
- import { useLocale as h, useTranslations as d } from "next-intl";
2
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
3
+ import { useLocale as h, useTranslations as f } from "next-intl";
4
4
  import { useSearchParams as p, usePathname as x } from "next/navigation";
5
- import { Accordion as b, AccordionItem as w, AccordionTrigger as y, AccordionContent as N } from "@ichaingo/ui/accordion";
6
- import { twMerge as j } from "tailwind-merge";
7
- import { useCallback as v } from "react";
5
+ import { Accordion as b, AccordionItem as w, AccordionTrigger as y, AccordionContent as v } from "@ichaingo/ui/accordion";
6
+ import { twMerge as N } from "tailwind-merge";
7
+ import { useCallback as j } from "react";
8
8
  import k from "@ichaingo/link";
9
9
  import $ from "@ichaingo/theme-toggle";
10
- function U({ onClick: f = () => {
10
+ function U({ onClick: d = () => {
11
11
  } }) {
12
- var i;
13
- const a = h(), r = p(), t = d("lang"), s = d("setting"), o = [
12
+ var g;
13
+ const a = h(), o = p(), t = f("lang"), c = f("setting"), i = [
14
14
  { name: t("en"), lang: "en" },
15
15
  { name: t("ja"), lang: "ja" },
16
16
  { name: t("ko"), lang: "ko" },
17
17
  { name: t("zh-hant"), lang: "zh-hant" },
18
18
  { name: t("zh-hans"), lang: "zh-hans" }
19
- ], c = x(), u = v(
20
- (n) => {
21
- const m = c.replace(new RegExp(`/${a}(/|$)`), `/${n}$1`), g = r.toString();
22
- return g ? `${m}?${g}` : m;
19
+ ], m = x(), u = j(
20
+ (e) => {
21
+ const s = m.replace(new RegExp(`/${a}(/|$)`), `/${e}$1`), l = o.toString();
22
+ return l ? `${s}?${l}` : s;
23
23
  },
24
- [c, a, r]
24
+ [m, a, o]
25
25
  );
26
- return /* @__PURE__ */ l("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
27
- /* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(b, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ l(w, { value: a, className: "border-0", children: [
28
- /* @__PURE__ */ e(y, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ l("div", { className: "flex w-full justify-between items-center", children: [
29
- /* @__PURE__ */ e("span", { className: "text-title", children: s("language") }),
30
- /* @__PURE__ */ e("span", { className: "text-title", children: (i = o.find((n) => n.lang === a)) == null ? void 0 : i.name })
26
+ return /* @__PURE__ */ r("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
27
+ /* @__PURE__ */ n("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ n(b, { type: "single", className: "flex-1", collapsible: !0, onValueChange: (e) => {
28
+ document.querySelectorAll("iframe").forEach((l) => {
29
+ l.style.pointerEvents = e ? "auto" : "none";
30
+ });
31
+ }, children: /* @__PURE__ */ r(w, { value: a, className: "border-0", children: [
32
+ /* @__PURE__ */ n(y, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ r("div", { className: "flex w-full justify-between items-center", children: [
33
+ /* @__PURE__ */ n("span", { className: "text-title", children: c("language") }),
34
+ /* @__PURE__ */ n("span", { className: "text-title", children: (g = i.find((e) => e.lang === a)) == null ? void 0 : g.name })
31
35
  ] }) }),
32
- /* @__PURE__ */ e(N, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((n) => /* @__PURE__ */ e(
36
+ /* @__PURE__ */ n(v, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: i.map((e) => /* @__PURE__ */ n(
33
37
  k,
34
38
  {
35
39
  prefetch: !1,
36
40
  withLocale: !1,
37
- className: j(
41
+ className: N(
38
42
  "p-2 rounded-lg flex w-full justify-between items-center",
39
- a === n.lang ? "text-primary" : ""
43
+ a === e.lang ? "text-primary" : ""
40
44
  ),
41
- href: u(n.lang),
42
- onClick: f,
43
- children: n.name
45
+ href: u(e.lang),
46
+ onClick: d,
47
+ children: e.name
44
48
  },
45
- n.lang
49
+ e.lang
46
50
  )) })
47
51
  ] }) }) }),
48
- /* @__PURE__ */ l("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
49
- /* @__PURE__ */ e("div", { children: s("theme") }),
50
- /* @__PURE__ */ e($, {})
52
+ /* @__PURE__ */ r("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
53
+ /* @__PURE__ */ n("div", { children: c("theme") }),
54
+ /* @__PURE__ */ n($, {})
51
55
  ] })
52
56
  ] });
53
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/header",
3
- "version": "1.5.25",
3
+ "version": "1.5.26",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -32,18 +32,18 @@
32
32
  "tailwind-merge": "3.3.1",
33
33
  "next": "15.5.6",
34
34
  "antd": "6.1.1",
35
- "@ichaingo/auth": "1.5.25",
36
- "@ichaingo/better-link": "1.5.25",
37
- "@ichaingo/image": "1.5.25",
38
- "@ichaingo/translation": "1.5.25",
39
- "@ichaingo/request": "1.5.25",
40
- "@ichaingo/with-login": "1.5.25",
41
- "@ichaingo/tooltip": "1.5.25",
42
- "@ichaingo/token": "1.5.25",
43
- "@ichaingo/iconfont": "1.5.25",
44
- "@ichaingo/ui": "1.5.25",
45
- "@ichaingo/avatar": "1.5.25",
46
- "@ichaingo/link": "1.5.25",
47
- "@ichaingo/theme-toggle": "1.5.25"
35
+ "@ichaingo/auth": "1.5.26",
36
+ "@ichaingo/avatar": "1.5.26",
37
+ "@ichaingo/image": "1.5.26",
38
+ "@ichaingo/better-link": "1.5.26",
39
+ "@ichaingo/link": "1.5.26",
40
+ "@ichaingo/translation": "1.5.26",
41
+ "@ichaingo/ui": "1.5.26",
42
+ "@ichaingo/theme-toggle": "1.5.26",
43
+ "@ichaingo/iconfont": "1.5.26",
44
+ "@ichaingo/request": "1.5.26",
45
+ "@ichaingo/with-login": "1.5.26",
46
+ "@ichaingo/token": "1.5.26",
47
+ "@ichaingo/tooltip": "1.5.26"
48
48
  }
49
49
  }