@naeil/ui 0.2.0 → 0.4.0
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/CHANGELOG.md +28 -0
- package/DESIGN.md +194 -0
- package/LICENSE +21 -0
- package/README.md +77 -53
- package/THIRD_PARTY_NOTICES.md +51 -0
- package/dist/{chunk-SYI3IKIC.js → chunk-QKVN6Q6C.js} +102 -19
- package/dist/components/index.d.ts +17 -8
- package/dist/components/index.js +1278 -251
- package/dist/components/ui/index.d.ts +27 -5
- package/dist/components/ui/index.js +288 -33
- package/dist/source/components/brand-artwork.generated.d.ts +162 -0
- package/dist/source/components/brand-artwork.generated.js +1103 -0
- package/dist/source/components/footer.d.ts +15 -0
- package/dist/source/components/footer.js +128 -0
- package/dist/source/components/index.d.ts +11 -0
- package/dist/source/components/index.js +26 -0
- package/dist/source/components/locale-switcher.d.ts +17 -0
- package/dist/source/components/locale-switcher.js +66 -0
- package/dist/source/components/logo.d.ts +18 -0
- package/dist/source/components/logo.js +91 -0
- package/dist/source/components/nav.d.ts +39 -0
- package/dist/source/components/nav.js +375 -0
- package/dist/source/components/theme-provider.d.ts +6 -0
- package/dist/source/components/theme-provider.js +45 -0
- package/dist/source/components/theme-toggle-icon.d.ts +5 -0
- package/dist/source/components/theme-toggle-icon.js +62 -0
- package/dist/source/components/theme-toggle.d.ts +5 -0
- package/dist/source/components/theme-toggle.js +34 -0
- package/dist/source/components/typography.d.ts +12 -0
- package/dist/source/components/typography.js +49 -0
- package/dist/source/components/ui/avatar.d.ts +14 -0
- package/dist/source/components/ui/avatar.js +137 -0
- package/dist/source/components/ui/badge.d.ts +13 -0
- package/dist/source/components/ui/badge.js +76 -0
- package/dist/source/components/ui/button.d.ts +14 -0
- package/dist/source/components/ui/button.js +88 -0
- package/dist/source/components/ui/card.d.ts +13 -0
- package/dist/source/components/ui/card.js +135 -0
- package/dist/source/components/ui/checkbox.d.ts +7 -0
- package/dist/source/components/ui/checkbox.js +58 -0
- package/dist/source/components/ui/dialog.d.ts +20 -0
- package/dist/source/components/ui/dialog.js +182 -0
- package/dist/source/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/source/components/ui/dropdown-menu.js +282 -0
- package/dist/source/components/ui/index.d.ts +19 -0
- package/dist/source/components/ui/index.js +131 -0
- package/dist/source/components/ui/input.d.ts +6 -0
- package/dist/source/components/ui/input.js +49 -0
- package/dist/source/components/ui/select.d.ts +16 -0
- package/dist/source/components/ui/select.js +197 -0
- package/dist/source/components/ui/sonner.d.ts +6 -0
- package/dist/source/components/ui/sonner.js +80 -0
- package/dist/source/components/ui/switch.d.ts +7 -0
- package/dist/source/components/ui/switch.js +54 -0
- package/dist/source/components/ui/tabs.d.ts +10 -0
- package/dist/source/components/ui/tabs.js +57 -0
- package/dist/source/components/ui/textarea.d.ts +6 -0
- package/dist/source/components/ui/textarea.js +46 -0
- package/dist/source/i18n/config.d.ts +6 -0
- package/dist/source/i18n/config.js +12 -0
- package/dist/source/i18n/routing.d.ts +371 -0
- package/dist/source/i18n/routing.js +17 -0
- package/dist/source/lib/design/modal-inert.d.ts +6 -0
- package/dist/source/lib/design/modal-inert.js +73 -0
- package/dist/source/lib/utils.d.ts +5 -0
- package/dist/source/lib/utils.js +8 -0
- package/dist/tokens.ts +217 -0
- package/docs/components/README.md +21 -0
- package/docs/components/avatar.md +47 -0
- package/docs/components/badge.md +29 -0
- package/docs/components/button.md +39 -0
- package/docs/components/card.md +32 -0
- package/docs/components/checkbox.md +35 -0
- package/docs/components/common.md +31 -0
- package/docs/components/composition.md +68 -0
- package/docs/components/dialog.md +41 -0
- package/docs/components/dropdown-menu.md +38 -0
- package/docs/components/input.md +32 -0
- package/docs/components/select.md +39 -0
- package/docs/components/sonner.md +37 -0
- package/docs/components/switch.md +33 -0
- package/docs/components/tabs.md +40 -0
- package/docs/components/textarea.md +35 -0
- package/docs/design/component-demand.md +30 -0
- package/docs/design/public-ui-final-verification.md +96 -0
- package/docs/design/public-ui-release-validation.md +86 -0
- package/docs/design/public-ui-stage3-verification.md +98 -0
- package/docs/design/public-ui-stage4-verification.md +129 -0
- package/docs/design/public-ui-support.md +42 -0
- package/docs/design/v2-migration.md +229 -0
- package/docs/package-release.md +108 -0
- package/licenses/Lato-OFL.txt +93 -0
- package/licenses/Noto-Sans-JP-OFL.txt +93 -0
- package/licenses/Nunito-Sans-OFL.txt +93 -0
- package/licenses/Pretendard-OFL.txt +94 -0
- package/licenses/React-MIT.txt +21 -0
- package/licenses/Storybook-MIT.txt +21 -0
- package/licenses/popper-MIT.txt +25 -0
- package/licenses/react-remove-scroll-bar-MIT.txt +21 -0
- package/licenses/store2-MIT.txt +22 -0
- package/licenses/toggle-selection-MIT.txt +21 -0
- package/package.json +184 -34
- package/src/styles/components.css +276 -0
- package/src/styles/globals.css +18 -0
- package/src/styles/theme.css +185 -98
- package/messages/en.json +0 -221
- package/messages/ja.json +0 -221
- package/messages/ko.json +0 -221
- package/src/app/globals.css +0 -32
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface FooterProps {
|
|
4
|
+
/** Link component from consumer */
|
|
5
|
+
Link?: React.ComponentType<{
|
|
6
|
+
href: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Whether links go to naeil.dev (external) or are internal. Default: false */
|
|
11
|
+
linksExternal?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function Footer({ Link, linksExternal }: FooterProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { Footer };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from "next-intl";
|
|
4
|
+
import { Logo } from "./logo.js";
|
|
5
|
+
function NavLink({
|
|
6
|
+
href,
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
linksExternal,
|
|
10
|
+
Link
|
|
11
|
+
}) {
|
|
12
|
+
if (linksExternal) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"a",
|
|
15
|
+
{
|
|
16
|
+
href: `https://naeil.dev${href}`,
|
|
17
|
+
target: "_blank",
|
|
18
|
+
rel: "noopener noreferrer",
|
|
19
|
+
className,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
if (Link) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Link, { href, className, children });
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsx("a", { href, className, children });
|
|
28
|
+
}
|
|
29
|
+
function Footer({ Link, linksExternal = false }) {
|
|
30
|
+
const t = useTranslations("footer");
|
|
31
|
+
return /* @__PURE__ */ jsx("footer", { className: "border-border/40 border-t", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-7xl flex-col gap-10 px-6 py-16 sm:flex-row sm:justify-between", children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Logo, { variant: "footer", size: 20, className: "block" }),
|
|
34
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-[240px] text-sm leading-relaxed", children: t("tagline") }),
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
"a",
|
|
38
|
+
{
|
|
39
|
+
href: "https://github.com/naeil-dev",
|
|
40
|
+
target: "_blank",
|
|
41
|
+
rel: "noopener noreferrer",
|
|
42
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
43
|
+
"aria-label": "GitHub",
|
|
44
|
+
children: /* @__PURE__ */ jsx(GitHubIcon, {})
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
"a",
|
|
49
|
+
{
|
|
50
|
+
href: "https://x.com",
|
|
51
|
+
target: "_blank",
|
|
52
|
+
rel: "noopener noreferrer",
|
|
53
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
54
|
+
"aria-label": "X",
|
|
55
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-10 sm:gap-16", children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground text-xs font-medium uppercase tracking-wider", children: t("navigation") }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
NavLink,
|
|
65
|
+
{
|
|
66
|
+
href: "/projects",
|
|
67
|
+
className: "text-muted-foreground hover:text-foreground text-sm transition-colors",
|
|
68
|
+
linksExternal,
|
|
69
|
+
Link,
|
|
70
|
+
children: t("projects")
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
NavLink,
|
|
75
|
+
{
|
|
76
|
+
href: "/blog",
|
|
77
|
+
className: "text-muted-foreground hover:text-foreground text-sm transition-colors",
|
|
78
|
+
linksExternal,
|
|
79
|
+
Link,
|
|
80
|
+
children: t("blog")
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground text-xs font-medium uppercase tracking-wider", children: t("social") }),
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
"a",
|
|
88
|
+
{
|
|
89
|
+
href: "https://github.com/naeil-dev",
|
|
90
|
+
target: "_blank",
|
|
91
|
+
rel: "noopener noreferrer",
|
|
92
|
+
className: "text-muted-foreground hover:text-foreground text-sm transition-colors",
|
|
93
|
+
children: "GitHub \u2197"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] })
|
|
97
|
+
] })
|
|
98
|
+
] }) });
|
|
99
|
+
}
|
|
100
|
+
function GitHubIcon() {
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
"svg",
|
|
103
|
+
{
|
|
104
|
+
width: "16",
|
|
105
|
+
height: "16",
|
|
106
|
+
viewBox: "0 0 24 24",
|
|
107
|
+
fill: "currentColor",
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" })
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function XIcon() {
|
|
114
|
+
return /* @__PURE__ */ jsx(
|
|
115
|
+
"svg",
|
|
116
|
+
{
|
|
117
|
+
width: "14",
|
|
118
|
+
height: "14",
|
|
119
|
+
viewBox: "0 0 24 24",
|
|
120
|
+
fill: "currentColor",
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" })
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
Footer
|
|
128
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Nav } from './nav.js';
|
|
2
|
+
export { Footer } from './footer.js';
|
|
3
|
+
export { LocaleSwitcher } from './locale-switcher.js';
|
|
4
|
+
export { ThemeToggle } from './theme-toggle.js';
|
|
5
|
+
export { ThemeProvider } from './theme-provider.js';
|
|
6
|
+
export { ThemeToggleIcon } from './theme-toggle-icon.js';
|
|
7
|
+
export { Logo, LogoProps } from './logo.js';
|
|
8
|
+
export { PageTitle, SectionTitle, pageTitleClass, sectionTitleClass } from './typography.js';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import 'next-themes';
|
|
11
|
+
import 'react';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Nav } from "./nav.js";
|
|
2
|
+
import { Footer } from "./footer.js";
|
|
3
|
+
import { LocaleSwitcher } from "./locale-switcher.js";
|
|
4
|
+
import { ThemeToggle } from "./theme-toggle.js";
|
|
5
|
+
import { ThemeProvider } from "./theme-provider.js";
|
|
6
|
+
import { ThemeToggleIcon } from "./theme-toggle-icon.js";
|
|
7
|
+
import { Logo } from "./logo.js";
|
|
8
|
+
import {
|
|
9
|
+
PageTitle,
|
|
10
|
+
SectionTitle,
|
|
11
|
+
pageTitleClass,
|
|
12
|
+
sectionTitleClass
|
|
13
|
+
} from "./typography.js";
|
|
14
|
+
export {
|
|
15
|
+
Footer,
|
|
16
|
+
LocaleSwitcher,
|
|
17
|
+
Logo,
|
|
18
|
+
Nav,
|
|
19
|
+
PageTitle,
|
|
20
|
+
SectionTitle,
|
|
21
|
+
ThemeProvider,
|
|
22
|
+
ThemeToggle,
|
|
23
|
+
ThemeToggleIcon,
|
|
24
|
+
pageTitleClass,
|
|
25
|
+
sectionTitleClass
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface LocaleSwitcherProps {
|
|
4
|
+
/** Available locales */
|
|
5
|
+
locales: Array<{
|
|
6
|
+
code: string;
|
|
7
|
+
short: string;
|
|
8
|
+
full: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Current locale */
|
|
11
|
+
currentLocale: string;
|
|
12
|
+
/** Called when user selects a new locale */
|
|
13
|
+
onLocaleChange: (locale: string) => void;
|
|
14
|
+
}
|
|
15
|
+
declare function LocaleSwitcher({ locales, currentLocale, onLocaleChange, }: LocaleSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { LocaleSwitcher };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuTrigger,
|
|
6
|
+
DropdownMenuContent,
|
|
7
|
+
DropdownMenuItem
|
|
8
|
+
} from "./ui/dropdown-menu.js";
|
|
9
|
+
function LocaleSwitcher({
|
|
10
|
+
locales,
|
|
11
|
+
currentLocale,
|
|
12
|
+
onLocaleChange
|
|
13
|
+
}) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const current = locales.find((l) => l.code === currentLocale);
|
|
16
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
className: "text-muted-foreground hover:text-foreground flex items-center gap-1.5 text-sm transition-colors focus:outline-none",
|
|
21
|
+
"aria-label": `Change language \u2014 current: ${(_a = current == null ? void 0 : current.short) != null ? _a : currentLocale}`,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsx(GlobeIcon, {}),
|
|
24
|
+
(_b = current == null ? void 0 : current.short) != null ? _b : currentLocale.toUpperCase()
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
) }),
|
|
28
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "min-w-[120px]", children: locales.map((l) => /* @__PURE__ */ jsxs(
|
|
29
|
+
DropdownMenuItem,
|
|
30
|
+
{
|
|
31
|
+
onClick: () => onLocaleChange(l.code),
|
|
32
|
+
className: l.code === currentLocale ? "font-medium" : "",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground mr-2 w-5 text-xs", children: l.short }),
|
|
35
|
+
l.full
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
l.code
|
|
39
|
+
)) })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
function GlobeIcon() {
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"svg",
|
|
45
|
+
{
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
width: "14",
|
|
48
|
+
height: "14",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
strokeWidth: "1.5",
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
strokeLinejoin: "round",
|
|
55
|
+
className: "shrink-0",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
58
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }),
|
|
59
|
+
/* @__PURE__ */ jsx("path", { d: "M2 12h20" })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
LocaleSwitcher
|
|
66
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { SVGProps } from 'react';
|
|
3
|
+
|
|
4
|
+
interface LogoProps extends Omit<SVGProps<SVGSVGElement>, "children" | "width" | "height" | "viewBox"> {
|
|
5
|
+
/** Rendered height. Symbol stays square; lockups preserve their aspect ratio. */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** Legacy single-ink currentColor silhouette. Prefer tone="gray" for tonal detail. */
|
|
8
|
+
mono?: boolean;
|
|
9
|
+
variant?: "symbol" | "horizontal" | "footer" | "stacked" | "wordmark";
|
|
10
|
+
tone?: "color" | "gray";
|
|
11
|
+
/** Auto follows the nearest .light/.dark or data-theme ancestor, then the OS. */
|
|
12
|
+
theme?: "auto" | "light" | "dark";
|
|
13
|
+
/** null marks a decorative logo; label the containing link instead. */
|
|
14
|
+
label?: string | null;
|
|
15
|
+
}
|
|
16
|
+
declare function Logo({ size, mono, variant, tone, theme, label, className, ...props }: LogoProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Logo, type LogoProps };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
+
import { useId } from "react";
|
|
35
|
+
import { BrandArtwork, brandDimensions, brandVersion } from "./brand-artwork.generated.js";
|
|
36
|
+
const autoThemeCSS = `
|
|
37
|
+
:where(.light,[data-theme="light"]){--naeil-logo-light:inline;--naeil-logo-dark:none}
|
|
38
|
+
:where(.dark,[data-theme="dark"]){--naeil-logo-light:none;--naeil-logo-dark:inline}
|
|
39
|
+
@media(prefers-color-scheme:dark){[data-naeil-theme="auto"]{--naeil-logo-os-light:none;--naeil-logo-os-dark:inline}}
|
|
40
|
+
`;
|
|
41
|
+
function Logo(_a) {
|
|
42
|
+
var _b = _a, {
|
|
43
|
+
size = 20,
|
|
44
|
+
mono = false,
|
|
45
|
+
variant = "symbol",
|
|
46
|
+
tone = "color",
|
|
47
|
+
theme = "auto",
|
|
48
|
+
label = "naeil",
|
|
49
|
+
className
|
|
50
|
+
} = _b, props = __objRest(_b, [
|
|
51
|
+
"size",
|
|
52
|
+
"mono",
|
|
53
|
+
"variant",
|
|
54
|
+
"tone",
|
|
55
|
+
"theme",
|
|
56
|
+
"label",
|
|
57
|
+
"className"
|
|
58
|
+
]);
|
|
59
|
+
const id = `naeil-${useId()}`;
|
|
60
|
+
const form = variant === "symbol" && size <= 48 ? "symbol-small" : variant;
|
|
61
|
+
const mode = mono ? "mono" : `${tone}${theme === "dark" ? "-dark" : ""}`;
|
|
62
|
+
const asset = `${form}-${mode}`;
|
|
63
|
+
const geometry = brandDimensions[asset];
|
|
64
|
+
const auto = !mono && theme === "auto";
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"svg",
|
|
67
|
+
__spreadProps(__spreadValues({
|
|
68
|
+
width: size * geometry.width / geometry.height,
|
|
69
|
+
height: size,
|
|
70
|
+
viewBox: geometry.viewBox,
|
|
71
|
+
fill: "none",
|
|
72
|
+
role: label === null ? void 0 : "img",
|
|
73
|
+
"aria-label": label != null ? label : void 0,
|
|
74
|
+
"aria-hidden": label === null ? true : void 0,
|
|
75
|
+
focusable: "false",
|
|
76
|
+
"data-naeil-brand": brandVersion,
|
|
77
|
+
"data-naeil-variant": variant,
|
|
78
|
+
"data-naeil-theme": auto ? "auto" : theme,
|
|
79
|
+
className
|
|
80
|
+
}, props), {
|
|
81
|
+
children: auto ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
+
/* @__PURE__ */ jsx("style", { children: autoThemeCSS }),
|
|
83
|
+
/* @__PURE__ */ jsx("g", { "data-naeil-palette": "light", style: { display: "var(--naeil-logo-light, var(--naeil-logo-os-light, inline))" }, children: /* @__PURE__ */ jsx(BrandArtwork, { asset, id: `${id}-light` }) }),
|
|
84
|
+
/* @__PURE__ */ jsx("g", { "data-naeil-palette": "dark", style: { display: "var(--naeil-logo-dark, var(--naeil-logo-os-dark, none))" }, children: /* @__PURE__ */ jsx(BrandArtwork, { asset: `${form}-${tone}-dark`, id: `${id}-dark` }) })
|
|
85
|
+
] }) : /* @__PURE__ */ jsx(BrandArtwork, { asset, id })
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
Logo
|
|
91
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface NavProps {
|
|
4
|
+
/** Internal Link component (from consumer's next-intl routing) */
|
|
5
|
+
Link: React.ComponentType<React.ComponentPropsWithoutRef<"a"> & {
|
|
6
|
+
href: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** Current pathname value (already resolved, not a hook) */
|
|
9
|
+
usePathname: () => string;
|
|
10
|
+
/** Where the naeil logo links to. Default: "/" */
|
|
11
|
+
brandHref?: string;
|
|
12
|
+
/** Whether brandHref is external (renders <a>) or internal (renders Link). Default: false */
|
|
13
|
+
brandExternal?: boolean;
|
|
14
|
+
/** Custom brand content (replaces the default naeil wordmark lockup) */
|
|
15
|
+
brandSlot?: React.ReactNode;
|
|
16
|
+
/** When true, project links (except current) are rendered as external <a> to externalBaseUrl. Default: false */
|
|
17
|
+
projectsExternal?: boolean;
|
|
18
|
+
/** Base URL for external project links. Default: "https://naeil.dev" */
|
|
19
|
+
externalBaseUrl?: string;
|
|
20
|
+
/** Override href for the current project in the dropdown */
|
|
21
|
+
currentProjectKey?: string;
|
|
22
|
+
currentProjectHref?: string;
|
|
23
|
+
/** App-specific sub-navigation items after the project dropdown */
|
|
24
|
+
subNav?: Array<{
|
|
25
|
+
label: string;
|
|
26
|
+
href: string;
|
|
27
|
+
}>;
|
|
28
|
+
/** React node for auth UI (rendered in desktop right side + mobile bottom) */
|
|
29
|
+
authSlot?: React.ReactNode;
|
|
30
|
+
/** Show Projects dropdown in nav. Default: true */
|
|
31
|
+
showProjects?: boolean;
|
|
32
|
+
/** Show blog link in nav. Default: true */
|
|
33
|
+
showBlog?: boolean;
|
|
34
|
+
/** Right-side toolbar (theme toggle, locale switcher, etc.) */
|
|
35
|
+
toolbarSlot?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function Nav({ Link, usePathname, brandHref, brandExternal, brandSlot, projectsExternal, externalBaseUrl, currentProjectKey, currentProjectHref, subNav, authSlot, showProjects, showBlog, toolbarSlot, }: NavProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
|
|
39
|
+
export { Nav };
|