@plexui/ui 0.22.0 → 0.23.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.
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import clsx from "clsx";
4
+ import { createContext, useContext, useMemo, useState, } from "react";
5
+ import s from "@plexui/styles/components/Page/Page.module.css";
6
+ // A trackpad's small settle at the top must not flash the line.
7
+ const SCROLLED_AFTER = 4;
8
+ const PageContext = createContext(null);
9
+ function usePageContext(part) {
10
+ const context = useContext(PageContext);
11
+ if (!context) {
12
+ throw new Error(`Page.${part} must be used within Page`);
13
+ }
14
+ return context;
15
+ }
16
+ function PageRoot({ width = "full", className, children, ...restProps }) {
17
+ const [scrolled, setScrolled] = useState(false);
18
+ const context = useMemo(() => ({ scrolled, setScrolled }), [scrolled]);
19
+ return (_jsx(PageContext.Provider, { value: context, children: _jsx("div", { className: clsx(s.Page, className), "data-width": width, ...restProps, children: children }) }));
20
+ }
21
+ PageRoot.displayName = "Page";
22
+ function PageHeader({ divider = true, className, children, ...restProps }) {
23
+ const { scrolled } = usePageContext("Header");
24
+ return (_jsx("div", { className: clsx(s.Header, className), "data-scrolled": divider && scrolled ? "" : undefined, ...restProps, children: _jsx("div", { className: s.Head, children: children }) }));
25
+ }
26
+ PageHeader.displayName = "Page.Header";
27
+ function PageBar({ className, ...restProps }) {
28
+ return _jsx("div", { className: clsx(s.Bar, className), ...restProps });
29
+ }
30
+ PageBar.displayName = "Page.Bar";
31
+ function PageHeading({ className, ...restProps }) {
32
+ return _jsx("div", { className: clsx(s.Heading, className), ...restProps });
33
+ }
34
+ PageHeading.displayName = "Page.Heading";
35
+ function PageTitle({ className, ...restProps }) {
36
+ return _jsx("h1", { className: clsx(s.Title, className), ...restProps });
37
+ }
38
+ PageTitle.displayName = "Page.Title";
39
+ function PageSubtitle({ className, ...restProps }) {
40
+ return _jsx("p", { className: clsx(s.Subtitle, className), ...restProps });
41
+ }
42
+ PageSubtitle.displayName = "Page.Subtitle";
43
+ function PageActions({ className, ...restProps }) {
44
+ return _jsx("div", { className: clsx(s.Actions, className), ...restProps });
45
+ }
46
+ PageActions.displayName = "Page.Actions";
47
+ function PageContent({ fill = false, className, children, onScroll, ...restProps }) {
48
+ const { setScrolled } = usePageContext("Content");
49
+ const handleScroll = (event) => {
50
+ setScrolled(event.currentTarget.scrollTop > SCROLLED_AFTER);
51
+ onScroll?.(event);
52
+ };
53
+ return (_jsx("div", { className: clsx(s.Content, className), "data-fill": fill ? "" : undefined, onScroll: handleScroll, ...restProps, children: _jsx("div", { className: s.Column, children: children }) }));
54
+ }
55
+ PageContent.displayName = "Page.Content";
56
+ /* ------------------------------------------------------------------ */
57
+ /* Compound */
58
+ /* ------------------------------------------------------------------ */
59
+ export const Page = PageRoot;
60
+ Page.Header = PageHeader;
61
+ Page.Bar = PageBar;
62
+ Page.Heading = PageHeading;
63
+ Page.Title = PageTitle;
64
+ Page.Subtitle = PageSubtitle;
65
+ Page.Actions = PageActions;
66
+ Page.Content = PageContent;
67
+ //# sourceMappingURL=Page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../../src/components/Page/Page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,UAAU,EACV,OAAO,EACP,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,CAAC,MAAM,gDAAgD,CAAA;AAI9D,gEAAgE;AAChE,MAAM,cAAc,GAAG,CAAC,CAAA;AAOxB,MAAM,WAAW,GAAG,aAAa,CAA0B,IAAI,CAAC,CAAA;AAEhE,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,QAAQ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C,aAAa,CAAC,SAAS,GAAG,cAAc,CAAC,CAAA;QAC3D,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAA;IACnB,CAAC,CAAA;IAED,OAAO,CACL,cACE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,eAC1B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAChC,QAAQ,EAAE,YAAY,KAClB,SAAS,YAEb,cAAK,SAAS,EAAE,CAAC,CAAC,MAAM,YAAG,QAAQ,GAAO,GACtC,CACP,CAAA;AACH,CAAC;AACD,WAAW,CAAC,WAAW,GAAG,cAAc,CAAA;AAExC,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,CAAC,MAAM,IAAI,GAAG,QAQnB,CAAA;AACD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;AACxB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAA;AAClB,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;AACtB,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAA;AAC5B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useContext,\n useMemo,\n useState,\n type HTMLAttributes,\n type Ref,\n type UIEvent,\n} from \"react\"\nimport s from \"@plexui/styles/components/Page/Page.module.css\"\n\nexport type PageWidth = \"full\" | \"wide\" | \"column\"\n\n// A trackpad's small settle at the top must not flash the line.\nconst SCROLLED_AFTER = 4\n\ntype PageContextValue = {\n scrolled: boolean\n setScrolled: (scrolled: boolean) => void\n}\n\nconst PageContext = createContext<PageContextValue | null>(null)\n\nfunction usePageContext(part: string): PageContextValue {\n const context = useContext(PageContext)\n if (!context) {\n throw new Error(`Page.${part} must be used within Page`)\n }\n return context\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type PageProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * Width of the column that header and content share.\n * - `\"full\"` — edge to edge, for tables (default)\n * - `\"wide\"` — 1280px, centred, for overviews\n * - `\"column\"` — 768px, centred, for settings and forms\n *\n * Set `--page-width` on the page for any other width.\n * @default \"full\"\n */\n width?: PageWidth\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageRoot({ width = \"full\", className, children, ...restProps }: PageProps) {\n const [scrolled, setScrolled] = useState(false)\n const context = useMemo(() => ({ scrolled, setScrolled }), [scrolled])\n\n return (\n <PageContext.Provider value={context}>\n <div className={clsx(s.Page, className)} data-width={width} {...restProps}>\n {children}\n </div>\n </PageContext.Provider>\n )\n}\nPageRoot.displayName = \"Page\"\n\n/* ------------------------------------------------------------------ */\n/* Header */\n/* ------------------------------------------------------------------ */\n\nexport type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * Shows the line, and the glass on a phone, once the content has scrolled under the header.\n * Turn it off when the content already draws a line of its own at that place.\n * @default true\n */\n divider?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageHeader({ divider = true, className, children, ...restProps }: PageHeaderProps) {\n const { scrolled } = usePageContext(\"Header\")\n\n return (\n <div\n className={clsx(s.Header, className)}\n data-scrolled={divider && scrolled ? \"\" : undefined}\n {...restProps}\n >\n <div className={s.Head}>{children}</div>\n </div>\n )\n}\nPageHeader.displayName = \"Page.Header\"\n\n/* ------------------------------------------------------------------ */\n/* Slots */\n/* ------------------------------------------------------------------ */\n\nexport type PageSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction PageBar({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Bar, className)} {...restProps} />\n}\nPageBar.displayName = \"Page.Bar\"\n\nfunction PageHeading({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Heading, className)} {...restProps} />\n}\nPageHeading.displayName = \"Page.Heading\"\n\nfunction PageTitle({\n className,\n ...restProps\n}: HTMLAttributes<HTMLHeadingElement> & { ref?: Ref<HTMLHeadingElement> }) {\n return <h1 className={clsx(s.Title, className)} {...restProps} />\n}\nPageTitle.displayName = \"Page.Title\"\n\nfunction PageSubtitle({\n className,\n ...restProps\n}: HTMLAttributes<HTMLParagraphElement> & { ref?: Ref<HTMLParagraphElement> }) {\n return <p className={clsx(s.Subtitle, className)} {...restProps} />\n}\nPageSubtitle.displayName = \"Page.Subtitle\"\n\nfunction PageActions({ className, ...restProps }: PageSlotProps) {\n return <div className={clsx(s.Actions, className)} {...restProps} />\n}\nPageActions.displayName = \"Page.Actions\"\n\n/* ------------------------------------------------------------------ */\n/* Content */\n/* ------------------------------------------------------------------ */\n\nexport type PageContentProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The content fills the page and scrolls inside itself, as a table does: the page stops\n * scrolling from 768px up.\n * @default false\n */\n fill?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nfunction PageContent({ fill = false, className, children, onScroll, ...restProps }: PageContentProps) {\n const { setScrolled } = usePageContext(\"Content\")\n\n const handleScroll = (event: UIEvent<HTMLDivElement>) => {\n setScrolled(event.currentTarget.scrollTop > SCROLLED_AFTER)\n onScroll?.(event)\n }\n\n return (\n <div\n className={clsx(s.Content, className)}\n data-fill={fill ? \"\" : undefined}\n onScroll={handleScroll}\n {...restProps}\n >\n <div className={s.Column}>{children}</div>\n </div>\n )\n}\nPageContent.displayName = \"Page.Content\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Page = PageRoot as typeof PageRoot & {\n Header: typeof PageHeader\n Bar: typeof PageBar\n Heading: typeof PageHeading\n Title: typeof PageTitle\n Subtitle: typeof PageSubtitle\n Actions: typeof PageActions\n Content: typeof PageContent\n}\nPage.Header = PageHeader\nPage.Bar = PageBar\nPage.Heading = PageHeading\nPage.Title = PageTitle\nPage.Subtitle = PageSubtitle\nPage.Actions = PageActions\nPage.Content = PageContent\n"]}
@@ -0,0 +1,2 @@
1
+ export { Page, } from "./Page.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Page/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,GAML,MAAM,QAAQ,CAAA","sourcesContent":["export {\n Page,\n type PageContentProps,\n type PageHeaderProps,\n type PageProps,\n type PageSlotProps,\n type PageWidth,\n} from \"./Page\"\n"]}
@@ -142,17 +142,29 @@ export const SidebarMenu = forwardRef(({ className, ...props }, ref) => (_jsx("u
142
142
  SidebarMenu.displayName = "SidebarMenu";
143
143
  export const SidebarMenuItem = forwardRef(({ expanded, className, ...props }, ref) => (_jsx("li", { ref: ref, "data-expanded": expanded ? "true" : undefined, className: clsx(s.MenuItem, className), ...cleanProps(props) })));
144
144
  SidebarMenuItem.displayName = "SidebarMenuItem";
145
- export const SidebarMenuButton = forwardRef(({ isActive = false, tooltip, asChild = false, className, children, ...props }, ref) => {
145
+ // Shared by every row of the rail: moving to the next one shows its label at once.
146
+ let railLeftAt = 0;
147
+ export const SidebarMenuButton = forwardRef(({ isActive = false, tooltip, asChild = false, className, children, onPointerEnter, onPointerLeave, ...props }, ref) => {
146
148
  const { state, isMobile } = useSidebar();
149
+ const [openDelay, setOpenDelay] = useState();
147
150
  const Comp = asChild ? Slot.Root : "button";
148
151
  // With asChild the child element is the button, so the inner wrapper
149
152
  // goes inside it. Wrapping the child instead would make Slot merge the
150
153
  // button props onto the wrapper span.
151
154
  const content = asChild && isValidElement(children) ? (cloneElement(children, undefined, _jsx("span", { className: s.MenuButtonInner, children: children.props.children }))) : (_jsx("span", { className: s.MenuButtonInner, children: children }));
152
- const button = (_jsx(Comp, { ref: ref, "data-active": isActive ? "true" : "false", "aria-current": isActive ? "page" : undefined, className: clsx(s.MenuButton, className), ...cleanProps(props), children: content }));
153
- // Show tooltip when collapsed (icon mode) and not mobile
154
- if (tooltip && state === "collapsed" && !isMobile) {
155
- return (_jsx(Tooltip, { content: tooltip, side: "right", children: button }));
155
+ const button = (_jsx(Comp, { ref: ref, "data-active": isActive ? "true" : "false", "aria-current": isActive ? "page" : undefined, className: clsx(s.MenuButton, className), onPointerEnter: (event) => {
156
+ onPointerEnter?.(event);
157
+ if (tooltip)
158
+ setOpenDelay(Date.now() - railLeftAt < 300 ? 0 : undefined);
159
+ }, onPointerLeave: (event) => {
160
+ onPointerLeave?.(event);
161
+ if (tooltip)
162
+ railLeftAt = Date.now();
163
+ }, ...cleanProps(props), children: content }));
164
+ // The tooltip shows when collapsed (icon mode) and not on mobile. It wraps
165
+ // the row in every state, so the row stays mounted and its label can fade.
166
+ if (tooltip) {
167
+ return (_jsx(Tooltip, { content: state === "collapsed" && !isMobile ? tooltip : null, openDelay: openDelay, side: "right", children: button }));
156
168
  }
157
169
  return button;
158
170
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,QAAQ,GAGT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,UAAU,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,SAAS,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAmB,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,CAA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E,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,KAAM,UAAU,CAAC,KAAK,CAAC,GAAI,CACrF,CACF,CAAA;AACD,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA;AAQvD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cAAK,SAAS,EAAE,CAAC,CAAC,KAAK,YACrB,KAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,KAAC,UAAU,KAAG,KAC1B,UAAU,CAAC,KAAK,CAAC,GACrB,GACE,CACP,CACF,CAAA;AACD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAQzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAC1C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,UAAU,CAAC,KAAK,CAAC,GAAI,CACpF,CACF,CAAA;AACD,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA","sourcesContent":["\"use client\"\n\n/**\n * Sidebar Component - Composable navigation sidebar\n *\n * API SPECIFICATION:\n *\n * SidebarProvider\n * - defaultOpen?: boolean (default: true)\n * - open?: boolean (controlled)\n * - onOpenChange?: (open: boolean) => void\n * - collapsible?: \"offcanvas\" | \"icon\" | \"none\" (default: \"offcanvas\")\n *\n * Sidebar\n * - side?: \"left\" | \"right\" (default: \"left\")\n * - variant?: \"sidebar\" | \"docs\" (default: \"sidebar\")\n *\n * SidebarHeader / SidebarContent / SidebarFooter\n * - Standard container props\n *\n * SidebarGroup\n * - defaultOpen?: boolean (default: true)\n * - open?: boolean (controlled)\n *\n * SidebarGroupLabel / SidebarGroupAction / SidebarGroupContent\n * - Standard container props\n *\n * SidebarMenu / SidebarMenuItem\n * - Standard container props\n *\n * SidebarMenuButton\n * - isActive?: boolean (default: false)\n * - size?: \"sm\" | \"md\" | \"lg\" (default: \"md\")\n * - tooltip?: string | ReactNode\n * - asChild?: boolean\n *\n * SidebarMenuAction / SidebarMenuBadge\n * - Standard container props\n *\n * SidebarMenuSkeleton\n * - showIcon?: boolean (default: true)\n *\n * SidebarMenuSub / SidebarMenuSubItem / SidebarMenuSubButton\n * - Same as parent menu components\n *\n * SidebarSeparator\n * - Standard separator props\n *\n * SidebarCard / SidebarCardHeader / SidebarCardContent / SidebarCardFooter\n * - variant?: \"default\" | \"elevated\"\n * - dismissible?: boolean\n * - onDismiss?: () => void\n *\n * SidebarInset\n * - Standard container for main content area\n *\n * SidebarTrigger\n * - Uses Button component internally\n * - Returns null when collapsible=\"none\"\n *\n * SidebarMobileMenuButton\n * - Hamburger → X animated icon button for mobile\n *\n * SidebarInput\n * - shortcut?: string (keyboard shortcut display)\n */\n\nimport clsx from \"clsx\"\nimport { Slot } from \"radix-ui\"\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useLayoutEffect,\n useState,\n type ComponentProps,\n type ReactNode,\n} from \"react\"\n\nimport { Button } from \"../Button\"\nimport { ChevronRightMd, Search as SearchIcon, SidebarLeft, X } from \"../Icon\"\nimport { Input, type InputProps } from \"../Input\"\nimport { Tooltip } from \"../Tooltip\"\nimport s from \"@plexui/styles/components/Sidebar/Sidebar.module.css\"\nimport {\n SidebarProvider,\n useSidebar,\n type SidebarCollapsible,\n type SidebarSide,\n type SidebarVariant,\n} from \"./useSidebarContext\"\n\n// Helper to filter out props that shouldn't be spread to the DOM (e.g. injected by MDX)\nconst cleanProps = <P extends object>(props: P): Omit<P, \"data-toggle\"> => {\n const { \"data-toggle\": _, ...rest } = props as P & { \"data-toggle\"?: unknown }\n return rest\n}\n\n// Re-export provider and hook\nexport { SidebarProvider, useSidebar }\nexport type { SidebarCollapsible, SidebarSide, SidebarVariant }\n\n// =============================================\n// Sidebar Root\n// =============================================\n\nexport type SidebarProps = ComponentProps<\"aside\"> & {\n /**\n * The side the sidebar is on.\n * @default \"left\"\n */\n side?: SidebarSide\n /**\n * The visual variant of the sidebar.\n * @default \"sidebar\"\n */\n variant?: SidebarVariant\n}\n\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(\n ({ side = \"left\", variant = \"sidebar\", className, children, ...props }, ref) => {\n const { collapsible, isMobile } = useSidebar()\n\n // Skip rendering sidebar on mobile for offcanvas mode\n if (isMobile && collapsible === \"offcanvas\") {\n return null\n }\n\n return (\n <aside\n ref={ref}\n data-side={side}\n data-variant={variant}\n className={clsx(s.Sidebar, className)}\n {...cleanProps(props)}\n >\n {children}\n </aside>\n )\n },\n)\nSidebar.displayName = \"Sidebar\"\n\n// =============================================\n// Sidebar Sections\n// =============================================\n\nexport type SidebarHeaderProps = ComponentProps<\"div\">\n\nexport const SidebarHeader = forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.Header, className)} {...cleanProps(props)} />\n ),\n)\nSidebarHeader.displayName = \"SidebarHeader\"\n\nexport type SidebarContentProps = ComponentProps<\"div\">\n\nexport const SidebarContent = forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, ...props }, ref) => {\n const [contentEl, setContentEl] = useState<HTMLDivElement | null>(null)\n const setRef = useCallback(\n (el: HTMLDivElement | null) => {\n setContentEl(el)\n if (typeof ref === \"function\") ref(el)\n else if (ref) (ref as { current: HTMLDivElement | null }).current = el\n },\n [ref],\n )\n\n useLayoutEffect(() => {\n if (!contentEl) return\n const sidebar = contentEl.parentElement\n if (!sidebar) return\n\n const update = () => {\n const hasOverflow = contentEl.scrollHeight > contentEl.clientHeight\n sidebar.setAttribute(\"data-content-scrollable\", hasOverflow ? \"true\" : \"false\")\n }\n update()\n const ro = new ResizeObserver(update)\n ro.observe(contentEl)\n return () => ro.disconnect()\n }, [contentEl])\n\n return <div ref={setRef} className={clsx(s.Content, className)} {...cleanProps(props)} />\n },\n)\nSidebarContent.displayName = \"SidebarContent\"\n\nexport type SidebarFooterProps = ComponentProps<\"div\">\n\nexport const SidebarFooter = forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={clsx(s.Footer, className)} {...cleanProps(props)}>\n <div className={s.FooterSeparator} />\n {children}\n </div>\n ),\n)\nSidebarFooter.displayName = \"SidebarFooter\"\n\nexport type SidebarRailProps = ComponentProps<\"div\">\n\nexport const SidebarRail = forwardRef<HTMLDivElement, SidebarRailProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.Rail, className)} {...cleanProps(props)} />\n ),\n)\nSidebarRail.displayName = \"SidebarRail\"\n\n// =============================================\n// Groups\n// =============================================\n\nexport type SidebarGroupProps = ComponentProps<\"div\"> & {\n /**\n * Whether the group is open initially. A closed group hides its `SidebarGroupContent`.\n * @default true\n */\n defaultOpen?: boolean\n /**\n * Controlled open state. The group has no toggle of its own: change `open` from your own control.\n */\n open?: boolean\n}\n\nexport const SidebarGroup = forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ defaultOpen = true, open: openProp, className, ...props }, ref) => {\n // The initial value only, like an uncontrolled input's defaultValue\n const [initialOpen] = useState(defaultOpen)\n const open = openProp ?? initialOpen\n\n return (\n <div\n ref={ref}\n data-state={open ? \"open\" : \"closed\"}\n className={clsx(s.Group, className)}\n {...cleanProps(props)}\n />\n )\n },\n)\nSidebarGroup.displayName = \"SidebarGroup\"\n\nexport type SidebarGroupLabelProps = ComponentProps<\"span\"> & {\n asChild?: boolean\n /**\n * Size variant for the label.\n * - \"sm\": Compact style for dashboard/settings sidebars\n * - \"lg\": Documentation style with larger text and more spacing\n * @default \"lg\"\n */\n size?: \"sm\" | \"lg\"\n}\n\nexport const SidebarGroupLabel = forwardRef<HTMLSpanElement, SidebarGroupLabelProps>(\n ({ asChild = false, size = \"lg\", className, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : \"span\"\n return (\n <Comp\n ref={ref}\n data-size={size}\n className={clsx(s.GroupLabel, className)}\n {...cleanProps(props)}\n />\n )\n },\n)\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\"\n\nexport type SidebarGroupActionProps = ComponentProps<\"div\">\n\nexport const SidebarGroupAction = forwardRef<HTMLDivElement, SidebarGroupActionProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.GroupAction, className)} {...cleanProps(props)} />\n ),\n)\nSidebarGroupAction.displayName = \"SidebarGroupAction\"\n\nexport type SidebarGroupContentProps = ComponentProps<\"div\">\n\nexport const SidebarGroupContent = forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.GroupContent, className)} {...cleanProps(props)} />\n ),\n)\nSidebarGroupContent.displayName = \"SidebarGroupContent\"\n\n// =============================================\n// Menu\n// =============================================\n\nexport type SidebarMenuProps = ComponentProps<\"ul\">\n\nexport const SidebarMenu = forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={clsx(s.Menu, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenu.displayName = \"SidebarMenu\"\n\nexport type SidebarMenuItemProps = ComponentProps<\"li\"> & {\n expanded?: boolean\n}\n\nexport const SidebarMenuItem = forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ expanded, className, ...props }, ref) => (\n <li\n ref={ref}\n data-expanded={expanded ? \"true\" : undefined}\n className={clsx(s.MenuItem, className)}\n {...cleanProps(props)}\n />\n ),\n)\nSidebarMenuItem.displayName = \"SidebarMenuItem\"\n\n// =============================================\n// Menu Button\n// =============================================\n\nexport type SidebarMenuButtonProps = ComponentProps<\"button\"> & {\n /**\n * Whether the button is in an active/highlighted state.\n * @default false\n */\n isActive?: boolean\n /**\n * Optional tooltip to show when the sidebar is collapsed.\n */\n tooltip?: string | ReactNode\n /**\n * Whether to render the button as a custom element via Slot.\n * @default false\n */\n asChild?: boolean\n}\n\nexport const SidebarMenuButton = forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n ({ isActive = false, tooltip, asChild = false, className, children, ...props }, ref) => {\n const { state, isMobile } = useSidebar()\n const Comp = asChild ? Slot.Root : \"button\"\n // With asChild the child element is the button, so the inner wrapper\n // goes inside it. Wrapping the child instead would make Slot merge the\n // button props onto the wrapper span.\n const content =\n asChild && isValidElement<{ children?: ReactNode }>(children) ? (\n cloneElement(\n children,\n undefined,\n <span className={s.MenuButtonInner}>{children.props.children}</span>,\n )\n ) : (\n <span className={s.MenuButtonInner}>{children}</span>\n )\n\n const button = (\n <Comp\n ref={ref}\n data-active={isActive ? \"true\" : \"false\"}\n aria-current={isActive ? \"page\" : undefined}\n className={clsx(s.MenuButton, className)}\n {...cleanProps(props)}\n >\n {content}\n </Comp>\n )\n\n // Show tooltip when collapsed (icon mode) and not mobile\n if (tooltip && state === \"collapsed\" && !isMobile) {\n return (\n <Tooltip content={tooltip} side=\"right\">\n {button}\n </Tooltip>\n )\n }\n\n return button\n },\n)\nSidebarMenuButton.displayName = \"SidebarMenuButton\"\n\n// =============================================\n// Menu Button Parts\n// =============================================\n\nexport type SidebarMenuButtonIconProps = ComponentProps<\"span\">\n\nexport const SidebarMenuButtonIcon = forwardRef<HTMLSpanElement, SidebarMenuButtonIconProps>(\n ({ className, ...props }, ref) => (\n <span ref={ref} className={clsx(s.MenuButtonIcon, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuButtonIcon.displayName = \"SidebarMenuButtonIcon\"\n\nexport type SidebarMenuButtonLabelProps = ComponentProps<\"span\"> & {\n shortLabel?: string\n}\n\nexport const SidebarMenuButtonLabel = forwardRef<HTMLSpanElement, SidebarMenuButtonLabelProps>(\n ({ shortLabel, className, children, ...props }, ref) => (\n <>\n <span\n ref={ref}\n data-long-label=\"true\"\n className={clsx(s.MenuButtonLabel, className)}\n {...cleanProps(props)}\n >\n {children}\n </span>\n {shortLabel && (\n <span data-short-label=\"true\" className={clsx(s.MenuButtonLabel, className)}>\n {shortLabel}\n </span>\n )}\n </>\n ),\n)\nSidebarMenuButtonLabel.displayName = \"SidebarMenuButtonLabel\"\n\n// =============================================\n// Menu Chevron (Expand/Collapse Toggle)\n// =============================================\n\nexport type SidebarMenuChevronProps = ComponentProps<\"span\">\n\nexport const SidebarMenuChevron = forwardRef<HTMLSpanElement, SidebarMenuChevronProps>(\n ({ className, ...props }, ref) => (\n <span ref={ref} className={clsx(s.MenuChevron, className)} {...cleanProps(props)}>\n <ChevronRightMd />\n </span>\n ),\n)\nSidebarMenuChevron.displayName = \"SidebarMenuChevron\"\n\n// =============================================\n// Menu Badge & Action\n// =============================================\n\nexport type SidebarMenuBadgeProps = ComponentProps<\"span\">\n\nexport const SidebarMenuBadge = forwardRef<HTMLSpanElement, SidebarMenuBadgeProps>(\n ({ className, ...props }, ref) => (\n <span ref={ref} className={clsx(s.MenuBadge, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\"\n\nexport type SidebarMenuActionProps = ComponentProps<\"div\">\n\nexport const SidebarMenuAction = forwardRef<HTMLDivElement, SidebarMenuActionProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.MenuAction, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuAction.displayName = \"SidebarMenuAction\"\n\n// =============================================\n// Menu Skeleton\n// =============================================\n\nexport type SidebarMenuSkeletonProps = ComponentProps<\"div\"> & {\n showIcon?: boolean\n /** Width of the label skeleton (e.g., \"60%\", \"80%\", \"100px\") */\n labelWidth?: string\n}\n\nexport const SidebarMenuSkeleton = forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>(\n ({ showIcon = true, labelWidth = \"60%\", className, ...props }, ref) => (\n <div\n ref={ref}\n data-skeleton\n className={clsx(s.MenuSkeleton, className)}\n {...cleanProps(props)}\n >\n {showIcon && <div className={s.MenuSkeletonIcon} />}\n <div className={s.MenuSkeletonLabel} style={{ width: labelWidth }} />\n </div>\n ),\n)\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\"\n\n// =============================================\n// Submenu\n// =============================================\n\nexport type SidebarMenuSubProps = ComponentProps<\"ul\"> & {\n open?: boolean\n /**\n * When true, child items align with parent text that has icons.\n * This adjusts the padding so level 2 text aligns with level 1 text.\n */\n hasIcons?: boolean\n}\n\nexport const SidebarMenuSub = forwardRef<HTMLUListElement, SidebarMenuSubProps>(\n ({ open = true, hasIcons = false, className, ...props }, ref) => (\n <ul\n ref={ref}\n data-state={open ? \"open\" : \"closed\"}\n data-has-icons={hasIcons ? \"true\" : undefined}\n // Collapsed items are only hidden visually: keep them out of the tab order\n inert={open ? undefined : true}\n className={clsx(s.MenuSub, className)}\n {...cleanProps(props)}\n />\n ),\n)\nSidebarMenuSub.displayName = \"SidebarMenuSub\"\n\nexport type SidebarMenuSubItemProps = ComponentProps<\"li\">\n\nexport const SidebarMenuSubItem = forwardRef<HTMLLIElement, SidebarMenuSubItemProps>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={clsx(s.MenuSubItem, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\"\n\nexport type SidebarMenuSubButtonProps = ComponentProps<\"button\"> & {\n isActive?: boolean\n asChild?: boolean\n /**\n * Indent level for nested items (0-3).\n * Each level adds 12px of left margin.\n * @default 0\n */\n indent?: 0 | 1 | 2 | 3\n}\n\nexport const SidebarMenuSubButton = forwardRef<HTMLButtonElement, SidebarMenuSubButtonProps>(\n ({ isActive = false, asChild = false, indent = 0, className, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : \"button\"\n return (\n <Comp\n ref={ref}\n data-active={isActive ? \"true\" : \"false\"}\n aria-current={isActive ? \"page\" : undefined}\n className={clsx(s.MenuSubButton, s[`indent${indent}`], className)}\n {...cleanProps(props)}\n />\n )\n },\n)\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\"\n\n// =============================================\n// Separator\n// =============================================\n\nexport type SidebarSeparatorProps = ComponentProps<\"hr\">\n\nexport const SidebarSeparator = forwardRef<HTMLHRElement, SidebarSeparatorProps>(\n ({ className, ...props }, ref) => (\n <hr ref={ref} className={clsx(s.Separator, className)} {...cleanProps(props)} />\n ),\n)\nSidebarSeparator.displayName = \"SidebarSeparator\"\n\n// =============================================\n// Card\n// =============================================\n\nexport type SidebarCardProps = ComponentProps<\"div\"> & {\n variant?: \"default\" | \"elevated\"\n dismissible?: boolean\n onDismiss?: () => void\n}\n\nexport const SidebarCard = forwardRef<HTMLDivElement, SidebarCardProps>(\n ({ variant = \"default\", dismissible = false, onDismiss, className, children, ...props }, ref) => (\n <div\n ref={ref}\n data-variant={variant}\n className={clsx(s.Card, className)}\n {...cleanProps(props)}\n >\n {dismissible && (\n <Button\n uniform\n size=\"3xs\"\n variant=\"ghost\"\n color=\"secondary\"\n className={s.CardDismiss}\n onClick={onDismiss}\n aria-label=\"Dismiss\"\n >\n <X />\n </Button>\n )}\n {children}\n </div>\n ),\n)\nSidebarCard.displayName = \"SidebarCard\"\n\nexport type SidebarCardHeaderProps = ComponentProps<\"div\">\n\nexport const SidebarCardHeader = forwardRef<HTMLDivElement, SidebarCardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardHeader, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardHeader.displayName = \"SidebarCardHeader\"\n\nexport type SidebarCardTitleProps = ComponentProps<\"div\">\n\nexport const SidebarCardTitle = forwardRef<HTMLDivElement, SidebarCardTitleProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardTitle, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardTitle.displayName = \"SidebarCardTitle\"\n\nexport type SidebarCardTitleLinkProps = ComponentProps<\"a\">\n\nexport const SidebarCardTitleLink = forwardRef<HTMLAnchorElement, SidebarCardTitleLinkProps>(\n ({ className, children, ...props }, ref) => (\n <a ref={ref} className={clsx(s.CardTitleLink, className)} {...cleanProps(props)}>\n {children}\n <ChevronRightMd className={s.CardTitleChevron} />\n </a>\n ),\n)\nSidebarCardTitleLink.displayName = \"SidebarCardTitleLink\"\n\nexport type SidebarCardContentProps = ComponentProps<\"div\">\n\nexport const SidebarCardContent = forwardRef<HTMLDivElement, SidebarCardContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardContent, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardContent.displayName = \"SidebarCardContent\"\n\nexport type SidebarCardFooterProps = ComponentProps<\"div\">\n\nexport const SidebarCardFooter = forwardRef<HTMLDivElement, SidebarCardFooterProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardFooter, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardFooter.displayName = \"SidebarCardFooter\"\n\n// =============================================\n// Inset (Main Content Area)\n// =============================================\n\nexport type SidebarInsetProps = ComponentProps<\"main\">\n\nexport const SidebarInset = forwardRef<HTMLElement, SidebarInsetProps>(\n ({ className, ...props }, ref) => (\n <main ref={ref} className={clsx(s.Inset, className)} {...cleanProps(props)} />\n ),\n)\nSidebarInset.displayName = \"SidebarInset\"\n\n// =============================================\n// Layout Container\n// =============================================\n\nexport type SidebarLayoutProps = ComponentProps<\"div\">\n\nexport const SidebarLayout = forwardRef<HTMLDivElement, SidebarLayoutProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.SidebarLayout, className)} {...cleanProps(props)} />\n ),\n)\nSidebarLayout.displayName = \"SidebarLayout\"\n\n// =============================================\n// Trigger (Collapse Button)\n// =============================================\n\nexport type SidebarTriggerProps = ComponentProps<\"button\"> & {\n children?: ReactNode\n}\n\nexport const SidebarTrigger = forwardRef<HTMLButtonElement, SidebarTriggerProps>(\n ({ className, children, onClick, ...props }, ref) => {\n const { state, collapsible, isMobile, toggleSidebar } = useSidebar()\n\n // Don't render if collapsible=\"none\" (text-only sidebars)\n if (collapsible === \"none\") {\n return null\n }\n\n // Default icon (same for both states, as per reference)\n const defaultIcon = <SidebarLeft />\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(s.Trigger, className)}\n onClick={(event) => {\n // The caller's handler runs first and can cancel the toggle\n onClick?.(event)\n if (!event.defaultPrevented) toggleSidebar()\n }}\n aria-label={\n isMobile ? \"Open menu\" : state === \"expanded\" ? \"Collapse sidebar\" : \"Expand sidebar\"\n }\n {...cleanProps(props)}\n >\n <span className={s.TriggerInner}>\n <span className={s.TriggerIcon}>{children ?? defaultIcon}</span>\n </span>\n </button>\n )\n },\n)\nSidebarTrigger.displayName = \"SidebarTrigger\"\n\n// =============================================\n// Mobile Menu Button (Hamburger → X)\n// =============================================\n\nexport type SidebarMobileMenuButtonProps = ComponentProps<\"button\">\n\nexport const SidebarMobileMenuButton = forwardRef<HTMLButtonElement, SidebarMobileMenuButtonProps>(\n ({ className, onClick, ...props }, ref) => {\n const { openMobile, setOpenMobile } = useSidebar()\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-expanded={openMobile ? \"\" : undefined}\n className={clsx(s.MobileMenuButton, className)}\n onClick={(event) => {\n // The caller's handler runs first and can cancel the toggle\n onClick?.(event)\n if (!event.defaultPrevented) setOpenMobile(!openMobile)\n }}\n aria-label={openMobile ? \"Close menu\" : \"Open menu\"}\n {...cleanProps(props)}\n >\n <span className={s.MobileMenuIcon}>\n <span className={s.MobileMenuLine} data-top />\n <span className={s.MobileMenuMiddle}>\n <span className={s.MobileMenuLine} data-bottom />\n </span>\n </span>\n </button>\n )\n },\n)\nSidebarMobileMenuButton.displayName = \"SidebarMobileMenuButton\"\n\n// =============================================\n// Mobile Sidebar\n// =============================================\n\nexport type SidebarMobileProps = ComponentProps<\"div\"> & {\n /** When true, drawer is positioned absolute instead of fixed (for contained demos) */\n contained?: boolean\n}\n\nexport const SidebarMobile = forwardRef<HTMLDivElement, SidebarMobileProps>(\n ({ className, children, contained, ...props }, ref) => {\n const { setOpenMobile } = useSidebar()\n\n return (\n <>\n {/* Backdrop */}\n <div\n className={clsx(s.MobileBackdrop, contained && s.contained)}\n onClick={() => setOpenMobile(false)}\n aria-hidden=\"true\"\n />\n\n {/* Drawer */}\n <div\n ref={ref}\n className={clsx(s.MobileSidebar, contained && s.contained, className)}\n {...cleanProps(props)}\n >\n {children}\n </div>\n </>\n )\n },\n)\nSidebarMobile.displayName = \"SidebarMobile\"\n\nexport type SidebarMobileHeaderProps = ComponentProps<\"div\">\n\nexport const SidebarMobileHeader = forwardRef<HTMLDivElement, SidebarMobileHeaderProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.MobileHeader, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMobileHeader.displayName = \"SidebarMobileHeader\"\n\nexport type SidebarMobileFooterProps = ComponentProps<\"div\">\n\nexport const SidebarMobileFooter = forwardRef<HTMLDivElement, SidebarMobileFooterProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.MobileFooter, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMobileFooter.displayName = \"SidebarMobileFooter\"\n\n// =============================================\n// Input (Search)\n// =============================================\n\nexport type SidebarInputProps = InputProps\n\nexport const SidebarInput = forwardRef<HTMLInputElement, SidebarInputProps>(\n ({ className, ...props }, ref) => (\n <div className={s.Input}>\n <Input\n ref={ref}\n className={className}\n startAdornment={<SearchIcon />}\n {...cleanProps(props)}\n />\n </div>\n ),\n)\nSidebarInput.displayName = \"SidebarInput\"\n\n// =============================================\n// Footer Links\n// =============================================\n\nexport type SidebarFooterLinksProps = ComponentProps<\"div\">\n\nexport const SidebarFooterLinks = forwardRef<HTMLDivElement, SidebarFooterLinksProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.FooterLinks, className)} {...cleanProps(props)} />\n ),\n)\nSidebarFooterLinks.displayName = \"SidebarFooterLinks\"\n"]}
1
+ {"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,QAAQ,GAIT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,UAAU,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,SAAS,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAmB,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,CAAC,MAAM,sDAAsD,CAAA;AACpE,OAAO,EACL,eAAe,EACf,UAAU,GAKX,MAAM,qBAAqB,CAAA;AAE5B,wFAAwF;AACxF,MAAM,UAAU,GAAG,CAAmB,KAAQ,EAA0B,EAAE;IACxE,MAAM,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,KAAwC,CAAA;IAC9E,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,8BAA8B;AAC9B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,CAAA;AAoBtC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAC/B,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC7E,MAAM,EA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,CAAC,WAAW,GAAG,qBAAqB,CAAA;AAIvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAC3C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,KAAM,UAAU,CAAC,KAAK,CAAC,GAAI,CACrF,CACF,CAAA;AACD,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA;AAQvD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cAAK,SAAS,EAAE,CAAC,CAAC,KAAK,YACrB,KAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,KAAC,UAAU,KAAG,KAC1B,UAAU,CAAC,KAAK,CAAC,GACrB,GACE,CACP,CACF,CAAA;AACD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAQzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAC1C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,UAAU,CAAC,KAAK,CAAC,GAAI,CACpF,CACF,CAAA;AACD,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA","sourcesContent":["\"use client\"\n\n/**\n * Sidebar Component - Composable navigation sidebar\n *\n * API SPECIFICATION:\n *\n * SidebarProvider\n * - defaultOpen?: boolean (default: true)\n * - open?: boolean (controlled)\n * - onOpenChange?: (open: boolean) => void\n * - collapsible?: \"offcanvas\" | \"icon\" | \"none\" (default: \"offcanvas\")\n *\n * Sidebar\n * - side?: \"left\" | \"right\" (default: \"left\")\n * - variant?: \"sidebar\" | \"docs\" (default: \"sidebar\")\n *\n * SidebarHeader / SidebarContent / SidebarFooter\n * - Standard container props\n *\n * SidebarGroup\n * - defaultOpen?: boolean (default: true)\n * - open?: boolean (controlled)\n *\n * SidebarGroupLabel / SidebarGroupAction / SidebarGroupContent\n * - Standard container props\n *\n * SidebarMenu / SidebarMenuItem\n * - Standard container props\n *\n * SidebarMenuButton\n * - isActive?: boolean (default: false)\n * - size?: \"sm\" | \"md\" | \"lg\" (default: \"md\")\n * - tooltip?: string | ReactNode\n * - asChild?: boolean\n *\n * SidebarMenuAction / SidebarMenuBadge\n * - Standard container props\n *\n * SidebarMenuSkeleton\n * - showIcon?: boolean (default: true)\n *\n * SidebarMenuSub / SidebarMenuSubItem / SidebarMenuSubButton\n * - Same as parent menu components\n *\n * SidebarSeparator\n * - Standard separator props\n *\n * SidebarCard / SidebarCardHeader / SidebarCardContent / SidebarCardFooter\n * - variant?: \"default\" | \"elevated\"\n * - dismissible?: boolean\n * - onDismiss?: () => void\n *\n * SidebarInset\n * - Standard container for main content area\n *\n * SidebarTrigger\n * - Uses Button component internally\n * - Returns null when collapsible=\"none\"\n *\n * SidebarMobileMenuButton\n * - Hamburger → X animated icon button for mobile\n *\n * SidebarInput\n * - shortcut?: string (keyboard shortcut display)\n */\n\nimport clsx from \"clsx\"\nimport { Slot } from \"radix-ui\"\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useLayoutEffect,\n useState,\n type ComponentProps,\n type PointerEvent,\n type ReactNode,\n} from \"react\"\n\nimport { Button } from \"../Button\"\nimport { ChevronRightMd, Search as SearchIcon, SidebarLeft, X } from \"../Icon\"\nimport { Input, type InputProps } from \"../Input\"\nimport { Tooltip } from \"../Tooltip\"\nimport s from \"@plexui/styles/components/Sidebar/Sidebar.module.css\"\nimport {\n SidebarProvider,\n useSidebar,\n type SidebarCollapsible,\n type SidebarSide,\n type SidebarProviderVariant,\n type SidebarVariant,\n} from \"./useSidebarContext\"\n\n// Helper to filter out props that shouldn't be spread to the DOM (e.g. injected by MDX)\nconst cleanProps = <P extends object>(props: P): Omit<P, \"data-toggle\"> => {\n const { \"data-toggle\": _, ...rest } = props as P & { \"data-toggle\"?: unknown }\n return rest\n}\n\n// Re-export provider and hook\nexport { SidebarProvider, useSidebar }\nexport type { SidebarCollapsible, SidebarProviderVariant, SidebarSide, SidebarVariant }\n\n// =============================================\n// Sidebar Root\n// =============================================\n\nexport type SidebarProps = ComponentProps<\"aside\"> & {\n /**\n * The side the sidebar is on.\n * @default \"left\"\n */\n side?: SidebarSide\n /**\n * The visual variant of the sidebar.\n * @default \"sidebar\"\n */\n variant?: SidebarVariant\n}\n\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(\n ({ side = \"left\", variant = \"sidebar\", className, children, ...props }, ref) => {\n const { collapsible, isMobile } = useSidebar()\n\n // Skip rendering sidebar on mobile for offcanvas mode\n if (isMobile && collapsible === \"offcanvas\") {\n return null\n }\n\n return (\n <aside\n ref={ref}\n data-side={side}\n data-variant={variant}\n className={clsx(s.Sidebar, className)}\n {...cleanProps(props)}\n >\n {children}\n </aside>\n )\n },\n)\nSidebar.displayName = \"Sidebar\"\n\n// =============================================\n// Sidebar Sections\n// =============================================\n\nexport type SidebarHeaderProps = ComponentProps<\"div\">\n\nexport const SidebarHeader = forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.Header, className)} {...cleanProps(props)} />\n ),\n)\nSidebarHeader.displayName = \"SidebarHeader\"\n\nexport type SidebarContentProps = ComponentProps<\"div\">\n\nexport const SidebarContent = forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, ...props }, ref) => {\n const [contentEl, setContentEl] = useState<HTMLDivElement | null>(null)\n const setRef = useCallback(\n (el: HTMLDivElement | null) => {\n setContentEl(el)\n if (typeof ref === \"function\") ref(el)\n else if (ref) (ref as { current: HTMLDivElement | null }).current = el\n },\n [ref],\n )\n\n useLayoutEffect(() => {\n if (!contentEl) return\n const sidebar = contentEl.parentElement\n if (!sidebar) return\n\n const update = () => {\n const hasOverflow = contentEl.scrollHeight > contentEl.clientHeight\n sidebar.setAttribute(\"data-content-scrollable\", hasOverflow ? \"true\" : \"false\")\n }\n update()\n const ro = new ResizeObserver(update)\n ro.observe(contentEl)\n return () => ro.disconnect()\n }, [contentEl])\n\n return <div ref={setRef} className={clsx(s.Content, className)} {...cleanProps(props)} />\n },\n)\nSidebarContent.displayName = \"SidebarContent\"\n\nexport type SidebarFooterProps = ComponentProps<\"div\">\n\nexport const SidebarFooter = forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={clsx(s.Footer, className)} {...cleanProps(props)}>\n <div className={s.FooterSeparator} />\n {children}\n </div>\n ),\n)\nSidebarFooter.displayName = \"SidebarFooter\"\n\nexport type SidebarRailProps = ComponentProps<\"div\">\n\nexport const SidebarRail = forwardRef<HTMLDivElement, SidebarRailProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.Rail, className)} {...cleanProps(props)} />\n ),\n)\nSidebarRail.displayName = \"SidebarRail\"\n\n// =============================================\n// Groups\n// =============================================\n\nexport type SidebarGroupProps = ComponentProps<\"div\"> & {\n /**\n * Whether the group is open initially. A closed group hides its `SidebarGroupContent`.\n * @default true\n */\n defaultOpen?: boolean\n /**\n * Controlled open state. The group has no toggle of its own: change `open` from your own control.\n */\n open?: boolean\n}\n\nexport const SidebarGroup = forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ defaultOpen = true, open: openProp, className, ...props }, ref) => {\n // The initial value only, like an uncontrolled input's defaultValue\n const [initialOpen] = useState(defaultOpen)\n const open = openProp ?? initialOpen\n\n return (\n <div\n ref={ref}\n data-state={open ? \"open\" : \"closed\"}\n className={clsx(s.Group, className)}\n {...cleanProps(props)}\n />\n )\n },\n)\nSidebarGroup.displayName = \"SidebarGroup\"\n\nexport type SidebarGroupLabelProps = ComponentProps<\"span\"> & {\n asChild?: boolean\n /**\n * Size variant for the label.\n * - \"sm\": Compact style for dashboard/settings sidebars\n * - \"lg\": Documentation style with larger text and more spacing\n * @default \"lg\"\n */\n size?: \"sm\" | \"lg\"\n}\n\nexport const SidebarGroupLabel = forwardRef<HTMLSpanElement, SidebarGroupLabelProps>(\n ({ asChild = false, size = \"lg\", className, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : \"span\"\n return (\n <Comp\n ref={ref}\n data-size={size}\n className={clsx(s.GroupLabel, className)}\n {...cleanProps(props)}\n />\n )\n },\n)\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\"\n\nexport type SidebarGroupActionProps = ComponentProps<\"div\">\n\nexport const SidebarGroupAction = forwardRef<HTMLDivElement, SidebarGroupActionProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.GroupAction, className)} {...cleanProps(props)} />\n ),\n)\nSidebarGroupAction.displayName = \"SidebarGroupAction\"\n\nexport type SidebarGroupContentProps = ComponentProps<\"div\">\n\nexport const SidebarGroupContent = forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.GroupContent, className)} {...cleanProps(props)} />\n ),\n)\nSidebarGroupContent.displayName = \"SidebarGroupContent\"\n\n// =============================================\n// Menu\n// =============================================\n\nexport type SidebarMenuProps = ComponentProps<\"ul\">\n\nexport const SidebarMenu = forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={clsx(s.Menu, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenu.displayName = \"SidebarMenu\"\n\nexport type SidebarMenuItemProps = ComponentProps<\"li\"> & {\n expanded?: boolean\n}\n\nexport const SidebarMenuItem = forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ expanded, className, ...props }, ref) => (\n <li\n ref={ref}\n data-expanded={expanded ? \"true\" : undefined}\n className={clsx(s.MenuItem, className)}\n {...cleanProps(props)}\n />\n ),\n)\nSidebarMenuItem.displayName = \"SidebarMenuItem\"\n\n// =============================================\n// Menu Button\n// =============================================\n\nexport type SidebarMenuButtonProps = ComponentProps<\"button\"> & {\n /**\n * Whether the button is in an active/highlighted state.\n * @default false\n */\n isActive?: boolean\n /**\n * Optional tooltip to show when the sidebar is collapsed.\n */\n tooltip?: string | ReactNode\n /**\n * Whether to render the button as a custom element via Slot.\n * @default false\n */\n asChild?: boolean\n}\n\n// Shared by every row of the rail: moving to the next one shows its label at once.\nlet railLeftAt = 0\n\nexport const SidebarMenuButton = forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n ({ isActive = false, tooltip, asChild = false, className, children, onPointerEnter, onPointerLeave, ...props }, ref) => {\n const { state, isMobile } = useSidebar()\n const [openDelay, setOpenDelay] = useState<number>()\n const Comp = asChild ? Slot.Root : \"button\"\n // With asChild the child element is the button, so the inner wrapper\n // goes inside it. Wrapping the child instead would make Slot merge the\n // button props onto the wrapper span.\n const content =\n asChild && isValidElement<{ children?: ReactNode }>(children) ? (\n cloneElement(\n children,\n undefined,\n <span className={s.MenuButtonInner}>{children.props.children}</span>,\n )\n ) : (\n <span className={s.MenuButtonInner}>{children}</span>\n )\n\n const button = (\n <Comp\n ref={ref}\n data-active={isActive ? \"true\" : \"false\"}\n aria-current={isActive ? \"page\" : undefined}\n className={clsx(s.MenuButton, className)}\n onPointerEnter={(event: PointerEvent<HTMLButtonElement>) => {\n onPointerEnter?.(event)\n if (tooltip) setOpenDelay(Date.now() - railLeftAt < 300 ? 0 : undefined)\n }}\n onPointerLeave={(event: PointerEvent<HTMLButtonElement>) => {\n onPointerLeave?.(event)\n if (tooltip) railLeftAt = Date.now()\n }}\n {...cleanProps(props)}\n >\n {content}\n </Comp>\n )\n\n // The tooltip shows when collapsed (icon mode) and not on mobile. It wraps\n // the row in every state, so the row stays mounted and its label can fade.\n if (tooltip) {\n return (\n <Tooltip content={state === \"collapsed\" && !isMobile ? tooltip : null} openDelay={openDelay} side=\"right\">\n {button}\n </Tooltip>\n )\n }\n\n return button\n },\n)\nSidebarMenuButton.displayName = \"SidebarMenuButton\"\n\n// =============================================\n// Menu Button Parts\n// =============================================\n\nexport type SidebarMenuButtonIconProps = ComponentProps<\"span\">\n\nexport const SidebarMenuButtonIcon = forwardRef<HTMLSpanElement, SidebarMenuButtonIconProps>(\n ({ className, ...props }, ref) => (\n <span ref={ref} className={clsx(s.MenuButtonIcon, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuButtonIcon.displayName = \"SidebarMenuButtonIcon\"\n\nexport type SidebarMenuButtonLabelProps = ComponentProps<\"span\"> & {\n shortLabel?: string\n}\n\nexport const SidebarMenuButtonLabel = forwardRef<HTMLSpanElement, SidebarMenuButtonLabelProps>(\n ({ shortLabel, className, children, ...props }, ref) => (\n <>\n <span\n ref={ref}\n data-long-label=\"true\"\n className={clsx(s.MenuButtonLabel, className)}\n {...cleanProps(props)}\n >\n {children}\n </span>\n {shortLabel && (\n <span data-short-label=\"true\" className={clsx(s.MenuButtonLabel, className)}>\n {shortLabel}\n </span>\n )}\n </>\n ),\n)\nSidebarMenuButtonLabel.displayName = \"SidebarMenuButtonLabel\"\n\n// =============================================\n// Menu Chevron (Expand/Collapse Toggle)\n// =============================================\n\nexport type SidebarMenuChevronProps = ComponentProps<\"span\">\n\nexport const SidebarMenuChevron = forwardRef<HTMLSpanElement, SidebarMenuChevronProps>(\n ({ className, ...props }, ref) => (\n <span ref={ref} className={clsx(s.MenuChevron, className)} {...cleanProps(props)}>\n <ChevronRightMd />\n </span>\n ),\n)\nSidebarMenuChevron.displayName = \"SidebarMenuChevron\"\n\n// =============================================\n// Menu Badge & Action\n// =============================================\n\nexport type SidebarMenuBadgeProps = ComponentProps<\"span\">\n\nexport const SidebarMenuBadge = forwardRef<HTMLSpanElement, SidebarMenuBadgeProps>(\n ({ className, ...props }, ref) => (\n <span ref={ref} className={clsx(s.MenuBadge, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\"\n\nexport type SidebarMenuActionProps = ComponentProps<\"div\">\n\nexport const SidebarMenuAction = forwardRef<HTMLDivElement, SidebarMenuActionProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.MenuAction, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuAction.displayName = \"SidebarMenuAction\"\n\n// =============================================\n// Menu Skeleton\n// =============================================\n\nexport type SidebarMenuSkeletonProps = ComponentProps<\"div\"> & {\n showIcon?: boolean\n /** Width of the label skeleton (e.g., \"60%\", \"80%\", \"100px\") */\n labelWidth?: string\n}\n\nexport const SidebarMenuSkeleton = forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>(\n ({ showIcon = true, labelWidth = \"60%\", className, ...props }, ref) => (\n <div\n ref={ref}\n data-skeleton\n className={clsx(s.MenuSkeleton, className)}\n {...cleanProps(props)}\n >\n {showIcon && <div className={s.MenuSkeletonIcon} />}\n <div className={s.MenuSkeletonLabel} style={{ width: labelWidth }} />\n </div>\n ),\n)\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\"\n\n// =============================================\n// Submenu\n// =============================================\n\nexport type SidebarMenuSubProps = ComponentProps<\"ul\"> & {\n open?: boolean\n /**\n * When true, child items align with parent text that has icons.\n * This adjusts the padding so level 2 text aligns with level 1 text.\n */\n hasIcons?: boolean\n}\n\nexport const SidebarMenuSub = forwardRef<HTMLUListElement, SidebarMenuSubProps>(\n ({ open = true, hasIcons = false, className, ...props }, ref) => (\n <ul\n ref={ref}\n data-state={open ? \"open\" : \"closed\"}\n data-has-icons={hasIcons ? \"true\" : undefined}\n // Collapsed items are only hidden visually: keep them out of the tab order\n inert={open ? undefined : true}\n className={clsx(s.MenuSub, className)}\n {...cleanProps(props)}\n />\n ),\n)\nSidebarMenuSub.displayName = \"SidebarMenuSub\"\n\nexport type SidebarMenuSubItemProps = ComponentProps<\"li\">\n\nexport const SidebarMenuSubItem = forwardRef<HTMLLIElement, SidebarMenuSubItemProps>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={clsx(s.MenuSubItem, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\"\n\nexport type SidebarMenuSubButtonProps = ComponentProps<\"button\"> & {\n isActive?: boolean\n asChild?: boolean\n /**\n * Indent level for nested items (0-3).\n * Each level adds 12px of left margin.\n * @default 0\n */\n indent?: 0 | 1 | 2 | 3\n}\n\nexport const SidebarMenuSubButton = forwardRef<HTMLButtonElement, SidebarMenuSubButtonProps>(\n ({ isActive = false, asChild = false, indent = 0, className, ...props }, ref) => {\n const Comp = asChild ? Slot.Root : \"button\"\n return (\n <Comp\n ref={ref}\n data-active={isActive ? \"true\" : \"false\"}\n aria-current={isActive ? \"page\" : undefined}\n className={clsx(s.MenuSubButton, s[`indent${indent}`], className)}\n {...cleanProps(props)}\n />\n )\n },\n)\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\"\n\n// =============================================\n// Separator\n// =============================================\n\nexport type SidebarSeparatorProps = ComponentProps<\"hr\">\n\nexport const SidebarSeparator = forwardRef<HTMLHRElement, SidebarSeparatorProps>(\n ({ className, ...props }, ref) => (\n <hr ref={ref} className={clsx(s.Separator, className)} {...cleanProps(props)} />\n ),\n)\nSidebarSeparator.displayName = \"SidebarSeparator\"\n\n// =============================================\n// Card\n// =============================================\n\nexport type SidebarCardProps = ComponentProps<\"div\"> & {\n variant?: \"default\" | \"elevated\"\n dismissible?: boolean\n onDismiss?: () => void\n}\n\nexport const SidebarCard = forwardRef<HTMLDivElement, SidebarCardProps>(\n ({ variant = \"default\", dismissible = false, onDismiss, className, children, ...props }, ref) => (\n <div\n ref={ref}\n data-variant={variant}\n className={clsx(s.Card, className)}\n {...cleanProps(props)}\n >\n {dismissible && (\n <Button\n uniform\n size=\"3xs\"\n variant=\"ghost\"\n color=\"secondary\"\n className={s.CardDismiss}\n onClick={onDismiss}\n aria-label=\"Dismiss\"\n >\n <X />\n </Button>\n )}\n {children}\n </div>\n ),\n)\nSidebarCard.displayName = \"SidebarCard\"\n\nexport type SidebarCardHeaderProps = ComponentProps<\"div\">\n\nexport const SidebarCardHeader = forwardRef<HTMLDivElement, SidebarCardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardHeader, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardHeader.displayName = \"SidebarCardHeader\"\n\nexport type SidebarCardTitleProps = ComponentProps<\"div\">\n\nexport const SidebarCardTitle = forwardRef<HTMLDivElement, SidebarCardTitleProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardTitle, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardTitle.displayName = \"SidebarCardTitle\"\n\nexport type SidebarCardTitleLinkProps = ComponentProps<\"a\">\n\nexport const SidebarCardTitleLink = forwardRef<HTMLAnchorElement, SidebarCardTitleLinkProps>(\n ({ className, children, ...props }, ref) => (\n <a ref={ref} className={clsx(s.CardTitleLink, className)} {...cleanProps(props)}>\n {children}\n <ChevronRightMd className={s.CardTitleChevron} />\n </a>\n ),\n)\nSidebarCardTitleLink.displayName = \"SidebarCardTitleLink\"\n\nexport type SidebarCardContentProps = ComponentProps<\"div\">\n\nexport const SidebarCardContent = forwardRef<HTMLDivElement, SidebarCardContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardContent, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardContent.displayName = \"SidebarCardContent\"\n\nexport type SidebarCardFooterProps = ComponentProps<\"div\">\n\nexport const SidebarCardFooter = forwardRef<HTMLDivElement, SidebarCardFooterProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.CardFooter, className)} {...cleanProps(props)} />\n ),\n)\nSidebarCardFooter.displayName = \"SidebarCardFooter\"\n\n// =============================================\n// Inset (Main Content Area)\n// =============================================\n\nexport type SidebarInsetProps = ComponentProps<\"main\">\n\nexport const SidebarInset = forwardRef<HTMLElement, SidebarInsetProps>(\n ({ className, ...props }, ref) => (\n <main ref={ref} className={clsx(s.Inset, className)} {...cleanProps(props)} />\n ),\n)\nSidebarInset.displayName = \"SidebarInset\"\n\n// =============================================\n// Layout Container\n// =============================================\n\nexport type SidebarLayoutProps = ComponentProps<\"div\">\n\nexport const SidebarLayout = forwardRef<HTMLDivElement, SidebarLayoutProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.SidebarLayout, className)} {...cleanProps(props)} />\n ),\n)\nSidebarLayout.displayName = \"SidebarLayout\"\n\n// =============================================\n// Trigger (Collapse Button)\n// =============================================\n\nexport type SidebarTriggerProps = ComponentProps<\"button\"> & {\n children?: ReactNode\n}\n\nexport const SidebarTrigger = forwardRef<HTMLButtonElement, SidebarTriggerProps>(\n ({ className, children, onClick, ...props }, ref) => {\n const { state, collapsible, isMobile, toggleSidebar } = useSidebar()\n\n // Don't render if collapsible=\"none\" (text-only sidebars)\n if (collapsible === \"none\") {\n return null\n }\n\n // Default icon (same for both states, as per reference)\n const defaultIcon = <SidebarLeft />\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(s.Trigger, className)}\n onClick={(event) => {\n // The caller's handler runs first and can cancel the toggle\n onClick?.(event)\n if (!event.defaultPrevented) toggleSidebar()\n }}\n aria-label={\n isMobile ? \"Open menu\" : state === \"expanded\" ? \"Collapse sidebar\" : \"Expand sidebar\"\n }\n {...cleanProps(props)}\n >\n <span className={s.TriggerInner}>\n <span className={s.TriggerIcon}>{children ?? defaultIcon}</span>\n </span>\n </button>\n )\n },\n)\nSidebarTrigger.displayName = \"SidebarTrigger\"\n\n// =============================================\n// Mobile Menu Button (Hamburger → X)\n// =============================================\n\nexport type SidebarMobileMenuButtonProps = ComponentProps<\"button\">\n\nexport const SidebarMobileMenuButton = forwardRef<HTMLButtonElement, SidebarMobileMenuButtonProps>(\n ({ className, onClick, ...props }, ref) => {\n const { openMobile, setOpenMobile } = useSidebar()\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-expanded={openMobile ? \"\" : undefined}\n className={clsx(s.MobileMenuButton, className)}\n onClick={(event) => {\n // The caller's handler runs first and can cancel the toggle\n onClick?.(event)\n if (!event.defaultPrevented) setOpenMobile(!openMobile)\n }}\n aria-label={openMobile ? \"Close menu\" : \"Open menu\"}\n {...cleanProps(props)}\n >\n <span className={s.MobileMenuIcon}>\n <span className={s.MobileMenuLine} data-top />\n <span className={s.MobileMenuMiddle}>\n <span className={s.MobileMenuLine} data-bottom />\n </span>\n </span>\n </button>\n )\n },\n)\nSidebarMobileMenuButton.displayName = \"SidebarMobileMenuButton\"\n\n// =============================================\n// Mobile Sidebar\n// =============================================\n\nexport type SidebarMobileProps = ComponentProps<\"div\"> & {\n /** When true, drawer is positioned absolute instead of fixed (for contained demos) */\n contained?: boolean\n}\n\nexport const SidebarMobile = forwardRef<HTMLDivElement, SidebarMobileProps>(\n ({ className, children, contained, ...props }, ref) => {\n const { setOpenMobile } = useSidebar()\n\n return (\n <>\n {/* Backdrop */}\n <div\n className={clsx(s.MobileBackdrop, contained && s.contained)}\n onClick={() => setOpenMobile(false)}\n aria-hidden=\"true\"\n />\n\n {/* Drawer */}\n <div\n ref={ref}\n className={clsx(s.MobileSidebar, contained && s.contained, className)}\n {...cleanProps(props)}\n >\n {children}\n </div>\n </>\n )\n },\n)\nSidebarMobile.displayName = \"SidebarMobile\"\n\nexport type SidebarMobileHeaderProps = ComponentProps<\"div\">\n\nexport const SidebarMobileHeader = forwardRef<HTMLDivElement, SidebarMobileHeaderProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.MobileHeader, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMobileHeader.displayName = \"SidebarMobileHeader\"\n\nexport type SidebarMobileFooterProps = ComponentProps<\"div\">\n\nexport const SidebarMobileFooter = forwardRef<HTMLDivElement, SidebarMobileFooterProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.MobileFooter, className)} {...cleanProps(props)} />\n ),\n)\nSidebarMobileFooter.displayName = \"SidebarMobileFooter\"\n\n// =============================================\n// Input (Search)\n// =============================================\n\nexport type SidebarInputProps = InputProps\n\nexport const SidebarInput = forwardRef<HTMLInputElement, SidebarInputProps>(\n ({ className, ...props }, ref) => (\n <div className={s.Input}>\n <Input\n ref={ref}\n className={className}\n startAdornment={<SearchIcon />}\n {...cleanProps(props)}\n />\n </div>\n ),\n)\nSidebarInput.displayName = \"SidebarInput\"\n\n// =============================================\n// Footer Links\n// =============================================\n\nexport type SidebarFooterLinksProps = ComponentProps<\"div\">\n\nexport const SidebarFooterLinks = forwardRef<HTMLDivElement, SidebarFooterLinksProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={clsx(s.FooterLinks, className)} {...cleanProps(props)} />\n ),\n)\nSidebarFooterLinks.displayName = \"SidebarFooterLinks\"\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sidebar/index.tsx"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,qEAAqE;AAErE,OAAO;AACL,OAAO;AACP,OAAO;AACP,OAAO;AACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa;AACb,eAAe;AACf,kBAAkB;AAClB,SAAS;AACT,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB;AACjB,WAAW;AACX,aAAa;AACb,QAAQ;AACR,YAAY,EACZ,YAAY,EACZ,aAAa;AACb,OAAO;AACP,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,mBAAmB;AACnB,UAAU;AACV,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,mBAAmB;AACnB,SAAS;AACT,uBAAuB;AACvB,oBAAoB;AACpB,eAAe,EACf,WAAW;AACX,YAAY;AACZ,gBAAgB;AAChB,UAAU;AACV,cAAc,EACd,UAAU,GACX,MAAM,WAAW,CAAA;AAmDlB,mBAAmB;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA","sourcesContent":["// Sidebar Component - Composable navigation sidebar\n// Re-export all components from Sidebar.tsx and useSidebarContext.ts\n\nexport {\n // Core\n Sidebar,\n // Card\n SidebarCard,\n SidebarCardContent,\n SidebarCardFooter,\n SidebarCardHeader,\n SidebarCardTitle,\n SidebarCardTitleLink,\n SidebarContent,\n SidebarFooter,\n // Footer Links\n SidebarFooterLinks,\n // Groups\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n // Sections\n SidebarHeader,\n // Input\n SidebarInput,\n SidebarInset,\n SidebarLayout,\n // Menu\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuButtonIcon,\n SidebarMenuButtonLabel,\n SidebarMenuChevron,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n // Submenu\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarMobile,\n SidebarMobileFooter,\n SidebarMobileHeader,\n // Mobile\n SidebarMobileMenuButton,\n // Provider and Hook\n SidebarProvider,\n SidebarRail,\n // Separator\n SidebarSeparator,\n // Trigger\n SidebarTrigger,\n useSidebar,\n} from \"./Sidebar\"\n\n// Export types\nexport type {\n SidebarCardContentProps,\n SidebarCardFooterProps,\n SidebarCardHeaderProps,\n SidebarCardProps,\n SidebarCardTitleLinkProps,\n SidebarCardTitleProps,\n // Context types\n SidebarCollapsible,\n SidebarContentProps,\n SidebarFooterLinksProps,\n SidebarFooterProps,\n SidebarGroupActionProps,\n SidebarGroupContentProps,\n SidebarGroupLabelProps,\n SidebarGroupProps,\n SidebarHeaderProps,\n SidebarInputProps,\n SidebarInsetProps,\n SidebarLayoutProps,\n SidebarMenuActionProps,\n SidebarMenuBadgeProps,\n SidebarMenuButtonIconProps,\n SidebarMenuButtonLabelProps,\n SidebarMenuButtonProps,\n SidebarMenuChevronProps,\n SidebarMenuItemProps,\n SidebarMenuProps,\n SidebarMenuSkeletonProps,\n SidebarMenuSubButtonProps,\n SidebarMenuSubItemProps,\n SidebarMenuSubProps,\n SidebarMobileFooterProps,\n SidebarMobileHeaderProps,\n SidebarMobileMenuButtonProps,\n SidebarMobileProps,\n // Component props\n SidebarProps,\n SidebarRailProps,\n SidebarSeparatorProps,\n SidebarSide,\n SidebarTriggerProps,\n SidebarVariant,\n} from \"./Sidebar\"\n\n// Export provider props and context types\nexport type { SidebarContextValue, SidebarProviderProps, SidebarState } from \"./useSidebarContext\"\n\n// Export constants\nexport { SIDEBAR_CONSTANTS } from \"./useSidebarContext\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Sidebar/index.tsx"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,qEAAqE;AAErE,OAAO;AACL,OAAO;AACP,OAAO;AACP,OAAO;AACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa;AACb,eAAe;AACf,kBAAkB;AAClB,SAAS;AACT,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB;AACjB,WAAW;AACX,aAAa;AACb,QAAQ;AACR,YAAY,EACZ,YAAY,EACZ,aAAa;AACb,OAAO;AACP,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,mBAAmB;AACnB,UAAU;AACV,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,mBAAmB;AACnB,SAAS;AACT,uBAAuB;AACvB,oBAAoB;AACpB,eAAe,EACf,WAAW;AACX,YAAY;AACZ,gBAAgB;AAChB,UAAU;AACV,cAAc,EACd,UAAU,GACX,MAAM,WAAW,CAAA;AAoDlB,mBAAmB;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA","sourcesContent":["// Sidebar Component - Composable navigation sidebar\n// Re-export all components from Sidebar.tsx and useSidebarContext.ts\n\nexport {\n // Core\n Sidebar,\n // Card\n SidebarCard,\n SidebarCardContent,\n SidebarCardFooter,\n SidebarCardHeader,\n SidebarCardTitle,\n SidebarCardTitleLink,\n SidebarContent,\n SidebarFooter,\n // Footer Links\n SidebarFooterLinks,\n // Groups\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n // Sections\n SidebarHeader,\n // Input\n SidebarInput,\n SidebarInset,\n SidebarLayout,\n // Menu\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuButtonIcon,\n SidebarMenuButtonLabel,\n SidebarMenuChevron,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n // Submenu\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarMobile,\n SidebarMobileFooter,\n SidebarMobileHeader,\n // Mobile\n SidebarMobileMenuButton,\n // Provider and Hook\n SidebarProvider,\n SidebarRail,\n // Separator\n SidebarSeparator,\n // Trigger\n SidebarTrigger,\n useSidebar,\n} from \"./Sidebar\"\n\n// Export types\nexport type {\n SidebarCardContentProps,\n SidebarCardFooterProps,\n SidebarCardHeaderProps,\n SidebarCardProps,\n SidebarCardTitleLinkProps,\n SidebarCardTitleProps,\n // Context types\n SidebarCollapsible,\n SidebarContentProps,\n SidebarFooterLinksProps,\n SidebarFooterProps,\n SidebarGroupActionProps,\n SidebarGroupContentProps,\n SidebarGroupLabelProps,\n SidebarGroupProps,\n SidebarHeaderProps,\n SidebarInputProps,\n SidebarInsetProps,\n SidebarLayoutProps,\n SidebarMenuActionProps,\n SidebarMenuBadgeProps,\n SidebarMenuButtonIconProps,\n SidebarMenuButtonLabelProps,\n SidebarMenuButtonProps,\n SidebarMenuChevronProps,\n SidebarMenuItemProps,\n SidebarMenuProps,\n SidebarMenuSkeletonProps,\n SidebarMenuSubButtonProps,\n SidebarMenuSubItemProps,\n SidebarMenuSubProps,\n SidebarMobileFooterProps,\n SidebarMobileHeaderProps,\n SidebarMobileMenuButtonProps,\n SidebarMobileProps,\n // Component props\n SidebarProps,\n SidebarRailProps,\n SidebarSeparatorProps,\n SidebarSide,\n SidebarTriggerProps,\n SidebarProviderVariant,\n SidebarVariant,\n} from \"./Sidebar\"\n\n// Export provider props and context types\nexport type { SidebarContextValue, SidebarProviderProps, SidebarState } from \"./useSidebarContext\"\n\n// Export constants\nexport { SIDEBAR_CONSTANTS } from \"./useSidebarContext\"\n"]}
@@ -1,10 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { createContext, useCallback, useContext, useEffect, useMemo, useState, useSyncExternalStore, } from "react";
4
+ import clsx from "clsx";
5
+ import s from "@plexui/styles/components/Sidebar/Sidebar.module.css";
4
6
  // Constants
5
7
  const SIDEBAR_COOKIE_NAME = "sidebar:state";
6
8
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7; // 7 days
7
9
  const SIDEBAR_WIDTH = "240px";
10
+ const SIDEBAR_WIDTH_APP = "260px";
8
11
  const SIDEBAR_WIDTH_MOBILE = "288px";
9
12
  const SIDEBAR_WIDTH_ICON = "64px";
10
13
  const SIDEBAR_KEYBOARD_SHORTCUT = "b";
@@ -34,7 +37,7 @@ function useIsMobile() {
34
37
  return useSyncExternalStore(subscribeToMobile, getMobileSnapshot, getServerMobileSnapshot);
35
38
  }
36
39
  // Provider component
37
- export const SidebarProvider = ({ children, defaultOpen = true, open: openProp, onOpenChange: setOpenProp, collapsible = "offcanvas", style, className, }) => {
40
+ export const SidebarProvider = ({ children, defaultOpen = true, open: openProp, onOpenChange: setOpenProp, collapsible = "offcanvas", variant = "sidebar", style, className, }) => {
38
41
  const isMobile = useIsMobile();
39
42
  const [openMobile, setOpenMobile] = useState(false);
40
43
  // Controlled vs uncontrolled state for desktop
@@ -108,8 +111,8 @@ export const SidebarProvider = ({ children, defaultOpen = true, open: openProp,
108
111
  collapsible,
109
112
  toggleSidebar,
110
113
  }), [state, open, setOpen, openMobile, isMobile, collapsible, toggleSidebar]);
111
- return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx("div", { className: className, style: {
112
- "--sidebar-width": SIDEBAR_WIDTH,
114
+ return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx("div", { className: clsx(variant === "app" && s.App, className), style: {
115
+ "--sidebar-width": variant === "app" ? SIDEBAR_WIDTH_APP : SIDEBAR_WIDTH,
113
116
  "--sidebar-width-mobile": SIDEBAR_WIDTH_MOBILE,
114
117
  "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
115
118
  ...style,
@@ -118,6 +121,7 @@ export const SidebarProvider = ({ children, defaultOpen = true, open: openProp,
118
121
  // Re-export constants for external use
119
122
  export const SIDEBAR_CONSTANTS = {
120
123
  WIDTH: SIDEBAR_WIDTH,
124
+ WIDTH_APP: SIDEBAR_WIDTH_APP,
121
125
  WIDTH_MOBILE: SIDEBAR_WIDTH_MOBILE,
122
126
  WIDTH_ICON: SIDEBAR_WIDTH_ICON,
123
127
  KEYBOARD_SHORTCUT: SIDEBAR_KEYBOARD_SHORTCUT,
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebarContext.js","sourceRoot":"","sources":["../../../../src/components/Sidebar/useSidebarContext.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,EACR,oBAAoB,GAErB,MAAM,OAAO,CAAA;AAEd,YAAY;AACZ,MAAM,mBAAmB,GAAG,eAAe,CAAA;AAC3C,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,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ncExternalStore,\n type ReactNode,\n} from \"react\"\n\n// Constants\nconst SIDEBAR_COOKIE_NAME = \"sidebar:state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7 // 7 days\nconst SIDEBAR_WIDTH = \"240px\"\nconst SIDEBAR_WIDTH_MOBILE = \"288px\"\nconst SIDEBAR_WIDTH_ICON = \"64px\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\nconst MOBILE_BREAKPOINT = 768\n\n// Types\nexport type SidebarState = \"expanded\" | \"collapsed\"\nexport type SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\"\nexport type SidebarSide = \"left\" | \"right\"\nexport type SidebarVariant = \"sidebar\" | \"docs\"\n\nexport type SidebarContextValue = {\n state: SidebarState\n open: boolean\n setOpen: (open: boolean) => void\n openMobile: boolean\n setOpenMobile: (open: boolean) => void\n isMobile: boolean\n collapsible: SidebarCollapsible\n toggleSidebar: () => void\n}\n\n// Context\nconst SidebarContext = createContext<SidebarContextValue | null>(null)\n\n// Hook to access sidebar context\nexport const useSidebar = (): SidebarContextValue => {\n const context = useContext(SidebarContext)\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider\")\n }\n\n return context\n}\n\n// Hook for mobile detection via matchMedia. Read during render, so a phone\n// gets the mobile layout on its first paint instead of one frame of the\n// desktop sidebar; the server (and hydration) renders the desktop layout.\nconst MOBILE_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nconst subscribeToMobile = (onChange: () => void) => {\n const mql = window.matchMedia(MOBILE_QUERY)\n mql.addEventListener(\"change\", onChange)\n return () => mql.removeEventListener(\"change\", onChange)\n}\n\nconst getMobileSnapshot = () => window.matchMedia(MOBILE_QUERY).matches\nconst getServerMobileSnapshot = () => false\n\nfunction useIsMobile(): boolean {\n return useSyncExternalStore(subscribeToMobile, getMobileSnapshot, getServerMobileSnapshot)\n}\n\n// Provider props\nexport type SidebarProviderProps = {\n children: ReactNode\n /**\n * Default open state (uncontrolled)\n * @default true\n */\n defaultOpen?: boolean\n /**\n * Controlled open state\n */\n open?: boolean\n /**\n * Callback when open state changes\n */\n onOpenChange?: (open: boolean) => void\n /**\n * Collapsible mode\n * @default \"offcanvas\"\n */\n collapsible?: SidebarCollapsible\n /**\n * Custom CSS properties for the sidebar\n */\n style?: React.CSSProperties\n /**\n * Additional class name\n */\n className?: string\n}\n\n// Provider component\nexport const SidebarProvider = ({\n children,\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n collapsible = \"offcanvas\",\n style,\n className,\n}: SidebarProviderProps) => {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = useState(false)\n\n // Controlled vs uncontrolled state for desktop\n const [_open, _setOpen] = useState(defaultOpen)\n const open = openProp ?? _open\n\n const setOpen = useCallback(\n (value: boolean | ((prev: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value\n\n // Controlled only when `open` is passed; onOpenChange alone is a notification\n if (openProp === undefined) {\n _setOpen(openState)\n }\n setOpenProp?.(openState)\n\n // Persist state in cookie for SSR\n if (typeof document !== \"undefined\") {\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n }\n },\n [setOpenProp, openProp, open],\n )\n\n // Toggle function that handles both mobile and desktop\n const toggleSidebar = useCallback(() => {\n if (isMobile) {\n setOpenMobile((prev) => !prev)\n } else {\n setOpen((prev) => !prev)\n }\n }, [isMobile, setOpen])\n\n // Keyboard shortcut: Cmd/Ctrl + B\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // Skip if collapsible is \"none\"\n if (collapsible === \"none\") return\n\n // Don't trigger when focus is in an editable element (input, textarea, contenteditable)\n const target = event.target as HTMLElement | null\n if (target?.closest?.(\"input, textarea\") || target?.isContentEditable) return\n\n // Check for Cmd (Mac) or Ctrl (Windows/Linux) + B\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey) &&\n !event.altKey &&\n !event.shiftKey\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [toggleSidebar, collapsible])\n\n // Close mobile menu on escape key\n useEffect(() => {\n if (!openMobile) return\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpenMobile(false)\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [openMobile])\n\n // Derive state from open boolean\n const state: SidebarState = open ? \"expanded\" : \"collapsed\"\n\n // Context value\n const contextValue = useMemo<SidebarContextValue>(\n () => ({\n state,\n open,\n setOpen,\n openMobile,\n setOpenMobile,\n isMobile,\n collapsible,\n toggleSidebar,\n }),\n [state, open, setOpen, openMobile, isMobile, collapsible, toggleSidebar],\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n className={className}\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-mobile\": SIDEBAR_WIDTH_MOBILE,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n data-sidebar={state}\n data-mobile-menu={openMobile ? \"visible\" : \"hidden\"}\n data-collapsible={collapsible}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\n// Re-export constants for external use\nexport const SIDEBAR_CONSTANTS = {\n WIDTH: SIDEBAR_WIDTH,\n WIDTH_MOBILE: SIDEBAR_WIDTH_MOBILE,\n WIDTH_ICON: SIDEBAR_WIDTH_ICON,\n KEYBOARD_SHORTCUT: SIDEBAR_KEYBOARD_SHORTCUT,\n MOBILE_BREAKPOINT,\n COOKIE_NAME: SIDEBAR_COOKIE_NAME,\n COOKIE_MAX_AGE: SIDEBAR_COOKIE_MAX_AGE,\n} as const\n"]}
1
+ {"version":3,"file":"useSidebarContext.js","sourceRoot":"","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AAa;gBACxE,wBAAwB,EAAE,oBAAoB;gBAC9C,sBAAsB,EAAE,kBAAkB;gBAC1C,GAAG,KAAK;aACc,kBAEZ,KAAK,sBACD,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,sBACjC,WAAW,YAE5B,QAAQ,GACL,GACkB,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,uCAAuC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,iBAAiB;IAC5B,YAAY,EAAE,oBAAoB;IAClC,UAAU,EAAE,kBAAkB;IAC9B,iBAAiB,EAAE,yBAAyB;IAC5C,iBAAiB;IACjB,WAAW,EAAE,mBAAmB;IAChC,cAAc,EAAE,sBAAsB;CAC9B,CAAA","sourcesContent":["\"use client\"\n\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from \"react\"\nimport clsx from \"clsx\"\nimport s from \"@plexui/styles/components/Sidebar/Sidebar.module.css\"\n\n// Constants\nconst SIDEBAR_COOKIE_NAME = \"sidebar:state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7 // 7 days\nconst SIDEBAR_WIDTH = \"240px\"\nconst SIDEBAR_WIDTH_APP = \"260px\"\nconst SIDEBAR_WIDTH_MOBILE = \"288px\"\nconst SIDEBAR_WIDTH_ICON = \"64px\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\nconst MOBILE_BREAKPOINT = 768\n\n// Types\nexport type SidebarState = \"expanded\" | \"collapsed\"\nexport type SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\"\nexport type SidebarSide = \"left\" | \"right\"\nexport type SidebarVariant = \"sidebar\" | \"docs\"\nexport type SidebarProviderVariant = \"sidebar\" | \"app\"\n\nexport type SidebarContextValue = {\n state: SidebarState\n open: boolean\n setOpen: (open: boolean) => void\n openMobile: boolean\n setOpenMobile: (open: boolean) => void\n isMobile: boolean\n collapsible: SidebarCollapsible\n toggleSidebar: () => void\n}\n\n// Context\nconst SidebarContext = createContext<SidebarContextValue | null>(null)\n\n// Hook to access sidebar context\nexport const useSidebar = (): SidebarContextValue => {\n const context = useContext(SidebarContext)\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider\")\n }\n\n return context\n}\n\n// Hook for mobile detection via matchMedia. Read during render, so a phone\n// gets the mobile layout on its first paint instead of one frame of the\n// desktop sidebar; the server (and hydration) renders the desktop layout.\nconst MOBILE_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`\n\nconst subscribeToMobile = (onChange: () => void) => {\n const mql = window.matchMedia(MOBILE_QUERY)\n mql.addEventListener(\"change\", onChange)\n return () => mql.removeEventListener(\"change\", onChange)\n}\n\nconst getMobileSnapshot = () => window.matchMedia(MOBILE_QUERY).matches\nconst getServerMobileSnapshot = () => false\n\nfunction useIsMobile(): boolean {\n return useSyncExternalStore(subscribeToMobile, getMobileSnapshot, getServerMobileSnapshot)\n}\n\n// Provider props\nexport type SidebarProviderProps = {\n children: ReactNode\n /**\n * Default open state (uncontrolled)\n * @default true\n */\n defaultOpen?: boolean\n /**\n * Controlled open state\n */\n open?: boolean\n /**\n * Callback when open state changes\n */\n onOpenChange?: (open: boolean) => void\n /**\n * Collapsible mode\n * @default \"offcanvas\"\n */\n collapsible?: SidebarCollapsible\n /**\n * \"app\" is the shell of a product: a quiet rail, pill rows and on a phone a drawer under the page.\n * @default \"sidebar\"\n */\n variant?: SidebarProviderVariant\n /**\n * Custom CSS properties for the sidebar\n */\n style?: React.CSSProperties\n /**\n * Additional class name\n */\n className?: string\n}\n\n// Provider component\nexport const SidebarProvider = ({\n children,\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n collapsible = \"offcanvas\",\n variant = \"sidebar\",\n style,\n className,\n}: SidebarProviderProps) => {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = useState(false)\n\n // Controlled vs uncontrolled state for desktop\n const [_open, _setOpen] = useState(defaultOpen)\n const open = openProp ?? _open\n\n const setOpen = useCallback(\n (value: boolean | ((prev: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value\n\n // Controlled only when `open` is passed; onOpenChange alone is a notification\n if (openProp === undefined) {\n _setOpen(openState)\n }\n setOpenProp?.(openState)\n\n // Persist state in cookie for SSR\n if (typeof document !== \"undefined\") {\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n }\n },\n [setOpenProp, openProp, open],\n )\n\n // Toggle function that handles both mobile and desktop\n const toggleSidebar = useCallback(() => {\n if (isMobile) {\n setOpenMobile((prev) => !prev)\n } else {\n setOpen((prev) => !prev)\n }\n }, [isMobile, setOpen])\n\n // Keyboard shortcut: Cmd/Ctrl + B\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // Skip if collapsible is \"none\"\n if (collapsible === \"none\") return\n\n // Don't trigger when focus is in an editable element (input, textarea, contenteditable)\n const target = event.target as HTMLElement | null\n if (target?.closest?.(\"input, textarea\") || target?.isContentEditable) return\n\n // Check for Cmd (Mac) or Ctrl (Windows/Linux) + B\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey) &&\n !event.altKey &&\n !event.shiftKey\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [toggleSidebar, collapsible])\n\n // Close mobile menu on escape key\n useEffect(() => {\n if (!openMobile) return\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpenMobile(false)\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [openMobile])\n\n // Derive state from open boolean\n const state: SidebarState = open ? \"expanded\" : \"collapsed\"\n\n // Context value\n const contextValue = useMemo<SidebarContextValue>(\n () => ({\n state,\n open,\n setOpen,\n openMobile,\n setOpenMobile,\n isMobile,\n collapsible,\n toggleSidebar,\n }),\n [state, open, setOpen, openMobile, isMobile, collapsible, toggleSidebar],\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n className={clsx(variant === \"app\" && s.App, className)}\n style={\n {\n \"--sidebar-width\": variant === \"app\" ? SIDEBAR_WIDTH_APP : SIDEBAR_WIDTH,\n \"--sidebar-width-mobile\": SIDEBAR_WIDTH_MOBILE,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n data-sidebar={state}\n data-mobile-menu={openMobile ? \"visible\" : \"hidden\"}\n data-collapsible={collapsible}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\n// Re-export constants for external use\nexport const SIDEBAR_CONSTANTS = {\n WIDTH: SIDEBAR_WIDTH,\n WIDTH_APP: SIDEBAR_WIDTH_APP,\n WIDTH_MOBILE: SIDEBAR_WIDTH_MOBILE,\n WIDTH_ICON: SIDEBAR_WIDTH_ICON,\n KEYBOARD_SHORTCUT: SIDEBAR_KEYBOARD_SHORTCUT,\n MOBILE_BREAKPOINT,\n COOKIE_NAME: SIDEBAR_COOKIE_NAME,\n COOKIE_MAX_AGE: SIDEBAR_COOKIE_MAX_AGE,\n} as const\n"]}
@@ -0,0 +1,82 @@
1
+ import { type HTMLAttributes, type Ref } from "react";
2
+ export type PageWidth = "full" | "wide" | "column";
3
+ export type PageProps = HTMLAttributes<HTMLDivElement> & {
4
+ /**
5
+ * Width of the column that header and content share.
6
+ * - `"full"` — edge to edge, for tables (default)
7
+ * - `"wide"` — 1280px, centred, for overviews
8
+ * - `"column"` — 768px, centred, for settings and forms
9
+ *
10
+ * Set `--page-width` on the page for any other width.
11
+ * @default "full"
12
+ */
13
+ width?: PageWidth;
14
+ ref?: Ref<HTMLDivElement>;
15
+ };
16
+ declare function PageRoot({ width, className, children, ...restProps }: PageProps): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace PageRoot {
18
+ var displayName: string;
19
+ }
20
+ export type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {
21
+ /**
22
+ * Shows the line, and the glass on a phone, once the content has scrolled under the header.
23
+ * Turn it off when the content already draws a line of its own at that place.
24
+ * @default true
25
+ */
26
+ divider?: boolean;
27
+ ref?: Ref<HTMLDivElement>;
28
+ };
29
+ declare function PageHeader({ divider, className, children, ...restProps }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
30
+ declare namespace PageHeader {
31
+ var displayName: string;
32
+ }
33
+ export type PageSlotProps = HTMLAttributes<HTMLDivElement> & {
34
+ ref?: Ref<HTMLDivElement>;
35
+ };
36
+ declare function PageBar({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
37
+ declare namespace PageBar {
38
+ var displayName: string;
39
+ }
40
+ declare function PageHeading({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
41
+ declare namespace PageHeading {
42
+ var displayName: string;
43
+ }
44
+ declare function PageTitle({ className, ...restProps }: HTMLAttributes<HTMLHeadingElement> & {
45
+ ref?: Ref<HTMLHeadingElement>;
46
+ }): import("react/jsx-runtime").JSX.Element;
47
+ declare namespace PageTitle {
48
+ var displayName: string;
49
+ }
50
+ declare function PageSubtitle({ className, ...restProps }: HTMLAttributes<HTMLParagraphElement> & {
51
+ ref?: Ref<HTMLParagraphElement>;
52
+ }): import("react/jsx-runtime").JSX.Element;
53
+ declare namespace PageSubtitle {
54
+ var displayName: string;
55
+ }
56
+ declare function PageActions({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
57
+ declare namespace PageActions {
58
+ var displayName: string;
59
+ }
60
+ export type PageContentProps = HTMLAttributes<HTMLDivElement> & {
61
+ /**
62
+ * The content fills the page and scrolls inside itself, as a table does: the page stops
63
+ * scrolling from 768px up.
64
+ * @default false
65
+ */
66
+ fill?: boolean;
67
+ ref?: Ref<HTMLDivElement>;
68
+ };
69
+ declare function PageContent({ fill, className, children, onScroll, ...restProps }: PageContentProps): import("react/jsx-runtime").JSX.Element;
70
+ declare namespace PageContent {
71
+ var displayName: string;
72
+ }
73
+ export declare const Page: typeof PageRoot & {
74
+ Header: typeof PageHeader;
75
+ Bar: typeof PageBar;
76
+ Heading: typeof PageHeading;
77
+ Title: typeof PageTitle;
78
+ Subtitle: typeof PageSubtitle;
79
+ Actions: typeof PageActions;
80
+ Content: typeof PageContent;
81
+ };
82
+ export {};
@@ -0,0 +1 @@
1
+ export { Page, type PageContentProps, type PageHeaderProps, type PageProps, type PageSlotProps, type PageWidth, } from "./Page.js";
@@ -1,8 +1,8 @@
1
1
  import { type ComponentProps, type ReactNode } from "react";
2
2
  import { type InputProps } from "../Input/index.js";
3
- import { SidebarProvider, useSidebar, type SidebarCollapsible, type SidebarSide, type SidebarVariant } from "./useSidebarContext.js";
3
+ import { SidebarProvider, useSidebar, type SidebarCollapsible, type SidebarSide, type SidebarProviderVariant, type SidebarVariant } from "./useSidebarContext.js";
4
4
  export { SidebarProvider, useSidebar };
5
- export type { SidebarCollapsible, SidebarSide, SidebarVariant };
5
+ export type { SidebarCollapsible, SidebarProviderVariant, SidebarSide, SidebarVariant };
6
6
  export type SidebarProps = ComponentProps<"aside"> & {
7
7
  /**
8
8
  * The side the sidebar is on.
@@ -1,4 +1,4 @@
1
1
  export { Sidebar, SidebarCard, SidebarCardContent, SidebarCardFooter, SidebarCardHeader, SidebarCardTitle, SidebarCardTitleLink, SidebarContent, SidebarFooter, SidebarFooterLinks, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuButtonIcon, SidebarMenuButtonLabel, SidebarMenuChevron, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarMobile, SidebarMobileFooter, SidebarMobileHeader, SidebarMobileMenuButton, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, } from "./Sidebar.js";
2
- export type { SidebarCardContentProps, SidebarCardFooterProps, SidebarCardHeaderProps, SidebarCardProps, SidebarCardTitleLinkProps, SidebarCardTitleProps, SidebarCollapsible, SidebarContentProps, SidebarFooterLinksProps, SidebarFooterProps, SidebarGroupActionProps, SidebarGroupContentProps, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeaderProps, SidebarInputProps, SidebarInsetProps, SidebarLayoutProps, SidebarMenuActionProps, SidebarMenuBadgeProps, SidebarMenuButtonIconProps, SidebarMenuButtonLabelProps, SidebarMenuButtonProps, SidebarMenuChevronProps, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeletonProps, SidebarMenuSubButtonProps, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarMobileFooterProps, SidebarMobileHeaderProps, SidebarMobileMenuButtonProps, SidebarMobileProps, SidebarProps, SidebarRailProps, SidebarSeparatorProps, SidebarSide, SidebarTriggerProps, SidebarVariant, } from "./Sidebar.js";
2
+ export type { SidebarCardContentProps, SidebarCardFooterProps, SidebarCardHeaderProps, SidebarCardProps, SidebarCardTitleLinkProps, SidebarCardTitleProps, SidebarCollapsible, SidebarContentProps, SidebarFooterLinksProps, SidebarFooterProps, SidebarGroupActionProps, SidebarGroupContentProps, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeaderProps, SidebarInputProps, SidebarInsetProps, SidebarLayoutProps, SidebarMenuActionProps, SidebarMenuBadgeProps, SidebarMenuButtonIconProps, SidebarMenuButtonLabelProps, SidebarMenuButtonProps, SidebarMenuChevronProps, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeletonProps, SidebarMenuSubButtonProps, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarMobileFooterProps, SidebarMobileHeaderProps, SidebarMobileMenuButtonProps, SidebarMobileProps, SidebarProps, SidebarRailProps, SidebarSeparatorProps, SidebarSide, SidebarTriggerProps, SidebarProviderVariant, SidebarVariant, } from "./Sidebar.js";
3
3
  export type { SidebarContextValue, SidebarProviderProps, SidebarState } from "./useSidebarContext.js";
4
4
  export { SIDEBAR_CONSTANTS } from "./useSidebarContext.js";
@@ -3,6 +3,7 @@ export type SidebarState = "expanded" | "collapsed";
3
3
  export type SidebarCollapsible = "offcanvas" | "icon" | "none";
4
4
  export type SidebarSide = "left" | "right";
5
5
  export type SidebarVariant = "sidebar" | "docs";
6
+ export type SidebarProviderVariant = "sidebar" | "app";
6
7
  export type SidebarContextValue = {
7
8
  state: SidebarState;
8
9
  open: boolean;
@@ -34,6 +35,11 @@ export type SidebarProviderProps = {
34
35
  * @default "offcanvas"
35
36
  */
36
37
  collapsible?: SidebarCollapsible;
38
+ /**
39
+ * "app" is the shell of a product: a quiet rail, pill rows and on a phone a drawer under the page.
40
+ * @default "sidebar"
41
+ */
42
+ variant?: SidebarProviderVariant;
37
43
  /**
38
44
  * Custom CSS properties for the sidebar
39
45
  */
@@ -43,9 +49,10 @@ export type SidebarProviderProps = {
43
49
  */
44
50
  className?: string;
45
51
  };
46
- export declare const SidebarProvider: ({ children, defaultOpen, open: openProp, onOpenChange: setOpenProp, collapsible, style, className, }: SidebarProviderProps) => import("react/jsx-runtime").JSX.Element;
52
+ export declare const SidebarProvider: ({ children, defaultOpen, open: openProp, onOpenChange: setOpenProp, collapsible, variant, style, className, }: SidebarProviderProps) => import("react/jsx-runtime").JSX.Element;
47
53
  export declare const SIDEBAR_CONSTANTS: {
48
54
  readonly WIDTH: "240px";
55
+ readonly WIDTH_APP: "260px";
49
56
  readonly WIDTH_MOBILE: "288px";
50
57
  readonly WIDTH_ICON: "64px";
51
58
  readonly KEYBOARD_SHORTCUT: "b";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/ui",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Modern design system for building high-quality applications",
5
5
  "type": "module",
6
6
  "license": "MIT",