@gridui/site-navigation 1.1.10 → 1.3.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/README.md +25 -2
- package/dist/index.js +18 -4
- package/dist/index.js.map +2 -2
- package/dist/site-navigation/site-navigation-types.d.ts +5 -0
- package/dist/styled.js +6 -0
- package/dist/styles.css +1192 -0
- package/dist/styles.local.css +16 -0
- package/docs/catalog.json +2 -1
- package/docs/reference/site-navigation.md +18 -0
- package/package.json +18 -13
package/README.md
CHANGED
|
@@ -3,10 +3,20 @@
|
|
|
3
3
|
Landing family. Public API: `SiteNavigation`, `SiteNavigationLink`, `SiteNavigationProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/site-navigation` and load `@gridui/site-navigation/styles.css` after Theme.
|
|
6
|
-
|
|
6
|
+
Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
8
|
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-landing/site-navigation/.changeset/history).
|
|
9
9
|
|
|
10
|
+
## Styles
|
|
11
|
+
|
|
12
|
+
Load Theme once. Use `@gridui/site-navigation/styled` for automatic component CSS in
|
|
13
|
+
CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/site-navigation/styles.css`.
|
|
14
|
+
Both entries expose the same root API. The standalone stylesheet includes component
|
|
15
|
+
dependency styles; Theme/reset remain separate. See the
|
|
16
|
+
[integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
|
|
17
|
+
for static HTML loading, SSR limits, and avoiding duplicate CSS.
|
|
18
|
+
|
|
19
|
+
|
|
10
20
|
## Mobile region spacing
|
|
11
21
|
|
|
12
22
|
The mobile navigation body has no outer padding: destination rows and separators
|
|
@@ -27,7 +37,7 @@ family owns desktop hover intent. FrameHeader supplies a separate frame shell
|
|
|
27
37
|
with caller-owned branding.
|
|
28
38
|
|
|
29
39
|
Set `columns={1}` on a MenuGrid passed as mobile content; the composition does
|
|
30
|
-
not select its private descendants.
|
|
40
|
+
not select its private descendants. Rendered dependency styles are included in
|
|
31
41
|
SiteNavigation styles.
|
|
32
42
|
|
|
33
43
|
`className` styles the ResponsiveNavigation root. For a header whose links and
|
|
@@ -76,3 +86,16 @@ their own activation policy. Compose their controls with public Drawer parts
|
|
|
76
86
|
when they should dismiss the panel.
|
|
77
87
|
|
|
78
88
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
89
|
+
|
|
90
|
+
## Local color scopes
|
|
91
|
+
|
|
92
|
+
Pass `portalContainer` to SiteNavigation to mount its mobile drawer and backdrop
|
|
93
|
+
inside a `data-gridui-color-variant` region. The default remains the document body.
|
|
94
|
+
Inline content continues inheriting from its actual DOM parent.
|
|
95
|
+
|
|
96
|
+
## Sizing and density
|
|
97
|
+
|
|
98
|
+
size sets owned desktop NavigationLinks and mobile trigger/close controls; density independently sets owned mobile destination rows. Defaults are medium and comfortable. Supplied preferences, desktop/mobile content and footer slots choose their own presentation.
|
|
99
|
+
|
|
100
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
101
|
+
for native attributes, scope precedence, tokens and target behavior.
|
package/dist/index.js
CHANGED
|
@@ -13,11 +13,12 @@ import { cn as cn2 } from "@gridui/style-utils";
|
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { createElement } from "react";
|
|
15
15
|
var DesktopSiteNavigation = (props) => {
|
|
16
|
-
const { label, links, preferences, desktopContent } = props;
|
|
16
|
+
const { size = "medium", label, links, preferences, desktopContent } = props;
|
|
17
17
|
return /* @__PURE__ */ jsxs(DesktopNavigation, { children: [
|
|
18
18
|
/* @__PURE__ */ jsxs(
|
|
19
19
|
NavigationLinks,
|
|
20
20
|
{
|
|
21
|
+
size,
|
|
21
22
|
"aria-label": label,
|
|
22
23
|
children: [
|
|
23
24
|
links.map((link) => {
|
|
@@ -58,6 +59,8 @@ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
58
59
|
import { createElement as createElement2 } from "react";
|
|
59
60
|
var MobileSiteNavigation = (props) => {
|
|
60
61
|
const {
|
|
62
|
+
size = "medium",
|
|
63
|
+
density = "comfortable",
|
|
61
64
|
label,
|
|
62
65
|
links,
|
|
63
66
|
menuLabel,
|
|
@@ -68,7 +71,8 @@ var MobileSiteNavigation = (props) => {
|
|
|
68
71
|
mobileFooter,
|
|
69
72
|
onMobileCloseAutoFocus,
|
|
70
73
|
anchorNavigation,
|
|
71
|
-
closeDrawer
|
|
74
|
+
closeDrawer,
|
|
75
|
+
portalContainer
|
|
72
76
|
} = props;
|
|
73
77
|
const id = useId();
|
|
74
78
|
return /* @__PURE__ */ jsx2(MobileNavigation, { children: /* @__PURE__ */ jsxs2(ResponsiveDrawer, { children: [
|
|
@@ -80,7 +84,7 @@ var MobileSiteNavigation = (props) => {
|
|
|
80
84
|
Button,
|
|
81
85
|
{
|
|
82
86
|
variant: "quiet",
|
|
83
|
-
size
|
|
87
|
+
size,
|
|
84
88
|
layout: "icon",
|
|
85
89
|
"aria-label": menuLabel,
|
|
86
90
|
title: menuLabel,
|
|
@@ -97,6 +101,7 @@ var MobileSiteNavigation = (props) => {
|
|
|
97
101
|
/* @__PURE__ */ jsxs2(
|
|
98
102
|
DrawerPanel,
|
|
99
103
|
{
|
|
104
|
+
container: portalContainer,
|
|
100
105
|
onCloseAutoFocus: (event) => {
|
|
101
106
|
const preserveAnchor = anchorNavigation.current;
|
|
102
107
|
anchorNavigation.current = false;
|
|
@@ -111,6 +116,7 @@ var MobileSiteNavigation = (props) => {
|
|
|
111
116
|
/* @__PURE__ */ jsx2(
|
|
112
117
|
DrawerCloseButton,
|
|
113
118
|
{
|
|
119
|
+
size,
|
|
114
120
|
"aria-label": closeLabel
|
|
115
121
|
}
|
|
116
122
|
)
|
|
@@ -130,6 +136,7 @@ var MobileSiteNavigation = (props) => {
|
|
|
130
136
|
return /* @__PURE__ */ createElement2(
|
|
131
137
|
MenuLink,
|
|
132
138
|
{
|
|
139
|
+
density,
|
|
133
140
|
...anchorProps,
|
|
134
141
|
key: link.href,
|
|
135
142
|
"aria-current": current ? "page" : void 0,
|
|
@@ -195,6 +202,8 @@ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
195
202
|
var SiteNavigation = (props) => {
|
|
196
203
|
const {
|
|
197
204
|
className,
|
|
205
|
+
size = "medium",
|
|
206
|
+
density = "comfortable",
|
|
198
207
|
label,
|
|
199
208
|
links,
|
|
200
209
|
menuLabel,
|
|
@@ -205,7 +214,8 @@ var SiteNavigation = (props) => {
|
|
|
205
214
|
desktopContent,
|
|
206
215
|
mobileContent,
|
|
207
216
|
mobileFooter,
|
|
208
|
-
onMobileCloseAutoFocus
|
|
217
|
+
onMobileCloseAutoFocus,
|
|
218
|
+
portalContainer
|
|
209
219
|
} = props;
|
|
210
220
|
const anchorNavigation = useRef(false);
|
|
211
221
|
const [
|
|
@@ -227,6 +237,7 @@ var SiteNavigation = (props) => {
|
|
|
227
237
|
/* @__PURE__ */ jsx3(
|
|
228
238
|
DesktopSiteNavigation,
|
|
229
239
|
{
|
|
240
|
+
size,
|
|
230
241
|
label,
|
|
231
242
|
links,
|
|
232
243
|
preferences,
|
|
@@ -236,6 +247,9 @@ var SiteNavigation = (props) => {
|
|
|
236
247
|
/* @__PURE__ */ jsx3(
|
|
237
248
|
MobileSiteNavigation,
|
|
238
249
|
{
|
|
250
|
+
size,
|
|
251
|
+
density,
|
|
252
|
+
portalContainer,
|
|
239
253
|
label,
|
|
240
254
|
links,
|
|
241
255
|
menuLabel,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/site-navigation/style.ts", "../src/site-navigation/desktop-site-navigation.tsx", "../src/site-navigation/mobile-site-navigation.tsx", "../src/site-navigation/site-navigation.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const navigationActionsStyles = cva(cn(\n \"gridui-navigation-actions\",\n \"gridui-u-site-navigation--ms-auto\",\n));\n", "/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Desktop Site Navigation\n */\n\nimport type { DesktopNavigationOptions } from \"./site-navigation-types\";\nimport { navigationActionsStyles } from \"./style\";\nimport { NavigationLinks } from \"@gridui/menu\";\nimport { DesktopNavigation } from \"@gridui/responsive-navigation\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DesktopSiteNavigationProps = DesktopNavigationOptions;\n\nexport const DesktopSiteNavigation: FC<DesktopSiteNavigationProps> = (props: DesktopSiteNavigationProps) => {\n const { label, links, preferences, desktopContent } = props;\n return (<DesktopNavigation>\n <NavigationLinks\n aria-label={label}\n >\n {links.map((link) => {\n const { label: linkLabel, current, ...anchorProps } = link;\n return (<a\n {...anchorProps}\n key={link.href}\n aria-current={current ? \"page\" : undefined}\n >\n {linkLabel}\n </a>);\n })}\n {desktopContent}\n </NavigationLinks>\n <div\n className={cn(navigationActionsStyles())}\n >\n {preferences}\n </div>\n </DesktopNavigation>);\n};\n", "/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Mobile Site Navigation\n */\n\nimport type { MobileNavigationOptions } from \"./site-navigation-types\";\nimport { Button } from \"@gridui/button\";\nimport { DrawerBody, DrawerCloseButton, DrawerFooter, DrawerHeader, DrawerPanel, DrawerTitle, DrawerTrigger } from \"@gridui/drawer\";\nimport { getNavigationActivation } from \"@gridui/interaction\";\nimport { MenuGroup, MenuItemContent, MenuItemLabel, MenuLabel, MenuLink, MenuSeparator } from \"@gridui/menu\";\nimport { MobileNavigation, ResponsiveDrawer } from \"@gridui/responsive-navigation\";\nimport { Menu } from \"lucide-react\";\nimport { type FC, type RefObject, useId } from \"react\";\n\nexport type MobileSiteNavigationProps = MobileNavigationOptions & {\n readonly anchorNavigation: RefObject<boolean>;\n readonly closeDrawer: () => void;\n};\n\nexport const MobileSiteNavigation: FC<MobileSiteNavigationProps> = (props: MobileSiteNavigationProps) => {\n const { label, links, menuLabel, closeLabel, settingsLabel, mobilePreferences, mobileContent, mobileFooter,\n onMobileCloseAutoFocus, anchorNavigation, closeDrawer } = props;\n const id = useId();\n return (<MobileNavigation>\n <ResponsiveDrawer>\n <DrawerTrigger\n asChild\n >\n <Button\n variant=\"quiet\"\n size
|
|
5
|
-
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,0BAA0B,IAAI;AAAA,EACvC;AAAA,EACA;AACJ,CAAC;;;ACJD,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,MAAAA,WAAU;AAQX,
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const navigationActionsStyles = cva(cn(\n \"gridui-navigation-actions\",\n \"gridui-u-site-navigation--ms-auto\",\n));\n", "/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Desktop Site Navigation\n */\n\nimport type { DesktopNavigationOptions } from \"./site-navigation-types\";\nimport { navigationActionsStyles } from \"./style\";\nimport { NavigationLinks } from \"@gridui/menu\";\nimport { DesktopNavigation } from \"@gridui/responsive-navigation\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DesktopSiteNavigationProps = DesktopNavigationOptions;\n\nexport const DesktopSiteNavigation: FC<DesktopSiteNavigationProps> = (props: DesktopSiteNavigationProps) => {\n const { size = \"medium\", label, links, preferences, desktopContent } = props;\n return (<DesktopNavigation>\n <NavigationLinks\n size={size}\n aria-label={label}\n >\n {links.map((link) => {\n const { label: linkLabel, current, ...anchorProps } = link;\n return (<a\n {...anchorProps}\n key={link.href}\n aria-current={current ? \"page\" : undefined}\n >\n {linkLabel}\n </a>);\n })}\n {desktopContent}\n </NavigationLinks>\n <div\n className={cn(navigationActionsStyles())}\n >\n {preferences}\n </div>\n </DesktopNavigation>);\n};\n", "/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Mobile Site Navigation\n */\n\nimport type { MobileNavigationOptions } from \"./site-navigation-types\";\nimport { Button } from \"@gridui/button\";\nimport { DrawerBody, DrawerCloseButton, DrawerFooter, DrawerHeader, DrawerPanel, DrawerTitle, DrawerTrigger } from \"@gridui/drawer\";\nimport { getNavigationActivation } from \"@gridui/interaction\";\nimport { MenuGroup, MenuItemContent, MenuItemLabel, MenuLabel, MenuLink, MenuSeparator } from \"@gridui/menu\";\nimport { MobileNavigation, ResponsiveDrawer } from \"@gridui/responsive-navigation\";\nimport { Menu } from \"lucide-react\";\nimport { type FC, type RefObject, useId } from \"react\";\n\nexport type MobileSiteNavigationProps = MobileNavigationOptions & {\n readonly anchorNavigation: RefObject<boolean>;\n readonly closeDrawer: () => void;\n};\n\nexport const MobileSiteNavigation: FC<MobileSiteNavigationProps> = (props: MobileSiteNavigationProps) => {\n const { size = \"medium\", density = \"comfortable\", label, links, menuLabel, closeLabel, settingsLabel, mobilePreferences, mobileContent, mobileFooter,\n onMobileCloseAutoFocus, anchorNavigation, closeDrawer, portalContainer } = props;\n const id = useId();\n return (<MobileNavigation>\n <ResponsiveDrawer>\n <DrawerTrigger\n asChild\n >\n <Button\n variant=\"quiet\"\n size={size}\n layout=\"icon\"\n aria-label={menuLabel}\n title={menuLabel}\n >\n <Menu\n aria-hidden=\"true\"\n />\n </Button>\n </DrawerTrigger>\n <DrawerPanel\n container={portalContainer}\n onCloseAutoFocus={(event) => {\n const preserveAnchor = anchorNavigation.current;\n anchorNavigation.current = false;\n onMobileCloseAutoFocus?.(event);\n if (preserveAnchor) {\n event.preventDefault();\n }\n }}\n >\n <DrawerHeader>\n <DrawerTitle >\n {menuLabel}\n </DrawerTitle>\n <DrawerCloseButton\n size={size}\n aria-label={closeLabel}\n />\n </DrawerHeader>\n <DrawerBody\n className=\"gridui-u-site-navigation--p-0\"\n >\n <nav\n aria-label={label}\n >\n {links.map((link) => {\n const { label: linkLabel, current, onClick, ...anchorProps } = link;\n return (<MenuLink\n density={density}\n {...anchorProps}\n key={link.href}\n aria-current={current ? \"page\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n const activation = getNavigationActivation(event);\n if (!activation) {\n return;\n }\n anchorNavigation.current = activation === \"anchor\";\n closeDrawer();\n }}\n >\n <MenuItemContent>\n <MenuItemLabel>\n {linkLabel}\n </MenuItemLabel>\n </MenuItemContent>\n </MenuLink>);\n })}\n {mobileContent && (<>\n {links.length > 0 && (<MenuSeparator />)}\n {mobileContent}\n </>)}\n </nav>\n <MenuSeparator />\n <MenuGroup\n className=\"gridui-u-site-navigation--gap-gridui-16 gridui-u-site-navigation--p-gridui-24\"\n aria-labelledby={`${id}-settings`}\n >\n <MenuLabel\n className=\"gridui-u-site-navigation--p-0\"\n id={`${id}-settings`}\n >\n {settingsLabel}\n </MenuLabel>\n {mobilePreferences}\n </MenuGroup>\n </DrawerBody>\n {mobileFooter && (<DrawerFooter>\n <div\n className=\"gridui-u-site-navigation--p-gridui-24\"\n >\n {mobileFooter}\n </div>\n </DrawerFooter>)}\n </DrawerPanel>\n </ResponsiveDrawer>\n </MobileNavigation>);\n};\n", "/**\n * @author WMXPY\n * @package Site Navigation\n * @namespace SiteNavigation\n * @description Site Navigation\n */\n\nimport { DesktopSiteNavigation } from \"./desktop-site-navigation\";\nimport { MobileSiteNavigation } from \"./mobile-site-navigation\";\nimport type { DesktopNavigationOptions, MobileNavigationOptions } from \"./site-navigation-types\";\nimport { ResponsiveNavigation } from \"@gridui/responsive-navigation\";\nimport { type FC, useRef, useState } from \"react\";\n\nexport type SiteNavigationProps = DesktopNavigationOptions & MobileNavigationOptions & {\n readonly className?: string;\n};\n\nexport const SiteNavigation: FC<SiteNavigationProps> = (props: SiteNavigationProps) => {\n const {\n className,\n size = \"medium\", density = \"comfortable\",\n label,\n links,\n menuLabel,\n closeLabel,\n settingsLabel,\n preferences,\n mobilePreferences,\n desktopContent,\n mobileContent,\n mobileFooter,\n onMobileCloseAutoFocus,\n portalContainer,\n } = props;\n const anchorNavigation = useRef(false);\n const [\n mobileOpen,\n setMobileOpen,\n ] = useState(false);\n return (<ResponsiveNavigation\n className={className}\n drawerOpen={mobileOpen}\n onDrawerOpenChange={(open) => {\n if (open) {\n anchorNavigation.current = false;\n }\n setMobileOpen(open);\n }}\n >\n <DesktopSiteNavigation\n size={size}\n label={label}\n links={links}\n preferences={preferences}\n desktopContent={desktopContent}\n />\n <MobileSiteNavigation\n size={size}\n density={density}\n portalContainer={portalContainer}\n label={label}\n links={links}\n menuLabel={menuLabel}\n closeLabel={closeLabel}\n settingsLabel={settingsLabel}\n mobilePreferences={mobilePreferences}\n mobileContent={mobileContent}\n mobileFooter={mobileFooter}\n onMobileCloseAutoFocus={onMobileCloseAutoFocus}\n anchorNavigation={anchorNavigation}\n closeDrawer={() => {\n setMobileOpen(false);\n }}\n />\n </ResponsiveNavigation>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,0BAA0B,IAAI;AAAA,EACvC;AAAA,EACA;AACJ,CAAC;;;ACJD,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,MAAAA,WAAU;AAQX,SAgBA,KAhBA;AAMgB;AATjB,IAAM,wBAAwD,CAAC,UAAsC;AACxG,QAAM,EAAE,OAAO,UAAU,OAAO,OAAO,aAAa,eAAe,IAAI;AACvE,SAAQ,qBAAC,qBACL;AAAA;AAAA,MAAC;AAAA;AAAA,QACG;AAAA,QACA,c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A,QACA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACG;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,aAAa,MAAM;AACf,4BAAc,KAAK;AAAA,YACvB;AAAA;AAAA,QACJ;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cn", "jsx", "jsxs", "createElement", "jsx", "jsxs"]
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @namespace SiteNavigation
|
|
5
5
|
* @description Site Navigation Types
|
|
6
6
|
*/
|
|
7
|
+
import type { Size, Density } from "@gridui/theme";
|
|
7
8
|
import type { DrawerPanelProps } from "@gridui/drawer";
|
|
8
9
|
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
9
10
|
export type SiteNavigationLink = Omit<ComponentPropsWithoutRef<"a">, "children" | "dangerouslySetInnerHTML" | "href" | "aria-current"> & {
|
|
@@ -16,10 +17,14 @@ type SiteNavigationLinks = {
|
|
|
16
17
|
readonly links: readonly SiteNavigationLink[];
|
|
17
18
|
};
|
|
18
19
|
export type DesktopNavigationOptions = SiteNavigationLinks & {
|
|
20
|
+
readonly size?: Size | undefined;
|
|
19
21
|
readonly preferences: ReactNode;
|
|
20
22
|
readonly desktopContent?: ReactNode;
|
|
21
23
|
};
|
|
22
24
|
export type MobileNavigationOptions = SiteNavigationLinks & {
|
|
25
|
+
readonly size?: Size | undefined;
|
|
26
|
+
readonly density?: Density | undefined;
|
|
27
|
+
readonly portalContainer?: DrawerPanelProps["container"];
|
|
23
28
|
readonly menuLabel: string;
|
|
24
29
|
readonly closeLabel: string;
|
|
25
30
|
readonly settingsLabel: string;
|