@sikka/hawa 0.1.91 → 0.1.92

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
@@ -2428,6 +2428,9 @@ video {
2428
2428
  .text-right {
2429
2429
  text-align: right;
2430
2430
  }
2431
+ .text-start {
2432
+ text-align: start;
2433
+ }
2431
2434
  .align-middle {
2432
2435
  vertical-align: middle;
2433
2436
  }
@@ -2952,6 +2955,10 @@ video {
2952
2955
  .repeat-infinite {
2953
2956
  animation-iteration-count: infinite;
2954
2957
  }
2958
+ .shadow-color-primary {
2959
+ --tw-shadow: 0.25rem 0.25rem hsl(var(--primary));
2960
+ box-shadow: var(--tw-shadow);
2961
+ }
2955
2962
  /* Chrome, Safari and Opera */
2956
2963
  .no-scrollbar::-webkit-scrollbar {
2957
2964
  display: none;
@@ -3321,6 +3328,26 @@ body {
3321
3328
  .focus-visible\:ring-offset-2:focus-visible {
3322
3329
  --tw-ring-offset-width: 2px;
3323
3330
  }
3331
+ .active\:translate-x-0:active {
3332
+ --tw-translate-x: 0px;
3333
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3334
+ }
3335
+ .active\:translate-x-0\.5:active {
3336
+ --tw-translate-x: 0.125rem;
3337
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3338
+ }
3339
+ .active\:translate-y-0:active {
3340
+ --tw-translate-y: 0px;
3341
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3342
+ }
3343
+ .active\:translate-y-0\.5:active {
3344
+ --tw-translate-y: 0.125rem;
3345
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3346
+ }
3347
+ .active\:shadow-color-primary-active:active {
3348
+ --tw-shadow: 0.125rem 0.125rem hsl(var(--primary));
3349
+ box-shadow: var(--tw-shadow);
3350
+ }
3324
3351
  .disabled\:pointer-events-none:disabled {
3325
3352
  pointer-events: none;
3326
3353
  }
@@ -3798,6 +3825,10 @@ body {
3798
3825
  :is(.dark .dark\:bg-background) {
3799
3826
  background-color: hsl(var(--background));
3800
3827
  }
3828
+ :is(.dark .dark\:bg-black) {
3829
+ --tw-bg-opacity: 1;
3830
+ background-color: rgb(0 0 0 / var(--tw-bg-opacity));
3831
+ }
3801
3832
  :is(.dark .dark\:bg-blue-200) {
3802
3833
  --tw-bg-opacity: 1;
3803
3834
  background-color: rgb(191 219 254 / var(--tw-bg-opacity));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.1.91",
3
+ "version": "0.1.92",
4
4
  "description": "Modern UI Kit made with Tailwind & Radix Primitives",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -5,72 +5,121 @@ import { Button } from "../../elements/Button"
5
5
  import { Icons } from "../../elements/Icons"
6
6
 
7
7
  type AppLandingTypes = {
8
- handleSignIn: () => void
9
- handleSignUp: () => void
10
- handleLanguage: () => void
11
- handleColorMode: () => void
12
8
  texts?: {
13
9
  signIn: string
14
10
  signUp: string
15
11
  lang: string
16
12
  newUserText?: string
17
13
  createAccount?: string
14
+ continueWithGoogle?: string
15
+ continueWithTwitter?: string
16
+ continueWithApple?: string
17
+ continueWithMicrosoft?: string
18
+ continueWithGithub?: string
19
+ continueWithEmail?: string
20
+ continueWithPhone?: string
18
21
  }
22
+ viaGoogle?: boolean
23
+ viaTwitter?: boolean
24
+ viaGithub?: boolean
25
+ viaMicrosoft?: boolean
26
+ viaEmail?: boolean
27
+ viaPhone?: boolean
28
+ viaApple?: boolean
29
+
19
30
  withoutSignUp?: boolean
20
- handleRouteToSignUp?: () => void
21
31
  size: "small" | "normal" | "full"
32
+ direction: "rtl" | "ltr"
33
+ handleSignIn: () => void
34
+ handleSignUp: () => void
35
+ handleLanguage: () => void
36
+ handleColorMode: () => void
37
+ handleRouteToSignUp?: () => void
38
+ handleGoogle?: () => void
39
+ handleTwitter?: () => void
40
+ handleApple?: () => void
41
+ handleMicrosoft?: () => void
42
+ handleGithub?: () => void
43
+ handleEmail?: () => void
44
+ handlePhone?: () => void
22
45
  }
23
46
 
24
- //TODO: update Google auth button
25
47
  export const AppLanding: FC<AppLandingTypes> = (props) => {
26
48
  return (
27
- <div>
49
+ <div dir={props.direction}>
28
50
  <Card>
29
51
  <CardContent headless className="flex flex-col gap-6">
30
- <Button
31
- className="flex flex-row items-center gap-2"
32
- variant="outline"
33
- // onClick={props.handleGoogleSignIn}
34
- >
35
- <Icons.google className="h-4 w-4" />
36
- {/* {!props.logosOnly && props.texts.signInViaGoogleLabel} */}
37
- Continue With Google
38
- </Button>
39
- <Button
40
- className="flex flex-row items-center gap-2"
41
- variant="outline"
42
- // onClick={props.handleGoogleSignIn}
43
- >
44
- <Icons.twitter className="h-4 w-4" />
45
- {/* {!props.logosOnly && props.texts.signInViaGoogleLabel} */}
46
- Continue With Twitter
47
- </Button>
48
- <Button
49
- className="flex flex-row items-center gap-2"
50
- variant="outline"
51
- // onClick={props.handleGoogleSignIn}
52
- >
53
- <Icons.apple className="h-4 w-4" />
54
- {/* {!props.logosOnly && props.texts.signInViaGoogleLabel} */}
55
- Continue With Apple
56
- </Button>
57
- <Button
58
- className="flex flex-row items-center gap-2"
59
- variant="outline"
60
- // onClick={props.handleGoogleSignIn}
61
- >
62
- <Icons.mail className="h-4 w-4" />
63
- {/* {!props.logosOnly && props.texts.signInViaGoogleLabel} */}
64
- Continue With Email
65
- </Button>
66
-
67
- {/* {props.handleSignIn && (
68
- <Button onClick={props.handleSignIn}>{props.texts.signIn}</Button>
69
- // <Button onClick={props.handleSignIn}>Continue With Google</Button>
52
+ {props.viaGoogle && (
53
+ <Button
54
+ className="flex flex-row items-center gap-2"
55
+ variant="outline"
56
+ onClick={props.handleGoogle}
57
+ >
58
+ <Icons.google className="h-4 w-4" />
59
+ {props.texts?.continueWithGoogle ?? "Continue With Google"}
60
+ </Button>
61
+ )}
62
+ {props.viaGithub && (
63
+ <Button
64
+ className="flex flex-row items-center gap-2"
65
+ variant="outline"
66
+ onClick={props.handleGithub}
67
+ >
68
+ <Icons.gitHub className="h-4 w-4" />
69
+ {props.texts?.continueWithGithub ?? "Continue With Github"}
70
+ </Button>
71
+ )}
72
+ {props.viaTwitter && (
73
+ <Button
74
+ className="flex flex-row items-center gap-2"
75
+ variant="outline"
76
+ onClick={props.handleTwitter}
77
+ >
78
+ <Icons.twitter className="h-4 w-4" />
79
+ {props.texts?.continueWithTwitter ?? "Continue With Twitter"}
80
+ </Button>
81
+ )}
82
+ {props.viaApple && (
83
+ <Button
84
+ className="flex flex-row items-center gap-2"
85
+ variant="outline"
86
+ onClick={props.handleApple}
87
+ >
88
+ <Icons.apple className="h-4 w-4" />
89
+ {props.texts?.continueWithApple ?? "Continue With Apple"}
90
+ </Button>
70
91
  )}
71
- {props.handleSignUp && (
72
- <Button onClick={props.handleSignUp}>{props.texts.signUp}</Button>
73
- )} */}
92
+ {props.viaMicrosoft && (
93
+ <Button
94
+ className="flex flex-row items-center gap-2"
95
+ variant="outline"
96
+ onClick={props.handleMicrosoft}
97
+ >
98
+ <Icons.microsoft className="h-4 w-4" />
99
+ {props.texts?.continueWithMicrosoft ?? "Continue With Microsoft"}
100
+ </Button>
101
+ )}
102
+ {props.viaEmail && (
103
+ <Button
104
+ className="flex flex-row items-center gap-2"
105
+ variant="outline"
106
+ onClick={props.handleEmail}
107
+ >
108
+ <Icons.mail className="h-4 w-4" />
109
+ {props.texts?.continueWithEmail ?? "Continue With Email"}
110
+ </Button>
111
+ )}
112
+ {props.viaPhone && (
113
+ <Button
114
+ className="flex flex-row items-center gap-2"
115
+ variant="outline"
116
+ onClick={props.handlePhone}
117
+ >
118
+ <Icons.phone className="h-4 w-4" />
119
+ {props.texts?.continueWithPhone ?? "Continue With Phone"}
120
+ </Button>
121
+ )}
122
+
74
123
  {!props.withoutSignUp && (
75
124
  <div className="p-3 text-center text-sm font-normal dark:text-gray-300">
76
125
  {props.texts.newUserText}{" "}
@@ -82,7 +131,6 @@ export const AppLanding: FC<AppLandingTypes> = (props) => {
82
131
  </span>
83
132
  </div>
84
133
  )}
85
-
86
134
  </CardContent>
87
135
  </Card>
88
136
  <div className="mt-6 flex flex-row justify-between">
@@ -25,6 +25,8 @@ type ResetPasswordType = {
25
25
  signUpText: string
26
26
  dontHaveAccount: string
27
27
  }
28
+ headless?: boolean
29
+ direction?: "rtl" | "ltr"
28
30
  }
29
31
 
30
32
  export const ResetPasswordForm: FC<ResetPasswordType> = (props) => {
@@ -36,17 +38,19 @@ export const ResetPasswordForm: FC<ResetPasswordType> = (props) => {
36
38
  control,
37
39
  } = methods
38
40
  return (
39
- <Card>
41
+ <Card dir={props.direction}>
40
42
  {!props.sent ? (
41
43
  <>
42
- <CardHeader>
43
- <CardTitle>Reset Password</CardTitle>
44
- <CardDescription>
45
- Enter your email to reset your account password
46
- </CardDescription>
47
- </CardHeader>
44
+ {!props.headless && (
45
+ <CardHeader>
46
+ <CardTitle>Reset Password</CardTitle>
47
+ <CardDescription>
48
+ Enter your email to reset your account password
49
+ </CardDescription>
50
+ </CardHeader>
51
+ )}
48
52
  <form onSubmit={handleSubmit(props.handleResetPassword)}>
49
- <CardContent>
53
+ <CardContent headless={props.headless}>
50
54
  <Controller
51
55
  control={control}
52
56
  name="email"
@@ -70,7 +74,7 @@ export const ResetPasswordForm: FC<ResetPasswordType> = (props) => {
70
74
  },
71
75
  }}
72
76
  />
73
- <div className=" pb-2 text-left text-sm dark:text-gray-300">
77
+ <div className="pb-2 text-start text-sm dark:text-gray-300">
74
78
  {props.texts?.dontHaveAccount ?? "Don't have an account? "}
75
79
  <span
76
80
  onClick={props.handleRouteToSignUp}
@@ -19,6 +19,8 @@ const buttonVariants = cva(
19
19
  "bg-secondary text-secondary-foreground hover:bg-secondary/80",
20
20
  ghost: "hover:bg-accent hover:text-accent-foreground",
21
21
  link: "text-primary underline-offset-4 hover:underline",
22
+ neoBrutalism:
23
+ "cursor-pointer transition-all uppercase font-mono dark:bg-black font-bold py-2 px-4 rounded border-2 border-primary shadow-color-primary transition-[transform_50ms, box-shadow_50ms] active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active",
22
24
  },
23
25
  size: {
24
26
  default: "h-10 px-4 py-2",
@@ -59,6 +61,13 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
59
61
  ref
60
62
  ) => {
61
63
  const Comp = "button"
64
+
65
+ // Determine the color for the HawaLoading component based on the variant
66
+ const loadingColor =
67
+ variant === "outline" || variant === "ghost" || variant === "neoBrutalism"
68
+ ? "bg-primary"
69
+ : "bg-primary-foreground"
70
+
62
71
  return (
63
72
  <Comp
64
73
  className={cn(buttonVariants({ variant, size, className }))}
@@ -68,7 +77,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
68
77
  {isLoading ? (
69
78
  <HawaLoading
70
79
  design="dots-pulse"
71
- color="bg-primary-foreground"
80
+ color={loadingColor} // Apply the computed color here
72
81
  size="button"
73
82
  />
74
83
  ) : (
@@ -45,6 +45,25 @@ export const Icons = {
45
45
  <polyline points="22,6 12,13 2,6"></polyline>
46
46
  </svg>
47
47
  ),
48
+ phone: (props: IconProps) => (
49
+ <svg
50
+ stroke="currentColor"
51
+ fill="none"
52
+ stroke-width="2"
53
+ viewBox="0 0 24 24"
54
+ aria-hidden="true"
55
+ height="1em"
56
+ width="1em"
57
+ xmlns="http://www.w3.org/2000/svg"
58
+ {...props}
59
+ >
60
+ <path
61
+ stroke-linecap="round"
62
+ stroke-linejoin="round"
63
+ d="M10.5 1.5H8.25A2.25 2.25 0 006 3.75v16.5a2.25 2.25 0 002.25 2.25h7.5A2.25 2.25 0 0018 20.25V3.75a2.25 2.25 0 00-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"
64
+ ></path>
65
+ </svg>
66
+ ),
48
67
  twitter: (props: IconProps) => (
49
68
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
50
69
  <path
@@ -53,6 +72,11 @@ export const Icons = {
53
72
  />
54
73
  </svg>
55
74
  ),
75
+ microsoft: (props: IconProps) => (
76
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" {...props}>
77
+ <path d="M7.462 0H0v7.19h7.462V0zM16 0H8.538v7.19H16V0zM7.462 8.211H0V16h7.462V8.211zm8.538 0H8.538V16H16V8.211z"></path>
78
+ </svg>
79
+ ),
56
80
  gitHub: (props: IconProps) => (
57
81
  <svg viewBox="0 0 438.549 438.549" {...props}>
58
82
  <path
@@ -18,9 +18,7 @@ export function Toaster(props) {
18
18
  {toasts.map(function ({ id, title, description, action, ...toastProps }) {
19
19
  return (
20
20
  <Toast direction={props.direction} key={id} {...toastProps}>
21
- <div
22
- className={cn("grid gap-1", isRTL ? "text-right" : "text-left")}
23
- >
21
+ <div className={"grid gap-1 text-start"}>
24
22
  {title && <ToastTitle>{title}</ToastTitle>}
25
23
  {description && (
26
24
  <ToastDescription>{description}</ToastDescription>
package/src/styles.css CHANGED
@@ -2428,6 +2428,9 @@ video {
2428
2428
  .text-right {
2429
2429
  text-align: right;
2430
2430
  }
2431
+ .text-start {
2432
+ text-align: start;
2433
+ }
2431
2434
  .align-middle {
2432
2435
  vertical-align: middle;
2433
2436
  }
@@ -2952,6 +2955,10 @@ video {
2952
2955
  .repeat-infinite {
2953
2956
  animation-iteration-count: infinite;
2954
2957
  }
2958
+ .shadow-color-primary {
2959
+ --tw-shadow: 0.25rem 0.25rem hsl(var(--primary));
2960
+ box-shadow: var(--tw-shadow);
2961
+ }
2955
2962
  /* Chrome, Safari and Opera */
2956
2963
  .no-scrollbar::-webkit-scrollbar {
2957
2964
  display: none;
@@ -3321,6 +3328,26 @@ body {
3321
3328
  .focus-visible\:ring-offset-2:focus-visible {
3322
3329
  --tw-ring-offset-width: 2px;
3323
3330
  }
3331
+ .active\:translate-x-0:active {
3332
+ --tw-translate-x: 0px;
3333
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3334
+ }
3335
+ .active\:translate-x-0\.5:active {
3336
+ --tw-translate-x: 0.125rem;
3337
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3338
+ }
3339
+ .active\:translate-y-0:active {
3340
+ --tw-translate-y: 0px;
3341
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3342
+ }
3343
+ .active\:translate-y-0\.5:active {
3344
+ --tw-translate-y: 0.125rem;
3345
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3346
+ }
3347
+ .active\:shadow-color-primary-active:active {
3348
+ --tw-shadow: 0.125rem 0.125rem hsl(var(--primary));
3349
+ box-shadow: var(--tw-shadow);
3350
+ }
3324
3351
  .disabled\:pointer-events-none:disabled {
3325
3352
  pointer-events: none;
3326
3353
  }
@@ -3798,6 +3825,10 @@ body {
3798
3825
  :is(.dark .dark\:bg-background) {
3799
3826
  background-color: hsl(var(--background));
3800
3827
  }
3828
+ :is(.dark .dark\:bg-black) {
3829
+ --tw-bg-opacity: 1;
3830
+ background-color: rgb(0 0 0 / var(--tw-bg-opacity));
3831
+ }
3801
3832
  :is(.dark .dark\:bg-blue-200) {
3802
3833
  --tw-bg-opacity: 1;
3803
3834
  background-color: rgb(191 219 254 / var(--tw-bg-opacity));
package/src/tailwind.css CHANGED
@@ -234,6 +234,16 @@
234
234
  }
235
235
  }
236
236
  @layer utilities {
237
+
238
+ .shadow-color-primary {
239
+ --tw-shadow: 0.25rem 0.25rem hsl(var(--primary));
240
+ box-shadow: var(--tw-shadow);
241
+ }
242
+ .shadow-color-primary-active {
243
+ --tw-shadow: 0.125rem 0.125rem hsl(var(--primary));
244
+ box-shadow: var(--tw-shadow);
245
+ }
246
+
237
247
  /* Chrome, Safari and Opera */
238
248
  .no-scrollbar::-webkit-scrollbar {
239
249
  display: none;
@@ -22,6 +22,15 @@
22
22
  "createAccount": "أنشئ حساب",
23
23
  "expandSidebar": "توسيع القائمة",
24
24
  "collapseSidebar": "طي القائمة",
25
+
26
+ "continueWithGoogle": "الإستمرار بواسطة Google",
27
+ "continueWithTwitter": "الإستمرار بواسطة Twitter",
28
+ "continueWithApple": "الإستمرار بواسطة Apple",
29
+ "continueWithMicrosoft": "الإستمرار بواسطة Microsoft",
30
+ "continueWithGithub": "الإستمرار بواسطة Github",
31
+ "continueWithEmail": "الإستمرار بواسطة Email",
32
+ "continueWithPhone": "الإستمرار بواسطة Phone",
33
+
25
34
  "signInViaGoogleLabel": "الدخول بواسطة Google",
26
35
  "signInViaGithubLabel": "الدخول بواسطة Github",
27
36
  "signInViaTwitterLabel": "الدخول بواسطة Twitter",
@@ -20,6 +20,15 @@
20
20
  "signUpText": "Sign up",
21
21
  "createAccount": "Create Account",
22
22
  "signInText": "Sign in",
23
+
24
+ "continueWithGoogle": "Continue with Google",
25
+ "continueWithTwitter": "Continue with Twitter",
26
+ "continueWithApple": "Continue with Apple",
27
+ "continueWithMicrosoft": "Continue with Microsoft",
28
+ "continueWithGithub": "Continue with Github",
29
+ "continueWithEmail": "Continue with Email",
30
+ "continueWithPhone": "Continue with Phone",
31
+
23
32
  "signInViaGoogleLabel": "Sign in with Google",
24
33
  "signInViaGithubLabel": "Sign in with Github",
25
34
  "signInViaTwitterLabel": "Sign in with Twitter",