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