@sikka/hawa 0.1.2 → 0.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -107,6 +107,7 @@
107
107
  "dependencies": {
108
108
  "@radix-ui/react-dropdown-menu": "^2.0.5",
109
109
  "@radix-ui/react-label": "^2.0.2",
110
+ "@radix-ui/react-tooltip": "^1.0.6",
110
111
  "class-variance-authority": "^0.7.0",
111
112
  "clsx": "^1.2.1",
112
113
  "cmdk": "^0.2.0",
@@ -1,7 +1,6 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton, HawaPhoneInput, HawaTextField } from "../../elements"
3
2
  import { Controller, FormProvider, useForm } from "react-hook-form"
4
- import { HawaContainer } from "../../layout"
3
+ import { HawaPhoneInput, HawaTextField } from "../../elements"
5
4
  import { Card, CardContent, CardFooter } from "../../elements/Card"
6
5
  import { Button } from "../../elements/Button"
7
6
 
@@ -1,5 +1,4 @@
1
1
  import React, { FC } from "react"
2
- import { HawaContainer } from "../../layout"
3
2
  import { Card, CardContent } from "../../elements/Card"
4
3
 
5
4
  type UserSettingsFormTypes = {
@@ -1,6 +1,5 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton, HawaRadio } from "../../elements"
3
- import { HawaContainer } from "../../layout/HawaContainer"
2
+ import { HawaRadio } from "../../elements"
4
3
  import { Card, CardContent } from "../../elements/Card"
5
4
  import { Button } from "../../elements/Button"
6
5
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState, FC } from "react"
2
- import { HawaTextField, HawaAlert, HawaButton } from "../../elements"
2
+ import { HawaTextField, HawaAlert } from "../../elements"
3
3
  import { Controller, FormProvider, useForm } from "react-hook-form"
4
4
  import {
5
5
  Card,
@@ -3,7 +3,6 @@ import {
3
3
  HawaTextField,
4
4
  HawaLogoButton,
5
5
  HawaAlert,
6
- HawaButton,
7
6
  HawaCheckbox,
8
7
  HawaSelect,
9
8
  } from "../../elements"
@@ -1,6 +1,4 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton } from "../../elements"
3
- import { HawaContainer } from "../../layout"
4
2
  import { Card, CardContent, CardFooter } from "../../elements/Card"
5
3
  import { Button } from "../../elements/Button"
6
4
 
@@ -1,6 +1,4 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton, HawaTextField } from "../../elements"
3
- import { HawaContainer } from "../../layout"
4
2
  import { Input } from "../../elements/Input"
5
3
  import { Button } from "../../elements/Button"
