@scalemule/ui
v0.0.1
Published
ScaleMule shared UI components and utilities
Downloads
147
Maintainers
Readme
@scalemule/ui
Shared phone utilities and optional React input components for ScaleMule SDKs.
Install
npm install @scalemule/uiExports
@scalemule/ui and @scalemule/ui/phone export:
PHONE_COUNTRIESnormalizePhoneNumber,normalizeAndValidatePhonecomposePhoneNumberisValidE164Phone,E164_REGEXfindPhoneCountryByCode,findPhoneCountryByDialCode,detectCountryFromE164countryFlag
@scalemule/ui/react exports:
PhoneInputCountrySelect,COUNTRIES
Usage
import { normalizeAndValidatePhone } from '@scalemule/ui/phone'
const result = normalizeAndValidatePhone('(415) 555-0123', 'US')import { PhoneInput } from '@scalemule/ui/react'
export function PhoneField() {
return <PhoneInput value="" onChange={() => {}} />
}License
MIT
