@sikka/hawa 0.0.95 → 0.0.96

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 (174) hide show
  1. package/dist/styles.css +279 -211
  2. package/es/index.es.js +1 -1
  3. package/lib/index.js +1 -1
  4. package/package.json +18 -6
  5. package/rollup.config.js +14 -2
  6. package/src/blocks/Account/{UserProfileForm.js → UserProfileForm.tsx} +42 -41
  7. package/src/blocks/Account/UserSettingsForm.tsx +28 -0
  8. package/src/blocks/Account/index.ts +2 -0
  9. package/src/blocks/AuthForms/AppLanding.tsx +33 -0
  10. package/src/blocks/AuthForms/CodeConfirmation.tsx +59 -0
  11. package/src/blocks/AuthForms/{NewPasswordForm.js → NewPasswordForm.tsx} +49 -53
  12. package/src/blocks/AuthForms/{ResetPasswordForm.js → ResetPasswordForm.tsx} +35 -38
  13. package/src/blocks/AuthForms/{SignInForm.js → SignInForm.tsx} +73 -65
  14. package/src/blocks/AuthForms/SignInPhone.tsx +68 -0
  15. package/src/blocks/AuthForms/{SignUpForm.js → SignUpForm.tsx} +88 -82
  16. package/src/blocks/AuthForms/index.ts +7 -0
  17. package/src/blocks/Misc/NotFound.tsx +28 -0
  18. package/src/blocks/Misc/index.ts +1 -0
  19. package/src/blocks/Payment/ChargeWalletForm.tsx +70 -0
  20. package/src/blocks/Payment/{CheckoutForm.js → CheckoutForm.tsx} +82 -81
  21. package/src/blocks/Payment/Confirmation.tsx +96 -0
  22. package/src/blocks/Payment/{CreditCardForm.js → CreditCardForm.tsx} +48 -33
  23. package/src/blocks/Payment/PayWithWallet.tsx +29 -0
  24. package/src/blocks/Payment/{SelectPayment.js → SelectPayment.tsx} +33 -29
  25. package/src/blocks/Payment/{index.js → index.ts} +0 -0
  26. package/src/blocks/Pricing/{ComparingPlans.js → ComparingPlans.tsx} +51 -53
  27. package/src/blocks/Pricing/PricingPlans.tsx +72 -0
  28. package/src/blocks/Pricing/{index.js → index.ts} +0 -0
  29. package/src/blocks/{index.js → index.ts} +0 -0
  30. package/{countries.js → src/countries.ts} +245 -245
  31. package/src/elements/{AutoCompleteField.js → AutoCompleteField.tsx} +16 -9
  32. package/src/elements/{DragDropImages.js → DragDropImages.tsx} +78 -53
  33. package/src/elements/DraggableCard.tsx +29 -0
  34. package/src/elements/{HawaAccordian.js → HawaAccordian.tsx} +27 -23
  35. package/src/elements/HawaAdCard.tsx +48 -0
  36. package/src/elements/HawaAlert.tsx +30 -0
  37. package/src/elements/HawaButton.tsx +120 -0
  38. package/src/elements/HawaCheckbox.tsx +37 -0
  39. package/src/elements/HawaChip.tsx +12 -0
  40. package/src/elements/HawaColorPicker.tsx +38 -0
  41. package/src/elements/{HawaCopyrights.js → HawaCopyrights.tsx} +15 -8
  42. package/src/elements/HawaDrawer.tsx +84 -0
  43. package/src/elements/{HawaDrawerItem.js → HawaDrawerItem.tsx} +12 -7
  44. package/src/elements/{HawaItemCard.js → HawaItemCard.tsx} +35 -36
  45. package/src/elements/{HawaLogoButton.js → HawaLogoButton.tsx} +52 -56
  46. package/src/elements/HawaMenu.tsx +75 -0
  47. package/src/elements/{HawaModal.js → HawaModal.tsx} +30 -21
  48. package/src/elements/{HawaPanelTabs.js → HawaPanelTabs.tsx} +27 -27
  49. package/src/elements/HawaPhoneInput.tsx +112 -0
  50. package/src/elements/{HawaPricingCard.js → HawaPricingCard.tsx} +86 -47
  51. package/src/elements/HawaRadio.tsx +34 -0
  52. package/src/elements/HawaRange.tsx +47 -0
  53. package/src/elements/HawaSearchBar.tsx +9 -0
  54. package/src/elements/{HawaSelect.js → HawaSelect.tsx} +74 -31
  55. package/src/elements/HawaSettingsRow.tsx +56 -0
  56. package/src/elements/HawaSnackbar.tsx +73 -0
  57. package/src/elements/HawaSwitch.tsx +25 -0
  58. package/src/elements/{HawaTable.js → HawaTable.tsx} +33 -31
  59. package/src/elements/{HawaTabs.js → HawaTabs.tsx} +17 -12
  60. package/src/elements/HawaTextField.tsx +71 -0
  61. package/src/elements/HawaTooltip.tsx +35 -0
  62. package/src/elements/HawaTypography.tsx +11 -0
  63. package/src/elements/{TabPanel.js → TabPanel.tsx} +10 -5
  64. package/src/elements/{index.js → index.ts} +7 -4
  65. package/src/index.ts +3 -0
  66. package/src/layout/Box.tsx +5 -0
  67. package/src/layout/HawaBottomAppBar.tsx +54 -0
  68. package/src/layout/HawaContainer.tsx +24 -0
  69. package/src/layout/{HawaLayout.js → HawaLayout.tsx} +54 -49
  70. package/src/layout/{index.js → index.ts} +0 -0
  71. package/src/styles.css +279 -211
  72. package/src/{util.js → util.ts} +0 -0
  73. package/storybook-static/229.a3257e00.iframe.bundle.js +1 -0
  74. package/storybook-static/229.d6fb4f8f665962cef844.manager.bundle.js +1 -0
  75. package/storybook-static/295.67c251ec00675ab59b60.manager.bundle.js +1 -0
  76. package/storybook-static/51.786e9bbba427ee454dc0.manager.bundle.js +2 -0
  77. package/storybook-static/{0.1104ca18.iframe.bundle.js.LICENSE.txt → 51.786e9bbba427ee454dc0.manager.bundle.js.LICENSE.txt} +0 -0
  78. package/storybook-static/51.acbbdb95.iframe.bundle.js +2 -0
  79. package/storybook-static/{0.cf71f8aa82edef0a7186.manager.bundle.js.LICENSE.txt → 51.acbbdb95.iframe.bundle.js.LICENSE.txt} +0 -0
  80. package/storybook-static/551.67cd309b0648b0a52636.manager.bundle.js +1 -0
  81. package/storybook-static/551.c82ea8f1.iframe.bundle.js +1 -0
  82. package/storybook-static/701.bcf1e718.iframe.bundle.js +1 -0
  83. package/storybook-static/733.8d2de9f8.iframe.bundle.js +2 -0
  84. package/storybook-static/{vendors~main.a40572d0.iframe.bundle.js.LICENSE.txt → 733.8d2de9f8.iframe.bundle.js.LICENSE.txt} +0 -10
  85. package/storybook-static/767.2f9c96fa3338c8d16078.manager.bundle.js +2 -0
  86. package/storybook-static/{vendors~main.d13ba71108048897ea4a.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +0 -10
  87. package/storybook-static/807.14b8bfa7.iframe.bundle.js +2 -0
  88. package/storybook-static/{5.5b799f3fbf64cec8e51a.manager.bundle.js.LICENSE.txt → 807.14b8bfa7.iframe.bundle.js.LICENSE.txt} +0 -0
  89. package/storybook-static/807.4f52b2d047c5e8c5872f.manager.bundle.js +2 -0
  90. package/storybook-static/{6.6023eba1.iframe.bundle.js.LICENSE.txt → 807.4f52b2d047c5e8c5872f.manager.bundle.js.LICENSE.txt} +0 -0
  91. package/storybook-static/897.386c170cbd1467abc7ca.manager.bundle.js +2 -0
  92. package/storybook-static/{8.f9b98ef3e089be1a16d6.manager.bundle.js.LICENSE.txt → 897.386c170cbd1467abc7ca.manager.bundle.js.LICENSE.txt} +0 -0
  93. package/storybook-static/897.d9a35fd0.iframe.bundle.js +2 -0
  94. package/storybook-static/{9.63a5cf7a.iframe.bundle.js.LICENSE.txt → 897.d9a35fd0.iframe.bundle.js.LICENSE.txt} +0 -0
  95. package/storybook-static/935.07c1b6ea.iframe.bundle.js +1 -0
  96. package/storybook-static/935.0b4e9c201c33f3e66e81.manager.bundle.js +1 -0
  97. package/storybook-static/iframe.html +1 -1
  98. package/storybook-static/index.html +1 -1
  99. package/storybook-static/main.051275cac7b0dc69501c.manager.bundle.js +1 -0
  100. package/storybook-static/main.71507dcb.iframe.bundle.js +1 -0
  101. package/storybook-static/project.json +1 -1
  102. package/storybook-static/runtime~main.25eae181fe0f96887a15.manager.bundle.js +1 -0
  103. package/storybook-static/runtime~main.4d0bf318.iframe.bundle.js +1 -0
  104. package/tailwind.config.js +16 -1
  105. package/tsconfig.json +25 -0
  106. package/src/blocks/Account/UserSettingsForm.js +0 -17
  107. package/src/blocks/Account/index.js +0 -2
  108. package/src/blocks/AuthForms/AppLanding.js +0 -40
  109. package/src/blocks/AuthForms/CodeConfirmation.js +0 -78
  110. package/src/blocks/AuthForms/SignInPhone.js +0 -38
  111. package/src/blocks/AuthForms/index.js +0 -7
  112. package/src/blocks/Misc/NotFound.js +0 -32
  113. package/src/blocks/Misc/index.js +0 -1
  114. package/src/blocks/Payment/ChargeWalletForm.js +0 -81
  115. package/src/blocks/Payment/Confirmation.js +0 -104
  116. package/src/blocks/Payment/Form/CForm.js +0 -316
  117. package/src/blocks/Payment/Form/Card.js +0 -242
  118. package/src/blocks/Payment/Form/PaymentMethod.js +0 -118
  119. package/src/blocks/Payment/Gateway/GooglePay.js +0 -251
  120. package/src/blocks/Payment/Gateway/Payfort.js +0 -90
  121. package/src/blocks/Payment/Gateway/Paypal.js +0 -138
  122. package/src/blocks/Payment/Gateway/Wallet.js +0 -148
  123. package/src/blocks/Payment/PayWithWallet.js +0 -20
  124. package/src/blocks/Pricing/PricingPlans.js +0 -88
  125. package/src/elements/DraggableCard.js +0 -24
  126. package/src/elements/HawaAlert.js +0 -41
  127. package/src/elements/HawaButton.js +0 -62
  128. package/src/elements/HawaCheckbox.js +0 -28
  129. package/src/elements/HawaChip.js +0 -9
  130. package/src/elements/HawaColorPicker.js +0 -57
  131. package/src/elements/HawaDrawer.js +0 -68
  132. package/src/elements/HawaMenu.js +0 -71
  133. package/src/elements/HawaPhoneInput.js +0 -106
  134. package/src/elements/HawaRadio.js +0 -31
  135. package/src/elements/HawaRange.js +0 -54
  136. package/src/elements/HawaSearchBar.js +0 -15
  137. package/src/elements/HawaSettingsRow.js +0 -34
  138. package/src/elements/HawaSnackbar.js +0 -44
  139. package/src/elements/HawaSwitch.js +0 -21
  140. package/src/elements/HawaTextField.js +0 -34
  141. package/src/elements/HawaTooltip.js +0 -19
  142. package/src/elements/HawaTypography.js +0 -5
  143. package/src/elements/PinInput.js +0 -141
  144. package/src/elements/SelectedField.js +0 -46
  145. package/src/index.js +0 -3
  146. package/src/layout/Box.js +0 -5
  147. package/src/layout/HawaAppLayout.js +0 -245
  148. package/src/layout/HawaAppLayout2.js +0 -254
  149. package/src/layout/HawaBottomAppBar.js +0 -76
  150. package/src/layout/HawaContainer.js +0 -8
  151. package/storybook-static/0.1104ca18.iframe.bundle.js +0 -3
  152. package/storybook-static/0.1104ca18.iframe.bundle.js.map +0 -1
  153. package/storybook-static/0.cf71f8aa82edef0a7186.manager.bundle.js +0 -2
  154. package/storybook-static/1.7e6ec5c45ae5b70c5149.manager.bundle.js +0 -1
  155. package/storybook-static/1.e3eafd38.iframe.bundle.js +0 -1
  156. package/storybook-static/2.3841b1a5.iframe.bundle.js +0 -1
  157. package/storybook-static/5.5b799f3fbf64cec8e51a.manager.bundle.js +0 -2
  158. package/storybook-static/6.6023eba1.iframe.bundle.js +0 -3
  159. package/storybook-static/6.6023eba1.iframe.bundle.js.map +0 -1
  160. package/storybook-static/6.b34ce31193a7fa1dd965.manager.bundle.js +0 -1
  161. package/storybook-static/7.632f8551.iframe.bundle.js +0 -1
  162. package/storybook-static/7.72879af713f755a7aa7e.manager.bundle.js +0 -1
  163. package/storybook-static/8.9a8f8b69.iframe.bundle.js +0 -1
  164. package/storybook-static/8.f9b98ef3e089be1a16d6.manager.bundle.js +0 -2
  165. package/storybook-static/9.1e1335092fade49cc986.manager.bundle.js +0 -1
  166. package/storybook-static/9.63a5cf7a.iframe.bundle.js +0 -3
  167. package/storybook-static/9.63a5cf7a.iframe.bundle.js.map +0 -1
  168. package/storybook-static/main.4bd27e4e7faa098302d1.manager.bundle.js +0 -1
  169. package/storybook-static/main.ea9904c2.iframe.bundle.js +0 -1
  170. package/storybook-static/runtime~main.67ec6e92.iframe.bundle.js +0 -1
  171. package/storybook-static/runtime~main.a58df7ba92d01c5088d3.manager.bundle.js +0 -1
  172. package/storybook-static/vendors~main.a40572d0.iframe.bundle.js +0 -3
  173. package/storybook-static/vendors~main.a40572d0.iframe.bundle.js.map +0 -1
  174. package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +0 -2
@@ -1,25 +1,63 @@
1
- import React from "react";
1
+ import React from "react"
2
2
  import {
3
3
  HawaTextField,
4
4
  HawaLogoButton,
5
5
  HawaAlert,
6
6
  HawaButton,
7
- HawaPhoneInput
8
- } from "../../elements";
9
- import { Controller, useForm } from "react-hook-form";
10
- import PropTypes from "prop-types";
11
- import { HawaContainer } from "../../layout/HawaContainer";
7
+ HawaPhoneInput,
8
+ } from "../../elements"
9
+ import { Controller, useForm } from "react-hook-form"
10
+ import { HawaContainer } from "../../layout"
12
11
 
