jaci-ui 0.5.0 → 0.6.1

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +49 -2
  3. package/dist/components/navigation/index.d.cts +2 -1
  4. package/dist/components/navigation/index.d.ts +2 -1
  5. package/dist/components/navigation/navbar-namespace.cjs +26 -0
  6. package/dist/components/navigation/navbar-namespace.cjs.map +1 -0
  7. package/dist/components/navigation/navbar-namespace.d.cts +25 -0
  8. package/dist/components/navigation/navbar-namespace.d.ts +25 -0
  9. package/dist/components/navigation/navbar-namespace.js +26 -0
  10. package/dist/components/navigation/navbar-namespace.js.map +1 -0
  11. package/dist/components/navigation/navigation.cjs +2 -13
  12. package/dist/components/navigation/navigation.cjs.map +1 -1
  13. package/dist/components/navigation/navigation.d.cts +2 -13
  14. package/dist/components/navigation/navigation.d.ts +2 -13
  15. package/dist/components/navigation/navigation.js +2 -13
  16. package/dist/components/navigation/navigation.js.map +1 -1
  17. package/dist/components/navigation-menu/navigation-menu.cjs +3 -3
  18. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  19. package/dist/components/navigation-menu/navigation-menu.js +3 -3
  20. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  21. package/dist/components/sidebar/sidebar.cjs +59 -11
  22. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  23. package/dist/components/sidebar/sidebar.d.cts +13 -0
  24. package/dist/components/sidebar/sidebar.d.ts +13 -0
  25. package/dist/components/sidebar/sidebar.js +59 -13
  26. package/dist/components/sidebar/sidebar.js.map +1 -1
  27. package/dist/components/stepper/index.d.cts +2 -0
  28. package/dist/components/stepper/index.d.ts +2 -0
  29. package/dist/components/stepper/stepper.cjs +341 -0
  30. package/dist/components/stepper/stepper.cjs.map +1 -0
  31. package/dist/components/stepper/stepper.d.cts +52 -0
  32. package/dist/components/stepper/stepper.d.ts +52 -0
  33. package/dist/components/stepper/stepper.js +330 -0
  34. package/dist/components/stepper/stepper.js.map +1 -0
  35. package/dist/components/toast/toast.cjs +3 -1
  36. package/dist/components/toast/toast.cjs.map +1 -1
  37. package/dist/components/toast/toast.js +3 -1
  38. package/dist/components/toast/toast.js.map +1 -1
  39. package/dist/index.cjs +15 -1
  40. package/dist/index.d.cts +5 -2
  41. package/dist/index.d.ts +5 -2
  42. package/dist/index.js +4 -2
  43. package/dist/styled-system/recipes/sidebar.cjs +3 -0
  44. package/dist/styled-system/recipes/sidebar.cjs.map +1 -1
  45. package/dist/styled-system/recipes/sidebar.js +3 -0
  46. package/dist/styled-system/recipes/sidebar.js.map +1 -1
  47. package/dist/styled-system/recipes/stepper.cjs +53 -0
  48. package/dist/styled-system/recipes/stepper.cjs.map +1 -0
  49. package/dist/styled-system/recipes/stepper.js +53 -0
  50. package/dist/styled-system/recipes/stepper.js.map +1 -0
  51. package/dist/styles.css +365 -17
  52. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-menu.js","names":["NavigationMenuRoot","BaseNavigationMenu","NavigationMenu"],"sources":["../../../src/components/navigation-menu/navigation-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { NavigationMenuRoot as BaseNavigationMenuRoot } from \"@base-ui/react/navigation-menu\";\n\nimport { navigationMenu } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type NavigationMenuOrientation = \"horizontal\" | \"vertical\";\n\ninterface NavigationMenuContextValue {\n close: () => void;\n orientation: NavigationMenuOrientation;\n styles: ReturnType<typeof navigationMenu>;\n value: string | null;\n}\n\nconst NavigationMenuContext = createContext<NavigationMenuContextValue | null>(null);\nconst NavigationMenuItemContext = createContext<{ value?: string } | null>(null);\n\nfunction useNavigationMenuContext() {\n const context = useContext(NavigationMenuContext);\n if (!context) {\n throw new Error(\"NavigationMenu parts must be rendered inside NavigationMenu.Root.\");\n }\n\n return context;\n}\n\nexport interface NavigationMenuRootProps\n extends Omit<\n BaseNavigationMenuRoot.Props<string>,\n \"children\" | \"className\" | \"onValueChange\" | \"value\" | \"defaultValue\"\n > {\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n orientation?: NavigationMenuOrientation;\n children?: ReactNode;\n className?: string;\n}\n\nexport const NavigationMenuRoot = forwardRef<HTMLElement, NavigationMenuRootProps>(\n function NavigationMenuRoot(\n {\n children,\n className,\n defaultValue,\n onValueChange,\n orientation = \"horizontal\",\n value,\n ...props\n },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState<string | null>(defaultValue ?? null);\n const rootElementRef = useRef<HTMLElement | null>(null);\n // Keep the Base UI primitive controlled by the wrapper state even when the\n // consumer uses the uncontrolled API. This keeps the viewport and the\n // primitive in sync when Base UI dismisses a menu (pointer leave, outside\n // press, Escape or pressing the trigger again).\n const resolvedValue = value === undefined ? uncontrolledValue : value;\n const styles = navigationMenu({ orientation });\n const close = useCallback(() => {\n if (value === undefined) setUncontrolledValue(null);\n else onValueChange?.(null);\n }, [onValueChange, value]);\n\n useEffect(() => {\n if (resolvedValue === null) return;\n\n const handleOutsideClick = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (rootElementRef.current?.contains(target)) return;\n if (\n target.closest(\n '[data-slot=\"navigation-menu-content\"], [data-slot=\"navigation-menu-positioner\"], [data-slot=\"navigation-menu-popup\"], [data-slot=\"navigation-menu-viewport\"]',\n )\n ) {\n return;\n }\n close();\n };\n\n document.addEventListener(\"click\", handleOutsideClick);\n return () => document.removeEventListener(\"click\", handleOutsideClick);\n }, [close, resolvedValue]);\n\n const setRootRef = (element: HTMLElement | null) => {\n rootElementRef.current = element;\n if (typeof ref === \"function\") ref(element);\n else if (ref) ref.current = element;\n };\n\n return (\n <NavigationMenuContext.Provider value={{ close, orientation, styles, value: resolvedValue }}>\n <BaseNavigationMenu.Root\n {...props}\n onValueChange={(next) => {\n if (value === undefined) setUncontrolledValue(next);\n onValueChange?.(next);\n }}\n orientation={orientation}\n ref={setRootRef}\n value={resolvedValue}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"navigation-menu\"\n data-orientation={orientation}\n data-slot=\"navigation-menu\"\n >\n {children}\n </BaseNavigationMenu.Root>\n </NavigationMenuContext.Provider>\n );\n },\n);\n\nexport type NavigationMenuListProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.List>;\nexport const NavigationMenuList = forwardRef<HTMLUListElement, NavigationMenuListProps>(\n function NavigationMenuList({ className, ...props }, ref) {\n const { styles, orientation } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.List\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.list, className)}\n data-orientation={orientation}\n data-slot=\"navigation-menu-list\"\n />\n );\n },\n);\n\nexport type NavigationMenuItemProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Item>;\nexport const NavigationMenuItem = forwardRef<HTMLLIElement, NavigationMenuItemProps>(\n function NavigationMenuItem({ children, className, value, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n const generatedValue = useId();\n const itemValue = value ?? generatedValue;\n return (\n <NavigationMenuItemContext.Provider value={{ value: itemValue }}>\n <BaseNavigationMenu.Item\n {...props}\n ref={ref}\n value={itemValue}\n className={withRecipeClassName(styles.item, className)}\n data-slot=\"navigation-menu-item\"\n >\n {children}\n </BaseNavigationMenu.Item>\n </NavigationMenuItemContext.Provider>\n );\n },\n);\n\nexport type NavigationMenuTriggerProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Trigger\n>;\nexport const NavigationMenuTrigger = forwardRef<HTMLButtonElement, NavigationMenuTriggerProps>(\n function NavigationMenuTrigger({ className, onClick, ...props }, ref) {\n const { close, styles, value } = useNavigationMenuContext();\n const item = useContext(NavigationMenuItemContext);\n return (\n <BaseNavigationMenu.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-slot=\"navigation-menu-trigger\"\n onClick={(event) => {\n // Base UI intentionally keeps a hover-opened menu open for a brief\n // patient-click window. For a component library trigger, a second\n // click should always be an explicit close action.\n if (item?.value !== undefined && value === item.value) {\n event.preventDefault();\n close();\n }\n onClick?.(event);\n }}\n />\n );\n },\n);\n\nexport type NavigationMenuContentProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Content\n>;\nexport const NavigationMenuContent = forwardRef<HTMLDivElement, NavigationMenuContentProps>(\n function NavigationMenuContent({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Content\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.content, className)}\n data-slot=\"navigation-menu-content\"\n />\n );\n },\n);\n\nexport type NavigationMenuLinkProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Link>;\nexport const NavigationMenuLink = forwardRef<HTMLAnchorElement, NavigationMenuLinkProps>(\n function NavigationMenuLink({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Link\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.link, className)}\n data-slot=\"navigation-menu-link\"\n />\n );\n },\n);\n\nexport type NavigationMenuIconProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Icon>;\nexport const NavigationMenuIcon = forwardRef<HTMLSpanElement, NavigationMenuIconProps>(\n function NavigationMenuIcon({ children = \"⌄\", className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.icon, className)}\n data-slot=\"navigation-menu-icon\"\n >\n {children}\n </BaseNavigationMenu.Icon>\n );\n },\n);\n\nexport const NavigationMenuPortal = BaseNavigationMenu.Portal;\n\nexport type NavigationMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Positioner\n>;\nexport const NavigationMenuPositioner = forwardRef<HTMLDivElement, NavigationMenuPositionerProps>(\n function NavigationMenuPositioner({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"navigation-menu-positioner\"\n />\n );\n },\n);\n\nexport type NavigationMenuViewportProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Viewport\n>;\nexport const NavigationMenuViewport = forwardRef<HTMLDivElement, NavigationMenuViewportProps>(\n function NavigationMenuViewport({ className, ...props }, ref) {\n const { styles, value } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.viewport, className)}\n data-open={value !== null ? \"true\" : \"false\"}\n data-slot=\"navigation-menu-viewport\"\n />\n );\n },\n);\n\nexport type NavigationMenuPopupProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Popup>;\nexport const NavigationMenuPopup = forwardRef<HTMLElement, NavigationMenuPopupProps>(\n function NavigationMenuPopup({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"navigation-menu-popup\"\n />\n );\n },\n);\n\nexport type NavigationMenuBackdropProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Backdrop\n>;\nexport const NavigationMenuBackdrop = forwardRef<HTMLDivElement, NavigationMenuBackdropProps>(\n function NavigationMenuBackdrop({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.backdrop, className)}\n data-slot=\"navigation-menu-backdrop\"\n />\n );\n },\n);\n\nexport type NavigationMenuArrowProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Arrow>;\nexport const NavigationMenuArrow = forwardRef<HTMLDivElement, NavigationMenuArrowProps>(\n function NavigationMenuArrow({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.arrow, className)}\n data-slot=\"navigation-menu-arrow\"\n />\n );\n },\n);\n\nexport const NavigationMenu = {\n Root: NavigationMenuRoot,\n List: NavigationMenuList,\n Item: NavigationMenuItem,\n Trigger: NavigationMenuTrigger,\n Content: NavigationMenuContent,\n Link: NavigationMenuLink,\n Icon: NavigationMenuIcon,\n Portal: NavigationMenuPortal,\n Positioner: NavigationMenuPositioner,\n Viewport: NavigationMenuViewport,\n Popup: NavigationMenuPopup,\n Backdrop: NavigationMenuBackdrop,\n Arrow: NavigationMenuArrow,\n};\n"],"mappings":";;;;;;;AA4BA,MAAM,wBAAwB,cAAiD,IAAI;AACnF,MAAM,4BAA4B,cAAyC,IAAI;AAE/E,SAAS,2BAA2B;CAClC,MAAM,UAAU,WAAW,qBAAqB;CAChD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,mEAAmE;CAGrF,OAAO;AACT;AAeA,MAAaA,uBAAqB,WAChC,SAAS,mBACP,EACE,UACA,WACA,cACA,eACA,cAAc,cACd,OACA,GAAG,SAEL,KACA;CACA,MAAM,CAAC,mBAAmB,wBAAwB,SAAwB,gBAAgB,IAAI;CAC9F,MAAM,iBAAiB,OAA2B,IAAI;CAKtD,MAAM,gBAAgB,UAAU,KAAA,IAAY,oBAAoB;CAChE,MAAM,SAAS,eAAe,EAAE,YAAY,CAAC;CAC7C,MAAM,QAAQ,kBAAkB;EAC9B,IAAI,UAAU,KAAA,GAAW,qBAAqB,IAAI;OAC7C,gBAAgB,IAAI;CAC3B,GAAG,CAAC,eAAe,KAAK,CAAC;CAEzB,gBAAgB;EACd,IAAI,kBAAkB,MAAM;EAE5B,MAAM,sBAAsB,UAAsB;GAChD,MAAM,SAAS,MAAM;GACrB,IAAI,EAAE,kBAAkB,UAAU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AQ;CACR,YAAY;CACZ,UAAU;CACV,OAAO;CACP,UAAU;CACV,OAAO;AACT"}
