From d5eb52abd2d5a4d6f0fdd59c3599fc3bc3d4ef21 Mon Sep 17 00:00:00 2001 From: Aylong <69762909+AyIong@users.noreply.github.com> Date: Sun, 22 Jun 2025 00:58:48 +0300 Subject: [PATCH 1/2] Improve `IconStack` (#203) --- lib/components/Icon.tsx | 15 +++++++++++++-- stories/components/Icon.stories.tsx | 16 ++++++++++++++++ styles/components/Icon.scss | 24 +++++++++++------------- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/lib/components/Icon.tsx b/lib/components/Icon.tsx index 884f7588..27599fee 100644 --- a/lib/components/Icon.tsx +++ b/lib/components/Icon.tsx @@ -64,8 +64,19 @@ export function Icon(props: Props) { ); } -function IconStack(props: BoxProps) { - const { className, children, ...rest } = props; +type IconStackProps = { + /** Works same as `Icon` size prop, but for all icons inside. */ + size?: number; +}; + +function IconStack(props: BoxProps & IconStackProps) { + const { className, children, size, ...rest } = props; + + const customStyle = rest.style || {}; + if (size) { + customStyle.fontSize = `${size * 100}%`; + } + rest.style = customStyle; return ( + + +
+ + + + + + ); + }, +}; diff --git a/styles/components/Icon.scss b/styles/components/Icon.scss index bce2cdd6..1087f555 100644 --- a/styles/components/Icon.scss +++ b/styles/components/Icon.scss @@ -1,18 +1,16 @@ -.IconStack > .Icon { - position: absolute; - width: 100%; - text-align: center; -} - .IconStack { position: relative; - display: inline-block; - height: 1.2em; - line-height: 2em; - vertical-align: middle; + display: inline-flex; + justify-content: center; + align-items: center; + + .Icon { + &:before { + vertical-align: middle; + } - &:after { - color: transparent; - content: "."; + &:not(:first-child) { + position: absolute; + } } } From b9d2ad27845a42e40154d7f6da3b293eaa60ff3e Mon Sep 17 00:00:00 2001 From: robuddybot <65057909+robuddybot@users.noreply.github.com> Date: Wed, 25 Jun 2025 01:59:16 +0000 Subject: [PATCH 2/2] Build & Release v4.3.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ef3dcd2..8b0d2e73 100644 --- a/package.json +++ b/package.json @@ -69,5 +69,5 @@ "test": "bun test" }, "type": "module", - "version": "4.3.1" + "version": "4.3.2" }