mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-25 17:30:37 +01:00
chore(components): improve props
This commit is contained in:
@@ -12,20 +12,20 @@ const checkbox = tv({ extend: tv(theme), ...(appConfig.ui?.checkbox || {}) })
|
||||
|
||||
type CheckboxVariants = VariantProps<typeof checkbox>
|
||||
|
||||
export interface CheckboxProps extends Omit<CheckboxRootProps, 'asChild' | 'checked' | 'defaultChecked'> {
|
||||
export interface CheckboxProps extends Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id'> {
|
||||
label?: string
|
||||
description?: string
|
||||
color?: CheckboxVariants['color']
|
||||
size?: CheckboxVariants['size']
|
||||
/**
|
||||
* The icon displayed when checked.
|
||||
* @defaultValue `appConfig.ui.icons.check`
|
||||
* @defaultValue appConfig.ui.icons.check
|
||||
*/
|
||||
icon?: string
|
||||
indeterminate?: InputHTMLAttributes['indeterminate']
|
||||
/**
|
||||
* The icon displayed when the checkbox is indeterminate.
|
||||
* @defaultValue `appConfig.ui.icons.minus`
|
||||
* @defaultValue appConfig.ui.icons.minus
|
||||
*/
|
||||
indeterminateIcon?: string
|
||||
/** The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state. */
|
||||
@@ -56,7 +56,7 @@ defineEmits<CheckboxEmits>()
|
||||
|
||||
const modelValue = defineModel<boolean | undefined>({ default: undefined })
|
||||
|
||||
const rootProps = useForwardProps(reactivePick(props, 'as', 'required', 'value'))
|
||||
const rootProps = useForwardProps(reactivePick(props, 'required', 'value'))
|
||||
|
||||
const appConfig = useAppConfig()
|
||||
const { id: _id, emitFormChange, size, color, name, disabled } = useFormField<CheckboxProps>(props)
|
||||
|
||||
Reference in New Issue
Block a user