@sikka/hawa 0.0.95 → 0.0.97

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 +19 -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,9 +1,16 @@
1
- import React from "react";
2
- import { Controller, useFormContext } from "react-hook-form";
1
+ import React from "react"
2
+ import { Controller, useFormContext } from "react-hook-form"
3
3
 
4
- export const AutoCompleteField = (props) => {
5
- const { control } = useFormContext();
6
- const { name, rules, shouldUnregister } = props;
4
+ type TAutoCompleteFieldTypes = {
5
+ name: string
6
+ rules: any
7
+ shouldUnregister: boolean
8
+ }
9
+ export const AutoCompleteField: React.FunctionComponent<
10
+ TAutoCompleteFieldTypes
11
+ > = (props) => {
12
+ const { control } = useFormContext()
13
+ const { name, rules, shouldUnregister } = props
7
14
 
8
15
  return (
9
16
  <React.Fragment>
@@ -12,7 +19,7 @@ export const AutoCompleteField = (props) => {
12
19
  rules={rules}
13
20
  control={control}
14
21
  shouldUnregister={shouldUnregister}
15
- className="theme_form_input"
22
+ // className="theme_form_input"
16
23
  render={({ field: { onChange, value } }) => {
17
24
  return (
18
25
  <input type="text" />
@@ -24,9 +31,9 @@ export const AutoCompleteField = (props) => {
24
31
  // {...props}
25
32
  // className={"theme_form_input"}
26
33
  // />
27
- );
34
+ )
28
35
  }}
29
36
  />
30
37
  </React.Fragment>
31
- );
32
- };
38
+ )
39
+ }
@@ -1,16 +1,30 @@
1
- import React, { useEffect, useState } from "react";
2
- import { useDropzone } from "react-dropzone";
3
- import { HawaAlert } from "./HawaAlert";
4
- import { HawaButton } from "./HawaButton";
1
+ import React, { useEffect, useState } from "react"
2
+ import { useDropzone } from "react-dropzone"
3
+ import { HawaAlert } from "./HawaAlert"
4
+ import { HawaButton } from "./HawaButton"
5
5
 
6
6
  const thumbsContainer = {
7
7
  display: "flex",
8
8
  flexDirection: "row",
9
9
  flexWrap: "wrap",
10
- marginTop: 10
11
- };
10
+ marginTop: 10,
11
+ }
12
+ type DragDropImagesTypes = {
13
+ texts: any
14
+ files: [File]
15
+ setFiles: any
16
+ setDeletedFiles: any
17
+ maxFiles: number
18
+ accept: any
19
+ onAcceptedFiles: any
20
+ showPreview: any
21
+ onDeleteFile: any
22
+ onClearFiles: any
23
+ maxSize: number
24
+ errorMessages: string
25
+ }
12
26
 
13
- export const DragDropImages = ({
27
+ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
14
28
  texts,
15
29
  files,
16
30
  setFiles,
@@ -22,19 +36,19 @@ export const DragDropImages = ({
22
36
  onDeleteFile,
23
37
  onClearFiles,
24
38
  maxSize,
25
- errorMessages
39
+ errorMessages,
26
40
  }) =>
27
41
  // props
28
42
  {
29
- const [cmp, setCmp] = useState(0);
30
- const [max, setMax] = useState(0);
43
+ const [cmp, setCmp] = useState(0)
44
+ const [max, setMax] = useState<any>(0)
31
45
  //const [thumbs, setThumbs] = useState("");
32
46
  const {
33
47
  getRootProps,
34
48
  getInputProps,
35
49
  fileRejections,
36
50
  acceptedFiles,
37
- isDragActive
51
+ isDragActive,
38
52
  } = useDropzone({
39
53
  multiple: true,
40
54
  accept: accept,
@@ -44,66 +58,66 @@ export const DragDropImages = ({
44
58
  setFiles(
45
59
  acceptedFiles.map((file, index) =>
46
60
  Object.assign(file, {
47
- preview: URL.createObjectURL(file)
61
+ preview: URL.createObjectURL(file),
48
62
  })
49
63
  )
50
- );
51
- }
52
- });
64
+ )
65
+ },
66
+ })
53
67
  useEffect(
54
68
  () => () => {
55
- files?.forEach((file) => {
56
- URL.revokeObjectURL(file.preview);
57
- });
69
+ files?.forEach((file: any) => {
70
+ URL.revokeObjectURL(file.preview)
71
+ })
58
72
  },
59
73
  [files]
60
- );
74
+ )
61
75
 
