mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 10:50:40 +01:00
chore(components): improve JSDoc
This commit is contained in:
@@ -20,7 +20,12 @@ export interface AccordionItem extends Partial<Pick<AccordionItemProps, 'disable
|
|||||||
|
|
||||||
export interface AccordionProps<T> extends Omit<AccordionRootProps, 'asChild' | 'dir' | 'orientation'> {
|
export interface AccordionProps<T> extends Omit<AccordionRootProps, 'asChild' | 'dir' | 'orientation'> {
|
||||||
items?: T[]
|
items?: T[]
|
||||||
|
/**
|
||||||
|
* The icon displayed on the right side of the trigger.
|
||||||
|
* @defaultValue `appConfig.ui.icons.chevronDown`
|
||||||
|
*/
|
||||||
trailingIcon?: string
|
trailingIcon?: string
|
||||||
|
/** The content of the accordion. */
|
||||||
content?: Omit<AccordionContentProps, 'asChild'>
|
content?: Omit<AccordionContentProps, 'asChild'>
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof accordion.slots>
|
ui?: Partial<typeof accordion.slots>
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ export interface AlertProps extends Omit<PrimitiveProps, 'asChild'> {
|
|||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
color?: AlertVariants['color']
|
color?: AlertVariants['color']
|
||||||
variant?: AlertVariants['variant']
|
variant?: AlertVariants['variant']
|
||||||
|
/**
|
||||||
|
* Display a list of actions:
|
||||||
|
* - under the title and description if multiline
|
||||||
|
* - next to the close button if not multiline
|
||||||
|
*/
|
||||||
actions?: ButtonProps[]
|
actions?: ButtonProps[]
|
||||||
/**
|
/**
|
||||||
* Display a close button to dismiss the alert.
|
* Display a close button to dismiss the alert.
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ type AvatarGroupVariants = VariantProps<typeof avatarGroup>
|
|||||||
|
|
||||||
export interface AvatarGroupProps extends Omit<PrimitiveProps, 'asChild'> {
|
export interface AvatarGroupProps extends Omit<PrimitiveProps, 'asChild'> {
|
||||||
size?: AvatarGroupVariants['size']
|
size?: AvatarGroupVariants['size']
|
||||||
|
/**
|
||||||
|
* The maximum number of avatars to display.
|
||||||
|
*/
|
||||||
max?: number | string
|
max?: number | string
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof avatarGroup.slots>
|
ui?: Partial<typeof avatarGroup.slots>
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export interface BreadcrumbItem extends Omit<LinkProps, 'custom'> {
|
|||||||
|
|
||||||
export interface BreadcrumbProps<T> extends Omit<PrimitiveProps, 'asChild'> {
|
export interface BreadcrumbProps<T> extends Omit<PrimitiveProps, 'asChild'> {
|
||||||
items?: T[]
|
items?: T[]
|
||||||
|
/**
|
||||||
|
* The icon to use as a separator.
|
||||||
|
* @defaultValue `appConfig.ui.icons.chevronRight`
|
||||||
|
*/
|
||||||
separatorIcon?: string
|
separatorIcon?: string
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof breadcrumb.slots>
|
ui?: Partial<typeof breadcrumb.slots>
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'cu
|
|||||||
color?: ButtonVariants['color']
|
color?: ButtonVariants['color']
|
||||||
variant?: ButtonVariants['variant']
|
variant?: ButtonVariants['variant']
|
||||||
size?: ButtonVariants['size']
|
size?: ButtonVariants['size']
|
||||||
|
/** Render the button with equal padding on all sides. */
|
||||||
square?: boolean
|
square?: boolean
|
||||||
|
/** Render the button full width. */
|
||||||
block?: boolean
|
block?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof button.slots>
|
ui?: Partial<typeof button.slots>
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ type ButtonGroupVariants = VariantProps<typeof buttonGroup>
|
|||||||
|
|
||||||
export interface ButtonGroupProps extends Omit<PrimitiveProps, 'asChild'> {
|
export interface ButtonGroupProps extends Omit<PrimitiveProps, 'asChild'> {
|
||||||
size?: ButtonProps['size']
|
size?: ButtonProps['size']
|
||||||
|
/**
|
||||||
|
* The orientation the buttons are laid out.
|
||||||
|
* @defaultValue `'horizontal'`
|
||||||
|
*/
|
||||||
orientation?: ButtonGroupVariants['orientation']
|
orientation?: ButtonGroupVariants['orientation']
|
||||||
class?: any
|
class?: any
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export interface CheckboxProps extends Omit<CheckboxRootProps, 'asChild' | 'chec
|
|||||||
* @defaultValue `appConfig.ui.icons.minus`
|
* @defaultValue `appConfig.ui.icons.minus`
|
||||||
*/
|
*/
|
||||||
indeterminateIcon?: string
|
indeterminateIcon?: string
|
||||||
|
/** The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state. */
|
||||||
defaultValue?: boolean
|
defaultValue?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof checkbox.slots>
|
ui?: Partial<typeof checkbox.slots>
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'custom'>, Pic
|
|||||||
|
|
||||||
export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'>, Pick<ContextMenuTriggerProps, 'disabled'> {
|
export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'>, Pick<ContextMenuTriggerProps, 'disabled'> {
|
||||||
items?: T[] | T[][]
|
items?: T[] | T[][]
|
||||||
|
/** The content of the menu. */
|
||||||
content?: Omit<ContextMenuContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<ContextMenuContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Render the menu in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof contextMenu.slots>
|
ui?: Partial<typeof contextMenu.slots>
|
||||||
|
|||||||
@@ -13,8 +13,13 @@ const drawer = tv({ extend: tv(theme), ...(appConfig.ui?.drawer || {}) })
|
|||||||
export interface DrawerProps extends Omit<DrawerRootProps, 'asChild'> {
|
export interface DrawerProps extends Omit<DrawerRootProps, 'asChild'> {
|
||||||
title?: string
|
title?: string
|
||||||
description?: string
|
description?: string
|
||||||
|
/** The content of the drawer. */
|
||||||
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
||||||
overlay?: boolean
|
overlay?: boolean
|
||||||
|
/**
|
||||||
|
* Render the drawer in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof drawer.slots>
|
ui?: Partial<typeof drawer.slots>
|
||||||
|
|||||||
@@ -31,8 +31,20 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'custom'>, Pi
|
|||||||
|
|
||||||
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>, Pick<DropdownMenuTriggerProps, 'disabled'> {
|
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>, Pick<DropdownMenuTriggerProps, 'disabled'> {
|
||||||
items?: T[] | T[][]
|
items?: T[] | T[][]
|
||||||
|
/**
|
||||||
|
* The content of the menu.
|
||||||
|
* @defaultValue `{ side: 'bottom', sideOffset: 8 }`
|
||||||
|
*/
|
||||||
content?: Omit<DropdownMenuContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<DropdownMenuContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the menu.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean | Omit<DropdownMenuArrowProps, 'asChild'>
|
arrow?: boolean | Omit<DropdownMenuArrowProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Render the menu in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof dropdownMenu.slots>
|
ui?: Partial<typeof dropdownMenu.slots>
|
||||||
|
|||||||
@@ -54,8 +54,20 @@ export interface InputMenuProps<T> extends Omit<ComboboxRootProps<T>, 'asChild'
|
|||||||
* @defaultValue `appConfig.ui.icons.close`
|
* @defaultValue `appConfig.ui.icons.close`
|
||||||
*/
|
*/
|
||||||
deleteIcon?: string
|
deleteIcon?: string
|
||||||
|
/**
|
||||||
|
* The content of the menu.
|
||||||
|
* @defaultValue `{ side: 'bottom', sideOffset: 8, position: 'popper' }`
|
||||||
|
*/
|
||||||
content?: Omit<ComboboxContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<ComboboxContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the menu.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean | Omit<ComboboxArrowProps, 'asChild'>
|
arrow?: boolean | Omit<ComboboxArrowProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Render the menu in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
/**
|
/**
|
||||||
* Whether to filter items or not, can be an array of fields to filter.
|
* Whether to filter items or not, can be an array of fields to filter.
|
||||||
@@ -193,9 +205,9 @@ onMounted(() => {
|
|||||||
v-slot="{ modelValue: tags }: { modelValue: AcceptableValue[] }"
|
v-slot="{ modelValue: tags }: { modelValue: AcceptableValue[] }"
|
||||||
:model-value="(modelValue as string[])"
|
:model-value="(modelValue as string[])"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@blur="emitFormBlur()"
|
|
||||||
delimiter=""
|
delimiter=""
|
||||||
as-child
|
as-child
|
||||||
|
@blur="emitFormBlur()"
|
||||||
>
|
>
|
||||||
<TagsInputItem v-for="(item, index) in tags" :key="index" :value="(item as string)" :class="ui.tagsItem()">
|
<TagsInputItem v-for="(item, index) in tags" :key="index" :value="(item as string)" :class="ui.tagsItem()">
|
||||||
<TagsInputItemText :class="ui.tagsItemText()">
|
<TagsInputItemText :class="ui.tagsItemText()">
|
||||||
|
|||||||
@@ -13,10 +13,15 @@ const modal = tv({ extend: tv(theme), ...(appConfig.ui?.modal || {}) })
|
|||||||
export interface ModalProps extends DialogRootProps {
|
export interface ModalProps extends DialogRootProps {
|
||||||
title?: string
|
title?: string
|
||||||
description?: string
|
description?: string
|
||||||
|
/** The content of the modal. */
|
||||||
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
||||||
overlay?: boolean
|
overlay?: boolean
|
||||||
transition?: boolean
|
transition?: boolean
|
||||||
fullscreen?: boolean
|
fullscreen?: boolean
|
||||||
|
/**
|
||||||
|
* Render the modal in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
/**
|
/**
|
||||||
* Display a close button to dismiss the modal.
|
* Display a close button to dismiss the modal.
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'custom'>, Pick<Navi
|
|||||||
|
|
||||||
type NavigationMenuVariants = VariantProps<typeof navigationMenu>
|
type NavigationMenuVariants = VariantProps<typeof navigationMenu>
|
||||||
|
|
||||||
export interface NavigationMenuProps<T> extends Omit<NavigationMenuRootProps, 'asChild' | 'dir'> {
|
export interface NavigationMenuProps<T> extends Omit<NavigationMenuRootProps, 'asChild' | 'dir' | 'orientation'> {
|
||||||
/**
|
/**
|
||||||
* The icon displayed to open the menu.
|
* The icon displayed to open the menu.
|
||||||
* @defaultValue `appConfig.ui.icons.chevronDown`
|
* @defaultValue `appConfig.ui.icons.chevronDown`
|
||||||
@@ -41,11 +41,19 @@ export interface NavigationMenuProps<T> extends Omit<NavigationMenuRootProps, 'a
|
|||||||
color?: NavigationMenuVariants['color']
|
color?: NavigationMenuVariants['color']
|
||||||
variant?: NavigationMenuVariants['variant']
|
variant?: NavigationMenuVariants['variant']
|
||||||
/**
|
/**
|
||||||
* Display a line next to the active item.
|
* The orientation of the menu.
|
||||||
|
* @defaultValue `'horizontal'`
|
||||||
*/
|
*/
|
||||||
|
orientation?: NavigationMenuRootProps['orientation']
|
||||||
|
/** Display a line next to the active item. */
|
||||||
highlight?: boolean
|
highlight?: boolean
|
||||||
highlightColor?: NavigationMenuVariants['highlightColor']
|
highlightColor?: NavigationMenuVariants['highlightColor']
|
||||||
|
/** The content of the menu. */
|
||||||
content?: Omit<NavigationMenuContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<NavigationMenuContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the menu.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean
|
arrow?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof navigationMenu.slots>
|
ui?: Partial<typeof navigationMenu.slots>
|
||||||
|
|||||||
@@ -12,19 +12,63 @@ const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof t
|
|||||||
const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
|
const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
|
||||||
|
|
||||||
export interface PaginationProps extends Omit<PaginationRootProps, 'asChild'> {
|
export interface PaginationProps extends Omit<PaginationRootProps, 'asChild'> {
|
||||||
|
/**
|
||||||
|
* The icon to use for the first page control.
|
||||||
|
* @defaultValue `appConfig.ui.icons.chevronDoubleLeft`
|
||||||
|
*/
|
||||||
firstIcon?: string
|
firstIcon?: string
|
||||||
|
/**
|
||||||
|
* The icon to use for the previous page control.
|
||||||
|
* @defaultValue `appConfig.ui.icons.chevronLeft`
|
||||||
|
*/
|
||||||
prevIcon?: string
|
prevIcon?: string
|
||||||
|
/**
|
||||||
|
* The icon to use for the next page control.
|
||||||
|
* @defaultValue `appConfig.ui.icons.chevronRight`
|
||||||
|
*/
|
||||||
nextIcon?: string
|
nextIcon?: string
|
||||||
|
/**
|
||||||
|
* The icon to use for the last page control.
|
||||||
|
* @defaultValue `appConfig.ui.icons.chevronDoubleRight`
|
||||||
|
*/
|
||||||
lastIcon?: string
|
lastIcon?: string
|
||||||
|
/**
|
||||||
|
* The icon to use for the ellipsis control.
|
||||||
|
* @defaultValue `appConfig.ui.icons.ellipsis`
|
||||||
|
*/
|
||||||
ellipsisIcon?: string
|
ellipsisIcon?: string
|
||||||
|
/**
|
||||||
|
* The color of the pagination controls.
|
||||||
|
* @defaultValue `'white'`
|
||||||
|
*/
|
||||||
color?: ButtonProps['color']
|
color?: ButtonProps['color']
|
||||||
|
/**
|
||||||
|
* The variant of the pagination controls.
|
||||||
|
* @defaultValue `'solid'`
|
||||||
|
*/
|
||||||
variant?: ButtonProps['variant']
|
variant?: ButtonProps['variant']
|
||||||
|
/**
|
||||||
|
* The color of the active pagination control.
|
||||||
|
* @defaultValue `'black'`
|
||||||
|
*/
|
||||||
activeColor?: ButtonProps['color']
|
activeColor?: ButtonProps['color']
|
||||||
|
/**
|
||||||
|
* The variant of the active pagination control.
|
||||||
|
* @defaultValue `'solid'`
|
||||||
|
*/
|
||||||
activeVariant?: ButtonProps['variant']
|
activeVariant?: ButtonProps['variant']
|
||||||
|
/**
|
||||||
|
* Whether to show the first, previous, next, and last controls.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
showControls?: boolean
|
showControls?: boolean
|
||||||
size?: ButtonProps['size']
|
size?: ButtonProps['size']
|
||||||
class?: any
|
/**
|
||||||
|
* A function to render page controls as links.
|
||||||
|
* @param page The page number to navigate to.
|
||||||
|
*/
|
||||||
to?: (page: number) => RouteLocationRaw
|
to?: (page: number) => RouteLocationRaw
|
||||||
|
class?: any
|
||||||
ui?: Partial<typeof pagination.slots>
|
ui?: Partial<typeof pagination.slots>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,20 @@ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps,
|
|||||||
* @defaultValue `"click"`
|
* @defaultValue `"click"`
|
||||||
*/
|
*/
|
||||||
mode?: 'click' | 'hover'
|
mode?: 'click' | 'hover'
|
||||||
|
/**
|
||||||
|
* The content of the popover.
|
||||||
|
* @defaultValue `{ side: 'bottom', sideOffset: 8 }`
|
||||||
|
*/
|
||||||
content?: Omit<PopoverContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<PopoverContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the popover.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean | Omit<PopoverArrowProps, 'asChild'>
|
arrow?: boolean | Omit<PopoverArrowProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Render the popover in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof popover.slots>
|
ui?: Partial<typeof popover.slots>
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ export interface ProgressProps extends Omit<ProgressRootProps, 'asChild' | 'max'
|
|||||||
inverted?: boolean
|
inverted?: boolean
|
||||||
size?: ProgressVariants['size']
|
size?: ProgressVariants['size']
|
||||||
color?: ProgressVariants['color']
|
color?: ProgressVariants['color']
|
||||||
|
/**
|
||||||
|
* The orientation of the progress bar.
|
||||||
|
* @defaultValue `'horizontal'`
|
||||||
|
*/
|
||||||
orientation?: ProgressVariants['orientation']
|
orientation?: ProgressVariants['orientation']
|
||||||
animation?: ProgressVariants['animation']
|
animation?: ProgressVariants['animation']
|
||||||
class?: any
|
class?: any
|
||||||
|
|||||||
@@ -17,12 +17,17 @@ export interface RadioGroupItem extends Pick<RadioGroupItemProps, 'disabled' | '
|
|||||||
description?: string
|
description?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RadioGroupProps<T> extends Omit<RadioGroupRootProps, 'asChild' | 'dir'> {
|
export interface RadioGroupProps<T> extends Omit<RadioGroupRootProps, 'asChild' | 'dir' | 'orientation'> {
|
||||||
legend?: string
|
legend?: string
|
||||||
items?: T[]
|
items?: T[]
|
||||||
class?: any
|
|
||||||
size?: RadioGroupVariants['size']
|
size?: RadioGroupVariants['size']
|
||||||
color?: RadioGroupVariants['color']
|
color?: RadioGroupVariants['color']
|
||||||
|
/**
|
||||||
|
* The orientation the radio buttons are laid out.
|
||||||
|
* @defaultValue `'vertical'`
|
||||||
|
*/
|
||||||
|
orientation?: RadioGroupRootProps['orientation']
|
||||||
|
class?: any
|
||||||
ui?: Partial<typeof radioGroup.slots>
|
ui?: Partial<typeof radioGroup.slots>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +48,9 @@ import { RadioGroupRoot, RadioGroupItem, RadioGroupIndicator, Label, useForwardP
|
|||||||
import { reactivePick } from '@vueuse/core'
|
import { reactivePick } from '@vueuse/core'
|
||||||
import { useId, useFormField } from '#imports'
|
import { useId, useFormField } from '#imports'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<RadioGroupProps<T>>(), { orientation: 'vertical' })
|
const props = withDefaults(defineProps<RadioGroupProps<T>>(), {
|
||||||
|
orientation: 'vertical'
|
||||||
|
})
|
||||||
const emits = defineEmits<RadioGroupEmits>()
|
const emits = defineEmits<RadioGroupEmits>()
|
||||||
const slots = defineSlots<RadioGroupSlots<T>>()
|
const slots = defineSlots<RadioGroupSlots<T>>()
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,20 @@ export interface SelectProps<T> extends Omit<SelectRootProps, 'asChild' | 'dir'>
|
|||||||
* @defaultValue `appConfig.ui.icons.check`
|
* @defaultValue `appConfig.ui.icons.check`
|
||||||
*/
|
*/
|
||||||
selectedIcon?: string
|
selectedIcon?: string
|
||||||
|
/**
|
||||||
|
* The content of the menu.
|
||||||
|
* @defaultValue `{ side: 'bottom', sideOffset: 8, position: 'popper' }`
|
||||||
|
*/
|
||||||
content?: Omit<SelectContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<SelectContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the menu.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean | Omit<SelectArrowProps, 'asChild'>
|
arrow?: boolean | Omit<SelectArrowProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Render the menu in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
items?: T[] | T[][]
|
items?: T[] | T[][]
|
||||||
class?: any
|
class?: any
|
||||||
|
|||||||
@@ -46,8 +46,20 @@ export interface SelectMenuProps<T> extends Omit<ComboboxRootProps<T>, 'asChild'
|
|||||||
* @defaultValue `appConfig.ui.icons.check`
|
* @defaultValue `appConfig.ui.icons.check`
|
||||||
*/
|
*/
|
||||||
selectedIcon?: string
|
selectedIcon?: string
|
||||||
|
/**
|
||||||
|
* The content of the menu.
|
||||||
|
* @defaultValue `{ side: 'bottom', sideOffset: 8, position: 'popper' }`
|
||||||
|
*/
|
||||||
content?: Omit<ComboboxContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<ComboboxContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the menu.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean | Omit<ComboboxArrowProps, 'asChild'>
|
arrow?: boolean | Omit<ComboboxArrowProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Render the menu in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
/**
|
/**
|
||||||
* Whether to filter items or not, can be an array of fields to filter.
|
* Whether to filter items or not, can be an array of fields to filter.
|
||||||
|
|||||||
@@ -12,13 +12,21 @@ const separator = tv({ extend: tv(theme), ...(appConfig.ui?.separator || {}) })
|
|||||||
|
|
||||||
type SeparatorVariants = VariantProps<typeof separator>
|
type SeparatorVariants = VariantProps<typeof separator>
|
||||||
|
|
||||||
export interface SeparatorProps extends Omit<_SeparatorProps, 'asChild'> {
|
export interface SeparatorProps extends Omit<_SeparatorProps, 'asChild' | 'orientation'> {
|
||||||
|
/** Display a label in the middle. */
|
||||||
label?: string
|
label?: string
|
||||||
|
/** Display an icon in the middle. */
|
||||||
icon?: string
|
icon?: string
|
||||||
|
/** Display an avatar in the middle. */
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
color?: SeparatorVariants['color']
|
color?: SeparatorVariants['color']
|
||||||
size?: SeparatorVariants['size']
|
size?: SeparatorVariants['size']
|
||||||
type?: SeparatorVariants['type']
|
type?: SeparatorVariants['type']
|
||||||
|
/**
|
||||||
|
* The orientation of the separator.
|
||||||
|
* @defaultValue `'horizontal'`
|
||||||
|
*/
|
||||||
|
orientation?: _SeparatorProps['orientation']
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof separator.slots>
|
ui?: Partial<typeof separator.slots>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,23 @@ type SlideoverVariants = VariantProps<typeof slideover>
|
|||||||
export interface SlideoverProps extends DialogRootProps {
|
export interface SlideoverProps extends DialogRootProps {
|
||||||
title?: string
|
title?: string
|
||||||
description?: string
|
description?: string
|
||||||
|
/** The content of the slideover. */
|
||||||
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
||||||
|
/**
|
||||||
|
* Display an overlay behind the slideover.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
overlay?: boolean
|
overlay?: boolean
|
||||||
|
/**
|
||||||
|
* Open & close the slideover with a transition.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
transition?: boolean
|
transition?: boolean
|
||||||
side?: SlideoverVariants['side']
|
side?: SlideoverVariants['side']
|
||||||
|
/**
|
||||||
|
* Render the slideover in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
/**
|
/**
|
||||||
* Display a close button to dismiss the slideover.
|
* Display a close button to dismiss the slideover.
|
||||||
|
|||||||
@@ -11,9 +11,15 @@ const slider = tv({ extend: tv(theme), ...(appConfig.ui?.slider || {}) })
|
|||||||
|
|
||||||
type SliderVariants = VariantProps<typeof slider>
|
type SliderVariants = VariantProps<typeof slider>
|
||||||
|
|
||||||
export interface SliderProps extends Omit<SliderRootProps, 'asChild' | 'modelValue' | 'defaultValue' | 'dir'> {
|
export interface SliderProps extends Omit<SliderRootProps, 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'orientation'> {
|
||||||
size?: SliderVariants['size']
|
size?: SliderVariants['size']
|
||||||
color?: SliderVariants['color']
|
color?: SliderVariants['color']
|
||||||
|
/**
|
||||||
|
* The orientation of the slider.
|
||||||
|
* @defaultValue `'horizontal'`
|
||||||
|
*/
|
||||||
|
orientation?: SliderRootProps['orientation']
|
||||||
|
/** The value of the slider when initially rendered. Use when you do not need to control the state of the slider. */
|
||||||
defaultValue?: number | number[]
|
defaultValue?: number | number[]
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof slider.slots>
|
ui?: Partial<typeof slider.slots>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export interface SwitchProps extends Omit<SwitchRootProps, 'asChild' | 'checked'
|
|||||||
uncheckedIcon?: string
|
uncheckedIcon?: string
|
||||||
label?: string
|
label?: string
|
||||||
description?: string
|
description?: string
|
||||||
|
/** The state of the switch when it is initially rendered. Use when you do not need to control its state. */
|
||||||
defaultValue?: boolean
|
defaultValue?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof switchTv.slots>
|
ui?: Partial<typeof switchTv.slots>
|
||||||
|
|||||||
@@ -21,11 +21,20 @@ export interface TabsItem extends Partial<Pick<TabsTriggerProps, 'disabled' | 'v
|
|||||||
|
|
||||||
type TabsVariants = VariantProps<typeof tabs>
|
type TabsVariants = VariantProps<typeof tabs>
|
||||||
|
|
||||||
export interface TabsProps<T> extends Omit<TabsRootProps, 'asChild'> {
|
export interface TabsProps<T> extends Omit<TabsRootProps, 'asChild' | 'orientation'> {
|
||||||
items?: T[]
|
items?: T[]
|
||||||
color?: TabsVariants['color']
|
color?: TabsVariants['color']
|
||||||
variant?: TabsVariants['variant']
|
variant?: TabsVariants['variant']
|
||||||
size?: TabsVariants['size']
|
size?: TabsVariants['size']
|
||||||
|
/**
|
||||||
|
* The orientation of the tabs.
|
||||||
|
* @defaultValue `'horizontal'`
|
||||||
|
*/
|
||||||
|
orientation?: TabsRootProps['orientation']
|
||||||
|
/**
|
||||||
|
* The content of the tabs, can be disabled to prevent rendering the content.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
content?: boolean | Omit<TabsContentProps, 'asChild' | 'value'>
|
content?: boolean | Omit<TabsContentProps, 'asChild' | 'value'>
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof tabs.slots>
|
ui?: Partial<typeof tabs.slots>
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ export interface ToastProps extends Omit<ToastRootProps, 'asChild' | 'forceMount
|
|||||||
icon?: string
|
icon?: string
|
||||||
avatar?: AvatarProps
|
avatar?: AvatarProps
|
||||||
color?: ToastVariants['color']
|
color?: ToastVariants['color']
|
||||||
|
/**
|
||||||
|
* Display a list of actions:
|
||||||
|
* - under the title and description if multiline
|
||||||
|
* - next to the close button if not multiline
|
||||||
|
*/
|
||||||
actions?: ButtonProps[]
|
actions?: ButtonProps[]
|
||||||
/**
|
/**
|
||||||
* Display a close button to dismiss the toast.
|
* Display a close button to dismiss the toast.
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ type ToasterVariants = VariantProps<typeof toaster>
|
|||||||
|
|
||||||
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
||||||
position?: ToasterVariants['position']
|
position?: ToasterVariants['position']
|
||||||
|
/**
|
||||||
|
* Expand the toasts to show multiple toasts at once.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
expand?: boolean
|
expand?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof toaster.slots>
|
ui?: Partial<typeof toaster.slots>
|
||||||
|
|||||||
@@ -11,10 +11,24 @@ const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof them
|
|||||||
const tooltip = tv({ extend: tv(theme), ...(appConfig.ui?.tooltip || {}) })
|
const tooltip = tv({ extend: tv(theme), ...(appConfig.ui?.tooltip || {}) })
|
||||||
|
|
||||||
export interface TooltipProps extends TooltipRootProps {
|
export interface TooltipProps extends TooltipRootProps {
|
||||||
|
/** The text content of the tooltip. */
|
||||||
text?: string
|
text?: string
|
||||||
|
/** The keyboard keys to display in the tooltip. */
|
||||||
kbds?: KbdProps['value'][] | KbdProps[]
|
kbds?: KbdProps['value'][] | KbdProps[]
|
||||||
|
/**
|
||||||
|
* The content of the tooltip.
|
||||||
|
* @defaultValue `{ side: 'bottom', sideOffset: 8 }`
|
||||||
|
*/
|
||||||
content?: Omit<TooltipContentProps, 'asChild'>
|
content?: Omit<TooltipContentProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Display an arrow alongside the tooltip.
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
arrow?: boolean | Omit<TooltipArrowProps, 'asChild'>
|
arrow?: boolean | Omit<TooltipArrowProps, 'asChild'>
|
||||||
|
/**
|
||||||
|
* Render the tooltip in a portal.
|
||||||
|
* @defaultValue `true`
|
||||||
|
*/
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
class?: any
|
class?: any
|
||||||
ui?: Partial<typeof tooltip.slots>
|
ui?: Partial<typeof tooltip.slots>
|
||||||
|
|||||||
Reference in New Issue
Block a user