// Copyright (c) Meta Platforms, Inc. and affiliates. // SCRATCH — review evidence for #3890, not part of the PR. import type {Meta, StoryObj} from '@storybook/react'; import {useState} from 'react'; import { SideNav, SideNavCollapseButton, SideNavItem, SideNavSection, } from '@astryxdesign/core'; const meta: Meta = { title: 'Scratch/SideNav3890', component: SideNav, }; export default meta; type Story = StoryObj; function Nav({ collapsible, label, }: { collapsible: Record; label: string; }) { return ( ); } // A hidden-collapse nav whose ONLY control is a plain button — no // SideNavCollapseButton anywhere, so nothing registers in the toggle registry. function NoRegisteredToggle() { const [isCollapsed, setIsCollapsed] = useState(false); return (
); } export const NoOutsideToggle: Story = {render: () => }; // The built-in toggle with collapsedWidth: 0 — the default `hasButton`. function BuiltInButtonOnly() { const [isCollapsed, setIsCollapsed] = useState(false); return (
); } export const BuiltInButton: Story = {render: () => }; // Two hidden-collapse navs, each with its own outside toggle. The registry is // module-global and unkeyed, so which toggle nav B parks focus on is the test. function TwoNavs() { const [aCollapsed, setACollapsed] = useState(false); const [bCollapsed, setBCollapsed] = useState(false); const a = {isCollapsed: aCollapsed, onCollapsedChange: setACollapsed}; const b = {isCollapsed: bCollapsed, onCollapsedChange: setBCollapsed}; return (
); } export const TwoNavsShared: Story = {render: () => };