@sikka/hawa 0.0.94 → 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.30019f92.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 -59
  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.c9ced472.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.30019f92.iframe.bundle.js +0 -3
  173. package/storybook-static/vendors~main.30019f92.iframe.bundle.js.map +0 -1
  174. package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +0 -2
@@ -1,23 +1,36 @@
1
- import React, { useState } from "react";
1
+ import React, { useState } from "react"
2
2
 
3
- import PropTypes from "prop-types";
4
-
5
- export const HawaPanelTabs = (props) => {
6
- const [value, setValue] = useState(props.defaultValue);
3
+ type PanelTabsTypes = {
4
+ defaultValue: any
5
+ options: any
6
+ // options: PropTypes.arrayOf(
7
+ // PropTypes.shape({
8
+ // label: PropTypes.string,
9
+ // value: PropTypes.string,
10
+ // })
11
+ // ),
12
+ lang: any
13
+ handleChange: any
14
+ location: any
15
+ }
16
+ export const HawaPanelTabs: React.FunctionComponent<PanelTabsTypes> = (
17
+ props
18
+ ) => {
19
+ const [value, setValue] = useState(props.defaultValue)
7
20
  return (
8
21
  <div>
9
22
  <div className="mb-4 border-b border-gray-200 dark:border-gray-700">
10
23
  <ul
11
- className="flex flex-wrap -mb-px text-sm font-medium text-center"
24
+ className="-mb-px flex flex-wrap text-center text-sm font-medium"
12
25
  id="myTab"
13
26
  data-tabs-toggle="#myTabContent"
14
27
  role="tablist"
15
28
  >
16
- {props.options.map((option) => {
29
+ {props.options.map((option: any) => {
17
30
  return (
18
31
  <li className="mr-2" role="presentation">
19
32
  <button
20
- className="inline-block p-4 rounded-t-lg border-b-2 text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500"
33
+ className="inline-block rounded-t-lg border-b-2 border-blue-600 p-4 text-blue-600 hover:text-blue-600 dark:border-blue-500 dark:text-blue-500 dark:hover:text-blue-500"
21
34
  id={`${option.value}-tab`}
22
35
  data-tabs-target={`#${option.value}`}
23
36
  type="button"
@@ -28,37 +41,24 @@ export const HawaPanelTabs = (props) => {
28
41
  {option.label}
29
42
  </button>
30
43
  </li>
31
- );
44
+ )
32
45
  })}
33
46
  </ul>
34
47
  </div>
35
48
  <div id="myTabContent">
36
- {props.options.map((option) => {
49
+ {props.options.map((option: any) => {
37
50
  return (
38
51
  <div
39
- className="p-4 bg-gray-50 rounded-lg dark:bg-gray-800"
52
+ className="rounded-lg bg-gray-50 p-4 dark:bg-gray-800"
40
53
  id={option.value}
41
54
  role="tabpanel"
42
55
  aria-labelledby={`${option.value}-tab`}
43
56
  >
44
57
  {option.content}
45
58
  </div>
46
- );
59
+ )
47
60
  })}
48
61
  </div>
49
62
  </div>
50
- );
51
- };
52
-
53
- HawaPanelTabs.propTypes = {
54
- lang: PropTypes.string,
55
- options: PropTypes.arrayOf(
56
- PropTypes.shape({
57
- label: PropTypes.string,
58
- value: PropTypes.string
59
- })
60
- ),
61
- defaultValue: PropTypes.string,
62
- handleChange: PropTypes.func,
63
- location: PropTypes.string
64
- };
63
+ )
64
+ }
@@ -0,0 +1,112 @@
1
+ import { useState } from "react"
2
+ import Countries from "../countries"
3
+ import Select from "react-select"
4
+
5
+ type OptionTypes = {
6
+ cx: any
7
+ data: any
8
+ children: any
9
+ getStyles: any
10
+ innerProps: any
11
+ innerRef: any
12
+ }
13
+ const Option: React.FunctionComponent<OptionTypes> = ({
14
+ cx,
15
+ children,
16
+ getStyles,
17
+ innerProps,
18
+ innerRef,
19
+ ...props
20
+ }) => (
21
+ <div
22
+ ref={innerRef}
23
+ className="m-2 flex flex-row items-center justify-between rounded-lg p-1 px-3 hover:bg-blue-200"
24
+ {...innerProps}
25
+ >
26
+ <img className="h-8 w-8" src={props.data.image}></img>
27
+ {children}
28
+ </div>
29
+ )
30
+
31
+ type HawaPhoneInputTypes = {
32
+ preferredCountry?: any
33
+ helperText?: any
34
+ label?: string
35
+ value?: any
36
+ country?: any
37
+ handleChange?: any
38
+ }
39
+ export const HawaPhoneInput: React.FunctionComponent<HawaPhoneInputTypes> = (
40
+ props
41
+ ) => {
42
+ const [selectedCountry, setSelectedCountry] = useState("+966")
43
+
44
+ return (
45
+ <div className="mb-3 flex flex-col">
46
+ {props.label && (
47
+ <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
48
+ {props.label}
49
+ </label>
50
+ )}
51
+ <div className="flex flex-row">
52
+ <Select
53
+ styles={{
54
+ input: (base) => ({
55
+ ...base,
56
+ fontSize: "0.875rem",
57
+ "input:focus": {
58
+ boxShadow: "none",
59
+ },
60
+ lineHeight: "1.25rem",
61
+ padding: "0.37rem",
62
+ }),
63
+ singleValue: (base) => ({
64
+ ...base,
65
+ fontSize: "0.875rem",
66
+ textAlign: "right",
67
+ }),
68
+ control: (base) => ({
69
+ ...base,
70
+ width: 64,
71
+ borderRadius: "0.5rem",
72
+ borderTopRightRadius: 0,
73
+ borderBottomRightRadius: 0,
74
+ }),
75
+ menu: (base) => ({
76
+ ...base,
77
+ width: 190,
78
+ borderRadius: "0.5rem",
79
+ }),
80
+ }}
81
+ components={{
82
+ Option,
83
+ DropdownIndicator: () => null,
84
+ IndicatorSeparator: () => null,
85
+ }}
86
+ options={Countries}
87
+ // isCreatable={false}
88
+ isMulti={false}
89
+ isSearchable={true}
90
+ isClearable={false}
91
+ placeholder="+966"
92
+ defaultValue={props.preferredCountry}
93
+ value={selectedCountry}
94
+ onChange={(newValue, action) => {
95
+ console.log("test n", newValue)
96
+ setSelectedCountry(newValue)
97
+ }}
98
+ />
99
+ <input
100
+ onChange={props.handleChange}
101
+ type="number"
102
+ className="block w-full appearance-none rounded-lg rounded-l-none border border-l-0 border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
103
+ />
104
+ {props.helperText && (
105
+ <p className="mb-1 mt-1 text-xs text-red-600 dark:text-red-500">
106
+ {props.helperText}
107
+ </p>
108
+ )}
109
+ </div>
110
+ </div>
111
+ )
112
+ }
@@ -1,53 +1,106 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
1
+ import React from "react"
3
2
 
4
- export const HawaPricingCard = (props) => {
5
- let isArabic = props.lang === "ar";
6
- let cycleTextsArabic = {
3
+ type PricingCardTypes = {
4
+ lang: "ar" | "en"
5
+ features: [any]
6
+ features_ar: [any]
7
+ title: string
8
+ title_ar: string
9
+ price: number
10
+ currency: string
11
+ buttonText: string
12
+ cycleText: string
13
+ size: "small" | "medium" | "large"
14
+ }
15
+ type CycleTextTypes = {
16
+ monthly: string
17
+ "3-months": string
18
+ "6-months": string
19
+ annually: string
20
+ }
21
+ type CurrencyTextTypes = {
22
+ usd: string
23
+ sar: string
24
+ }
25
+ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
26
+ props
27
+ ) => {
28
+ let isArabic = props.lang === "ar"
29
+ let cycleTextsArabic: CycleTextTypes = {
7
30
  monthly: "شهرياً",
8
31
  "3-months": "كل 3 أشهر",
9
32
  "6-months": "كل 6 أشهر",
10
- annually: "سنوياً"
11
- };
12
- let cycleTextsEnglish = {
33
+ annually: "سنوياً",
34
+ }
35
+ let cycleTextsEnglish: CycleTextTypes = {
13
36
  monthly: "Monthly",
14
37
  "3-months": "3 Months",
15
38
  "6-months": "6 Months",
16
- annually: "Annually"
17
- };
18
- let currencyMapping = {
39
+ annually: "Annually",
40
+ }
41
+ let currencyMapping: CurrencyTextTypes = {
19
42
  usd: isArabic ? "دولار" : "$",
20
- sar: isArabic ? "ريال" : "SAR"
21
- };
22
- let featuresMapping = isArabic ? props.features_ar : props.features;
23
- let chipSpacing = isArabic ? { left: 10 } : { right: 10 };
43
+ sar: isArabic ? "ريال" : "SAR",
44
+ }
45
+ let featuresMapping = isArabic ? props.features_ar : props.features
46
+ let chipSpacing = isArabic ? { left: 10 } : { right: 10 }
47
+ let cardSizes = {
48
+ small:
49
+ "mx-1 w-full max-w-fit rounded-lg border bg-white p-4 shadow-md dark:border-gray-700 dark:bg-gray-800 sm:p-8",
50
+ medium:
51
+ "mx-1 w-full max-w-md rounded-lg border bg-white p-4 shadow-md dark:border-gray-700 dark:bg-gray-800 sm:p-8",
52
+ large:
53
+ "mx-1 w-full max-w-lg rounded-lg border bg-white p-4 shadow-md dark:border-gray-700 dark:bg-gray-800 sm:p-8",
54
+ }
24
55
  return (
25
- <div className="mx-1 p-4 w-full max-w-sm bg-white rounded-lg border shadow-md sm:p-8 dark:bg-gray-800 dark:border-gray-700">
56
+ <div dir={isArabic ? "rtl" : "ltr"} className={cardSizes[props.size]}>
26
57
  <h5 className="mb-4 text-xl font-medium text-gray-500 dark:text-gray-400">
27
58
  {isArabic ? props.title_ar : props.title}
28
59
  </h5>
29
60
  <div className="flex items-baseline text-gray-900 dark:text-white">
30
- <span className="font-semibold text-sm">
31
- {" "}
32
- {currencyMapping[props.currency?.toLowerCase()]}
33
- </span>
34
- <span className="text-5xl font-extrabold tracking-tight">
35
- {props.price}
36
- </span>
61
+ {isArabic ? (
62
+ <>
63
+ <span className="text-5xl font-extrabold tracking-tight">
64
+ {props.price}
65
+ </span>
66
+ <span className="mx-1 text-sm font-semibold">
67
+ {" "}
68
+ {
69
+ currencyMapping[
70
+ props.currency?.toLowerCase() as keyof CurrencyTextTypes
71
+ ]
72
+ }
73
+ </span>
74
+ </>
75
+ ) : (
76
+ <>
77
+ <span className="text-sm font-semibold">
78
+ {" "}
79
+ {
80
+ currencyMapping[
81
+ props.currency?.toLowerCase() as keyof CurrencyTextTypes
82
+ ]
83
+ }
84
+ </span>
85
+ <span className="mx-1 text-5xl font-extrabold tracking-tight">
86
+ {props.price}
87
+ </span>
88
+ </>
89
+ )}
37
90
  <span className="ml-1 text-xl font-normal text-gray-500 dark:text-gray-400">
38
91
  /{" "}
39
92
  {isArabic
40
- ? cycleTextsArabic[props.cycleText]
41
- : cycleTextsEnglish[props.cycleText]}
93
+ ? cycleTextsArabic[props.cycleText as keyof CycleTextTypes]
94
+ : cycleTextsEnglish[props.cycleText as keyof CycleTextTypes]}
42
95
  </span>
43
96
  </div>
44
- <ul role="list" className="my-7 space-y-5">
97
+ <ul role="list" className="my-7 space-y-0">
45
98
  {featuresMapping?.map((feature) => {
46
99
  return (
47
- <li className="flex space-x-3">
100
+ <li className="flex ">
48
101
  <svg
49
102
  aria-hidden="true"
50
- className="flex-shrink-0 w-5 h-5 text-blue-600 dark:text-blue-500"
103
+ className="m-2 h-5 w-5 flex-shrink-0 text-blue-600 dark:text-blue-500"
51
104
  fill="currentColor"
52
105
  viewBox="0 0 20 20"
53
106
  xmlns="http://www.w3.org/2000/svg"
@@ -59,11 +112,11 @@ export const HawaPricingCard = (props) => {
59
112
  clip-rule="evenodd"
60
113
  ></path>
61
114
  </svg>
62
- <span className="text-base font-normal leading-tight text-gray-500 dark:text-gray-400">
115
+ <span className="flex items-center text-center font-normal leading-tight text-gray-500 dark:text-gray-400">
63
116
  {feature}
64
117
  </span>
65
118
  </li>
66
- );
119
+ )
67
120
  })}
68
121
 
69
122
  {/* <li className="flex space-x-3 line-through decoration-gray-500">
@@ -88,7 +141,7 @@ export const HawaPricingCard = (props) => {
88
141
  </ul>
89
142
  <button
90
143
  type="button"
91
- className="text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-none focus:ring-blue-200 dark:focus:ring-blue-900 font-medium rounded-lg text-sm px-5 py-2.5 inline-flex justify-center w-full text-center"
144
+ className="inline-flex w-full justify-center rounded-lg bg-blue-600 px-5 py-2.5 text-center text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-200 dark:focus:ring-blue-900"
92
145
  >
93
146
  {props.buttonText}
94
147
  </button>
@@ -126,19 +179,5 @@ export const HawaPricingCard = (props) => {
126
179
  // {props.buttonText}
127
180
  // </button>
128
181
  // </Container>
129
- );
130
- };
131
-
132
- HawaPricingCard.propTypes = {
133
- lang: PropTypes.string,
134
- buttonText: PropTypes.string,
135
- selectedPlan: PropTypes.string,
136
- title: PropTypes.string,
137
- title_ar: PropTypes.string,
138
- subtitle: PropTypes.string,
139
- subtitle_ar: PropTypes.string,
140
- features: PropTypes.array,
141
- features_ar: PropTypes.array,
142
- currency: PropTypes.oneOf(["sar", "usd"]),
143
- cycleText: PropTypes.oneOf(["monthly", "3-months", "6-months", "annually"])
144
- };
182
+ )
183
+ }
@@ -0,0 +1,34 @@
1
+ import React from "react"
2
+
3
+ type RadioTypes = {
4
+ options: any
5
+ }
6
+ export const HawaRadio: React.FunctionComponent<RadioTypes> = (props) => {
7
+ return (
8
+ <div>
9
+ <ul className="w-full items-center rounded-lg border border-gray-200 bg-white text-sm font-medium text-gray-900 dark:border-gray-600 dark:bg-gray-700 dark:text-white sm:flex">
10
+ {props.options.map((option: any) => {
11
+ return (
12
+ <li className="w-full border-b border-gray-200 dark:border-gray-600 sm:border-b-0 sm:border-r">
13
+ <div className="flex items-center pl-3">
14
+ <input
15
+ id="horizontal-list-radio-license"
16
+ type="radio"
17
+ value=""
18
+ name="list-radio"
19
+ className="h-4 w-4 border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-500 dark:bg-gray-600 dark:ring-offset-gray-700 dark:focus:ring-blue-600"
20
+ />
21
+ <label
22
+ htmlFor="horizontal-list-radio-license"
23
+ className="ml-2 w-full py-3 text-sm font-medium text-gray-900 dark:text-gray-300"
24
+ >
25
+ {option.label}
26
+ </label>
27
+ </div>
28
+ </li>
29
+ )
30
+ })}
31
+ </ul>
32
+ </div>
33
+ )
34
+ }
@@ -0,0 +1,47 @@
1
+ import React from "react"
2
+
3
+ type RangeTypes = {
4
+ value?: any
5
+ handleChange?: any
6
+ startElement?: any
7
+ endElement?: any
8
+ label?: any
9
+ }
10
+
11
+ export const HawaRange: React.FunctionComponent<RangeTypes> = ({
12
+ value,
13
+ handleChange,
14
+ startElement,
15
+ endElement,
16
+ label,
17
+ ...props
18
+ }) => {
19
+ const [rangeValue, setRangeValue] = React.useState(value)
20
+
21
+ return (
22
+ <div {...props}>
23
+ {label && (
24
+ <label
25
+ htmlFor="default-range"
26
+ className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300"
27
+ >
28
+ {label}
29
+ </label>
30
+ )}
31
+ <div className="flex w-fit flex-row items-center justify-center">
32
+ <div className="mr-2">{startElement}</div>{" "}
33
+ <input
34
+ id="default-range"
35
+ type="range"
36
+ value={rangeValue}
37
+ onChange={(e) => {
38
+ setRangeValue(e.target.value)
39
+ handleChange(e)
40
+ }}
41
+ className="h-2 w-fit cursor-pointer appearance-none rounded-lg bg-gray-200 dark:bg-gray-700"
42
+ />
43
+ <div className="ml-2">{endElement}</div>{" "}
44
+ </div>
45
+ </div>
46
+ )
47
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react"
2
+ import { HawaTextField } from "./HawaTextField"
3
+
4
+ type SearchBarTypes = {}
5
+ export const HawaSearchBar: React.FunctionComponent<SearchBarTypes> = (
6
+ props
7
+ ) => {
8
+ return <HawaTextField {...props} />
9
+ }
@@ -1,7 +1,14 @@
1
- import Select from "react-select";
2
- import CreatableSelect from "react-select/creatable";
3
-
4
- const Option = ({
1
+ import React from "react"
2
+ import Select from "react-select"
3
+ import CreatableSelect from "react-select/creatable"
4
+ type OptionTypes = {
5
+ cx: any
6
+ children: any
7
+ getStyles: any
8
+ innerProps: any
9
+ innerRef: any
10
+ }
11
+ const Option: React.FunctionComponent<OptionTypes> = ({
5
12
  cx,
6
13
  children,
7
14
  getStyles,
@@ -11,14 +18,21 @@ const Option = ({
11
18
  }) => (
12
19
  <div
13
20
  ref={innerRef}
14
- className="m-2 p-1 px-3 rounded-lg flex flex-row items-center justify-between hover:bg-blue-200"
21
+ className="m-2 flex flex-row items-center justify-between rounded-lg p-1 px-3 hover:bg-blue-200"
15
22
  {...innerProps}
16
23
  >
17
24
  {children}
18
25
  </div>
19
- );
26
+ )
20
27
 
21
- const Control = ({
28
+ type ControlTypes = {
29
+ cx: any
30
+ children: any
31
+ getStyles: any
32
+ innerProps: any
33
+ innerRef: any
34
+ }
35
+ const Control: React.FunctionComponent<ControlTypes> = ({
22
36
  cx,
23
37
  children,
24
38
  getStyles,
@@ -29,32 +43,61 @@ const Control = ({
29
43
  return (
30
44
  <div
31
45
  ref={innerRef}
32
- className="h-10 flex bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
46
+ className="flex h-10 w-full rounded-lg border border-gray-300 bg-gray-50 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
33
47
  {...innerProps}
34
48
  // {...props}
35
49
  >
36
50
  {children}
37
51
  </div>
38
- );
39
- };
40
- const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...props }) => {
52
+ )
53
+ }
54
+ type MenuTypes = {
55
+ cx: any
56
+ children: any
57
+ getStyles: any
58
+ innerProps: any
59
+ innerRef: any
60
+ }
61
+ const Menu: React.FunctionComponent<MenuTypes> = ({
62
+ cx,
63
+ children,
64
+ getStyles,
65
+ innerProps,
66
+ innerRef,
67
+ ...props
68
+ }) => {
41
69
  return (
42
70
  <div
43
- className="bg-white rounded-lg absolute w-full mt-2"
71
+ className="absolute mt-2 w-full rounded-lg bg-white"
44
72
  ref={innerRef}
45
73
  {...innerProps}
46
74
  // {...props}
47
75
  >
48
76
  {children}
49
77
  </div>
50
- );
51
- };
78
+ )
79
+ }
52
80
 
53
- export const HawaSelect = (props) => {
81
+ type SelectTypes = {
82
+ label?: any
83
+ isCreatable?: any
84
+ options?: any
85
+ isClearable?: any
86
+ isMulti?: any
87
+ isSearchable?: any
88
+ onChange?: any
89
+ helperText?: any
90
+ onInputChange?: any
91
+ native?: any
92
+ fullWidth?: any
93
+ value?: any
94
+ children?: any
95
+ }
96
+ export const HawaSelect: React.FunctionComponent<SelectTypes> = (props) => {
54
97
  return (
55
98
  <div className="mb-3">
56
99
  {props.label && (
57
- <label className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">
100
+ <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
58
101
  {props.label}
59
102
  </label>
60
103
  )}
@@ -64,13 +107,13 @@ export const HawaSelect = (props) => {
64
107
  isClearable={props.isClearable}
65
108
  isMulti={props.isMulti}
66
109
  isSearchable={props.isSearchable}
67
- onChange={(newValue, action) =>
110
+ onChange={(newValue: any, action) =>
68
111
  props.onChange(newValue.label, action)
69
112
  }
70
113
  components={{
71
114
  Control,
72
115
  Option,
73
- Menu
116
+ Menu,
74
117
  }}
75
118
  />
76
119
  )}
@@ -80,20 +123,20 @@ export const HawaSelect = (props) => {
80
123
  input: (base) => ({
81
124
  ...base,
82
125
  "input:focus": {
83
- boxShadow: "none"
84
- }
126
+ boxShadow: "none",
127
+ },
85
128
  }),
86
129
 
87
130
  control: (base) => ({
88
131
  ...base,
89
- borderRadius: "0.75rem"
132
+ borderRadius: "0.75rem",
90
133
  }),
91
134
  menu: (base) => ({
92
135
  ...base,
93
136
  borderRadius: "0.75rem",
94
137
  padding: 0,
95
138
  display: "flex",
96
- justifyContent: "center"
139
+ justifyContent: "center",
97
140
  }),
98
141
  menuList: (base) => ({
99
142
  ...base,
@@ -101,14 +144,14 @@ export const HawaSelect = (props) => {
101
144
  flexDirection: "column",
102
145
  justifyContent: "center",
103
146
  alignItems: "center",
104
- width: "100%"
147
+ width: "100%",
105
148
  }),
106
149
  option: (base) => ({
107
150
  ...base,
108
151
  borderRadius: "0.75rem",
109
152
  margin: 3,
110
- width: "98%"
111
- })
153
+ width: "98%",
154
+ }),
112
155
  }}
113
156
  options={props.options}
114
157
  isClearable={props.isClearable}
@@ -116,12 +159,12 @@ export const HawaSelect = (props) => {
116
159
  isSearchable={props.isSearchable}
117
160
  onCreateOption={() => console.log("im changing")}
118
161
  onChange={(newValue, action) => {
119
- console.log("this is onChange", newValue);
120
- props.onChange(newValue, action);
162
+ console.log("this is onChange", newValue)
163
+ props.onChange(newValue, action)
121
164
  }}
122
165
  onInputChange={(newValue, action) => {
123
- console.log("onInputChange====", newValue);
124
- props.onInputChange(newValue, action);
166
+ console.log("onInputChange====", newValue)
167
+ props.onInputChange(newValue, action)
125
168
  }}
126
169
  />
127
170
  )}
@@ -131,5 +174,5 @@ export const HawaSelect = (props) => {
131
174
  </p>
132
175
  )}
133
176
  </div>
134
- );
135
- };
177
+ )
178
+ }