62
76
  useEffect(() => {
63
- setFiles(acceptedFiles);
64
- }, [acceptedFiles, cmp]);
77
+ setFiles(acceptedFiles)
78
+ }, [acceptedFiles, cmp])
65
79
 
66
80
  onClearFiles = () => {
67
- acceptedFiles.length = 0;
68
- acceptedFiles.splice(0, acceptedFiles.length);
69
- setFiles([]);
70
- };
81
+ acceptedFiles.length = 0
82
+ acceptedFiles.splice(0, acceptedFiles.length)
83
+ setFiles([])
84
+ }
71
85
 
72
86
  useEffect(() => {
73
87
  if (maxSize > 0) {
74
- const k = 1024;
75
- const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
76
- const i = Math.floor(Math.log(maxSize) / Math.log(1024));
88
+ const k = 1024
89
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
90
+ const i = Math.floor(Math.log(maxSize) / Math.log(1024))
77
91
 
78
92
  setMax(
79
93
  parseFloat((maxSize / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]
80
- );
94
+ )
81
95
  }
82
- }, [maxSize]);
96
+ }, [maxSize])
83
97
  const errs = fileRejections.map((rej, i) => {
84
98
  return (
85
99
  <div key={i}>
86
100
  <div>{rej.file.name}</div>
87
101
  <div>{rej.errors[0].code}</div>
88
102
  </div>
89
- );
90
- });
91
- const thumbs = files?.map((file, index) => (
103
+ )
104
+ })
105
+ const thumbs = files?.map((file: any, index: any) => (
92
106
  <div style={{ position: "relative", margin: 10 }}>
93
107
  <button
94
108
  onClick={(e) => {
95
- e.stopPropagation();
96
- acceptedFiles.splice(acceptedFiles.indexOf(file), 1);
97
- setCmp(Math.random);
98
- onDeleteFile(file);
109
+ e.stopPropagation()
110
+ acceptedFiles.splice(acceptedFiles.indexOf(file), 1)
111
+ setCmp(Math.random)
112
+ onDeleteFile(file)
99
113
  }}
100
114
  type="button"
101
- className="text-gray-400 absolute left-0 bg-gray-900 hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
115
+ className="absolute left-0 ml-auto inline-flex items-center rounded-lg bg-gray-900 p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"
102
116
  data-modal-toggle="defaultModal"
103
117
  >
104
118
  <svg
105
119
  aria-hidden="true"
106
- className="w-5 h-5"
120
+ className="h-5 w-5"
107
121
  fill="currentColor"
108
122
  viewBox="0 0 20 20"
109
123
  xmlns="http://www.w3.org/2000/svg"
@@ -128,41 +142,52 @@ export const DragDropImages = ({
128
142
  backgroundImage: `url(${file.preview})`,
129
143
  backgroundSize: "cover",
130
144
  backgroundPosition: "center",
131
- border: "1px solid black"
145
+ border: "1px solid black",
132
146
  }}
133
147
  key={file.name}
134
148
  />
135
149
  </div>
136
- ));
150
+ ))
137
151
 
138
- console.log("error", fileRejections);
152
+ console.log("error", fileRejections)
139
153
 
