diff --git a/packages/react-components/src/components/Input/Input.module.scss b/packages/react-components/src/components/Input/Input.module.scss index 379c65bc3..1897e0a0f 100644 --- a/packages/react-components/src/components/Input/Input.module.scss +++ b/packages/react-components/src/components/Input/Input.module.scss @@ -1,5 +1,5 @@ .input { - border: 1px solid #bdc7d1; + background: var(--surface-basic-default); border: 1px solid var(--border-default); border-radius: 4px; box-sizing: border-box; @@ -8,6 +8,10 @@ line-height: 22px; outline: none; + &::placeholder { + color: var(--content-disabled); + } + &:focus { border-color: var(--color-action-default); } diff --git a/packages/react-components/src/components/Input/Input.stories.tsx b/packages/react-components/src/components/Input/Input.stories.tsx index 41f1c2158..70f0b1aaa 100644 --- a/packages/react-components/src/components/Input/Input.stories.tsx +++ b/packages/react-components/src/components/Input/Input.stories.tsx @@ -1,24 +1,51 @@ import * as React from 'react'; -import { ComponentMeta } from '@storybook/react'; +import { ComponentMeta, Story } from '@storybook/react'; -import { Input as InputComponent, InputProps } from './Input'; +import { StoryDescriptor } from '../../stories/components/StoryDescriptor'; + +import { Input, InputProps } from './Input'; + +const placeholderText = 'Placeholder text'; export default { title: 'Forms/Input', - component: InputComponent, -} as ComponentMeta; + component: Input, +} as ComponentMeta; -export const Input = ({ ...args }): React.ReactElement => ( - +export const Default: Story = (args: InputProps) => ( + ); -Input.args = { +Default.storyName = 'Input'; +Default.args = { size: 'medium', placeholder: 'Placeholder text', - error: false, - disabled: false, -} as InputProps; +}; -export const WithIcon = () =>
TODO
; -export const WithArrow = () =>
TODO
; -export const WithIconAndArrow = () =>
TODO
; +export const Sizes = (): JSX.Element => ( + <> + + + + + + + + + + + + + +); + +export const States = (): JSX.Element => ( + <> + + + + + + + +); diff --git a/packages/react-components/src/components/Input/Input.tsx b/packages/react-components/src/components/Input/Input.tsx index ba886ee6e..db6cca22b 100644 --- a/packages/react-components/src/components/Input/Input.tsx +++ b/packages/react-components/src/components/Input/Input.tsx @@ -6,8 +6,9 @@ import styles from './Input.module.scss'; type InputSize = 'xsmall' | 'small' | 'medium' | 'large'; export interface InputProps extends React.HTMLAttributes { - size?: InputSize; - error?: boolean; + size?: InputSize | undefined; + error?: boolean | undefined; + disabled?: boolean | undefined; } const baseClass = 'input'; diff --git a/packages/react-components/src/components/TagInput/TagInput.module.scss b/packages/react-components/src/components/TagInput/TagInput.module.scss index 919a8c955..90745b34c 100644 --- a/packages/react-components/src/components/TagInput/TagInput.module.scss +++ b/packages/react-components/src/components/TagInput/TagInput.module.scss @@ -1,5 +1,6 @@ .tag-input { align-items: center; + background: var(--surface-basic-default); background-clip: padding-box; border: 1px solid var(--border-default); border-radius: 4px; @@ -34,6 +35,8 @@ } &:disabled { + background-color: var(--surface-basic-disabled); + border: 1px solid var(--border-disabled); color: var(--content-disabled); cursor: not-allowed; } diff --git a/packages/react-components/src/components/TagInput/TagInput.stories.tsx b/packages/react-components/src/components/TagInput/TagInput.stories.tsx index 37d89e80f..cbe06f380 100644 --- a/packages/react-components/src/components/TagInput/TagInput.stories.tsx +++ b/packages/react-components/src/components/TagInput/TagInput.stories.tsx @@ -1,16 +1,21 @@ import * as React from 'react'; -import { ComponentMeta } from '@storybook/react'; +import { ComponentMeta, Story } from '@storybook/react'; + +import noop from '../../utils/noop'; +import { StoryDescriptor } from '../../stories/components/StoryDescriptor'; import { - TagInput as TagInputComponent, + TagInput, TagInputProps, - EmailTagInput as EmailTagInputComponent, + EmailTagInput, EmailTagInputProps, } from './index'; +const placeholderText = 'Placeholder text'; + export default { title: 'Forms/Tag Input', - component: TagInputComponent, + component: TagInput, argTypes: { tags: { control: { @@ -18,32 +23,46 @@ export default { }, }, }, -} as ComponentMeta; +} as ComponentMeta; -export const TagInput = ({ ...args }: TagInputProps): React.ReactElement => { +export const DefaultTagInput: Story = ({ + ...args +}: TagInputProps) => { const [tags, setTags] = React.useState(['tag1', 'tag2']); return (
- +
); }; -TagInput.args = { - placeholder: 'Tag input placeholder', -} as TagInputProps; +DefaultTagInput.storyName = 'TagInput'; +DefaultTagInput.args = { + placeholder: placeholderText, +}; -export const EmailTagInput = ({ +export const DefaultEmailTagInput: Story = ({ ...args -}: EmailTagInputProps): React.ReactElement => { +}: EmailTagInputProps) => { const [tags, setTags] = React.useState(['one@test.com', 'two@test.com']); return (
- +
); }; - -EmailTagInput.args = { +DefaultEmailTagInput.storyName = 'EmailTagInput'; +DefaultEmailTagInput.args = { placeholder: 'name@company.com', -} as TagInputProps; +}; + +export const Sizes = (): JSX.Element => ( + <> + + + + + + + +);