feat: enhance input recipe with size variants and improve styling
This commit is contained in:
@@ -21,7 +21,7 @@ const buttonRecipe = ({ semanticColorNames }: ButtonRecipeArg) => {
|
|||||||
paddingBlock: 'xs',
|
paddingBlock: 'xs',
|
||||||
paddingInline: 'sm',
|
paddingInline: 'sm',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
transition: 'all',
|
transitionProperty: 'color, background-color, border-color',
|
||||||
transitionDuration: 'normal',
|
transitionDuration: 'normal',
|
||||||
transitionTimingFunction: 'easeOut'
|
transitionTimingFunction: 'easeOut'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ export const inputRecipe = ({ semanticColorNames }: InputRecipeArg) => {
|
|||||||
base: {
|
base: {
|
||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
borderRadius: 'sm',
|
borderRadius: 'sm',
|
||||||
paddingBlock: 'xs',
|
|
||||||
paddingInline: 'sm',
|
|
||||||
border: '1px solid',
|
border: '1px solid',
|
||||||
outline: 'none',
|
outline: 'none',
|
||||||
transitionProperty: 'color, background-color, border-color',
|
transitionProperty: 'color, background-color, border-color',
|
||||||
@@ -25,6 +23,23 @@ export const inputRecipe = ({ semanticColorNames }: InputRecipeArg) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
|
size: {
|
||||||
|
small: {
|
||||||
|
paddingBlock: 'calc({spacing.xs} * 0.5)',
|
||||||
|
paddingInline: 'calc({spacing.xs} * 1)',
|
||||||
|
fontSize: 'sm'
|
||||||
|
},
|
||||||
|
medium: {
|
||||||
|
paddingBlock: 'calc({spacing.xs} * 0.75)',
|
||||||
|
paddingInline: 'calc({spacing.xs} * 1.25)',
|
||||||
|
fontSize: 'base'
|
||||||
|
},
|
||||||
|
large: {
|
||||||
|
paddingBlock: 'calc({spacing.xs} * 1)',
|
||||||
|
paddingInline: 'calc({spacing.xs} * 1.5)',
|
||||||
|
fontSize: 'lg'
|
||||||
|
}
|
||||||
|
},
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(
|
...Object.fromEntries(
|
||||||
colorVariants.map((color) => [
|
colorVariants.map((color) => [
|
||||||
@@ -33,34 +48,49 @@ export const inputRecipe = ({ semanticColorNames }: InputRecipeArg) => {
|
|||||||
borderColor: `${color}.6`,
|
borderColor: `${color}.6`,
|
||||||
backgroundColor: `${color}.2`,
|
backgroundColor: `${color}.2`,
|
||||||
color: `${color}.12`,
|
color: `${color}.12`,
|
||||||
|
_placeholder: {
|
||||||
|
color: `${color}.11`
|
||||||
|
},
|
||||||
_hover: {
|
_hover: {
|
||||||
backgroundColor: `${color}.3`
|
backgroundColor: `${color}.3`
|
||||||
},
|
},
|
||||||
|
_active: {
|
||||||
|
backgroundColor: `${color}.4`
|
||||||
|
},
|
||||||
_focus: {
|
_focus: {
|
||||||
backgroundColor: `${color}.3`,
|
backgroundColor: `${color}.3`,
|
||||||
borderColor: `${color}.7`
|
borderColor: `${color}.7`
|
||||||
},
|
},
|
||||||
_disabled: {
|
_disabled: {
|
||||||
backgroundColor: `color-mix(in srgb, {colors.${color}.2} 30%, transparent)`,
|
backgroundColor: `color-mix(in srgb, {colors.${color}.2} 40%, transparent)`,
|
||||||
color: `color-mix(in srgb, {colors.${color}.11} 30%, transparent)`,
|
color: `color-mix(in srgb, {colors.${color}.11} 40%, transparent)`,
|
||||||
borderColor: `color-mix(in srgb, {colors.${color}.6} 30%, transparent)`,
|
borderColor: `color-mix(in srgb, {colors.${color}.6} 40%, transparent)`,
|
||||||
|
_placeholder: {
|
||||||
|
color: `color-mix(in srgb, {colors.${color}.11} 40%, transparent)`
|
||||||
|
},
|
||||||
_hover: {
|
_hover: {
|
||||||
backgroundColor: `color-mix(in srgb, {colors.${color}.2} 30%, transparent)`,
|
backgroundColor: `color-mix(in srgb, {colors.${color}.2} 40%, transparent)`,
|
||||||
borderColor: `color-mix(in srgb, {colors.${color}.6} 30%, transparent)`,
|
borderColor: `color-mix(in srgb, {colors.${color}.6} 40%, transparent)`,
|
||||||
color: `color-mix(in srgb, {colors.${color}.11} 30%, transparent)`
|
color: `color-mix(in srgb, {colors.${color}.11} 40%, transparent)`
|
||||||
},
|
},
|
||||||
_focus: {
|
_focus: {
|
||||||
backgroundColor: `color-mix(in srgb, {colors.${color}.2} 30%, transparent)`,
|
backgroundColor: `color-mix(in srgb, {colors.${color}.2} 40%, transparent)`,
|
||||||
borderColor: `color-mix(in srgb, {colors.${color}.6} 30%, transparent)`,
|
borderColor: `color-mix(in srgb, {colors.${color}.6} 40%, transparent)`,
|
||||||
color: `color-mix(in srgb, {colors.${color}.11} 30%, transparent)`
|
color: `color-mix(in srgb, {colors.${color}.11} 40%, transparent)`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
fullWidth: {
|
||||||
|
true: {
|
||||||
|
width: '100%'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
|
size: 'medium',
|
||||||
color: 'neutral'
|
color: 'neutral'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user