1
+ {"version":3,"file":"navigation-menu.js","names":["NavigationMenuRoot","BaseNavigationMenu","NavigationMenu"],"sources":["../../../src/components/navigation-menu/navigation-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { NavigationMenuRoot as BaseNavigationMenuRoot } from \"@base-ui/react/navigation-menu\";\n\nimport { navigationMenu } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type NavigationMenuOrientation = \"horizontal\" | \"vertical\";\n\ninterface NavigationMenuContextValue {\n close: () => void;\n orientation: NavigationMenuOrientation;\n styles: ReturnType<typeof navigationMenu>;\n value: string | null;\n}\n\nconst NavigationMenuContext = createContext<NavigationMenuContextValue | null>(null);\nconst NavigationMenuItemContext = createContext<{ value?: string } | null>(null);\n\nfunction useNavigationMenuContext() {\n const context = useContext(NavigationMenuContext);\n if (!context) {\n throw new Error(\"NavigationMenu parts must be rendered inside NavigationMenu.Root.\");\n }\n\n return context;\n}\n\nexport interface NavigationMenuRootProps\n extends Omit<\n BaseNavigationMenuRoot.Props<string>,\n \"children\" | \"className\" | \"onValueChange\" | \"value\" | \"defaultValue\"\n > {\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n orientation?: NavigationMenuOrientation;\n children?: ReactNode;\n className?: string;\n}\n\nexport const NavigationMenuRoot = forwardRef<HTMLElement, NavigationMenuRootProps>(\n function NavigationMenuRoot(\n {\n children,\n className,\n defaultValue,\n onValueChange,\n orientation = \"horizontal\",\n value,\n ...props\n },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState<string | null>(defaultValue ?? null);\n const rootElementRef = useRef<HTMLElement | null>(null);\n // Keep the Base UI primitive controlled by the wrapper state even when the\n // consumer uses the uncontrolled API. This keeps the viewport and the\n // primitive in sync when Base UI dismisses a menu (pointer leave, outside\n // press, Escape or pressing the trigger again).\n const resolvedValue = value === undefined ? uncontrolledValue : value;\n const styles = navigationMenu({ orientation });\n const close = useCallback(() => {\n if (value === undefined) setUncontrolledValue(null);\n else onValueChange?.(null);\n }, [onValueChange, value]);\n\n useEffect(() => {\n if (resolvedValue === null) return;\n const handleOutsidePress = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (rootElementRef.current?.contains(target)) return;\n if (\n target.closest(\n '[data-slot=\"navigation-menu-content\"], [data-slot=\"navigation-menu-positioner\"], [data-slot=\"navigation-menu-popup\"], [data-slot=\"navigation-menu-viewport\"]',\n )\n ) {\n return;\n }\n close();\n };\n document.addEventListener(\"click\", handleOutsidePress);\n return () => document.removeEventListener(\"click\", handleOutsidePress);\n }, [close, resolvedValue]);\n\n const setRootRef = (element: HTMLElement | null) => {\n rootElementRef.current = element;\n if (typeof ref === \"function\") ref(element);\n else if (ref) ref.current = element;\n };\n\n return (\n <NavigationMenuContext.Provider value={{ close, orientation, styles, value: resolvedValue }}>\n <BaseNavigationMenu.Root\n {...props}\n onValueChange={(next) => {\n if (value === undefined) setUncontrolledValue(next);\n onValueChange?.(next);\n }}\n orientation={orientation}\n ref={setRootRef}\n value={resolvedValue}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"navigation-menu\"\n data-orientation={orientation}\n data-slot=\"navigation-menu\"\n >\n {children}\n </BaseNavigationMenu.Root>\n </NavigationMenuContext.Provider>\n );\n },\n);\n\nexport type NavigationMenuListProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.List>;\nexport const NavigationMenuList = forwardRef<HTMLUListElement, NavigationMenuListProps>(\n function NavigationMenuList({ className, ...props }, ref) {\n const { styles, orientation } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.List\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.list, className)}\n data-orientation={orientation}\n data-slot=\"navigation-menu-list\"\n />\n );\n },\n);\n\nexport type NavigationMenuItemProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Item>;\nexport const NavigationMenuItem = forwardRef<HTMLLIElement, NavigationMenuItemProps>(\n function NavigationMenuItem({ children, className, value, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n const generatedValue = useId();\n const itemValue = value ?? generatedValue;\n return (\n <NavigationMenuItemContext.Provider value={{ value: itemValue }}>\n <BaseNavigationMenu.Item\n {...props}\n ref={ref}\n value={itemValue}\n className={withRecipeClassName(styles.item, className)}\n data-slot=\"navigation-menu-item\"\n >\n {children}\n </BaseNavigationMenu.Item>\n </NavigationMenuItemContext.Provider>\n );\n },\n);\n\nexport type NavigationMenuTriggerProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Trigger\n>;\nexport const NavigationMenuTrigger = forwardRef<HTMLButtonElement, NavigationMenuTriggerProps>(\n function NavigationMenuTrigger({ className, onClick, ...props }, ref) {\n const { close, styles, value } = useNavigationMenuContext();\n const item = useContext(NavigationMenuItemContext);\n return (\n <BaseNavigationMenu.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-slot=\"navigation-menu-trigger\"\n onClick={(event) => {\n // Base UI intentionally keeps a hover-opened menu open for a brief\n // patient-click window. For a component library trigger, a second\n // click should always be an explicit close action.\n if (item?.value !== undefined && value === item.value) {\n event.preventDefault();\n close();\n }\n onClick?.(event);\n }}\n />\n );\n },\n);\n\nexport type NavigationMenuContentProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Content\n>;\nexport const NavigationMenuContent = forwardRef<HTMLDivElement, NavigationMenuContentProps>(\n function NavigationMenuContent({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Content\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.content, className)}\n data-slot=\"navigation-menu-content\"\n />\n );\n },\n);\n\nexport type NavigationMenuLinkProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Link>;\nexport const NavigationMenuLink = forwardRef<HTMLAnchorElement, NavigationMenuLinkProps>(\n function NavigationMenuLink({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Link\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.link, className)}\n data-slot=\"navigation-menu-link\"\n />\n );\n },\n);\n\nexport type NavigationMenuIconProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Icon>;\nexport const NavigationMenuIcon = forwardRef<HTMLSpanElement, NavigationMenuIconProps>(\n function NavigationMenuIcon({ children = \"⌄\", className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.icon, className)}\n data-slot=\"navigation-menu-icon\"\n >\n {children}\n </BaseNavigationMenu.Icon>\n );\n },\n);\n\nexport const NavigationMenuPortal = BaseNavigationMenu.Portal;\n\nexport type NavigationMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Positioner\n>;\nexport const NavigationMenuPositioner = forwardRef<HTMLDivElement, NavigationMenuPositionerProps>(\n function NavigationMenuPositioner({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"navigation-menu-positioner\"\n />\n );\n },\n);\n\nexport type NavigationMenuViewportProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Viewport\n>;\nexport const NavigationMenuViewport = forwardRef<HTMLDivElement, NavigationMenuViewportProps>(\n function NavigationMenuViewport({ className, ...props }, ref) {\n const { styles, value } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.viewport, className)}\n data-open={value !== null ? \"true\" : \"false\"}\n data-slot=\"navigation-menu-viewport\"\n />\n );\n },\n);\n\nexport type NavigationMenuPopupProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Popup>;\nexport const NavigationMenuPopup = forwardRef<HTMLElement, NavigationMenuPopupProps>(\n function NavigationMenuPopup({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"navigation-menu-popup\"\n />\n );\n },\n);\n\nexport type NavigationMenuBackdropProps = ComponentPropsWithoutRef<\n typeof BaseNavigationMenu.Backdrop\n>;\nexport const NavigationMenuBackdrop = forwardRef<HTMLDivElement, NavigationMenuBackdropProps>(\n function NavigationMenuBackdrop({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.backdrop, className)}\n data-slot=\"navigation-menu-backdrop\"\n />\n );\n },\n);\n\nexport type NavigationMenuArrowProps = ComponentPropsWithoutRef<typeof BaseNavigationMenu.Arrow>;\nexport const NavigationMenuArrow = forwardRef<HTMLDivElement, NavigationMenuArrowProps>(\n function NavigationMenuArrow({ className, ...props }, ref) {\n const { styles } = useNavigationMenuContext();\n return (\n <BaseNavigationMenu.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.arrow, className)}\n data-slot=\"navigation-menu-arrow\"\n />\n );\n },\n);\n\nexport const NavigationMenu = {\n Root: NavigationMenuRoot,\n List: NavigationMenuList,\n Item: NavigationMenuItem,\n Trigger: NavigationMenuTrigger,\n Content: NavigationMenuContent,\n Link: NavigationMenuLink,\n Icon: NavigationMenuIcon,\n Portal: NavigationMenuPortal,\n Positioner: NavigationMenuPositioner,\n Viewport: NavigationMenuViewport,\n Popup: NavigationMenuPopup,\n Backdrop: NavigationMenuBackdrop,\n Arrow: NavigationMenuArrow,\n};\n"],"mappings":";;;;;;;AA4BA,MAAM,wBAAwB,cAAiD,IAAI;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,WAAW,yBAAyB;CAC5C,OACE,oBAACA,eAAmB,OAApB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,OAAO,SAAS;EACtD,aAAU;CACX,CAAA;AAEL,CACF;AAKA,MAAa,yBAAyB,WACpC,SAAS,uBAAuB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC5D,MAAM,EAAE,WAAW,yBAAyB;CAC5C,OACE,oBAACA,eAAmB,UAApB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,UAAU,SAAS;EACzD,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,MAAM,EAAE,WAAW,yBAAyB;CAC5C,OACE,oBAACA,eAAmB,OAApB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,OAAO,SAAS;EACtD,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAaC,mBAAiB;CAC5B,MAAMF;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,SAAS;CACT,MAAM;CACN,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,UAAU;CACV,OAAO;CACP,UAAU;CACV,OAAO;AACT"}
@@ -1,8 +1,10 @@
1
1
  "use client";
