@verifiedinc-public/shared-ui-elements 1.3.3 → 2.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.
Files changed (122) hide show
  1. package/README.md +3 -29
  2. package/dist/components/animation/Counter.d.ts +8 -0
  3. package/dist/components/animation/index.d.ts +2 -0
  4. package/dist/components/animation/index.mjs +1 -0
  5. package/dist/components/animation/motions.d.ts +2220 -0
  6. package/dist/components/index.mjs +1 -0
  7. package/dist/hooks/index.mjs +1 -0
  8. package/dist/hooks/useOnClickOutside.d.ts +23 -0
  9. package/dist/index.mjs +1 -0
  10. package/dist/shared/index-C9nSeFPi.mjs +105 -0
  11. package/dist/shared/jsx-runtime-jmtevAuS.mjs +1 -0
  12. package/dist/shared/phone.schema-XBbyizhq.mjs +1 -0
  13. package/dist/shared/shadows-fgmuXym6.mjs +1 -0
  14. package/dist/shared/unix.schema-CMYTtXco.mjs +1 -0
  15. package/dist/shared/useQRCode-DXiPIj-D.mjs +1 -0
  16. package/dist/shared/useSearchParams-CW9y02Ym.mjs +1 -0
  17. package/dist/styles/index.mjs +1 -0
  18. package/dist/utils/masks/index.mjs +1 -0
  19. package/dist/utils/string/index.mjs +1 -0
  20. package/dist/validations/index.mjs +1 -0
  21. package/package.json +36 -12
  22. package/dist/shared-ui-elements.mjs +0 -105
  23. package/src/components/Alert/Alert.tsx +0 -8
  24. package/src/components/Alert/FullWidthAlert.tsx +0 -27
  25. package/src/components/Alert/index.ts +0 -2
  26. package/src/components/Backdrop/index.tsx +0 -34
  27. package/src/components/Banners/Banner.tsx +0 -42
  28. package/src/components/Banners/ExactBirthdayBanner.tsx +0 -18
  29. package/src/components/Banners/ResendPhoneBanner.tsx +0 -55
  30. package/src/components/Banners/TestPhoneNumbersBanner.tsx +0 -25
  31. package/src/components/Banners/index.tsx +0 -4
  32. package/src/components/Button/index.tsx +0 -8
  33. package/src/components/CredentialRequestsEditor/CredentialRequestsEditor.context.tsx +0 -98
  34. package/src/components/CredentialRequestsEditor/components/CredentialRequestsField.tsx +0 -103
  35. package/src/components/CredentialRequestsEditor/components/DataFieldAccordion.tsx +0 -337
  36. package/src/components/CredentialRequestsEditor/components/DataFieldDeleteModal.tsx +0 -64
  37. package/src/components/CredentialRequestsEditor/components/DataFieldDescription.tsx +0 -68
  38. package/src/components/CredentialRequestsEditor/components/DataFieldMandatory.tsx +0 -84
  39. package/src/components/CredentialRequestsEditor/components/DataFieldMulti.tsx +0 -74
  40. package/src/components/CredentialRequestsEditor/components/DataFieldOptionType.tsx +0 -84
  41. package/src/components/CredentialRequestsEditor/components/DataFieldSection.tsx +0 -48
  42. package/src/components/CredentialRequestsEditor/components/DataFieldUserInput.tsx +0 -71
  43. package/src/components/CredentialRequestsEditor/components/RadioOption.tsx +0 -89
  44. package/src/components/CredentialRequestsEditor/contexts/CredentialRequestFieldContext.tsx +0 -36
  45. package/src/components/CredentialRequestsEditor/index.tsx +0 -15
  46. package/src/components/CredentialRequestsEditor/types/compositeCredentialSchema.ts +0 -1
  47. package/src/components/CredentialRequestsEditor/types/credentialSchemasDto.ts +0 -3
  48. package/src/components/CredentialRequestsEditor/types/form.ts +0 -28
  49. package/src/components/CredentialRequestsEditor/types/mandatoryEnum.ts +0 -5
  50. package/src/components/CredentialRequestsEditor/utils/buildDataFieldValue.ts +0 -65
  51. package/src/components/CredentialRequestsEditor/utils/prettyField.ts +0 -16
  52. package/src/components/Image.tsx +0 -10
  53. package/src/components/QRCodeDisplay/index.tsx +0 -50
  54. package/src/components/RequiredLabel/index.tsx +0 -15
  55. package/src/components/Snackbar/index.tsx +0 -156
  56. package/src/components/TextField/index.tsx +0 -8
  57. package/src/components/Tip/index.tsx +0 -18
  58. package/src/components/Typography/index.tsx +0 -8
  59. package/src/components/When.tsx +0 -28
  60. package/src/components/form/CountrySelector.tsx +0 -96
  61. package/src/components/form/DataFieldClearAdornment.tsx +0 -28
  62. package/src/components/form/DateInput.tsx +0 -78
  63. package/src/components/form/DefaultInput.tsx +0 -26
  64. package/src/components/form/InputMask.tsx +0 -41
  65. package/src/components/form/OTPInput.tsx +0 -254
  66. package/src/components/form/PhoneInput.tsx +0 -152
  67. package/src/components/form/SSNInput.tsx +0 -99
  68. package/src/components/form/SelectInput.tsx +0 -101
  69. package/src/components/form/TextMaskCustom.tsx +0 -48
  70. package/src/components/form/index.ts +0 -5
  71. package/src/components/index.ts +0 -13
  72. package/src/components/terms/AcceptTermsNotice.tsx +0 -27
  73. package/src/components/terms/LegalLink.tsx +0 -22
  74. package/src/components/verified/VerifiedImage.tsx +0 -272
  75. package/src/components/verified/VerifiedIncLogo.tsx +0 -11
  76. package/src/components/verified/index.ts +0 -2
  77. package/src/hooks/index.ts +0 -6
  78. package/src/hooks/useCallbackRef.ts +0 -22
  79. package/src/hooks/useCopyToClipboard.ts +0 -76
  80. package/src/hooks/useDisclosure.ts +0 -96
  81. package/src/hooks/useLocalStorage.ts +0 -24
  82. package/src/hooks/usePrevious.ts +0 -17
  83. package/src/hooks/useQRCode.ts +0 -62
  84. package/src/hooks/useSearchParams.ts +0 -7
  85. package/src/index.ts +0 -13
  86. package/src/stories/components/Alert.stories.tsx +0 -41
  87. package/src/stories/components/Button.stories.ts +0 -49
  88. package/src/stories/components/CredentialRequestsEditor.stories.tsx +0 -98
  89. package/src/stories/components/QRCodeDisplay.stories.tsx +0 -60
  90. package/src/stories/components/TextField.stories.ts +0 -59
  91. package/src/stories/components/Typography.stories.ts +0 -140
  92. package/src/stories/components/VerifiedImage.stories.tsx +0 -32
  93. package/src/stories/components/form/DateInput.stories.ts +0 -36
  94. package/src/stories/components/form/OTPInput.stories.tsx +0 -90
  95. package/src/stories/components/form/PhoneInput.stories.tsx +0 -34
  96. package/src/stories/components/form/SSNInput.stories.ts +0 -30
  97. package/src/stories/components/form/SelectInput.stories.ts +0 -39
  98. package/src/stories/hooks/useCopyToClipboard.stories.tsx +0 -45
  99. package/src/styles/colors.ts +0 -60
  100. package/src/styles/index.ts +0 -3
  101. package/src/styles/shadows.ts +0 -6
  102. package/src/styles/theme.ts +0 -257
  103. package/src/styles/typography.ts +0 -86
  104. package/src/utils/date.ts +0 -32
  105. package/src/utils/index.ts +0 -6
  106. package/src/utils/masks/index.ts +0 -6
  107. package/src/utils/omitProperty.ts +0 -19
  108. package/src/utils/phone.ts +0 -76
  109. package/src/utils/ssn.ts +0 -8
  110. package/src/utils/string/index.ts +0 -2
  111. package/src/utils/string/toCapitalize.ts +0 -13
  112. package/src/utils/string/toSentenceCase.ts +0 -7
  113. package/src/utils/wrapPromise.ts +0 -19
  114. package/src/validations/date.schema.ts +0 -18
  115. package/src/validations/description.schema.ts +0 -5
  116. package/src/validations/email.schema.ts +0 -3
  117. package/src/validations/field.schema.ts +0 -3
  118. package/src/validations/index.ts +0 -8
  119. package/src/validations/phone.schema.ts +0 -6
  120. package/src/validations/ssn.schema.ts +0 -24
  121. package/src/validations/state.schema.ts +0 -3
  122. package/src/validations/unix.schema.ts +0 -11
