diff --git a/package.json b/package.json index 45962f2..fa901a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "design-system-vue", - "version": "0.0.20", + "version": "0.0.21", "type": "module", "files": [ "dist" diff --git a/src/components/Textfield/Textfield.vue b/src/components/Textfield/Textfield.vue index a89bc5c..8d52887 100644 --- a/src/components/Textfield/Textfield.vue +++ b/src/components/Textfield/Textfield.vue @@ -62,6 +62,11 @@ const iconName = computed(() => { if (hasErrorMsg.value) return props.icon || 'error'; return props.icon; }); +const iconSize = computed(() => { + if (props.size === 'small') return 16; + if (props.size === 'large') return 24; + return 20; +}); const onChange = () => { emit('change', { value: state.value, @@ -124,8 +129,8 @@ const onClick = () => { /> input[type='text'] { @apply border-red-500 text-red-500 bg-red-100 hover:border-red-500; } + .textfield__error { @apply text-red-500 font-light text-xs tracking-wide mt-1; } + .textfield__icon--error { @apply animate-bounce text-red-500; } + .textfield--loading { @apply animate-pulse; } + .textfield--disabled { @apply opacity-50 cursor-not-allowed; } + .textfield--disabled > input[type='text'] { @apply cursor-not-allowed; } + .textfield--disabled:hover { @apply border border-solid border-gray-100; } + .textfield--clearable > .textfield__icon { @apply cursor-pointer; } + .textfield--small { @apply h-6 text-sm; } + .textfield--small > input[type='text'] { @apply text-sm; } + .textfield__label--small { @apply text-xs; } + .textfield--large { @apply h-10 text-lg; } + .textfield--large > input[type='text'] { @apply text-lg; } + .textfield__label--large { @apply text-base; }