2
2
  const require_cx = require("../../styled-system/css/cx.cjs");
3
+ const require_base_ui = require("../base-ui.cjs");
3
4
  const require_sidebar = require("../../styled-system/recipes/sidebar.cjs");
4
5
  let react = require("react");
5
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
+ let _base_ui_react_dialog = require("@base-ui/react/dialog");
6
8
  //#region src/components/sidebar/sidebar.tsx
7
9
  const SidebarContext = (0, react.createContext)(null);
8
10
  /**
@@ -22,7 +24,7 @@ function useSidebarStyles() {
22
24
  /**
23
25
  * The sidebar container. It supports both controlled and uncontrolled state.
24
26
  */
25
- const SidebarRoot = (0, react.forwardRef)(function SidebarRoot({ children, className, defaultOpen = true, onOpenChange, open: controlledOpen, ...props }, ref) {
27
+ const SidebarRoot = (0, react.forwardRef)(function SidebarRoot({ children, className, closeOnEscape = true, closeOnOutsidePress = true, defaultOpen = true, modal = true, mode = "static", onOpenChange, open: controlledOpen, restoreFocus = true, ...props }, ref) {
26
28
  const [uncontrolledOpen, setUncontrolledOpen] = (0, react.useState)(defaultOpen);
27
29
  const isControlled = controlledOpen !== void 0;
28
30
  const open = controlledOpen ?? uncontrolledOpen;
@@ -43,19 +45,61 @@ const SidebarRoot = (0, react.forwardRef)(function SidebarRoot({ children, class
43
45
  toggle
44
46
  ]);
45
47
  const styles = require_sidebar.sidebar({ open });
46
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarContext.Provider, {
48
+ const surface = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
49
+ ...props,
50
+ ref,
51
+ className: require_cx.cx(styles.root, className),
52
+ "data-jaci-component": "sidebar",
53
+ "data-open": open,
54
+ "data-slot": "sidebar",
55
+ "data-state": open ? "open" : "closed",
56
+ children
57
+ });
58
+ if (mode === "overlay") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarContext.Provider, {
47
59
  value: context,
48
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
49
- ...props,
50
- ref,
51
- className: require_cx.cx(styles.root, className),
52
- "data-jaci-component": "sidebar",
53
- "data-open": open,
54
- "data-slot": "sidebar",
55
- "data-state": open ? "open" : "closed",
56
- children
60
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Root, {
61
+ open,
62
+ modal,
63
+ onOpenChange: (nextOpen, details) => {
64
+ if (!nextOpen && (!closeOnEscape && details.reason === "escape-key" || !closeOnOutsidePress && details.reason === "outside-press")) {
65
+ details.cancel();
66
+ return;
67
+ }
68
+ setOpen(nextOpen);
69
+ },
70
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, {
71
+ className: require_cx.cx(styles.backdrop),
72
+ "data-jaci-component": "sidebar",
73
+ "data-slot": "sidebar-backdrop"
74
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Viewport, {
75
+ className: require_cx.cx(styles.viewport),
76
+ "data-slot": "sidebar-viewport",
77
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Popup, {
78
+ "aria-label": props["aria-label"] ?? "Sidebar navigation",
79
+ className: require_cx.cx(styles.popup),
80
+ "data-jaci-component": "sidebar",
81
+ "data-slot": "sidebar-popup",
82
+ finalFocus: restoreFocus,
83
+ initialFocus: true,
84
+ children: surface
85
+ })
86
+ })] })
57
87
  })
