Skip to content

Commit

Permalink
fix: input and select component
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitskvmdam committed Nov 19, 2021
1 parent 00f6998 commit c847359
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ interface IconContainerProps {
}
}

// TODO: Don't depend on padding to get a specific height of input box.
// TODO: Use fixed value instead.

const InputRoot = createStyledComponent<typeof InputBase, InputProps>(
InputBase,
(theme, props) => {
Expand All @@ -143,10 +146,10 @@ const InputRoot = createStyledComponent<typeof InputBase, InputProps>(
const { body, bodySm, h3 } = themePropsForThemeVarFn.typography

const getPadding = (): string => {
if (size === 'regular') return '0.4rem 0.625rem'
if (size === 'small') return '0.3rem 0.4rem'
if (size === 'regular') return '0.6rem'
if (size === 'small') return '0.4rem 0.6rem'

return '0.5rem 0.8rem'
return '0.8rem 0.6rem'
}

const getTypographyProperties = (): CSSObject => {
Expand Down Expand Up @@ -298,7 +301,7 @@ const IconContainer = createStyledComponent<'div ', IconContainerProps>(
width: '2rem'
}
return {
width: '2rem'
width: '1.5rem'
}
}

Expand All @@ -319,7 +322,7 @@ const IconContainer = createStyledComponent<'div ', IconContainerProps>(

const getPadding = (): string => {
if (size === 'regular' || size === 'large') return '0.5rem'
return '0.125rem'
return '0.25rem'
}

return {
Expand Down
12 changes: 12 additions & 0 deletions src/select/select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ Default.args = {
{ value: 'covid-mind', label: 'CovidMine' },
],
}

export const MultipleSelect = Template.bind({})
MultipleSelect.args = {
isDisabled: false,
isMulti: true,
options: [
{ value: 'fly-mine', label: 'FlyMine' },
{ value: 'human--mine', label: 'HumanMine' },
{ value: 'rat-mine', label: 'RatMine' },
{ value: 'covid-mind', label: 'CovidMine' },
],
}
5 changes: 2 additions & 3 deletions src/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ export const Select = forwardRef(

const _neutral = tto(themeType, grey, darkGrey)
const _neutralText = tto(themeType, black, white)

return {
danger: error.main,
dangerLight: error.mainLightShade,
danger: error.text,
dangerLight: error.main,
neutral0: tto(themeType, white, _neutral[30]),
neutral5: disable.main,
neutral10: disable.mainDarkShade,
Expand Down

0 comments on commit c847359

Please sign in to comment.