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(password-input): support theming #635

Merged
merged 2 commits into from
Apr 4, 2019
Merged
Changes from 1 commit
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
Next Next commit
feat(password-input): support theming for password input
montezume committed Apr 4, 2019

Unverified

This user has not yet uploaded their public signing key.
commit 59c4adcd026217ae658c78ce474d55f50888b995
2 changes: 1 addition & 1 deletion src/components/inputs/password-input/password-input.js
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ const PasswordInput = props => (
disabled={props.isDisabled}
placeholder={props.placeholder}
autoComplete={props.autoComplete}
css={getInputStyles(props)}
css={theme => getInputStyles(props, theme)}
readOnly={props.isReadOnly}
autoFocus={props.isAutofocussed}
{...filterDataAttributes(props)}
18 changes: 18 additions & 0 deletions src/components/inputs/password-input/password-input.visualroute.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import React from 'react';
import { ThemeProvider } from 'emotion-theming';
import { PasswordInput } from 'ui-kit';
import { Suite, Spec } from '../../../../test/percy';

const value = 'hello world how are you?';

export const routePath = '/password-input';

const darkTheme = {
colorSurface: 'black',
colorSolid: 'white',
colorNeutral60: 'rgba(255,255,255,0.60)',
colorNeutral: 'rgba(255,255,255,0.60)',
colorAccent98: 'rgba(0,0,0,0.98)',
};

export const component = () => (
<Suite>
<Spec label="minimal">
@@ -73,5 +82,14 @@ export const component = () => (
hasWarning={true}
/>
</Spec>
<ThemeProvider theme={darkTheme}>
<Spec label="with custom (inverted) theme" inverted>
<PasswordInput
value={value}
onChange={() => {}}
horizontalConstraint="m"
/>
</Spec>
</ThemeProvider>
</Suite>
);