@sikka/hawa 0.1.87 → 0.1.89

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 CHANGED
@@ -1099,6 +1099,9 @@ video {
1099
1099
  .h-14 {
1100
1100
  height: 3.5rem;
1101
1101
  }
1102
+ .h-16 {
1103
+ height: 4rem;
1104
+ }
1102
1105
  .h-2 {
1103
1106
  height: 0.5rem;
1104
1107
  }
@@ -1255,6 +1258,9 @@ video {
1255
1258
  .w-14 {
1256
1259
  width: 3.5rem;
1257
1260
  }
1261
+ .w-16 {
1262
+ width: 4rem;
1263
+ }
1258
1264
  .w-2 {
1259
1265
  width: 0.5rem;
1260
1266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.1.87",
3
+ "version": "0.1.89",
4
4
  "description": "Modern UI Kit made with Tailwind & Radix Primitives",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -0,0 +1,54 @@
1
+ import React, { useState, FC } from "react"
2
+ import { HawaAlert, HawaPinInput } from "../../elements"
3
+ import { Card, CardContent, CardFooter } from "../../elements/Card"
4
+ import { Button } from "../../elements/Button"
5
+
6
+ type CheckEmailBlocks = {
7
+ texts?: {
8
+ checkEmail: string
9
+ resendEmail: string
10
+ pleaseVerify: string
11
+ }
12
+ handleResend?: () => void
13
+ }
14
+
15
+ export const CheckEmail: FC<CheckEmailBlocks> = ({ texts, handleResend }) => {
16
+ return (
17
+ <Card>
18
+ <CardContent headless>
19
+ <div className="flex flex-col items-center justify-center text-center">
20
+ <div className="flex h-16 w-16 flex-col items-center justify-center rounded-3xl bg-primary text-6xl font-bold text-primary-foreground">
21
+ <svg
22
+ stroke="currentColor"
23
+ fill="none"
24
+ stroke-width="2"
25
+ viewBox="0 0 24 24"
26
+ stroke-linecap="round"
27
+ stroke-linejoin="round"
28
+ height="0.5em"
29
+ width="0.5em"
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ // {...props}
32
+ >
33
+ <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
34
+ <polyline points="22,6 12,13 2,6"></polyline>
35
+ </svg>
36
+ </div>
37
+ <div className="m-2 text-xl font-bold">
38
+ {texts?.checkEmail ?? "Check you email"}
39
+ </div>
40
+
41
+ <div className="text-sm">
42
+ {texts?.pleaseVerify ??
43
+ "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."}
44
+ </div>
45
+ </div>
46
+ </CardContent>
47
+ <CardFooter className="flex flex-col justify-center ">
48
+ <span className="clickable-link text-sm" onClick={handleResend}>
49
+ {texts?.resendEmail ?? "Resend Email"}
50
+ </span>
51
+ </CardFooter>
52
+ </Card>
53
+ )
54
+ }
@@ -15,7 +15,7 @@ type ResetPasswordType = {
15
15
  handleResetPassword: () => void
16
16
  handleRouteToSignUp: () => void
17
17
  sent: any
18
- texts: {
18
+ texts?: {
19
19
  emailLabel: string
20
20
  emailPlaceholder: string
21
21
  emailRequiredText: string
@@ -54,42 +54,42 @@ export const ResetPasswordForm: FC<ResetPasswordType> = (props) => {
54
54
  <HawaTextField
55
55
  width="full"
56
56
  type="text"
57
- label={props.texts.emailLabel}
57
+ label={props.texts?.emailLabel}
58
58
  helpertext={errors.email?.message}
59
- placeholder={props.texts.emailPlaceholder}
59
+ placeholder={props.texts?.emailPlaceholder}
60
60
  {...field}
61
61
  value={field.value ?? ""}
62
62
  />
63
63
  )}
64
64
  rules={{
65
- required: props.texts.emailRequiredText,
65
+ required: props.texts?.emailRequiredText,
66
66
  pattern: {
67
67
  value:
68
68
  /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
69
- message: props.texts.emailInvalidText,
69
+ message: props.texts?.emailInvalidText,
70
70
  },
71
71
  }}
72
72
  />
73
73
  <div className=" pb-2 text-left text-sm dark:text-gray-300">
74
- {props.texts.dontHaveAccount ?? "Don't have an account? "}
74
+ {props.texts?.dontHaveAccount ?? "Don't have an account? "}
75
75
  <span
76
76
  onClick={props.handleRouteToSignUp}
77
77
  className="clickable-link"
78
78
  >
79
- {props.texts.signUpText ?? "Sign Up"}
79
+ {props.texts?.signUpText ?? "Sign Up"}
80
80
  </span>
81
81
  </div>
82
82
  </CardContent>
83
83
  <CardFooter>
84
84
  <Button type="submit" className="w-full">
85
- {props.texts.resetPassword}
85
+ {props.texts?.resetPassword}
86
86
  </Button>
87
87
  </CardFooter>
88
88
  </form>
89
89
  </>
90
90
  ) : (
91
91
  <CardContent headless>
92
- <div className="text-center">{props.texts.emailSentText}</div>
92
+ <div className="text-center">{props.texts?.emailSentText}</div>
93
93
  </CardContent>
94
94
  )}
95
95
  </Card>
@@ -6,3 +6,4 @@ export * from "./SignUpForm"
6
6
  export * from "./NewPasswordForm"
7
7
  export * from "./ResetPasswordForm"
8
8
  export * from "./CodeConfirmation"
9
+ export * from "./CheckEmail"
@@ -2,17 +2,13 @@ import React, { FC } from "react"
2
2
  import { Card, CardContent } from "../../elements/Card"
3
3
 
4
4
  type TNoPermission = {
5
- variant?: "outlined" | "contained" | "neobrutalism"
6
5
  texts?: {
7
6
  title: string
8
7
  subtitle: string
9
8
  }
10
9
  }
11
10
 
12
- export const NoPermission: FC<TNoPermission> = ({
13
- variant = "contained",
14
- texts,
15
- }) => {
11
+ export const NoPermission: FC<TNoPermission> = ({ texts }) => {
16
12
  return (
17
13
  <Card>
18
14
  <CardContent headless>
@@ -1,14 +1,40 @@
1
1
  import clsx from "clsx"
2
- import React, { FC } from "react"
2
+ import React, { FC, useState, useEffect, useRef } from "react"
3
3
 
4
4
  type AdCardTypes = {
5
5
  orientation: "vertical" | "horizontal"
6
6
  title: string
7
7
  description: string
8
8
  imageURL: string
9
- handleHide: any
9
+ handleHide?: any
10
+ handleCantHide?: () => void
11
+ canHide: boolean
10
12
  }
11
13
  export const HawaAdCard: FC<AdCardTypes> = ({ orientation, ...props }) => {
14
+ const adRef = useRef(null)
15
+ const [closed, setClosed] = useState(false)
16
+
17
+ let duration = 0
18
+
19
+ useEffect(() => {
20
+ if (duration) {
21
+ //To change opacity and hide the component
22
+ const timeoutHide = setTimeout(() => {
23
+ setClosed(true)
24
+ }, duration)
25
+ //To destroy the component after hiding it
26
+ const timeoutDestroy = setTimeout(() => {
27
+ setClosed(true)
28
+ adRef.current.removeChild(adRef.current.children[0])
29
+ }, duration + 1000)
30
+
31
+ return () => {
32
+ clearTimeout(timeoutHide)
33
+ clearTimeout(timeoutDestroy)
34
+ }
35
+ }
36
+ }, [duration])
37
+
12
38
  let cardStyles = {
13
39
  horizontal:
14
40
  "flex flex-row max-w-xl rounded border-gray-200 bg-gray-100 shadow-md p-2 gap-2 items-center relative dark:border-gray-700 dark:bg-gray-800 ",
@@ -22,28 +48,40 @@ export const HawaAdCard: FC<AdCardTypes> = ({ orientation, ...props }) => {
22
48
  }
23
49
 
24
50
  return (
25
- <div
26
- className={clsx(cardStyles[orientation], "dark:text-white")}
27
- {...props}
28
- >
29
- <div className="flex aspect-square w-full max-w-fit items-start ">
30
- <img
31
- src={
32
- props.imageURL ? props.imageURL : "https://via.placeholder.com/50"
33
- }
34
- className={imageStyles[orientation]}
35
- />
36
- </div>
37
- <div className="w-full text-xs">
38
- <div className="font-bold">{props.title}</div>
39
- <div className="text-[12px]">{props.description}</div>
40
- </div>
41
- <span
42
- onClick={props.handleHide}
43
- className="absolute right-0 top-0 h-fit cursor-pointer select-none rounded-bl-lg rounded-tr-lg bg-blue-100 px-2.5 py-0.5 text-[10px] font-semibold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
51
+ <div ref={adRef}>
52
+ <div
53
+ className={clsx(cardStyles[orientation], "dark:text-white")}
54
+ {...props}
44
55
  >
45
- Hide
46
- </span>
56
+ <div className="flex aspect-square w-full max-w-fit items-start ">
57
+ <img
58
+ src={
59
+ props.imageURL ? props.imageURL : "https://via.placeholder.com/50"
60
+ }
61
+ className={imageStyles[orientation]}
62
+ />
63
+ </div>
64
+ <div className="w-full text-xs">
65
+ <div className="font-bold">{props.title}</div>
66
+ <div className="text-[12px]">{props.description}</div>
67
+ </div>
68
+ <span
69
+ // onClick={props.handleHide}
70
+ onClick={() => {
71
+ if (props.canHide) {
72
+ setClosed(true)
73
+ setTimeout(() => {
74
+ adRef.current.removeChild(adRef.current.children[0])
75
+ }, 200)
76
+ } else {
77
+ props.handleCantHide()
78
+ }
79
+ }}
80
+ className="absolute right-0 top-0 h-fit cursor-pointer select-none rounded-bl-lg rounded-tr-lg bg-blue-100 px-2.5 py-0.5 text-[10px] font-semibold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
81
+ >
82
+ Hide
83
+ </span>
84
+ </div>
47
85
  </div>
48
86
  )
49
87
  }
package/src/styles.css CHANGED
@@ -1099,6 +1099,9 @@ video {
1099
1099
  .h-14 {
1100
1100
  height: 3.5rem;
1101
1101
  }
1102
+ .h-16 {
1103
+ height: 4rem;
1104
+ }
1102
1105
  .h-2 {
1103
1106
  height: 0.5rem;
1104
1107
  }
@@ -1255,6 +1258,9 @@ video {
1255
1258
  .w-14 {
1256
1259
  width: 3.5rem;
1257
1260
  }
1261
+ .w-16 {
1262
+ width: 4rem;
1263
+ }
1258
1264
  .w-2 {
1259
1265
  width: 0.5rem;
1260
1266
  }
@@ -43,5 +43,8 @@
43
43
  "password": "كلمة المرور",
44
44
  "settings": "الإعدادات",
45
45
  "display": "المظهر",
46
- "option": "خيار"
46
+ "option": "خيار",
47
+ "checkEmail": "تحقق من بريدك الإلكتروني",
48
+ "resendEmail": "إعادة إرسال البريد الإلكتروني",
49
+ "pleaseVerify": "شكرًا لتسجيلك! لإتمام عملية التسجيل، قمنا بإرسال بريد إلكتروني للتحقق إلى العنوان الذي قدمته. يُرجى التحقق من صندوق الوارد الخاص بك واتباع التعليمات الموجودة في البريد الإلكتروني لتنشيط حسابك"
47
50
  }
@@ -42,5 +42,8 @@
42
42
  "password": "Password",
43
43
  "settings": "Settings",
44
44
  "display": "Display",
45
- "option": "Option"
45
+ "option": "Option",
46
+ "checkEmail": "Check you email",
47
+ "resendEmail": "Resend Email",
48
+ "pleaseVerify": "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."
46
49
  }
package/tsup.config.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ splitting: true,
3
+ sourcemap: true,
4
+ clean: true,
5
+ dts: true,
6
+ external: ["react", "react-dom", "react-icons"]
7
+ };