From baef6aa2876b6e9dce1b07cc3ff736019868083d Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Mon, 25 Nov 2024 15:07:35 +0530 Subject: [PATCH] chore: Update size of sidebar + remove using sheet (#37638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/user-attachments/assets/94c51ceb-d0cd-47b8-9766-a160f43b6f6f /ok-to-test tags="@tag.Anvil" ## Summary by CodeRabbit ## Release Notes - **New Features** - Enhanced styling for the sidebar title for improved visual presentation. - Streamlined sidebar component stories for simplicity and focus on core functionality. - **Bug Fixes** - Removed unnecessary mobile state handling, resulting in a more efficient sidebar rendering. - **Style** - Updated CSS for sidebar components to improve responsiveness and visual consistency. - Adjusted display properties for sidebar classes to enhance visibility. - **Chores** - Removed the `SidebarInset` component to simplify the sidebar structure. - Introduced a new `side` property to the sidebar provider for better contextual control. > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 40e605795762c6a5822f1cbd6aed5f0aaf99a239 > Cypress dashboard. > Tags: `@tag.Anvil` > Spec: >
Thu, 21 Nov 2024 13:11:13 UTC --- .../src/components/Sidebar/src/Sidebar.tsx | 20 +-- .../components/Sidebar/src/SidebarContent.tsx | 12 +- .../components/Sidebar/src/SidebarInset.tsx | 22 --- .../Sidebar/src/SidebarProvider.tsx | 5 +- .../components/Sidebar/src/SidebarTrigger.tsx | 12 +- .../src/components/Sidebar/src/index.ts | 1 - .../components/Sidebar/src/styles.module.css | 127 +++++------------- .../src/components/Sidebar/src/types.ts | 8 +- .../Sidebar/stories/Sidebar.stories.tsx | 66 ++------- 9 files changed, 73 insertions(+), 200 deletions(-) delete mode 100644 app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarInset.tsx diff --git a/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx b/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx index 60b628f8da..820de64e50 100644 --- a/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx +++ b/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx @@ -3,7 +3,6 @@ import * as React from "react"; import { type Ref, useRef, useState } from "react"; import { CSSTransition } from "react-transition-group"; -import { Sheet } from "../../Sheet"; import styles from "./styles.module.css"; import { useSidebar } from "./use-sidebar"; import type { SidebarProps } from "./types"; @@ -19,13 +18,12 @@ const _Sidebar = (props: SidebarProps, ref: Ref) => { onEntered: onEnteredProp, onExit: onExitProp, onExited: onExitedProp, - side = "start", title, variant = "sidebar", ...rest } = props; const [isAnimating, setIsAnimating] = useState(false); - const { isMobile, setState, state } = useSidebar(); + const { side, state } = useSidebar(); const sidebarRef = useRef(); const onEnter = () => { @@ -64,22 +62,6 @@ const _Sidebar = (props: SidebarProps, ref: Ref) => { ); } - if (Boolean(isMobile)) { - return ( - setState(isOpen ? "expanded" : "collapsed")} - position={side} - > - {content} - - ); - } - return ( - {Boolean(title) && {title}} + {Boolean(title) && ( + + {title} + + )} {!isMobile && (