Skip to content

Commit 18ea367

Browse files
authored
feat(password-input): support theming (#635)
* feat(password-input): support theming for password input
1 parent d04d426 commit 18ea367

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/components/inputs/password-input/password-input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const PasswordInput = props => (
1818
disabled={props.isDisabled}
1919
placeholder={props.placeholder}
2020
autoComplete={props.autoComplete}
21-
css={getInputStyles(props)}
21+
css={theme => getInputStyles(props, theme)}
2222
readOnly={props.isReadOnly}
2323
autoFocus={props.isAutofocussed}
2424
{...filterDataAttributes(props)}

src/components/inputs/password-input/password-input.visualroute.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React from 'react';
2+
import { ThemeProvider } from 'emotion-theming';
23
import { PasswordInput } from 'ui-kit';
34
import { Suite, Spec } from '../../../../test/percy';
45

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

78
export const routePath = '/password-input';
89

9-
export const component = () => (
10+
export const component = ({ themes }) => (
1011
<Suite>
1112
<Spec label="minimal">
1213
<PasswordInput
@@ -73,5 +74,14 @@ export const component = () => (
7374
hasWarning={true}
7475
/>
7576
</Spec>
77+
<ThemeProvider theme={themes.darkTheme}>
78+
<Spec label="with custom (inverted) theme">
79+
<PasswordInput
80+
value={value}
81+
onChange={() => {}}
82+
horizontalConstraint="m"
83+
/>
84+
</Spec>
85+
</ThemeProvider>
7686
</Suite>
7787
);

0 commit comments

Comments
 (0)