fix phone input height (#585)

* fix phone input height

* fix width classes

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka 2024-10-10 09:45:01 +01:00 committed by GitHub
parent 2ab5e09750
commit fa8c264cd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 83 additions and 16 deletions

View File

@ -12,7 +12,7 @@
> >
<v-select <v-select
v-model="selectedCountryCode" v-model="selectedCountryCode"
class="w-[130px]" :class="theme.PhoneInput.countrySelectWidth"
dropdown-class="max-w-[300px]" dropdown-class="max-w-[300px]"
input-class="rounded-r-none" input-class="rounded-r-none"
:data="countries" :data="countries"
@ -41,13 +41,14 @@
<template #selected="props"> <template #selected="props">
<div <div
class="flex items-center space-x-2 justify-center overflow-hidden" class="flex items-center space-x-2 justify-center overflow-hidden"
:class="theme.PhoneInput.maxHeight"
> >
<country-flag <country-flag
size="normal" size="normal"
class="!-mt-[9px] rounded" class="!-mt-[9px] rounded"
:country="props.option.code" :country="props.option.code"
/> />
<span>{{ props.option.dial_code }}</span> <span class="text-sm">{{ props.option.dial_code }}</span>
</div> </div>
</template> </template>
</v-select> </v-select>
@ -57,11 +58,11 @@
class="inline-flex-grow !border-l-0 !rounded-l-none" class="inline-flex-grow !border-l-0 !rounded-l-none"
:disabled="disabled ? true : null" :disabled="disabled ? true : null"
:class="[ :class="[
theme.default.input, theme.PhoneInput.input,
theme.default.spacing.horizontal, theme.PhoneInput.spacing.horizontal,
theme.default.spacing.vertical, theme.PhoneInput.spacing.vertical,
theme.default.fontSize, theme.PhoneInput.fontSize,
theme.default.borderRadius, theme.PhoneInput.borderRadius,
{ {
'!ring-red-500 !ring-2': hasError, '!ring-red-500 !ring-2': hasError,
'!cursor-not-allowed !bg-gray-200': disabled, '!cursor-not-allowed !bg-gray-200': disabled,

View File

@ -73,6 +73,28 @@ export const themes = {
lg: 'w-6 h-6 mx-1' lg: 'w-6 h-6 mx-1'
} }
}, },
PhoneInput: {
countrySelectWidth: {
sm: 'w-[100px]',
md: 'w-[120px]',
lg: 'w-[120px]'
},
flag: {
sm: '!-mt-[14px]',
md: '!-mt-[9px] rounded',
lg: '!-mt-[9px] rounded'
},
flagSize: {
sm: 'small',
md: 'normal',
lg: 'normal'
},
maxHeight: {
sm: 'max-h-[20px]',
md: 'max-h-[24px]',
lg: 'max-h-[28px]'
}
},
DateInput: { DateInput: {
input: input:
'flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full bg-white text-gray-700 dark:bg-notion-dark-light dark:text-gray-300 dark:placeholder-gray-500 placeholder-gray-400 shadow-sm text-base focus:outline-none focus:ring-2 focus:border-transparent focus:ring-opacity-100' 'flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full bg-white text-gray-700 dark:bg-notion-dark-light dark:text-gray-300 dark:placeholder-gray-500 placeholder-gray-400 shadow-sm text-base focus:outline-none focus:ring-2 focus:border-transparent focus:ring-opacity-100'
@ -202,6 +224,28 @@ export const themes = {
lg: 'w-6 h-6 mx-1' lg: 'w-6 h-6 mx-1'
} }
}, },
PhoneInput: {
countrySelectWidth: {
sm: 'w-[100px]',
md: 'w-[120px]',
lg: 'w-[120px]'
},
flag: {
sm: '!-mt-[14px]',
md: '!-mt-[9px] rounded',
lg: '!-mt-[9px] rounded'
},
flagSize: {
sm: 'small',
md: 'normal',
lg: 'normal'
},
maxHeight: {
sm: 'max-h-[20px]',
md: 'max-h-[24px]',
lg: 'max-h-[28px]'
}
},
DateInput: { DateInput: {
input: 'flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full bg-white text-gray-700 dark:bg-notion-dark-light dark:text-gray-300 placeholder-gray-400 text-base focus:outline-none focus:ring-2 focus:border-transparent focus:ring-opacity-100' input: 'flex-1 appearance-none border border-gray-300 dark:border-gray-600 w-full bg-white text-gray-700 dark:bg-notion-dark-light dark:text-gray-300 placeholder-gray-400 text-base focus:outline-none focus:ring-2 focus:border-transparent focus:ring-opacity-100'
}, },
@ -325,6 +369,28 @@ export const themes = {
lg: 'w-6 h-6 mx-1' lg: 'w-6 h-6 mx-1'
} }
}, },
PhoneInput: {
countrySelectWidth: {
sm: 'w-[100px]',
md: 'w-[120px]',
lg: 'w-[120px]'
},
flag: {
sm: '!-mt-[14px]',
md: '!-mt-[9px] rounded',
lg: '!-mt-[9px] rounded'
},
flagSize: {
sm: 'small',
md: 'normal',
lg: 'normal'
},
maxHeight: {
sm: 'max-h-[20px]',
md: 'max-h-[24px]',
lg: 'max-h-[28px]'
}
},
DateInput: { DateInput: {
input: 'shadow-inner-notion border-transparent focus:border-transparent flex-1 appearance-none w-full bg-notion-input-background dark:bg-notion-dark-light text-gray-900 dark:text-gray-100 placeholder-gray-400 text-base focus:outline-none focus:ring-0 focus:border-transparent focus:shadow-focus-notion p-[1px]' input: 'shadow-inner-notion border-transparent focus:border-transparent flex-1 appearance-none w-full bg-notion-input-background dark:bg-notion-dark-light text-gray-900 dark:text-gray-100 placeholder-gray-400 text-base focus:outline-none focus:ring-0 focus:border-transparent focus:shadow-focus-notion p-[1px]'
}, },