58
88
  });
89
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarContext.Provider, {
90
+ value: context,
91
+ children: surface
92
+ });
93
+ });
94
+ const SidebarPortal = _base_ui_react_dialog.Dialog.Portal;
95
+ const SidebarBackdrop = (0, react.forwardRef)(function SidebarBackdrop({ className, ...props }, ref) {
96
+ const { open } = useSidebar();
97
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, {
98
+ ...props,
99
+ className: require_base_ui.withRecipeClassName(require_sidebar.sidebar({ open }).backdrop, className),
100
+ "data-slot": "sidebar-backdrop",
101
+ ref
102
+ });
59
103
  });
60
104
  /**
61
105
  * A floating, accessible control that expands or collapses the sidebar.
@@ -141,6 +185,8 @@ const SidebarLabel = (0, react.forwardRef)(function SidebarLabel({ className, ..
141
185
  });
142
186
  const Sidebar = {
143
187
  Root: SidebarRoot,
188
+ Portal: SidebarPortal,
189
+ Backdrop: SidebarBackdrop,
144
190
  Toggle: SidebarToggle,
145
191
  Header: SidebarHeader,
146
192
  Content: SidebarContent,
@@ -150,11 +196,13 @@ const Sidebar = {
150
196
  };
151
197
  //#endregion
152
198
  exports.Sidebar = Sidebar;
199
+ exports.SidebarBackdrop = SidebarBackdrop;
153
200
  exports.SidebarContent = SidebarContent;
154
201
  exports.SidebarFooter = SidebarFooter;
155
202
  exports.SidebarHeader = SidebarHeader;
156
203
  exports.SidebarItem = SidebarItem;
157
204
  exports.SidebarLabel = SidebarLabel;
205
+ exports.SidebarPortal = SidebarPortal;
158
206
  exports.SidebarRoot = SidebarRoot;
159
207
  exports.SidebarToggle = SidebarToggle;
160
208
  exports.useSidebar = useSidebar;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.cjs","names":["sidebar","cx"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n { children, className, defaultOpen = true, onOpenChange, open: controlledOpen, ...props },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n\n return (\n <SidebarContext.Provider value={context}>\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n </SidebarContext.Provider>\n );\n});\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;AAiBA,MAAM,kBAAA,GAAA,MAAA,cAAA,CAA2D,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D;CAG5E,OAAO;AACT;AAEA,SAAS,mBAAmB;CAC1B,MAAM,EAAE,SAAS,WAAW;CAC5B,OAAOA,gBAAAA,QAAQ,EAAE,KAAK,CAAC;AACzB;;;;AAeA,MAAa,eAAA,GAAA,MAAA,WAAA,CAAwD,SAAS,YAC5E,EAAE,UAAU,WAAW,cAAc,MAAM,cAAc,MAAM,gBAAgB,GAAG,SAClF,KACA;CACA,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,SAAA,CAAgC,WAAW;CACpE,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,kBAAkB;CAE/B,MAAM,WAAA,GAAA,MAAA,YAAA,EACH,aAAsB;EACrB,IAAI,CAAC,cACH,oBAAoB,QAAQ;EAG9B,eAAe,QAAQ;CACzB,GACA,CAAC,cAAc,YAAY,CAC7B;CAEA,MAAM,UAAA,GAAA,MAAA,YAAA,OAA2B;EAC/B,QAAQ,CAAC,IAAI;CACf,GAAG,CAAC,MAAM,OAAO,CAAC;CAElB,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAM;EAAS;CAAO,IAC/B;EAAC;EAAM;EAAS;CAAM,CACxB;CACA,MAAM,SAASA,gBAAAA,QAAQ,EAAE,KAAK,CAAC;CAE/B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,eA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D;EACE,GAAI;EACJ,cAAY,aAAa;EACpB;EACL,WAAWA,WAAAA,GAAG,OAAO,SAAS,SAAS;EACvC,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA4D,SAAS,cAChF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAG,OAAO,QAAQ,SAAS;EACtC,aAAU;CACX,CAAA;AAEL,CAAC;;;;;;AAYD,MAAa,eAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,YAClF,EAAE,gBAAgB,aAAa,SAAS,OAAO,WAAW,GAAG,SAC7D,KACA;CACA,MAAM,EAAE,SAAS,WAAW;CAC5B,MAAM,SAASD,gBAAAA,QAAQ;EAAE;EAAQ;CAAK,CAAC;CAEvC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACJ,gBAAc,gBAAgB,SAAS,SAAS,KAAA;EAC3C;EACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAWA,WAAAA,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
1
+ {"version":3,"file":"sidebar.cjs","names":["sidebar","cx","BaseDialog","withRecipeClassName"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport const SidebarPortal: typeof BaseDialog.Portal = BaseDialog.Portal;\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarH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,WAAAA,GAAG,OAAO,SAAS,SAAS;EACvC,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA4D,SAAS,cAChF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAG,OAAO,QAAQ,SAAS;EACtC,aAAU;CACX,CAAA;AAEL,CAAC;;;;;;AAYD,MAAa,eAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,YAClF,EAAE,gBAAgB,aAAa,SAAS,OAAO,WAAW,GAAG,SAC7D,KACA;CACA,MAAM,EAAE,SAAS,WAAW;CAC5B,MAAM,SAASD,gBAAAA,QAAQ;EAAE;EAAQ;CAAK,CAAC;CAEvC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACJ,gBAAc,gBAAgB,SAAS,SAAS,KAAA;EAC3C;EACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAWA,WAAAA,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
@@ -1,4 +1,5 @@
1
1
  import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import { Dialog } from "@base-ui/react/dialog";
2
3
  //#region src/components/sidebar/sidebar.d.ts
3
4
  interface SidebarContextValue {
4
5
  /** Whether the sidebar is visually expanded. */
