mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
feat: uniformize components sizes (#68)
This commit is contained in:
@@ -2,10 +2,15 @@ import { describe, it, expect, test } from 'vitest'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Input, { type InputProps } from '../../src/runtime/components/Input.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
import theme from '#build/ui/input'
|
||||
|
||||
describe('Input', () => {
|
||||
const sizes = Object.keys(theme.variants.size) as any
|
||||
const colors = Object.keys(theme.variants.color) as any
|
||||
const variants = Object.keys(theme.variants.variant) as any
|
||||
|
||||
it.each([
|
||||
['basic case', {}],
|
||||
// Props
|
||||
['with id', { props: { name: 'id' } }],
|
||||
['with name', { props: { name: 'username' } }],
|
||||
['with type', { props: { type: 'password' } }],
|
||||
@@ -19,14 +24,12 @@ describe('Input', () => {
|
||||
['with trailingIcon', { props: { trailingIcon: 'i-heroicons-magnifying-glass' } }],
|
||||
['with loading', { props: { loading: true } }],
|
||||
['with loadingIcon', { props: { loading: true, loadingIcon: 'i-heroicons-sparkles' } }],
|
||||
['with size 2xs', { props: { size: '2xs' as const } }],
|
||||
['with size xs', { props: { size: 'xs' as const } }],
|
||||
['with size sm', { props: { size: 'sm' as const } }],
|
||||
['with size md', { props: { size: 'md' as const } }],
|
||||
['with size lg', { props: { size: 'lg' as const } }],
|
||||
['with size xl', { props: { size: 'xl' as const } }],
|
||||
['with color', { props: { color: 'red' as const } }],
|
||||
['with variant', { props: { variant: 'outline' as const } }],
|
||||
...sizes.map((size: string) => [`with size ${size}`, { props: { size } }]),
|
||||
...colors.map((color: string) => [`with color ${color}`, { props: { color } }]),
|
||||
...variants.map((variant: string) => [`with variant ${variant}`, { props: { variant } }]),
|
||||
['with class', { props: { class: 'absolute' } }],
|
||||
['with ui', { props: { ui: { base: 'rounded-full' } } }],
|
||||
// Slots
|
||||
['with default slot', { slots: { default: () => 'Default slot' } }],
|
||||
['with leading slot', { slots: { leading: () => 'Leading slot' } }],
|
||||
['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }]
|
||||
|
||||
Reference in New Issue
Block a user