@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.
- package/dist/styles.css +279 -211
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +18 -6
- package/rollup.config.js +14 -2
- package/src/blocks/Account/{UserProfileForm.js → UserProfileForm.tsx} +42 -41
- package/src/blocks/Account/UserSettingsForm.tsx +28 -0
- package/src/blocks/Account/index.ts +2 -0
- package/src/blocks/AuthForms/AppLanding.tsx +33 -0
- package/src/blocks/AuthForms/CodeConfirmation.tsx +59 -0
- package/src/blocks/AuthForms/{NewPasswordForm.js → NewPasswordForm.tsx} +49 -53
- package/src/blocks/AuthForms/{ResetPasswordForm.js → ResetPasswordForm.tsx} +35 -38
- package/src/blocks/AuthForms/{SignInForm.js → SignInForm.tsx} +73 -65
- package/src/blocks/AuthForms/SignInPhone.tsx +68 -0
- package/src/blocks/AuthForms/{SignUpForm.js → SignUpForm.tsx} +88 -82
- package/src/blocks/AuthForms/index.ts +7 -0
- package/src/blocks/Misc/NotFound.tsx +28 -0
- package/src/blocks/Misc/index.ts +1 -0
- package/src/blocks/Payment/ChargeWalletForm.tsx +70 -0
- package/src/blocks/Payment/{CheckoutForm.js → CheckoutForm.tsx} +82 -81
- package/src/blocks/Payment/Confirmation.tsx +96 -0
- package/src/blocks/Payment/{CreditCardForm.js → CreditCardForm.tsx} +48 -33
- package/src/blocks/Payment/PayWithWallet.tsx +29 -0
- package/src/blocks/Payment/{SelectPayment.js → SelectPayment.tsx} +33 -29
- package/src/blocks/Payment/{index.js → index.ts} +0 -0
- package/src/blocks/Pricing/{ComparingPlans.js → ComparingPlans.tsx} +51 -53
- package/src/blocks/Pricing/PricingPlans.tsx +72 -0
- package/src/blocks/Pricing/{index.js → index.ts} +0 -0
- package/src/blocks/{index.js → index.ts} +0 -0
- package/{countries.js → src/countries.ts} +245 -245
- package/src/elements/{AutoCompleteField.js → AutoCompleteField.tsx} +16 -9
- package/src/elements/{DragDropImages.js → DragDropImages.tsx} +78 -53
- package/src/elements/DraggableCard.tsx +29 -0
- package/src/elements/{HawaAccordian.js → HawaAccordian.tsx} +27 -23
- package/src/elements/HawaAdCard.tsx +48 -0
- package/src/elements/HawaAlert.tsx +30 -0
- package/src/elements/HawaButton.tsx +120 -0
- package/src/elements/HawaCheckbox.tsx +37 -0
- package/src/elements/HawaChip.tsx +12 -0
- package/src/elements/HawaColorPicker.tsx +38 -0
- package/src/elements/{HawaCopyrights.js → HawaCopyrights.tsx} +15 -8
- package/src/elements/HawaDrawer.tsx +84 -0
- package/src/elements/{HawaDrawerItem.js → HawaDrawerItem.tsx} +12 -7
- package/src/elements/{HawaItemCard.js → HawaItemCard.tsx} +35 -36
- package/src/elements/{HawaLogoButton.js → HawaLogoButton.tsx} +52 -56
- package/src/elements/HawaMenu.tsx +75 -0
- package/src/elements/{HawaModal.js → HawaModal.tsx} +30 -21
- package/src/elements/{HawaPanelTabs.js → HawaPanelTabs.tsx} +27 -27
- package/src/elements/HawaPhoneInput.tsx +112 -0
- package/src/elements/{HawaPricingCard.js → HawaPricingCard.tsx} +86 -47
- package/src/elements/HawaRadio.tsx +34 -0
- package/src/elements/HawaRange.tsx +47 -0
- package/src/elements/HawaSearchBar.tsx +9 -0
- package/src/elements/{HawaSelect.js → HawaSelect.tsx} +74 -31
- package/src/elements/HawaSettingsRow.tsx +56 -0
- package/src/elements/HawaSnackbar.tsx +73 -0
- package/src/elements/HawaSwitch.tsx +25 -0
- package/src/elements/{HawaTable.js → HawaTable.tsx} +33 -31
- package/src/elements/{HawaTabs.js → HawaTabs.tsx} +17 -12
- package/src/elements/HawaTextField.tsx +71 -0
- package/src/elements/HawaTooltip.tsx +35 -0
- package/src/elements/HawaTypography.tsx +11 -0
- package/src/elements/{TabPanel.js → TabPanel.tsx} +10 -5
- package/src/elements/{index.js → index.ts} +7 -4
- package/src/index.ts +3 -0
- package/src/layout/Box.tsx +5 -0
- package/src/layout/HawaBottomAppBar.tsx +54 -0
- package/src/layout/HawaContainer.tsx +24 -0
- package/src/layout/{HawaLayout.js → HawaLayout.tsx} +54 -49
- package/src/layout/{index.js → index.ts} +0 -0
- package/src/styles.css +279 -211
- package/src/{util.js → util.ts} +0 -0
- package/storybook-static/229.a3257e00.iframe.bundle.js +1 -0
- package/storybook-static/229.d6fb4f8f665962cef844.manager.bundle.js +1 -0
- package/storybook-static/295.67c251ec00675ab59b60.manager.bundle.js +1 -0
- package/storybook-static/51.786e9bbba427ee454dc0.manager.bundle.js +2 -0
- package/storybook-static/{0.1104ca18.iframe.bundle.js.LICENSE.txt → 51.786e9bbba427ee454dc0.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/51.acbbdb95.iframe.bundle.js +2 -0
- package/storybook-static/{0.cf71f8aa82edef0a7186.manager.bundle.js.LICENSE.txt → 51.acbbdb95.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/551.67cd309b0648b0a52636.manager.bundle.js +1 -0
- package/storybook-static/551.c82ea8f1.iframe.bundle.js +1 -0
- package/storybook-static/701.bcf1e718.iframe.bundle.js +1 -0
- package/storybook-static/733.8d2de9f8.iframe.bundle.js +2 -0
- package/storybook-static/{vendors~main.30019f92.iframe.bundle.js.LICENSE.txt → 733.8d2de9f8.iframe.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/767.2f9c96fa3338c8d16078.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.d13ba71108048897ea4a.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/807.14b8bfa7.iframe.bundle.js +2 -0
- package/storybook-static/{5.5b799f3fbf64cec8e51a.manager.bundle.js.LICENSE.txt → 807.14b8bfa7.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/807.4f52b2d047c5e8c5872f.manager.bundle.js +2 -0
- package/storybook-static/{6.6023eba1.iframe.bundle.js.LICENSE.txt → 807.4f52b2d047c5e8c5872f.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/897.386c170cbd1467abc7ca.manager.bundle.js +2 -0
- package/storybook-static/{8.f9b98ef3e089be1a16d6.manager.bundle.js.LICENSE.txt → 897.386c170cbd1467abc7ca.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/897.d9a35fd0.iframe.bundle.js +2 -0
- package/storybook-static/{9.63a5cf7a.iframe.bundle.js.LICENSE.txt → 897.d9a35fd0.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/935.07c1b6ea.iframe.bundle.js +1 -0
- package/storybook-static/935.0b4e9c201c33f3e66e81.manager.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.051275cac7b0dc69501c.manager.bundle.js +1 -0
- package/storybook-static/main.71507dcb.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.25eae181fe0f96887a15.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.4d0bf318.iframe.bundle.js +1 -0
- package/tailwind.config.js +16 -1
- package/tsconfig.json +25 -0
- package/src/blocks/Account/UserSettingsForm.js +0 -17
- package/src/blocks/Account/index.js +0 -2
- package/src/blocks/AuthForms/AppLanding.js +0 -40
- package/src/blocks/AuthForms/CodeConfirmation.js +0 -78
- package/src/blocks/AuthForms/SignInPhone.js +0 -38
- package/src/blocks/AuthForms/index.js +0 -7
- package/src/blocks/Misc/NotFound.js +0 -32
- package/src/blocks/Misc/index.js +0 -1
- package/src/blocks/Payment/ChargeWalletForm.js +0 -81
- package/src/blocks/Payment/Confirmation.js +0 -104
- package/src/blocks/Payment/Form/CForm.js +0 -316
- package/src/blocks/Payment/Form/Card.js +0 -242
- package/src/blocks/Payment/Form/PaymentMethod.js +0 -118
- package/src/blocks/Payment/Gateway/GooglePay.js +0 -251
- package/src/blocks/Payment/Gateway/Payfort.js +0 -90
- package/src/blocks/Payment/Gateway/Paypal.js +0 -138
- package/src/blocks/Payment/Gateway/Wallet.js +0 -148
- package/src/blocks/Payment/PayWithWallet.js +0 -20
- package/src/blocks/Pricing/PricingPlans.js +0 -88
- package/src/elements/DraggableCard.js +0 -24
- package/src/elements/HawaAlert.js +0 -41
- package/src/elements/HawaButton.js +0 -62
- package/src/elements/HawaCheckbox.js +0 -28
- package/src/elements/HawaChip.js +0 -9
- package/src/elements/HawaColorPicker.js +0 -57
- package/src/elements/HawaDrawer.js +0 -68
- package/src/elements/HawaMenu.js +0 -59
- package/src/elements/HawaPhoneInput.js +0 -106
- package/src/elements/HawaRadio.js +0 -31
- package/src/elements/HawaRange.js +0 -54
- package/src/elements/HawaSearchBar.js +0 -15
- package/src/elements/HawaSettingsRow.js +0 -34
- package/src/elements/HawaSnackbar.js +0 -44
- package/src/elements/HawaSwitch.js +0 -21
- package/src/elements/HawaTextField.js +0 -34
- package/src/elements/HawaTooltip.js +0 -19
- package/src/elements/HawaTypography.js +0 -5
- package/src/elements/PinInput.js +0 -141
- package/src/elements/SelectedField.js +0 -46
- package/src/index.js +0 -3
- package/src/layout/Box.js +0 -5
- package/src/layout/HawaAppLayout.js +0 -245
- package/src/layout/HawaAppLayout2.js +0 -254
- package/src/layout/HawaBottomAppBar.js +0 -76
- package/src/layout/HawaContainer.js +0 -8
- package/storybook-static/0.1104ca18.iframe.bundle.js +0 -3
- package/storybook-static/0.1104ca18.iframe.bundle.js.map +0 -1
- package/storybook-static/0.cf71f8aa82edef0a7186.manager.bundle.js +0 -2
- package/storybook-static/1.7e6ec5c45ae5b70c5149.manager.bundle.js +0 -1
- package/storybook-static/1.e3eafd38.iframe.bundle.js +0 -1
- package/storybook-static/2.3841b1a5.iframe.bundle.js +0 -1
- package/storybook-static/5.5b799f3fbf64cec8e51a.manager.bundle.js +0 -2
- package/storybook-static/6.6023eba1.iframe.bundle.js +0 -3
- package/storybook-static/6.6023eba1.iframe.bundle.js.map +0 -1
- package/storybook-static/6.b34ce31193a7fa1dd965.manager.bundle.js +0 -1
- package/storybook-static/7.632f8551.iframe.bundle.js +0 -1
- package/storybook-static/7.72879af713f755a7aa7e.manager.bundle.js +0 -1
- package/storybook-static/8.9a8f8b69.iframe.bundle.js +0 -1
- package/storybook-static/8.f9b98ef3e089be1a16d6.manager.bundle.js +0 -2
- package/storybook-static/9.1e1335092fade49cc986.manager.bundle.js +0 -1
- package/storybook-static/9.63a5cf7a.iframe.bundle.js +0 -3
- package/storybook-static/9.63a5cf7a.iframe.bundle.js.map +0 -1
- package/storybook-static/main.4bd27e4e7faa098302d1.manager.bundle.js +0 -1
- package/storybook-static/main.c9ced472.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.67ec6e92.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.a58df7ba92d01c5088d3.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.30019f92.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.30019f92.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +0 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { HawaTypography } from "./HawaTypography"
|
|
3
|
+
import { HawaTextField } from "./HawaTextField"
|
|
4
|
+
import { HawaSwitch } from "./HawaSwitch"
|
|
5
|
+
import { HawaColorPicker } from "./HawaColorPicker"
|
|
6
|
+
import { HawaRange } from "./HawaRange"
|
|
7
|
+
import { HawaCheckbox } from "./HawaCheckbox"
|
|
8
|
+
import { HawaTabs } from "./HawaTabs"
|
|
9
|
+
|
|
10
|
+
type SettingsRowTypes = {
|
|
11
|
+
settingsLabel: any
|
|
12
|
+
settingsType: any
|
|
13
|
+
// settingsType: PropTypes.oneOf([
|
|
14
|
+
// "checkbox",
|
|
15
|
+
// "text",
|
|
16
|
+
// "radio",
|
|
17
|
+
// "boolean",
|
|
18
|
+
// "color",
|
|
19
|
+
// ]),
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const HawaSettingsRow: React.FunctionComponent<SettingsRowTypes> = (
|
|
23
|
+
props
|
|
24
|
+
) => {
|
|
25
|
+
return (
|
|
26
|
+
<div className="my-2 flex max-h-fit flex-row items-center justify-between rounded-xl bg-white px-4 py-2 pr-2 align-middle">
|
|
27
|
+
<HawaTypography>{props.settingsLabel}</HawaTypography>
|
|
28
|
+
{props.settingsType === "checkbox" && (
|
|
29
|
+
<HawaCheckbox centered {...props} />
|
|
30
|
+
)}
|
|
31
|
+
{props.settingsType === "text" && (
|
|
32
|
+
<HawaTextField margin="none" {...props} />
|
|
33
|
+
)}
|
|
34
|
+
{props.settingsType === "boolean" && (
|
|
35
|
+
<HawaSwitch
|
|
36
|
+
// {...props}
|
|
37
|
+
/>
|
|
38
|
+
)}
|
|
39
|
+
{props.settingsType === "range" && (
|
|
40
|
+
<HawaRange
|
|
41
|
+
// {...props}
|
|
42
|
+
/>
|
|
43
|
+
)}
|
|
44
|
+
{props.settingsType === "color" && (
|
|
45
|
+
<HawaColorPicker
|
|
46
|
+
// {...props}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
{props.settingsType === "radio" && (
|
|
50
|
+
<HawaTabs
|
|
51
|
+
// {...props}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
2
|
+
import React, { FC } from "react"
|
|
3
|
+
|
|
4
|
+
type THawaSnackBar = {
|
|
5
|
+
severity: "info" | "warning" | "error" | "success" | "none"
|
|
6
|
+
title: string
|
|
7
|
+
description: string
|
|
8
|
+
position?:
|
|
9
|
+
| "top-left"
|
|
10
|
+
| "top-center"
|
|
11
|
+
| "top-right"
|
|
12
|
+
| "bottom-right"
|
|
13
|
+
| "bottom-center"
|
|
14
|
+
| "bottom-left"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const HawaSnackbar: FC<THawaSnackBar> = ({
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
severity = "info",
|
|
21
|
+
position = "bottom-left",
|
|
22
|
+
}) => {
|
|
23
|
+
let defaultStyle =
|
|
24
|
+
"fixed flex flex-row items-top p-1 w-full max-w-xs rounded-lg shadow dark:text-gray-400 dark:bg-gray-800"
|
|
25
|
+
let severities = {
|
|
26
|
+
info: "text-blue-700 bg-blue-100",
|
|
27
|
+
warning: "text-yellow-700 bg-yellow-100",
|
|
28
|
+
error: "text-red-700 bg-red-100",
|
|
29
|
+
success: "text-green-700 bg-green-100",
|
|
30
|
+
none: "text-gray-500 bg-white ",
|
|
31
|
+
}
|
|
32
|
+
let positions = {
|
|
33
|
+
"top-left": "top-4",
|
|
34
|
+
"top-right": "top-4 right-4",
|
|
35
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
36
|
+
"bottom-left": "bottom-4",
|
|
37
|
+
"bottom-right": "bottom-4 right-4",
|
|
38
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
39
|
+
}
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
id="toast-default"
|
|
43
|
+
role="alert"
|
|
44
|
+
className={clsx(defaultStyle, severities[severity], positions[position])}
|
|
45
|
+
>
|
|
46
|
+
<div className="p-3">
|
|
47
|
+
<div className="ml-3 text-sm font-bold">{title}</div>
|
|
48
|
+
<div className="ml-3 text-sm font-normal">{description}</div>
|
|
49
|
+
</div>
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
className="inline-flex h-8 w-8 rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
53
|
+
data-dismiss-target="#toast-default"
|
|
54
|
+
aria-label="Close"
|
|
55
|
+
>
|
|
56
|
+
<span className="sr-only">Close</span>
|
|
57
|
+
<svg
|
|
58
|
+
aria-hidden="true"
|
|
59
|
+
className="h-5 w-5"
|
|
60
|
+
fill="currentColor"
|
|
61
|
+
viewBox="0 0 20 20"
|
|
62
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
63
|
+
>
|
|
64
|
+
<path
|
|
65
|
+
fill-rule="evenodd"
|
|
66
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
67
|
+
clip-rule="evenodd"
|
|
68
|
+
></path>
|
|
69
|
+
</svg>
|
|
70
|
+
</button>
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
type SwitchTypes = {
|
|
4
|
+
text?: any
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const HawaSwitch: React.FunctionComponent<SwitchTypes> = (props) => {
|
|
8
|
+
return (
|
|
9
|
+
<label
|
|
10
|
+
htmlFor="default-toggle"
|
|
11
|
+
className="relative inline-flex cursor-pointer items-center"
|
|
12
|
+
>
|
|
13
|
+
<input
|
|
14
|
+
type="checkbox"
|
|
15
|
+
value=""
|
|
16
|
+
id="default-toggle"
|
|
17
|
+
className="peer sr-only"
|
|
18
|
+
/>
|
|
19
|
+
<div className="peer h-6 w-11 rounded-full bg-gray-200 after:absolute after:top-[2px] after:left-[2px] after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:border-gray-600 dark:bg-gray-700 dark:peer-focus:ring-blue-800"></div>
|
|
20
|
+
<span className="mx-2 text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
21
|
+
{props.text}
|
|
22
|
+
</span>
|
|
23
|
+
</label>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import
|
|
3
|
-
import { HawaButton } from "./HawaButton";
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { HawaButton } from "./HawaButton"
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type TableTypes = {
|
|
5
|
+
lang?: any
|
|
6
|
+
columns?: any
|
|
7
|
+
actions?: any
|
|
8
|
+
rows?: any
|
|
9
|
+
noDataText?: any
|
|
10
|
+
handleActionClick?: any
|
|
11
|
+
end?: any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const HawaTable: React.FunctionComponent<TableTypes> = (props) => {
|
|
15
|
+
let isArabic = props.lang === "ar"
|
|
7
16
|
return (
|
|
8
17
|
<>
|
|
9
18
|
<div>
|
|
10
|
-
<div className="overflow-x-auto
|
|
11
|
-
<table className="w-full text-
|
|
12
|
-
<thead className="
|
|
19
|
+
<div className="relative overflow-x-auto rounded-xl">
|
|
20
|
+
<table className="w-full text-left text-sm text-gray-500 dark:text-gray-400">
|
|
21
|
+
<thead className="bg-gray-50 text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400">
|
|
13
22
|
<tr>
|
|
14
|
-
{props.columns.map((col, i) => (
|
|
23
|
+
{props.columns.map((col: any, i: any) => (
|
|
15
24
|
<th key={i} scope="col" className="py-3 px-6">
|
|
16
25
|
{col}
|
|
17
26
|
</th>
|
|
@@ -25,36 +34,37 @@ export const HawaTable = (props) => {
|
|
|
25
34
|
</thead>
|
|
26
35
|
<tbody>
|
|
27
36
|
{props.rows ? (
|
|
28
|
-
props.rows.map((singleRow, j) => (
|
|
37
|
+
props.rows.map((singleRow: any, j: any) => (
|
|
29
38
|
<tr
|
|
30
|
-
className="bg-white
|
|
39
|
+
className="border-b bg-white dark:border-gray-700 dark:bg-gray-800"
|
|
31
40
|
key={j}
|
|
32
41
|
>
|
|
33
|
-
{singleRow.map((r, i) => {
|
|
42
|
+
{singleRow.map((r: any, i: any) => {
|
|
34
43
|
if (i === 0) {
|
|
35
44
|
return (
|
|
36
45
|
<th
|
|
37
46
|
scope="row"
|
|
38
|
-
className="py-4 px-6 font-medium text-gray-900
|
|
47
|
+
className="whitespace-nowrap py-4 px-6 font-medium text-gray-900 dark:text-white"
|
|
39
48
|
>
|
|
40
49
|
{r}{" "}
|
|
41
50
|
</th>
|
|
42
|
-
)
|
|
51
|
+
)
|
|
43
52
|
} else {
|
|
44
|
-
return <td className="py-4 px-6">{r}</td
|
|
53
|
+
return <td className="py-4 px-6">{r}</td>
|
|
45
54
|
}
|
|
46
55
|
})}
|
|
47
56
|
{props.actions && (
|
|
48
57
|
<td
|
|
49
58
|
align={isArabic ? "right" : "left"}
|
|
50
59
|
style={{ fontWeight: 700 }}
|
|
51
|
-
variant={isArabic ? "borderedRight" : "borderedLeft"}
|
|
60
|
+
// variant={isArabic ? "borderedRight" : "borderedLeft"}
|
|
52
61
|
>
|
|
53
|
-
{props.actions.map((act) => (
|
|
62
|
+
{props.actions.map((act: any) => (
|
|
54
63
|
<HawaButton
|
|
55
64
|
onClick={() => props.handleActionClick(singleRow)}
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
>
|
|
66
|
+
{act}
|
|
67
|
+
</HawaButton>
|
|
58
68
|
))}
|
|
59
69
|
</td>
|
|
60
70
|
)}
|
|
@@ -62,8 +72,8 @@ export const HawaTable = (props) => {
|
|
|
62
72
|
))
|
|
63
73
|
) : (
|
|
64
74
|
<tr>
|
|
65
|
-
<td
|
|
66
|
-
<div className="w-full p-5 text-center
|
|
75
|
+
<td colSpan={props.columns.length}>
|
|
76
|
+
<div className="w-full bg-white p-5 text-center">
|
|
67
77
|
{props.noDataText}
|
|
68
78
|
</div>
|
|
69
79
|
</td>
|
|
@@ -180,13 +190,5 @@ export const HawaTable = (props) => {
|
|
|
180
190
|
</Table>
|
|
181
191
|
</TableContainer> */}
|
|
182
192
|
</>
|
|
183
|
-
)
|
|
184
|
-
}
|
|
185
|
-
HawaTable.propTypes = {
|
|
186
|
-
handleActionClick: PropTypes.func,
|
|
187
|
-
noDataText: PropTypes.string,
|
|
188
|
-
lang: PropTypes.string,
|
|
189
|
-
columns: PropTypes.array,
|
|
190
|
-
rows: PropTypes.array,
|
|
191
|
-
end: PropTypes.array
|
|
192
|
-
};
|
|
193
|
+
)
|
|
194
|
+
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import React, { useState } from "react"
|
|
1
|
+
import React, { useState } from "react"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type TabsTypes = {
|
|
4
|
+
options?: any
|
|
5
|
+
onChangeTab?: any
|
|
6
|
+
defaultValue?: any
|
|
7
|
+
}
|
|
8
|
+
export const HawaTabs: React.FunctionComponent<TabsTypes> = (props) => {
|
|
9
|
+
const [selectedOption, setSelectedOption] = useState(props.defaultValue)
|
|
5
10
|
let activeTabStyle =
|
|
6
|
-
"inline-block py-2 px-4 text-white bg-blue-600 rounded-lg active"
|
|
11
|
+
"inline-block py-2 px-4 text-white bg-blue-600 rounded-lg active"
|
|
7
12
|
let inactiveTabStyle =
|
|
8
|
-
"inline-block py-2 px-4 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white"
|
|
13
|
+
"inline-block py-2 px-4 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white"
|
|
9
14
|
|
|
10
15
|
return (
|
|
11
16
|
<div>
|
|
12
|
-
<ul className="
|
|
13
|
-
{props.options.map((opt) => (
|
|
14
|
-
<li
|
|
17
|
+
<ul className="flex w-fit flex-wrap rounded-lg bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
18
|
+
{props.options.map((opt: any) => (
|
|
19
|
+
<li>
|
|
15
20
|
<button
|
|
16
21
|
aria-current="page"
|
|
17
22
|
onClick={() => {
|
|
18
|
-
setSelectedOption(opt.value)
|
|
19
|
-
props.onChangeTab(opt.value)
|
|
23
|
+
setSelectedOption(opt.value)
|
|
24
|
+
props.onChangeTab(opt.value)
|
|
20
25
|
}}
|
|
21
26
|
className={
|
|
22
27
|
selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
|
|
@@ -28,5 +33,5 @@ export const HawaTabs = (props) => {
|
|
|
28
33
|
))}
|
|
29
34
|
</ul>
|
|
30
35
|
</div>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import clsx from "clsx"
|
|
3
|
+
|
|
4
|
+
type TextFieldTypes = {
|
|
5
|
+
margin?: "none" | "normal" | "large"
|
|
6
|
+
width?: "small" | "normal" | "full"
|
|
7
|
+
label?: any
|
|
8
|
+
multiline?: any
|
|
9
|
+
helperText?: any
|
|
10
|
+
value?: any
|
|
11
|
+
props?: React.PropsWithRef<"input">
|
|
12
|
+
type?: any
|
|
13
|
+
placeholder?: any
|
|
14
|
+
defaultValue?: any
|
|
15
|
+
name?: any
|
|
16
|
+
inputProps?: any
|
|
17
|
+
onChange?: any
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
21
|
+
margin = "normal",
|
|
22
|
+
width = "full",
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
let marginStyles = {
|
|
26
|
+
none: "mb-0",
|
|
27
|
+
normal: "mb-3",
|
|
28
|
+
large: "mb-5",
|
|
29
|
+
}
|
|
30
|
+
let widthStyles = {
|
|
31
|
+
small: "",
|
|
32
|
+
normal: "",
|
|
33
|
+
full: "w-full",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let defaultStyle = "flex h-fit max-h-fit flex-col justify-center"
|
|
37
|
+
return (
|
|
38
|
+
<div
|
|
39
|
+
className={clsx(defaultStyle, marginStyles[margin], widthStyles[width])}
|
|
40
|
+
>
|
|
41
|
+
{props.label && (
|
|
42
|
+
<label
|
|
43
|
+
htmlFor="first_name"
|
|
44
|
+
className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
45
|
+
>
|
|
46
|
+
{props.label}
|
|
47
|
+
</label>
|
|
48
|
+
)}
|
|
49
|
+
{props.multiline ? (
|
|
50
|
+
<textarea
|
|
51
|
+
id="message"
|
|
52
|
+
rows={4}
|
|
53
|
+
className="block w-full rounded-lg border 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"
|
|
54
|
+
placeholder="Your message..."
|
|
55
|
+
/>
|
|
56
|
+
) : (
|
|
57
|
+
<input
|
|
58
|
+
{...props}
|
|
59
|
+
className="mb-0 block w-full rounded-lg border 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"
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
{props.helperText && (
|
|
64
|
+
<p className="mb-1 mt-1 text-xs text-red-600 dark:text-red-500">
|
|
65
|
+
{/* <span className="font-medium">Oh, snapp!</span> */}
|
|
66
|
+
{props.helperText}
|
|
67
|
+
</p>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
type THawaToolTip = {
|
|
5
|
+
children : React.ReactElement
|
|
6
|
+
content : string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const HawaTooltip : React.FunctionComponent<THawaToolTip> = ({children, content}) => {
|
|
10
|
+
const [isHovered, setIsHovered] = useState<boolean>(false);
|
|
11
|
+
return (
|
|
12
|
+
<div className="relative">
|
|
13
|
+
<div
|
|
14
|
+
className="w-fit"
|
|
15
|
+
onMouseEnter={() => {
|
|
16
|
+
setIsHovered(true);
|
|
17
|
+
}}
|
|
18
|
+
onMouseLeave={() => {
|
|
19
|
+
setIsHovered(false);
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
className={
|
|
26
|
+
isHovered
|
|
27
|
+
? "absolute top-10 left-0 z-10 inline-block w-fit 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"
|
|
28
|
+
: "absolute top-10 left-0 z-10 inline-block w-fit 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"
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
{content}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
3
|
// const useStyles = makeStyles((theme) => ({
|
|
4
4
|
// panelsContainer: {
|
|
@@ -13,8 +13,13 @@ import React from "react";
|
|
|
13
13
|
// }
|
|
14
14
|
// }));
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
type TabPanelTypes = {
|
|
17
|
+
children: any
|
|
18
|
+
value: any
|
|
19
|
+
index: any
|
|
20
|
+
}
|
|
21
|
+
export const TabPanel: React.FunctionComponent<TabPanelTypes> = (props) => {
|
|
22
|
+
const { children, value, index, ...other } = props
|
|
18
23
|
return (
|
|
19
24
|
<div
|
|
20
25
|
role="tabpanel"
|
|
@@ -29,5 +34,5 @@ export const TabPanel = (props) => {
|
|
|
29
34
|
</div>
|
|
30
35
|
)}
|
|
31
36
|
</div>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -3,11 +3,7 @@ export * from "./HawaSwitch";
|
|
|
3
3
|
export * from "./HawaCheckbox";
|
|
4
4
|
export * from "./HawaPanelTabs";
|
|
5
5
|
export * from "./HawaChip";
|
|
6
|
-
export * from "./HawaItemCard";
|
|
7
|
-
export * from "./HawaPricingCard";
|
|
8
6
|
export * from "./HawaSettingsRow";
|
|
9
|
-
export * from "./HawaLogoButton";
|
|
10
|
-
export * from "./HawaButton";
|
|
11
7
|
export * from "./HawaSelect";
|
|
12
8
|
export * from "./HawaRange";
|
|
13
9
|
export * from "./HawaTextField";
|
|
@@ -27,3 +23,10 @@ export * from "./HawaModal";
|
|
|
27
23
|
export * from "./HawaMenu";
|
|
28
24
|
export * from "./HawaDrawer";
|
|
29
25
|
export * from "./HawaCopyrights";
|
|
26
|
+
// Cards
|
|
27
|
+
export * from "./HawaItemCard";
|
|
28
|
+
export * from "./HawaPricingCard";
|
|
29
|
+
export * from "./HawaAdCard";
|
|
30
|
+
//Buttons
|
|
31
|
+
export * from "./HawaButton";
|
|
32
|
+
export * from "./HawaLogoButton";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
type BottomAppBarTypes = {
|
|
4
|
+
sx: any
|
|
5
|
+
color: any
|
|
6
|
+
appBarContent: any
|
|
7
|
+
}
|
|
8
|
+
export const HawaBottomAppBar: React.FunctionComponent<BottomAppBarTypes> = (
|
|
9
|
+
props
|
|
10
|
+
) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="fixed bottom-0 top-auto left-0 m-0 w-full max-w-full p-1">
|
|
13
|
+
<div
|
|
14
|
+
// elevation={3}
|
|
15
|
+
// style={{
|
|
16
|
+
// width: "100%",
|
|
17
|
+
// display: "flex",
|
|
18
|
+
// flexDirection: "row",
|
|
19
|
+
// justifyContent: "space-evenly",
|
|
20
|
+
// borderRadius: 10,
|
|
21
|
+
// alignContent: "center",
|
|
22
|
+
// padding: 10,
|
|
23
|
+
// }}
|
|
24
|
+
className="flex w-full flex-row items-center justify-evenly rounded-lg bg-gray-200"
|
|
25
|
+
// variant="outlined"
|
|
26
|
+
>
|
|
27
|
+
{props.appBarContent.map((singleContent: any) => (
|
|
28
|
+
<div
|
|
29
|
+
className="m-1 flex h-full w-full flex-col items-center justify-center rounded-lg p-2 transition-all hover:cursor-pointer hover:bg-primary-600 hover:text-white"
|
|
30
|
+
onClick={singleContent.action}
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
// sx={{
|
|
34
|
+
// ml: 1,
|
|
35
|
+
// "&.MuiButtonBase-root:hover": {
|
|
36
|
+
// color: "blue",
|
|
37
|
+
// bgcolor: "transparent",
|
|
38
|
+
// },
|
|
39
|
+
// }}
|
|
40
|
+
>
|
|
41
|
+
{singleContent.icon}
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
// sx={{ display: { xs: "none", sm: "none", md: "block" } }}
|
|
45
|
+
className="mt-2 text-sm"
|
|
46
|
+
>
|
|
47
|
+
{singleContent.label}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import clsx from "clsx"
|
|
3
|
+
|
|
4
|
+
type ContainerTypes = {
|
|
5
|
+
maxWidth?: "full" | "small" | "normal"
|
|
6
|
+
children: React.ReactNode
|
|
7
|
+
}
|
|
8
|
+
export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
|
|
9
|
+
maxWidth = "normal",
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
let defaultStyle =
|
|
13
|
+
"flex w-full max-w-sm flex-col rounded-xl bg-primary-300 p-4 dark:bg-gray-600"
|
|
14
|
+
let maxWidthStyles: any = {
|
|
15
|
+
full: "md:max-w-xl",
|
|
16
|
+
small: "md:max-w-sm",
|
|
17
|
+
normal: "md:max-w-md",
|
|
18
|
+
}
|
|
19
|
+
return (
|
|
20
|
+
<div className={clsx(defaultStyle, maxWidthStyles[maxWidth])}>
|
|
21
|
+
{props.children}
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|