@@ -21,6 +22,16 @@ interface SidebarRootProps extends ComponentPropsWithoutRef<"aside"> {
21
22
  defaultOpen?: boolean;
22
23
  /** Called after the requested expanded state changes. */
23
24
  onOpenChange?: (open: boolean) => void;
25
+ /** Renders the sidebar as a modal mobile surface when set to overlay. */
26
+ mode?: "static" | "overlay";
27
+ /** Allows Escape to be disabled for overlay mode. */
28
+ closeOnEscape?: boolean;
29
+ /** Allows outside presses to be disabled for overlay mode. */
30
+ closeOnOutsidePress?: boolean;
31
+ /** Restores focus to the element that opened the overlay. */
32
+ restoreFocus?: boolean;
33
+ /** Controls whether the overlay traps focus and locks page scroll. */
34
+ modal?: boolean | "trap-focus";
24
35
  children?: ReactNode;
25
36
  }
26
37
  /**
@@ -52,6 +63,8 @@ type SidebarLabelProps = ComponentPropsWithoutRef<"span">;
52
63
  declare const SidebarLabel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
53
64
  declare const Sidebar: {
54
65
  Root: import("react").ForwardRefExoticComponent<SidebarRootProps & import("react").RefAttributes<HTMLElement>>;
66
+ Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
67
+ Backdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
68
  Toggle: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
56
69
  Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
57
70
  Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
@@ -1,4 +1,5 @@
1
1
  import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import { Dialog } from "@base-ui/react/dialog";
2
3
  //#region src/components/sidebar/sidebar.d.ts
3
4
  interface SidebarContextValue {
4
5
  /** Whether the sidebar is visually expanded. */
