Make user specify country code for PhoneNumberInput.master
@@ -3,7 +3,7 @@ | |||||
- Action | - Action | ||||
- [X] ActionButton | - [X] ActionButton | ||||
- Blob (choose to extract each preview component to their own library?) | - Blob (choose to extract each preview component to their own library?) | ||||
- [-] FileSelectBox | |||||
- [X] FileSelectBox | |||||
- Choice | - Choice | ||||
- [X] ComboBox | - [X] ComboBox | ||||
- [X] DropdownSelect | - [X] DropdownSelect | ||||
@@ -48,7 +48,7 @@ export interface PhoneNumberInputProps extends Omit<React.HTMLProps<PhoneNumberI | |||||
/** | /** | ||||
* Country where the phone number should be formatted for. | * Country where the phone number should be formatted for. | ||||
*/ | */ | ||||
country?: Country, | |||||
country: Country, | |||||
/** | /** | ||||
* Visual length of the input. | * Visual length of the input. | ||||
*/ | */ | ||||
@@ -74,7 +74,7 @@ export const PhoneNumberInput = React.forwardRef< | |||||
id: idProp, | id: idProp, | ||||
style, | style, | ||||
enhanced = false as const, | enhanced = false as const, | ||||
country = 'PH' as const, | |||||
country, | |||||
value, | value, | ||||
onChange, | onChange, | ||||
name, | name, | ||||
@@ -247,6 +247,5 @@ PhoneNumberInput.defaultProps = { | |||||
variant: 'default' as const, | variant: 'default' as const, | ||||
hiddenLabel: false as const, | hiddenLabel: false as const, | ||||
enhanced: false as const, | enhanced: false as const, | ||||
country: 'PH' as const, | |||||
length: undefined, | length: undefined, | ||||
}; | }; |
@@ -12,6 +12,7 @@ const TemporalPage: NextPage = () => { | |||||
<Section title="PhoneNumberInput"> | <Section title="PhoneNumberInput"> | ||||
<Subsection title="Default"> | <Subsection title="Default"> | ||||
<Formatted.PhoneNumberInput | <Formatted.PhoneNumberInput | ||||
country="PH" | |||||
label="Phone" | label="Phone" | ||||
name="phone" | name="phone" | ||||
enhanced | enhanced | ||||
@@ -23,6 +24,7 @@ const TemporalPage: NextPage = () => { | |||||
</Subsection> | </Subsection> | ||||
<Subsection title="Non-enhanced"> | <Subsection title="Non-enhanced"> | ||||
<Formatted.PhoneNumberInput | <Formatted.PhoneNumberInput | ||||
country="PH" | |||||
label="Phone" | label="Phone" | ||||
name="phone" | name="phone" | ||||
border | border | ||||
@@ -33,6 +35,7 @@ const TemporalPage: NextPage = () => { | |||||
</Subsection> | </Subsection> | ||||
<Subsection title="With Default Value"> | <Subsection title="With Default Value"> | ||||
<Formatted.PhoneNumberInput | <Formatted.PhoneNumberInput | ||||
country="PH" | |||||
label="Phone" | label="Phone" | ||||
name="phone2" | name="phone2" | ||||
enhanced | enhanced | ||||
@@ -44,6 +47,7 @@ const TemporalPage: NextPage = () => { | |||||
<div className="flex gap-4 flex-wrap"> | <div className="flex gap-4 flex-wrap"> | ||||
<div> | <div> | ||||
<Formatted.PhoneNumberInput | <Formatted.PhoneNumberInput | ||||
country="PH" | |||||
label="Phone" | label="Phone" | ||||
name="phone3" | name="phone3" | ||||
enhanced | enhanced | ||||
@@ -87,6 +87,7 @@ const RegistrationFormPage: NextPage = () => { | |||||
</div> | </div> | ||||
<div className="sm:col-span-2"> | <div className="sm:col-span-2"> | ||||
<Formatted.PhoneNumberInput | <Formatted.PhoneNumberInput | ||||
country="PH" | |||||
block | block | ||||
border | border | ||||
label="Phone" | label="Phone" | ||||