@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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/{pkg/dist-types → dist-types}/index.d.ts +2 -2
  3. package/package.json +14 -40
  4. package/.babelrc.js +0 -5
  5. package/.turbo/turbo-version.log +0 -26
  6. package/pkg/README.md +0 -10
  7. package/pkg/package.json +0 -34
  8. package/playroom.ts +0 -3
  9. package/src/__tests__/index.spec.ts +0 -23
  10. package/src/apn/APN.ts +0 -40
  11. package/src/country-code-metadata/CountryCodeMetadata.spec.ts +0 -1291
  12. package/src/country-code-metadata/CountryCodeMetadata.ts +0 -281
  13. package/src/formatted-phone-number/FormattedPhoneNumber.ts +0 -20
  14. package/src/index.ts +0 -6
  15. package/src/phone-field/PhoneField.playroom.tsx +0 -28
  16. package/src/phone-field/PhoneField.spec.tsx +0 -171
  17. package/src/phone-field/PhoneField.stories.tsx +0 -6
  18. package/src/phone-field/PhoneField.tsx +0 -200
  19. package/src/phone-field/PhoneFieldFlag.tsx +0 -54
  20. package/src/phone-field/PhoneFieldMenu.tsx +0 -53
  21. package/src/phone-field/PhoneFieldMenuItem.spec.tsx +0 -12
  22. package/src/phone-field/PhoneFieldMenuItem.tsx +0 -61
  23. package/src/phone-field/PhoneFieldStartAdornment.tsx +0 -68
  24. package/src/phone-link/PhoneLink.spec.tsx +0 -60
  25. package/src/phone-link/PhoneLink.stories.tsx +0 -9
  26. package/src/phone-link/PhoneLink.tsx +0 -59
  27. package/src/phone-service/PhoneService.spec.ts +0 -277
  28. package/src/phone-service/PhoneService.ts +0 -287
  29. package/src/phone-text/PhoneText.spec.tsx +0 -65
  30. package/src/phone-text/PhoneText.stories.tsx +0 -9
  31. package/src/phone-text/PhoneText.tsx +0 -38
  32. package/tsconfig.json +0 -19
  33. /package/{pkg/dist-node → dist-node}/index.js +0 -0
  34. /package/{pkg/dist-node → dist-node}/index.js.map +0 -0
  35. /package/{pkg/dist-src → dist-src}/apn/APN.js +0 -0
  36. /package/{pkg/dist-src → dist-src}/country-code-metadata/CountryCodeMetadata.js +0 -0
  37. /package/{pkg/dist-src → dist-src}/formatted-phone-number/FormattedPhoneNumber.js +0 -0
  38. /package/{pkg/dist-src → dist-src}/index.js +0 -0
  39. /package/{pkg/dist-src → dist-src}/phone-field/PhoneField.js +0 -0
  40. /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldFlag.js +0 -0
  41. /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldMenu.js +0 -0
  42. /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldMenuItem.js +0 -0
  43. /package/{pkg/dist-src → dist-src}/phone-field/PhoneFieldStartAdornment.js +0 -0
  44. /package/{pkg/dist-src → dist-src}/phone-link/PhoneLink.js +0 -0
  45. /package/{pkg/dist-src → dist-src}/phone-service/PhoneService.js +0 -0
  46. /package/{pkg/dist-src → dist-src}/phone-text/PhoneText.js +0 -0
  47. /package/{pkg/dist-web → dist-web}/index.js +0 -0
  48. /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 AwesomePhonenumber.PhoneNumber;
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.13",
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.13",
18
- "awesome-phonenumber": "^2.70.0",
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
- "@pika/pack": {
32
- "pipeline": [
33
- [
34
- "@pika/plugin-standard-pkg",
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
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const createBabelConfig = require('../../config/createBabelConfig');
4
-
5
- module.exports = createBabelConfig();
@@ -1,26 +0,0 @@
1
- @superdispatch/phones:version: cache hit, replaying output fd40332366d2d744
2
- @superdispatch/phones:version: $ pika build
3
- @superdispatch/phones:version: @pika/pack v0.5.0
4
- @superdispatch/phones:version: [1/8] Validating source...
5
- @superdispatch/phones:version: [2/8] Preparing pipeline...
6
- @superdispatch/phones:version:  ❇️ pkg/
7
- @superdispatch/phones:version: [3/8] Running @pika/plugin-standard-pkg...
8
- @superdispatch/phones:version: Browserslist: caniuse-lite is outdated. Please run:
9
- @superdispatch/phones:version:  npx browserslist@latest --update-db
10
- @superdispatch/phones:version:  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
11
- @superdispatch/phones:version:  📝 pkg/dist-src/index.js [esnext]
12
- @superdispatch/phones:version:  » Linting with standard-pkg...
13
- @superdispatch/phones:version: [4/8] Running @pika/plugin-build-web...
14
- @superdispatch/phones:version:  📝 pkg/dist-web/index.js [module]
15
- @superdispatch/phones:version: [5/8] Running @pika/plugin-build-node...
16
- @superdispatch/phones:version:  📝 pkg/dist-node/index.js [main]
17
- @superdispatch/phones:version: [6/8] Running @pika/plugin-build-types...
18
- @superdispatch/phones:version:  » no manual type definitions found, auto-generating...
19
- @superdispatch/phones:version:  📝 pkg/dist-types/index.d.ts [types]
20
- @superdispatch/phones:version: [7/8] Running @pika/plugin-bundle-types...
21
- @superdispatch/phones:version:  📝 pkg/dist-types/index.d.ts
22
- @superdispatch/phones:version: [8/8] Finalizing package...
23
- @superdispatch/phones:version:  » copying README.md...
24
- @superdispatch/phones:version:  📝 pkg/package.json
25
- @superdispatch/phones:version:  📦 pkg/
26
- @superdispatch/phones:version: Done in 8.46s.
package/pkg/README.md DELETED
@@ -1,10 +0,0 @@
1
- ### `@superdispatch/phones`
2
-
3
- [![npm](https://img.shields.io/npm/v/@superdispatch/phones)](https://www.npmjs.com/package/@superdispatch/phones)
4
- [![npm minzipped size](https://img.shields.io/bundlephobia/minzip/@superdispatch/phones.svg)](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,3 +0,0 @@
1
- export { PhoneField } from './src/phone-field/PhoneField.playroom';
2
- export { PhoneLink } from './src/phone-link/PhoneLink';
3
- export { PhoneText } from './src/phone-text/PhoneText';
@@ -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
- }