@sikka/hawa 0.0.174 → 0.0.175

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.
@@ -3,6 +3,7 @@ type ContainerTypes = {
3
3
  maxWidth?: "full" | "small" | "normal";
4
4
  children: React.ReactNode;
5
5
  variant?: "contained" | "outlined" | "neobrutalism";
6
+ direction?: "rtl" | "ltr";
6
7
  centered?: boolean;
7
8
  };
8
9
  export declare const HawaContainer: React.FunctionComponent<ContainerTypes>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.174",
3
+ "version": "0.0.175",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -10,6 +10,7 @@ import { Controller, useForm } from "react-hook-form"
10
10
  import { HawaContainer } from "../../layout"
11
11
 
12
12
  type SignInFormTypes = {
13
+ language?: string
13
14
  showError?: any
14
15
  errorTitle?: string
15
16
  errorText?: string
@@ -47,7 +48,6 @@ type SignInFormTypes = {
47
48
  handleGithubSignIn?: () => void
48
49
  handleTwitterSignIn?: () => void
49
50
  }
50
- // TODO: add direction to flip block
51
51
 
52
52
  export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
53
53
  const {
@@ -57,7 +57,7 @@ export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
57
57
  } = useForm()
58
58
 
59
59
  return (
60
- <HawaContainer>
60
+ <HawaContainer direction={props.language === "ar" ? "rtl" : "ltr"}>
61
61
  <form onSubmit={handleSubmit((e) => props.handleSignIn(e))}>
62
62
  {props.showError && (
63
63
  <HawaAlert
@@ -11,6 +11,7 @@ import { Controller, FormProvider, useForm } from "react-hook-form"
11
11
  import { HawaContainer } from "../../layout/HawaContainer"
12
12
 
13
13
  type SignUpFormTypes = {
14
+ language?: string
14
15
  texts: {
15
16
  fullNameLabel: string
16
17
  fullNamePlaceholder: string
@@ -70,7 +71,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
70
71
  } = methods
71
72
 
72
73
  return (
73
- <HawaContainer>
74
+ <HawaContainer direction={props.language === "ar" ? "rtl" : "ltr"}>
74
75
  <div>
75
76
  {props.showError && (
76
77
  <HawaAlert
@@ -288,8 +289,8 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
288
289
  </HawaButton>
289
290
  </form>
290
291
  </FormProvider>
291
- <div className="p-3 text-center text-sm font-semibold">
292
- {props.texts.existingUserText}{" "}
292
+ <div className="flex flex-row items-center justify-center gap-1 p-3 text-center text-sm font-semibold">
293
+ <span>{props.texts.existingUserText}</span>
293
294
  <span
294
295
  onClick={props.handleRouteToSignIn}
295
296
  className="cursor-pointer text-blue-600"
@@ -8,13 +8,13 @@ type TNewsletter = {
8
8
  wantToStayUpdated: string
9
9
  subscribeToNewsletter: string
10
10
  }
11
+ handleNewsletterSub: (e: string) => void
11
12
  }
12
13
 
13
- // TODO: make it a form and handle email submission
14
-
15
14
  export const Newsletter: React.FunctionComponent<TNewsletter> = ({
16
15
  variant = "contained",
17
16
  texts,
17
+ handleNewsletterSub,
18
18
  }) => {
19
19
  return (
20
20
  <HawaContainer variant={variant} centered={true}>
@@ -22,17 +22,24 @@ export const Newsletter: React.FunctionComponent<TNewsletter> = ({
22
22
  <h1 className="font-bold">{texts.wantToStayUpdated}</h1>
23
23
  <span>{texts.subscribeToNewsletter}</span>
24
24
  </div>
25
- <div className="flex flex-row gap-2">
25
+ <form
26
+ className="flex flex-row gap-2"
27
+ onSubmit={(e) => {
28
+ e.preventDefault()
29
+ handleNewsletterSub(e.target[0].value)
30
+ }}
31
+ >
26
32
  <HawaTextField
27
33
  width="full"
28
34
  type="email"
35
+ name="email"
29
36
  placeholder={"example@sikka.io"}
30
37
  margin="none"
31
38
  />
32
39
  <HawaButton size="full" margins="none">
33
40
  Submit
34
41
  </HawaButton>
35
- </div>
42
+ </form>
36
43
  </HawaContainer>
37
44
  )
38
45
  }
@@ -1,21 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import React from "react"
2
3
 
3
- // TODO: make the texts in one object property
4
- // TODO: give it a background color (white)
5
- // TODO: remove title_ar
6
- // TODO: spicifiy features object
7
- // TODO: remove features_ar
4
+ // TODO: if feature.included is false, show gray and x
8
5
 
9
6
  type PricingCardTypes = {
10
7
  lang: "ar" | "en"
11
- features: [any]
12
- features_ar: [any]
8
+ features: [{ included: boolean; text: string }]
13
9
  title: string
14
- title_ar: string
15
10
  price: number
16
- currency: string
17
- buttonText: string
18
- cycleText: string
11
+ // currency: string
12
+ // buttonText: string
13
+ // cycleText: string
14
+ texts: { buttonText: string; cycleText: string; currencyText: string }
19
15
  size: "small" | "medium" | "large"
20
16
  }
21
17
  type CycleTextTypes = {
@@ -48,8 +44,6 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
48
44
  usd: isArabic ? "دولار" : "$",
49
45
  sar: isArabic ? "ريال" : "SAR",
50
46
  }
51
- let featuresMapping = isArabic ? props.features_ar : props.features
52
- let chipSpacing = isArabic ? { left: 10 } : { right: 10 }
53
47
  let cardSizes = {
54
48
  small:
55
49
  "mx-1 w-full max-w-fit rounded border bg-white p-4 shadow-md dark:border-gray-700 dark:bg-gray-800 sm:p-8",
@@ -59,45 +53,49 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
59
53
  "mx-1 w-full max-w-lg rounded border bg-white p-4 shadow-md dark:border-gray-700 dark:bg-gray-800 sm:p-8",
60
54
  }
61
55
  return (
62
- <div dir={isArabic ? "rtl" : "ltr"} className={cardSizes[props.size]}>
56
+ <div
57
+ dir={isArabic ? "rtl" : "ltr"}
58
+ className={clsx(cardSizes[props.size], "bg-white")}
59
+ >
63
60
  <h5 className="mb-4 text-xl font-medium text-gray-500 dark:text-gray-400">
64
- {isArabic ? props.title_ar : props.title}
61
+ {props.title}
65
62
  </h5>
66
63
  <div className="flex items-baseline text-gray-900 dark:text-white">
67
- {isArabic ? (
68
- <>
69
- <span className="text-5xl font-extrabold tracking-tight">
70
- {props.price}
71
- </span>
72
- <span className="mx-1 text-sm font-semibold">
73
- {" "}
74
- {
75
- currencyMapping[
76
- props.currency?.toLowerCase() as keyof CurrencyTextTypes
77
- ]
78
- }
79
- </span>
80
- </>
81
- ) : (
82
- <>
83
- <span className="text-sm font-semibold">
84
- {" "}
85
- {
86
- currencyMapping[
87
- props.currency?.toLowerCase() as keyof CurrencyTextTypes
88
- ]
89
- }
90
- </span>
91
- <span className="mx-1 text-5xl font-extrabold tracking-tight">
92
- {props.price}
93
- </span>
94
- </>
95
- )}
64
+ {/* {isArabic ? ( */}
65
+ <>
66
+ <span className="text-5xl font-extrabold tracking-tight">
67
+ {props.price}
68
+ </span>
69
+ <span className="mx-1 text-sm font-semibold">
70
+ {" "}
71
+ {/* {
72
+ currencyMapping[
73
+ props.currency?.toLowerCase() as keyof CurrencyTextTypes
74
+ ]
75
+ } */}
76
+ {props.texts.currencyText}
77
+ </span>
78
+ </>
79
+ {/* // ) : (
80
+ // <>
81
+ // <span className="text-sm font-semibold">
82
+ // {" "}
83
+ // {
84
+ // currencyMapping[
85
+ // props.currency?.toLowerCase() as keyof CurrencyTextTypes
86
+ // ]
87
+ // }
88
+ // </span>
89
+ // <span className="mx-1 text-5xl font-extrabold tracking-tight">
90
+ // {props.price}
91
+ // </span>
92
+ // </>
93
+ // )} */}
96
94
  <span className="ml-1 text-xl font-normal text-gray-500 dark:text-gray-400">
97
- /{" "}
98
- {isArabic
95
+ / {props.texts.cycleText}
96
+ {/* {isArabic
99
97
  ? cycleTextsArabic[props.cycleText as keyof CycleTextTypes]
100
- : cycleTextsEnglish[props.cycleText as keyof CycleTextTypes]}
98
+ : cycleTextsEnglish[props.cycleText as keyof CycleTextTypes]} */}
101
99
  </span>
102
100
  </div>
103
101
  <ul role="list" className="my-7 space-y-0">
@@ -119,7 +117,7 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
119
117
  ></path>
120
118
  </svg>
121
119
  <span className="flex items-center text-center font-normal leading-tight text-gray-500 dark:text-gray-400">
122
- {feature}
120
+ {feature.text}
123
121
  </span>
124
122
  </li>
125
123
  )
@@ -129,7 +127,7 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
129
127
  type="button"
130
128
  className="inline-flex w-full justify-center rounded bg-blue-600 px-5 py-2.5 text-center text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-200 dark:focus:ring-blue-900"
131
129
  >
132
- {props.buttonText}
130
+ {props.texts.buttonText}
133
131
  </button>
134
132
  </div>
135
133
 
@@ -1,6 +1,6 @@
1
1
  import clsx from "clsx"
2
2
  import React from "react"
3
- // TODO: Add different sizes
3
+
4
4
  type SpinnerTypes = {
5
5
  size?: "button" | "sm" | "normal" | "lg" | "xl"
6
6
  }
@@ -33,7 +33,7 @@ type MenuItems = {
33
33
  isButton?: boolean
34
34
  }
35
35
 
36
- // TODO: fix the drawer top when no topbar
36
+
37
37
  export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
38
38
  direction = "rtl",
39
39
  ...props
@@ -5,12 +5,14 @@ type ContainerTypes = {
5
5
  maxWidth?: "full" | "small" | "normal"
6
6
  children: React.ReactNode
7
7
  variant?: "contained" | "outlined" | "neobrutalism"
8
+ direction?: "rtl" | "ltr"
8
9
  centered?: boolean
9
10
  }
10
11
  export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
11
12
  maxWidth = "normal",
12
13
  variant = "contained",
13
14
  centered = false,
15
+ direction = "rtl",
14
16
  ...props
15
17
  }) => {
16
18
  let defaultStyle = "flex w-full flex-col rounded p-4"
@@ -34,6 +36,7 @@ export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
34
36
  variantStyles[variant],
35
37
  centered ? "flex items-center text-center" : ""
36
38
  )}
39
+ dir={direction}
37
40
  >
38
41
  {props.children}
39
42
  </div>
@@ -26,7 +26,6 @@ type HawaSiteLayoutTypes = {
26
26
  floating?: boolean
27
27
  }
28
28
 
29
- // TODO: fix the drawer top when no topbar
30
29
  export const HawaSiteLayout: React.FunctionComponent<HawaSiteLayoutTypes> = ({
31
30
  direction = "rtl",
32
31
  navigationSize = "md",
@@ -361,4 +361,4 @@
361
361
 
362
362
 
363
363
 
364
- window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.4a2964ac.iframe.bundle.js"></script><script src="239.5e8067ea.iframe.bundle.js"></script><script src="main.ea6f9b48.iframe.bundle.js"></script></body></html>
364
+ window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.4a2964ac.iframe.bundle.js"></script><script src="239.5e8067ea.iframe.bundle.js"></script><script src="main.46fe6f33.iframe.bundle.js"></script></body></html>