feat(CheckboxGroup): add table variant (#3997)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
TribeWeb
2025-05-13 13:28:15 +01:00
committed by GitHub
parent 0dc4678c68
commit 1b6ab271ea
7 changed files with 286 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ export type CheckboxGroupItem = {
[key: string]: any
} | CheckboxGroupValue
export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupItem> extends Pick<CheckboxGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | 'variant' | 'indicator' | 'icon'> {
export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupItem> extends Pick<CheckboxGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | 'indicator' | 'icon'> {
/**
* The element or component this component should render as.
* @defaultValue 'div'
@@ -44,6 +44,10 @@ export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupI
* @defaultValue 'md'
*/
size?: CheckboxGroup['variants']['size']
/**
* @defaultValue 'list'
*/
variant?: CheckboxGroup['variants']['variant']
/**
* The orientation the checkbox buttons are laid out.
* @defaultValue 'vertical'
@@ -97,7 +101,9 @@ const id = _id.value ?? useId()
const ui = computed(() => tv({ extend: theme, ...(appConfig.ui?.checkboxGroup || {}) })({
size: size.value,
required: props.required,
orientation: props.orientation
orientation: props.orientation,
color: props.color,
variant: props.variant
}))
function normalizeItem(item: any) {