Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: styling for icon button and field label #1761

Merged
merged 5 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quick-pans-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@strapi/design-system': patch
---

fix: icon button default size updated to small
4 changes: 2 additions & 2 deletions docs/stories/04-components/IconButton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ variants available. However, `tertiary` is considered the default.

<Canvas of={IconButtonStories.Disabled} />

### Small Size
### Medium Size

<Canvas of={IconButtonStories.SizeSmall} />
<Canvas of={IconButtonStories.SizeMedium} />

### Large Size

Expand Down
9 changes: 4 additions & 5 deletions docs/stories/04-components/IconButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const meta: Meta<IconButtonArgs> = {
disabled: false,
label: 'More actions',
onClick: fn(),
size: 'M',
variant: 'tertiary',
},
argTypes: {
Expand Down Expand Up @@ -94,22 +93,22 @@ export const Disabled = {
name: 'disabled',
} satisfies Story;

export const SizeSmall = {
export const SizeMedium = {
args: {
size: 'S',
size: 'M',
},
parameters: {
docs: {
source: {
code: outdent`
<IconButton size="S" label="More actions">
<IconButton size="M" label="More actions">
<More />
</IconButton>
`,
},
},
},
name: 'size small',
name: 'size medium',
} satisfies Story;

export const SizeLarge = {
Expand Down
1 change: 1 addition & 0 deletions packages/design-system/src/components/Field/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const Label = React.forwardRef<HTMLLabelElement, LabelProps>(({ children, action
id={`${id}-label`}
htmlFor={id}
tag="label"
ellipsis
>
{children}
{required && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const IconButton = forwardRef(
children,
disabled = false,
onClick,
size = 'M',
size = 'S',
variant = 'tertiary',
withTooltip = true,
...restProps
Expand Down Expand Up @@ -81,8 +81,8 @@ const IconButtonWrapper = styled<FlexComponent<'button'>>(Flex)<IconButtonWrappe
switch (props.$size) {
case 'S': {
return css`
padding-block: 0.6rem;
padding-inline: 0.6rem;
padding-block: 0.7rem;
padding-inline: 0.7rem;
`;
}
case 'M': {
Expand Down
Loading