From 335b41e53e6823c57756737685282fa27e558a41 Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 21 Aug 2024 14:26:24 -0700 Subject: [PATCH] Allow controlling the gap between the icon and the content of OuiButton and OuiButtonEmpty Signed-off-by: Miki --- CHANGELOG.md | 1 + .../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 +- 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 + 14 files changed, 243 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/button/__snapshots__/button.test.tsx.snap b/src/components/button/__snapshots__/button.test.tsx.snap index 23d70d6fdb..3f88b56ce5 100644 --- a/src/components/button/__snapshots__/button.test.tsx.snap +++ b/src/components/button/__snapshots__/button.test.tsx.snap @@ -205,6 +205,72 @@ exports[`OuiButton props href secures the rel attribute when the target is _blan `; +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`] = `