Skip to content

Commit

Permalink
Fixes Selector component size padding (#2255)
Browse files Browse the repository at this point in the history
* Fixes Selector component size padding

* Fixes Selector label wrapping
  • Loading branch information
tareqlol authored Sep 26, 2023
1 parent e2f8230 commit 600eff2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-kiwis-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': patch
---

Fixes Selector component size padding
10 changes: 8 additions & 2 deletions packages/circuit-ui/components/Selector/Selector.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
height: 100%;
color: var(--cui-fg-normal);
text-align: center;
white-space: nowrap;
cursor: pointer;
background-color: var(--cui-bg-normal);
border-radius: var(--cui-border-radius-byte);
Expand Down Expand Up @@ -100,14 +101,15 @@
text-align: start;
}


/* Sizes */

.kilo {
padding: var(--cui-spacings-bit) var(--cui-spacings-mega);
padding: var(--cui-spacings-byte) var(--cui-spacings-kilo);
}

.mega {
padding: var(--cui-spacings-kilo) var(--cui-spacings-giga);
padding: var(--cui-spacings-kilo) var(--cui-spacings-mega);
}

.flexible {
Expand All @@ -118,6 +120,10 @@
font-weight: var(--cui-font-weight-bold);
}

.description {
white-space: initial;
}

.icon {
margin-bottom: var(--cui-spacings-bit);
}
4 changes: 3 additions & 1 deletion packages/circuit-ui/components/Selector/Selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ export const Selector = forwardRef<HTMLInputElement, SelectorProps>(
{hasDescription ? (
<Fragment>
<span className={classes.title}>{label || children}</span>
<span aria-hidden="true">{description}</span>
<span className={classes.description} aria-hidden="true">
{description}
</span>
</Fragment>
) : (
label || children
Expand Down

1 comment on commit 600eff2

@vercel
Copy link

@vercel vercel bot commented on 600eff2 Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.