Skip to content

Commit

Permalink
Remove :invalid pseudoclass from InputBox.Option (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored and ggazzo committed Nov 25, 2019
1 parent e116296 commit 20ea696
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/fuselage/src/components/Divider/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

import { createStyledComponent } from '../../styles';

const Container = createStyledComponent('rcx-divider', 'hr');

export const Divider = (props) => <Container {...props}/>;
10 changes: 10 additions & 0 deletions packages/fuselage/src/components/Divider/spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom';

import { Divider } from '../..';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Divider />, div);
ReactDOM.unmountComponentAtNode(div);
});
16 changes: 16 additions & 0 deletions packages/fuselage/src/components/Divider/stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { action } from '@storybook/addon-actions';
import { Meta, Preview, Props, Story } from '@storybook/addon-docs/blocks';

import { Divider } from '../..';

<Meta title='Misc|Divider' parameters={{ jest: ['Divider/spec'] }} />

# Divider

<Preview>
<Story name='Default'>
<Divider/>
</Story>
</Preview>

<Props of={Divider}/>
7 changes: 7 additions & 0 deletions packages/fuselage/src/components/Divider/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import '~@rocket.chat/fuselage-tokens/colors.scss';

.rcx-divider {
border: #{ $borders-width-x1 } solid #{ map-get($colors, dark300) };
margin-block-end: #{ $spaces-x16 };
margin-block-start: #{ $spaces-x16 };
}
5 changes: 0 additions & 5 deletions packages/fuselage/src/components/InputBox/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,6 @@

@include paragraph;
color: #{ $input-colors-color };

.rcx-input-box:invalid > &,
.rcx-input-box.invalid > & {
color: #{ $input-colors-invalid-color };
}
}

.rcx-skeleton__input {
Expand Down
1 change: 1 addition & 0 deletions packages/fuselage/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export * from './TextInput';
export * from './Tile';
export * from './ToggleSwitch';
export * from './UrlInput';
export * from './Divider';
1 change: 1 addition & 0 deletions packages/fuselage/src/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
@import './Text/styles.scss';
@import './Tile/styles.scss';
@import './ToggleSwitch/styles.scss';
@import './Divider/styles.scss';
2 changes: 2 additions & 0 deletions packages/fuselage/src/styles/variables/borders.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import '~@rocket.chat/fuselage-tokens/borders.scss';

$borders-width-x1: 1px;

$borders-width-x2: theme('borders-width-x2', to-rem(get-map-value($borders, widths, 1)));

$borders-radius-x2: theme('borders-radius-x2', to-rem(get-map-value($borders, radii, 1)));
Expand Down

0 comments on commit 20ea696

Please sign in to comment.