Skip to content

Commit

Permalink
fix(checkbox): adds overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Firsov committed Feb 28, 2019
1 parent 8ad0d6c commit becce46
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/components/Checkbox/Checkbox.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// @flow

import React, { Component } from 'react';
import styled from 'react-emotion';

const Container = styled('div')`
max-width: 100px;
`;

class CheckboxState extends Component<*, Object> {
state = {
Expand All @@ -24,6 +29,9 @@ export default (asStory: *) => {
<Checkbox label="With Check" checked />
<Checkbox label="With error" checked hasError />
<Checkbox label="With disabled" checked disabled />
<Container>
<Checkbox label="With overflow" checked />
</Container>
</Column>
))
.add('with state', () => (
Expand All @@ -33,5 +41,6 @@ export default (asStory: *) => {
}
</CheckboxState>
));

});
};
5 changes: 5 additions & 0 deletions src/components/Checkbox/Checkbox.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const [CheckboxSquareTag, themeSquare] = createThemeTag(`${name}Square`, ({ COLO
width: '24px',
height: '24px',
transition: 'all .15s ease-in-out',
flexShrink: 0,

background: COLORS.WHITE,
border: `1px solid ${COLORS.PRIMARY_BORDER_COLOR}`,
Expand Down Expand Up @@ -53,6 +54,9 @@ const [CheckboxTextTag, themeText] = createThemeTag(`${name}Text`, ({ COLORS }:
root: {
paddingLeft: '12px',
cursor: 'pointer',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',

color: COLORS.SECONDARY_TEXT_COLOR,
fontSize: COLORS.BODY_TEXT,
Expand All @@ -71,6 +75,7 @@ const [CheckboxWrapperTag, themeWrapper] = createThemeTag(`${name}Wrapper`, {
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
overflow: 'hidden',
},
});

Expand Down

0 comments on commit becce46

Please sign in to comment.