@naeil/ui 0.7.1 → 0.8.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 +10 -1
- package/README.md +15 -10
- package/dist/{chunk-QQQQZEPV.js → chunk-KPE4KKYM.js} +111 -14
- package/dist/{chunk-OLKTEYLS.js → chunk-ULZPJI5X.js} +103 -73
- package/dist/{chunk-VWIUN35X.js → chunk-WA5D7UI2.js} +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +3 -3
- package/dist/components/naeil-footer.d.ts +2 -2
- package/dist/components/naeil-footer.js +3 -1
- package/dist/components/naeil-header.d.ts +8 -2
- package/dist/components/naeil-header.js +3 -3
- package/dist/components/ui/index.d.ts +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/lib/ui-release.d.ts +1 -1
- package/dist/lib/ui-release.js +1 -1
- package/dist/{navigation-CgPeL9tF.d.ts → navigation-D8N1tMTu.d.ts} +4 -2
- package/dist/{site-footer-vXDa_6yr.d.ts → site-footer-s113FZgC.d.ts} +1 -1
- package/dist/source/components/naeil-footer.js +2 -0
- package/dist/source/components/naeil-header-account.js +54 -19
- package/dist/source/components/naeil-header-content.d.ts +1 -25
- package/dist/source/components/naeil-header-content.js +0 -28
- package/dist/source/components/naeil-header.d.ts +8 -2
- package/dist/source/components/naeil-header.js +50 -24
- package/dist/source/components/ui/navigation.d.ts +8 -2
- package/dist/source/components/ui/navigation.js +112 -15
- package/dist/source/lib/ui-release.d.ts +1 -1
- package/dist/source/lib/ui-release.js +1 -1
- package/docs/components/README.md +3 -3
- package/docs/components/application-layout.md +48 -13
- package/docs/components/naeil-footer.md +2 -2
- package/docs/components/naeil-header.md +37 -7
- package/docs/design/v2-migration.md +11 -10
- package/docs/package-release.md +44 -14
- package/package.json +1 -1
- package/src/styles/components.css +113 -0
package/dist/components/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
NaeilHeader,
|
|
4
4
|
headerLocales
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-ULZPJI5X.js";
|
|
6
6
|
import {
|
|
7
7
|
Logo
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-WA5D7UI2.js";
|
|
9
9
|
import {
|
|
10
10
|
SiteFooter
|
|
11
11
|
} from "../chunk-HSTDPY56.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
DropdownMenuContent,
|
|
16
16
|
DropdownMenuItem,
|
|
17
17
|
DropdownMenuTrigger
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-KPE4KKYM.js";
|
|
19
19
|
import {
|
|
20
20
|
__objRest,
|
|
21
21
|
__spreadProps,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as SiteFooterProps } from '../site-footer-
|
|
2
|
+
import { S as SiteFooterProps } from '../site-footer-s113FZgC.js';
|
|
3
3
|
import { N as NaeilHeaderLocale } from '../naeil-header-content-BvISJ4RV.js';
|
|
4
4
|
import 'react';
|
|
5
|
-
import '../navigation-
|
|
5
|
+
import '../navigation-D8N1tMTu.js';
|
|
6
6
|
|
|
7
7
|
type NaeilFooterLocale = NaeilHeaderLocale;
|
|
8
8
|
interface NaeilFooterProps extends Omit<SiteFooterProps, "brand" | "description" | "groups"> {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
Logo,
|
|
5
5
|
uiRelease
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WA5D7UI2.js";
|
|
7
7
|
import {
|
|
8
8
|
SiteFooter
|
|
9
9
|
} from "../chunk-HSTDPY56.js";
|
|
@@ -44,6 +44,8 @@ function NaeilFooter(_a) {
|
|
|
44
44
|
Link,
|
|
45
45
|
onNavigate,
|
|
46
46
|
"data-naeil-footer": true,
|
|
47
|
+
"data-naeil-chrome": "",
|
|
48
|
+
lang: locale,
|
|
47
49
|
"data-naeil-ui-version": uiRelease.version,
|
|
48
50
|
"data-naeil-ui-contract": uiRelease.contractVersion,
|
|
49
51
|
brand: /* @__PURE__ */ jsx(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { b as NavigationLinkComponent, a as NavigationProps, c as NavigationLinkProps, N as NavigationLink } from '../navigation-
|
|
3
|
+
import { b as NavigationLinkComponent, a as NavigationProps, c as NavigationItem, d as NavigationLinkProps, N as NavigationLink } from '../navigation-D8N1tMTu.js';
|
|
4
4
|
import { N as NaeilHeaderLocale } from '../naeil-header-content-BvISJ4RV.js';
|
|
5
5
|
|
|
6
6
|
type NaeilHeaderAccount = {
|
|
@@ -29,6 +29,12 @@ interface NaeilHeaderProps extends Omit<NavigationProps, "brand" | "items" | "to
|
|
|
29
29
|
resolveHref?: (path: string) => string;
|
|
30
30
|
brandHref?: string;
|
|
31
31
|
brandSlot?: ReactNode;
|
|
32
|
+
/** Ignored when brandSlot replaces the complete brand content. */
|
|
33
|
+
brandSuffix?: string;
|
|
34
|
+
/** After the brand link, outside it; rendered once at every width. */
|
|
35
|
+
statusSlot?: ReactNode;
|
|
36
|
+
/** Product menu data, after catalog/blog and before flat subNav links. */
|
|
37
|
+
appNavigation?: NavigationItem[];
|
|
32
38
|
brandLinkProps?: Omit<NavigationLinkProps, "href" | "children">;
|
|
33
39
|
/** Omit when the application does not support changing its UI language. */
|
|
34
40
|
onLocaleChange?: (locale: NaeilHeaderLocale) => void;
|
|
@@ -67,6 +73,6 @@ declare function NaeilHeaderLocaleControl({ locale, onLocaleChange }: {
|
|
|
67
73
|
onLocaleChange: (locale: NaeilHeaderLocale) => void;
|
|
68
74
|
}): react_jsx_runtime.JSX.Element;
|
|
69
75
|
/** One complete, opt-in branded composition shared by naeil.dev and applications. */
|
|
70
|
-
declare function NaeilHeader({ locale, resolveHref, brandHref, brandSlot, brandLinkProps, brandLinkComponent, onLocaleChange, authSlot, toolbarSlot, projects, projectsExternal, translations, showProjects, showBlog, subNav, currentProjectKey, currentProjectHref, labels, Link, currentHref, onNavigate, className, containerClassName, ...props }: NaeilHeaderProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function NaeilHeader({ locale, resolveHref, brandHref, brandSlot, brandSuffix, statusSlot, appNavigation, brandLinkProps, brandLinkComponent, onLocaleChange, authSlot, toolbarSlot, projects, projectsExternal, translations, showProjects, showBlog, subNav, currentProjectKey, currentProjectHref, labels, Link, currentHref, onNavigate, className, containerClassName, ...props }: NaeilHeaderProps): react_jsx_runtime.JSX.Element;
|
|
71
77
|
|
|
72
78
|
export { NaeilHeader, type NaeilHeaderAccount, NaeilHeaderAccountControl, type NaeilHeaderAccountControlProps, NaeilHeaderLocale, NaeilHeaderLocaleControl, type NaeilHeaderProps, NaeilHeaderThemeControl };
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
NaeilHeaderAccountControl,
|
|
6
6
|
NaeilHeaderLocaleControl,
|
|
7
7
|
NaeilHeaderThemeControl
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-ULZPJI5X.js";
|
|
9
|
+
import "../chunk-WA5D7UI2.js";
|
|
10
|
+
import "../chunk-KPE4KKYM.js";
|
|
11
11
|
import "../chunk-JBTDRVZ7.js";
|
|
12
12
|
export {
|
|
13
13
|
NaeilHeader,
|
|
@@ -4,8 +4,8 @@ import { Avatar as Avatar$1, Dialog as Dialog$1, DropdownMenu as DropdownMenu$1,
|
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
import { ToasterProps } from 'sonner';
|
|
7
|
-
export {
|
|
8
|
-
export { a as SiteFooter, S as SiteFooterProps } from '../../site-footer-
|
|
7
|
+
export { e as Navigation, f as NavigationGroup, c as NavigationItem, N as NavigationLink, b as NavigationLinkComponent, d as NavigationLinkProps, a as NavigationProps } from '../../navigation-D8N1tMTu.js';
|
|
8
|
+
export { a as SiteFooter, S as SiteFooterProps } from '../../site-footer-s113FZgC.js';
|
|
9
9
|
|
|
10
10
|
declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof Avatar$1.Root> & {
|
|
11
11
|
size?: "default" | "sm" | "lg";
|
package/dist/lib/ui-release.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const uiRelease: Readonly<{version: "0.
|
|
1
|
+
export declare const uiRelease: Readonly<{version: "0.8.0"; contractVersion: "1"}>;
|
package/dist/lib/ui-release.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const uiRelease = Object.freeze({"version":"0.
|
|
1
|
+
export const uiRelease = Object.freeze({"version":"0.8.0","contractVersion":"1"});
|
|
@@ -38,11 +38,13 @@ interface NavigationProps extends Omit<React.ComponentPropsWithoutRef<"header">,
|
|
|
38
38
|
toolbar?: React.ReactNode;
|
|
39
39
|
mobileToolbar?: React.ReactNode;
|
|
40
40
|
mobileFooter?: React.ReactNode;
|
|
41
|
+
mobileOpen?: boolean;
|
|
42
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
41
43
|
/** Use the same product-owned frame class on header, footer and main. */
|
|
42
44
|
containerClassName?: string;
|
|
43
45
|
/** Preserve modified clicks; applications may preventDefault for client routing/guards. */
|
|
44
46
|
onNavigate?: (event: React.MouseEvent<HTMLAnchorElement>, item: NavigationLink) => void;
|
|
45
47
|
}
|
|
46
|
-
declare function Navigation({ brand, items, labels, Link, currentHref, toolbar, mobileToolbar, mobileFooter, containerClassName, onNavigate, className, ...props }: NavigationProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function Navigation({ brand, items, labels, Link, currentHref, toolbar, mobileToolbar, mobileFooter, mobileOpen: controlledOpen, onMobileOpenChange, containerClassName, onNavigate, className, ...props }: NavigationProps): react_jsx_runtime.JSX.Element;
|
|
47
49
|
|
|
48
|
-
export { type NavigationLink as N, type NavigationProps as a, type NavigationLinkComponent as b, type
|
|
50
|
+
export { type NavigationLink as N, type NavigationProps as a, type NavigationLinkComponent as b, type NavigationItem as c, type NavigationLinkProps as d, Navigation as e, type NavigationGroup as f };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { N as NavigationLink, b as NavigationLinkComponent, a as NavigationProps } from './navigation-
|
|
3
|
+
import { N as NavigationLink, b as NavigationLinkComponent, a as NavigationProps } from './navigation-D8N1tMTu.js';
|
|
4
4
|
|
|
5
5
|
interface SiteFooterProps extends React.ComponentPropsWithoutRef<"footer"> {
|
|
6
6
|
brand?: React.ReactNode;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
3
5
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -15,9 +17,12 @@ var __spreadValues = (a, b) => {
|
|
|
15
17
|
}
|
|
16
18
|
return a;
|
|
17
19
|
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
18
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
22
|
import { UserRound } from "lucide-react";
|
|
23
|
+
import { useContext, useRef } from "react";
|
|
20
24
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem } from "./ui/dropdown-menu.js";
|
|
25
|
+
import { NavigationSheetAction } from "./ui/navigation.js";
|
|
21
26
|
const labels = {
|
|
22
27
|
en: { menu: "Account menu", account: "Account", login: "Log in", logout: "Log out", busy: "Logging out\u2026" },
|
|
23
28
|
ko: { menu: "\uACC4\uC815 \uBA54\uB274", account: "\uACC4\uC815", login: "\uB85C\uADF8\uC778", logout: "\uB85C\uADF8\uC544\uC6C3", busy: "\uB85C\uADF8\uC544\uC6C3 \uC911\u2026" },
|
|
@@ -26,10 +31,18 @@ const labels = {
|
|
|
26
31
|
const NativeLink = (props) => /* @__PURE__ */ jsx("a", __spreadValues({}, props));
|
|
27
32
|
function NaeilHeaderAccountControl({ locale, account, Link = NativeLink }) {
|
|
28
33
|
const text = labels[locale];
|
|
34
|
+
const handoff = useContext(NavigationSheetAction);
|
|
35
|
+
const pendingAction = useRef(void 0);
|
|
29
36
|
if (account.status === "signed-out") {
|
|
30
37
|
return /* @__PURE__ */ jsx(Link, { href: account.loginHref, className: "ui-navigation-link ui-focus naeil-header-login", "data-naeil-account-state": "signed-out", children: text.login });
|
|
31
38
|
}
|
|
32
|
-
return /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
39
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { onOpenChange: (open) => {
|
|
40
|
+
var _a;
|
|
41
|
+
if (open) {
|
|
42
|
+
(_a = pendingAction.current) == null ? void 0 : _a.cancel();
|
|
43
|
+
pendingAction.current = void 0;
|
|
44
|
+
}
|
|
45
|
+
}, children: [
|
|
33
46
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
34
47
|
"button",
|
|
35
48
|
{
|
|
@@ -42,24 +55,46 @@ function NaeilHeaderAccountControl({ locale, account, Link = NativeLink }) {
|
|
|
42
55
|
children: /* @__PURE__ */ jsx("span", { className: "naeil-header-account-avatar", "aria-hidden": "true", children: /* @__PURE__ */ jsx(UserRound, {}) })
|
|
43
56
|
}
|
|
44
57
|
) }),
|
|
45
|
-
/* @__PURE__ */ jsxs(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
/* @__PURE__ */ jsxs(
|
|
59
|
+
DropdownMenuContent,
|
|
60
|
+
{
|
|
61
|
+
align: "end",
|
|
62
|
+
className: "w-56 max-w-[calc(100vw-2rem)]",
|
|
63
|
+
"data-naeil-account-menu": true,
|
|
64
|
+
"data-naeil-chrome": "",
|
|
65
|
+
lang: locale,
|
|
66
|
+
onCloseAutoFocus: (event) => {
|
|
67
|
+
const flow = pendingAction.current;
|
|
68
|
+
if (!flow || event.target !== flow.menu) return;
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
flow.menu = null;
|
|
71
|
+
flow.menuClosed();
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex min-w-0 flex-col font-normal", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-base font-medium", children: account.displayName || text.account }),
|
|
76
|
+
account.email && /* @__PURE__ */ jsx("span", { className: "truncate text-sm text-muted-foreground", children: account.email })
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
DropdownMenuItem,
|
|
81
|
+
{
|
|
82
|
+
className: "min-h-11",
|
|
83
|
+
disabled: account.busy,
|
|
84
|
+
onSelect: (event) => {
|
|
85
|
+
if (account.busy) return;
|
|
86
|
+
if (handoff) {
|
|
87
|
+
const menu = event.target.closest("[data-naeil-account-menu]");
|
|
88
|
+
if (!(menu == null ? void 0 : menu.isConnected)) return;
|
|
89
|
+
pendingAction.current = __spreadProps(__spreadValues({}, handoff(account.onLogout)), { menu });
|
|
90
|
+
} else account.onLogout();
|
|
91
|
+
},
|
|
92
|
+
children: account.busy ? text.busy : text.logout
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
)
|
|
63
98
|
] });
|
|
64
99
|
}
|
|
65
100
|
export {
|
|
@@ -6,35 +6,11 @@ declare const headerLocaleNames: {
|
|
|
6
6
|
readonly ja: "日本語";
|
|
7
7
|
};
|
|
8
8
|
declare const headerProjects: readonly [{
|
|
9
|
-
readonly key: "cc";
|
|
10
|
-
readonly href: "/cc";
|
|
11
|
-
readonly accent: "oklch(0.704 0.140 181)";
|
|
12
|
-
readonly icon: "coral";
|
|
13
|
-
readonly status: "active";
|
|
14
|
-
}, {
|
|
15
|
-
readonly key: "pkm";
|
|
16
|
-
readonly href: "/pkm";
|
|
17
|
-
readonly accent: "oklch(0.702 0.183 293)";
|
|
18
|
-
readonly icon: "jellyfish";
|
|
19
|
-
readonly status: "coming";
|
|
20
|
-
}, {
|
|
21
9
|
readonly key: "naeilUi";
|
|
22
10
|
readonly href: "/design";
|
|
23
11
|
readonly accent: "oklch(0.623 0.214 259)";
|
|
24
12
|
readonly icon: "whale";
|
|
25
|
-
readonly status: "active";
|
|
26
|
-
}, {
|
|
27
|
-
readonly key: "sa";
|
|
28
|
-
readonly href: "/sa";
|
|
29
|
-
readonly accent: "oklch(0.723 0.219 149)";
|
|
30
|
-
readonly icon: "fish";
|
|
31
|
-
readonly status: "active";
|
|
32
|
-
}, {
|
|
33
|
-
readonly key: "babyAgent";
|
|
34
|
-
readonly href: "/baby-agent";
|
|
35
|
-
readonly accent: "oklch(0.769 0.188 70.08)";
|
|
36
|
-
readonly icon: "turtle";
|
|
37
|
-
readonly status: "coming";
|
|
13
|
+
readonly status: "active" | "coming";
|
|
38
14
|
}];
|
|
39
15
|
declare const headerContent: {
|
|
40
16
|
readonly en: {
|
|
@@ -1,40 +1,12 @@
|
|
|
1
1
|
const headerLocales = ["en", "ko", "ja"];
|
|
2
2
|
const headerLocaleNames = { en: "English", ko: "\uD55C\uAD6D\uC5B4", ja: "\u65E5\u672C\u8A9E" };
|
|
3
3
|
const headerProjects = [
|
|
4
|
-
{
|
|
5
|
-
"key": "cc",
|
|
6
|
-
"href": "/cc",
|
|
7
|
-
"accent": "oklch(0.704 0.140 181)",
|
|
8
|
-
"icon": "coral",
|
|
9
|
-
"status": "active"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"key": "pkm",
|
|
13
|
-
"href": "/pkm",
|
|
14
|
-
"accent": "oklch(0.702 0.183 293)",
|
|
15
|
-
"icon": "jellyfish",
|
|
16
|
-
"status": "coming"
|
|
17
|
-
},
|
|
18
4
|
{
|
|
19
5
|
"key": "naeilUi",
|
|
20
6
|
"href": "/design",
|
|
21
7
|
"accent": "oklch(0.623 0.214 259)",
|
|
22
8
|
"icon": "whale",
|
|
23
9
|
"status": "active"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"key": "sa",
|
|
27
|
-
"href": "/sa",
|
|
28
|
-
"accent": "oklch(0.723 0.219 149)",
|
|
29
|
-
"icon": "fish",
|
|
30
|
-
"status": "active"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"key": "babyAgent",
|
|
34
|
-
"href": "/baby-agent",
|
|
35
|
-
"accent": "oklch(0.769 0.188 70.08)",
|
|
36
|
-
"icon": "turtle",
|
|
37
|
-
"status": "coming"
|
|
38
10
|
}
|
|
39
11
|
];
|
|
40
12
|
const headerContent = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { NavigationProps, NavigationLinkProps, NavigationLink, NavigationLinkComponent } from './ui/navigation.js';
|
|
3
|
+
import { NavigationProps, NavigationItem, NavigationLinkProps, NavigationLink, NavigationLinkComponent } from './ui/navigation.js';
|
|
4
4
|
import { NaeilHeaderLocale } from './naeil-header-content.js';
|
|
5
5
|
export { NaeilHeaderAccount, NaeilHeaderAccountControl, NaeilHeaderAccountControlProps } from './naeil-header-account.js';
|
|
6
6
|
|
|
@@ -10,6 +10,12 @@ interface NaeilHeaderProps extends Omit<NavigationProps, "brand" | "items" | "to
|
|
|
10
10
|
resolveHref?: (path: string) => string;
|
|
11
11
|
brandHref?: string;
|
|
12
12
|
brandSlot?: ReactNode;
|
|
13
|
+
/** Ignored when brandSlot replaces the complete brand content. */
|
|
14
|
+
brandSuffix?: string;
|
|
15
|
+
/** After the brand link, outside it; rendered once at every width. */
|
|
16
|
+
statusSlot?: ReactNode;
|
|
17
|
+
/** Product menu data, after catalog/blog and before flat subNav links. */
|
|
18
|
+
appNavigation?: NavigationItem[];
|
|
13
19
|
brandLinkProps?: Omit<NavigationLinkProps, "href" | "children">;
|
|
14
20
|
/** Omit when the application does not support changing its UI language. */
|
|
15
21
|
onLocaleChange?: (locale: NaeilHeaderLocale) => void;
|
|
@@ -48,6 +54,6 @@ declare function NaeilHeaderLocaleControl({ locale, onLocaleChange }: {
|
|
|
48
54
|
onLocaleChange: (locale: NaeilHeaderLocale) => void;
|
|
49
55
|
}): react_jsx_runtime.JSX.Element;
|
|
50
56
|
/** One complete, opt-in branded composition shared by naeil.dev and applications. */
|
|
51
|
-
declare function NaeilHeader({ locale, resolveHref, brandHref, brandSlot, brandLinkProps, brandLinkComponent, onLocaleChange, authSlot, toolbarSlot, projects, projectsExternal, translations, showProjects, showBlog, subNav, currentProjectKey, currentProjectHref, labels, Link, currentHref, onNavigate, className, containerClassName, ...props }: NaeilHeaderProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare function NaeilHeader({ locale, resolveHref, brandHref, brandSlot, brandSuffix, statusSlot, appNavigation, brandLinkProps, brandLinkComponent, onLocaleChange, authSlot, toolbarSlot, projects, projectsExternal, translations, showProjects, showBlog, subNav, currentProjectKey, currentProjectHref, labels, Link, currentHref, onNavigate, className, containerClassName, ...props }: NaeilHeaderProps): react_jsx_runtime.JSX.Element;
|
|
52
58
|
|
|
53
59
|
export { NaeilHeader, NaeilHeaderLocale, NaeilHeaderLocaleControl, type NaeilHeaderProps, NaeilHeaderThemeControl };
|
|
@@ -72,7 +72,7 @@ function NaeilHeaderLocaleControl({ locale, onLocaleChange }) {
|
|
|
72
72
|
children: /* @__PURE__ */ jsx(SelectValue, { children: locale.toUpperCase() })
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
/* @__PURE__ */ jsx(SelectContent, { align: "end", children: headerLocales.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, className: "min-h-11", lang: value, children: headerLocaleNames[value] }, value)) })
|
|
75
|
+
/* @__PURE__ */ jsx(SelectContent, { align: "end", "data-naeil-chrome": "", "data-naeil-locale-menu": "", lang: locale, children: headerLocales.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, className: "min-h-11", lang: value, children: headerLocaleNames[value] }, value)) })
|
|
76
76
|
] });
|
|
77
77
|
}
|
|
78
78
|
const NativeLink = (props) => /* @__PURE__ */ jsx("a", __spreadValues({}, props));
|
|
@@ -82,6 +82,9 @@ function NaeilHeader(_a) {
|
|
|
82
82
|
resolveHref = (path) => `https://naeil.dev/${locale}${path === "/" ? "" : path}`,
|
|
83
83
|
brandHref,
|
|
84
84
|
brandSlot,
|
|
85
|
+
brandSuffix,
|
|
86
|
+
statusSlot,
|
|
87
|
+
appNavigation,
|
|
85
88
|
brandLinkProps,
|
|
86
89
|
brandLinkComponent,
|
|
87
90
|
onLocaleChange,
|
|
@@ -106,6 +109,9 @@ function NaeilHeader(_a) {
|
|
|
106
109
|
"resolveHref",
|
|
107
110
|
"brandHref",
|
|
108
111
|
"brandSlot",
|
|
112
|
+
"brandSuffix",
|
|
113
|
+
"statusSlot",
|
|
114
|
+
"appNavigation",
|
|
109
115
|
"brandLinkProps",
|
|
110
116
|
"brandLinkComponent",
|
|
111
117
|
"onLocaleChange",
|
|
@@ -148,41 +154,61 @@ function NaeilHeader(_a) {
|
|
|
148
154
|
const brandDestination = brandHref != null ? brandHref : resolveHref("/");
|
|
149
155
|
const BrandLink = brandLinkComponent != null ? brandLinkComponent : Link;
|
|
150
156
|
const _a2 = brandLinkProps != null ? brandLinkProps : {}, { onClick: onBrandClick } = _a2, brandProps = __objRest(_a2, ["onClick"]);
|
|
151
|
-
const toolbar = /* @__PURE__ */ jsx(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
const toolbar = /* @__PURE__ */ jsx(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
"data-app-toolbar": true,
|
|
161
|
+
className: "naeil-header-controls",
|
|
162
|
+
"data-naeil-chrome": toolbarSlot === void 0 ? "" : void 0,
|
|
163
|
+
lang: toolbarSlot === void 0 ? locale : void 0,
|
|
164
|
+
children: toolbarSlot !== void 0 ? toolbarSlot : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
165
|
+
/* @__PURE__ */ jsx(NaeilHeaderThemeControl, { locale }),
|
|
166
|
+
onLocaleChange && /* @__PURE__ */ jsx(NaeilHeaderLocaleControl, { locale, onLocaleChange }),
|
|
167
|
+
authSlot && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
168
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "naeil-header-separator" }),
|
|
169
|
+
authSlot
|
|
170
|
+
] })
|
|
171
|
+
] })
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
const logo = /* @__PURE__ */ jsx(Logo, { variant: "horizontal", size: 28, className: "block", label: null });
|
|
175
|
+
const brand = /* @__PURE__ */ jsx(
|
|
176
|
+
BrandLink,
|
|
177
|
+
__spreadProps(__spreadValues({
|
|
178
|
+
href: brandDestination,
|
|
179
|
+
"data-app-brand": true,
|
|
180
|
+
"aria-label": brandSlot == null ? ".naeil" : void 0
|
|
181
|
+
}, brandProps), {
|
|
182
|
+
onClick: (event) => {
|
|
183
|
+
onBrandClick == null ? void 0 : onBrandClick(event);
|
|
184
|
+
onNavigate == null ? void 0 : onNavigate(event, { id: "brand", href: brandDestination, label: ".naeil" });
|
|
185
|
+
},
|
|
186
|
+
children: brandSlot != null ? brandSlot : brandSuffix ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
187
|
+
logo,
|
|
188
|
+
/* @__PURE__ */ jsx("span", { className: "naeil-header-brand-suffix", children: brandSuffix })
|
|
189
|
+
] }) : logo
|
|
190
|
+
})
|
|
191
|
+
);
|
|
159
192
|
return /* @__PURE__ */ jsx(
|
|
160
193
|
Navigation,
|
|
161
194
|
__spreadProps(__spreadValues({}, props), {
|
|
162
195
|
"data-global-header": true,
|
|
163
196
|
"data-naeil-header": true,
|
|
197
|
+
"data-naeil-chrome": "",
|
|
198
|
+
lang: locale,
|
|
164
199
|
"data-naeil-ui-version": uiRelease.version,
|
|
165
200
|
"data-naeil-ui-contract": uiRelease.contractVersion,
|
|
166
201
|
Link,
|
|
167
202
|
currentHref,
|
|
168
203
|
onNavigate,
|
|
169
|
-
brand: /* @__PURE__ */
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"data-app-brand": true,
|
|
174
|
-
"aria-label": brandSlot == null ? ".naeil" : void 0
|
|
175
|
-
}, brandProps), {
|
|
176
|
-
onClick: (event) => {
|
|
177
|
-
onBrandClick == null ? void 0 : onBrandClick(event);
|
|
178
|
-
onNavigate == null ? void 0 : onNavigate(event, { id: "brand", href: brandDestination, label: ".naeil" });
|
|
179
|
-
},
|
|
180
|
-
children: brandSlot != null ? brandSlot : /* @__PURE__ */ jsx(Logo, { variant: "horizontal", size: 28, className: "block", label: null })
|
|
181
|
-
})
|
|
182
|
-
),
|
|
204
|
+
brand: statusSlot != null ? /* @__PURE__ */ jsxs("div", { className: "naeil-header-brand-row", children: [
|
|
205
|
+
brand,
|
|
206
|
+
statusSlot
|
|
207
|
+
] }) : brand,
|
|
183
208
|
items: [
|
|
184
|
-
...showProjects ? [{ id: "projects", label: (_b2 = translations == null ? void 0 : translations.projects) != null ? _b2 : content.nav.projects, items: projectLinks, columns: 2 }] : [],
|
|
209
|
+
...showProjects ? [{ id: "projects", label: (_b2 = translations == null ? void 0 : translations.projects) != null ? _b2 : content.nav.projects, items: projectLinks, columns: projectLinks.length > 1 ? 2 : 1 }] : [],
|
|
185
210
|
...showBlog ? [{ id: "blog", label: (_c = translations == null ? void 0 : translations.blog) != null ? _c : content.nav.blog, href: resolveHref("/blog"), external: projectsExternal }] : [],
|
|
211
|
+
...appNavigation != null ? appNavigation : [],
|
|
186
212
|
...(subNav != null ? subNav : []).map((item) => __spreadProps(__spreadValues({}, item), { id: item.href }))
|
|
187
213
|
],
|
|
188
214
|
labels: labels != null ? labels : { navigation: content.nav.navigation, menu: content.nav.menu, close: content.nav.closeMenu },
|
|
@@ -38,11 +38,17 @@ interface NavigationProps extends Omit<react.ComponentPropsWithoutRef<"header">,
|
|
|
38
38
|
toolbar?: react.ReactNode;
|
|
39
39
|
mobileToolbar?: react.ReactNode;
|
|
40
40
|
mobileFooter?: react.ReactNode;
|
|
41
|
+
mobileOpen?: boolean;
|
|
42
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
41
43
|
/** Use the same product-owned frame class on header, footer and main. */
|
|
42
44
|
containerClassName?: string;
|
|
43
45
|
/** Preserve modified clicks; applications may preventDefault for client routing/guards. */
|
|
44
46
|
onNavigate?: (event: react.MouseEvent<HTMLAnchorElement>, item: NavigationLink) => void;
|
|
45
47
|
}
|
|
46
|
-
declare
|
|
48
|
+
declare const NavigationSheetAction: react.Context<((action: () => void) => {
|
|
49
|
+
menuClosed: () => void;
|
|
50
|
+
cancel: () => void;
|
|
51
|
+
}) | undefined>;
|
|
52
|
+
declare function Navigation({ brand, items, labels, Link, currentHref, toolbar, mobileToolbar, mobileFooter, mobileOpen: controlledOpen, onMobileOpenChange, containerClassName, onNavigate, className, ...props }: NavigationProps): react_jsx_runtime.JSX.Element;
|
|
47
53
|
|
|
48
|
-
export { Navigation, type NavigationGroup, type NavigationItem, type NavigationLink, type NavigationLinkComponent, type NavigationLinkProps, type NavigationProps };
|
|
54
|
+
export { Navigation, type NavigationGroup, type NavigationItem, type NavigationLink, type NavigationLinkComponent, type NavigationLinkProps, type NavigationProps, NavigationSheetAction };
|