@naeil/ui 0.3.0 → 0.5.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 +22 -2
- package/DESIGN.md +27 -0
- package/README.md +16 -9
- package/THIRD_PARTY_NOTICES.md +6 -0
- package/dist/chunk-CE73AEJZ.js +667 -0
- package/dist/{chunk-QKVN6Q6C.js → chunk-QSTGUEEI.js} +60 -175
- package/dist/chunk-S64H3OYQ.js +1512 -0
- package/dist/components/index.d.ts +33 -10
- package/dist/components/index.js +101 -557
- package/dist/components/naeil-header.d.ts +54 -0
- package/dist/components/naeil-header.js +14 -0
- package/dist/components/ui/index.d.ts +3 -1
- package/dist/components/ui/index.js +40 -179
- package/dist/navigation-CL10a6Eb.d.ts +48 -0
- package/dist/site-footer-B67meCDv.d.ts +21 -0
- 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 +13 -4
- package/dist/source/components/footer.js +74 -114
- package/dist/source/components/index.d.ts +6 -4
- package/dist/source/components/locale-switcher.js +1 -1
- package/dist/source/components/logo.d.ts +13 -4
- package/dist/source/components/logo.js +83 -44
- package/dist/source/components/naeil-header-content.d.ts +171 -0
- package/dist/source/components/naeil-header-content.js +176 -0
- package/dist/source/components/naeil-header.d.ts +52 -0
- package/dist/source/components/naeil-header.js +196 -0
- package/dist/source/components/nav.d.ts +12 -4
- package/dist/source/components/nav.js +51 -384
- package/dist/source/components/ui/index.d.ts +2 -0
- package/dist/source/components/ui/index.js +4 -0
- package/dist/source/components/ui/navigation.d.ts +48 -0
- package/dist/source/components/ui/navigation.js +347 -0
- package/dist/source/components/ui/site-footer.d.ts +21 -0
- package/dist/source/components/ui/site-footer.js +93 -0
- package/docs/components/README.md +6 -1
- package/docs/components/common.md +1 -1
- package/docs/components/naeil-header.md +50 -0
- package/docs/components/navigation.md +59 -0
- package/docs/design/public-ui-support.md +17 -2
- package/docs/design/v2-migration.md +75 -11
- package/docs/package-release.md +54 -13
- package/licenses/Lato-OFL.txt +93 -0
- package/package.json +18 -4
- package/src/styles/components.css +292 -0
- package/src/styles/theme.css +4 -0
|
@@ -1,46 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
2
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const PROJECTS = [
|
|
8
|
-
{
|
|
9
|
-
key: "cc",
|
|
10
|
-
href: "/cc",
|
|
11
|
-
accent: "oklch(0.704 0.140 181)",
|
|
12
|
-
icon: "/images/coral.png",
|
|
13
|
-
status: "active"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
key: "pkm",
|
|
17
|
-
href: "/pkm",
|
|
18
|
-
accent: "oklch(0.702 0.183 293)",
|
|
19
|
-
icon: "/images/jellyfish.png",
|
|
20
|
-
status: "coming"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
key: "naeilUi",
|
|
24
|
-
href: "/design",
|
|
25
|
-
accent: "oklch(0.623 0.214 259)",
|
|
26
|
-
icon: "/images/whale.png",
|
|
27
|
-
status: "active"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: "sa",
|
|
31
|
-
href: "/sa",
|
|
32
|
-
accent: "oklch(0.723 0.219 149)",
|
|
33
|
-
icon: "/images/fish.png",
|
|
34
|
-
status: "active"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
key: "babyAgent",
|
|
38
|
-
href: "/baby-agent",
|
|
39
|
-
accent: "oklch(0.769 0.188 70.08)",
|
|
40
|
-
icon: "/images/turtle.png",
|
|
41
|
-
status: "coming"
|
|
42
|
-
}
|
|
43
|
-
];
|
|
19
|
+
import { useLocale, useTranslations } from "next-intl";
|
|
20
|
+
import { NaeilHeader } from "./naeil-header.js";
|
|
21
|
+
import { headerLocales } from "./naeil-header-content.js";
|
|
22
|
+
const NativeBrandLink = (props) => /* @__PURE__ */ jsx("a", __spreadValues({}, props));
|
|
44
23
|
function Nav({
|
|
45
24
|
Link,
|
|
46
25
|
usePathname,
|
|
@@ -55,355 +34,43 @@ function Nav({
|
|
|
55
34
|
authSlot,
|
|
56
35
|
showProjects = true,
|
|
57
36
|
showBlog = true,
|
|
58
|
-
toolbarSlot
|
|
37
|
+
toolbarSlot,
|
|
38
|
+
projects,
|
|
39
|
+
className,
|
|
40
|
+
containerClassName,
|
|
41
|
+
labels
|
|
59
42
|
}) {
|
|
43
|
+
var _a;
|
|
44
|
+
const consumerLocale = useLocale();
|
|
45
|
+
const locale = (_a = headerLocales.find((value) => value === consumerLocale)) != null ? _a : "en";
|
|
60
46
|
const t = useTranslations("nav");
|
|
61
47
|
const pt = useTranslations("projects");
|
|
62
48
|
const pathname = usePathname();
|
|
63
|
-
const [scrolled, setScrolled] = useState(false);
|
|
64
|
-
const [mobileOpen, setMobileOpen] = useState(false);
|
|
65
|
-
const [projectsOpen, setProjectsOpen] = useState(false);
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
const onScroll = () => setScrolled(window.scrollY > 16);
|
|
68
|
-
window.addEventListener("scroll", onScroll, { passive: true });
|
|
69
|
-
return () => window.removeEventListener("scroll", onScroll);
|
|
70
|
-
}, []);
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
setMobileOpen(false);
|
|
73
|
-
setProjectsOpen(false);
|
|
74
|
-
}, [pathname]);
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
document.body.style.overflow = mobileOpen ? "hidden" : "";
|
|
77
|
-
return () => {
|
|
78
|
-
document.body.style.overflow = "";
|
|
79
|
-
};
|
|
80
|
-
}, [mobileOpen]);
|
|
81
|
-
const linkClass = (href) => {
|
|
82
|
-
const isActive = pathname === href;
|
|
83
|
-
return [
|
|
84
|
-
"text-sm font-medium transition-colors",
|
|
85
|
-
isActive ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
86
|
-
].join(" ");
|
|
87
|
-
};
|
|
88
|
-
const isProjectActive = pathname.startsWith("/projects") || pathname.startsWith("/cc") || pathname.startsWith("/pkm") || pathname.startsWith("/sa") || pathname.startsWith("/design");
|
|
89
|
-
function getProjectLink(project) {
|
|
90
|
-
if (currentProjectKey && project.key === currentProjectKey) {
|
|
91
|
-
return { href: currentProjectHref || "/", external: false };
|
|
92
|
-
}
|
|
93
|
-
if (projectsExternal) {
|
|
94
|
-
return { href: `${externalBaseUrl}${project.href}`, external: true };
|
|
95
|
-
}
|
|
96
|
-
return { href: project.href, external: false };
|
|
97
|
-
}
|
|
98
|
-
const brandContent = brandSlot != null ? brandSlot : /* @__PURE__ */ jsxs("span", { className: "text-foreground flex items-center gap-3 text-xl font-semibold tracking-tight", children: [
|
|
99
|
-
/* @__PURE__ */ jsx(Logo, { size: 28 }),
|
|
100
|
-
".naeil"
|
|
101
|
-
] });
|
|
102
|
-
const brandElement = brandExternal ? /* @__PURE__ */ jsx("a", { href: brandHref, children: brandContent }) : /* @__PURE__ */ jsx(Link, { href: brandHref, children: brandContent });
|
|
103
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
|
-
/* @__PURE__ */ jsx(
|
|
105
|
-
"nav",
|
|
106
|
-
{
|
|
107
|
-
className: [
|
|
108
|
-
"fixed top-0 z-50 w-full transition-[background-color,border-color] duration-300",
|
|
109
|
-
scrolled || mobileOpen ? "border-b border-border/40 bg-background/80 backdrop-blur-md" : "border-b border-transparent bg-transparent"
|
|
110
|
-
].join(" "),
|
|
111
|
-
children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex h-[58px] max-w-7xl items-center px-6", children: [
|
|
112
|
-
/* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center md:w-[200px]", children: brandElement }),
|
|
113
|
-
/* @__PURE__ */ jsxs("div", { className: "hidden flex-1 items-center gap-6 md:flex", children: [
|
|
114
|
-
showProjects && /* @__PURE__ */ jsxs("div", { className: "group relative", children: [
|
|
115
|
-
/* @__PURE__ */ jsxs(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
className: [
|
|
119
|
-
"text-sm font-medium transition-colors",
|
|
120
|
-
isProjectActive ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
121
|
-
].join(" "),
|
|
122
|
-
children: [
|
|
123
|
-
t("projects"),
|
|
124
|
-
/* @__PURE__ */ jsx(
|
|
125
|
-
"svg",
|
|
126
|
-
{
|
|
127
|
-
width: "10",
|
|
128
|
-
height: "10",
|
|
129
|
-
viewBox: "0 0 24 24",
|
|
130
|
-
fill: "none",
|
|
131
|
-
stroke: "currentColor",
|
|
132
|
-
strokeWidth: "2",
|
|
133
|
-
strokeLinecap: "round",
|
|
134
|
-
strokeLinejoin: "round",
|
|
135
|
-
className: "ml-1 inline-block transition-transform group-hover:rotate-180",
|
|
136
|
-
children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" })
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
),
|
|
142
|
-
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute left-0 top-full pt-3 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100", children: /* @__PURE__ */ jsx("div", { className: "border-border/40 bg-background/95 w-[520px] rounded-xl border p-4 shadow-xl backdrop-blur-md", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: PROJECTS.map((project) => {
|
|
143
|
-
const { href, external } = getProjectLink(project);
|
|
144
|
-
const inner = /* @__PURE__ */ jsxs("div", { className: "hover:bg-muted/50 flex items-start gap-3.5 rounded-lg px-3 py-3 transition-colors", children: [
|
|
145
|
-
/* @__PURE__ */ jsx(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border",
|
|
149
|
-
style: {
|
|
150
|
-
borderColor: `color-mix(in oklch, ${project.accent} 30%, transparent)`,
|
|
151
|
-
backgroundColor: `color-mix(in oklch, ${project.accent} 8%, transparent)`
|
|
152
|
-
},
|
|
153
|
-
children: /* @__PURE__ */ jsx(
|
|
154
|
-
Image,
|
|
155
|
-
{
|
|
156
|
-
src: project.icon,
|
|
157
|
-
alt: "",
|
|
158
|
-
width: 24,
|
|
159
|
-
height: 24,
|
|
160
|
-
className: "object-contain"
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 pt-0.5", children: [
|
|
166
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
167
|
-
/* @__PURE__ */ jsx("span", { className: "text-foreground text-sm font-medium", children: pt(`${project.key}.name`) }),
|
|
168
|
-
project.status === "coming" && /* @__PURE__ */ jsx(
|
|
169
|
-
Badge,
|
|
170
|
-
{
|
|
171
|
-
variant: "outline",
|
|
172
|
-
className: "text-muted-foreground px-1 py-0 text-[9px]",
|
|
173
|
-
children: pt("status.coming")
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
] }),
|
|
177
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-0.5 text-xs leading-snug", children: pt(`${project.key}.description`) })
|
|
178
|
-
] })
|
|
179
|
-
] });
|
|
180
|
-
if (external) {
|
|
181
|
-
return /* @__PURE__ */ jsx("a", { href, children: inner }, project.key);
|
|
182
|
-
}
|
|
183
|
-
return /* @__PURE__ */ jsx(Link, { href, children: inner }, project.key);
|
|
184
|
-
}) }) }) })
|
|
185
|
-
] }),
|
|
186
|
-
showBlog && /* @__PURE__ */ jsx(Fragment, { children: projectsExternal ? /* @__PURE__ */ jsx(
|
|
187
|
-
"a",
|
|
188
|
-
{
|
|
189
|
-
href: `${externalBaseUrl}/blog`,
|
|
190
|
-
className: "text-sm font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
191
|
-
children: t("blog")
|
|
192
|
-
}
|
|
193
|
-
) : /* @__PURE__ */ jsx(Link, { href: "/blog", className: linkClass("/blog"), children: t("blog") }) }),
|
|
194
|
-
subNav && subNav.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
195
|
-
/* @__PURE__ */ jsx("div", { className: "h-4 w-px bg-border/40" }),
|
|
196
|
-
subNav.map((item) => /* @__PURE__ */ jsx(
|
|
197
|
-
Link,
|
|
198
|
-
{
|
|
199
|
-
href: item.href,
|
|
200
|
-
className: linkClass(item.href),
|
|
201
|
-
children: item.label
|
|
202
|
-
},
|
|
203
|
-
item.href
|
|
204
|
-
))
|
|
205
|
-
] })
|
|
206
|
-
] }),
|
|
207
|
-
/* @__PURE__ */ jsxs("div", { className: "hidden items-center gap-3 md:flex", children: [
|
|
208
|
-
authSlot,
|
|
209
|
-
authSlot && toolbarSlot && /* @__PURE__ */ jsx("div", { className: "h-4 w-px bg-border/40" }),
|
|
210
|
-
toolbarSlot && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: toolbarSlot })
|
|
211
|
-
] }),
|
|
212
|
-
/* @__PURE__ */ jsx(
|
|
213
|
-
"button",
|
|
214
|
-
{
|
|
215
|
-
className: "text-muted-foreground hover:text-foreground ml-auto transition-colors md:hidden",
|
|
216
|
-
onClick: () => setMobileOpen(!mobileOpen),
|
|
217
|
-
"aria-label": "Menu",
|
|
218
|
-
children: mobileOpen ? /* @__PURE__ */ jsx(CloseIcon, {}) : /* @__PURE__ */ jsx(MenuIcon, {})
|
|
219
|
-
}
|
|
220
|
-
)
|
|
221
|
-
] })
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
mobileOpen && /* @__PURE__ */ jsx("div", { className: "bg-background/95 fixed inset-0 z-40 overflow-y-auto pt-[58px] backdrop-blur-md md:hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-6 py-6", children: [
|
|
225
|
-
showProjects && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
226
|
-
/* @__PURE__ */ jsxs(
|
|
227
|
-
"button",
|
|
228
|
-
{
|
|
229
|
-
className: "text-foreground flex items-center justify-between py-3 text-base font-medium",
|
|
230
|
-
onClick: () => setProjectsOpen(!projectsOpen),
|
|
231
|
-
children: [
|
|
232
|
-
t("projects"),
|
|
233
|
-
/* @__PURE__ */ jsx(
|
|
234
|
-
"svg",
|
|
235
|
-
{
|
|
236
|
-
width: "14",
|
|
237
|
-
height: "14",
|
|
238
|
-
viewBox: "0 0 24 24",
|
|
239
|
-
fill: "none",
|
|
240
|
-
stroke: "currentColor",
|
|
241
|
-
strokeWidth: "2",
|
|
242
|
-
strokeLinecap: "round",
|
|
243
|
-
strokeLinejoin: "round",
|
|
244
|
-
className: [
|
|
245
|
-
"transition-transform duration-200",
|
|
246
|
-
projectsOpen ? "rotate-180" : ""
|
|
247
|
-
].join(" "),
|
|
248
|
-
children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" })
|
|
249
|
-
}
|
|
250
|
-
)
|
|
251
|
-
]
|
|
252
|
-
}
|
|
253
|
-
),
|
|
254
|
-
projectsOpen && /* @__PURE__ */ jsx("div", { className: "mb-2 flex flex-col gap-1 pl-1", children: PROJECTS.map((project) => {
|
|
255
|
-
const { href, external } = getProjectLink(project);
|
|
256
|
-
const inner = /* @__PURE__ */ jsxs("div", { className: "hover:bg-muted/50 flex items-center gap-3 rounded-lg px-3 py-3 transition-colors", children: [
|
|
257
|
-
/* @__PURE__ */ jsx(
|
|
258
|
-
"div",
|
|
259
|
-
{
|
|
260
|
-
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border",
|
|
261
|
-
style: {
|
|
262
|
-
borderColor: `color-mix(in oklch, ${project.accent} 30%, transparent)`,
|
|
263
|
-
backgroundColor: `color-mix(in oklch, ${project.accent} 8%, transparent)`
|
|
264
|
-
},
|
|
265
|
-
children: /* @__PURE__ */ jsx(
|
|
266
|
-
Image,
|
|
267
|
-
{
|
|
268
|
-
src: project.icon,
|
|
269
|
-
alt: "",
|
|
270
|
-
width: 20,
|
|
271
|
-
height: 20,
|
|
272
|
-
className: "object-contain"
|
|
273
|
-
}
|
|
274
|
-
)
|
|
275
|
-
}
|
|
276
|
-
),
|
|
277
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
278
|
-
/* @__PURE__ */ jsx("span", { className: "text-foreground text-sm font-medium", children: pt(`${project.key}.name`) }),
|
|
279
|
-
project.status === "coming" && /* @__PURE__ */ jsx(
|
|
280
|
-
Badge,
|
|
281
|
-
{
|
|
282
|
-
variant: "outline",
|
|
283
|
-
className: "text-muted-foreground ml-2 px-1 py-0 text-[9px]",
|
|
284
|
-
children: pt("status.coming")
|
|
285
|
-
}
|
|
286
|
-
)
|
|
287
|
-
] })
|
|
288
|
-
] });
|
|
289
|
-
if (external) {
|
|
290
|
-
return /* @__PURE__ */ jsx(
|
|
291
|
-
"a",
|
|
292
|
-
{
|
|
293
|
-
href,
|
|
294
|
-
onClick: () => setMobileOpen(false),
|
|
295
|
-
children: inner
|
|
296
|
-
},
|
|
297
|
-
project.key
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
return /* @__PURE__ */ jsx(
|
|
301
|
-
Link,
|
|
302
|
-
{
|
|
303
|
-
href,
|
|
304
|
-
onClick: () => setMobileOpen(false),
|
|
305
|
-
children: inner
|
|
306
|
-
},
|
|
307
|
-
project.key
|
|
308
|
-
);
|
|
309
|
-
}) })
|
|
310
|
-
] }),
|
|
311
|
-
showBlog && /* @__PURE__ */ jsx(Fragment, { children: projectsExternal ? /* @__PURE__ */ jsx(
|
|
312
|
-
"a",
|
|
313
|
-
{
|
|
314
|
-
href: `${externalBaseUrl}/blog`,
|
|
315
|
-
className: "text-foreground border-border/40 border-t py-3 text-base font-medium",
|
|
316
|
-
onClick: () => setMobileOpen(false),
|
|
317
|
-
children: t("blog")
|
|
318
|
-
}
|
|
319
|
-
) : /* @__PURE__ */ jsx(
|
|
320
|
-
Link,
|
|
321
|
-
{
|
|
322
|
-
href: "/blog",
|
|
323
|
-
className: "text-foreground border-border/40 border-t py-3 text-base font-medium",
|
|
324
|
-
onClick: () => setMobileOpen(false),
|
|
325
|
-
children: t("blog")
|
|
326
|
-
}
|
|
327
|
-
) }),
|
|
328
|
-
subNav && subNav.length > 0 && /* @__PURE__ */ jsx("div", { className: "border-border/40 border-t", children: subNav.map((item) => /* @__PURE__ */ jsx(
|
|
329
|
-
Link,
|
|
330
|
-
{
|
|
331
|
-
href: item.href,
|
|
332
|
-
className: "text-foreground block py-3 text-base font-medium",
|
|
333
|
-
onClick: () => setMobileOpen(false),
|
|
334
|
-
children: item.label
|
|
335
|
-
},
|
|
336
|
-
item.href
|
|
337
|
-
)) }),
|
|
338
|
-
authSlot && /* @__PURE__ */ jsx("div", { className: "border-border/40 border-t pt-4", children: authSlot }),
|
|
339
|
-
toolbarSlot && /* @__PURE__ */ jsx("div", { className: "border-border/40 flex items-center gap-4 border-t pt-4 mt-2", children: toolbarSlot })
|
|
340
|
-
] }) })
|
|
341
|
-
] });
|
|
342
|
-
}
|
|
343
|
-
function Logo({
|
|
344
|
-
size = 20
|
|
345
|
-
}) {
|
|
346
|
-
const id = `naeil-nav-logo-${size}`;
|
|
347
|
-
return /* @__PURE__ */ jsxs(
|
|
348
|
-
"svg",
|
|
349
|
-
{
|
|
350
|
-
width: size,
|
|
351
|
-
height: size,
|
|
352
|
-
viewBox: "0 0 24 24",
|
|
353
|
-
fill: "none",
|
|
354
|
-
"aria-label": "naeil",
|
|
355
|
-
children: [
|
|
356
|
-
/* @__PURE__ */ jsx(
|
|
357
|
-
"path",
|
|
358
|
-
{
|
|
359
|
-
d: "M6 4 L6 16 L20 16",
|
|
360
|
-
stroke: "currentColor",
|
|
361
|
-
strokeWidth: "2",
|
|
362
|
-
strokeLinecap: "square",
|
|
363
|
-
strokeLinejoin: "miter"
|
|
364
|
-
}
|
|
365
|
-
),
|
|
366
|
-
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "16", r: "3.5", fill: `url(#${id}-grad)`, mask: `url(#${id})` }),
|
|
367
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
368
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: `${id}-grad`, x1: "15", y1: "12.5", x2: "15", y2: "16", children: [
|
|
369
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#eab308" }),
|
|
370
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#dc2626" })
|
|
371
|
-
] }),
|
|
372
|
-
/* @__PURE__ */ jsx("mask", { id, children: /* @__PURE__ */ jsx("rect", { x: "0", y: "0", width: "24", height: "16", fill: "white" }) })
|
|
373
|
-
] })
|
|
374
|
-
]
|
|
375
|
-
}
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
function MenuIcon() {
|
|
379
|
-
return /* @__PURE__ */ jsx(
|
|
380
|
-
"svg",
|
|
381
|
-
{
|
|
382
|
-
width: "22",
|
|
383
|
-
height: "22",
|
|
384
|
-
viewBox: "0 0 24 24",
|
|
385
|
-
fill: "none",
|
|
386
|
-
stroke: "currentColor",
|
|
387
|
-
strokeWidth: "1.5",
|
|
388
|
-
strokeLinecap: "round",
|
|
389
|
-
strokeLinejoin: "round",
|
|
390
|
-
children: /* @__PURE__ */ jsx("path", { d: "M4 6h16M4 12h16M4 18h16" })
|
|
391
|
-
}
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
function CloseIcon() {
|
|
395
49
|
return /* @__PURE__ */ jsx(
|
|
396
|
-
|
|
50
|
+
NaeilHeader,
|
|
397
51
|
{
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
52
|
+
locale,
|
|
53
|
+
Link,
|
|
54
|
+
currentHref: pathname,
|
|
55
|
+
resolveHref: (path) => projectsExternal ? `${externalBaseUrl}${path}` : path,
|
|
56
|
+
projectsExternal,
|
|
57
|
+
translations: { projects: showProjects ? t("projects") : "", blog: showBlog ? t("blog") : "", project: pt },
|
|
58
|
+
brandHref,
|
|
59
|
+
brandSlot,
|
|
60
|
+
brandLinkComponent: brandExternal ? NativeBrandLink : Link,
|
|
61
|
+
currentProjectKey,
|
|
62
|
+
currentProjectHref,
|
|
63
|
+
subNav,
|
|
64
|
+
projects,
|
|
65
|
+
showProjects,
|
|
66
|
+
showBlog,
|
|
67
|
+
toolbarSlot: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
authSlot,
|
|
69
|
+
toolbarSlot
|
|
70
|
+
] }),
|
|
71
|
+
className,
|
|
72
|
+
containerClassName,
|
|
73
|
+
labels
|
|
407
74
|
}
|
|
408
75
|
);
|
|
409
76
|
}
|
|
@@ -11,6 +11,8 @@ export { Switch } from './switch.js';
|
|
|
11
11
|
export { Checkbox } from './checkbox.js';
|
|
12
12
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from './tabs.js';
|
|
13
13
|
export { Textarea } from './textarea.js';
|
|
14
|
+
export { Navigation, NavigationGroup, NavigationItem, NavigationLink, NavigationLinkComponent, NavigationLinkProps, NavigationProps } from './navigation.js';
|
|
15
|
+
export { SiteFooter, SiteFooterProps } from './site-footer.js';
|
|
14
16
|
import 'react/jsx-runtime';
|
|
15
17
|
import 'react';
|
|
16
18
|
import 'radix-ui';
|
|
@@ -65,6 +65,8 @@ import { Switch } from "./switch.js";
|
|
|
65
65
|
import { Checkbox } from "./checkbox.js";
|
|
66
66
|
import { Tabs, TabsList, TabsTrigger, TabsContent } from "./tabs.js";
|
|
67
67
|
import { Textarea } from "./textarea.js";
|
|
68
|
+
import { Navigation } from "./navigation.js";
|
|
69
|
+
import { SiteFooter } from "./site-footer.js";
|
|
68
70
|
export {
|
|
69
71
|
Avatar,
|
|
70
72
|
AvatarBadge,
|
|
@@ -109,6 +111,7 @@ export {
|
|
|
109
111
|
DropdownMenuSubTrigger,
|
|
110
112
|
DropdownMenuTrigger,
|
|
111
113
|
Input,
|
|
114
|
+
Navigation,
|
|
112
115
|
Select,
|
|
113
116
|
SelectContent,
|
|
114
117
|
SelectGroup,
|
|
@@ -119,6 +122,7 @@ export {
|
|
|
119
122
|
SelectSeparator,
|
|
120
123
|
SelectTrigger,
|
|
121
124
|
SelectValue,
|
|
125
|
+
SiteFooter,
|
|
122
126
|
Switch,
|
|
123
127
|
Tabs,
|
|
124
128
|
TabsContent,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
type NavigationLinkProps = react.ComponentPropsWithoutRef<"a"> & {
|
|
5
|
+
href: string;
|
|
6
|
+
};
|
|
7
|
+
type NavigationLinkComponent = react.ComponentType<NavigationLinkProps>;
|
|
8
|
+
interface NavigationLink {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
href: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
icon?: react.ReactNode;
|
|
14
|
+
badge?: react.ReactNode;
|
|
15
|
+
external?: boolean;
|
|
16
|
+
target?: react.HTMLAttributeAnchorTarget;
|
|
17
|
+
active?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface NavigationGroup {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
items: NavigationLink[];
|
|
23
|
+
/** Desktop menu layout; the mobile sheet always uses one column. */
|
|
24
|
+
columns?: 1 | 2;
|
|
25
|
+
}
|
|
26
|
+
type NavigationItem = NavigationLink | NavigationGroup;
|
|
27
|
+
interface NavigationProps extends Omit<react.ComponentPropsWithoutRef<"header">, "children" | "onSelect"> {
|
|
28
|
+
brand: react.ReactNode;
|
|
29
|
+
items: NavigationItem[];
|
|
30
|
+
/** Translated landmark/dialog/close labels are supplied by the application. */
|
|
31
|
+
labels: {
|
|
32
|
+
navigation: string;
|
|
33
|
+
menu: string;
|
|
34
|
+
close: string;
|
|
35
|
+
};
|
|
36
|
+
Link?: NavigationLinkComponent;
|
|
37
|
+
currentHref?: string;
|
|
38
|
+
toolbar?: react.ReactNode;
|
|
39
|
+
mobileToolbar?: react.ReactNode;
|
|
40
|
+
mobileFooter?: react.ReactNode;
|
|
41
|
+
/** Use the same product-owned frame class on header, footer and main. */
|
|
42
|
+
containerClassName?: string;
|
|
43
|
+
/** Preserve modified clicks; applications may preventDefault for client routing/guards. */
|
|
44
|
+
onNavigate?: (event: react.MouseEvent<HTMLAnchorElement>, item: NavigationLink) => void;
|
|
45
|
+
}
|
|
46
|
+
declare function Navigation({ brand, items, labels, Link, currentHref, toolbar, mobileToolbar, mobileFooter, containerClassName, onNavigate, className, ...props }: NavigationProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
|
|
48
|
+
export { Navigation, type NavigationGroup, type NavigationItem, type NavigationLink, type NavigationLinkComponent, type NavigationLinkProps, type NavigationProps };
|