From df7521e93a7ff0a284a1736dffbed3ca3b920643 Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Wed, 13 Nov 2024 12:45:26 +0530 Subject: [PATCH] chore: Update ADS button min width (#37338) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Sets the min width of an ADS button (expect icon buttons) to be 60px Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: > Commit: 224483d356083468d27acc5bb6a3d2b059ba8146 > Cypress dashboard. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR:
    >
  1. cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Inputs_spec.js
> List of identified flaky tests. >
Wed, 13 Nov 2024 04:12:40 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Enhanced button styles to include minimum width constraints: 60 pixels for small buttons and 80 pixels for medium buttons, improving layout consistency for non-icon buttons. - Introduced a new property `isIconButton` in the `Button` component to adjust button presentation. - Added functionality to refresh the workspace list immediately after creating a new workspace. - Implemented improved error handling by checking for `workspace.id` before rendering workspace items. - Added a new state variable to manage the visibility of the import application modal. --- .../packages/design-system/ads/src/Button/Button.styles.tsx | 4 ++++ app/client/src/ce/pages/Applications/index.tsx | 1 + 2 files changed, 5 insertions(+) diff --git a/app/client/packages/design-system/ads/src/Button/Button.styles.tsx b/app/client/packages/design-system/ads/src/Button/Button.styles.tsx index b5e58e42b2..1fd71a2ca8 100644 --- a/app/client/packages/design-system/ads/src/Button/Button.styles.tsx +++ b/app/client/packages/design-system/ads/src/Button/Button.styles.tsx @@ -29,6 +29,7 @@ const getSizes = (size: ButtonSizes, isIconButton?: boolean) => { ? "var(--ads-v2-spaces-2)" : "var(--ads-v2-spaces-2) var(--ads-v2-spaces-3)"}; --button-gap: var(--ads-v2-spaces-2); + --button-min-width: 60px; `, md: css` --button-font-weight: 600; @@ -37,6 +38,7 @@ const getSizes = (size: ButtonSizes, isIconButton?: boolean) => { ? "var(--ads-v2-spaces-3)" : "var(--ads-v2-spaces-3) var(--ads-v2-spaces-4)"}; --button-gap: var(--ads-v2-spaces-3); + --button-min-width: 80px; `, }; @@ -175,6 +177,8 @@ export const ButtonContent = styled.div<{ box-sizing: border-box; padding: var(--button-padding); border-radius: inherit; + min-width: ${({ isIconButton }) => + isIconButton ? "unset" : "var(--button-min-width)"}; & > .${ButtonContentChildrenClassName} { display: flex; diff --git a/app/client/src/ce/pages/Applications/index.tsx b/app/client/src/ce/pages/Applications/index.tsx index df8d6176a5..5c3e54af7f 100644 --- a/app/client/src/ce/pages/Applications/index.tsx +++ b/app/client/src/ce/pages/Applications/index.tsx @@ -318,6 +318,7 @@ export function LeftPaneSection(props: {