From d1a1cb7ed9025a657141b76535ab49f00747ff70 Mon Sep 17 00:00:00 2001 From: Constance Date: Wed, 16 Nov 2022 15:36:23 -0800 Subject: [PATCH] [EuiButton] Improve `minWidth` handling (#6373) * EuiButton `minWidth` - allow disabling/removing minWidth without having to set an overriding inline style * Update snapshots * Props API - support `minWidth={false}` - since false satisfies the conditions already laid out by `minWidth={0}`, we should explicitly allow this option as well for clearer intention communication * [Typescript] Allow `EuiFacetButton` to accept the `minWidth` prop - and all other props EuiButtonDisplay accepts - it already `...rest`s them anyway, so this is just a question of typing * changelog * Snapshot updates --- .../__snapshots__/skip_link.test.tsx.snap | 10 ++-- .../button/__snapshots__/button.test.tsx.snap | 53 +++++++++---------- src/components/button/button.tsx | 1 + .../_button_display.test.tsx.snap | 2 +- .../button_display/_button_display.styles.ts | 5 +- .../button_display/_button_display.test.tsx | 28 ++++++++-- .../button/button_display/_button_display.tsx | 5 +- .../card/__snapshots__/card.test.tsx.snap | 4 +- .../__snapshots__/card_select.test.tsx.snap | 10 ++-- .../__snapshots__/control_bar.test.tsx.snap | 16 +++--- .../super_update_button.test.tsx.snap | 16 +++--- .../super_date_picker/super_update_button.tsx | 2 +- .../__snapshots__/facet_button.test.tsx.snap | 12 ++--- src/components/facet/facet_button.tsx | 4 +- .../__snapshots__/confirm_modal.test.tsx.snap | 4 +- upcoming_changelogs/6373.md | 6 +++ 16 files changed, 102 insertions(+), 76 deletions(-) create mode 100644 upcoming_changelogs/6373.md diff --git a/src/components/accessibility/skip_link/__snapshots__/skip_link.test.tsx.snap b/src/components/accessibility/skip_link/__snapshots__/skip_link.test.tsx.snap index 9f81dada84c..53af988e3e1 100644 --- a/src/components/accessibility/skip_link/__snapshots__/skip_link.test.tsx.snap +++ b/src/components/accessibility/skip_link/__snapshots__/skip_link.test.tsx.snap @@ -3,7 +3,7 @@ exports[`EuiSkipLink is rendered 1`] = ` @@ -34,7 +34,7 @@ exports[`EuiSkipLink props position absolute is rendered 1`] = ` exports[`EuiSkipLink props position fixed is rendered 1`] = ` @@ -59,7 +59,7 @@ exports[`EuiSkipLink props position static is rendered 1`] = ` exports[`EuiSkipLink props tabIndex is rendered 1`] = ` @@ -21,7 +21,7 @@ exports[`EuiButton is rendered 1`] = ` exports[`EuiButton props color accent is rendered 1`] = `