13
- export const SignInForm = (props) => {
14
- const methods = useForm();
12
+ type SignInFormTypes = {
13
+ showError: any
14
+ errorTitle: string
15
+ errorText: string
16
+ signInType: "email" | "username" | "phone"
17
+ texts: {
18
+ emailLabel: string
19
+ emailPlaceholder: string
20
+ emailRequiredText: string
21
+ emailInvalidText: string
22
+ usernameLabel: string
23
+ usernamePlaceholder: string
24
+ usernameRequired: string
25
+ usernameRequiredText: string
26
+ phoneRequiredText: string
27
+ passwordLabel: string
28
+ passwordPlaceholder: string
29
+ passwordRequiredText: string
30
+ forgotPasswordText: string
31
+ newUserText: string
32
+ signUpText: string
33
+ signInText: string
34
+ googleButtonLabel: string
35
+ githubButtonLabel: string
36
+ twitterButtonLabel: string
37
+ }
38
+ withoutResetPassword: boolean
39
+ withoutSignUp: boolean
40
+ isLoading: any
41
+ viaGoogle: boolean
42
+ viaGithub: boolean
43
+ viaTwitter: boolean
44
+ handleSignIn: any
45
+ handleRouteToSignUp: any
46
+ handleForgotPassword: any
47
+ handleGoogleSignIn: any
48
+ handleGithubSignIn: any
49
+ handleTwitterSignIn: any
50
+ }
51
+
52
+ export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
15
53
  const {
16
54
  formState: { errors },
17
55
  handleSubmit,
18
- control
19
- } = methods;
56
+ control,
57
+ } = useForm()
20
58
 
