@gridui/site-navigation 1.1.9 → 1.2.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 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
- Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
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. Load rendered dependency styles before
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,9 @@ 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-system` region. The default remains the document body.
94
+ Inline content continues inheriting from its actual DOM parent.
package/dist/index.js CHANGED
@@ -68,7 +68,8 @@ var MobileSiteNavigation = (props) => {
68
68
  mobileFooter,
69
69
  onMobileCloseAutoFocus,
70
70
  anchorNavigation,
71
- closeDrawer
71
+ closeDrawer,
72
+ portalContainer
72
73
  } = props;
73
74
  const id = useId();
74
75
  return /* @__PURE__ */ jsx2(MobileNavigation, { children: /* @__PURE__ */ jsxs2(ResponsiveDrawer, { children: [
@@ -97,6 +98,7 @@ var MobileSiteNavigation = (props) => {
97
98
  /* @__PURE__ */ jsxs2(
98
99
  DrawerPanel,
99
100
  {
101
+ container: portalContainer,
100
102
  onCloseAutoFocus: (event) => {
101
103
  const preserveAnchor = anchorNavigation.current;
102
104
  anchorNavigation.current = false;
@@ -205,7 +207,8 @@ var SiteNavigation = (props) => {
205
207
  desktopContent,
206
208
  mobileContent,
207
209
  mobileFooter,
208
- onMobileCloseAutoFocus
210
+ onMobileCloseAutoFocus,
211
+ portalContainer
209
212
  } = props;
210
213
  const anchorNavigation = useRef(false);
211
214
  const [
@@ -236,6 +239,7 @@ var SiteNavigation = (props) => {
236
239
  /* @__PURE__ */ jsx3(
237
240
  MobileSiteNavigation,
238
241
  {
242
+ portalContainer,
239
243
  label,
240
244
  links,
241
245
  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=\"standard\"\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 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 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 {...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 label,\n links,\n menuLabel,\n closeLabel,\n settingsLabel,\n preferences,\n mobilePreferences,\n desktopContent,\n mobileContent,\n mobileFooter,\n onMobileCloseAutoFocus,\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 label={label}\n links={links}\n preferences={preferences}\n desktopContent={desktopContent}\n />\n <MobileSiteNavigation\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,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AAAA,UAAC;AAAA;AAAA,YACG;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACJ;AAAA,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,MAAM;AACf,4BAAc,KAAK;AAAA,YACvB;AAAA;AAAA,QACJ;AAAA;AAAA;AAAA,EACJ;AACJ;",
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, portalContainer } = props;\n const id = useId();\n return (<MobileNavigation>\n <ResponsiveDrawer>\n <DrawerTrigger\n asChild\n >\n <Button\n variant=\"quiet\"\n size=\"standard\"\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 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 {...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 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 label={label}\n links={links}\n preferences={preferences}\n desktopContent={desktopContent}\n />\n <MobileSiteNavigation\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,SAeA,KAfA;AAKgB;AARjB,IAAM,wBAAwD,CAAC,UAAsC;AACxG,QAAM,EAAE,OAAO,OAAO,aAAa,eAAe,IAAI;AACtD,SAAQ,qBAAC,qBACL;AAAA;AAAA,MAAC;AAAA;AAAA,QACG,cAAY;AAAA,QAEX;AAAA,gBAAM,IAAI,CAAC,SAAS;AACjB,kBAAM,EAAE,OAAO,WAAW,SAAS,GAAG,YAAY,IAAI;AACtD,mBAAQ;AAAA,cAAC;AAAA;AAAA,gBACJ,GAAG;AAAA,gBACJ,KAAK,KAAK;AAAA,gBACV,gBAAc,UAAU,SAAS;AAAA;AAAA,cAEhC;AAAA,YACL;AAAA,UACJ,CAAC;AAAA,UACA;AAAA;AAAA;AAAA,IACL;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACG,WAAWA,IAAG,wBAAwB,CAAC;AAAA,QAEtC;AAAA;AAAA,IACL;AAAA,KACJ;AACJ;;;AChCA,SAAS,cAAc;AACvB,SAAS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;;;AC7GA,SAAS,4BAA4B;AACrC,SAAkB,QAAQ,gBAAgB;AA2B9B,SAUJ,OAAAG,MAVI,QAAAC,aAAA;AArBL,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,IAAI;AACJ,QAAM,mBAAmB,OAAO,KAAK;AACrC,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,KAAK;AAClB,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACL;AAAA,MACA,YAAY;AAAA,MACZ,oBAAoB,CAAC,SAAS;AAC1B,YAAI,MAAM;AACN,2BAAiB,UAAU;AAAA,QAC/B;AACA,sBAAc,IAAI;AAAA,MACtB;AAAA,MAEA;AAAA,wBAAAD;AAAA,UAAC;AAAA;AAAA,YACG;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACJ;AAAA,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,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
  }
@@ -20,6 +20,7 @@ export type DesktopNavigationOptions = SiteNavigationLinks & {
20
20
  readonly desktopContent?: ReactNode;
21
21
  };
22
22
  export type MobileNavigationOptions = SiteNavigationLinks & {
23
+ readonly portalContainer?: DrawerPanelProps["container"];
23
24
  readonly menuLabel: string;
24
25
  readonly closeLabel: string;
25
26
  readonly settingsLabel: string;
package/dist/styled.js ADDED
@@ -0,0 +1,6 @@
1
+ import "@gridui/button/styled";
2
+ import "@gridui/menu/styled";
3
+ import "@gridui/drawer/styled";
4
+ import "@gridui/responsive-navigation/styled";
5
+ import "./styles.local.css";
6
+ export * from "./index.js";