140
154
  return (
141
155
  <div
142
156
  // variant="drop-area"
143
157
  {...getRootProps({
144
- style: { backgroundColor: isDragActive && "white" }
158
+ //fix type error
159
+ // style: { backgroundColor: isDragActive && "white" },
145
160
  })}
146
- className="border-black border border-dashed rounded-xl flex flex-col justify-center"
161
+ className="flex flex-col justify-center rounded-xl border border-dashed border-black"
147
162
  >
148
163
  <input {...getInputProps()} />
149
- <div className="text-center p-1">
164
+ <div className="p-1 text-center">
150
165
  Click here or drop files here to upload
151
166
  </div>
152
- <div className="text-center p-1">Max file size is {max}</div>
167
+ <div className="p-1 text-center">Max file size is {max}</div>
153
168
  {acceptedFiles.length > 0 && (
154
169
  <HawaButton
155
170
  style={{ color: "black" }}
156
171
  onClick={(e) => {
157
- e.stopPropagation();
158
- onClearFiles(acceptedFiles);
172
+ e.stopPropagation()
173
+ onClearFiles(acceptedFiles)
159
174
  }}
160
- text={"Clear All"}
161
- />
175
+ >
176
+ Clear All
177
+ </HawaButton>
162
178
  )}
163
179
 
164
180
  {thumbs && showPreview ? (
165
- <aside style={thumbsContainer}>{thumbs}</aside>
181
+ <aside
182
+ style={{
183
+ display: "flex",
184
+ flexDirection: "row",
185
+ flexWrap: "wrap",
186
+ marginTop: 10,
187
+ }}
188
+ >
189
+ {thumbs}
190
+ </aside>
166
191
  ) : null}
167
192
  {fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
168
193
  <HawaAlert text={texts.tooManyFiles} severity="error" />
@@ -173,5 +198,5 @@ export const DragDropImages = ({
173
198
  )}
174
199
  {}
175
200
  </div>
176
- );
177
- };
201
+ )
202
+ }
@@ -0,0 +1,29 @@
1
+ import React from "react"
2
+ type DraggableCardTypes = {
3
+ children: any
4
+ }
5
+
6
+ export const DraggableCard: React.FunctionComponent<DraggableCardTypes> = (
7
+ props
8
+ ) => {
9
+ return (
10
+ <div className="flex flex-row rounded-xl bg-blue-300 p-4">
11
+ <button
12
+ className="inline-flex items-center rounded-lg bg-white p-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-50 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-600"
13
+ type="button"
14
+ >
15
+ <svg
16
+ className="h-6 w-6"
17
+ aria-hidden="true"
18
+ fill="currentColor"
19
+ viewBox="0 0 20 20"
20
+ xmlns="http://www.w3.org/2000/svg"
21
+ >
22
+ <path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path>
23
+ </svg>
24
+ </button>
25
+
26
+ <div className="p-4">{props.children}</div>
27
+ </div>
28
+ )
29
+ }
@@ -1,18 +1,23 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
1
+ import React from "react"
3
2
 