21
59
  return (
22
- <HawaContainer withDividers>
60
+ <HawaContainer>
23
61
  <form onSubmit={handleSubmit(props.handleSignIn)}>
24
62
  {props.showError && (
25
63
  <HawaAlert
@@ -34,13 +72,13 @@ export const SignInForm = (props) => {
34
72
  name="email"
35
73
  render={({ field }) => (
36
74
  <HawaTextField
37
- fullWidth
75
+ width="full"
38
76
  type="text"
39
- value={field.value ?? ""}
40
77
  label={props.texts.emailLabel}
41
78
  helperText={errors.email?.message}
42
79
  placeholder={props.texts.emailPlaceholder}
43
80
  {...field}
81
+ value={field.value ?? ""}
44
82
  />
45
83
  )}
46
84
  rules={{
@@ -48,8 +86,8 @@ export const SignInForm = (props) => {
48
86
  pattern: {
49
87
  value:
50
88
  /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
51
- message: props.texts.emailInvalidText
52
- }
89
+ message: props.texts.emailInvalidText,
90
+ },
53
91
  }}
54
92
  />
55
93
  ) : props.signInType === "username" ? (
@@ -58,17 +96,17 @@ export const SignInForm = (props) => {
58
96
  name="username"
59
97
  render={({ field }) => (
60
98
  <HawaTextField
61
- fullWidth
99
+ width="full"
62
100
  type="text"
63
- value={field.value ?? ""}
64
101
  label={props.texts.usernameLabel}
65
102
  helperText={errors.username?.message}
66
103
  placeholder={props.texts.usernamePlaceholder}
67
104
  {...field}
105
+ value={field.value ?? ""}
68
106
  />
69
107
  )}
70
108
  rules={{
71
- required: props.texts.usernameRequired
109
+ required: props.texts.usernameRequiredText,
72
110
  }}
73
111
  />
74
112
  ) : (
@@ -76,7 +114,7 @@ export const SignInForm = (props) => {
76
114
  control={control}
77
115
  name="phone"
78
116
  render={({ field }) => <HawaPhoneInput label="Phone number" />}
79
- rules={{ required: props.texts.passwordRequiredText }}
117
+ rules={{ required: props.texts.phoneRequiredText }}
80
118
  />
81
119
  )}
82
120
  <Controller
@@ -84,38 +122,43 @@ export const SignInForm = (props) => {
84
122
  name="password"
85
123
  render={({ field }) => (
86
124
  <HawaTextField
87
- fullWidth
125
+ width="full"
88
126
  type="password"
89
127
  defaultValue={field.value ?? ""}
90
- value={field.value ?? ""}
91
128
  label={props.texts.passwordLabel}
92
129
  placeholder={props.texts.passwordPlaceholder}
93
130
  helperText={errors.password?.message}
94
131
  {...field}
132
+ value={field.value ?? ""}
95
133
  />
96
134
  )}
97
- rules={{ required: props.texts.passwordRequiredText }}
135
+ rules={{ required: props.texts.passwordRequiredText, minLength: 5 }}
98
136
  />
99
137
  {!props.withoutResetPassword && (
100
138
  <div
101
- className="dark:text-gray-300 text-xs cursor-pointer w-fit mb-3"
139
+ className="mb-3 w-fit cursor-pointer text-xs dark:text-gray-300"
102
140
  onClick={props.handleForgotPassword}
103
141
  >
104
142
  {props.texts.forgotPasswordText}
105
143
  </div>
106
144
  )}
145
+
107
146
  <HawaButton
108
- fullWidth
109
147
  isLoading={props.isLoading}
148
+ variant="contained"
149
+ color="primary"
150
+ size="medium"
151
+ width="full"
110
152
  type="submit"
111
- text={props.texts.signInText}
112
- />{" "}
153
+ >
154
+ {props.texts.signInText}
155
+ </HawaButton>
113
156
  {!props.withoutSignUp && (
114
- <div className="dark:text-gray-300 font-semibold p-3 text-center text-sm">
157
+ <div className="p-3 text-center text-sm font-semibold dark:text-gray-300">
115
158
  {props.texts.newUserText}{" "}
116
159
  <span
117
160
  onClick={props.handleRouteToSignUp}
118
- className="dark:text-blue-400 text-blue-600 cursor-pointer"
161
+ className="cursor-pointer text-blue-600 dark:text-blue-400"
119
162
  >
120
163
  {props.texts.signUpText}
121
164
  </span>
@@ -150,40 +193,5 @@ export const SignInForm = (props) => {
150
193
  </div>
151
194
  ) : null}
152
195
  </HawaContainer>
153
- );
154
- };
155
- SignInForm.propTypes = {
156
- /**
157
- * An object of all the texts in the blocks
158
- */
159
- texts: PropTypes.shape({
160
- emailLabel: PropTypes.string,
161
- emailPlaceholder: PropTypes.string,
162
- emailRequiredText: PropTypes.string,
163
- emailInvalidText: PropTypes.string,
164
- usernameLabel: PropTypes.string,
165
- usernamePlaceholder: PropTypes.string,
166
- usernameRequired: PropTypes.string,
167
- passwordLabel: PropTypes.string,
168
- passwordPlaceholder: PropTypes.string,
169
- passwordRequiredText: PropTypes.string,
170
- forgotPasswordText: PropTypes.string,
171
- newUserText: PropTypes.string,
172
- signUpText: PropTypes.string,
173
- signInText: PropTypes.string,
174
- googleButtonLabel: PropTypes.string,
175
- githubButtonLabel: PropTypes.string,
176
- twitterButtonLabel: PropTypes.string
177
- }),
178
- viaGoogle: PropTypes.bool,
179
- viaGithub: PropTypes.bool,
180
- viaTwitter: PropTypes.bool,
181
- handleSignIn: PropTypes.func,
182
- handleRouteToSignUp: PropTypes.func,
183
- handleGoogleSignIn: PropTypes.func,
184
- handleGithubSignIn: PropTypes.func,
185
- handleTwitterSignIn: PropTypes.func,
186
- handleForgotPassword: PropTypes.func,
187
-
188
- withoutSignUp: PropTypes.bool
189
- };
196
+ )
197
+ }
@@ -0,0 +1,68 @@
1
+ import React, { useState } from "react"
2
+ import { Controller, useForm } from "react-hook-form"
3
+ import { HawaButton, HawaPhoneInput } from "../../elements"
4
+ import { HawaContainer } from "../../layout"
5
+
6
+ type SignInPhoneTypes = {
7
+ value: any
8
+ onSubmit: any
9
+ country: any
10
+ label: any
11
+ handlePhoneChange: any
12
+ phoneRequiredText: any
13
+ SignInButtonText: any
14
+ }
15
+
16
+ export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
17
+ props
18
+ ) => {
19
+ const {
20
+ formState: { errors },
21
+ handleSubmit,
22
+ control,
23
+ } = useForm()
24
+
25
+ const [userPhone, setUserPhone] = useState("")
26
+ const handlingSubmit = () => {
27
+ console.log("submitting ", userPhone)
28
+ }
29
+ return (
30
+ <HawaContainer>
31
+ <form
32
+ onSubmit={handleSubmit(() => console.log("testing submit"))}
33
+ // onSubmit={(e) => {
34
+ // e.preventDefault()
35
+ // console.log("testing submit")
36
+ // }}
37
+ >
38
+ <Controller
39
+ control={control}
40
+ name="phone"
41
+ render={({ field }) => (
42
+ <HawaPhoneInput
43
+ country={props.country ?? ""}
44
+ label={props.label ?? ""}
45
+ {...field}
46
+ handleChange={(e: any) => {
47
+ console.log("test")
48
+ setUserPhone(e.target.value)
49
+ }}
50
+ // handleChange={(e: any) => {
51
+ // // props.handlePhoneChange(e.target.value)
52
+ // setUserPhone(e.target.value)
53
+ // }}
54
+ // value={props.value ?? props.value}
55
+ />
56
+ )}
57
+ rules={{
58
+ required: props.phoneRequiredText,
59
+ }}
60
+ />
61
+ <div className="mt-2"></div>
62
+ <HawaButton color="primary" width="full" type="submit">
63
+ {props.SignInButtonText}
64
+ </HawaButton>
65
+ </form>
66
+ </HawaContainer>
67
+ )
68
+ }
@@ -1,26 +1,74 @@
1
- import React from "react";
1
+ import React from "react"
2
2
  import {
3
3
  HawaTextField,
4
4
  HawaLogoButton,
5
5
  HawaAlert,
6
6
  HawaButton,
7
7
  HawaCheckbox,
8
- HawaSelect
9
- } from "../../elements";
10
- import PropTypes from "prop-types";
11
- import { Controller, FormProvider, useForm } from "react-hook-form";
12
- import { HawaContainer } from "../../layout/HawaContainer";
8
+ HawaSelect,
9
+ } from "../../elements"
10
+ import { Controller, FormProvider, useForm } from "react-hook-form"
11
+ import { HawaContainer } from "../../layout/HawaContainer"
13
12
 