@@ -21,6 +22,16 @@ interface SidebarRootProps extends ComponentPropsWithoutRef<"aside"> {
21
22
  defaultOpen?: boolean;
22
23
  /** Called after the requested expanded state changes. */
23
24
  onOpenChange?: (open: boolean) => void;
25
+ /** Renders the sidebar as a modal mobile surface when set to overlay. */
26
+ mode?: "static" | "overlay";
27
+ /** Allows Escape to be disabled for overlay mode. */
28
+ closeOnEscape?: boolean;
29
+ /** Allows outside presses to be disabled for overlay mode. */
30
+ closeOnOutsidePress?: boolean;
31
+ /** Restores focus to the element that opened the overlay. */
32
+ restoreFocus?: boolean;
33
+ /** Controls whether the overlay traps focus and locks page scroll. */
34
+ modal?: boolean | "trap-focus";
24
35
  children?: ReactNode;
25
36
  }
26
37
  /**
@@ -52,6 +63,8 @@ type SidebarLabelProps = ComponentPropsWithoutRef<"span">;
52
63
  declare const SidebarLabel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
53
64
  declare const Sidebar: {
54
65
  Root: import("react").ForwardRefExoticComponent<SidebarRootProps & import("react").RefAttributes<HTMLElement>>;
66
+ Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
67
+ Backdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
68
  Toggle: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
56
69
  Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
57
70
  Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
@@ -1,8 +1,10 @@
1
1
  "use client";
2
2
  import { cx } from "../../styled-system/css/cx.js";
3
+ import { withRecipeClassName } from "../base-ui.js";
3
4
  import { sidebar } from "../../styled-system/recipes/sidebar.js";
4
5
  import { createContext, forwardRef, useCallback, useContext, useMemo, useState } from "react";
5
- import { jsx } from "react/jsx-runtime";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Dialog } from "@base-ui/react/dialog";
6
8
  //#region src/components/sidebar/sidebar.tsx
7
9
  const SidebarContext = createContext(null);
8
10
  /**
@@ -22,7 +24,7 @@ function useSidebarStyles() {
22
24
  /**
23
25
  * The sidebar container. It supports both controlled and uncontrolled state.
24
26
  */
