@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,88 +0,0 @@
1
- import React, { useState } from "react";
2
- import { HawaPricingCard, HawaPanelTabs, HawaTabs } from "../../elements";
3
- import PropTypes from "prop-types";
4
-
5
- export const PricingPlans = (props) => {
6
- const [currentCurrency, setCurrentCurrency] = useState("sar");
7
- const [currentCycle, setCurrentCycle] = useState("monthly");
8
- let cycleOptions = [
9
- { label: `Monthly`, value: `monthly` },
10
- { label: `3 Months`, value: `3-months` },
11
- { label: `6 Months`, value: `6-months` },
12
- { label: `Annually`, value: `annually` }
13
- ];
14
- let currencyOptions = [
15
- { label: `USD`, value: `usd` },
16
- { label: `SAR`, value: `sar` }
17
- ];
18
- let activeTabStyle =
19
- "inline-block py-3 px-4 text-white bg-blue-600 rounded-lg active";
20
- let inactiveTabStyle =
21
- "inline-block py-3 px-4 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white";
22
- return (
23
- <div>
24
- <div
25
- style={{
26
- display: "flex",
27
- flexDirection: "row",
28
- justifyContent: "space-between",
29
- marginBottom: 10
30
- }}
31
- >
32
- <HawaTabs
33
- defaultValue={currentCycle}
34
- options={[
35
- { label: `Monthly`, value: `monthly` },
36
- { label: `3 Months`, value: `3-months` },
37
- { label: `6 Months`, value: `6-months` },
38
- { label: `Annually`, value: `annually` }
39
- ]}
40
- onChangeTab={(e) => setCurrentCycle(e)}
41
- />
42
- <HawaTabs
43
- defaultValue={currentCurrency}
44
- options={[
45
- { label: `USD`, value: `usd` },
46
- { label: `SAR`, value: `sar` }
47
- ]}
48
- onChangeTab={(e) => setCurrentCurrency(e)}
49
- />
50
- </div>
51
-
52
- <div className="flex flex-row">
53
- {props.plans.map((plan) => {
54
- return (
55
- <HawaPricingCard
56
- lang={props.lang}
57
- {...plan}
58
- currency={currentCurrency}
59
- cycleText={currentCycle}
60
- />
61
- );
62
- })}
63
- </div>
64
- </div>
65
- );
66
- };
67
-
68
- PricingPlans.propTypes = {
69
- /**
70
- * An array of the pricing plans
71
- */
72
- plans: PropTypes.arrayOf(
73
- PropTypes.shape({
74
- title: PropTypes.string,
75
- title_ar: PropTypes.string,
76
- subtitle: PropTypes.string,
77
- subtitle_ar: PropTypes.string,
78
- price: PropTypes.number,
79
- currency: PropTypes.string,
80
- cycleText: PropTypes.string,
81
- buttonText: PropTypes.string,
82
- features: PropTypes.array,
83
- features_ar: PropTypes.array,
84
- selectedPlan: PropTypes.bool
85
- })
86
- ),
87
- lang: PropTypes.string
88
- };
@@ -1,24 +0,0 @@
1
- import React from "react";
2
-
3
- export const DraggableCard = (props) => {
4
- return (
5
- <div className="flex flex-row bg-blue-300 rounded-xl p-4">
6
- <button
7
- className="inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
8
- type="button"
9
- >
10
- <svg
11
- className="w-6 h-6"
12
- aria-hidden="true"
13
- fill="currentColor"
14
- viewBox="0 0 20 20"
15
- xmlns="http://www.w3.org/2000/svg"
16
- >
17
- <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>
18
- </svg>
19
- </button>
20
-
21
- <div className="p-4">{props.children}</div>
22
- </div>
23
- );
24
- };
@@ -1,41 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- export const HawaAlert = (props) => {
5
- let severities = {
6
- info: "text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
7
- warning:
8
- "text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
9
- error: "text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
10
- success: "text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800"
11
- };
12
-
13
- return (
14
- <div
15
- className={
16
- "flex flex-col p-4 mb-4 text-sm rounded-lg" +
17
- " " +
18
- severities[props.severity]
19
- }
20
- role="alert"
21
- >
22
- <span className="font-medium">{props.title}</span>
23
- <span>{" " + props.text}</span>
24
- </div>
25
- );
26
- };
27
- HawaAlert.propTypes = {
28
- /**
29
- * The severity of the alert. This defines the color and icon used.
30
- */
31
- severity: PropTypes.oneOf(["error", "info", "success", "warning"]),
32
- /**
33
- * The title of the alert in bold. Can be left empty.
34
- */
35
- title: PropTypes.string,
36
- /**
37
- * The text of the alert.
38
- */
39
- text: PropTypes.string,
40
- hideIcon: PropTypes.bool
41
- };
@@ -1,62 +0,0 @@
1
- import React, { useState } from "react";
2
- import { HawaTooltip } from "./HawaTooltip";
3
- import PropTypes from "prop-types";
4
-
5
- export const HawaButton = ({
6
- tooltip,
7
- icon,
8
- iconOnly,
9
- text,
10
- isLoading = false,
11
- loadingText,
12
- ...props
13
- }) => {
14
- const [loading, setLoading] = useState(isLoading);
15
- let iconStyle = "pr-2 flex flex-col justify-center items-center";
16
- let styles = `${
17
- isLoading ? "cursor-not-allowed" : "cursor-pointer"
18
- } m-1 px-2.5 py-2.5 text-center text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm text-center inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`;
19
- if (props.fullWidth) {
20
- styles =
21
- "my-1 w-full flex justify-center text-white bg-primary-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
22
- }
23
- if (props.normalWidth) {
24
- styles =
25
- "text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
26
- }
27
- if (iconOnly) {
28
- iconStyle = "flex flex-col justify-center items-center";
29
- }
30
- return (
31
- <button
32
- data-tooltip-target={tooltip}
33
- className={styles}
34
- disabled={isLoading}
35
- {...props}
36
- >
37
- {!isLoading ? (
38
- <>
39
- {tooltip ? (
40
- <HawaTooltip tooltipID={tooltip} content={tooltip} />
41
- ) : null}
42
- {icon ? <div className={iconStyle}>{icon}</div> : null}
43
- {!iconOnly && text}
44
- </>
45
- ) : (
46
- <div className="flex flex-row gap-x-3">
47
- <div className="border-2 border-gray-400 border-t-white animate-spin text-white rounded-full h-5 w-5"></div>
48
- {/* <div>{loadingText}</div> */}
49
- </div>
50
- )}
51
- </button>
52
- );
53
- };
54
-
55
- HawaButton.PropTypes = {
56
- tooltip: PropTypes.string,
57
- icon: PropTypes.element,
58
- iconOnly: PropTypes.bool,
59
- text: PropTypes.string,
60
- isLoading: PropTypes.bool,
61
- loadingText: PropTypes.string
62
- };
@@ -1,28 +0,0 @@
1
- import React from "react";
2
-
3
- export const HawaCheckbox = (props) => {
4
- return (
5
- <div className="flex items-top h-full">
6
- <input
7
- type="checkbox"
8
- value=""
9
- className="w-4 h-5 text-blue-600 bg-gray-100 rounded border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
10
- {...props}
11
- />
12
- {(props.label || props.helperText) && (
13
- <div className="flex flex-col items-stat">
14
- {props.label && (
15
- <label className="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">
16
- {props.label}
17
- </label>
18
- )}
19
- {props.helperText && (
20
- <p className="mx-2 mt-1 text-xs text-red-600 dark:text-red-500">
21
- {props.helperText}
22
- </p>
23
- )}
24
- </div>
25
- )}
26
- </div>
27
- );
28
- };
@@ -1,9 +0,0 @@
1
- import React from "react";
2
-
3
- export const HawaChip = (props) => {
4
- return (
5
- <span className="bg-blue-100 text-blue-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800">
6
- {props.label}
7
- </span>
8
- );
9
- };
@@ -1,57 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- // const ColorInput = styled.input`
5
- // -webkit-appearance: none;
6
- // -moz-appearance: none;
7
- // appearance: none;
8
- // border: none;
9
- // cursor: pointer;
10
- // height: 35px;
11
- // border-radius: ${(props) => props.borderRadius}px;
12
- // background-color: ${(props) => props.value};
13
- // &::-webkit-color-swatch {
14
- // border: none;
15
- // }
16
- // &::-moz-color-swatch {
17
- // border: none;
18
- // }
19
- // `;
20
- // const ColorText = styled.input`
21
- // max-width: 70px;
22
- // -webkit-appearance: none;
23
- // -moz-appearance: none;
24
- // appearance: none;
25
- // border: none;
26
- // // height: 30px;
27
- // padding: 10px;
28
- // border-radius: ${(props) => props.borderRadius}px;
29
- // &::-webkit-color-swatch {
30
- // border: none;
31
- // }
32
- // &::-moz-color-swatch {
33
- // border: none;
34
- // }
35
- // `;
36
- export const HawaColorPicker = (props) => {
37
- return (
38
- <div style={{ display: "flex", flexDirection: "row" }}>
39
- {/* <ColorText
40
- type={"text"}
41
- value={props.color}
42
- onChange={props.handleChange}
43
- />
44
- <div style={{ width: 10 }} />
45
- <ColorInput
46
- type={"color"}
47
- value={props.color}
48
- onChange={props.handleChange}
49
- /> */}
50
- </div>
51
- );
52
- };
53
-
54
- HawaColorPicker.propTypes = {
55
- color: PropTypes.string,
56
- handleChange: PropTypes.func
57
- };
@@ -1,68 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import { AiOutlineClose } from "react-icons/ai";
3
- import clsx from "clsx";
4
-
5
- export const HawaDrawer = ({ open, setOpen, position, heading, children }) => {
6
- const [openDrawer, setOpenDrawer] = useState(open);
7
-
8
- const leftDrawer =
9
- "w-60 z-50 h-full absolute overflow-x-hidden top-0 left-0 border-r";
10
- const rightDrawer =
11
- "w-60 z-50 h-full absolute overflow-x-hidden top-0 right-0 border-l";
12
-
13
- // useEffect(() => {
14
- // setOpenDrawer(true);
15
- // }, [open]);
16
-
17
- const childrenWithProps = React.Children.map(children, (child) => {
18
- if (React.isValidElement(child) && child.type.name == "DrawerHeader") {
19
- return React.cloneElement(child, {
20
- closeButton: setOpenDrawer,
21
- children: child.props.children
22
- });
23
- }
24
- if (React.isValidElement(child) && child.type.name == "DrawerBody") {
25
- return React.cloneElement(child, { children: child.props.children });
26
- }
27
- if (React.isValidElement(child) && child.type.name == "DrawerFooter") {
28
- return React.cloneElement(child, { children: child.props.children });
29
- }
30
- });
31
-
32
- const drawerClass =
33
- open && position == "left"
34
- ? clsx("block", leftDrawer)
35
- : open && position == "right"
36
- ? clsx("block", rightDrawer)
37
- : "hidden";
38
-
39
- return <div className={drawerClass}>{childrenWithProps}</div>;
40
- };
41
-
42
- export const DrawerHeader = ({ children, closeButton }) => {
43
- return (
44
- <div className=" w-full flex flex-row justify-between items-center py-4 px-1 border-b">
45
- {children}
46
- <div
47
- className="justify-self-end hover:cursor-pointer border p-1 rounded"
48
- onClick={() => {
49
- closeButton(false);
50
- }}
51
- >
52
- <AiOutlineClose size={20} strokeWidth={2} />
53
- </div>
54
- </div>
55
- );
56
- };
57
-
58
- export const DrawerBody = ({ children }) => {
59
- return <div className="p-1">{children}</div>;
60
- };
61
-
62
- export const DrawerFooter = ({ children }) => {
63
- return (
64
- <div className="absolute w-full py-4 px-1 border-t bottom-0">
65
- {children}
66
- </div>
67
- );
68
- };
@@ -1,71 +0,0 @@
1
- import PropTypes from "prop-types";
2
-
3
- export const HawaMenu = ({
4
- popMenuID,
5
- menuItems,
6
- withHeader,
7
- withIcons,
8
- headerTitle,
9
- headerSubtitle,
10
- open,
11
- handleClose
12
- }) => {
13
- return (
14
- <div>
15
- <button
16
- className="border rounded w-44 p-2 bg-blue-700 text-white"
17
- onClick={() => handleClose(!open)}
18
- >
19
- Menu Dropdown
20
- </button>
21
- <div
22
- id={popMenuID}
23
- className={`${
24
- open ? "block" : "hidden"
25
- } z-10 w-44 bg-white rounded-lg divide-y divide-gray-100 shadow dark:bg-gray-700`}
26
- >
27
- {withHeader && (
28
- <div class="py-3 px-4 text-sm text-gray-900 dark:text-white">
29
- <div>{headerTitle}</div>
30
- <div class="font-medium truncate">{headerSubtitle}</div>
31
- </div>
32
- )}
33
- {menuItems.map((group) => {
34
- return (
35
- <ul className="py-1 text-sm text-gray-700 dark:text-gray-200">
36
- {group.map((item) => {
37
- return (
38
- <li
39
- onClick={item.action}
40
- className={
41
- item.button
42
- ? "bg-primary-500 text-white hover:bg-primary-600 flex flex-row rtl:flex-row-reverse items-center cursor-pointer py-2 px-4 rounded-lg mx-1 hover:bg-gray-100 dark:hover:bg-primary-600 dark:hover:text-white"
43
- : "flex flex-row rtl:flex-row-reverse items-center cursor-pointer py-2 px-4 rounded-lg mx-1 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
44
- }
45
- >
46
- {withIcons && (
47
- <div className="mr-2 rtl:ml-2">{item.icon}</div>
48
- )}
49
- {item.label}
50
- </li>
51
- );
52
- })}
53
- </ul>
54
- );
55
- })}
56
- </div>
57
- </div>
58
- );
59
- };
60
-
61
- HawaMenu.propTypes = {
62
- anchor: PropTypes.any,
63
- handleClose: PropTypes.func,
64
- menuItems: PropTypes.arrayOf(
65
- PropTypes.shape({
66
- icon: PropTypes.element,
67
- label: PropTypes.string,
68
- action: PropTypes.func
69
- })
70
- )
71
- };
@@ -1,106 +0,0 @@
1
- import { useState } from "react";
2
- import Countries from "../../countries";
3
- import Select from "react-select";
4
- const Option = ({
5
- cx,
6
- children,
7
- getStyles,
8
- innerProps,
9
- innerRef,
10
- ...props
11
- }) => (
12
- <div
13
- ref={innerRef}
14
- className="m-2 p-1 px-3 rounded-lg flex flex-row items-center justify-between hover:bg-blue-200"
15
- {...innerProps}
16
- >
17
- <img className="h-8 w-8" src={props.data.image}></img>
18
- {children}
19
- </div>
20
- );
21
-
22
- export const HawaPhoneInput = ({ preferredCountry, label }) => {
23
- const [code, setCode] = useState(preferredCountry ?? "");
24
- const [selectedCountry, setSelectedCountry] = useState("+966");
25
- const [tel, setTel] = useState("");
26
- const handleChangePhone = (phone) => {
27
- if (phone.length == 0) {
28
- setTel("");
29
- setCode("");
30
- return;
31
- }
32
- if (!phone.startsWith("+")) phone = "+".concat(phone);
33
- if (phone.length >= 5) {
34
- setTel(phone);
35
- return;
36
- }
37
- let findDialCode = Countries.find((country) => country.dial_code == phone);
38
- if (findDialCode != undefined && findDialCode != null) {
39
- setCode(findDialCode.code);
40
- }
41
- setTel(phone);
42
- };
43
-
44
- return (
45
- <div className="flex flex-col mb-3">
46
- {label && (
47
- <label className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">
48
- {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={Countries[0]}
93
- onInputChange={() => console.log("changed to")}
94
- onChange={(newValue, action) => {
95
- console.log("test n", newValue);
96
- setSelectedCountry(newValue);
97
- }}
98
- />
99
- <input
100
- type="number"
101
- className="bg-gray-50 appearance-none border rounded-l-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 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 border-l-0"
102
- />
103
- </div>
104
- </div>
105
- );
106
- };
@@ -1,31 +0,0 @@
1
- import React from "react";
2
-
3
- export const HawaRadio = (props) => {
4
- return (
5
- <div>
6
- <ul className="items-center w-full text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 sm:flex dark:bg-gray-700 dark:border-gray-600 dark:text-white">
7
- {props.options.map((option) => {
8
- return (
9
- <li className="w-full border-b border-gray-200 sm:border-b-0 sm:border-r dark:border-gray-600">
10
- <div className="flex items-center pl-3">
11
- <input
12
- id="horizontal-list-radio-license"
13
- type="radio"
14
- value=""
15
- name="list-radio"
16
- className="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500"
17
- />
18
- <label
19
- htmlFor="horizontal-list-radio-license"
20
- className="py-3 ml-2 w-full text-sm font-medium text-gray-900 dark:text-gray-300"
21
- >
22
- {option.label}
23
- </label>
24
- </div>
25
- </li>
26
- );
27
- })}
28
- </ul>
29
- </div>
30
- );
31
- };
@@ -1,54 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- export const HawaRange = ({
5
- value,
6
- handleChange,
7
- startElement,
8
- endElement,
9
- label,
10
- ...props
11
- }) => {
12
- const [rangeValue, setRangeValue] = React.useState(value);
13
-
14
- return (
15
- <div {...props}>
16
- {label && (
17
- <label
18
- htmlFor="default-range"
19
- className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
20
- >
21
- {label}
22
- </label>
23
- )}
24
- <div className="flex flex-row justify-center items-center w-fit">
25
- <div className="mr-2">{startElement}</div>{" "}
26
- <input
27
- id="default-range"
28
- type="range"
29
- value={rangeValue}
30
- onChange={(e) => {
31
- setRangeValue(e.target.value);
32
- handleChange(e);
33
- }}
34
- className="w-fit h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
35
- />
36
- <div className="ml-2">{endElement}</div>{" "}
37
- </div>
38
- </div>
39
- );
40
- };
41
- HawaRange.propTypes = {
42
- /**
43
- * The element at the side where the range value is 0
44
- * Can be an icon
45
- */
46
- startElement: PropTypes.element,
47
- value: PropTypes.number,
48
- /**
49
- * The element at the side where the range value is 100
50
- */
51
- endElement: PropTypes.element,
52
- handleChange: PropTypes.func,
53
- label : PropTypes.string
54
- };
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import { HawaTextField } from "./HawaTextField";
3
-
4
- export const HawaSearchBar = (props) => {
5
- return (
6
- <HawaTextField
7
- // endAdornment={
8
- // <InputAdornment position="start">
9
- // <Search />
10
- // </InputAdornment>
11
- // }
12
- {...props}
13
- />
14
- );
15
- };