mirror of
https://github.com/tale/headplane.git
synced 2026-08-25 20:06:48 +00:00
feat: create shared button component
This commit is contained in:
@@ -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
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user