Skip to content

Commit

Permalink
Fix request changes
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbrasileiro committed Jul 14, 2021
1 parent 0275430 commit 182b2a0
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 36 deletions.
6 changes: 2 additions & 4 deletions packages/store-ui/src/atoms/Button/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ButtonTemplate: Story<ButtonProps> = ({ children, onClick, testId }) => (

export const Button = ButtonTemplate.bind({})

const constrols: ComponentArgTypes<ButtonProps> = {
const argTypes: ComponentArgTypes<ButtonProps> = {
children: {
control: { type: 'text' },
defaultValue: 'Button',
Expand All @@ -28,9 +28,7 @@ const constrols: ComponentArgTypes<ButtonProps> = {
export default {
title: 'Atoms/Button',
component: Button,
argTypes: {
...constrols,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down
6 changes: 2 additions & 4 deletions packages/store-ui/src/atoms/Icon/stories/Icon.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const IconTemplate: Story<IconProps> = ({ style }) => (

export const Icon = IconTemplate.bind({})

const controls: ComponentArgTypes<Omit<IconProps, 'component'>> = {
const argTypes: ComponentArgTypes<Omit<IconProps, 'component'>> = {
style: {
control: { type: 'object' },
defaultValue: {
Expand All @@ -32,9 +32,7 @@ const controls: ComponentArgTypes<Omit<IconProps, 'component'>> = {
export default {
title: 'Atoms/Icon',
component: Icon,
argTypes: {
...controls,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down
10 changes: 4 additions & 6 deletions packages/store-ui/src/atoms/Input/stories/Input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Component from '../Input'
import mdx from './Input.mdx'

const InputTemplate: Story<InputProps> = ({ placeholder, variant }) => {
const colorByvariant = {
const colorByVariant = {
default: 'black',
success: 'green',
error: 'red',
Expand All @@ -16,7 +16,7 @@ const InputTemplate: Story<InputProps> = ({ placeholder, variant }) => {
return (
<Component
style={{
borderColor: colorByvariant[variant || 'default'],
borderColor: colorByVariant[variant || 'default'],
borderStyle: 'solid',
}}
placeholder={placeholder}
Expand All @@ -27,7 +27,7 @@ const InputTemplate: Story<InputProps> = ({ placeholder, variant }) => {

export const Input = InputTemplate.bind({})

const controls: ComponentArgTypes<InputProps> = {
const argTypes: ComponentArgTypes<InputProps> = {
variant: {
options: ['default', 'success', 'error'],
defaultValue: 'default',
Expand All @@ -42,9 +42,7 @@ const controls: ComponentArgTypes<InputProps> = {
export default {
title: 'Atoms/Input',
component: Input,
argTypes: {
...controls,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ const PopoverTemplate: Story<PopoverProps> = ({ children }) => {

export const Popover = PopoverTemplate.bind({})

const controls: ComponentArgTypes<Omit<PopoverProps, 'targetRef'>> = {
const argTypes: ComponentArgTypes<Omit<PopoverProps, 'targetRef'>> = {
children: 'Whoa! Look at me!',
}

export default {
title: 'Atoms/Popover',
argTypes: {
...controls,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down
6 changes: 2 additions & 4 deletions packages/store-ui/src/atoms/Price/stories/Price.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Custom.args = {
value: priceValue,
}

const constrols: ComponentArgTypes<Omit<PriceProps, 'value'>> = {
const argTypes: ComponentArgTypes<Omit<PriceProps, 'value'>> = {
variant: {
options: ['selling', 'listing', 'spot', 'savings', 'installment'],
control: { type: 'select' },
Expand All @@ -121,9 +121,7 @@ const constrols: ComponentArgTypes<Omit<PriceProps, 'value'>> = {

export default {
title: 'Atoms/Price',
argTypes: {
...constrols,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { Props as TextAreaProps } from '../TextArea'
import mdx from './TextArea.mdx'
import type { ComponentArgTypes } from '../../../typings/utils'

const TextAreaTemplate: Story<TextAreaProps> = ({ variant, ...props }) => {
const colorByState: Record<
const TextAreaTemplate: Story<TextAreaProps> = (props) => {
const colorByVariant: Record<
NonNullable<TextAreaProps['variant']> | 'default',
string
> = {
Expand All @@ -21,10 +21,9 @@ const TextAreaTemplate: Story<TextAreaProps> = ({ variant, ...props }) => {
style={{
borderWidth: 2,
borderStyle: 'solid',
borderColor: colorByState[variant || 'default'],
borderColor: colorByVariant[props.variant || 'default'],
}}
{...props}
variant={variant}
/>
)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/store-ui/src/deprecated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export {
Label,
Input as UIInput,
Select,
Textarea,
Textarea as UITextarea,
Text,
Radio,
Checkbox as UICheckbox,
Expand Down Expand Up @@ -55,7 +55,7 @@ export type {
LabelProps,
InputProps as UIInputProps,
SelectProps,
TextareaProps,
TextareaProps as UITextareaProps,
TextProps,
RadioProps,
CheckboxProps as UICheckboxProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const BulletsTemplate: Story<BulletsProps> = ({

export const Bullets = BulletsTemplate.bind({})

const controls: ComponentArgTypes<BulletsProps> = {
const argTypes: ComponentArgTypes<BulletsProps> = {
totalQuantity: {
control: { type: 'number', min: 1 },
defaultValue: 5,
Expand All @@ -44,9 +44,7 @@ const controls: ComponentArgTypes<BulletsProps> = {
export default {
title: 'Molecules/Bullets',
component: Bullets,
argTypes: {
...controls,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const CustomIconTemplate: Story<SearchInputProps> = ({

export const CustomIcon = CustomIconTemplate.bind({})

const controls: ComponentArgTypes<SearchInputProps> = {
const argTypes: ComponentArgTypes<SearchInputProps> = {
placeholder: {
control: { type: 'text' },
defaultValue: 'Search',
Expand All @@ -36,9 +36,7 @@ const controls: ComponentArgTypes<SearchInputProps> = {

export default {
title: 'Molecules/SearchInput',
argTypes: {
...controls,
},
argTypes,
parameters: {
docs: {
page: mdx,
Expand Down

0 comments on commit 182b2a0

Please sign in to comment.