14
- export const SignUpForm = (props) => {
15
- const methods = useForm();
13
+ type SignUpFormTypes = {
14
+ texts: {
15
+ fullNameLabel: string
16
+ fullNamePlaceholder: string
17
+ fullNameRequiredText: string
18
+ emailLabel: string
19
+ emailPlaceholder: string
20
+ emailRequiredText: string
21
+ emailInvalidText: string
22
+ usernameLabel: string
23
+ usernamePlaceholder: string
24
+ usernameRequired: string
25
+ passwordLabel: string
26
+ passwordPlaceholder: string
27
+ passwordRequiredText: string
28
+ passwordTooShortText: string
29
+ confirmPasswordLabel: string
30
+ confirmPasswordPlaceholder: string
31
+ subscribeToNewsletter: string
32
+ forgotPasswordText: string
33
+ termsText: string
34
+ iAcceptText: string
35
+ termsRequiredText: string
36
+ newUserText: string
37
+ signUpText: string
38
+ signInText: string
39
+ existingUserText: string
40
+ googleButtonLabel: string
41
+ githubButtonLabel: string
42
+ twitterButtonLabel: string
43
+ }
44
+ showUserSource: any
45
+ signUpType: any
46
+ viaGoogle: boolean
47
+ viaGithub: boolean
48
+ viaTwitter: boolean
49
+ showNewsletterOption: boolean
50
+ showRefCode: boolean
51
+ showTermsOption: boolean
52
+ handleSignUp: any
53
+ handleRouteToSignIn: any
54
+ handleGoogleSignUp: any
55
+ handleGithubSignUp: any
56
+ handleTwitterSignUp: any
57
+ showError: any
58
+ errorTitle: any
59
+ errorText: any
60
+ }
61
+
62
+ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
63
+ const methods = useForm()
16
64
  const {
17
65
  formState: { errors },
18
66
  handleSubmit,
19
- control
20
- } = methods;
67
+ control,
68
+ } = methods
21
69
 
