@superdispatch/phones 0.21.13 → 0.21.18
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/LICENSE +21 -0
- package/{pkg/dist-types → dist-types}/index.d.ts +2 -2
- package/package.json +14 -40
- package/.babelrc.js +0 -5
- package/.turbo/turbo-version.log +0 -26
- package/pkg/README.md +0 -10
- package/pkg/package.json +0 -34
- package/playroom.ts +0 -3
- package/src/__tests__/index.spec.ts +0 -23
- package/src/apn/APN.ts +0 -40
- package/src/country-code-metadata/CountryCodeMetadata.spec.ts +0 -1291
- package/src/country-code-metadata/CountryCodeMetadata.ts +0 -281
- package/src/formatted-phone-number/FormattedPhoneNumber.ts +0 -20
- package/src/index.ts +0 -6
- package/src/phone-field/PhoneField.playroom.tsx +0 -28
- package/src/phone-field/PhoneField.spec.tsx +0 -171
- package/src/phone-field/PhoneField.stories.tsx +0 -6
- package/src/phone-field/PhoneField.tsx +0 -200
- package/src/phone-field/PhoneFieldFlag.tsx +0 -54
- package/src/phone-field/PhoneFieldMenu.tsx +0 -53
- package/src/phone-field/PhoneFieldMenuItem.spec.tsx +0 -12
- package/src/phone-field/PhoneFieldMenuItem.tsx +0 -61
- package/src/phone-field/PhoneFieldStartAdornment.tsx +0 -68
- package/src/phone-link/PhoneLink.spec.tsx +0 -60
- package/src/phone-link/PhoneLink.stories.tsx +0 -9
- package/src/phone-link/PhoneLink.tsx +0 -59
- package/src/phone-service/PhoneService.spec.ts +0 -277
- package/src/phone-service/PhoneService.ts +0 -287
- package/src/phone-text/PhoneText.spec.tsx +0 -65
- package/src/phone-text/PhoneText.stories.tsx +0 -9
- package/src/phone-text/PhoneText.tsx +0 -38
- package/tsconfig.json +0 -19
- /package/{pkg/dist-node → dist-node}/index.js +0 -0
- /package/{pkg/dist-node → dist-node}/index.js.map +0 -0
- /package/{pkg/dist-src → dist-src}/apn/APN.js +0 -0
- /package/{pkg/dist-src → dist-src}/country-code-metadata/CountryCodeMetadata.js +0 -0
- /package/{pkg/dist-src → dist-src}/formatted-phone-number/FormattedPhoneNumber.js +0 -0
- /package/{pkg/dist-src → dist-src}/index.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-field/PhoneField.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldFlag.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldMenu.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldMenuItem.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldStartAdornment.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-link/PhoneLink.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-service/PhoneService.js +0 -0
- /package/{pkg/dist-src → dist-src}/phone-text/PhoneText.js +0 -0
- /package/{pkg/dist-web → dist-web}/index.js +0 -0
- /package/{pkg/dist-web → dist-web}/index.js.map +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Super Dispatch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AwesomePhoneNumber from 'awesome-phonenumber';
|
|
1
|
+
import AwesomePhoneNumber, { PhoneNumber } from 'awesome-phonenumber';
|
|
2
2
|
import { ForwardRefExoticComponent, RefAttributes, ReactNode, ReactElement } from 'react';
|
|
3
3
|
import { BaseTextFieldProps, LinkProps } from '@material-ui/core';
|
|
4
4
|
|
|
@@ -46,7 +46,7 @@ declare class PhoneService {
|
|
|
46
46
|
static load(): Promise<PhoneService>;
|
|
47
47
|
static checkPossibility(input: unknown): Promise<PhoneNumberPossibility>;
|
|
48
48
|
static validate(input: unknown, rules?: PhoneValidationRules): Promise<string | undefined>;
|
|
49
|
-
readonly APN: typeof
|
|
49
|
+
readonly APN: typeof PhoneNumber;
|
|
50
50
|
constructor(APN: APNStatic);
|
|
51
51
|
createAPN(phone: string, country?: CountryISO): APNType;
|
|
52
52
|
getJSON(phone: string, country?: CountryISO): PhoneNumberJSON;
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdispatch/phones",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.18",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist-*/",
|
|
7
|
+
"bin/"
|
|
8
|
+
],
|
|
9
|
+
"pika": true,
|
|
10
|
+
"sideEffects": false,
|
|
4
11
|
"repository": {
|
|
5
12
|
"type": "git",
|
|
6
13
|
"url": "https://github.com/superdispatch/ui.git"
|
|
7
14
|
},
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"main": "src/index.ts",
|
|
10
|
-
"module": "src/index.ts",
|
|
11
|
-
"browser": "pkg/dist-web/index.js",
|
|
12
|
-
"types": "src/index.ts",
|
|
13
|
-
"scripts": {
|
|
14
|
-
"version": "pika build"
|
|
15
|
-
},
|
|
16
15
|
"dependencies": {
|
|
17
|
-
"@superdispatch/ui": "^0.21.
|
|
18
|
-
"awesome-phonenumber": "
|
|
16
|
+
"@superdispatch/ui": "^0.21.14",
|
|
17
|
+
"awesome-phonenumber": "3.4.0",
|
|
19
18
|
"clsx": "^1.1.1"
|
|
20
19
|
},
|
|
21
20
|
"peerDependencies": {
|
|
@@ -28,33 +27,8 @@
|
|
|
28
27
|
"access": "public",
|
|
29
28
|
"directory": "pkg"
|
|
30
29
|
},
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
"exclude": [
|
|
37
|
-
"**/*.spec.*",
|
|
38
|
-
"**/*.stories.*",
|
|
39
|
-
"**/*.playroom.*",
|
|
40
|
-
"**/__tests__/**",
|
|
41
|
-
"**/__testutils__/**"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
[
|
|
46
|
-
"@pika/plugin-build-web"
|
|
47
|
-
],
|
|
48
|
-
[
|
|
49
|
-
"@pika/plugin-build-node"
|
|
50
|
-
],
|
|
51
|
-
[
|
|
52
|
-
"@pika/plugin-build-types"
|
|
53
|
-
],
|
|
54
|
-
[
|
|
55
|
-
"@pika/plugin-bundle-types"
|
|
56
|
-
]
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"gitHead": "5ff0a851a8c24bab48a6fdb37e353eae62bd4a35"
|
|
30
|
+
"esnext": "dist-src/index.js",
|
|
31
|
+
"module": "dist-web/index.js",
|
|
32
|
+
"main": "dist-node/index.js",
|
|
33
|
+
"types": "dist-types/index.d.ts"
|
|
60
34
|
}
|
package/.babelrc.js
DELETED
package/.turbo/turbo-version.log
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[34m@superdispatch/phones:version[0m: cache hit, replaying output [2mfd40332366d2d744[0m
|
|
2
|
-
[34m@superdispatch/phones:version: [0m$ pika build
|
|
3
|
-
[34m@superdispatch/phones:version: [0m@pika/pack v0.5.0
|
|
4
|
-
[34m@superdispatch/phones:version: [0m[1/8] Validating source...
|
|
5
|
-
[34m@superdispatch/phones:version: [0m[2/8] Preparing pipeline...
|
|
6
|
-
[34m@superdispatch/phones:version: [0m ❇️ pkg/
|
|
7
|
-
[34m@superdispatch/phones:version: [0m[3/8] Running @pika/plugin-standard-pkg...
|
|
8
|
-
[34m@superdispatch/phones:version: [0mBrowserslist: caniuse-lite is outdated. Please run:
|
|
9
|
-
[34m@superdispatch/phones:version: [0m npx browserslist@latest --update-db
|
|
10
|
-
[34m@superdispatch/phones:version: [0m Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
11
|
-
[34m@superdispatch/phones:version: [0m 📝 pkg/dist-src/index.js [esnext]
|
|
12
|
-
[34m@superdispatch/phones:version: [0m » Linting with standard-pkg...
|
|
13
|
-
[34m@superdispatch/phones:version: [0m[4/8] Running @pika/plugin-build-web...
|
|
14
|
-
[34m@superdispatch/phones:version: [0m 📝 pkg/dist-web/index.js [module]
|
|
15
|
-
[34m@superdispatch/phones:version: [0m[5/8] Running @pika/plugin-build-node...
|
|
16
|
-
[34m@superdispatch/phones:version: [0m 📝 pkg/dist-node/index.js [main]
|
|
17
|
-
[34m@superdispatch/phones:version: [0m[6/8] Running @pika/plugin-build-types...
|
|
18
|
-
[34m@superdispatch/phones:version: [0m » no manual type definitions found, auto-generating...
|
|
19
|
-
[34m@superdispatch/phones:version: [0m 📝 pkg/dist-types/index.d.ts [types]
|
|
20
|
-
[34m@superdispatch/phones:version: [0m[7/8] Running @pika/plugin-bundle-types...
|
|
21
|
-
[34m@superdispatch/phones:version: [0m 📝 pkg/dist-types/index.d.ts
|
|
22
|
-
[34m@superdispatch/phones:version: [0m[8/8] Finalizing package...
|
|
23
|
-
[34m@superdispatch/phones:version: [0m » copying README.md...
|
|
24
|
-
[34m@superdispatch/phones:version: [0m 📝 pkg/package.json
|
|
25
|
-
[34m@superdispatch/phones:version: [0m 📦 pkg/
|
|
26
|
-
[34m@superdispatch/phones:version: [0mDone in 8.46s.
|
package/pkg/README.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
### `@superdispatch/phones`
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@superdispatch/phones)
|
|
4
|
-
[](https://bundlephobia.com/result?p=@superdispatch/phones)
|
|
5
|
-
|
|
6
|
-
#### Installation
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
yarn add @superdispatch/phones awesome-phonenumber @material-ui/core @material-ui/icons
|
|
10
|
-
```
|
package/pkg/package.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@superdispatch/phones",
|
|
3
|
-
"version": "0.21.8",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist-*/",
|
|
7
|
-
"bin/"
|
|
8
|
-
],
|
|
9
|
-
"pika": true,
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/superdispatch/ui.git"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@superdispatch/ui": "^0.21.8",
|
|
17
|
-
"awesome-phonenumber": "^2.70.0",
|
|
18
|
-
"clsx": "^1.1.1"
|
|
19
|
-
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"@babel/runtime": "^7.0.0",
|
|
22
|
-
"@material-ui/core": "^4.7.2",
|
|
23
|
-
"@material-ui/icons": "^4.5.1",
|
|
24
|
-
"react": "^17.0.2"
|
|
25
|
-
},
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public",
|
|
28
|
-
"directory": "pkg"
|
|
29
|
-
},
|
|
30
|
-
"esnext": "dist-src/index.js",
|
|
31
|
-
"module": "dist-web/index.js",
|
|
32
|
-
"main": "dist-node/index.js",
|
|
33
|
-
"types": "dist-types/index.d.ts"
|
|
34
|
-
}
|
package/playroom.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as api from '..';
|
|
2
|
-
|
|
3
|
-
test('api', () => {
|
|
4
|
-
expect(api).toMatchInlineSnapshot(`
|
|
5
|
-
Object {
|
|
6
|
-
"DEFAULT_COUNTRY": "US",
|
|
7
|
-
"PhoneField": React.forwardRef(PhoneField),
|
|
8
|
-
"PhoneLink": React.forwardRef(PhoneLink),
|
|
9
|
-
"PhoneService": [Function],
|
|
10
|
-
"PhoneText": [Function],
|
|
11
|
-
"SuspendedPhoneField": React.forwardRef(SuspendedPhoneField),
|
|
12
|
-
"SuspendedPhoneLink": React.forwardRef(SuspendedPhoneLink),
|
|
13
|
-
"SuspendedPhoneText": [Function],
|
|
14
|
-
"formatCountry": [Function],
|
|
15
|
-
"getCountryCode": [Function],
|
|
16
|
-
"isCountryISO": [Function],
|
|
17
|
-
"listCountries": [Function],
|
|
18
|
-
"toCountryISO": [Function],
|
|
19
|
-
"useFormattedPhoneNumber": [Function],
|
|
20
|
-
"usePhoneService": [Function],
|
|
21
|
-
}
|
|
22
|
-
`);
|
|
23
|
-
});
|
package/src/apn/APN.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type AwesomePhoneNumber from 'awesome-phonenumber';
|
|
2
|
-
|
|
3
|
-
export type APNType = AwesomePhoneNumber;
|
|
4
|
-
export type APNStatic = typeof AwesomePhoneNumber;
|
|
5
|
-
export type AYTType = ReturnType<APNStatic['getAsYouType']>;
|
|
6
|
-
|
|
7
|
-
let loadError: undefined | Error;
|
|
8
|
-
let loadedAPN: undefined | APNStatic;
|
|
9
|
-
|
|
10
|
-
export function loadAPN(): Promise<APNStatic> {
|
|
11
|
-
return import(
|
|
12
|
-
/* webpackPrefetch: true */
|
|
13
|
-
/* webpackChunkName: "apn" */
|
|
14
|
-
'awesome-phonenumber'
|
|
15
|
-
).then(
|
|
16
|
-
(apn) => {
|
|
17
|
-
loadedAPN = apn.default;
|
|
18
|
-
|
|
19
|
-
return loadedAPN;
|
|
20
|
-
},
|
|
21
|
-
(error: Error) => {
|
|
22
|
-
loadError = error;
|
|
23
|
-
|
|
24
|
-
throw error;
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function getAPN(): APNStatic {
|
|
30
|
-
if (loadError) {
|
|
31
|
-
throw loadError;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (!loadedAPN) {
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
36
|
-
throw loadAPN();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return loadedAPN;
|
|
40
|
-
}
|