mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(ButtonGroup): define its own size variant
This commit is contained in:
@@ -3,7 +3,6 @@ import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/button-group'
|
||||
import type { ButtonProps } from './Button.vue'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { buttonGroup: Partial<typeof theme> } }
|
||||
|
||||
@@ -17,7 +16,7 @@ export interface ButtonGroupProps {
|
||||
* @defaultValue 'div'
|
||||
*/
|
||||
as?: any
|
||||
size?: ButtonProps['size']
|
||||
size?: ButtonGroupVariants['size']
|
||||
/**
|
||||
* The orientation the buttons are laid out.
|
||||
* @defaultValue 'horizontal'
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { ButtonGroupProps } from '../components/ButtonGroup.vue'
|
||||
import type { GetObjectField } from '../types/utils'
|
||||
|
||||
export const buttonGroupInjectionKey: InjectionKey<ComputedRef<{
|
||||
size: ButtonGroupProps ['size']
|
||||
size: ButtonGroupProps['size']
|
||||
orientation: ButtonGroupProps['orientation']
|
||||
}>> = Symbol('nuxt-ui.button-group')
|
||||
|
||||
|
||||
@@ -21,6 +21,13 @@ export const buttonGroupVariantWithRoot = {
|
||||
export default {
|
||||
base: 'relative',
|
||||
variants: {
|
||||
size: {
|
||||
xs: '',
|
||||
sm: '',
|
||||
md: '',
|
||||
lg: '',
|
||||
xl: ''
|
||||
},
|
||||
orientation: {
|
||||
horizontal: 'inline-flex -space-x-px',
|
||||
vertical: 'flex flex-col -space-y-px'
|
||||
|
||||
Reference in New Issue
Block a user