@ichaingo/header 1.5.26 → 1.5.28

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,57 +1,53 @@
1
1
  'use client';
2
- import { jsxs as r, jsx as n } from "react/jsx-runtime";
3
- import { useLocale as h, useTranslations as f } from "next-intl";
2
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
3
+ import { useLocale as h, useTranslations as d } 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 v } from "@ichaingo/ui/accordion";
6
- import { twMerge as N } from "tailwind-merge";
7
- import { useCallback as j } from "react";
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";
8
8
  import k from "@ichaingo/link";
9
9
  import $ from "@ichaingo/theme-toggle";
10
- function U({ onClick: d = () => {
10
+ function U({ onClick: f = () => {
11
11
  } }) {
12
- var g;
13
- const a = h(), o = p(), t = f("lang"), c = f("setting"), i = [
12
+ var i;
13
+ const a = h(), r = p(), t = d("lang"), s = d("setting"), o = [
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
- ], 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;
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;
23
23
  },
24
- [m, a, o]
24
+ [c, a, r]
25
25
  );
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 })
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 })
35
31
  ] }) }),
36
- /* @__PURE__ */ n(v, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: i.map((e) => /* @__PURE__ */ n(
32
+ /* @__PURE__ */ e(N, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((n) => /* @__PURE__ */ e(
37
33
  k,
38
34
  {
39
35
  prefetch: !1,
40
36
  withLocale: !1,
41
- className: N(
37
+ className: j(
42
38
  "p-2 rounded-lg flex w-full justify-between items-center",
43
- a === e.lang ? "text-primary" : ""
39
+ a === n.lang ? "text-primary" : ""
44
40
  ),
45
- href: u(e.lang),
46
- onClick: d,
47
- children: e.name
41
+ href: u(n.lang),
42
+ onClick: f,
43
+ children: n.name
48
44
  },
49
- e.lang
45
+ n.lang
50
46
  )) })
51
47
  ] }) }) }),
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($, {})
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($, {})
55
51
  ] })
56
52
  ] });
57
53
  }
@@ -1,14 +1,18 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import d from "@ichaingo/iconfont";
3
- import i from "@ichaingo/tooltip";
4
- import r from "./SettingBody.js";
5
- function a({ onClick: o = () => {
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import i from "@ichaingo/iconfont";
3
+ import l from "@ichaingo/tooltip";
4
+ import o from "./SettingBody.js";
5
+ function g({ onClick: r = () => {
6
6
  } }) {
7
- return /* @__PURE__ */ t("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
8
- /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module hover:bg-stroke rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(i, { side: "bottom", needClick: !0, contentClassName: "bg-module w-70 rounded-lg bg-module text-title border border-stroke", trigger: /* @__PURE__ */ e(d, { type: "icon-centersetup", className: "text-2xl" }), arrowClassName: "fill-module", children: /* @__PURE__ */ e(r, { onClick: o }) }) }),
9
- /* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(r, {}) })
7
+ return /* @__PURE__ */ n("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
8
+ /* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module hover:bg-stroke rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(l, { side: "bottom", onChange: (t) => {
9
+ document.querySelectorAll("iframe").forEach((d) => {
10
+ d.style.pointerEvents = t ? "none" : "auto";
11
+ });
12
+ }, needClick: !0, contentClassName: "bg-module w-70 rounded-lg bg-module text-title border border-stroke", trigger: /* @__PURE__ */ e(i, { type: "icon-centersetup", className: "text-2xl" }), arrowClassName: "fill-module", children: /* @__PURE__ */ e(o, { onClick: r }) }) }),
13
+ /* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(o, {}) })
10
14
  ] });
11
15
  }
12
16
  export {
13
- a as default
17
+ g as default
14
18
  };
@@ -1,27 +1,31 @@
1
1
  'use client';
2
2
  import { jsx as l, jsxs as r } from "react/jsx-runtime";
3
- import d from "@ichaingo/link";
4
- import o from "@ichaingo/translation";
5
- import m from "./MainTrigger.js";
3
+ import m from "@ichaingo/link";
4
+ import d from "@ichaingo/translation";
5
+ import n from "./MainTrigger.js";
6
6
  import c from "./Logout.js";
7
- import n from "@ichaingo/avatar";
8
- import s from "@ichaingo/tooltip";
9
- function u({
7
+ import s from "@ichaingo/avatar";
8
+ import p from "@ichaingo/tooltip";
9
+ function y({
10
10
  list: t,
11
11
  userInfo: e,
12
- onClick: i
12
+ onClick: o
13
13
  }) {
14
- return /* @__PURE__ */ l(s, { trigger: /* @__PURE__ */ l(m, { userInfo: e }), arrowClassName: "fill-module", contentClassName: "text-title w-75 p-0 border-transparent outline-none ", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
14
+ return /* @__PURE__ */ l(p, { onChange: (a) => {
15
+ document.querySelectorAll("iframe").forEach((i) => {
16
+ i.style.pointerEvents = a ? "none" : "auto";
17
+ });
18
+ }, trigger: /* @__PURE__ */ l(n, { userInfo: e }), arrowClassName: "fill-module", contentClassName: "text-title w-75 p-0 border-transparent outline-none ", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
15
19
  /* @__PURE__ */ l("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
16
- /* @__PURE__ */ l(n, { userInfo: e, className: "w-8 h-8" }),
20
+ /* @__PURE__ */ l(s, { userInfo: e, className: "w-8 h-8" }),
17
21
  /* @__PURE__ */ r("div", { className: "flex flex-col overflow-hidden", children: [
18
22
  /* @__PURE__ */ l("div", { className: "text-sm font-medium", children: (e == null ? void 0 : e.username) || "--" }),
19
23
  /* @__PURE__ */ l("div", { className: "text-xs text-muted-foreground w-full truncate", children: (e == null ? void 0 : e.email) || (e == null ? void 0 : e.walletAddress) })
20
24
  ] })
21
25
  ] }) }),
22
- t.map((a) => /* @__PURE__ */ l("div", { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2 w-full", children: a.name === "logout" ? /* @__PURE__ */ l(c, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ l(d, { href: `/${a.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background hover:text-primary rounded-lg ", onClick: i, children: /* @__PURE__ */ l(o, { value: a.name, parentKey: "account" }) }) }) }, a.name))
26
+ t.map((a) => /* @__PURE__ */ l("div", { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2 w-full", children: a.name === "logout" ? /* @__PURE__ */ l(c, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ l(m, { href: `/${a.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background hover:text-primary rounded-lg ", onClick: o, children: /* @__PURE__ */ l(d, { value: a.name, parentKey: "account" }) }) }) }, a.name))
23
27
  ] }) });
24
28
  }
25
29
  export {
26
- u as default
30
+ y as default
27
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/header",
3
- "version": "1.5.26",
3
+ "version": "1.5.28",
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.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"
35
+ "@ichaingo/avatar": "1.5.28",
36
+ "@ichaingo/auth": "1.5.28",
37
+ "@ichaingo/image": "1.5.28",
38
+ "@ichaingo/better-link": "1.5.28",
39
+ "@ichaingo/link": "1.5.28",
40
+ "@ichaingo/ui": "1.5.28",
41
+ "@ichaingo/iconfont": "1.5.28",
42
+ "@ichaingo/translation": "1.5.28",
43
+ "@ichaingo/theme-toggle": "1.5.28",
44
+ "@ichaingo/with-login": "1.5.28",
45
+ "@ichaingo/request": "1.5.28",
46
+ "@ichaingo/tooltip": "1.5.28",
47
+ "@ichaingo/token": "1.5.28"
48
48
  }
49
49
  }