@caspeco/casper-ui-library 10.0.4 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/input/input-recipe.d.ts.map +1 -1
- package/dist/components/input/input-recipe.js +8 -3
- package/dist/components/input/input.composition.d.ts.map +1 -1
- package/dist/components/input/input.d.ts +1 -0
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +76 -52
- package/dist/components/input/types.d.ts +2 -2
- package/dist/components/input/types.d.ts.map +1 -1
- package/dist/components/menu/menu-box-button.d.ts +4 -1
- package/dist/components/menu/menu-box-button.d.ts.map +1 -1
- package/dist/components/menu/menu-box-button.js +15 -14
- package/dist/components/phone-input/country-data.d.ts +22 -0
- package/dist/components/phone-input/country-data.d.ts.map +1 -0
- package/dist/components/phone-input/country-data.js +38 -0
- package/dist/components/phone-input/country-data.spec.d.ts +2 -0
- package/dist/components/phone-input/country-data.spec.d.ts.map +1 -0
- package/dist/components/phone-input/country-list.d.ts +19 -0
- package/dist/components/phone-input/country-list.d.ts.map +1 -0
- package/dist/components/phone-input/country-list.js +27 -0
- package/dist/components/phone-input/country-selector.d.ts +59 -0
- package/dist/components/phone-input/country-selector.d.ts.map +1 -0
- package/dist/components/phone-input/country-selector.js +120 -0
- package/dist/components/phone-input/index.d.ts +5 -0
- package/dist/components/phone-input/index.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input-helpers.d.ts +47 -0
- package/dist/components/phone-input/phone-input-helpers.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input-helpers.js +134 -0
- package/dist/components/phone-input/phone-input-helpers.spec.d.ts +2 -0
- package/dist/components/phone-input/phone-input-helpers.spec.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input.composition.d.ts +26 -0
- package/dist/components/phone-input/phone-input.composition.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input.d.ts +22 -0
- package/dist/components/phone-input/phone-input.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input.js +43 -0
- package/dist/components/phone-input/phone-input.spec.d.ts +2 -0
- package/dist/components/phone-input/phone-input.spec.d.ts.map +1 -0
- package/dist/components/phone-input/phone-input.visual.test.d.ts +2 -0
- package/dist/components/phone-input/phone-input.visual.test.d.ts.map +1 -0
- package/dist/components/phone-input/translations.d.ts +60 -0
- package/dist/components/phone-input/translations.d.ts.map +1 -0
- package/dist/components/phone-input/translations.js +54 -0
- package/dist/components/phone-input/types.d.ts +45 -0
- package/dist/components/phone-input/types.d.ts.map +1 -0
- package/dist/components/phone-input/use-phone-input.d.ts +49 -0
- package/dist/components/phone-input/use-phone-input.d.ts.map +1 -0
- package/dist/components/phone-input/use-phone-input.js +138 -0
- package/dist/components/phone-input/use-phone-input.spec.d.ts +2 -0
- package/dist/components/phone-input/use-phone-input.spec.d.ts.map +1 -0
- package/dist/hooks/use-measured-width.d.ts +23 -0
- package/dist/hooks/use-measured-width.d.ts.map +1 -0
- package/dist/hooks/use-measured-width.js +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +289 -285
- package/dist/node_modules/country-flag-icons/modules/countries.json.js +4 -0
- package/dist/node_modules/country-flag-icons/modules/hasFlag.js +7 -0
- package/dist/node_modules/country-flag-icons/modules/react/3x2/index.js +6303 -0
- package/dist/node_modules/country-flag-icons/react/3x2/index.js +269 -0
- package/dist/node_modules/libphonenumber-js/es6/ParseError.js +89 -0
- package/dist/node_modules/libphonenumber-js/es6/PhoneNumber.js +192 -0
- package/dist/node_modules/libphonenumber-js/es6/constants.js +10 -0
- package/dist/node_modules/libphonenumber-js/es6/format.js +98 -0
- package/dist/node_modules/libphonenumber-js/es6/getCountries.js +7 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +11 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +7 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +16 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +11 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +18 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +46 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +27 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +23 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +39 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +31 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +23 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +25 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js +12 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +9 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +43 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +12 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +52 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +14 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/isCallingCode.js +7 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/isCountryCode.js +7 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/isObject.js +7 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +20 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +6 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +79 -0
- package/dist/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +19 -0
- package/dist/node_modules/libphonenumber-js/es6/isPossible.js +35 -0
- package/dist/node_modules/libphonenumber-js/es6/isValid.js +14 -0
- package/dist/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +59 -0
- package/dist/node_modules/libphonenumber-js/es6/metadata.js +494 -0
- package/dist/node_modules/libphonenumber-js/es6/normalizeArguments.js +108 -0
- package/dist/node_modules/libphonenumber-js/es6/parse.js +138 -0
- package/dist/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +40 -0
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +9 -0
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +55 -0
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +62 -0
- package/dist/node_modules/libphonenumber-js/es6/tools/semver-compare.js +14 -0
- package/dist/node_modules/libphonenumber-js/metadata.min.json.js +4 -0
- package/dist/node_modules/libphonenumber-js/min/exports/getCountries.js +8 -0
- package/dist/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js +8 -0
- package/dist/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js +8 -0
- package/dist/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js +8 -0
- package/dist/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +8 -0
- package/dist/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +8 -0
- package/dist/test-utils/create-visual-tests.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
2
|
+
import { Locales } from './translations.js';
|
|
3
|
+
import { PhoneValidationResult } from './types.js';
|
|
4
|
+
export type ValidatePhoneNumberOptions = {
|
|
5
|
+
/** Field is required (drives the empty-value error once feedback is revealed). */
|
|
6
|
+
isRequired?: boolean;
|
|
7
|
+
/** Whether to surface error feedback (revealed on blur/validate, cleared when fixed). */
|
|
8
|
+
showValidation?: boolean;
|
|
9
|
+
/** Locale for error messages. */
|
|
10
|
+
locale?: Locales;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Validate a phone number for a country. `isValid` is always reported; `errorMessage` is set only
|
|
14
|
+
* when `showValidation` is true and the number fails (required+empty, or content not yet valid).
|
|
15
|
+
*/
|
|
16
|
+
export declare function validatePhoneNumber(value: string, country: CountryCode, options?: ValidatePhoneNumberOptions): PhoneValidationResult;
|
|
17
|
+
/** Format to international format, or return the original value if it can't be parsed. */
|
|
18
|
+
export declare function formatPhoneNumber(value: string, country: CountryCode): string;
|
|
19
|
+
/**
|
|
20
|
+
* Convert to E.164 storage format (e.g. "+46737884410"). Falls back to a best-effort "+digits"
|
|
21
|
+
* while the number is still being typed, and "" when empty.
|
|
22
|
+
*/
|
|
23
|
+
export declare function toE164(value: string, country: CountryCode): string;
|
|
24
|
+
/** National number (digits without the country code), or "" if there is none. */
|
|
25
|
+
export declare function extractNationalNumber(value: string, country: CountryCode): string;
|
|
26
|
+
/** Whether the value has a national number beyond a bare dial-code prefix ("+46" → false, "+46 73…" → true). */
|
|
27
|
+
export declare function hasNationalContent(value: string, country: CountryCode): boolean;
|
|
28
|
+
/** Whether the value has content but isn't yet valid (warrants an "incomplete" warning). */
|
|
29
|
+
export declare function isIncompletePhoneNumber(value: string, country: CountryCode): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Detect the country for an international "+" value, resolving its calling code (longest match
|
|
32
|
+
* first) to the primary region. Returns undefined for non-"+" values or unknown codes.
|
|
33
|
+
*/
|
|
34
|
+
export declare function detectCountryFromInput(value: string): CountryCode | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The country to switch to for a "+" value, or undefined to keep `currentCountry`. Switches only on
|
|
37
|
+
* a different calling code, so countries sharing one (e.g. American Samoa & US, both +1) keep their flag.
|
|
38
|
+
*/
|
|
39
|
+
export declare function detectCountryChange(value: string, currentCountry: CountryCode): CountryCode | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a "+" value's leading digits can no longer prefix any calling code ("+999"), used to
|
|
42
|
+
* show a generic flag. A bare "+" or a viable prefix returns false to avoid flicker while typing.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isUnknownCallingCode(value: string): boolean;
|
|
45
|
+
/** Resolve the initial country: explicit prop → device locale → locale-prop region → "SE". */
|
|
46
|
+
export declare function resolveInitialCountry(country: CountryCode | undefined, locale: Locales): CountryCode;
|
|
47
|
+
//# sourceMappingURL=phone-input-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input-helpers.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,WAAW,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,0BAA0B,GAAG;IACxC,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,yFAAyF;IACzF,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,0BAA+B,GACtC,qBAAqB,CAmBvB;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAalE;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAQjF;AASD,gHAAgH;AAChH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAE/E;AAED,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAEpF;AA+BD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CA6B7E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAUvG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgB3D;AA+BD,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,WAAW,CAKpG"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { translations as I } from "./translations.js";
|
|
2
|
+
import { parsePhoneNumber as u } from "../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js";
|
|
3
|
+
import { getCountries as g } from "../../node_modules/libphonenumber-js/min/exports/getCountries.js";
|
|
4
|
+
import { getCountryCallingCode as o } from "../../node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js";
|
|
5
|
+
import { isValidPhoneNumber as d } from "../../node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js";
|
|
6
|
+
import { isSupportedCountry as b } from "../../node_modules/libphonenumber-js/min/exports/isSupportedCountry.js";
|
|
7
|
+
function V(t, n, r = {}) {
|
|
8
|
+
const {
|
|
9
|
+
isRequired: e = !1,
|
|
10
|
+
showValidation: i = !1,
|
|
11
|
+
locale: s = "en-US"
|
|
12
|
+
} = r, a = I[s], f = h(t, n);
|
|
13
|
+
return f && d(t, n) ? {
|
|
14
|
+
isValid: !0
|
|
15
|
+
} : i ? f ? {
|
|
16
|
+
isValid: !1,
|
|
17
|
+
errorMessage: a.numberLooksIncomplete
|
|
18
|
+
} : {
|
|
19
|
+
isValid: !1,
|
|
20
|
+
errorMessage: e ? a.requiredFieldEmpty : void 0
|
|
21
|
+
} : {
|
|
22
|
+
isValid: !1,
|
|
23
|
+
errorMessage: void 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function F(t, n) {
|
|
27
|
+
return u(t, n)?.formatInternational() ?? t;
|
|
28
|
+
}
|
|
29
|
+
function L(t, n) {
|
|
30
|
+
const r = u(t, n);
|
|
31
|
+
if (r)
|
|
32
|
+
return r.format("E.164");
|
|
33
|
+
const e = t.trim().startsWith("+"), i = t.replace(/\D/g, "");
|
|
34
|
+
return i ? e ? `+${i}` : i : "";
|
|
35
|
+
}
|
|
36
|
+
function M(t, n) {
|
|
37
|
+
const r = u(t, n);
|
|
38
|
+
return r ? r.nationalNumber?.toString() ?? "" : m(t, n);
|
|
39
|
+
}
|
|
40
|
+
function m(t, n) {
|
|
41
|
+
const r = o(n), e = t.replace(/\D/g, "");
|
|
42
|
+
return e.startsWith(r) ? e.slice(r.length) : e;
|
|
43
|
+
}
|
|
44
|
+
function h(t, n) {
|
|
45
|
+
return m(t, n).length > 0;
|
|
46
|
+
}
|
|
47
|
+
function U(t, n) {
|
|
48
|
+
return h(t, n) && !d(t, n);
|
|
49
|
+
}
|
|
50
|
+
const l = {
|
|
51
|
+
1: "US",
|
|
52
|
+
7: "RU",
|
|
53
|
+
39: "IT",
|
|
54
|
+
44: "GB",
|
|
55
|
+
47: "NO",
|
|
56
|
+
61: "AU",
|
|
57
|
+
212: "MA",
|
|
58
|
+
262: "RE",
|
|
59
|
+
290: "SH",
|
|
60
|
+
358: "FI",
|
|
61
|
+
590: "GP",
|
|
62
|
+
599: "CW"
|
|
63
|
+
};
|
|
64
|
+
let c = null;
|
|
65
|
+
function p() {
|
|
66
|
+
return c || (c = new Set(g().map((t) => o(t).toString()))), c;
|
|
67
|
+
}
|
|
68
|
+
function C(t, n) {
|
|
69
|
+
return t.replace(/^\+/, "").replace(/\D/g, "").slice(0, n);
|
|
70
|
+
}
|
|
71
|
+
function S(t) {
|
|
72
|
+
if (!t.trim().startsWith("+"))
|
|
73
|
+
return;
|
|
74
|
+
const n = p(), r = C(t, 3);
|
|
75
|
+
for (let e = 3; e >= 1; e--) {
|
|
76
|
+
const i = r.slice(0, e);
|
|
77
|
+
if (i.length !== e || !n.has(i))
|
|
78
|
+
continue;
|
|
79
|
+
if (l[i])
|
|
80
|
+
return l[i];
|
|
81
|
+
const s = u(t);
|
|
82
|
+
return s?.country && o(s.country) === i ? s.country : g().find((a) => o(a) === i);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function w(t, n) {
|
|
86
|
+
const r = S(t);
|
|
87
|
+
if (r && r !== n && o(r) !== o(n))
|
|
88
|
+
return r;
|
|
89
|
+
}
|
|
90
|
+
function A(t) {
|
|
91
|
+
if (!t.trim().startsWith("+"))
|
|
92
|
+
return !1;
|
|
93
|
+
const n = C(t, 3);
|
|
94
|
+
if (!n)
|
|
95
|
+
return !1;
|
|
96
|
+
for (const r of p())
|
|
97
|
+
if (r.startsWith(n) || n.startsWith(r))
|
|
98
|
+
return !1;
|
|
99
|
+
return !0;
|
|
100
|
+
}
|
|
101
|
+
function N(t) {
|
|
102
|
+
if (t)
|
|
103
|
+
try {
|
|
104
|
+
const n = new Intl.Locale(t), r = n.region ?? n.maximize().region;
|
|
105
|
+
return r && b(r) ? r : void 0;
|
|
106
|
+
} catch {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function v() {
|
|
111
|
+
if (typeof navigator > "u")
|
|
112
|
+
return;
|
|
113
|
+
const t = navigator.languages?.length ? navigator.languages : [navigator.language];
|
|
114
|
+
for (const n of t) {
|
|
115
|
+
const r = N(n);
|
|
116
|
+
if (r)
|
|
117
|
+
return r;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function G(t, n) {
|
|
121
|
+
return t || (v() ?? N(n) ?? "SE");
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
w as detectCountryChange,
|
|
125
|
+
S as detectCountryFromInput,
|
|
126
|
+
M as extractNationalNumber,
|
|
127
|
+
F as formatPhoneNumber,
|
|
128
|
+
h as hasNationalContent,
|
|
129
|
+
U as isIncompletePhoneNumber,
|
|
130
|
+
A as isUnknownCallingCode,
|
|
131
|
+
G as resolveInitialCountry,
|
|
132
|
+
L as toE164,
|
|
133
|
+
V as validatePhoneNumber
|
|
134
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input-helpers.spec.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input-helpers.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default appearance: input with the country flag + prefilled dial code, and a label.
|
|
3
|
+
*/
|
|
4
|
+
export declare const Default: () => import("react").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* The four sizes stacked, to catch height + flag/icon scaling regressions.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Sizes: () => import("react").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Outline (default) vs ghost variants.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Variants: () => import("react").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Invalid state: red border + the built-in error message rendered into the FormControl.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Invalid: () => import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Disabled input + country selector.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Disabled: () => import("react").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Country selector open — the searchable dropdown with flags and calling codes.
|
|
23
|
+
* The visual test opens it via `beforeScreenshot`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MenuOpen: () => import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=phone-input.composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.composition.tsx"],"names":[],"mappings":"AAiBA;;GAEG;AACH,eAAO,MAAM,OAAO,mCAQnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,mCAOjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,mCAKpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,mCAQnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,mCAQpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,mCAQpB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PhoneInputProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Phone number input with integrated country selection, formatting and validation.
|
|
4
|
+
*
|
|
5
|
+
* Presentational — always driven by {@link usePhoneInput}. Spread `inputProps` onto it and
|
|
6
|
+
* wrap it in a `<FormControl>` you own (spread `formControlProps`); the component renders its
|
|
7
|
+
* own error message into that FormControl's context.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const phone = usePhoneInput({ defaultCountry: "SE", isRequired: true });
|
|
12
|
+
*
|
|
13
|
+
* <FormControl {...phone.formControlProps}>
|
|
14
|
+
* <FormLabel>Phone number</FormLabel>
|
|
15
|
+
* <PhoneInput {...phone.inputProps} placeholder="Enter phone number" />
|
|
16
|
+
* </FormControl>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see Docs https://caspeco.github.io/casper-ui-library/components/phone-input
|
|
20
|
+
*/
|
|
21
|
+
export declare function PhoneInput({ ref, value, onChange, onBlur, country, onCountryChange, unknownPrefix, errorMessage, locale, size, variant, placeholder, isDisabled: isDisabledProp, isReadOnly: isReadOnlyProp, ...rest }: PhoneInputProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=phone-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EAC1B,GAAG,EACH,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,eAAe,EACf,aAAa,EACb,YAAY,EACZ,MAAgB,EAChB,IAAW,EACX,OAAmB,EACnB,WAAW,EACX,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,GAAG,IAAI,EACP,EAAE,eAAe,+BAsCjB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as E, jsxs as j, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { c as B } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { useFieldContext as I } from "@chakra-ui/react";
|
|
4
|
+
import { CountrySelector as S } from "./country-selector.js";
|
|
5
|
+
import { translations as N } from "./translations.js";
|
|
6
|
+
import { Input as U } from "../input/input.js";
|
|
7
|
+
import { FormErrorMessage as $ } from "../form-control/form-error-message.js";
|
|
8
|
+
function Q(R) {
|
|
9
|
+
const e = B.c(40);
|
|
10
|
+
let b, t, v, x, l, o, n, C, r, s, u, h, y, P, i;
|
|
11
|
+
e[0] !== R ? ({
|
|
12
|
+
ref: r,
|
|
13
|
+
value: i,
|
|
14
|
+
onChange: o,
|
|
15
|
+
onBlur: l,
|
|
16
|
+
country: b,
|
|
17
|
+
onCountryChange: n,
|
|
18
|
+
unknownPrefix: P,
|
|
19
|
+
errorMessage: t,
|
|
20
|
+
locale: u,
|
|
21
|
+
size: h,
|
|
22
|
+
variant: y,
|
|
23
|
+
placeholder: C,
|
|
24
|
+
isDisabled: v,
|
|
25
|
+
isReadOnly: x,
|
|
26
|
+
...s
|
|
27
|
+
} = R, e[0] = R, e[1] = b, e[2] = t, e[3] = v, e[4] = x, e[5] = l, e[6] = o, e[7] = n, e[8] = C, e[9] = r, e[10] = s, e[11] = u, e[12] = h, e[13] = y, e[14] = P, e[15] = i) : (b = e[1], t = e[2], v = e[3], x = e[4], l = e[5], o = e[6], n = e[7], C = e[8], r = e[9], s = e[10], u = e[11], h = e[12], y = e[13], P = e[14], i = e[15]);
|
|
28
|
+
const g = u === void 0 ? "en-US" : u, a = h === void 0 ? "md" : h, D = y === void 0 ? "outline" : y, M = N[g], F = I(), d = v ?? F?.disabled ?? !1, c = x ?? F?.readOnly ?? !1, k = C ?? M.enterPhoneNumberPlaceholder, w = P ? void 0 : b;
|
|
29
|
+
let m;
|
|
30
|
+
e[16] !== d || e[17] !== g || e[18] !== n || e[19] !== c || e[20] !== a || e[21] !== w ? (m = /* @__PURE__ */ E(S, { value: w, onChange: n, size: a, menuPlacement: "bottom-start", locale: g, isDisabled: d, isReadOnly: c }), e[16] = d, e[17] = g, e[18] = n, e[19] = c, e[20] = a, e[21] = w, e[22] = m) : m = e[22];
|
|
31
|
+
let f;
|
|
32
|
+
e[23] !== d || e[24] !== l || e[25] !== o || e[26] !== c || e[27] !== r || e[28] !== s || e[29] !== a || e[30] !== k || e[31] !== m || e[32] !== i || e[33] !== D ? (f = /* @__PURE__ */ E(U, { ref: r, type: "tel", inputMode: "tel", placeholder: k, value: i, size: a, variant: D, isDisabled: d, isReadOnly: c, onChange: o, onBlur: l, leftElement: m, ...s }), e[23] = d, e[24] = l, e[25] = o, e[26] = c, e[27] = r, e[28] = s, e[29] = a, e[30] = k, e[31] = m, e[32] = i, e[33] = D, e[34] = f) : f = e[34];
|
|
33
|
+
let p;
|
|
34
|
+
e[35] !== t ? (p = t && /* @__PURE__ */ E($, { wordBreak: "break-word", children: t }), e[35] = t, e[36] = p) : p = e[36];
|
|
35
|
+
let O;
|
|
36
|
+
return e[37] !== f || e[38] !== p ? (O = /* @__PURE__ */ j(z, { children: [
|
|
37
|
+
f,
|
|
38
|
+
p
|
|
39
|
+
] }), e[37] = f, e[38] = p, e[39] = O) : O = e[39], O;
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
Q as PhoneInput
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input.spec.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/phone-input.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type Locales = "en-US" | "nb-NO" | "da-DK" | "sv-SE" | "en-GB" | "fr-FR" | "nl-BE";
|
|
2
|
+
export declare const translations: {
|
|
3
|
+
"sv-SE": {
|
|
4
|
+
searchCountryPlaceholder: string;
|
|
5
|
+
noCountriesFound: string;
|
|
6
|
+
enterPhoneNumberPlaceholder: string;
|
|
7
|
+
numberLooksIncomplete: string;
|
|
8
|
+
requiredFieldEmpty: string;
|
|
9
|
+
openCountrySelector: string;
|
|
10
|
+
};
|
|
11
|
+
"en-US": {
|
|
12
|
+
searchCountryPlaceholder: string;
|
|
13
|
+
noCountriesFound: string;
|
|
14
|
+
enterPhoneNumberPlaceholder: string;
|
|
15
|
+
numberLooksIncomplete: string;
|
|
16
|
+
requiredFieldEmpty: string;
|
|
17
|
+
openCountrySelector: string;
|
|
18
|
+
};
|
|
19
|
+
"en-GB": {
|
|
20
|
+
searchCountryPlaceholder: string;
|
|
21
|
+
noCountriesFound: string;
|
|
22
|
+
enterPhoneNumberPlaceholder: string;
|
|
23
|
+
numberLooksIncomplete: string;
|
|
24
|
+
requiredFieldEmpty: string;
|
|
25
|
+
openCountrySelector: string;
|
|
26
|
+
};
|
|
27
|
+
"nb-NO": {
|
|
28
|
+
searchCountryPlaceholder: string;
|
|
29
|
+
noCountriesFound: string;
|
|
30
|
+
enterPhoneNumberPlaceholder: string;
|
|
31
|
+
numberLooksIncomplete: string;
|
|
32
|
+
requiredFieldEmpty: string;
|
|
33
|
+
openCountrySelector: string;
|
|
34
|
+
};
|
|
35
|
+
"da-DK": {
|
|
36
|
+
searchCountryPlaceholder: string;
|
|
37
|
+
noCountriesFound: string;
|
|
38
|
+
enterPhoneNumberPlaceholder: string;
|
|
39
|
+
numberLooksIncomplete: string;
|
|
40
|
+
requiredFieldEmpty: string;
|
|
41
|
+
openCountrySelector: string;
|
|
42
|
+
};
|
|
43
|
+
"fr-FR": {
|
|
44
|
+
searchCountryPlaceholder: string;
|
|
45
|
+
noCountriesFound: string;
|
|
46
|
+
enterPhoneNumberPlaceholder: string;
|
|
47
|
+
numberLooksIncomplete: string;
|
|
48
|
+
requiredFieldEmpty: string;
|
|
49
|
+
openCountrySelector: string;
|
|
50
|
+
};
|
|
51
|
+
"nl-BE": {
|
|
52
|
+
searchCountryPlaceholder: string;
|
|
53
|
+
noCountriesFound: string;
|
|
54
|
+
enterPhoneNumberPlaceholder: string;
|
|
55
|
+
numberLooksIncomplete: string;
|
|
56
|
+
requiredFieldEmpty: string;
|
|
57
|
+
openCountrySelector: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/translations.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAW1F,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CxB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
searchCountryPlaceholder: "Search country...",
|
|
3
|
+
noCountriesFound: "No countries found",
|
|
4
|
+
enterPhoneNumberPlaceholder: "Enter your phone number",
|
|
5
|
+
numberLooksIncomplete: "Please enter a valid phone number",
|
|
6
|
+
requiredFieldEmpty: "Phone number is required",
|
|
7
|
+
openCountrySelector: "Open country selector"
|
|
8
|
+
}, n = {
|
|
9
|
+
"sv-SE": {
|
|
10
|
+
searchCountryPlaceholder: "Sök land...",
|
|
11
|
+
noCountriesFound: "Inga länder hittades",
|
|
12
|
+
enterPhoneNumberPlaceholder: "Ange ditt telefonnummer",
|
|
13
|
+
numberLooksIncomplete: "Ange ett giltigt telefonnummer",
|
|
14
|
+
requiredFieldEmpty: "Telefonnummer krävs",
|
|
15
|
+
openCountrySelector: "Öppna landsväljaren"
|
|
16
|
+
},
|
|
17
|
+
"en-US": e,
|
|
18
|
+
"en-GB": e,
|
|
19
|
+
"nb-NO": {
|
|
20
|
+
searchCountryPlaceholder: "Søk land...",
|
|
21
|
+
noCountriesFound: "Ingen land funnet",
|
|
22
|
+
enterPhoneNumberPlaceholder: "Skriv inn telefonnummeret ditt",
|
|
23
|
+
numberLooksIncomplete: "Skriv inn et gyldig telefonnummer",
|
|
24
|
+
requiredFieldEmpty: "Telefonnummer er påkrevd",
|
|
25
|
+
openCountrySelector: "Åpne landvelgeren"
|
|
26
|
+
},
|
|
27
|
+
"da-DK": {
|
|
28
|
+
searchCountryPlaceholder: "Søg land...",
|
|
29
|
+
noCountriesFound: "Ingen lande fundet",
|
|
30
|
+
enterPhoneNumberPlaceholder: "Indtast dit telefonnummer",
|
|
31
|
+
numberLooksIncomplete: "Indtast et gyldigt telefonnummer",
|
|
32
|
+
requiredFieldEmpty: "Telefonnummer er påkrævet",
|
|
33
|
+
openCountrySelector: "Åbn landevælgeren"
|
|
34
|
+
},
|
|
35
|
+
"fr-FR": {
|
|
36
|
+
searchCountryPlaceholder: "Rechercher un pays...",
|
|
37
|
+
noCountriesFound: "Aucun pays trouvé",
|
|
38
|
+
enterPhoneNumberPlaceholder: "Entrez votre numéro de téléphone",
|
|
39
|
+
numberLooksIncomplete: "Veuillez saisir un numéro de téléphone valide",
|
|
40
|
+
requiredFieldEmpty: "Le numéro de téléphone est obligatoire",
|
|
41
|
+
openCountrySelector: "Ouvrir le sélecteur de pays"
|
|
42
|
+
},
|
|
43
|
+
"nl-BE": {
|
|
44
|
+
searchCountryPlaceholder: "Zoek land...",
|
|
45
|
+
noCountriesFound: "Geen landen gevonden",
|
|
46
|
+
enterPhoneNumberPlaceholder: "Voer uw telefoonnummer in",
|
|
47
|
+
numberLooksIncomplete: "Voer een geldig telefoonnummer in",
|
|
48
|
+
requiredFieldEmpty: "Telefoonnummer is verplicht",
|
|
49
|
+
openCountrySelector: "Landselector openen"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
n as translations
|
|
54
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { InputProps } from '../input/index.js';
|
|
2
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
3
|
+
import { ChangeEvent, FocusEvent, Ref } from 'react';
|
|
4
|
+
import { Locales } from './translations.js';
|
|
5
|
+
export type { CountryCode };
|
|
6
|
+
/**
|
|
7
|
+
* Phone number validation result. `isValid` is the bare fact (reveal-independent, drives e.g. a
|
|
8
|
+
* submit button); `errorMessage` is the localized reason, present only when a failure is revealed.
|
|
9
|
+
*/
|
|
10
|
+
export type PhoneValidationResult = {
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Props produced by `usePhoneInput().inputProps` and spread onto `<PhoneInput>`.
|
|
16
|
+
* `PhoneInput` is presentational — it is always driven by these.
|
|
17
|
+
*/
|
|
18
|
+
export type PhoneInputControlProps = {
|
|
19
|
+
/** Current display value (the user's spacing preserved while typing). */
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
22
|
+
onBlur: (e: FocusEvent<HTMLInputElement>) => void;
|
|
23
|
+
/** Currently selected country. */
|
|
24
|
+
country: CountryCode;
|
|
25
|
+
onCountryChange: (country: CountryCode) => void;
|
|
26
|
+
/** Whether the typed "+" prefix matches no known calling code (show the generic icon). */
|
|
27
|
+
unknownPrefix: boolean;
|
|
28
|
+
/** Localized message for the current invalid state, rendered in the error message slot. */
|
|
29
|
+
errorMessage?: string;
|
|
30
|
+
/** Locale for translations. */
|
|
31
|
+
locale: Locales;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Phone input component props. Spread `usePhoneInput().inputProps` and add presentational props.
|
|
35
|
+
*/
|
|
36
|
+
export type PhoneInputProps = PhoneInputControlProps & Pick<InputProps, "variant" | "placeholder" | "name" | "autoComplete" | "autoFocus"> & {
|
|
37
|
+
/** Size of the input and country selector. Defaults to "md". */
|
|
38
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
39
|
+
/** Disable the input + country selector. Falls back to the surrounding FormControl. */
|
|
40
|
+
isDisabled?: boolean;
|
|
41
|
+
/** Make the input read-only. Falls back to the surrounding FormControl. */
|
|
42
|
+
isReadOnly?: boolean;
|
|
43
|
+
ref?: Ref<HTMLInputElement>;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAClD,kCAAkC;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,0FAA0F;IAC1F,aAAa,EAAE,OAAO,CAAC;IACvB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,sBAAsB,GACnD,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,CAAC,GAAG;IACrF,gEAAgE;IAChE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,uFAAuF;IACvF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
2
|
+
import { Locales } from './translations.js';
|
|
3
|
+
import { PhoneInputControlProps, PhoneValidationResult } from './types.js';
|
|
4
|
+
export type UsePhoneInputOptions = {
|
|
5
|
+
/** Initial country. Defaults to device locale, then the locale-prop region. */
|
|
6
|
+
defaultCountry?: CountryCode;
|
|
7
|
+
/** Initial display value. Defaults to the bare dial-code prefix. */
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
/** Whether the field is required. */
|
|
10
|
+
isRequired?: boolean;
|
|
11
|
+
/** Extra rule on the E.164 value once it's otherwise valid; return an error message to fail. Surfaces on blur/validate(). */
|
|
12
|
+
customValidator?: (e164: string) => string | undefined;
|
|
13
|
+
/** Locale for translations and messages. Defaults to "en-US". */
|
|
14
|
+
locale?: Locales;
|
|
15
|
+
};
|
|
16
|
+
export type UsePhoneInputReturn = {
|
|
17
|
+
/** Spread onto `<PhoneInput>`. */
|
|
18
|
+
inputProps: PhoneInputControlProps;
|
|
19
|
+
/** Spread onto the surrounding `<FormControl>`. */
|
|
20
|
+
formControlProps: {
|
|
21
|
+
isRequired: boolean;
|
|
22
|
+
isInvalid: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Current display value (the user's spacing preserved while typing, formatted on blur). */
|
|
25
|
+
value: string;
|
|
26
|
+
/** Canonical E.164 value for storage/submission (e.g. "+46737884410"); "" when empty. */
|
|
27
|
+
e164: string;
|
|
28
|
+
/** Current country. */
|
|
29
|
+
country: CountryCode;
|
|
30
|
+
/** Whether the current e164 is a valid number (independent of whether an error is shown). */
|
|
31
|
+
isValid: boolean;
|
|
32
|
+
/** Change the selected country, reformatting the current number into it. Does not reveal errors. */
|
|
33
|
+
setCountry: (country: CountryCode) => void;
|
|
34
|
+
/** Set the display value programmatically (prefill an existing number / clear). Like typing, this will update the country if a "+"-prefixed value is provided. */
|
|
35
|
+
setValue: (value: string) => void;
|
|
36
|
+
/** Reveal validation and return a fresh result. Call from `onSubmit` to gate submission. */
|
|
37
|
+
validate: () => PhoneValidationResult;
|
|
38
|
+
/** Reset to the initial value. */
|
|
39
|
+
reset: () => void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Headless hook owning phone-input value + validation state. The display string is the single
|
|
43
|
+
* source of truth; `e164` is derived. `<PhoneInput>` is presentational — spread `inputProps` onto
|
|
44
|
+
* it and `formControlProps` onto the surrounding `<FormControl>`.
|
|
45
|
+
*
|
|
46
|
+
* @see Docs https://caspeco.github.io/casper-ui-library/components/phone-input
|
|
47
|
+
*/
|
|
48
|
+
export declare function usePhoneInput(options?: UsePhoneInputOptions): UsePhoneInputReturn;
|
|
49
|
+
//# sourceMappingURL=use-phone-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-phone-input.d.ts","sourceRoot":"","sources":["../../../lib/components/phone-input/use-phone-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAa5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAK7E,MAAM,MAAM,oBAAoB,GAAG;IAClC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,WAAW,CAAC;IAE7B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,6HAA6H;IAC7H,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAEvD,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,kCAAkC;IAClC,UAAU,EAAE,sBAAsB,CAAC;IAEnC,mDAAmD;IACnD,gBAAgB,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAE9D,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAC;IAEd,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IAEb,uBAAuB;IACvB,OAAO,EAAE,WAAW,CAAC;IAErB,6FAA6F;IAC7F,OAAO,EAAE,OAAO,CAAC;IAEjB,oGAAoG;IACpG,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAE3C,kKAAkK;IAClK,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,4FAA4F;IAC5F,QAAQ,EAAE,MAAM,qBAAqB,CAAC;IAEtC,kCAAkC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CA2HrF"}
|