/* * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import { SidenavEventTypes } from "./events.js"; import { ComponentPropsWithRef, PropsWithChildren } from "react"; import { DisclosurePanelProps, DisclosureProps } from "react-aria-components/Disclosure"; import { ButtonProps } from "react-aria-components/Button"; import { LinkProps } from "react-aria-components/Link"; import { ToggleButtonProps } from "react-aria-components/ToggleButton"; import { UniqueId } from "@accelint/core"; import { PopoverProps } from "react-aria-components/Popover"; import { Payload } from "@accelint/bus"; import { Pressable } from "react-aria-components/Pressable"; //#region src/components/sidenav/types.d.ts /** * Props for Sidenav component. * - `id` - Unique identifier for the sidenav. * - `isHiddenWhenClosed` - Whether to hide the sidenav when closed. */ type SidenavProps = ComponentPropsWithRef<'nav'> & { id: UniqueId; isHiddenWhenClosed?: boolean; }; /** * Props for SidenavHeader component. * - `classNames.header` - CSS class for the header container. * - `classNames.button` - CSS class for the toggle button. * - `classNames.container` - CSS class for the content container. * - `classNames.icon` - CSS class for the chevron icon. */ type SidenavHeaderProps = PropsWithChildren<{ classNames?: { header?: string; button?: ButtonProps['className']; container?: string; icon?: string; }; }>; /** Props for SidenavContent component. */ type SidenavContentProps = ComponentPropsWithRef<'div'>; /** * Props for SidenavItem component. * - `classNames.button` - CSS class for the toggle button. * - `classNames.icon` - CSS class for the icon. * - `textValue` - Text displayed in tooltip when sidenav is collapsed. */ type SidenavItemProps = ToggleButtonProps & { classNames?: { button?: ToggleButtonProps['className']; icon?: string; }; textValue?: string; }; /** * Props for SidenavLink component. * - `classNames.button` - CSS class for the link. * - `classNames.icon` - CSS class for the icon. * - `textValue` - Text displayed in tooltip when sidenav is collapsed. */ type SidenavLinkProps = LinkProps & { classNames?: { button?: LinkProps['className']; icon?: string; }; textValue: string; }; /** Props for SidenavAvatar component. */ type SidenavAvatarProps = ComponentPropsWithRef<'div'>; /** Props for SidenavDivider component. */ type SidenavDividerProps = ComponentPropsWithRef<'hr'>; /** Props for SidenavFooter component. */ type SidenavFooterProps = ComponentPropsWithRef<'footer'>; /** Event payload for closing a sidenav. */ type SidenavCloseEvent = Payload; /** Event payload for opening a sidenav. */ type SidenavOpenEvent = Payload; /** Event payload for toggling a sidenav. */ type SidenavToggleEvent = Payload; /** Union of all sidenav event types. */ type SidenavEvent = SidenavOpenEvent | SidenavToggleEvent | SidenavCloseEvent; type TargetedEvents = `close:${UniqueId}` | `open:${UniqueId}` | `toggle:${UniqueId}`; /** * Props for SidenavTrigger component. * - `for` - Target sidenav ID or targeted event string (e.g., 'open:id', 'close:id'). */ type SidenavTriggerProps = ComponentPropsWithRef & { for: TargetedEvents | UniqueId; }; /** * Context value for Sidenav. * - `id` - Unique identifier of the sidenav. * - `isOpen` - Whether the sidenav is currently open. */ type SidenavContextValue = { id: UniqueId; isOpen: boolean; }; /** * Props for SidenavMenu component. * - `title` - Menu title displayed in header. * - `icon` - Icon displayed before the title. * - `classNames.menu` - CSS class for the disclosure container. * - `classNames.button` - CSS class for the trigger button. * - `classNames.icon` - CSS class for the chevron icon. * - `classNames.disclosurePanel` - CSS class for expanded panel. * - `classNames.popoverPanel` - CSS class for popover panel (collapsed state). * - `classNames.panelContent` - CSS class for panel content wrapper. */ type SidenavMenuProps = PropsWithChildren & { title: string; icon: React.ReactNode; classNames?: { menu?: DisclosureProps['className']; button?: ButtonProps['className']; icon?: string; disclosurePanel?: DisclosurePanelProps['className']; popoverPanel?: PopoverProps['className']; panelContent?: string; }; }; /** Props for SidenavMenuItem component. */ type SidenavMenuItemProps = ToggleButtonProps; //#endregion export { SidenavAvatarProps, SidenavCloseEvent, SidenavContentProps, SidenavContextValue, SidenavDividerProps, SidenavEvent, SidenavFooterProps, SidenavHeaderProps, SidenavItemProps, SidenavLinkProps, SidenavMenuItemProps, SidenavMenuProps, SidenavOpenEvent, SidenavProps, SidenavToggleEvent, SidenavTriggerProps }; //# sourceMappingURL=types.d.ts.map