25
- const SidebarRoot = forwardRef(function SidebarRoot({ children, className, defaultOpen = true, onOpenChange, open: controlledOpen, ...props }, ref) {
27
+ const SidebarRoot = forwardRef(function SidebarRoot({ children, className, closeOnEscape = true, closeOnOutsidePress = true, defaultOpen = true, modal = true, mode = "static", onOpenChange, open: controlledOpen, restoreFocus = true, ...props }, ref) {
26
28
  const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
27
29
  const isControlled = controlledOpen !== void 0;
28
30
  const open = controlledOpen ?? uncontrolledOpen;
@@ -43,19 +45,61 @@ const SidebarRoot = forwardRef(function SidebarRoot({ children, className, defau
43
45
  toggle
44
46
  ]);
45
47
  const styles = sidebar({ open });
46
- return /* @__PURE__ */ jsx(SidebarContext.Provider, {
48
+ const surface = /* @__PURE__ */ jsx("aside", {
49
+ ...props,
50
+ ref,
51
+ className: cx(styles.root, className),
52
+ "data-jaci-component": "sidebar",
53
+ "data-open": open,
54
+ "data-slot": "sidebar",
55
+ "data-state": open ? "open" : "closed",
56
+ children
57
+ });
58
+ if (mode === "overlay") return /* @__PURE__ */ jsx(SidebarContext.Provider, {
47
59
  value: context,
48
- children: /* @__PURE__ */ jsx("aside", {
49
- ...props,
50
- ref,
51
- className: cx(styles.root, className),
52
- "data-jaci-component": "sidebar",
53
- "data-open": open,
54
- "data-slot": "sidebar",
55
- "data-state": open ? "open" : "closed",
56
- children
60
+ children: /* @__PURE__ */ jsx(Dialog.Root, {
61
+ open,
62
+ modal,
63
+ onOpenChange: (nextOpen, details) => {
64
+ if (!nextOpen && (!closeOnEscape && details.reason === "escape-key" || !closeOnOutsidePress && details.reason === "outside-press")) {
65
+ details.cancel();
66
+ return;
67
+ }
68
+ setOpen(nextOpen);
69
+ },
70
+ children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {
71
+ className: cx(styles.backdrop),
72
+ "data-jaci-component": "sidebar",
73
+ "data-slot": "sidebar-backdrop"
74
+ }), /* @__PURE__ */ jsx(Dialog.Viewport, {
75
+ className: cx(styles.viewport),
76
+ "data-slot": "sidebar-viewport",
77
+ children: /* @__PURE__ */ jsx(Dialog.Popup, {
78
+ "aria-label": props["aria-label"] ?? "Sidebar navigation",
79
+ className: cx(styles.popup),
80
+ "data-jaci-component": "sidebar",
81
+ "data-slot": "sidebar-popup",
82
+ finalFocus: restoreFocus,
83
+ initialFocus: true,
84
+ children: surface
85
+ })
86
+ })] })
57
87
  })
58
88
  });
89
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, {
90
+ value: context,
91
+ children: surface
92
+ });
93
+ });
94
+ const SidebarPortal = Dialog.Portal;
95
+ const SidebarBackdrop = forwardRef(function SidebarBackdrop({ className, ...props }, ref) {
96
+ const { open } = useSidebar();
97
+ return /* @__PURE__ */ jsx(Dialog.Backdrop, {
98
+ ...props,
99
+ className: withRecipeClassName(sidebar({ open }).backdrop, className),
100
+ "data-slot": "sidebar-backdrop",
101
+ ref
102
+ });
59
103
  });
60
104
  /**
61
105
  * A floating, accessible control that expands or collapses the sidebar.
@@ -141,6 +185,8 @@ const SidebarLabel = forwardRef(function SidebarLabel({ className, ...props }, r
141
185
  });
142
186
  const Sidebar = {
143
187
  Root: SidebarRoot,
188
+ Portal: SidebarPortal,
189
+ Backdrop: SidebarBackdrop,
144
190
  Toggle: SidebarToggle,
145
191
  Header: SidebarHeader,
146
192
  Content: SidebarContent,
@@ -149,6 +195,6 @@ const Sidebar = {
149
195
  Label: SidebarLabel
150
196
  };
151
197
  //#endregion
152
- export { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarItem, SidebarLabel, SidebarRoot, SidebarToggle, useSidebar };
198
+ export { Sidebar, SidebarBackdrop, SidebarContent, SidebarFooter, SidebarHeader, SidebarItem, SidebarLabel, SidebarPortal, SidebarRoot, SidebarToggle, useSidebar };
153
199
 
154
200
  //# sourceMappingURL=sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","names":[],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n { children, className, defaultOpen = true, onOpenChange, open: controlledOpen, ...props },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n\n return (\n <SidebarContext.Provider value={context}>\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n </SidebarContext.Provider>\n );\n});\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;AAiBA,MAAM,iBAAiB,cAA0C,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,UAAU,WAAW,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D;CAG5E,OAAO;AACT;AAEA,SAAS,mBAAmB;CAC1B,MAAM,EAAE,SAAS,WAAW;CAC5B,OAAO,QAAQ,EAAE,KAAK,CAAC;AACzB;;;;AAeA,MAAa,cAAc,WAA0C,SAAS,YAC5E,EAAE,UAAU,WAAW,cAAc,MAAM,cAAc,MAAM,gBAAgB,GAAG,SAClF,KACA;CACA,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,WAAW;CACpE,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,kBAAkB;CAE/B,MAA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;CACX,CAAA;AAEL,CAAC;AAID,MAAa,iBAAiB,WAA6C,SAAS,eAClF,EAAE,cAAc,WAAW,WAAW,GAAG,SACzC,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,cAAY,aAAa;EACpB;EACL,WAAW,GAAG,OAAO,SAAS,SAAS;EACvC,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAgB,WAA4C,SAAS,cAChF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,UAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,QAAQ,SAAS;EACtC,aAAU;CACX,CAAA;AAEL,CAAC;;;;;;AAYD,MAAa,cAAc,WAAgD,SAAS,YAClF,EAAE,gBAAgB,aAAa,SAAS,OAAO,WAAW,GAAG,SAC7D,KACA;CACA,MAAM,EAAE,SAAS,WAAW;CAC5B,MAAM,SAAS,QAAQ;EAAE;EAAQ;CAAK,CAAC;CAEvC,OACE,oBAAC,KAAD;EACE,GAAI;EACJ,gBAAc,gBAAgB,SAAS,SAAS,KAAA;EAC3C;EACL,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAe,WAA+C,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
1
+ {"version":3,"file":"sidebar.js","names":["BaseDialog"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport const SidebarPortal: typeof BaseDialog.Portal = BaseDialog.Portal;\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: Sid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AiB;CAEhC,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
@@ -0,0 +1,2 @@
1
+ import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperItemProps, StepperList, StepperNavigationButtonProps, StepperNext, StepperOrientation, StepperPrevious, StepperRoot, StepperRootProps, StepperSeparator, StepperStatus, StepperTitle, StepperTrigger, StepperTriggerProps } from "./stepper.cjs";
2
+ export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, type StepperItemProps, StepperList, type StepperNavigationButtonProps, StepperNext, type StepperOrientation, StepperPrevious, StepperRoot, type StepperRootProps, StepperSeparator, type StepperStatus, StepperTitle, StepperTrigger, type StepperTriggerProps };
@@ -0,0 +1,2 @@
1
+ import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperItemProps, StepperList, StepperNavigationButtonProps, StepperNext, StepperOrientation, StepperPrevious, StepperRoot, StepperRootProps, StepperSeparator, StepperStatus, StepperTitle, StepperTrigger, StepperTriggerProps } from "./stepper.js";
2
+ export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, type StepperItemProps, StepperList, type StepperNavigationButtonProps, StepperNext, type StepperOrientation, StepperPrevious, StepperRoot, type StepperRootProps, StepperSeparator, type StepperStatus, StepperTitle, StepperTrigger, type StepperTriggerProps };