From 7bdea7afd9874e3c1b5ad75e5beb62763dcc7fe7 Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 21 Aug 2024 15:21:21 -0700 Subject: [PATCH] Allow controlling the gap between the icon and the content of OuiButton and OuiButtonEmpty (#1367) Signed-off-by: Miki --- CHANGELOG.md | 1 + .../in_memory_table.test.tsx.snap | 3 + .../button/__snapshots__/button.test.tsx.snap | 66 +++++++++++++++++++ src/components/button/button.test.tsx | 16 ++++- src/components/button/button.tsx | 4 +- src/components/button/button_content.tsx | 17 +++++ .../__snapshots__/button_empty.test.tsx.snap | 66 +++++++++++++++++++ .../button/button_empty/button_empty.test.tsx | 16 ++++- .../button/button_empty/button_empty.tsx | 4 +- .../__snapshots__/control_bar.test.tsx.snap | 7 ++ .../__snapshots__/split_button.test.tsx.snap | 7 ++ src/global_styling/mixins/_button.scss | 18 +++++ src/global_styling/variables/_size.scss | 1 + .../global_styling/mixins/_button.scss | 18 +++++ .../global_styling/variables/_size.scss | 1 + .../v9/global_styling/mixins/_button.scss | 18 +++++ .../v9/global_styling/variables/_size.scss | 1 + 17 files changed, 260 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32138579a4..5c0bca2d7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### 📈 Features/Enhancements - Add new icons for workspaces ([#1365](https://github.com/opensearch-project/oui/pull/1365)) +- Add a property to control the gap between an icon and the content of OuiButton and OuiButtonEmpty ([#1367](https://github.com/opensearch-project/oui/pull/1367)) ### 🐛 Bug Fixes diff --git a/src/components/basic_table/__snapshots__/in_memory_table.test.tsx.snap b/src/components/basic_table/__snapshots__/in_memory_table.test.tsx.snap index ac72079baf..a65fa1469f 100644 --- a/src/components/basic_table/__snapshots__/in_memory_table.test.tsx.snap +++ b/src/components/basic_table/__snapshots__/in_memory_table.test.tsx.snap @@ -406,6 +406,7 @@ exports[`OuiInMemoryTable behavior pagination 1`] = ` > `; +exports[`OuiButton props iconGap m is rendered 1`] = ` + +`; + +exports[`OuiButton props iconGap none is rendered 1`] = ` + +`; + +exports[`OuiButton props iconGap s is rendered 1`] = ` + +`; + exports[`OuiButton props iconSide left is rendered 1`] = ` +`; + +exports[`OuiButtonEmpty props iconGap none is rendered 1`] = ` + +`; + +exports[`OuiButtonEmpty props iconGap s is rendered 1`] = ` + +`; + exports[`OuiButtonEmpty props iconSide left is rendered 1`] = `