@@ -1,34 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { PhoneInput } from '../../../components/form/PhoneInput';
4
- import { fn } from '@storybook/test';
5
-
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
- const meta = {
8
- title: 'Components/PhoneInput',
9
- component: PhoneInput,
10
- parameters: {
11
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
- layout: 'centered',
13
- },
14
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
- tags: ['autodocs'],
16
- args: {
17
- shouldHaveClearButton: true,
18
- },
19
- } satisfies Meta<typeof PhoneInput>;
20
-
21
- export default meta;
22
- type Story = StoryObj<typeof meta>;
23
-
24
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
25
- export const Default: Story = {
26
- args: {
27
- name: 'date',
28
- label: 'Label',
29
- onChange: fn(),
30
- onValidPhone: fn(),
31
- error: false,
32
- helperText: 'Helper text',
33
- },
34
- };
@@ -1,30 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
-
3
- import { fn } from '@storybook/test';
4
- import { SSNInput } from '../../../components/form/SSNInput';
5
-
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
- const meta = {
8
- title: 'Components/SSNInput',
9
- component: SSNInput,
10
- parameters: {
11
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
- layout: 'centered',
13
- },
14
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
- tags: ['autodocs'],
16
- args: {
17
- name: 'ssn',
18
- label: 'SSN',
19
- error: false,
20
- helperText: 'Helper text',
21
- shouldHaveCloseAdornment: false,
22
- onChange: fn(),
23
- },
24
- };
25
-
26
- export default meta;
27
- type Story = StoryObj<typeof meta>;
28
-
29
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
30
- export const Default: Story = {};
@@ -1,39 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { SelectInput } from '../../../components/form/SelectInput';
4
- import { fn } from '@storybook/test';
5
-
6
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
7
- const meta = {
8
- title: 'Components/SelectInput',
9
- component: SelectInput,
10
- parameters: {
11
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
12
- layout: 'centered',
13
- },
14
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
15
- tags: ['autodocs'],
16
- args: {
17
- InputProps: {
18
- name: 'Select Input',
19
- label: 'Select Input',
20
- error: false,
21
- helperText: 'Helper text',
22
- sx: { width: '200px' },
23
- },
24
- onChange: fn(),
25
- onClear: fn(),
26
- options: [
27
- { label: 'Option 1', id: '1' },
28
- { label: 'Option 2', id: '2' },
29
- { label: 'Option 3', id: '3' },
30
- ],
31
- defaultOption: { label: 'Option 1', id: '1' },
32
- },
33
- } satisfies Meta<typeof SelectInput>;
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof meta>;
37
-
38
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
39
- export const Default: Story = {};
@@ -1,45 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
-
4
- import { Button } from '../../components/Button';
5
- import { useCopyToClipboard } from '../../hooks/useCopyToClipboard';
6
-
7
- // Render to test the hook implementation.
8
- function HookRender(props: any): ReactElement {
9
- const copyToClipboard = useCopyToClipboard({ type: 'text/plain' });
10
- return (
11
- <Button
12
- onClick={() => {
13
- copyToClipboard
14
- .copy(props.content as string)
15
- .then(() => undefined)
16
- .catch(() => undefined);
17
- }}
18
- >
19
- Copy
20
- </Button>
21
- );
22
- }
23
-
24
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
25
- const meta = {
26
- title: 'Hooks/useCopyToClipboard',
27
- component: HookRender,
28
- parameters: {
29
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
30
- layout: 'centered',
31
- },
32
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
33
- tags: ['autodocs'],
34
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
35
- } satisfies Meta<typeof Button>;
36
-
37
- export default meta;
38
- type Story = StoryObj<typeof meta>;
39
-
40
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
41
- export const TextPlain: Story = {
42
- args: {
43
- content: 'Clicked!',
44
- },
45
- };
@@ -1,60 +0,0 @@
1
- import { colors as MUIColors } from '@mui/material';
2
-
3
- export const textDisabled = 'rgba(0,0,0,0.26)';
4
-
5
- export const white = '#ffffff';
6
- export const black = '#000000';
7
-
8
- export const green = '#0dbc3d';
9
- export const lightGreen = '#5ef06d';
10
- export const darkGreen = '#008a01';
11
-
12
- export const blue = '#164fd6';
13
- export const lightBlue = '#657bff';
14
- export const darkBlue = '#0028a3';
15
-
16
- export const red = '#eb0d28';
17
- export const lightRed = '#ff5952';
18
- export const darkRed = '#b00000';
19
-
20
- export const yellow = '#F5D328';
21
- export const lightYellow = '#5ef06d';
22
- export const darkYellow = '#bea008';
23
-
24
- export const warningContrast = '#625410';
25
-
26
- export const infoContrast = '#09225E';
27
-
28
- export const lightGrey = '#F9F9FB';
29
- export const grey = '#bdbdbd';
30
- export const darkGrey = '#797979';
31
-
32
- export const lightGreyContrast = MUIColors.grey['400'];
33
- export const greyContrast = MUIColors.grey['500'];
34
- export const darkGreyContrast = MUIColors.grey['600'];
35
-
36
- export const colors = {
37
- textDisabled,
38
- white,
39
- black,
40
- green,
41
- lightGreen,
42
- darkGreen,
43
- blue,
44
- lightBlue,
45
- darkBlue,
46
- red,
47
- lightRed,
48
- darkRed,
49
- yellow,
50
- lightYellow,
51
- darkYellow,
52
- warningContrast,
53
- infoContrast,
54
- lightGrey,
55
- grey,
56
- darkGrey,
57
- lightGreyContrast,
58
- greyContrast,
59
- darkGreyContrast,
60
- };
@@ -1,3 +0,0 @@
1
- export * from './colors';
2
- export * from './theme';
3
- export * from './shadows';
@@ -1,6 +0,0 @@
1
- const bottomSheet =
2
- '0px -2px 4px -1px rgba(0,0,0,0.2), 0px -4px 5px 0px rgba(0,0,0,0.14), 0px -1px 10px 0px rgba(0,0,0,0.12)';
3
-
4
- export const shadows = {
5
- bottomSheet,
6
- };
@@ -1,257 +0,0 @@
1
- import { createTheme } from '@mui/material';
2
- import { colors } from './colors';
3
- import { typography } from './typography';
4
-
5
- declare module '@mui/material/Button' {
6
- interface ButtonPropsColorOverrides {
7
- neutralContrast: true;
8
- warningContrast: true;
9
- infoContrast: true;
10
- }
11
- }
12
-
13
- declare module '@mui/material/styles' {
14
- // custom palette
15
- interface Palette {
16
- neutral: Palette['primary'];
17
- neutralContrast: Palette['primary'];
18
- warningContrast: Palette['primary'];
19
- infoContrast: Palette['primary'];
20
- }
21
-
22
- interface PaletteOptions {
23
- neutral: PaletteOptions['primary'];
24
- neutralContrast: PaletteOptions['primary'];
25
- warningContrast: PaletteOptions['primary'];
26
- infoContrast: PaletteOptions['primary'];
27
- }
28
- }
29
-
30
- // add neutral color palette as color option for buttons
31
- declare module '@mui/material' {
32
- interface ButtonPropsColorOverrides {
33
- neutral: true;
34
- neutralContrast: true;
35
- warningContrast: true;
36
- }
37
- interface SvgIconPropsColorOverrides {
38
- neutral: true;
39
- neutralContrast: true;
40
- warningContrast: true;
41
- }
42
- }
43
-
44
- interface ThemeOptions {
45
- primaryFontFace: Record<string, any>;
46
- }
47
-
48
- export const theme = ({ primaryFontFace }: ThemeOptions) =>
49
- createTheme({
50
- breakpoints: {
51
- values: {
52
- xs: 0,
53
- sm: 600,
54
- md: 900,
55
- lg: 1200,
56
- xl: 1536,
57
- },
58
- },
59
- typography: {
60
- fontFamily: primaryFontFace.style.fontFamily,
61
- ...typography,
62
- },
63
- palette: {
64
- text: {
65
- disabled: colors.textDisabled,
66
- },
67
- primary: {
68
- main: colors.green,
69
- light: colors.lightGreen,
70
- dark: colors.darkGreen,
71
- contrastText: colors.white,
72
- },
73
- secondary: {
74
- main: colors.blue,
75
- light: colors.lightBlue,
76
- dark: colors.darkBlue,
77
- contrastText: colors.white,
78
- },
79
- error: {
80
- main: colors.red,
81
- light: colors.lightRed,
82
- dark: colors.darkRed,
83
- contrastText: colors.white,
84
- },
85
- warning: {
86
- main: colors.yellow,
87
- light: colors.yellow,
88
- dark: colors.darkYellow,
89
- contrastText: colors.white,
90
- },
91
- success: {
92
- main: colors.green,
93
- light: colors.green,
94
- dark: colors.darkGreen,
95
- contrastText: colors.white,
96
- },
97
- info: {
98
- main: colors.blue,
99
- light: colors.lightBlue,
100
- dark: colors.darkBlue,
101
- contrastText: colors.infoContrast,
102
- },
103
- neutral: {
104
- main: colors.grey,
105
- light: colors.lightGrey,
106
- dark: colors.darkGrey,
107
- },
108
- neutralContrast: {
109
- main: colors.greyContrast,
110
- light: colors.lightGreyContrast,
111
- dark: colors.darkGreyContrast,
112
- },
113
- // We can register custom color to our palette with the augmentColor method.
114
- warningContrast: {
115
- main: colors.warningContrast,
116
- },
117
- infoContrast: {
118
- main: colors.infoContrast,
119
- },
120
- },
121
- components: {
122
- MuiAlert: {
123
- styleOverrides: {
124
- action: {
125
- // the action wrapper is pretty narrow (only fits about 5 characters of text) and the default is to wrap the text, which looks really bad
126
- overflowWrap: 'normal',
127
- // we want the action text, element, etc to be vertically centered if there are multiple lines of text in the alert body
128
- display: 'flex',
129
- alignItems: 'center',
130
- padding: '8px 0',
131
- marginRight: 0,
132
- '& button, & a': {
133
- lineHeight: '0',
134
- },
135
- },
136
- },
137
- },
138
- MuiAlertTitle: {
139
- styleOverrides: {
140
- root: {
141
- ...typography.body2,
142
- fontSize: '1.1rem',
143
- fontWeight: 700,
144
- },
145
- },
146
- },
147
- MuiListItemIcon: {
148
- styleOverrides: {
149
- root: {
150
- minWidth: 34,
151
- },
152
- },
153
- },
154
- MuiListItemText: {
155
- styleOverrides: {
156
- primary: {
157
- fontWeight: 800,
158
- },
159
- },
160
- },
161
- MuiFab: {
162
- styleOverrides: {
163
- circular: {
164
- width: 42,
165
- height: 42,
166
- },
167
- sizeSmall: {
168
- width: 40,
169
- height: 40,
170
- },
171
- },
172
- },
173
- MuiIconButton: {
174
- styleOverrides: {
175
- root: {
176
- '&.Mui-disabled': {
177
- svg: {
178
- opacity: 0.4,
179
- },
180
- },
181
- },
182
- },
183
- },
184
- MuiButton: {
185
- styleOverrides: {
186
- root: {
187
- fontWeight: 800,
188
- },
189
- },
190
- },
191
- MuiDialog: {
192
- defaultProps: {
193
- maxWidth: 'xs',
194
- },
195
- },
196
- MuiDialogTitle: {
197
- styleOverrides: {
198
- root: {
199
- fontSize: 20,
200
- fontWeight: 800,
201
- textAlign: 'center',
202
- },
203
- },
204
- },
205
- MuiDialogContent: {
206
- styleOverrides: {
207
- root: {
208
- paddingTop: '8px!important',
209
- paddingBottom: 8,
210
- },
211
- },
212
- },
213
- MuiDialogActions: {
214
- styleOverrides: {
215
- root: {
216
- paddingLeft: 24,
217
- paddingRight: 24,
218
- paddingBottom: 24,
219
- justifyContent: 'space-between',
220
- '& .MuiButton-root': {
221
- marginTop: 0,
222
- },
223
- },
224
- },
225
- },
226
- MuiRadio: {
227
- styleOverrides: {
228
- root: {
229
- '&.Mui-disabled': {
230
- color: `${colors.grey} !important`,
231
- },
232
- },
233
- },
234
- },
235
- MuiTableRow: {
236
- styleOverrides: {
237
- root: {
238
- '& th.MuiTableCell-root': {
239
- fontSize: 12,
240
- fontWeight: 700,
241
- letterSpacing: 1,
242
- },
243
- '& td.MuiTableCell-root': {
244
- fontSize: 20,
245
- fontWeight: 300,
246
- },
247
- },
248
- },
249
- },
250
- MuiTextField: {
251
- defaultProps: {
252
- variant: 'outlined',
253
- size: 'small',
254
- },
255
- },
256
- },
257
- });
@@ -1,86 +0,0 @@
1
- export const typography = {
2
- h1: {
3
- fontSize: '2.125rem',
4
- fontWeight: 700,
5
- letterSpacing: 0,
6
- lineHeight: 1.35,
7
- },
8
- h2: {
9
- fontSize: '1.5rem',
10
- fontWeight: 700,
11
- letterSpacing: 0,
12
- lineHeight: 1.33,
13
- },
14
- h3: {
15
- fontSize: '1.25rem',
16
- fontWeight: 700,
17
- letterSpacing: 0,
18
- lineHeight: 1.35,
19
- },
20
- h4: {
21
- fontSize: '1.25rem',
22
- fontWeight: 700,
23
- letterSpacing: 0,
24
- lineHeight: 1.2,
25
- },
26
- h5: {
27
- fontSize: '1rem',
28
- fontWeight: 700,
29
- letterSpacing: 0,
30
- lineHeight: 1.1875,
31
- },
32
- h6: {
33
- fontSize: '1rem',
34
- fontWeight: 700,
35
- letterSpacing: '0.15px',
36
- },
37
- subtitle1: {
38
- fontSize: '1rem',
39
- fontWeight: 700,
40
- letterSpacing: 0,
41
- lineHeight: 1.1875,
42
- },
43
- subtitle2: {
44
- fontSize: '0.875rem',
45
- fontWeight: 700,
46
- letterSpacing: 0.1,
47
- lineHeight: 1.5,
48
- },
49
- body1: {
50
- fontSize: '1.25rem',
51
- fontWeight: 300,
52
- letterSpacing: 0,
53
- lineHeight: 1.2,
54
- },
55
- body2: {
56
- fontSize: '1rem',
57
- fontWeight: 400,
58
- letterSpacing: 0,
59
- lineHeight: 1.1875,
60
- },
61
- button: {
62
- // fontSize set by MUI button component sizes, setting it here will screw that up
63
- fontWeight: 700,
64
- letterSpacing: 0,
65
- lineHeight: 1.2,
66
- textTransform: 'uppercase' as const,
67
- },
68
- caption: {
69
- fontSize: '0.75rem',
70
- fontWeight: 400,
71
- letterSpacing: 0,
72
- lineHeight: 1.25,
73
- },
74
- overline: {
75
- fontSize: '0.75rem',
76
- fontWeight: 400,
77
- letterSpacing: 0,
78
- lineHeight: 1.25,
79
- },
80
- label: {
81
- fontSize: '0.75rem',
82
- fontWeight: 700,
83
- letterSpacing: 1,
84
- textTransform: 'uppercase' as const,
85
- },
86
- };
package/src/utils/date.ts DELETED
@@ -1,32 +0,0 @@
1
- /**
2
- * Formats a timestamp into a pretty format of MM/DD/YYYY.
3
- * @param timestamp
4
- * @param separator
5
- */
6
- export const formatDateMMDDYYYY = (timestamp?: string): string => {
7
- let date = new Date(Number(timestamp));
8
-
9
- if (!timestamp) {
10
- const nowDate = new Date();
11
- date = new Date(
12
- nowDate.getFullYear(),
13
- nowDate.getMonth(),
14
- nowDate.getDate(),
15
- );
16
- }
17
-
18
- const day = String(date.getDate()).padStart(2, '0');
19
- const month = String(date.getMonth() + 1).padStart(2, '0');
20
- const year = date.getFullYear();
21
- return [month, day, year].join('/');
22
- };
23
-
24
- export const formatDateToTimestamp = (
25
- dateValue: number | string | Date,
26
- ): string => {
27
- const date = new Date(dateValue);
28
-
29
- date.setUTCHours(12);
30
-
31
- return String(+date);
32
- };
@@ -1,6 +0,0 @@
1
- export * from './wrapPromise';
2
- export * from './date';
3
- export * from './phone';
4
- export * from './masks/index';
5
- export * from './omitProperty';
6
- export * from './ssn';
@@ -1,6 +0,0 @@
1
- // Summary
2
- // - 9 means that it accepts only numbers from 0-9.
3
- export const masks = {
4
- // Mask for date of birth in the format of MM/DD/YYYY.
5
- DOB_MASK: '99/99/9999',
6
- };
@@ -1,19 +0,0 @@
1
- import _ from 'lodash';
2
-
3
- export function omitProperties<T>(obj: T, propertiesToOmit: string[]): T {
4
- if (_.isArray(obj)) {
5
- // If obj is an array, apply the function to each element
6
- return obj.map((item) => omitProperties(item, propertiesToOmit)) as T;
7
- } else if (_.isObject(obj)) {
8
- // If obj is an object, omit the specified properties
9
- let omittedObject: any = _.omit(obj, propertiesToOmit);
10
- // Recursively apply the function to each property in the object
11
- omittedObject = _.mapValues(omittedObject, (value) =>
12
- omitProperties(value, propertiesToOmit),
13
- );
14
- return omittedObject as T;
15
- } else {
16
- // If obj is neither an array nor an object, return it as is
17
- return obj;
18
- }
19
- }