@verifiedinc-public/shared-ui-elements 0.11.6
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/README.md +31 -0
- package/dist/components/Alert/Alert.d.ts +3 -0
- package/dist/components/Alert/FullWidthAlert.d.ts +5 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/CredentialRequestsEditor/CredentialRequestsEditor.context.d.ts +31 -0
- package/dist/components/CredentialRequestsEditor/components/CredentialRequestsField.d.ts +2 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldAccordion.d.ts +6 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldDeleteModal.d.ts +7 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldDescription.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldMandatory.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldMulti.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldOptionType.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldSection.d.ts +11 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldUserInput.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/RadioOption.d.ts +11 -0
- package/dist/components/CredentialRequestsEditor/contexts/CredentialRequestFieldContext.d.ts +14 -0
- package/dist/components/CredentialRequestsEditor/index.d.ts +2 -0
- package/dist/components/CredentialRequestsEditor/types/compositeCredentialSchema.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/types/credentialSchemasDto.d.ts +3 -0
- package/dist/components/CredentialRequestsEditor/types/form.d.ts +25 -0
- package/dist/components/CredentialRequestsEditor/types/mandatoryEnum.d.ts +5 -0
- package/dist/components/CredentialRequestsEditor/utils/buildDataFieldValue.d.ts +3 -0
- package/dist/components/CredentialRequestsEditor/utils/prettyField.d.ts +1 -0
- package/dist/components/Image.d.ts +6 -0
- package/dist/components/QRCodeDisplay/index.d.ts +8 -0
- package/dist/components/RequiredLabel/index.d.ts +2 -0
- package/dist/components/TextField/index.d.ts +3 -0
- package/dist/components/Tip/index.d.ts +2 -0
- package/dist/components/Typography/index.d.ts +3 -0
- package/dist/components/When.d.ts +17 -0
- package/dist/components/form/CountrySelector.d.ts +11 -0
- package/dist/components/form/DataFieldClearAdornment.d.ts +6 -0
- package/dist/components/form/DateInput.d.ts +18 -0
- package/dist/components/form/DefaultInput.d.ts +2 -0
- package/dist/components/form/InputMask.d.ts +27 -0
- package/dist/components/form/OTPInput.d.ts +21 -0
- package/dist/components/form/PhoneInput.d.ts +30 -0
- package/dist/components/form/SSNInput.d.ts +18 -0
- package/dist/components/form/SelectInput.d.ts +21 -0
- package/dist/components/form/TextMaskCustom.d.ts +15 -0
- package/dist/components/form/index.d.ts +5 -0
- package/dist/components/form/styles/input.d.ts +6 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/terms/AcceptTermsNotice.d.ts +5 -0
- package/dist/components/terms/LegalLink.d.ts +7 -0
- package/dist/components/verified/VerifiedImage.d.ts +11 -0
- package/dist/components/verified/VerifiedIncLogo.d.ts +2 -0
- package/dist/components/verified/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useCallbackRef.d.ts +5 -0
- package/dist/hooks/useCopyToClipboard.d.ts +20 -0
- package/dist/hooks/useDisclosure.d.ts +26 -0
- package/dist/hooks/useLocalStorage.d.ts +5 -0
- package/dist/hooks/usePrevious.d.ts +5 -0
- package/dist/hooks/useQRCode.d.ts +8 -0
- package/dist/index.d.ts +5 -0
- package/dist/shared-ui-elements.mjs +19938 -0
- package/dist/styles/colors.d.ts +23 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/theme.d.ts +25 -0
- package/dist/utils/date.d.ts +8 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/masks/index.d.ts +3 -0
- package/dist/utils/omitProperty.d.ts +1 -0
- package/dist/utils/phone.d.ts +31 -0
- package/dist/utils/wrapPromise.d.ts +8 -0
- package/dist/validations/birthDate.schema.d.ts +4 -0
- package/dist/validations/date.schema.d.ts +2 -0
- package/dist/validations/description.schema.d.ts +2 -0
- package/dist/validations/email.schema.d.ts +2 -0
- package/dist/validations/field.schema.d.ts +2 -0
- package/dist/validations/index.d.ts +9 -0
- package/dist/validations/phone.schema.d.ts +2 -0
- package/dist/validations/ssn.schema.d.ts +2 -0
- package/dist/validations/state.schema.d.ts +2 -0
- package/dist/validations/unix.schema.d.ts +2 -0
- package/package.json +130 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
export declare const textDisabled = "rgba(0,0,0,0.26)";
|
2
|
+
export declare const white = "#ffffff";
|
3
|
+
export declare const black = "#000000";
|
4
|
+
export declare const green = "#0dbc3d";
|
5
|
+
export declare const lightGreen = "#5ef06d";
|
6
|
+
export declare const darkGreen = "#008a01";
|
7
|
+
export declare const blue = "#164fd6";
|
8
|
+
export declare const lightBlue = "#657bff";
|
9
|
+
export declare const darkBlue = "#0028a3";
|
10
|
+
export declare const red = "#eb0d28";
|
11
|
+
export declare const lightRed = "#ff5952";
|
12
|
+
export declare const darkRed = "#b00000";
|
13
|
+
export declare const yellow = "#F5D328";
|
14
|
+
export declare const lightYellow = "#5ef06d";
|
15
|
+
export declare const darkYellow = "#bea008";
|
16
|
+
export declare const warningContrast = "#625410";
|
17
|
+
export declare const infoContrast = "#09225E";
|
18
|
+
export declare const lightGrey = "#F9F9FB";
|
19
|
+
export declare const grey = "#bdbdbd";
|
20
|
+
export declare const darkGrey = "#797979";
|
21
|
+
export declare const lightGreyContrast: "#bdbdbd";
|
22
|
+
export declare const greyContrast: "#9e9e9e";
|
23
|
+
export declare const darkGreyContrast: "#757575";
|
@@ -0,0 +1,25 @@
|
|
1
|
+
declare module '@mui/material/styles' {
|
2
|
+
interface Palette {
|
3
|
+
neutral: Palette['primary'];
|
4
|
+
neutralContrast: Palette['primary'];
|
5
|
+
}
|
6
|
+
interface PaletteOptions {
|
7
|
+
neutral: PaletteOptions['primary'];
|
8
|
+
neutralContrast: PaletteOptions['primary'];
|
9
|
+
}
|
10
|
+
}
|
11
|
+
declare module '@mui/material' {
|
12
|
+
interface ButtonPropsColorOverrides {
|
13
|
+
neutral: true;
|
14
|
+
neutralContrast: true;
|
15
|
+
}
|
16
|
+
interface SvgIconPropsColorOverrides {
|
17
|
+
neutral: true;
|
18
|
+
neutralContrast: true;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
interface ThemeOptions {
|
22
|
+
primaryFontFace: Record<string, any>;
|
23
|
+
}
|
24
|
+
export declare const theme: ({ primaryFontFace }: ThemeOptions) => import('@mui/material').Theme;
|
25
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* Formats a timestamp into a pretty format of MM/DD/YYYY.
|
3
|
+
* @param timestamp
|
4
|
+
* @param separator
|
5
|
+
*/
|
6
|
+
export declare const formatDateMMDDYYYY: (timestamp?: string) => string;
|
7
|
+
export declare const getMinDateInstance: (minDate?: number, minMonth?: number, minYear?: number) => Date;
|
8
|
+
export declare const getMaxDateInstance: (allowFutureDates?: boolean) => Date;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function omitProperties<T>(obj: T, propertiesToOmit: string[]): T;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
interface CountryData {
|
2
|
+
countryName: string;
|
3
|
+
countryCode: string;
|
4
|
+
emoji: string;
|
5
|
+
mask: string;
|
6
|
+
}
|
7
|
+
export declare const countries: CountryData[];
|
8
|
+
export declare function parseToPhoneNational(internationalPhone: string): string;
|
9
|
+
/**
|
10
|
+
* Get phone data by the international phone string.
|
11
|
+
* @param internationalPhone
|
12
|
+
*/
|
13
|
+
export declare function getPhoneData(internationalPhone: string): CountryData | undefined;
|
14
|
+
/**
|
15
|
+
* Get phone data by property and value match.
|
16
|
+
* @param fieldName
|
17
|
+
* @param value
|
18
|
+
*/
|
19
|
+
export declare function getPhoneDataByFieldName(fieldName: keyof CountryData, value: string): CountryData | undefined;
|
20
|
+
/**
|
21
|
+
* Helper to sort countries by country name.
|
22
|
+
* @param a
|
23
|
+
* @param b
|
24
|
+
*/
|
25
|
+
export declare const sortByCountryName: (a: CountryData, b: CountryData) => number;
|
26
|
+
/**
|
27
|
+
* Validate phone when it is valid and contains a country.
|
28
|
+
* @param internationalPhone
|
29
|
+
*/
|
30
|
+
export declare const validatePhone: (internationalPhone: string) => boolean;
|
31
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
type WrappedPromiseEitherResponse<D, Error> = [Awaited<D>, null] | [null, Error];
|
2
|
+
/**
|
3
|
+
* Wrap a promise to return an array with the data and the error.
|
4
|
+
* @param promise The promise to wrap
|
5
|
+
* @returns
|
6
|
+
*/
|
7
|
+
export declare function wrapPromise<D, Error = any>(promise: PromiseLike<D>): Promise<WrappedPromiseEitherResponse<D, Error>>;
|
8
|
+
export {};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import * as zod from 'zod';
|
2
|
+
export declare const birthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
3
|
+
export declare const simpleBirthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
4
|
+
export declare const shortenBirthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export * from './birthDate.schema';
|
2
|
+
export * from './date.schema';
|
3
|
+
export * from './description.schema';
|
4
|
+
export * from './email.schema';
|
5
|
+
export * from './field.schema';
|
6
|
+
export * from './phone.schema';
|
7
|
+
export * from './ssn.schema';
|
8
|
+
export * from './state.schema';
|
9
|
+
export * from './unix.schema';
|
package/package.json
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
{
|
2
|
+
"name": "@verifiedinc-public/shared-ui-elements",
|
3
|
+
"version": "0.11.6",
|
4
|
+
"description": "A set of UI components, utilities that is shareable with the core apps.",
|
5
|
+
"private": false,
|
6
|
+
"keywords": [],
|
7
|
+
"author": "VerifiedInc",
|
8
|
+
"engines": {
|
9
|
+
"node": ">=20.10.0",
|
10
|
+
"npm": ">=10.x.x"
|
11
|
+
},
|
12
|
+
"main": "/dist/shared-ui-elements.mjs",
|
13
|
+
"types": "/dist/index.d.ts",
|
14
|
+
"files": [
|
15
|
+
"dist"
|
16
|
+
],
|
17
|
+
"exports": {
|
18
|
+
".": {
|
19
|
+
"import": "./dist/shared-ui-elements.mjs",
|
20
|
+
"types": "./dist/index.d.ts"
|
21
|
+
},
|
22
|
+
"./components": {
|
23
|
+
"import": "./dist/shared-ui-elements.mjs",
|
24
|
+
"types": "./dist/index.d.ts"
|
25
|
+
},
|
26
|
+
"./hooks": {
|
27
|
+
"import": "./dist/shared-ui-elements.mjs",
|
28
|
+
"types": "./dist/index.d.ts"
|
29
|
+
},
|
30
|
+
"./utils": {
|
31
|
+
"import": "./dist/shared-ui-elements.mjs",
|
32
|
+
"types": "./dist/index.d.ts"
|
33
|
+
},
|
34
|
+
"./validations": {
|
35
|
+
"import": "./dist/shared-ui-elements.mjs",
|
36
|
+
"types": "./dist/index.d.ts"
|
37
|
+
},
|
38
|
+
"./styles": {
|
39
|
+
"import": "./dist/shared-ui-elements.mjs",
|
40
|
+
"types": "./dist/index.d.ts"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"scripts": {
|
44
|
+
"vitest": "vitest",
|
45
|
+
"lint": "npm run eslint && npm run prettier:check && npm run typecheck",
|
46
|
+
"eslint": "eslint .",
|
47
|
+
"prettier": "prettier --write .",
|
48
|
+
"prettier:check": "prettier --check .",
|
49
|
+
"typecheck": "tsc -b",
|
50
|
+
"storybook": "storybook dev -p 6006",
|
51
|
+
"build-storybook": "storybook build",
|
52
|
+
"prebuild": "rm -rf dist",
|
53
|
+
"build": "tsc && vite build",
|
54
|
+
"prepublishOnly": "npm run build",
|
55
|
+
"publish:prerelease": "npm version prerelease --preid=beta && npm publish --tag beta"
|
56
|
+
},
|
57
|
+
"devDependencies": {
|
58
|
+
"@chromatic-com/storybook": "^2.0.2",
|
59
|
+
"@emotion/react": "^11.11.4",
|
60
|
+
"@emotion/styled": "^11.11.5",
|
61
|
+
"@fontsource/lato": "^5.0.21",
|
62
|
+
"@fontsource/material-icons": "^5.0.18",
|
63
|
+
"@mona-health/react-input-mask": "^3.0.3",
|
64
|
+
"@mui/icons-material": "^5",
|
65
|
+
"@mui/material": "^5",
|
66
|
+
"@storybook/addon-essentials": "^8.3.1",
|
67
|
+
"@storybook/addon-interactions": "^8.3.1",
|
68
|
+
"@storybook/addon-links": "^8.3.1",
|
69
|
+
"@storybook/addon-onboarding": "^8.3.1",
|
70
|
+
"@storybook/addon-themes": "^8.3.1",
|
71
|
+
"@storybook/addon-viewport": "^8.3.1",
|
72
|
+
"@storybook/blocks": "^8.3.1",
|
73
|
+
"@storybook/react": "^8.3.1",
|
74
|
+
"@storybook/react-vite": "^8.3.1",
|
75
|
+
"@storybook/test": "^8.3.1",
|
76
|
+
"@testing-library/dom": "^10.3.0",
|
77
|
+
"@testing-library/react": "^16.0.0",
|
78
|
+
"@types/qrcode": "^1.5.5",
|
79
|
+
"@types/react": "^18.3.3",
|
80
|
+
"@types/react-dom": "^18.3.0",
|
81
|
+
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
82
|
+
"@vitejs/plugin-react": "^4.3.1",
|
83
|
+
"eslint": "^8.27.0",
|
84
|
+
"eslint-config-prettier": "^8.6.0",
|
85
|
+
"eslint-config-standard-with-typescript": "^43.0.1",
|
86
|
+
"eslint-plugin-import": "^2.26.0",
|
87
|
+
"eslint-plugin-node": "^11.1.0",
|
88
|
+
"eslint-plugin-prettier": "^5.1.3",
|
89
|
+
"eslint-plugin-promise": "^6.1.1",
|
90
|
+
"eslint-plugin-react": "^7.31.11",
|
91
|
+
"eslint-plugin-storybook": "^0.8.0",
|
92
|
+
"eslint-plugin-vitest": "^0.0.53",
|
93
|
+
"jsdom": "^24.1.0",
|
94
|
+
"libphonenumber-js": "^1.11.11",
|
95
|
+
"prettier": "^3.1.0",
|
96
|
+
"qrcode": "^1.5.4",
|
97
|
+
"react": "^18",
|
98
|
+
"react-dnd": "^16.0.1",
|
99
|
+
"react-dnd-html5-backend": "^16.0.1",
|
100
|
+
"react-dom": "^18",
|
101
|
+
"react-hook-form": "^7.52.1",
|
102
|
+
"react-imask": "^7.6.1",
|
103
|
+
"storybook": "^8.3.1",
|
104
|
+
"tsconfig-paths": "^4.2.0",
|
105
|
+
"tsx": "^3.12.4",
|
106
|
+
"typescript": "^5.2.2",
|
107
|
+
"vite-plugin-dts": "^4.3.0",
|
108
|
+
"vitest": "^1.6.0",
|
109
|
+
"zod": "^3.23.8"
|
110
|
+
},
|
111
|
+
"peerDependencies": {
|
112
|
+
"@emotion/react": "^11.11.4",
|
113
|
+
"@emotion/styled": "^11.11.5",
|
114
|
+
"@fontsource/lato": "^5.0.21",
|
115
|
+
"@fontsource/material-icons": "^5.0.18",
|
116
|
+
"@mona-health/react-input-mask": "^3.0.3",
|
117
|
+
"@mui/icons-material": "^5",
|
118
|
+
"@mui/material": "^5",
|
119
|
+
"jsdom": "^24.1.0",
|
120
|
+
"libphonenumber-js": "^1.11.11",
|
121
|
+
"qrcode": "^1.5.4",
|
122
|
+
"react": "^18",
|
123
|
+
"react-dnd": "^16.0.1",
|
124
|
+
"react-dnd-html5-backend": "^16.0.1",
|
125
|
+
"react-dom": "^18",
|
126
|
+
"react-hook-form": "^7.52.1",
|
127
|
+
"react-imask": "^7.6.1",
|
128
|
+
"zod": "^3.23.8"
|
129
|
+
}
|
130
|
+
}
|