22
70
  return (
23
- <HawaContainer withDividers>
71
+ <HawaContainer>
24
72
  <div>
25
73
  {props.showError && (
26
74
  <HawaAlert
@@ -36,17 +84,17 @@ export const SignUpForm = (props) => {
36
84
  name="fullName"
37
85
  render={({ field }) => (
38
86
  <HawaTextField
39
- fullWidth
87
+ width="full"
40
88
  type="text"
41
- value={field.value ?? ""}
42
89
  label={props.texts.fullNameLabel}
43
90
  placeholder={props.texts.fullNamePlaceholder}
44
91
  helperText={errors.fullName?.message}
45
92
  {...field}
93
+ value={field.value ?? ""}
46
94
  />
47
95
  )}
48
96
  rules={{
49
- required: props.texts.fullNameRequiredText
97
+ required: props.texts.fullNameRequiredText,
50
98
  }}
51
99
  />
52
100
  {props.signUpType === "email" ? (
@@ -55,13 +103,13 @@ export const SignUpForm = (props) => {
55
103
  name="email"
56
104
  render={({ field }) => (
57
105
  <HawaTextField
58
- fullWidth
106
+ width="full"
59
107
  type="text"
60
- value={field.value ?? ""}
61
108
  label={props.texts.emailLabel}
62
109
  helperText={errors.email?.message}
63
110
  placeholder={props.texts.emailPlaceholder}
64
111
  {...field}
112
+ value={field.value ?? ""}
65
113
  />
66
114
  )}
67
115
  rules={{
@@ -69,8 +117,8 @@ export const SignUpForm = (props) => {
69
117
  pattern: {
70
118
  value:
71
119
  /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
72
- message: props.texts.emailInvalidText
73
- }
120
+ message: props.texts.emailInvalidText,
121
+ },
74
122
  }}
75
123
  />
76
124
  ) : (
@@ -79,17 +127,17 @@ export const SignUpForm = (props) => {
79
127
  name="username"
80
128
  render={({ field }) => (
81
129
  <HawaTextField
82
- fullWidth
130
+ width="full"
83
131
  type="text"
84
- value={field.value ?? ""}
85
132
  label={props.texts.usernameLabel}
86
133
  helperText={errors.username?.message}
87
134
  placeholder={props.texts.usernamePlaceholder}
88
135
  {...field}
136
+ value={field.value ?? ""}
89
137
  />
90
138
  )}
91
139
  rules={{
92
- required: props.texts.usernameRequired
140
+ required: props.texts.usernameRequired,
93
141
  }}
94
142
  />
95
143
  )}
@@ -98,14 +146,14 @@ export const SignUpForm = (props) => {
98
146
  name="password"
99
147
  render={({ field }) => (
100
148
  <HawaTextField
101
- fullWidth
149
+ width="full"
102
150
  type="password"
103
151
  defaultValue={field.value ?? ""}
104
- value={field.value ?? ""}
105
152
  label={props.texts.passwordLabel}
106
153
  placeholder={props.texts.passwordPlaceholder}
107
154
  helperText={errors.password?.message}
108
155
  {...field}
156
+ value={field.value ?? ""}
109
157
  />
110
158
  )}
111
159
  rules={{ required: props.texts.passwordRequiredText }}
@@ -115,14 +163,14 @@ export const SignUpForm = (props) => {
115
163
  name="confirm_password"
116
164
  render={({ field }) => (
117
165
  <HawaTextField
118
- fullWidth
166
+ width="full"
119
167
  type="password"
120
168
  defaultValue={field.value ?? ""}
121
- value={field.value ?? ""}
122
169
  label={props.texts.confirmPasswordLabel}
123
170
  placeholder={props.texts.confirmPasswordPlaceholder}
124
171
  helperText={errors.confirm_password?.message}
125
172
  {...field}
173
+ value={field.value ?? ""}
126
174
  />
127
175
  )}
128
176
  rules={{ required: props.texts.passwordRequiredText }}
@@ -133,14 +181,14 @@ export const SignUpForm = (props) => {
133
181
  name="password"
134
182
  render={({ field }) => (
135
183
  <HawaTextField
136
- fullWidth
184
+ width="full"
137
185
  type="text"
138
186
  defaultValue={field.value ?? ""}
139
- value={field.value ?? ""}
140
187
  label={"Ref Code"}
141
188
  placeholder={props.texts.passwordPlaceholder}
142
189
  helperText={errors.password?.message}
143
190
  {...field}
191
+ value={field.value ?? ""}
144
192
  />
145
193
  )}
146
194
  />
@@ -160,11 +208,13 @@ export const SignUpForm = (props) => {
160
208
  options={[
161
209
  { value: "friend", label: "From a friend" },
162
210
  { value: "ad", label: "Advertisement" },
163
- { value: "other", label: "Other" }
211
+ { value: "other", label: "Other" },
164
212
  ]}
165
- onChange={(e, o) => console.log("chooo", e)}
166
- onInputChange={(e, o) => console.log("changing", e)}
213
+ onInputChange={(e: any, o: any) =>
214
+ console.log("changing", e)
215
+ }
167
216
  {...field}
217
+ onChange={(e: any, o: any) => console.log("chooo", e)}
168
218
  />
169
219
  )}
170
220
  />
@@ -178,6 +228,7 @@ export const SignUpForm = (props) => {
178
228
  render={({ field }) => (
179
229
  <HawaCheckbox
180
230
  helperText={errors.terms_accepted?.message}
231
+ {...field}
181
232
  onChange={() => console.log("te")}
182
233
  label={
183
234
  <span>
@@ -187,7 +238,6 @@ export const SignUpForm = (props) => {
187
238
  </a>
188
239
  </span>
189
240
  }
190
- {...field}
191
241
  />
192
242
  )}
193
243
  rules={{ required: props.texts.termsRequiredText }}
@@ -208,14 +258,16 @@ export const SignUpForm = (props) => {
208
258
  />
209
259
  </div>
210
260
  )}
211
- <HawaButton fullWidth type="submit" text={props.texts.signUpText} />{" "}
261
+ <HawaButton color="primary" width="full" type="submit">
262
+ {props.texts.signUpText}
263
+ </HawaButton>
212
264
  </form>
213
265
  </FormProvider>
214
- <div className="font-semibold p-3 text-center text-sm">
266
+ <div className="p-3 text-center text-sm font-semibold">
215
267
  {props.texts.existingUserText}{" "}
216
268
  <span
217
269
  onClick={props.handleRouteToSignIn}
218
- className="text-blue-600 cursor-pointer"
270
+ className="cursor-pointer text-blue-600"
219
271
  >
220
272
  {props.texts.signInText}
221
273
  </span>
@@ -247,51 +299,5 @@ export const SignUpForm = (props) => {
247
299
  </div>
248
300
  ) : null}
249
301
  </HawaContainer>
250
- );
251
- };
252
-
253
- SignUpForm.propTypes = {
254
- /**
255
- * An object of all the texts in the blocks
256
- */
257
- texts: PropTypes.shape({
258
- fullNameLabel: PropTypes.string,
259
- fullNamePlaceholder: PropTypes.string,
260
- fullNameRequiredText: PropTypes.string,
261
- emailLabel: PropTypes.string,
262
- emailPlaceholder: PropTypes.string,
263
- emailRequiredText: PropTypes.string,
264
- emailInvalidText: PropTypes.string,
265
- usernameLabel: PropTypes.string,
266
- usernamePlaceholder: PropTypes.string,
267
- usernameRequired: PropTypes.string,
268
- passwordLabel: PropTypes.string,
269
- passwordPlaceholder: PropTypes.string,
270
- passwordRequiredText: PropTypes.string,
271
- passwordTooShortText: PropTypes.string,
272
- confirmPasswordLabel: PropTypes.string,
273
- confirmPasswordPlaceholder: PropTypes.string,
274
- forgotPasswordText: PropTypes.string,
275
- termsText: PropTypes.string,
276
- iAcceptText: PropTypes.string,
277
- termsRequiredText: PropTypes.string,
278
- newUserText: PropTypes.string,
279
- signUpText: PropTypes.string,
280
- signInText: PropTypes.string,
281
- existingUserText: PropTypes.string,
282
- googleButtonLabel: PropTypes.string,
283
- githubButtonLabel: PropTypes.string,
284
- twitterButtonLabel: PropTypes.string
285
- }),
286
- viaGoogle: PropTypes.bool,
287
- viaGithub: PropTypes.bool,
288
- viaTwitter: PropTypes.bool,
289
- showNewsletterOption: PropTypes.bool,
290
- showRefCode: PropTypes.bool,
291
- showTermsOption: PropTypes.bool,
292
- handleSignUp: PropTypes.func,
293
- handleRouteToSignIn: PropTypes.func,
294
- handleGoogleSignUp: PropTypes.func,
295
- handleGithubSignUp: PropTypes.func,
296
- handleTwitterSignUp: PropTypes.func
297
- };
302
+ )
303
+ }
@@ -0,0 +1,7 @@
1
+ export * from "./AppLanding";
2
+ export * from "./SignInPhone";
3
+ export * from "./SignInForm";
4
+ export * from "./SignUpForm";
5
+ export * from "./NewPasswordForm";
6
+ export * from "./ResetPasswordForm";
7
+ export * from "./CodeConfirmation";
@@ -0,0 +1,28 @@
1
+ import React from "react"
2
+ import { HawaButton } from "../../elements"
3
+ import { HawaContainer } from "../../layout"
4
+
5
+ type NotFoundTypes = {}
6
+
7
+ export const NotFound: React.FunctionComponent<NotFoundTypes> = (props) => {
8
+ return (
9
+ <div
10
+ style={{
11
+ display: "flex",
12
+ flexDirection: "column",
13
+ alignItems: "center",
14
+ }}
15
+ >
16
+ <div className="text-6xl font-bold">404</div>
17
+ <div className="m-2 text-xl font-bold">Page Not Found</div>
18
+ <HawaContainer>
19
+ <div className="text-center">
20
+ If you're lost please contact us help@sikka.io{" "}
21
+ </div>
22
+ <HawaButton color="primary" width="full">
23
+ Home
24
+ </HawaButton>
25
+ </HawaContainer>
26
+ </div>
27
+ )
28
+ }
@@ -0,0 +1 @@
1
+ export * from "./NotFound";