4
- const AccordionItem = (props) => {
5
- const [collapse, setCollapse] = React.useState(false);
3
+ type AccordionItemTypes = {
4
+ title: any
5
+ count: any
6
+ content: any
7
+ }
8
+
9
+ const AccordionItem: React.FunctionComponent<AccordionItemTypes> = (props) => {
10
+ const [collapse, setCollapse] = React.useState(false)
6
11
  let noRounding =
7
- "flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white";
12
+ "flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white"
8
13
  let roundedTop =
9
- "rounded-t-xl border-b-0 flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white";
14
+ "rounded-t-xl border-b-0 flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white"
10
15
  let roundedBottom =
11
- "rounded-b-xl border-t-0 flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white";
16
+ "rounded-b-xl border-t-0 flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white"
12
17
  let accPaper =
13
- "p-5 font-light border border-b-xl border-gray-200 dark:border-gray-700 dark:bg-gray-900";
18
+ "p-5 font-light border border-b-xl border-gray-200 dark:border-gray-700 dark:bg-gray-900"
14
19
  let accPaperRounded =
15
- "p-5 font-light border border-b-xl rounded-b-xl border-gray-200 dark:border-gray-700 dark:bg-gray-900";
20
+ "p-5 font-light border border-b-xl rounded-b-xl border-gray-200 dark:border-gray-700 dark:bg-gray-900"
16
21
  return (
17
22
  <div>
18
23
  <h2 id={"accordion-collapse-heading-" + props.count}>
@@ -27,7 +32,7 @@ const AccordionItem = (props) => {
27
32
  <span>{props.title}</span>
28
33
  <svg
29
34
  data-accordion-icon=""
30
- className={`w-6 h-6 ${collapse ? "" : "rotate-180"} shrink-0`}
35
+ className={`h-6 w-6 ${collapse ? "" : "rotate-180"} shrink-0`}
31
36
  fill="currentColor"
32
37
  viewBox="0 0 20 20"
33
38
  xmlns="http://www.w3.org/2000/svg"
@@ -52,26 +57,25 @@ const AccordionItem = (props) => {
52
57
  </div>
53
58
  </div>
54
59
  </div>
55
- );
56
- };
57
- export const HawaAccordian = (props) => {
60
+ )
61
+ }
62
+ type AccordionTypes = {
63
+ content: any
64
+ }
65
+ export const HawaAccordian: React.FunctionComponent<AccordionTypes> = (
66
+ props
67
+ ) => {
58
68
  return (
59
69
  <div id="accordion-collapse" data-accordion="collapse">
60
- {props.content.map((acc, i) => {
70
+ {props.content.map((acc: any, i: any) => {
61
71
  return (
62
72
  <AccordionItem
63
73
  title={acc.title}
64
74
  content={acc.content}
65
75
  count={props.content.length - 1 === i ? -1 : i}
66
76
  />
67
- );
77
+ )
68
78
  })}
69
79
  </div>
70
- );
71
- };
72
- HawaAccordian.propTypes = {
73
- content: PropTypes.shape({
74
- title: PropTypes.string,
75
- content: PropTypes.string
76
- })
77
- };
80
+ )
81
+ }
@@ -0,0 +1,48 @@
1
+ import React from "react"
2
+
3
+ type AdCardTypes = {
4
+ orientation: "vertical" | "horizontal"
5
+ title: string
6
+ description: string
7
+ imageURL: string
8
+ handleHide: any
9
+ }
10
+ export const HawaAdCard: React.FunctionComponent<AdCardTypes> = ({
11
+ orientation,
12
+ ...props
13
+ }) => {
14
+ let cardStyles = {
15
+ horizontal:
16
+ "flex max-w-xl rounded-lg border-gray-200 bg-gray-100 shadow-md dark:border-gray-700 dark:bg-gray-800 ",
17
+ vertical:
18
+ "flex max-w-xs rounded-lg border-gray-200 bg-gray-100 shadow-md dark:border-gray-700 dark:bg-gray-800 ",
19
+ }
20
+
21
+ let imageStyles = {
22
+ horizontal: "w-8 h-8 rounded-lg",
23
+ vertical: "w-14 h-14 rounded-lg",
24
+ }
25
+
26
+ return (
27
+ <div className={cardStyles[orientation]} {...props}>
28
+ <div className=" m-2 mr-0 flex w-full max-w-fit items-center">
29
+ <img
30
+ src={
31
+ props.imageURL ? props.imageURL : "https://via.placeholder.com/50"
32
+ }
33
+ className={imageStyles[orientation]}
34
+ />
35
+ </div>
36
+ <div className="w-full p-2 text-xs">
37
+ <div className="font-bold">{props.title}</div>
38
+ <div>{props.description}</div>
39
+ </div>
40
+ <span
41
+ onClick={props.handleHide}
42
+ className="h-fit rounded-bl-lg rounded-tr-lg bg-blue-100 px-2.5 py-0.5 text-[10px] font-semibold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
43
+ >
44
+ Hide
45
+ </span>
46
+ </div>
47
+ )
48
+ }
@@ -0,0 +1,30 @@
1
+ import React from "react"
2
+ import clsx from "clsx"
3
+
4
+ let severities = {
5
+ info: "text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
6
+ warning:
7
+ "text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
8
+ error: "text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
9
+ success: "text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
10
+ }
11
+ type AlertTypes = {
12
+ severity: keyof typeof severities
13
+ title?: any
14
+ text: any
15
+ hideIcon?: any
16
+ }
17
+ export const HawaAlert: React.FunctionComponent<AlertTypes> = (props) => {
18
+ return (
19
+ <div
20
+ className={clsx(
21
+ "mb-4 flex flex-col rounded-lg p-4 text-sm",
22
+ severities[props.severity]
23
+ )}
24
+ role="alert"
25
+ >
26
+ <span className="font-medium">{props.title}</span>
27
+ <span>{" " + props.text}</span>
28
+ </div>
29
+ )
30
+ }
@@ -0,0 +1,120 @@
1
+ import * as React from "react"
2
+ import clsx from "clsx"
3
+
4
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: "contained" | "outlined"
6
+ color?: "default" | "primary" | "secondary"
7
+ width?: "full" | "normal" | "half"
8
+ size?: "small" | "medium" | "large"
9
+ tooltip?: string
10
+ isLoading?: boolean
11
+ }
12
+
13
+ const baseStyles = "font-medium rounded-lg"
14
+
15
+ const sizeStyles = {
16
+ small: "text-xs px-2.5 py-1.5",
17
+ medium: "text-sm leading-4 px-3 py-2",
18
+ large: "text-sm px-4 py-2",
19
+ }
20
+
21
+ const widthStyles = {
22
+ full: "w-full flex justify-center px-5 py-2.5 text-center inline-flex items-center",
23
+ normal:
24
+ "w-fit dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",
25
+ half: "w-1/2",
26
+ }
27
+ const variantStyles = {
28
+ contained: "border border-transparent",
29
+ outlined: "bg-transparent border",
30
+ }
31
+
32
+ const colorStyles = {
33
+ contained: {
34
+ default: "text-neutral-900 bg-gray-200 hover:bg-gray-300",
35
+ primary:
36
+ "text-white bg-primary-default hover:bg-primary-700 hover:text-white",
37
+ secondary:
38
+ "text-neutral-900 bg-secondary-default hover:bg-secondary-700 hover:text-white",
39
+ },
40
+ outlined: {
41
+ default: "text-gray-600 border-gray-600 hover:bg-gray-200",
42
+ primary: "text-black hover:bg-gray-50",
43
+ secondary: "text-secondary-800 border-secondary-800 hover:bg-secondary-100",
44
+ },
45
+ }
46
+
47
+ const disabledSyles = "cursor-default pointer-events-none"
48
+ const disabledVariantSyles = {
49
+ contained: "text-gray-300 bg-gray-100",
50
+ outlined: "text-gray-300 border-gray-300",
51
+ }
52
+
53
+ export function HawaButton({
54
+ className,
55
+ variant = "contained",
56
+ color = "default",
57
+ size = "medium",
58
+ width = "normal",
59
+ disabled = false,
60
+ isLoading = false,
61
+ tooltip,
62
+ children,
63
+ ...props
64
+ }: ButtonProps) {
65
+ const [isHovered, setIsHovered] = React.useState(false)
66
+
67
+ const buttonClass = disabled
68
+ ? clsx(
69
+ className,
70
+ baseStyles,
71
+ variantStyles[variant],
72
+ sizeStyles[size],
73
+ widthStyles[width],
74
+ disabledSyles,
75
+ disabledVariantSyles[variant]
76
+ )
77
+ : clsx(
78
+ className,
79
+ baseStyles,
80
+ variantStyles[variant],
81
+ sizeStyles[size],
82
+ colorStyles[variant][color],
83
+ widthStyles[width]
84
+ )
85
+
86
+ return (
87
+ <div className="relative my-2">
88
+ <button
89
+ onMouseEnter={() => {
90
+ setIsHovered(true)
91
+ }}
92
+ onMouseLeave={() => {
93
+ setIsHovered(false)
94
+ }}
95
+ className={buttonClass}
96
+ disabled={disabled}
97
+ {...props}
98
+ >
99
+ {!isLoading ? (
100
+ children
101
+ ) : (
102
+ <div className="flex flex-row gap-x-3">
103
+ <div className="h-5 w-5 animate-spin rounded-full border-2 border-gray-400 border-t-white text-white"></div>
104
+ </div>
105
+ )}
106
+ </button>
107
+ {tooltip && (
108
+ <div
109
+ className={
110
+ isHovered
111
+ ? "absolute top-10 left-0 z-10 inline-block w-fit min-w-max max-w-xs rounded-lg bg-gray-900 py-2 px-3 text-center text-sm font-medium text-white opacity-100 shadow-sm transition-opacity duration-300 dark:bg-gray-700"
112
+ : "absolute top-10 left-0 z-10 inline-block w-fit min-w-max max-w-xs rounded-lg bg-gray-900 py-2 px-3 text-center text-sm font-medium text-white opacity-0 shadow-sm transition-opacity duration-300 dark:bg-gray-700"
113
+ }
114
+ >
115
+ {tooltip}
116
+ </div>
117
+ )}
118
+ </div>
119
+ )
120
+ }
@@ -0,0 +1,37 @@
1
+ import React from "react"
2
+
3
+ type CheckoutTypes = {
4
+ centered?: any
5
+ label?: any
6
+ helperText?: any
7
+ onChange?: any
8
+ }
9
+
10
+ export const HawaCheckbox: React.FunctionComponent<CheckoutTypes> = (props) => {
11
+ return (
12
+ <div
13
+ className={props.centered ? "flex h-full items-center" : "flex h-full"}
14
+ >
15
+ <input
16
+ type="checkbox"
17
+ value=""
18
+ className="h-5 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800 dark:focus:ring-blue-600"
19
+ {...props}
20
+ />
21
+ {(props.label || props.helperText) && (
22
+ <div className="items-stat flex flex-col">
23
+ {props.label && (
24
+ <label className="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">
25
+ {props.label}
26
+ </label>
27
+ )}
28
+ {props.helperText && (
29
+ <p className="mx-2 mt-1 text-xs text-red-600 dark:text-red-500">
30
+ {props.helperText}
31
+ </p>
32
+ )}
33
+ </div>
34
+ )}
35
+ </div>
36
+ )
37
+ }
@@ -0,0 +1,12 @@
1
+ import React from "react"
2
+
3
+ type ChipTypes = {
4
+ label: any
5
+ }
6
+ export const HawaChip: React.FunctionComponent<ChipTypes> = (props) => {
7
+ return (
8
+ <span className="mr-2 h-fit rounded bg-blue-100 px-2.5 py-0.5 text-xs font-semibold text-blue-800 dark:bg-blue-200 dark:text-blue-800">
9
+ {props.label}
10
+ </span>
11
+ )
12
+ }
@@ -0,0 +1,38 @@
1
+ import React, { useState } from "react"
2
+
3
+ type ColorPickerTypes = {
4
+ color?: any
5
+ handleChange?: any
6
+ }
7
+
8
+ export const HawaColorPicker: React.FunctionComponent<ColorPickerTypes> = (
9
+ props
10
+ ) => {
11
+ const [selectedColor, setSelectedColor] = useState(props.color)
12
+ return (
13
+ <div className={`flex w-fit flex-row p-0`}>
14
+ <div
15
+ style={{ backgroundColor: selectedColor }}
16
+ className="rounded-tl-lg rounded-bl-lg"
17
+ >
18
+ <input
19
+ type="color"
20
+ value={selectedColor}
21
+ onChange={(e) => {
22
+ setSelectedColor(e.target.value)
23
+ props.handleChange(e.target.value)
24
+ }}
25
+ className="opacity-0"
26
+ />
27
+ </div>
28
+
29
+ <input
30
+ type="text"
31
+ value={selectedColor}
32
+ className="w-24 rounded-tr-lg rounded-br-lg pr-2 pl-2"
33
+ />
34
+ </div>
35
+ )
36
+ }
37
+
38
+