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

feat(button): remove custom wrap rules #82

Merged
merged 1 commit into from
Oct 23, 2023
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
6 changes: 3 additions & 3 deletions packages/ui-kit/src/ActionsBar/ActionsBar.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default (
<ActionsBarBTN>Test</ActionsBarBTN>
<ActionsBarBTN>Test</ActionsBarBTN>
<ActionsBarBTN active>Test</ActionsBarBTN>
<ActionsBarBTN size="small-xs">Test Small</ActionsBarBTN>
<ActionsBarBTN size="small-xs">Test Small</ActionsBarBTN>
<ActionsBarBTN size="small-xs">Test Small</ActionsBarBTN>
<ActionsBarBTN size="tiny">Test Small</ActionsBarBTN>
<ActionsBarBTN size="tiny">Test Small</ActionsBarBTN>
<ActionsBarBTN size="tiny">Test Small</ActionsBarBTN>
<ActionsBarBTN>Test</ActionsBarBTN>
</ActionsBar>
</div>
Expand Down
21 changes: 18 additions & 3 deletions packages/ui-kit/src/Button/Button.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EyeBallIcon } from '@konturio/default-icons';
import { useSelect, useValue } from 'react-cosmos/fixture';
import s from './fixture-style.module.css';
import { Button } from '.';

export default {
Expand Down Expand Up @@ -29,7 +30,7 @@ export default {
<Button onClick={console.log} size={size} disabled={disabled} iconBefore={<EyeBallIcon />} />
</div>
<h3>Invert-Outline</h3>
<div style={{ width: '250px', margin: '1em', gap: '1em', display: 'flex', flexFlow: 'row nowrap' }}>
<div style={{ width: '300px', margin: '1em', gap: '1em', display: 'flex', flexFlow: 'row nowrap' }}>
<Button onClick={console.log} size={size} disabled={disabled} variant="invert-outline">
Konturio
</Button>
Expand All @@ -40,7 +41,7 @@ export default {
disabled={disabled}
iconAfter={<EyeBallIcon />}
>
2 Lines
Two words
</Button>
<Button
variant="invert-outline"
Expand All @@ -49,7 +50,7 @@ export default {
disabled={disabled}
iconBefore={<EyeBallIcon />}
>
3 lines wrap text here
Three words here
</Button>
<Button
variant="invert-outline"
Expand Down Expand Up @@ -100,6 +101,20 @@ export default {
iconBefore={<EyeBallIcon />}
/>
</div>
<h3>Custom styles</h3>
<div style={{ margin: '1em' }}>
<Button
dark
variant="invert"
onClick={console.log}
size={size}
disabled={disabled}
iconBefore={<EyeBallIcon />}
className={size === 'large' ? s.customButton : ''}
>
{`Custom \n styles`}
</Button>
</div>
</div>
);
},
Expand Down
3 changes: 3 additions & 0 deletions packages/ui-kit/src/Button/fixture-style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.customButton {
white-space: pre-line;
}
2 changes: 1 addition & 1 deletion packages/ui-kit/src/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export const Button = forwardRef<HTMLButtonElement, React.PropsWithChildren<Butt
},
s[variant],
s[size],
className,
{
[s.active]: active,
[s.withContent]: hasContent,
[s.withIcon]: hasIcon,
},
className,
)}
{...props}
>
Expand Down
16 changes: 4 additions & 12 deletions packages/ui-kit/src/Button/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
box-shadow: none;
}

.buttonContent {
white-space: nowrap;
white-space: nowrap;
/* .buttonContent {
overflow: hidden;
text-overflow: ellipsis;
}
} */
}

.buttonDark {
Expand Down Expand Up @@ -102,15 +102,7 @@
text-align: center;
min-width: min-content;

&.withContent.withIcon .buttonContent {
white-space: normal;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;

-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
white-space: normal;

&.withContent.withIcon {
min-height: 76px;
Expand Down
Loading