Skip to content

Commit

Permalink
feat: TET-660 fix width button issue (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwleklinski authored May 22, 2024
1 parent 2070c34 commit dc44083
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,12 @@ export const BareDisabled: Story = {
variant: 'bare',
},
};

// should automatically fill the width of the container
export const WithFlexContainer: Story = {
render: () => (
<div style={{ display: 'flex', width: '400px', flexDirection: 'column' }}>
<Button label="Button 1" />
</div>
),
};
2 changes: 1 addition & 1 deletion src/components/Button/Button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const commonConfig = {
display: 'inline-flex',
borderRadius: '$border-radius-large',
gap: '$space-component-gap-small',
w: 'fit-content',
w: 'auto',
justifyContent: 'center',
alignItems: 'center',
textAlign: 'center',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/stylesBuilder/stylesBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('stylesBuilder', () => {
textAlign: 'center',
transition: true,
transitionDuration: 200,
w: 'fit-content',
w: 'auto',
whiteSpace: 'nowrap',
},
loader: {
Expand Down

0 comments on commit dc44083

Please sign in to comment.