feat: create shared button component
This commit is contained in:
parent
b5658750a9
commit
4a1cdaa432
8 changed files with 67 additions and 65 deletions
|
|
@ -2,7 +2,7 @@ import clsx from 'clsx'
|
|||
import { type DetailedHTMLProps, type InputHTMLAttributes } from 'react'
|
||||
|
||||
type Properties = {
|
||||
readonly isEmbedded?: boolean;
|
||||
readonly variant?: 'embedded' | 'normal';
|
||||
} & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>
|
||||
|
||||
export default function Input(properties: Properties) {
|
||||
|
|
@ -14,11 +14,11 @@ export default function Input(properties: Properties) {
|
|||
'border-gray-300 dark:border-zinc-700',
|
||||
'focus:outline-none focus:ring',
|
||||
'focus:ring-blue-500 dark:focus:ring-blue-300',
|
||||
properties.isEmbedded ? 'bg-transparent' : 'dark:bg-zinc-800',
|
||||
properties.isEmbedded ? 'p-0' : 'px-2.5 py-1.5',
|
||||
properties.isEmbedded ? 'border-none' : 'border',
|
||||
properties.isEmbedded ? 'focus:ring-0' : 'focus:ring-1',
|
||||
properties.isEmbedded ? 'rounded-none' : 'rounded-lg',
|
||||
properties.variant === 'embedded' ? 'bg-transparent' : 'dark:bg-zinc-800',
|
||||
properties.variant === 'embedded' ? 'p-0' : 'px-2.5 py-1.5',
|
||||
properties.variant === 'embedded' ? 'border-none' : 'border',
|
||||
properties.variant === 'embedded' ? 'focus:ring-0' : 'focus:ring-1',
|
||||
properties.variant === 'embedded' ? 'rounded-none' : 'rounded-lg',
|
||||
properties.className
|
||||
)}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue