Skip to content

Commit

Permalink
chore: made input border offset optional (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjitrosch committed Mar 15, 2022
1 parent c5d8ad0 commit e67ae52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Input/Input.tsx
Expand Up @@ -7,6 +7,7 @@ import { IComponentBaseProps, ComponentColor, ComponentSize } from '../types'
export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> &
IComponentBaseProps & {
bordered?: boolean
borderOffset?: boolean
size?: ComponentSize
color?: ComponentColor
}
Expand All @@ -16,7 +17,8 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
{
value,
placeholder,
bordered,
bordered = true,
borderOffset,
size,
color,
dataTheme,
Expand All @@ -31,6 +33,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
clsx({
[`input-${size}`]: size,
[`input-${color}`]: color,
[`focus:outline-offset-0`]: !borderOffset,
'input-bordered': bordered,
})
)
Expand Down
3 changes: 3 additions & 0 deletions src/Select/Select.tsx
Expand Up @@ -24,6 +24,7 @@ export type SelectProps<T> = Omit<
size?: ComponentSize
color?: ComponentColor
bordered?: boolean
borderOffset?: boolean
}

const Select = <T extends string | number | undefined>({
Expand All @@ -35,6 +36,7 @@ const Select = <T extends string | number | undefined>({
size,
color,
bordered = true,
borderOffset,
dataTheme,
className,
...props
Expand All @@ -45,6 +47,7 @@ const Select = <T extends string | number | undefined>({
clsx({
[`select-${size}`]: size,
[`select-${color}`]: color,
[`focus:outline-offset-0`]: !borderOffset,
'select-bordered': bordered,
})
)
Expand Down
5 changes: 4 additions & 1 deletion src/Textarea/Textarea.tsx
Expand Up @@ -10,10 +10,12 @@ export type TextareaProps =
& {
color?: ComponentColor
bordered?: boolean
borderOffset?: boolean
}

const Textarea = ({
bordered,
bordered = true,
borderOffset,
color,
dataTheme,
className,
Expand All @@ -24,6 +26,7 @@ const Textarea = ({
className,
clsx({
[`textarea-${color}`]: color,
[`focus:outline-offset-0`]: !borderOffset,
'textarea-bordered': bordered,
})
)
Expand Down

0 comments on commit e67ae52

Please sign in to comment.