@sikka/hawa 0.0.207 → 0.0.208

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.0.207",
3
+ "version": "0.0.208",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -1,5 +1,4 @@
1
1
  import React, { useState } from "react"
2
- import { HawaPricingCard, HawaPanelTabs, HawaTabs } from "../../elements"
3
2
 
4
3
  const CheckMark = () => (
5
4
  <svg
@@ -1,23 +1,23 @@
1
1
  import React, { useState } from "react"
2
2
  import { HawaPricingCard, HawaTabs } from "../../elements"
3
-
3
+ // TODO: make lang into direction rtl | ltr
4
+ // TODO: shape the type of plans
4
5
  type PricingPlansTypes = {
5
- plans: any
6
- // plans: PropTypes.arrayOf(
7
- // PropTypes.shape({
8
- // title: PropTypes.string,
9
- // title_ar: PropTypes.string,
10
- // subtitle: PropTypes.string,
11
- // subtitle_ar: PropTypes.string,
12
- // price: PropTypes.number,
13
- // currency: PropTypes.string,
14
- // cycleText: PropTypes.string,
15
- // buttonText: PropTypes.string,
16
- // features: PropTypes.array,
17
- // features_ar: PropTypes.array,
18
- // selectedPlan: PropTypes.bool,
19
- // })
20
- // ),
6
+ plans: [
7
+ {
8
+ direction: "rtl" | "ltr"
9
+ features: [{ included: boolean; text: string }]
10
+ price: number
11
+ texts: {
12
+ title: string
13
+ subtitle: string
14
+ buttonText: string
15
+ cycleText: string
16
+ currencyText: string
17
+ }
18
+ size: "small" | "medium" | "large"
19
+ }
20
+ ]
21
21
  lang: any
22
22
  }
23
23
  export const PricingPlans: React.FunctionComponent<PricingPlansTypes> = (
@@ -62,13 +62,13 @@ export const PricingPlans: React.FunctionComponent<PricingPlansTypes> = (
62
62
  <HawaPricingCard
63
63
  // size="large"
64
64
  // features={plan.features}
65
- lang={props.lang}
65
+ // lang={props.lang}
66
66
  {...plan}
67
- texts={{
68
- buttonText: "Upgrade",
69
- currencyText: currentCurrency,
70
- cycleText: currentCycle,
71
- }}
67
+ // texts={{
68
+ // buttonText: "Upgrade",
69
+ // currencyText: currentCurrency,
70
+ // cycleText: currentCycle,
71
+ // }}
72
72
  />
73
73
  )
74
74
  })}
@@ -47,17 +47,13 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
47
47
  position = "top-right",
48
48
  }) => {
49
49
  const [menuOpened, setMenuOpened] = useState(false)
50
-
51
50
  const childrenRef = useRef(null)
52
51
  const [childrenHeight, setChildrenHeight] = useState(null)
53
52
  const [childrenWidth, setChildrenWidth] = useState(null)
54
-
55
53
  const menuRef = useRef(null)
56
54
  const [menuWidth, setMenuWidth] = useState(null)
57
55
  const [menuHeight, setMenuHeight] = useState(null)
58
56
 
59
- const ref = useRef(null)
60
-
61
57
  useEffect(() => {
62
58
  setMenuHeight(menuRef.current?.getBoundingClientRect().height)
63
59
  setMenuWidth(menuRef.current?.getBoundingClientRect().width)
@@ -74,18 +70,9 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
74
70
  document.removeEventListener("click", handleClickOutside, true)
75
71
  }
76
72
  }, [onClickOutside])
73
+
77
74
  let defaultStyles =
78
75
  "border-none absolute ring-offset-1 absolute z-10 w-44 divide-y divide-gray-100 overflow-y-clip rounded bg-gray-50 shadow-lg transition-all dark:bg-gray-700"
