@sikka/hawa 0.0.205 → 0.0.207
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 +128 -17
- package/es/elements/HawaButton.d.ts +4 -2
- package/es/elements/HawaChip.d.ts +3 -0
- package/es/elements/HawaCopyrights.d.ts +1 -0
- package/es/elements/HawaPricingCard.d.ts +1 -0
- package/es/elements/{HawaTimeline.d.ts → HawaStepper.d.ts} +1 -1
- package/es/elements/HawaTable.d.ts +7 -2
- package/es/elements/HawaTabs.d.ts +1 -1
- package/es/elements/HawaTooltip.d.ts +0 -1
- package/es/elements/index.d.ts +1 -1
- package/es/index.es.js +1 -1
- package/lib/elements/HawaButton.d.ts +4 -2
- package/lib/elements/HawaChip.d.ts +3 -0
- package/lib/elements/HawaCopyrights.d.ts +1 -0
- package/lib/elements/HawaPricingCard.d.ts +1 -0
- package/lib/elements/{HawaTimeline.d.ts → HawaStepper.d.ts} +1 -1
- package/lib/elements/HawaTable.d.ts +7 -2
- package/lib/elements/HawaTabs.d.ts +1 -1
- package/lib/elements/HawaTooltip.d.ts +0 -1
- package/lib/elements/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -2
- package/src/blocks/AuthForms/NewPasswordForm.tsx +0 -1
- package/src/blocks/AuthForms/SignInPhone.tsx +2 -14
- package/src/blocks/AuthForms/SignUpForm.tsx +1 -5
- package/src/blocks/Pricing/PricingPlans.tsx +16 -10
- package/src/blocks/Referral/ReferralAccount.tsx +0 -2
- package/src/elements/Breadcrumb.tsx +5 -2
- package/src/elements/HawaAccordion.tsx +0 -1
- package/src/elements/HawaButton.tsx +70 -51
- package/src/elements/HawaCheckbox.tsx +0 -1
- package/src/elements/HawaChip.tsx +29 -4
- package/src/elements/HawaCopyrights.tsx +5 -10
- package/src/elements/HawaDrawer.tsx +2 -5
- package/src/elements/HawaItemCard.tsx +0 -13
- package/src/elements/HawaMenu.tsx +1 -2
- package/src/elements/HawaModal.tsx +0 -2
- package/src/elements/HawaPhoneInput.tsx +1 -5
- package/src/elements/HawaPricingCard.tsx +52 -96
- package/src/elements/HawaSelect.tsx +3 -7
- package/src/elements/HawaStepper.tsx +97 -0
- package/src/elements/HawaTable.tsx +224 -209
- package/src/elements/HawaTabs.tsx +10 -18
- package/src/elements/HawaTextField.tsx +7 -8
- package/src/elements/HawaTooltip.tsx +0 -1
- package/src/elements/InvoiceAccordion.tsx +2 -7
- package/src/elements/TabPanel.tsx +0 -13
- package/src/elements/index.ts +1 -1
- package/src/hooks/useBreakpoint.ts +2 -3
- package/src/hooks/useTable.ts +6 -4
- package/src/styles.css +128 -17
- package/src/elements/HawaTimeline.tsx +0 -84
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.207",
|
|
4
4
|
"description": "SaaS Oriented UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.12.10",
|
|
37
37
|
"@babel/preset-react": "^7.12.10",
|
|
38
|
-
"@paypal/react-paypal-js": "^7.6.0",
|
|
39
38
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
40
39
|
"@rollup/plugin-node-resolve": "^11.1.1",
|
|
41
40
|
"@storybook/addon-actions": "^6.5.8",
|
|
@@ -40,16 +40,8 @@ export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
|
|
|
40
40
|
<HawaPhoneInput
|
|
41
41
|
country={props.country ?? ""}
|
|
42
42
|
label={props.label ?? ""}
|
|
43
|
-
handleChange={(e: any) =>
|
|
44
|
-
console.log("test")
|
|
45
|
-
setUserPhone(e.target.value)
|
|
46
|
-
}}
|
|
43
|
+
handleChange={(e: any) => setUserPhone(e.target.value)}
|
|
47
44
|
{...field}
|
|
48
|
-
// handleChange={(e: any) => {
|
|
49
|
-
// // props.handlePhoneChange(e.target.value)
|
|
50
|
-
// setUserPhone(e.target.value)
|
|
51
|
-
// }}
|
|
52
|
-
// value={props.value ?? props.value}
|
|
53
45
|
/>
|
|
54
46
|
)}
|
|
55
47
|
rules={{
|
|
@@ -57,11 +49,7 @@ export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
|
|
|
57
49
|
}}
|
|
58
50
|
/>
|
|
59
51
|
<div className="mt-2"></div>
|
|
60
|
-
<HawaButton
|
|
61
|
-
color="primary"
|
|
62
|
-
width="full"
|
|
63
|
-
// type="submit"
|
|
64
|
-
>
|
|
52
|
+
<HawaButton color="primary" width="full">
|
|
65
53
|
{props.SignInButtonText}
|
|
66
54
|
</HawaButton>
|
|
67
55
|
</form>
|
|
@@ -243,10 +243,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
243
243
|
<HawaCheckbox
|
|
244
244
|
id="terms_accepted"
|
|
245
245
|
helperText={errors.terms_accepted?.message}
|
|
246
|
-
onChange={(e) =>
|
|
247
|
-
console.log("changing ", e)
|
|
248
|
-
field.onChange(e)
|
|
249
|
-
}}
|
|
246
|
+
onChange={(e) => field.onChange(e)}
|
|
250
247
|
label={
|
|
251
248
|
<span>
|
|
252
249
|
{props.texts.iAcceptText}{" "}
|
|
@@ -280,7 +277,6 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
280
277
|
isLoading={props.isLoading}
|
|
281
278
|
color="primary"
|
|
282
279
|
width="full"
|
|
283
|
-
// type="submit"
|
|
284
280
|
>
|
|
285
281
|
{props.texts.signUpText}
|
|
286
282
|
</HawaButton>
|
|
@@ -23,12 +23,12 @@ type PricingPlansTypes = {
|
|
|
23
23
|
export const PricingPlans: React.FunctionComponent<PricingPlansTypes> = (
|
|
24
24
|
props
|
|
25
25
|
) => {
|
|
26
|
-
const [currentCurrency, setCurrentCurrency] = useState("
|
|
27
|
-
const [currentCycle, setCurrentCycle] = useState("
|
|
26
|
+
const [currentCurrency, setCurrentCurrency] = useState("SAR")
|
|
27
|
+
const [currentCycle, setCurrentCycle] = useState("month")
|
|
28
28
|
let cycleOptions = [
|
|
29
|
-
{ label: `Monthly`, value: `
|
|
30
|
-
{ label: `3 Months`, value: `3-months` },
|
|
31
|
-
{ label: `6 Months`, value: `6-months` },
|
|
29
|
+
{ label: `Monthly`, value: `month` },
|
|
30
|
+
// { label: `3 Months`, value: `3-months` },
|
|
31
|
+
// { label: `6 Months`, value: `6-months` },
|
|
32
32
|
{ label: `Annually`, value: `annually` },
|
|
33
33
|
]
|
|
34
34
|
let currencyOptions = [
|
|
@@ -43,14 +43,16 @@ export const PricingPlans: React.FunctionComponent<PricingPlansTypes> = (
|
|
|
43
43
|
<div>
|
|
44
44
|
<div className="mb-2 flex w-full justify-between">
|
|
45
45
|
<HawaTabs
|
|
46
|
+
pill
|
|
46
47
|
defaultValue={currentCycle}
|
|
47
48
|
options={cycleOptions}
|
|
48
|
-
onChangeTab={(e: any) => setCurrentCycle(e)}
|
|
49
|
+
onChangeTab={(e: any) => setCurrentCycle(e.label)}
|
|
49
50
|
/>
|
|
50
51
|
<HawaTabs
|
|
52
|
+
pill
|
|
51
53
|
defaultValue={currentCurrency}
|
|
52
54
|
options={currencyOptions}
|
|
53
|
-
onChangeTab={(e: any) => setCurrentCurrency(e)}
|
|
55
|
+
onChangeTab={(e: any) => setCurrentCurrency(e.label)}
|
|
54
56
|
/>
|
|
55
57
|
</div>
|
|
56
58
|
|
|
@@ -58,11 +60,15 @@ export const PricingPlans: React.FunctionComponent<PricingPlansTypes> = (
|
|
|
58
60
|
{props.plans.map((plan: any) => {
|
|
59
61
|
return (
|
|
60
62
|
<HawaPricingCard
|
|
61
|
-
size="large"
|
|
63
|
+
// size="large"
|
|
64
|
+
// features={plan.features}
|
|
62
65
|
lang={props.lang}
|
|
63
66
|
{...plan}
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
texts={{
|
|
68
|
+
buttonText: "Upgrade",
|
|
69
|
+
currencyText: currentCurrency,
|
|
70
|
+
cycleText: currentCycle,
|
|
71
|
+
}}
|
|
66
72
|
/>
|
|
67
73
|
)
|
|
68
74
|
})}
|
|
@@ -19,7 +19,6 @@ export const ReferralAccount: React.FunctionComponent<ReferralAccount> = ({
|
|
|
19
19
|
<div className="flex flex-row items-center justify-between rounded bg-white">
|
|
20
20
|
<span className="ml-3 font-bold">{referralCode}</span>
|
|
21
21
|
<HawaButton
|
|
22
|
-
buttonID={"refCode"}
|
|
23
22
|
tooltip="Copy"
|
|
24
23
|
className="mr-1.5"
|
|
25
24
|
onClick={() => navigator.clipboard.writeText(referralCode)}
|
|
@@ -35,7 +34,6 @@ export const ReferralAccount: React.FunctionComponent<ReferralAccount> = ({
|
|
|
35
34
|
<div className="flex flex-row items-center justify-between rounded bg-white">
|
|
36
35
|
<span className="ml-3 font-bold">{referralLink}</span>
|
|
37
36
|
<HawaButton
|
|
38
|
-
buttonID={"refLink"}
|
|
39
37
|
className="mr-1.5"
|
|
40
38
|
onClick={() => navigator.clipboard.writeText(referralLink)}
|
|
41
39
|
>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from "react"
|
|
2
|
-
import { IconType } from "react-icons"
|
|
3
2
|
|
|
4
3
|
type TBreadcrumItem = {
|
|
5
4
|
label: string
|
|
@@ -22,7 +21,11 @@ const Breadcrumb: FC<TBreadcrumb> = ({
|
|
|
22
21
|
<div className="flex flex-row items-center justify-center gap-2">
|
|
23
22
|
<a
|
|
24
23
|
href={singleBreadcrumbLink.href}
|
|
25
|
-
className=
|
|
24
|
+
className={
|
|
25
|
+
index + 1 === breadcrumbLink.length
|
|
26
|
+
? "pointer-events-none"
|
|
27
|
+
: "underline-offset-4 transition-all hover:text-buttonPrimary-500 hover:underline hover:decoration-2"
|
|
28
|
+
}
|
|
26
29
|
>
|
|
27
30
|
{singleBreadcrumbLink.label}
|
|
28
31
|
</a>
|
|
@@ -26,7 +26,6 @@ const AccordionItem: React.FunctionComponent<AccordionItemTypes> = (props) => {
|
|
|
26
26
|
id={"accordion-collapse-heading-" + props.count}
|
|
27
27
|
type="button"
|
|
28
28
|
className={clsx(
|
|
29
|
-
// props.count === 0 ? roundedTop : noRounding,
|
|
30
29
|
collapse ? "rounded" : "rounded-t",
|
|
31
30
|
"flex w-full items-center justify-between border border-gray-200 bg-gray-100 p-5 text-left font-medium text-gray-900 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-800 dark:focus:ring-gray-800"
|
|
32
31
|
)}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react"
|
|
2
2
|
import clsx from "clsx"
|
|
3
3
|
import { HawaSpinner } from "./HawaSpinner"
|
|
4
4
|
import { HawaTooltip } from "./HawaTooltip"
|
|
5
|
-
import useHover from "../hooks/useHover"
|
|
6
5
|
|
|
7
6
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
7
|
variant?: "contained" | "outlined"
|
|
9
|
-
buttonID?: any
|
|
10
8
|
tooltipDirection?: "rtl" | "ltr"
|
|
11
9
|
color?: "default" | "primary" | "secondary"
|
|
12
10
|
width?: "full" | "normal" | "half"
|
|
@@ -23,46 +21,10 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
23
21
|
| "top-left"
|
|
24
22
|
| "bottom-right"
|
|
25
23
|
| "bottom-left"
|
|
24
|
+
startIcon?: any
|
|
25
|
+
endIcon?: any
|
|
26
26
|
isLoading?: boolean
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const baseStyles = "cursor-pointer font-medium rounded h-full transition-all"
|
|
30
|
-
|
|
31
|
-
const sizeStyles = {
|
|
32
|
-
xs: "px-1 py-1",
|
|
33
|
-
small: "text-xs px-2.5 py-1.5",
|
|
34
|
-
medium: "text-sm leading-4 px-3 py-2",
|
|
35
|
-
large: "text-sm px-4 py-2",
|
|
36
|
-
noPadding: "p-0",
|
|
37
|
-
full: "h-full max-h-full p-2",
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const widthStyles = {
|
|
41
|
-
full: "w-full flex justify-center px-5 py-2.5 text-center inline-flex items-center",
|
|
42
|
-
normal:
|
|
43
|
-
"w-fit dark:bg-buttonPrimary-dark dark:hover:bg-buttonPrimary-700 dark:hover:brightness-90 dark:focus:ring-buttonPrimary-500",
|
|
44
|
-
half: "w-1/2",
|
|
45
|
-
}
|
|
46
|
-
const variantStyles = {
|
|
47
|
-
contained: "border-transparent",
|
|
48
|
-
outlined: "bg-transparent border",
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const colorStyles = {
|
|
52
|
-
contained: {
|
|
53
|
-
default:
|
|
54
|
-
"text-neutral-900 bg-buttonPrimary-500 hover:bg-buttonPrimary-700 bg-buttonPrimary-500 text-white",
|
|
55
|
-
primary:
|
|
56
|
-
"text-white bg-buttonPrimary-500 hover:bg-buttonPrimary-700 transition-all",
|
|
57
|
-
secondary:
|
|
58
|
-
"text-neutral-900 bg-buttonSecondary-default hover:text-white hover:bg-buttonSecondary-700",
|
|
59
|
-
},
|
|
60
|
-
outlined: {
|
|
61
|
-
default: "text-gray-600 border-gray-600 hover:bg-gray-200",
|
|
62
|
-
primary: "text-black hover:bg-gray-50",
|
|
63
|
-
secondary:
|
|
64
|
-
"text-secondary-800 border-secondary-800 hover:bg-buttonSecondary-700 hover:text-white",
|
|
65
|
-
},
|
|
27
|
+
badge?: any
|
|
66
28
|
}
|
|
67
29
|
|
|
68
30
|
const disabledSyles = "cursor-default pointer-events-none"
|
|
@@ -71,7 +33,7 @@ const disabledVariantSyles = {
|
|
|
71
33
|
outlined: "text-gray-300 border-gray-300",
|
|
72
34
|
}
|
|
73
35
|
|
|
74
|
-
export
|
|
36
|
+
export const HawaButton: React.FunctionComponent<ButtonProps> = ({
|
|
75
37
|
className,
|
|
76
38
|
variant = "contained",
|
|
77
39
|
color = "default",
|
|
@@ -85,12 +47,60 @@ export function HawaButton({
|
|
|
85
47
|
tooltipDirection = "ltr",
|
|
86
48
|
margins = "2",
|
|
87
49
|
children,
|
|
88
|
-
|
|
50
|
+
badge,
|
|
89
51
|
...props
|
|
90
|
-
}
|
|
52
|
+
}) => {
|
|
53
|
+
const baseStyles = "cursor-pointer font-medium rounded h-full transition-all"
|
|
54
|
+
|
|
55
|
+
const sizeStyles = {
|
|
56
|
+
xs: "px-1 py-1",
|
|
57
|
+
small: "text-xs px-2.5 py-1.5",
|
|
58
|
+
medium: "text-sm leading-4 px-3 py-2",
|
|
59
|
+
large: "text-sm px-4 py-2",
|
|
60
|
+
noPadding: "p-0",
|
|
61
|
+
full: "h-full max-h-full p-2",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const widthStyles = {
|
|
65
|
+
full: "w-full flex justify-center px-5 py-2.5 text-center inline-flex items-center",
|
|
66
|
+
half: "w-full text-center flex items-center justify-center h-full",
|
|
67
|
+
normal:
|
|
68
|
+
"w-fit dark:bg-buttonPrimary-dark dark:hover:bg-buttonPrimary-700 dark:hover:brightness-90 dark:focus:ring-buttonPrimary-500",
|
|
69
|
+
}
|
|
70
|
+
const containerWidthStyles = {
|
|
71
|
+
full: "w-full flex justify-center text-center inline-flex items-center",
|
|
72
|
+
half: "w-1/2",
|
|
73
|
+
normal: "w-fit",
|
|
74
|
+
}
|
|
75
|
+
const variantStyles = {
|
|
76
|
+
contained: "border-transparent",
|
|
77
|
+
outlined: "bg-transparent border",
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const colorStyles = {
|
|
81
|
+
contained: {
|
|
82
|
+
default:
|
|
83
|
+
"text-neutral-900 bg-buttonPrimary-500 hover:bg-buttonPrimary-700 bg-buttonPrimary-500 text-white",
|
|
84
|
+
primary:
|
|
85
|
+
"text-white bg-buttonPrimary-500 hover:bg-buttonPrimary-700 transition-all",
|
|
86
|
+
secondary:
|
|
87
|
+
"text-neutral-900 bg-buttonSecondary-default hover:text-white hover:bg-buttonSecondary-700",
|
|
88
|
+
},
|
|
89
|
+
outlined: {
|
|
90
|
+
default: "text-gray-600 border-gray-600 hover:bg-gray-200",
|
|
91
|
+
primary: "text-black hover:bg-gray-50",
|
|
92
|
+
secondary:
|
|
93
|
+
"text-secondary-800 border-secondary-800 hover:bg-buttonSecondary-700 hover:text-white",
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
|
|
91
97
|
return (
|
|
92
98
|
<div
|
|
93
|
-
className={clsx(
|
|
99
|
+
className={clsx(
|
|
100
|
+
"relative",
|
|
101
|
+
margins !== "none" ? `my-${margins}` : "m-0",
|
|
102
|
+
containerWidthStyles[width]
|
|
103
|
+
)}
|
|
94
104
|
>
|
|
95
105
|
{tooltip ? (
|
|
96
106
|
<HawaTooltip
|
|
@@ -100,7 +110,6 @@ export function HawaButton({
|
|
|
100
110
|
content={tooltip}
|
|
101
111
|
>
|
|
102
112
|
<button
|
|
103
|
-
// type={props.type}
|
|
104
113
|
className={
|
|
105
114
|
disabled
|
|
106
115
|
? clsx(
|
|
@@ -123,14 +132,12 @@ export function HawaButton({
|
|
|
123
132
|
}
|
|
124
133
|
disabled={disabled}
|
|
125
134
|
onClick={props.onClick}
|
|
126
|
-
// {...props}
|
|
127
135
|
>
|
|
128
136
|
{!isLoading ? children : <HawaSpinner size="button" />}
|
|
129
137
|
</button>
|
|
130
138
|
</HawaTooltip>
|
|
131
139
|
) : (
|
|
132
140
|
<button
|
|
133
|
-
// type={props.type}
|
|
134
141
|
className={
|
|
135
142
|
disabled
|
|
136
143
|
? clsx(
|
|
@@ -153,11 +160,23 @@ export function HawaButton({
|
|
|
153
160
|
}
|
|
154
161
|
disabled={disabled}
|
|
155
162
|
onClick={props.onClick}
|
|
156
|
-
// {...props}
|
|
157
163
|
>
|
|
158
|
-
{!isLoading ?
|
|
164
|
+
{!isLoading ? (
|
|
165
|
+
<div className="flex flex-row items-center gap-2 whitespace-nowrap">
|
|
166
|
+
{props.startIcon && props.startIcon}
|
|
167
|
+
{children}
|
|
168
|
+
{props.endIcon && props.endIcon}
|
|
169
|
+
</div>
|
|
170
|
+
) : (
|
|
171
|
+
<HawaSpinner size="button" />
|
|
172
|
+
)}
|
|
159
173
|
</button>
|
|
160
174
|
)}
|
|
175
|
+
{badge && (
|
|
176
|
+
<div className="absolute -top-3 -right-3 inline-flex h-6 w-6 items-center justify-center rounded-full border-2 border-white bg-red-500 text-xs font-bold text-white dark:border-gray-900">
|
|
177
|
+
{badge}
|
|
178
|
+
</div>
|
|
179
|
+
)}
|
|
161
180
|
</div>
|
|
162
181
|
)
|
|
163
182
|
}
|
|
@@ -5,21 +5,46 @@ type TChipTypes = {
|
|
|
5
5
|
label: string
|
|
6
6
|
size?: "small" | "normal" | "large"
|
|
7
7
|
icon?: JSX.Element
|
|
8
|
+
color?: string
|
|
9
|
+
dot?: boolean
|
|
10
|
+
dotType?: "available" | "unavailable"
|
|
8
11
|
}
|
|
9
12
|
export const HawaChip: React.FunctionComponent<TChipTypes> = ({
|
|
10
13
|
size = "normal",
|
|
11
14
|
label,
|
|
12
15
|
icon,
|
|
16
|
+
color,
|
|
17
|
+
dot,
|
|
18
|
+
dotType = "available",
|
|
13
19
|
}) => {
|
|
14
20
|
let defaultStyles =
|
|
15
|
-
"flex flex-row w-fit gap-1 items-center rounded
|
|
21
|
+
"flex flex-row w-fit gap-1 items-center rounded px-2.5 py-0.5 font-bold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
|
|
16
22
|
let sizeStyles = {
|
|
17
|
-
small: "h-
|
|
18
|
-
normal: "h-
|
|
23
|
+
small: "h-full leading-4 px-1 py-0 text-[9px] gap-0.5 ",
|
|
24
|
+
normal: "h-fit text-xs",
|
|
19
25
|
large: "",
|
|
20
26
|
}
|
|
27
|
+
|
|
28
|
+
let dotStyles = {
|
|
29
|
+
small: "flex h-1 w-1 rounded-full",
|
|
30
|
+
normal: "flex h-2 w-2 rounded-full",
|
|
31
|
+
large: "flex h-3 w-3 rounded-full",
|
|
32
|
+
}
|
|
33
|
+
let dotTypeStyles = {
|
|
34
|
+
available: "bg-green-500",
|
|
35
|
+
unavailable: "bg-red-500",
|
|
36
|
+
}
|
|
21
37
|
return (
|
|
22
|
-
<span
|
|
38
|
+
<span
|
|
39
|
+
className={clsx(
|
|
40
|
+
defaultStyles,
|
|
41
|
+
sizeStyles[size],
|
|
42
|
+
color ? `bg-${color}-100 text-${color}-500` : "bg-layoutPrimary-500"
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{dot && (
|
|
46
|
+
<span className={clsx(dotStyles[size], dotTypeStyles[dotType])}></span>
|
|
47
|
+
)}
|
|
23
48
|
{icon && icon}
|
|
24
49
|
{label}
|
|
25
50
|
</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
3
|
type CopyRightsTypes = {
|
|
4
4
|
withLogo?: boolean
|
|
@@ -6,6 +6,7 @@ type CopyRightsTypes = {
|
|
|
6
6
|
version?: string
|
|
7
7
|
credits?: string
|
|
8
8
|
logoURL?: string
|
|
9
|
+
onLogoClicked?: any
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const HawaCopyrights: React.FunctionComponent<CopyRightsTypes> = (
|
|
@@ -14,15 +15,9 @@ export const HawaCopyrights: React.FunctionComponent<CopyRightsTypes> = (
|
|
|
14
15
|
return (
|
|
15
16
|
<div className="my-2 flex flex-col items-center justify-center gap-1 text-xs text-gray-400">
|
|
16
17
|
{props.withLogo ? (
|
|
17
|
-
<a href={
|
|
18
|
-
<div
|
|
19
|
-
<image
|
|
20
|
-
// src={props.logoURL}
|
|
21
|
-
href={props.logoURL}
|
|
22
|
-
// alt="Qawaim"
|
|
23
|
-
width={100}
|
|
24
|
-
height={50}
|
|
25
|
-
/>
|
|
18
|
+
<a href={props.onLogoClicked}>
|
|
19
|
+
<div className="cursor-pointer">
|
|
20
|
+
<image href={props.logoURL} width={100} height={50} />
|
|
26
21
|
</div>
|
|
27
22
|
</a>
|
|
28
23
|
) : null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC, ReactElement, ReactNode
|
|
1
|
+
import React, { FC, ReactElement, ReactNode } from "react"
|
|
2
2
|
import { FaChevronLeft, FaChevronRight } from "react-icons/fa"
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
@@ -68,10 +68,7 @@ const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
|
68
68
|
{props.children}
|
|
69
69
|
<div
|
|
70
70
|
className="justify-self-end rounded border p-1 hover:cursor-pointer"
|
|
71
|
-
onClick={() =>
|
|
72
|
-
console.log("running")
|
|
73
|
-
props.setOpen(false)
|
|
74
|
-
}}
|
|
71
|
+
onClick={() => props.setOpen(false)}
|
|
75
72
|
>
|
|
76
73
|
{props.direction == "left" ? (
|
|
77
74
|
<FaChevronLeft size={20} strokeWidth={2} />
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import clsx from "clsx"
|
|
2
2
|
import React, { useEffect } from "react"
|
|
3
3
|
import { useState } from "react"
|
|
4
|
-
import useDiscloser from "../hooks/useDiscloser"
|
|
5
4
|
import { HawaMenu } from "./HawaMenu"
|
|
6
5
|
|
|
7
6
|
interface ItemCardTypes {
|
|
@@ -46,17 +45,6 @@ export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
|
46
45
|
"inline-block rounded p-1 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-700"
|
|
47
46
|
|
|
48
47
|
const [openActionHeader, setOpenActionHeader] = useState(false)
|
|
49
|
-
// const {
|
|
50
|
-
// isOpen: isActionOpen,
|
|
51
|
-
// onClose: onActionClose,
|
|
52
|
-
// onOpen: onActionOpen,
|
|
53
|
-
// } = useDiscloser()
|
|
54
|
-
// const {
|
|
55
|
-
// isOpen: isDropDownOpen,
|
|
56
|
-
// onClose: onDropDownClose,
|
|
57
|
-
// onOpen: onDropDownOpen,
|
|
58
|
-
// } = useDiscloser()
|
|
59
|
-
// const [openDropDown, setOpenDropDown] = useState(false)
|
|
60
48
|
|
|
61
49
|
function handleOpenActionHeader() {
|
|
62
50
|
setOpenActionHeader(!openActionHeader)
|
|
@@ -64,7 +52,6 @@ export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
|
64
52
|
|
|
65
53
|
useEffect((): any => {
|
|
66
54
|
window.onclick = () => {
|
|
67
|
-
console.log("clicking, state = ", openActionHeader)
|
|
68
55
|
if (openActionHeader) {
|
|
69
56
|
setOpenActionHeader(false)
|
|
70
57
|
}
|
|
@@ -69,7 +69,6 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
69
69
|
setMenuOpened(false)
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
console.log("ref is", menuRef.current?.getBoundingClientRect())
|
|
73
72
|
document.addEventListener("click", handleClickOutside, true)
|
|
74
73
|
return () => {
|
|
75
74
|
document.removeEventListener("click", handleClickOutside, true)
|
|
@@ -88,7 +87,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
88
87
|
closed: "h-0 invisible opacity-0 hidden",
|
|
89
88
|
}
|
|
90
89
|
let sizeStyles = {
|
|
91
|
-
small: "text-[11px] p-1 m-0",
|
|
90
|
+
small: "text-[11px] p-1 px-4 m-0",
|
|
92
91
|
normal: "py-2 px-4",
|
|
93
92
|
large: "",
|
|
94
93
|
}
|
|
@@ -84,17 +84,13 @@ export const HawaPhoneInput: React.FunctionComponent<HawaPhoneInputTypes> = (
|
|
|
84
84
|
IndicatorSeparator: () => null,
|
|
85
85
|
}}
|
|
86
86
|
options={Countries}
|
|
87
|
-
// isCreatable={false}
|
|
88
87
|
isMulti={false}
|
|
89
88
|
isSearchable={true}
|
|
90
89
|
isClearable={false}
|
|
91
90
|
placeholder="+966"
|
|
92
91
|
defaultValue={props.preferredCountry}
|
|
93
92
|
value={selectedCountry}
|
|
94
|
-
onChange={(newValue, action) =>
|
|
95
|
-
console.log("test n", newValue)
|
|
96
|
-
setSelectedCountry(newValue)
|
|
97
|
-
}}
|
|
93
|
+
onChange={(newValue, action) => setSelectedCountry(newValue)}
|
|
98
94
|
/>
|
|
99
95
|
<input
|
|
100
96
|
onChange={props.handleChange}
|