@particle-academy/react-fancy 6.9.0 → 6.10.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/CHANGELOG.md +10 -0
- package/README.md +1 -0
- package/dist/autocomplete.cjs +3 -3
- package/dist/autocomplete.js +2 -2
- package/dist/{chunk-ZUJVGHFW.js → chunk-24RWB7Q3.js} +3 -3
- package/dist/{chunk-ZUJVGHFW.js.map → chunk-24RWB7Q3.js.map} +1 -1
- package/dist/{chunk-GODJVIIO.js → chunk-3W6BKQVZ.js} +4 -4
- package/dist/{chunk-GODJVIIO.js.map → chunk-3W6BKQVZ.js.map} +1 -1
- package/dist/{chunk-AZ5DWOQY.cjs → chunk-6B43ARGW.cjs} +4 -4
- package/dist/{chunk-AZ5DWOQY.cjs.map → chunk-6B43ARGW.cjs.map} +1 -1
- package/dist/{chunk-Q62RDKRA.cjs → chunk-7N7XVBH7.cjs} +6 -6
- package/dist/{chunk-Q62RDKRA.cjs.map → chunk-7N7XVBH7.cjs.map} +1 -1
- package/dist/{chunk-VGUAIFGE.js → chunk-C2VGO375.js} +3 -3
- package/dist/{chunk-VGUAIFGE.js.map → chunk-C2VGO375.js.map} +1 -1
- package/dist/{chunk-H7OTLGRD.cjs → chunk-DQWAG7YY.cjs} +4 -4
- package/dist/{chunk-H7OTLGRD.cjs.map → chunk-DQWAG7YY.cjs.map} +1 -1
- package/dist/{chunk-3KJN3GTB.cjs → chunk-EDIB6V6Y.cjs} +4 -4
- package/dist/{chunk-3KJN3GTB.cjs.map → chunk-EDIB6V6Y.cjs.map} +1 -1
- package/dist/{chunk-G5MDMQVQ.cjs → chunk-EEFU5BVM.cjs} +6 -6
- package/dist/{chunk-G5MDMQVQ.cjs.map → chunk-EEFU5BVM.cjs.map} +1 -1
- package/dist/{chunk-IYG436ZY.js → chunk-EW2N52FD.js} +3 -3
- package/dist/{chunk-IYG436ZY.js.map → chunk-EW2N52FD.js.map} +1 -1
- package/dist/{chunk-RSB2P3JK.js → chunk-FECD3WKN.js} +3 -3
- package/dist/{chunk-RSB2P3JK.js.map → chunk-FECD3WKN.js.map} +1 -1
- package/dist/{chunk-6RXEWM3V.js → chunk-FNHKZMMI.js} +3 -3
- package/dist/{chunk-6RXEWM3V.js.map → chunk-FNHKZMMI.js.map} +1 -1
- package/dist/{chunk-M5ER3Y5I.cjs → chunk-FR3V5IAJ.cjs} +4 -4
- package/dist/{chunk-M5ER3Y5I.cjs.map → chunk-FR3V5IAJ.cjs.map} +1 -1
- package/dist/{chunk-DXLPBLNC.cjs → chunk-FSLEFL4U.cjs} +4 -4
- package/dist/{chunk-DXLPBLNC.cjs.map → chunk-FSLEFL4U.cjs.map} +1 -1
- package/dist/{chunk-FQCLJZZS.js → chunk-FX37P4KR.js} +3 -3
- package/dist/{chunk-FQCLJZZS.js.map → chunk-FX37P4KR.js.map} +1 -1
- package/dist/{chunk-DW2PHLOA.js → chunk-H5LJFN7D.js} +3 -3
- package/dist/{chunk-DW2PHLOA.js.map → chunk-H5LJFN7D.js.map} +1 -1
- package/dist/{chunk-F3U4AVGF.js → chunk-HCIEXBEB.js} +3 -3
- package/dist/{chunk-F3U4AVGF.js.map → chunk-HCIEXBEB.js.map} +1 -1
- package/dist/{chunk-QAM6N3VG.cjs → chunk-HEGM5LMZ.cjs} +4 -4
- package/dist/{chunk-QAM6N3VG.cjs.map → chunk-HEGM5LMZ.cjs.map} +1 -1
- package/dist/{chunk-KAKKZDCE.js → chunk-J57JSHDC.js} +3 -3
- package/dist/{chunk-KAKKZDCE.js.map → chunk-J57JSHDC.js.map} +1 -1
- package/dist/{chunk-6BCXGP2T.js → chunk-JN5DHZ6I.js} +3 -3
- package/dist/{chunk-6BCXGP2T.js.map → chunk-JN5DHZ6I.js.map} +1 -1
- package/dist/chunk-LJCQI6ZS.js +1212 -0
- package/dist/chunk-LJCQI6ZS.js.map +1 -0
- package/dist/{chunk-JV2HEOCB.cjs → chunk-MAY4NMRI.cjs} +4 -4
- package/dist/{chunk-JV2HEOCB.cjs.map → chunk-MAY4NMRI.cjs.map} +1 -1
- package/dist/{chunk-BQENLOEV.js → chunk-MD7HUHJB.js} +4 -4
- package/dist/{chunk-BQENLOEV.js.map → chunk-MD7HUHJB.js.map} +1 -1
- package/dist/{chunk-QUZOGRZS.js → chunk-OE4AIUAN.js} +3 -3
- package/dist/{chunk-QUZOGRZS.js.map → chunk-OE4AIUAN.js.map} +1 -1
- package/dist/chunk-OP7A4SZZ.cjs +1216 -0
- package/dist/chunk-OP7A4SZZ.cjs.map +1 -0
- package/dist/{chunk-YBBBX5H2.cjs → chunk-OUPHLIXV.cjs} +11 -11
- package/dist/{chunk-YBBBX5H2.cjs.map → chunk-OUPHLIXV.cjs.map} +1 -1
- package/dist/{chunk-XGGAAG74.cjs → chunk-QQKWI7QP.cjs} +7 -3
- package/dist/chunk-QQKWI7QP.cjs.map +1 -0
- package/dist/{chunk-XT4WBBCD.cjs → chunk-R4SANV3G.cjs} +11 -11
- package/dist/{chunk-XT4WBBCD.cjs.map → chunk-R4SANV3G.cjs.map} +1 -1
- package/dist/{chunk-GJWNZMJT.js → chunk-RUEDMYBF.js} +7 -3
- package/dist/chunk-RUEDMYBF.js.map +1 -0
- package/dist/{chunk-UORN3Z7R.cjs → chunk-TBLKVTJC.cjs} +6 -6
- package/dist/{chunk-UORN3Z7R.cjs.map → chunk-TBLKVTJC.cjs.map} +1 -1
- package/dist/{chunk-L5NDZEL6.cjs → chunk-ZFXCZ2QO.cjs} +9 -9
- package/dist/{chunk-L5NDZEL6.cjs.map → chunk-ZFXCZ2QO.cjs.map} +1 -1
- package/dist/composer.cjs +6 -6
- package/dist/composer.js +4 -4
- package/dist/dropdown.cjs +4 -4
- package/dist/dropdown.js +2 -2
- package/dist/editor.cjs +1 -1
- package/dist/editor.js +1 -1
- package/dist/index.cjs +99 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -21
- package/dist/index.js.map +1 -1
- package/dist/input.cjs +5 -5
- package/dist/input.js +4 -4
- package/dist/inputs.cjs +19 -19
- package/dist/inputs.js +8 -8
- package/dist/json-editor.cjs +17 -17
- package/dist/json-editor.js +6 -6
- package/dist/mobile-menu.cjs +1 -1
- package/dist/mobile-menu.js +1 -1
- package/dist/number-field.cjs +6 -6
- package/dist/number-field.js +5 -5
- package/dist/paste-pills.cjs +16 -16
- package/dist/paste-pills.js +3 -3
- package/dist/phone-input.cjs +39 -0
- package/dist/phone-input.cjs.map +1 -0
- package/dist/phone-input.d.cts +139 -0
- package/dist/phone-input.d.ts +139 -0
- package/dist/phone-input.js +22 -0
- package/dist/phone-input.js.map +1 -0
- package/dist/popover.cjs +4 -4
- package/dist/popover.js +2 -2
- package/dist/prompt-input.cjs +8 -8
- package/dist/prompt-input.js +5 -5
- package/dist/reason-tag.cjs +4 -4
- package/dist/reason-tag.js +3 -3
- package/dist/select.cjs +3 -3
- package/dist/select.js +2 -2
- package/dist/sidebar.cjs +5 -5
- package/dist/sidebar.js +3 -3
- package/dist/tooltip.cjs +3 -3
- package/dist/tooltip.js +2 -2
- package/docs/PhoneInput.md +104 -0
- package/package.json +11 -1
- package/dist/chunk-GJWNZMJT.js.map +0 -1
- package/dist/chunk-XGGAAG74.cjs.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkOP7A4SZZ_cjs = require('./chunk-OP7A4SZZ.cjs');
|
|
4
|
+
require('./chunk-QGPMVFZJ.cjs');
|
|
5
|
+
require('./chunk-EEFU5BVM.cjs');
|
|
6
|
+
require('./chunk-DFROB5TW.cjs');
|
|
7
|
+
require('./chunk-UIBAIWUR.cjs');
|
|
8
|
+
require('./chunk-Q7XL37T3.cjs');
|
|
9
|
+
require('./chunk-XG6J5MOK.cjs');
|
|
10
|
+
require('./chunk-TBLKVTJC.cjs');
|
|
11
|
+
require('./chunk-MAY4NMRI.cjs');
|
|
12
|
+
require('./chunk-6V44RRSB.cjs');
|
|
13
|
+
require('./chunk-MKHYENKR.cjs');
|
|
14
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
15
|
+
require('./chunk-36IC3NDN.cjs');
|
|
16
|
+
require('./chunk-TI7D4QDM.cjs');
|
|
17
|
+
require('./chunk-KJ22KE56.cjs');
|
|
18
|
+
require('./chunk-L3V3BYVS.cjs');
|
|
19
|
+
require('./chunk-57FQGQJK.cjs');
|
|
20
|
+
require('./chunk-OUYC6EIL.cjs');
|
|
21
|
+
require('./chunk-SNHU2AI4.cjs');
|
|
22
|
+
require('./chunk-ZU5Q77OT.cjs');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Object.defineProperty(exports, "PHONE_COUNTRIES", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkOP7A4SZZ_cjs.PHONE_COUNTRIES; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "PhoneInput", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkOP7A4SZZ_cjs.PhoneInput; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "parsePhone", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkOP7A4SZZ_cjs.parsePhone; }
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=phone-input.cjs.map
|
|
39
|
+
//# sourceMappingURL=phone-input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"phone-input.cjs"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { FocusEvent } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Why a number is not (yet) a valid E.164. */
|
|
5
|
+
type PhoneInputReason = "too_short" | "too_long" | "invalid_chars" | "unknown_country";
|
|
6
|
+
/** One row of the first-party country table. */
|
|
7
|
+
interface PhoneCountry {
|
|
8
|
+
/** ISO 3166-1 alpha-2, upper case. */
|
|
9
|
+
code: string;
|
|
10
|
+
/** The ITU-T E.164 country code, digits only: `"95"`. */
|
|
11
|
+
dialCode: string;
|
|
12
|
+
/** Shortest national significant number, in digits. A sanity check, not validation. */
|
|
13
|
+
minLength: number;
|
|
14
|
+
/** Longest national significant number, in digits. A sanity check, not validation. */
|
|
15
|
+
maxLength: number;
|
|
16
|
+
/** What is typed before the number within the country (`"0"`). Empty: none. */
|
|
17
|
+
trunkPrefixes: readonly string[];
|
|
18
|
+
/**
|
|
19
|
+
* Whether `minLength` / `maxLength` were checked against a cited plan. When
|
|
20
|
+
* `false` the range is the widest E.164 allows (4 to 15 minus the dial code),
|
|
21
|
+
* so only the digits and the overall length are checked.
|
|
22
|
+
*/
|
|
23
|
+
lengthVerified: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** What the component read, reported with every value. JSON-serialisable. */
|
|
26
|
+
interface PhoneInputDetail {
|
|
27
|
+
/** ISO 3166-1 alpha-2 of the country the number was read in, or `null`. */
|
|
28
|
+
country: string | null;
|
|
29
|
+
/** Its dial code, digits only, or `null`. */
|
|
30
|
+
dialCode: string | null;
|
|
31
|
+
/** The national significant number: digits only, no trunk prefix. */
|
|
32
|
+
nationalNumber: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the number is PLAUSIBLE: digits only, a known dial code, and a length
|
|
35
|
+
* inside the country's range. Real per-country ranges apply only where the
|
|
36
|
+
* table's row is verified; elsewhere the range is the E.164 maximum. Never a
|
|
37
|
+
* claim that the number exists: validate on a server.
|
|
38
|
+
*/
|
|
39
|
+
valid: boolean;
|
|
40
|
+
/** Why it is not valid. `null` when valid, and when blank. */
|
|
41
|
+
reason: PhoneInputReason | null;
|
|
42
|
+
/**
|
|
43
|
+
* The dial code is shared (`+1`, `+7`, `+44`, …) and `country` is a guess from
|
|
44
|
+
* the number's leading digits or the selected country. The E.164 is exact
|
|
45
|
+
* either way; only `country` may be wrong.
|
|
46
|
+
*/
|
|
47
|
+
approximate: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface PhoneParse extends PhoneInputDetail {
|
|
50
|
+
/** The E.164 number (`+959…`), or `null` unless the number is whole. */
|
|
51
|
+
value: string | null;
|
|
52
|
+
}
|
|
53
|
+
interface ParsePhoneOptions {
|
|
54
|
+
/** The selected country, for a national number and as a tie-break for shared dial codes. */
|
|
55
|
+
country?: string | null;
|
|
56
|
+
/** Restrict to these countries. A dial code none of them owns is `unknown_country`. */
|
|
57
|
+
countries?: readonly string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Text the component shows, for a host working in another language. `{country}`
|
|
61
|
+
* in a reason message is replaced with the country's name in `locale`.
|
|
62
|
+
*/
|
|
63
|
+
interface PhoneInputMessages {
|
|
64
|
+
/** Default: "This number is too short for {country}." */
|
|
65
|
+
too_short?: string;
|
|
66
|
+
/** Default: "This number is too long for {country}." */
|
|
67
|
+
too_long?: string;
|
|
68
|
+
/** Default: "Use digits only. Spaces, dashes, brackets and a leading + are fine." */
|
|
69
|
+
invalid_chars?: string;
|
|
70
|
+
/** Default: "Choose a country, or start the number with + and its country code." */
|
|
71
|
+
unknown_country?: string;
|
|
72
|
+
/** Accessible name of the picker, before the chosen country. Default: "Country". */
|
|
73
|
+
country?: string;
|
|
74
|
+
/** Accessible name of the picker when no country is chosen. Default: "Choose a country". */
|
|
75
|
+
chooseCountry?: string;
|
|
76
|
+
/** Accessible name of the search box. Default: "Search countries". */
|
|
77
|
+
search?: string;
|
|
78
|
+
/** Shown when the search matches nothing. Default: "No matching countries". */
|
|
79
|
+
noResults?: string;
|
|
80
|
+
}
|
|
81
|
+
interface PhoneInputProps {
|
|
82
|
+
/** The number in E.164 (`+959451234567`), or `null` when there is none. */
|
|
83
|
+
value?: string | null;
|
|
84
|
+
/** Starting value when uncontrolled. */
|
|
85
|
+
defaultValue?: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Called when the value or the reading of it changes. `value` is `null` for
|
|
88
|
+
* blank and for anything that is not yet a whole number; `detail` says why.
|
|
89
|
+
*/
|
|
90
|
+
onValueChange?: (value: string | null, detail: PhoneInputDetail) => void;
|
|
91
|
+
/** ISO 3166-1 alpha-2 selected at first, and the tie-break for a shared dial code. */
|
|
92
|
+
defaultCountry?: string;
|
|
93
|
+
/** Restrict the picker to these ISO codes, in this order. Default: every country, by name. */
|
|
94
|
+
countries?: string[];
|
|
95
|
+
/** BCP 47 locale for country names (`Intl.DisplayNames`). Default: the browser's. */
|
|
96
|
+
locale?: string;
|
|
97
|
+
/** Visible label. Required: an unlabelled phone field fails WCAG. */
|
|
98
|
+
label: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
/** A host's message. Shown instead of the built-in one. */
|
|
101
|
+
error?: string;
|
|
102
|
+
required?: boolean;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
/** Posts the E.164 (or `""`) through a hidden input. */
|
|
105
|
+
name?: string;
|
|
106
|
+
form?: string;
|
|
107
|
+
id?: string;
|
|
108
|
+
placeholder?: string;
|
|
109
|
+
autoFocus?: boolean;
|
|
110
|
+
className?: string;
|
|
111
|
+
messages?: PhoneInputMessages;
|
|
112
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare const PhoneInput: react.ForwardRefExoticComponent<PhoneInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Reading a phone number, by hand.
|
|
119
|
+
*
|
|
120
|
+
* Every step is a single pass over the characters, with no regular expression:
|
|
121
|
+
* the text comes from a person or a paste, and a backtracking pattern over it is
|
|
122
|
+
* a ReDoS waiting for the right input. Linear time is pinned by a test.
|
|
123
|
+
*/
|
|
124
|
+
declare const PHONE_COUNTRIES: readonly PhoneCountry[];
|
|
125
|
+
/**
|
|
126
|
+
* Read what a person typed or pasted into an E.164 number and a reason.
|
|
127
|
+
*
|
|
128
|
+
* - `+` or `00` starts an international number; the country comes from its dial
|
|
129
|
+
* code. Other international prefixes (011 in North America, 010 in Japan) are
|
|
130
|
+
* not recognised: type `+`.
|
|
131
|
+
* - Anything else is a national number in `options.country`, with its trunk
|
|
132
|
+
* prefix dropped.
|
|
133
|
+
* - Blank (or separators only) is no value and no reason.
|
|
134
|
+
* - The value is `null` unless the number is whole. Lengths are a sanity check:
|
|
135
|
+
* a valid result can still be a number nobody holds.
|
|
136
|
+
*/
|
|
137
|
+
declare function parsePhone(text: string, options?: ParsePhoneOptions): PhoneParse;
|
|
138
|
+
|
|
139
|
+
export { PHONE_COUNTRIES, type ParsePhoneOptions, type PhoneCountry, PhoneInput, type PhoneInputDetail, type PhoneInputMessages, type PhoneInputProps, type PhoneInputReason, type PhoneParse, parsePhone };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { FocusEvent } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Why a number is not (yet) a valid E.164. */
|
|
5
|
+
type PhoneInputReason = "too_short" | "too_long" | "invalid_chars" | "unknown_country";
|
|
6
|
+
/** One row of the first-party country table. */
|
|
7
|
+
interface PhoneCountry {
|
|
8
|
+
/** ISO 3166-1 alpha-2, upper case. */
|
|
9
|
+
code: string;
|
|
10
|
+
/** The ITU-T E.164 country code, digits only: `"95"`. */
|
|
11
|
+
dialCode: string;
|
|
12
|
+
/** Shortest national significant number, in digits. A sanity check, not validation. */
|
|
13
|
+
minLength: number;
|
|
14
|
+
/** Longest national significant number, in digits. A sanity check, not validation. */
|
|
15
|
+
maxLength: number;
|
|
16
|
+
/** What is typed before the number within the country (`"0"`). Empty: none. */
|
|
17
|
+
trunkPrefixes: readonly string[];
|
|
18
|
+
/**
|
|
19
|
+
* Whether `minLength` / `maxLength` were checked against a cited plan. When
|
|
20
|
+
* `false` the range is the widest E.164 allows (4 to 15 minus the dial code),
|
|
21
|
+
* so only the digits and the overall length are checked.
|
|
22
|
+
*/
|
|
23
|
+
lengthVerified: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** What the component read, reported with every value. JSON-serialisable. */
|
|
26
|
+
interface PhoneInputDetail {
|
|
27
|
+
/** ISO 3166-1 alpha-2 of the country the number was read in, or `null`. */
|
|
28
|
+
country: string | null;
|
|
29
|
+
/** Its dial code, digits only, or `null`. */
|
|
30
|
+
dialCode: string | null;
|
|
31
|
+
/** The national significant number: digits only, no trunk prefix. */
|
|
32
|
+
nationalNumber: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the number is PLAUSIBLE: digits only, a known dial code, and a length
|
|
35
|
+
* inside the country's range. Real per-country ranges apply only where the
|
|
36
|
+
* table's row is verified; elsewhere the range is the E.164 maximum. Never a
|
|
37
|
+
* claim that the number exists: validate on a server.
|
|
38
|
+
*/
|
|
39
|
+
valid: boolean;
|
|
40
|
+
/** Why it is not valid. `null` when valid, and when blank. */
|
|
41
|
+
reason: PhoneInputReason | null;
|
|
42
|
+
/**
|
|
43
|
+
* The dial code is shared (`+1`, `+7`, `+44`, …) and `country` is a guess from
|
|
44
|
+
* the number's leading digits or the selected country. The E.164 is exact
|
|
45
|
+
* either way; only `country` may be wrong.
|
|
46
|
+
*/
|
|
47
|
+
approximate: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface PhoneParse extends PhoneInputDetail {
|
|
50
|
+
/** The E.164 number (`+959…`), or `null` unless the number is whole. */
|
|
51
|
+
value: string | null;
|
|
52
|
+
}
|
|
53
|
+
interface ParsePhoneOptions {
|
|
54
|
+
/** The selected country, for a national number and as a tie-break for shared dial codes. */
|
|
55
|
+
country?: string | null;
|
|
56
|
+
/** Restrict to these countries. A dial code none of them owns is `unknown_country`. */
|
|
57
|
+
countries?: readonly string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Text the component shows, for a host working in another language. `{country}`
|
|
61
|
+
* in a reason message is replaced with the country's name in `locale`.
|
|
62
|
+
*/
|
|
63
|
+
interface PhoneInputMessages {
|
|
64
|
+
/** Default: "This number is too short for {country}." */
|
|
65
|
+
too_short?: string;
|
|
66
|
+
/** Default: "This number is too long for {country}." */
|
|
67
|
+
too_long?: string;
|
|
68
|
+
/** Default: "Use digits only. Spaces, dashes, brackets and a leading + are fine." */
|
|
69
|
+
invalid_chars?: string;
|
|
70
|
+
/** Default: "Choose a country, or start the number with + and its country code." */
|
|
71
|
+
unknown_country?: string;
|
|
72
|
+
/** Accessible name of the picker, before the chosen country. Default: "Country". */
|
|
73
|
+
country?: string;
|
|
74
|
+
/** Accessible name of the picker when no country is chosen. Default: "Choose a country". */
|
|
75
|
+
chooseCountry?: string;
|
|
76
|
+
/** Accessible name of the search box. Default: "Search countries". */
|
|
77
|
+
search?: string;
|
|
78
|
+
/** Shown when the search matches nothing. Default: "No matching countries". */
|
|
79
|
+
noResults?: string;
|
|
80
|
+
}
|
|
81
|
+
interface PhoneInputProps {
|
|
82
|
+
/** The number in E.164 (`+959451234567`), or `null` when there is none. */
|
|
83
|
+
value?: string | null;
|
|
84
|
+
/** Starting value when uncontrolled. */
|
|
85
|
+
defaultValue?: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Called when the value or the reading of it changes. `value` is `null` for
|
|
88
|
+
* blank and for anything that is not yet a whole number; `detail` says why.
|
|
89
|
+
*/
|
|
90
|
+
onValueChange?: (value: string | null, detail: PhoneInputDetail) => void;
|
|
91
|
+
/** ISO 3166-1 alpha-2 selected at first, and the tie-break for a shared dial code. */
|
|
92
|
+
defaultCountry?: string;
|
|
93
|
+
/** Restrict the picker to these ISO codes, in this order. Default: every country, by name. */
|
|
94
|
+
countries?: string[];
|
|
95
|
+
/** BCP 47 locale for country names (`Intl.DisplayNames`). Default: the browser's. */
|
|
96
|
+
locale?: string;
|
|
97
|
+
/** Visible label. Required: an unlabelled phone field fails WCAG. */
|
|
98
|
+
label: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
/** A host's message. Shown instead of the built-in one. */
|
|
101
|
+
error?: string;
|
|
102
|
+
required?: boolean;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
/** Posts the E.164 (or `""`) through a hidden input. */
|
|
105
|
+
name?: string;
|
|
106
|
+
form?: string;
|
|
107
|
+
id?: string;
|
|
108
|
+
placeholder?: string;
|
|
109
|
+
autoFocus?: boolean;
|
|
110
|
+
className?: string;
|
|
111
|
+
messages?: PhoneInputMessages;
|
|
112
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare const PhoneInput: react.ForwardRefExoticComponent<PhoneInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Reading a phone number, by hand.
|
|
119
|
+
*
|
|
120
|
+
* Every step is a single pass over the characters, with no regular expression:
|
|
121
|
+
* the text comes from a person or a paste, and a backtracking pattern over it is
|
|
122
|
+
* a ReDoS waiting for the right input. Linear time is pinned by a test.
|
|
123
|
+
*/
|
|
124
|
+
declare const PHONE_COUNTRIES: readonly PhoneCountry[];
|
|
125
|
+
/**
|
|
126
|
+
* Read what a person typed or pasted into an E.164 number and a reason.
|
|
127
|
+
*
|
|
128
|
+
* - `+` or `00` starts an international number; the country comes from its dial
|
|
129
|
+
* code. Other international prefixes (011 in North America, 010 in Japan) are
|
|
130
|
+
* not recognised: type `+`.
|
|
131
|
+
* - Anything else is a national number in `options.country`, with its trunk
|
|
132
|
+
* prefix dropped.
|
|
133
|
+
* - Blank (or separators only) is no value and no reason.
|
|
134
|
+
* - The value is `null` unless the number is whole. Lengths are a sanity check:
|
|
135
|
+
* a valid result can still be a number nobody holds.
|
|
136
|
+
*/
|
|
137
|
+
declare function parsePhone(text: string, options?: ParsePhoneOptions): PhoneParse;
|
|
138
|
+
|
|
139
|
+
export { PHONE_COUNTRIES, type ParsePhoneOptions, type PhoneCountry, PhoneInput, type PhoneInputDetail, type PhoneInputMessages, type PhoneInputProps, type PhoneInputReason, type PhoneParse, parsePhone };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { PHONE_COUNTRIES, PhoneInput, parsePhone } from './chunk-LJCQI6ZS.js';
|
|
2
|
+
import './chunk-SHDSKHCC.js';
|
|
3
|
+
import './chunk-EW2N52FD.js';
|
|
4
|
+
import './chunk-EDIX6EXQ.js';
|
|
5
|
+
import './chunk-PZTFGPQJ.js';
|
|
6
|
+
import './chunk-E2AEU5SP.js';
|
|
7
|
+
import './chunk-IF6EITB5.js';
|
|
8
|
+
import './chunk-FECD3WKN.js';
|
|
9
|
+
import './chunk-FNHKZMMI.js';
|
|
10
|
+
import './chunk-S42OGG43.js';
|
|
11
|
+
import './chunk-5VMILVWD.js';
|
|
12
|
+
import './chunk-RUEDMYBF.js';
|
|
13
|
+
import './chunk-US5R36TQ.js';
|
|
14
|
+
import './chunk-RBCMKPBX.js';
|
|
15
|
+
import './chunk-OL53XYHF.js';
|
|
16
|
+
import './chunk-NRXK42LO.js';
|
|
17
|
+
import './chunk-RGANGU7X.js';
|
|
18
|
+
import './chunk-YX6FTJ6N.js';
|
|
19
|
+
import './chunk-EDYAXGUM.js';
|
|
20
|
+
import './chunk-MMW2JGKZ.js';
|
|
21
|
+
//# sourceMappingURL=phone-input.js.map
|
|
22
|
+
//# sourceMappingURL=phone-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"phone-input.js"}
|
package/dist/popover.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMAY4NMRI_cjs = require('./chunk-MAY4NMRI.cjs');
|
|
4
4
|
require('./chunk-MKHYENKR.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
6
6
|
require('./chunk-36IC3NDN.cjs');
|
|
7
7
|
require('./chunk-TI7D4QDM.cjs');
|
|
8
8
|
require('./chunk-57FQGQJK.cjs');
|
|
@@ -13,11 +13,11 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
13
13
|
|
|
14
14
|
Object.defineProperty(exports, "Popover", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkMAY4NMRI_cjs.Popover; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "usePopover", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkMAY4NMRI_cjs.usePopover; }
|
|
21
21
|
});
|
|
22
22
|
//# sourceMappingURL=popover.cjs.map
|
|
23
23
|
//# sourceMappingURL=popover.cjs.map
|
package/dist/popover.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Popover, usePopover } from './chunk-
|
|
1
|
+
export { Popover, usePopover } from './chunk-FNHKZMMI.js';
|
|
2
2
|
import './chunk-5VMILVWD.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-RUEDMYBF.js';
|
|
4
4
|
import './chunk-US5R36TQ.js';
|
|
5
5
|
import './chunk-RBCMKPBX.js';
|
|
6
6
|
import './chunk-RGANGU7X.js';
|
package/dist/prompt-input.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkR4SANV3G_cjs = require('./chunk-R4SANV3G.cjs');
|
|
4
|
+
require('./chunk-6B43ARGW.cjs');
|
|
5
5
|
require('./chunk-I27K6NLX.cjs');
|
|
6
6
|
require('./chunk-JKD6CFIP.cjs');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-TBLKVTJC.cjs');
|
|
8
|
+
require('./chunk-MAY4NMRI.cjs');
|
|
9
9
|
require('./chunk-AIA5UNQ5.cjs');
|
|
10
10
|
require('./chunk-2C64OVOZ.cjs');
|
|
11
11
|
require('./chunk-6V44RRSB.cjs');
|
|
12
12
|
require('./chunk-MKHYENKR.cjs');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
14
14
|
require('./chunk-36IC3NDN.cjs');
|
|
15
15
|
require('./chunk-TI7D4QDM.cjs');
|
|
16
16
|
require('./chunk-57FQGQJK.cjs');
|
|
@@ -26,15 +26,15 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
26
26
|
|
|
27
27
|
Object.defineProperty(exports, "PromptInput", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkR4SANV3G_cjs.PromptInput; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "promptDataUrlToFile", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkR4SANV3G_cjs.promptDataUrlToFile; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "promptFileToDataUrl", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkR4SANV3G_cjs.promptFileToDataUrl; }
|
|
38
38
|
});
|
|
39
39
|
//# sourceMappingURL=prompt-input.cjs.map
|
|
40
40
|
//# sourceMappingURL=prompt-input.cjs.map
|
package/dist/prompt-input.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { PromptInput, promptDataUrlToFile, promptFileToDataUrl } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { PromptInput, promptDataUrlToFile, promptFileToDataUrl } from './chunk-MD7HUHJB.js';
|
|
2
|
+
import './chunk-OE4AIUAN.js';
|
|
3
3
|
import './chunk-SV5BW3IA.js';
|
|
4
4
|
import './chunk-J6IQHJET.js';
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
5
|
+
import './chunk-FECD3WKN.js';
|
|
6
|
+
import './chunk-FNHKZMMI.js';
|
|
7
7
|
import './chunk-TJ66S5K6.js';
|
|
8
8
|
import './chunk-I3LAFKJU.js';
|
|
9
9
|
import './chunk-S42OGG43.js';
|
|
10
10
|
import './chunk-5VMILVWD.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-RUEDMYBF.js';
|
|
12
12
|
import './chunk-US5R36TQ.js';
|
|
13
13
|
import './chunk-RBCMKPBX.js';
|
|
14
14
|
import './chunk-RGANGU7X.js';
|
package/dist/reason-tag.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk7N7XVBH7_cjs = require('./chunk-7N7XVBH7.cjs');
|
|
4
|
+
require('./chunk-MAY4NMRI.cjs');
|
|
5
5
|
require('./chunk-MKHYENKR.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
7
7
|
require('./chunk-36IC3NDN.cjs');
|
|
8
8
|
require('./chunk-TI7D4QDM.cjs');
|
|
9
9
|
require('./chunk-57FQGQJK.cjs');
|
|
@@ -18,7 +18,7 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
18
18
|
|
|
19
19
|
Object.defineProperty(exports, "ReasonTag", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk7N7XVBH7_cjs.ReasonTag; }
|
|
22
22
|
});
|
|
23
23
|
//# sourceMappingURL=reason-tag.cjs.map
|
|
24
24
|
//# sourceMappingURL=reason-tag.cjs.map
|
package/dist/reason-tag.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ReasonTag } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { ReasonTag } from './chunk-JN5DHZ6I.js';
|
|
2
|
+
import './chunk-FNHKZMMI.js';
|
|
3
3
|
import './chunk-5VMILVWD.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-RUEDMYBF.js';
|
|
5
5
|
import './chunk-US5R36TQ.js';
|
|
6
6
|
import './chunk-RBCMKPBX.js';
|
|
7
7
|
import './chunk-RGANGU7X.js';
|
package/dist/select.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./chunk-HXLSEBAL.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkFR3V5IAJ_cjs = require('./chunk-FR3V5IAJ.cjs');
|
|
5
5
|
require('./chunk-DFROB5TW.cjs');
|
|
6
6
|
require('./chunk-UIBAIWUR.cjs');
|
|
7
7
|
require('./chunk-Q7XL37T3.cjs');
|
|
8
8
|
require('./chunk-XG6J5MOK.cjs');
|
|
9
9
|
require('./chunk-6V44RRSB.cjs');
|
|
10
10
|
require('./chunk-MKHYENKR.cjs');
|
|
11
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
12
12
|
require('./chunk-36IC3NDN.cjs');
|
|
13
13
|
require('./chunk-TI7D4QDM.cjs');
|
|
14
14
|
require('./chunk-KJ22KE56.cjs');
|
|
@@ -21,7 +21,7 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
21
21
|
|
|
22
22
|
Object.defineProperty(exports, "Select", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkFR3V5IAJ_cjs.Select; }
|
|
25
25
|
});
|
|
26
26
|
//# sourceMappingURL=select.cjs.map
|
|
27
27
|
//# sourceMappingURL=select.cjs.map
|
package/dist/select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './chunk-GNHQVPZP.js';
|
|
2
|
-
export { Select } from './chunk-
|
|
2
|
+
export { Select } from './chunk-24RWB7Q3.js';
|
|
3
3
|
import './chunk-EDIX6EXQ.js';
|
|
4
4
|
import './chunk-PZTFGPQJ.js';
|
|
5
5
|
import './chunk-E2AEU5SP.js';
|
|
6
6
|
import './chunk-IF6EITB5.js';
|
|
7
7
|
import './chunk-S42OGG43.js';
|
|
8
8
|
import './chunk-5VMILVWD.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-RUEDMYBF.js';
|
|
10
10
|
import './chunk-US5R36TQ.js';
|
|
11
11
|
import './chunk-RBCMKPBX.js';
|
|
12
12
|
import './chunk-OL53XYHF.js';
|
package/dist/sidebar.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkDQWAG7YY_cjs = require('./chunk-DQWAG7YY.cjs');
|
|
4
|
+
require('./chunk-6B43ARGW.cjs');
|
|
5
5
|
require('./chunk-I27K6NLX.cjs');
|
|
6
6
|
require('./chunk-A2JUTNE6.cjs');
|
|
7
7
|
require('./chunk-T6YELZPJ.cjs');
|
|
@@ -9,7 +9,7 @@ require('./chunk-4GOOSZEK.cjs');
|
|
|
9
9
|
require('./chunk-TXTRTTG7.cjs');
|
|
10
10
|
require('./chunk-FQZE5N2N.cjs');
|
|
11
11
|
require('./chunk-MKHYENKR.cjs');
|
|
12
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
13
13
|
require('./chunk-36IC3NDN.cjs');
|
|
14
14
|
require('./chunk-TI7D4QDM.cjs');
|
|
15
15
|
require('./chunk-X6LGRB4H.cjs');
|
|
@@ -22,11 +22,11 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
22
22
|
|
|
23
23
|
Object.defineProperty(exports, "Sidebar", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkDQWAG7YY_cjs.Sidebar; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "useSidebar", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkDQWAG7YY_cjs.useSidebar; }
|
|
30
30
|
});
|
|
31
31
|
//# sourceMappingURL=sidebar.cjs.map
|
|
32
32
|
//# sourceMappingURL=sidebar.cjs.map
|
package/dist/sidebar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Sidebar, useSidebar } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { Sidebar, useSidebar } from './chunk-FX37P4KR.js';
|
|
2
|
+
import './chunk-OE4AIUAN.js';
|
|
3
3
|
import './chunk-SV5BW3IA.js';
|
|
4
4
|
import './chunk-2BXMMVQS.js';
|
|
5
5
|
import './chunk-CPY7NHXM.js';
|
|
@@ -7,7 +7,7 @@ import './chunk-ZQ3VXRUY.js';
|
|
|
7
7
|
import './chunk-5U2DZ7AV.js';
|
|
8
8
|
import './chunk-3K2CEAI7.js';
|
|
9
9
|
import './chunk-5VMILVWD.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-RUEDMYBF.js';
|
|
11
11
|
import './chunk-US5R36TQ.js';
|
|
12
12
|
import './chunk-RBCMKPBX.js';
|
|
13
13
|
import './chunk-S53A6JIE.js';
|
package/dist/tooltip.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6B43ARGW_cjs = require('./chunk-6B43ARGW.cjs');
|
|
4
4
|
require('./chunk-I27K6NLX.cjs');
|
|
5
5
|
require('./chunk-MKHYENKR.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-QQKWI7QP.cjs');
|
|
7
7
|
require('./chunk-36IC3NDN.cjs');
|
|
8
8
|
require('./chunk-TI7D4QDM.cjs');
|
|
9
9
|
require('./chunk-OUYC6EIL.cjs');
|
|
@@ -13,7 +13,7 @@ require('./chunk-ZU5Q77OT.cjs');
|
|
|
13
13
|
|
|
14
14
|
Object.defineProperty(exports, "Tooltip", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk6B43ARGW_cjs.Tooltip; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=tooltip.cjs.map
|
|
19
19
|
//# sourceMappingURL=tooltip.cjs.map
|
package/dist/tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Tooltip } from './chunk-
|
|
1
|
+
export { Tooltip } from './chunk-OE4AIUAN.js';
|
|
2
2
|
import './chunk-SV5BW3IA.js';
|
|
3
3
|
import './chunk-5VMILVWD.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-RUEDMYBF.js';
|
|
5
5
|
import './chunk-US5R36TQ.js';
|
|
6
6
|
import './chunk-RBCMKPBX.js';
|
|
7
7
|
import './chunk-YX6FTJ6N.js';
|