79
- let positionStyles = {
80
- "top-right": "top-8 right-0",
81
- "top-left": "top-8 left-0",
82
- "bottom-right": "bottom-8 right-0",
83
- "bottom-left": "bottom-8 left-0",
84
- }
85
- let animationStyles = {
86
- opened: "max-h-fit h-max visible opacity-100 block",
87
- closed: "h-0 invisible opacity-0 hidden",
88
- }
89
76
  let sizeStyles = {
90
77
  small: "text-[11px] p-1 px-4 m-0",
91
78
  normal: "py-2 px-4",
@@ -191,7 +178,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
191
178
  >
192
179
  {group?.map((item) => {
193
180
  return item.element ? (
194
- <li className="mx-1 cursor-pointer items-center rounded hover:bg-gray-200 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white">
181
+ <li className="cursor-pointer items-center rounded hover:bg-gray-200 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white">
195
182
  {item.element}
196
183
  </li>
197
184
  ) : (
@@ -4,11 +4,11 @@ import React from "react"
4
4
  // TODO: if feature.included is false, show gray and x
5
5
 
6
6
  type PricingCardTypes = {
7
- lang: "ar" | "en"
7
+ direction?: "rtl" | "ltr"
8
8
  features: [{ included: boolean; text: string }]
9
- title: string
10
9
  price: number
11
10
  texts: {
11
+ title: string
12
12
  subtitle: string
13
13
  buttonText: string
14
14
  cycleText: string
@@ -28,9 +28,10 @@ type CurrencyTextTypes = {
28
28
  }
29
29
  export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = ({
30
30
  size = "medium",
31
+ direction = "ltr",
31
32
  ...props
32
33
  }) => {
33
- let isArabic = props.lang === "ar"
34
+ let isArabic = direction === "rtl"
34
35
  let cycleTextsArabic: CycleTextTypes = {
35
36
  monthly: "شهرياً",
36
37
  "3-months": "كل 3 أشهر",
@@ -64,7 +65,7 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = ({
64
65
  )}
65
66
  >
66
67
  <h5 className="text-md 0 font-bold text-gray-500 dark:text-gray-400">
67
- {props.title}
68
+ {props.texts.title}
68
69
  </h5>
69
70
  <div className=" flex items-baseline text-gray-900 dark:text-white">
70
71
  <>
@@ -105,7 +105,7 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
105
105
  ]
106
106
  : inactiveTabStyle[orientation],
107
107
  "w-full transition-all",
108
- pill ? "rounded bg-green-400" : ""
108
+ pill ? "rounded" : ""
109
109
  // direction === "rtl" ? "bg-yellow-400" : "bg-yellow-400"
110
110
  )}
111
111
  >
package/src/styles.css CHANGED
@@ -584,9 +584,6 @@ video {
584
584
  .bottom-4 {
585
585
  bottom: 1rem;
586
586
  }
587
- .bottom-8 {
588
- bottom: 2rem;
589
- }
590
587
  .left-0 {
591
588
  left: 0px;
592
589
  }
@@ -632,9 +629,6 @@ video {
632
629
  .top-4 {
633
630
  top: 1rem;
634
631
  }
635
- .top-8 {
636
- top: 2rem;
637
- }
638
632
  .top-auto {
639
633
  top: auto;
640
634
  }
@@ -883,10 +877,6 @@ video {
883
877
  .h-full {
884
878
  height: 100%;
885
879
  }
886
- .h-max {
887
- height: -moz-max-content;
888
- height: max-content;
889
- }
890
880
  .h-screen {
891
881
  height: 100vh;
892
882
  }
@@ -1478,10 +1468,6 @@ video {
1478
1468
  --tw-bg-opacity: 1;
1479
1469
  background-color: rgb(220 252 231 / var(--tw-bg-opacity));
1480
1470
  }
1481
- .bg-green-400 {
1482
- --tw-bg-opacity: 1;
1483
- background-color: rgb(74 222 128 / var(--tw-bg-opacity));
1484
- }
1485
1471
  .bg-green-500 {
1486
1472
  --tw-bg-opacity: 1;
1487
1473
  background-color: rgb(34 197 94 / var(--tw-bg-opacity));