6
4
  import {
@@ -1,5 +1,4 @@
1
1
  import React, { FC } from "react"
2
- import { HawaContainer } from "../../layout"
3
2
  import { Card, CardContent } from "../../elements/Card"
4
3
 
5
4
  type TNoPermission = {
@@ -1,6 +1,4 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton } from "../../elements"
3
- import { HawaContainer } from "../../layout"
4
2
  import { Card, CardContent } from "../../elements/Card"
5
3
  import { Button } from "../../elements/Button"
6
4
 
@@ -1,6 +1,7 @@
1
1
  import React, { useState, FC } from "react"
2
2
  import { HawaButton } from "../../elements"
3
- import { HawaContainer } from "../../layout"
3
+ import { Card, CardContent } from "../../elements/Card"
4
+ import { Button } from "../../elements/Button"
4
5
 
5
6
  type ChargeWalletTypes = {
6
7
  currency: any
@@ -15,27 +16,28 @@ export const ChargeWalletForm: FC<ChargeWalletTypes> = (props) => {
15
16
  const [walletAmount, setWalletAmount] = useState(0)
16
17
 
17
18
  return (
18
- <HawaContainer>
19
- <div className="p-4 text-center">
20
- <div className=" text-5xl font-extrabold">
21
- {Number(walletAmount).toLocaleString("en") || "0"}
19
+ <Card>
20
+ <CardContent headless>
21
+ <div className="p-4 text-center">
22
+ <div className=" text-5xl font-extrabold">
23
+ {Number(walletAmount).toLocaleString("en") || "0"}
24
+ </div>
25
+ <div className="text-sm font-normal">{props.currency || "SAR"}</div>
22
26
  </div>
23
- <div className="text-sm font-normal">{props.currency || "SAR"}</div>
24
- </div>
25
- <div className="mb-2 flex w-full flex-row gap-4 text-center">
26
- <HawaButton variant="outlined" margins="none" className="h-full">
27
- 10 SAR
28
- </HawaButton>
29
- <HawaButton variant="outlined" margins="none" className="h-full">
30
- 100 SAR
31
- </HawaButton>
27
+ <div className="mb-2 flex w-full flex-row gap-4 text-center">
28
+ <HawaButton variant="outlined" margins="none" className="h-full">
29
+ 10 SAR
30
+ </HawaButton>
31
+ <HawaButton variant="outlined" margins="none" className="h-full">
32
+ 100 SAR
33
+ </HawaButton>
32
34
 
33
- <input
34
- placeholder="Custom"
35
- className="h-auto w-full rounded bg-gray-100 p-4"
36
- />
37
- </div>
38
- {/* <FormProvider {...methods}>
35
+ <input
36
+ placeholder="Custom"
37
+ className="h-auto w-full rounded bg-gray-100 p-4"
38
+ />
39
+ </div>
40
+ {/* <FormProvider {...methods}>
39
41
  <form onSubmit={handleSubmit(props.handleChargeWallet)}>
40
42
  <Controller
41
43
  control={control}
@@ -74,9 +76,8 @@ export const ChargeWalletForm: FC<ChargeWalletTypes> = (props) => {
74
76
  </HawaButton>
75
77
  </form>
76
78
  </FormProvider> */}
77
- <HawaButton color="primary" width="full">
78
- {props.texts.chargeWallet}
79
- </HawaButton>
80
- </HawaContainer>
79
+ <Button className="mt-6 w-full">{props.texts.chargeWallet}</Button>
80
+ </CardContent>
81
+ </Card>
81
82
  )
82
83
  }
@@ -1,12 +1,6 @@
1
1
  import React, { FC } from "react"
2
- import {
3
- HawaTextField,
4
- HawaTable,
5
- HawaSelect,
6
- HawaButton,
7
- } from "../../elements"
2
+ import { HawaTextField, HawaTable, HawaSelect } from "../../elements"
8
3
  import { Controller, FormProvider, useForm } from "react-hook-form"
9
- import { HawaContainer } from "../../layout"
10
4
  import countries from "../../countries"
11
5
  import {
12
6
  Card,
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton, HawaTable } from "../../elements"
3
- import { HawaContainer } from "../../layout"
2
+ import { Card, CardContent } from "../../elements/Card"
3
+ import { Button } from "../../elements/Button"
4
4
 
5
5
  type ConfirmationPageTypes = {
6
6
  texts: {
@@ -42,19 +42,20 @@ export const ConfirmationPage: FC<ConfirmationPageTypes> = (props) => {
42
42
  let isArabic = props.lang === "ar"
43
43
 
44
44
  return (
45
- <HawaContainer>
46
- {" "}
47
- <div className="py-5 text-center text-3xl font-bold dark:text-white">
48
- {props.confirmationTitle}
49
- </div>
50
- <div className="py-5 dark:text-white">
51
- <div className="mb-2 text-center">
52
- {props.texts.successMessage} <strong>{props.userEmail}</strong>
45
+ <Card>
46
+ <CardContent headless>
47
+ {" "}
48
+ <div className="py-5 text-center text-3xl font-bold dark:text-white">
49
+ {props.confirmationTitle}
53
50
  </div>
54
- <div className="text-center">{props.texts.yourOrderNumber}</div>
55
- <div className="text-center font-bold">{props.orderNumber}</div>
56
- </div>
57
- {/* <div className="py-5">
51
+ <div className="py-5 dark:text-white">
52
+ <div className="mb-2 text-center">
53
+ {props.texts.successMessage} <strong>{props.userEmail}</strong>
54
+ </div>
55
+ <div className="text-center">{props.texts.yourOrderNumber}</div>
56
+ <div className="text-center font-bold">{props.orderNumber}</div>
57
+ </div>
58
+ {/* <div className="py-5">
58
59
  <div className="mb-3 text-center text-xl font-semibold">
59
60
  {props.texts.orderDetails}
60
61
  </div>
@@ -69,26 +70,27 @@ export const ConfirmationPage: FC<ConfirmationPageTypes> = (props) => {
69
70
  />
70
71
  )}
71
72
  </div> */}
72
- <div className="flex flex-col items-center justify-center py-5 pt-0">
73
- <HawaButton color="primary" width="full" onClick={props.handlePrint}>
74
- {props.texts.print}
75
- </HawaButton>
76
- <HawaButton color="primary" width="full" onClick={props.handleHistory}>
77
- {props.texts.history}
78
- </HawaButton>
79
- <HawaButton color="primary" width="full" onClick={props.handleHome}>
80
- {props.texts.homePage}
81
- </HawaButton>
82
- <div className="mb-5 mt-5 text-center text-sm dark:text-white">
83
- {props.texts.fasterPaymentNote}
73
+ <div className="flex flex-col items-center justify-center gap-4 py-5 pt-0">
74
+ <Button className="w-full" onClick={props.handlePrint}>
75
+ {props.texts.print}
76
+ </Button>
77
+ <Button className="w-full" onClick={props.handleHistory}>
78
+ {props.texts.history}
79
+ </Button>
80
+ <Button className="w-full" onClick={props.handleHome}>
81
+ {props.texts.homePage}
82
+ </Button>
83
+ <div className=" text-center text-sm dark:text-white">
84
+ {props.texts.fasterPaymentNote}
85
+ </div>
86
+ <a
87
+ className="w-fit cursor-pointer text-center text-xs font-normal dark:text-white"
88
+ onClick={props.handleRefundPolicyLink}
89
+ >
90
+ {props.texts.refundPolicy}
91
+ </a>
84
92
  </div>
85
- <a
86
- className="w-fit cursor-pointer text-center text-xs font-normal dark:text-white"
87
- onClick={props.handleRefundPolicyLink}
88
- >
89
- {props.texts.refundPolicy}
90
- </a>
91
- </div>
92
- </HawaContainer>
93
+ </CardContent>
94
+ </Card>
93
95
  )
94
96
  }
@@ -1,7 +1,6 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton, HawaTextField } from "../../elements"
2
+ import { HawaTextField } from "../../elements"
3
3
  import { Controller, useForm } from "react-hook-form"
4
- import { HawaContainer } from "../../layout"
5
4
  import { Card, CardContent, CardFooter } from "../../elements/Card"
6
5
  import { Button } from "../../elements/Button"
7
6
 
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton } from "../../elements"
3
- import { HawaContainer } from "../../layout"
2
+ import { Card, CardContent } from "../../elements/Card"
3
+ import { Button } from "../../elements/Button"
4
4
 
5
5
  type PayWithWalletTypes = {
6
6
  walletBalance: any
@@ -9,18 +9,16 @@ type PayWithWalletTypes = {
9
9
  }
10
10
  export const PayWithWallet: FC<PayWithWalletTypes> = (props) => {
11
11
  return (
12
- <HawaContainer>
13
- <div className="text-center text-5xl font-extrabold">
14
- {props.walletBalance || "0"}
15
- <div className="text-sm font-normal">{props.currency || "SAR"}</div>
16
- </div>
17
- <HawaButton
18
- width="full"
19
- color="primary"
20
- onClick={props.handlePayWithWallet}
21
- >
22
- Pay Now
23
- </HawaButton>
24
- </HawaContainer>
12
+ <Card>
13
+ <CardContent headless>
14
+ <div className="text-center text-5xl font-extrabold">
15
+ {props.walletBalance || "0"}
16
+ <div className="text-sm font-normal">{props.currency || "SAR"}</div>
17
+ </div>
18
+ <Button className="mt-6 w-full" onClick={props.handlePayWithWallet}>
19
+ Pay Now
20
+ </Button>
21
+ </CardContent>
22
+ </Card>
25
23
  )
26
24
  }
@@ -1,6 +1,5 @@
1
1
  import React, { FC } from "react"
2
- import { HawaTypography, HawaLogoButton } from "../../elements"
3
- import { HawaContainer } from "../../layout"
2
+ import { HawaLogoButton } from "../../elements"
4
3
  import { Card, CardContent, CardHeader, CardTitle } from "../../elements/Card"
5
4
 
6
5
  type SelectPaymentTypes = {
@@ -1,5 +1,6 @@
1
1
  import React, { useState, FC } from "react"
2
- import { HawaTabs, HawaTooltip } from "../../elements"
2
+ import { HawaTabs } from "../../elements"
3
+ import { Tooltip } from "../../elements/Tooltip"
3
4
 
4
5
  const CheckMark = () => (
5
6
  <svg
@@ -124,10 +125,7 @@ export const ComparingPlans: FC<ComparingPlansTypes> = (props) => {
124
125
  <div className=" flex flex-row items-center gap-2 text-gray-500 dark:text-gray-400">
125
126
  {feature.text}
126
127
  {feature.description && (
127
- <HawaTooltip
128
- position="top-right"
129
- content={feature.description}
130
- >
128
+ <Tooltip side="right" content={feature.description}>
131
129
  <svg
132
130
  stroke="currentColor"
133
131
  fill="currentColor"
@@ -138,7 +136,7 @@ export const ComparingPlans: FC<ComparingPlansTypes> = (props) => {
138
136
  >
139
137
  <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path>
140
138
  </svg>
141
- </HawaTooltip>
139
+ </Tooltip>
142
140
  )}
143
141
  </div>
144
142
  <UncheckMark />
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from "react"
2
- import { HawaButton } from "../../elements"
3
- import { HawaContainer } from "../../layout"
2
+
4
3
  import { Card, CardContent } from "../../elements/Card"
4
+ import { Button } from "../../elements/Button"
5
5
 
6
6
  type ReferralAccount = {
7
7
  referralLink: string
@@ -19,9 +19,9 @@ export const ReferralAccount: FC<ReferralAccount> = ({
19
19
  <div className="mb-1">Referral Code</div>
20
20
  <div className="flex flex-row items-center justify-between rounded border bg-background">
21
21
  <span className="ml-3 font-bold">{referralCode}</span>
22
- <HawaButton
23
- tooltip="Copy"
24
- className="mr-1.5"
22
+ <Button
23
+ // tooltip="Copy"
24
+ // className="mr-1.5"
25
25
  onClick={() => navigator.clipboard.writeText(referralCode)}
26
26
  >
27
27
  <span className="bg-red flex items-center justify-center">
@@ -36,15 +36,15 @@ export const ReferralAccount: FC<ReferralAccount> = ({
36
36
  <path d="M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z"></path>
37
37
  </svg>{" "}
38
38
  </span>
39
- </HawaButton>
39
+ </Button>
40
40
  </div>
41
41
  </div>
42
42
  <div className="my-2 mt-0">
43
43
  <div className="mb-1">Referral Link</div>
44
44
  <div className="flex flex-row items-center justify-between rounded border bg-background">
45
45
  <span className="ml-3 font-bold">{referralLink}</span>
46
- <HawaButton
47
- className="mr-1.5"
46
+ <Button
47
+ // className="mr-1.5"
48
48
  onClick={() => navigator.clipboard.writeText(referralLink)}
49
49
  >
50
50
  <span className="bg-red flex items-center justify-center">
@@ -59,7 +59,7 @@ export const ReferralAccount: FC<ReferralAccount> = ({
59
59
  <path d="M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z"></path>
60
60
  </svg>{" "}
61
61
  </span>
62
- </HawaButton>
62
+ </Button>
63
63
  </div>
64
64
  </div>
65
65
  </CardContent>
@@ -7,8 +7,8 @@ import {
7
7
  HawaSelect,
8
8
  HawaTextField,
9
9
  } from "../../elements"
10
- import { HawaContainer } from "../../layout"
11
10
  import { Controller, FormProvider, useForm } from "react-hook-form"
11
+ import { Card, CardContent } from "../../elements/Card"
12
12
 
13
13
  type TReferralSettlement = {
14
14
  referralLink: string
@@ -28,69 +28,71 @@ export const ReferralSettlement: FC<TReferralSettlement> = ({
28
28
  control,
29
29
  } = methods
30
30
  return (
31
- <HawaContainer>
32
- <div>
33
- <FormProvider {...methods}>
34
- <HawaTextField label={"IBAN"} />
35
- <HawaTextField label={"Holder Name"} />
36
- <Controller
37
- control={control}
38
- name="bank"
39
- render={({ field }) => (
40
- <HawaSelect
41
- label="Bank"
42
- isCreatable={false}
43
- isMulti={false ?? false}
44
- isSearchable={false}
45
- isClearable={false ?? false}
46
- options={[
47
- { value: "snb", label: "Saudi National Bank" },
48
- { value: "bilad", label: "Al Bilad Bank" },
49
- { value: "rajihi", label: "Al Rajihi Bank" },
50
- ]}
51
- onInputChange={(e: any, o: any) => console.log("changing", e)}
52
- {...field}
53
- onChange={(e: any, o: any) => console.log("chooo", e)}
54
- />
55
- )}
56
- />
57
- </FormProvider>
58
- </div>
59
- <div>
60
- <HawaButton width="full">Add Bank Account</HawaButton>
61
- </div>
62
- {withdrawError && (
31
+ <Card>
32
+ <CardContent headless>
33
+ <div>
34
+ <FormProvider {...methods}>
35
+ <HawaTextField label={"IBAN"} />
36
+ <HawaTextField label={"Holder Name"} />
37
+ <Controller
38
+ control={control}
39
+ name="bank"
40
+ render={({ field }) => (
41
+ <HawaSelect
42
+ label="Bank"
43
+ isCreatable={false}
44
+ isMulti={false ?? false}
45
+ isSearchable={false}
46
+ isClearable={false ?? false}
47
+ options={[
48
+ { value: "snb", label: "Saudi National Bank" },
49
+ { value: "bilad", label: "Al Bilad Bank" },
50
+ { value: "rajihi", label: "Al Rajihi Bank" },
51
+ ]}
52
+ onInputChange={(e: any, o: any) => console.log("changing", e)}
53
+ {...field}
54
+ onChange={(e: any, o: any) => console.log("chooo", e)}
55
+ />
56
+ )}
57
+ />
58
+ </FormProvider>
59
+ </div>
63
60
  <div>
64
- <HawaAlert
65
- text={
66
- "Sorry can't withdraw the money at the moment. Please try again in 2022/11/20"
67
- }
68
- severity="warning"
69
- />
61
+ <HawaButton width="full">Add Bank Account</HawaButton>
70
62
  </div>
71
- )}
72
- <div className="mt-3">
73
- <div className="mb-1">Settlement Accounts</div>
74
- <div className="rounded">
75
- <SettlementAccountCard
76
- bank="Al Inma Bank"
77
- iban="SA10228094028098329119"
78
- accountHolder="Zakher Masri"
79
- default
80
- />
81
- <SettlementAccountCard
82
- bank="Al Rajihi Bank"
83
- iban="SA10228094028098329119"
84
- accountHolder="Zakher Masri"
85
- />
86
- <SettlementAccountCard
87
- bank="Al Inma Bank"
88
- iban="SA10228094028098329119"
89
- accountHolder="Zakher Masri"
90
- />
63
+ {withdrawError && (
64
+ <div>
65
+ <HawaAlert
66
+ text={
67
+ "Sorry can't withdraw the money at the moment. Please try again in 2022/11/20"
68
+ }
69
+ severity="warning"
70
+ />
71
+ </div>
72
+ )}
73
+ <div className="mt-3">
74
+ <div className="mb-1">Settlement Accounts</div>
75
+ <div className="rounded">
76
+ <SettlementAccountCard
77
+ bank="Al Inma Bank"
78
+ iban="SA10228094028098329119"
79
+ accountHolder="Zakher Masri"
80
+ default
81
+ />
82
+ <SettlementAccountCard
83
+ bank="Al Rajihi Bank"
84
+ iban="SA10228094028098329119"
85
+ accountHolder="Zakher Masri"
86
+ />
87
+ <SettlementAccountCard
88
+ bank="Al Inma Bank"
89
+ iban="SA10228094028098329119"
90
+ accountHolder="Zakher Masri"
91
+ />
92
+ </div>
91
93
  </div>
92
- </div>
93
- </HawaContainer>
94
+ </CardContent>
95
+ </Card>
94
96
  )
95
97
  }
96
98
 
@@ -121,7 +123,7 @@ const SettlementAccountCard = (props) => {
121
123
  // position={direction === "rtl" ? "right-bottom" : "left-bottom"}
122
124
  // direction={direction}
123
125
  >
124
- <HawaButton variant="outlined" >
126
+ <HawaButton variant="outlined">
125
127
  <svg
126
128
  aria-label="Vertical Three Dots Menu Icon"
127
129
  className="rotate-90"