@sikka/hawa 0.0.172 → 0.0.174

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.
Files changed (41) hide show
  1. package/dist/styles.css +46 -69
  2. package/es/elements/HawaChip.d.ts +1 -1
  3. package/es/elements/SubsectionList.d.ts +19 -0
  4. package/es/elements/index.d.ts +1 -0
  5. package/es/index.es.js +1 -1
  6. package/es/layout/HawaSiteLayout.d.ts +20 -6
  7. package/lib/elements/HawaChip.d.ts +1 -1
  8. package/lib/elements/SubsectionList.d.ts +19 -0
  9. package/lib/elements/index.d.ts +1 -0
  10. package/lib/index.js +1 -1
  11. package/lib/layout/HawaSiteLayout.d.ts +20 -6
  12. package/package.json +1 -1
  13. package/src/blocks/AuthForms/SignInForm.tsx +1 -0
  14. package/src/blocks/Misc/Testimonial.tsx +1 -1
  15. package/src/elements/DraggableCard.tsx +1 -1
  16. package/src/elements/HawaButton.tsx +3 -3
  17. package/src/elements/HawaChip.tsx +1 -1
  18. package/src/elements/HawaLogoButton.tsx +3 -2
  19. package/src/elements/HawaMenu.tsx +1 -1
  20. package/src/elements/HawaPricingCard.tsx +7 -1
  21. package/src/elements/HawaRadio.tsx +1 -1
  22. package/src/elements/HawaStats.tsx +1 -1
  23. package/src/elements/HawaTable.tsx +1 -1
  24. package/src/elements/HawaTabs.tsx +7 -7
  25. package/src/elements/HawaTimeline.tsx +8 -6
  26. package/src/elements/SubsectionList.tsx +78 -0
  27. package/src/elements/index.ts +1 -0
  28. package/src/layout/HawaAppLayout.tsx +6 -6
  29. package/src/layout/HawaContainer.tsx +1 -1
  30. package/src/layout/HawaSiteLayout.tsx +125 -278
  31. package/src/styles.css +46 -69
  32. package/src/tailwind.css +5 -4
  33. package/storybook-static/{870.6284ce82.iframe.bundle.js → 239.5e8067ea.iframe.bundle.js} +2 -2
  34. package/storybook-static/{870.6284ce82.iframe.bundle.js.LICENSE.txt → 239.5e8067ea.iframe.bundle.js.LICENSE.txt} +0 -0
  35. package/storybook-static/iframe.html +1 -1
  36. package/storybook-static/main.ea6f9b48.iframe.bundle.js +1 -0
  37. package/storybook-static/project.json +1 -1
  38. package/tailwind.config.js +8 -42
  39. package/es/stories/LayoutStories/SimpleGrid.stories.d.ts +0 -4
  40. package/lib/stories/LayoutStories/SimpleGrid.stories.d.ts +0 -4
  41. package/storybook-static/main.653018b6.iframe.bundle.js +0 -1
@@ -1,9 +1,23 @@
1
1
  import React from "react";
2
- type LayoutTypes = {
3
- logoLink: string;
4
- username: string;
5
- userEmail: string;
6
- drawerItems: any;
2
+ type HawaSiteLayoutTypes = {
3
+ navItems: {
4
+ label: string;
5
+ icon: any;
6
+ slug: string;
7
+ action: () => void;
8
+ subItems?: any;
9
+ }[];
10
+ direction?: "rtl" | "ltr";
11
+ currentPage: string;
12
+ pageTitle?: string;
13
+ logoSymbol?: any;
14
+ logoLink?: string;
15
+ logoText?: any;
16
+ children?: any;
17
+ stickyNav?: boolean;
18
+ topBar?: boolean;
19
+ navigationSize?: "sm" | "md" | "lg";
20
+ floating?: boolean;
7
21
  };
8
- export declare const HawaSiteLayout: React.FunctionComponent<LayoutTypes>;
22
+ export declare const HawaSiteLayout: React.FunctionComponent<HawaSiteLayoutTypes>;
9
23
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.172",
3
+ "version": "0.0.174",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -47,6 +47,7 @@ type SignInFormTypes = {
47
47
  handleGithubSignIn?: () => void
48
48
  handleTwitterSignIn?: () => void
49
49
  }
50
+ // TODO: add direction to flip block
50
51
 
51
52
  export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
52
53
  const {
@@ -11,7 +11,7 @@ export const Testimonial: React.FunctionComponent<TEmptyState> = ({
11
11
  }) => {
12
12
  return (
13
13
  <div
14
- className="rounded flex flex-col gap-2 border-2 border-gray-200 bg-white p-4"
14
+ className="flex flex-col gap-2 rounded border-2 border-gray-200 bg-white p-4"
15
15
  // style={{ width: "249.708px", marginRight: "24px" }}
16
16
  >
17
17
  <svg width="48" height="48" viewBox="0 0 48 48" fill="none">
@@ -7,7 +7,7 @@ export const DraggableCard: React.FunctionComponent<DraggableCardTypes> = (
7
7
  props
8
8
  ) => {
9
9
  return (
10
- <div className="bg-layoutPrimary-default flex flex-row rounded p-4">
10
+ <div className="bg-layoutPrimary-500 flex flex-row rounded p-4">
11
11
  <button
12
12
  className="inline-flex items-center rounded bg-white p-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-50 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-600"
13
13
  type="button"
@@ -31,7 +31,7 @@ const sizeStyles = {
31
31
  const widthStyles = {
32
32
  full: "w-full flex justify-center px-5 py-2.5 text-center inline-flex items-center",
33
33
  normal:
34
- "w-fit dark:bg-buttonPrimary-dark dark:hover:bg-buttonPrimary-dark dark:hover:brightness-90 dark:focus:ring-primary-800",
34
+ "w-fit dark:bg-buttonPrimary-dark dark:hover:bg-buttonPrimary-darker dark:hover:brightness-90 dark:focus:ring-buttonPrimary-500",
35
35
  half: "w-1/2",
36
36
  }
37
37
  const variantStyles = {
@@ -42,9 +42,9 @@ const variantStyles = {
42
42
  const colorStyles = {
43
43
  contained: {
44
44
  default:
45
- "text-neutral-900 hover:bg-buttonPrimary-darker bg-buttonPrimary-default text-white",
45
+ "text-neutral-900 bg-buttonPrimary-500 hover:bg-buttonPrimary-darker bg-buttonPrimary-500 text-white",
46
46
  primary:
47
- "text-white bg-buttonPrimary-default hover:bg-buttonPrimary-darker transition-all",
47
+ "text-white bg-buttonPrimary-500 hover:bg-buttonPrimary-darker transition-all",
48
48
  secondary:
49
49
  "text-neutral-900 bg-buttonSecondary-default hover:text-white hover:bg-buttonSecondary-darker",
50
50
  },
@@ -3,7 +3,7 @@ import React from "react"
3
3
 
4
4
  type TChipTypes = {
5
5
  label: string
6
- size: "small" | "normal" | "large"
6
+ size?: "small" | "normal" | "large"
7
7
  icon?: JSX.Element
8
8
  }
9
9
  export const HawaChip: React.FunctionComponent<TChipTypes> = ({
@@ -146,17 +146,18 @@ export const HawaLogoButton: React.FunctionComponent<LogoButtonTypes> = (
146
146
  default:
147
147
  break
148
148
  }
149
+
149
150
  return (
150
151
  <button
151
152
  style={{ direction: isArabic ? "rtl" : "ltr" }}
152
153
  onClick={props.onClick}
153
- className="transition-all my-2 flex h-11 w-full flex-row justify-center rounded bg-white hover:ring-1 hover:ring-buttonPrimary-default hover:brightness-90 align-middle"
154
+ className="my-2 flex h-11 w-full flex-row justify-center rounded bg-white align-middle transition-all hover:ring-1 hover:ring-buttonPrimary-500 hover:brightness-90"
154
155
  >
155
156
  <div className="flex h-full flex-row items-center justify-end">
156
157
  {logoElement}
157
158
  </div>
158
159
  <div style={{ width: 10 }} />
159
- <div className="flex h-full flex-col items-start justify-center">
160
+ <div className="flex h-full flex-col items-start justify-center dark:text-black">
160
161
  {props.buttonText}
161
162
  </div>
162
163
  </button>
@@ -106,7 +106,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
106
106
  onClick={(e) => item.action(e, item.label)}
107
107
  className={
108
108
  item.isButton
109
- ? "mx-1 my-1 flex cursor-pointer flex-row items-center rounded bg-buttonPrimary-default py-2 px-4 text-white hover:bg-buttonPrimary-darker rtl:flex-row-reverse dark:hover:bg-buttonPrimary-darker dark:hover:text-white"
109
+ ? "mx-1 my-1 flex cursor-pointer flex-row items-center rounded bg-buttonPrimary-500 py-2 px-4 text-white hover:bg-buttonPrimary-darker rtl:flex-row-reverse dark:hover:bg-buttonPrimary-darker dark:hover:text-white"
110
110
  : "mx-1 flex cursor-pointer flex-row items-center rounded py-2 px-4 hover:bg-gray-200 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white"
111
111
  }
112
112
  >
@@ -1,5 +1,11 @@
1
1
  import React from "react"
2
2
 
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
8
+
3
9
  type PricingCardTypes = {
4
10
  lang: "ar" | "en"
5
11
  features: [any]
@@ -95,7 +101,7 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
95
101
  </span>
96
102
  </div>
97
103
  <ul role="list" className="my-7 space-y-0">
98
- {featuresMapping?.map((feature, o) => {
104
+ {props.features?.map((feature, o) => {
99
105
  return (
100
106
  <li key={o} className="flex ">
101
107
  <svg
@@ -14,7 +14,7 @@ type RadioTypes = {
14
14
  export const HawaRadio: React.FunctionComponent<RadioTypes> = (props) => {
15
15
  const [selectedOption, setSelectedOption] = useState(props.defaultValue)
16
16
  let activeTabStyle =
17
- "inline-block py-2 px-4 w-full text-white bg-buttonPrimary-default rounded active"
17
+ "inline-block py-2 px-4 w-full text-white bg-buttonPrimary-500 rounded active"
18
18
  let inactiveTabStyle =
19
19
  "inline-block py-2 px-4 w-full bg-gray-100 rounded hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white"
20
20
 
@@ -15,7 +15,7 @@ export const HawaStats: React.FunctionComponent<StatTypes> = (props) => {
15
15
  "flex flex-col gap-1 rounded p-4 text-sm h-fit max-h-fit"
16
16
  let statStyles = {
17
17
  plain: "",
18
- contained: "bg-layoutPrimary-default w-fit",
18
+ contained: "bg-layoutPrimary-500 w-fit",
19
19
  outlined: "ring-2 w-fit",
20
20
  }
21
21
  return (
@@ -31,7 +31,7 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
31
31
  return (
32
32
  <div className="relative overflow-x-clip rounded">
33
33
  <table className="w-full text-left text-sm text-gray-500 dark:text-gray-400">
34
- <thead className="bg-layoutPrimary-default text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400">
34
+ <thead className="bg-layoutPrimary-500 text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400">
35
35
  <tr>
36
36
  {props.columns.map((col: any, i: any) => (
37
37
  <th key={i} scope="col" className={clsx(sizeStyles[size])}>
@@ -18,9 +18,9 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
18
18
  // const [selectedOption, setSelectedOption] = useState(props.defaultValue - 1)
19
19
  let activeTabStyle = {
20
20
  vertical:
21
- "inline-block py-2 px-4 text-white bg-buttonPrimary-default active",
21
+ "inline-block py-2 px-4 text-white bg-buttonPrimary-500 active",
22
22
  horizontal:
23
- "inline-block py-2 px-4 text-white bg-buttonPrimary-default rounded rounded-br-none rounded-bl-none active",
23
+ "inline-block py-2 px-4 text-white bg-buttonPrimary-500 rounded rounded-br-none rounded-bl-none active",
24
24
  }
25
25
  let inactiveTabStyle = {
26
26
  vertical:
@@ -33,11 +33,11 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
33
33
  let orientationStyle = {
34
34
  vertical: {
35
35
  container: "flex flex-row",
36
- tabs: "flex flex-col w-fit flex-wrap rounded border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
36
+ tabs: "flex flex-col w-fit flex-wrap rounded border-b-buttonPrimary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
37
37
  },
38
38
  horizontal: {
39
39
  container: "",
40
- tabs: "flex w-fit flex-wrap rounded rounded-br-none rounded-bl-none border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
40
+ tabs: "flex w-fit flex-wrap rounded rounded-br-none rounded-bl-none border-b-buttonPrimary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
41
41
  },
42
42
  }
43
43
  let containerStyle = {
@@ -46,9 +46,9 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
46
46
  }
47
47
  let tabsStyle = {
48
48
  vertical:
49
- "sticky top-2 h-fit flex flex-col w-fit flex-wrap rounded border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
49
+ "sticky top-2 h-fit flex flex-col w-fit flex-wrap rounded border-b-buttonPrimary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
50
50
  horizontal:
51
- "flex w-fit flex-wrap rounded rounded-br-none rounded-bl-none border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
51
+ "flex w-fit flex-wrap rounded rounded-br-none rounded-bl-none border-b-buttonPrimary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
52
52
  }
53
53
  return (
54
54
  <div
@@ -61,7 +61,7 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
61
61
  <ul
62
62
  className={clsx(
63
63
  tabsStyle[orientation],
64
- "border-buttonPrimary-default",
64
+ "border-buttonPrimary-500",
65
65
  orientation === "vertical"
66
66
  ? direction === "rtl"
67
67
  ? "rounded-none rounded-r-lg border-l-2"
@@ -17,12 +17,12 @@ export const HawaTimeline: React.FunctionComponent<THawaTimeline> = ({
17
17
  }
18
18
  let lineStyles = {
19
19
  vertical: {
20
- default: "w-1 h-32 rounded bg-buttonPrimary-default ml-6 my-2",
21
- selected: "w-1 h-32 rounded bg-buttonPrimary-default ml-6 my-2",
20
+ default: "w-1 h-32 rounded bg-buttonPrimary-500 ml-6 my-2",
21
+ selected: "w-1 h-32 rounded bg-buttonPrimary-500 ml-6 my-2",
22
22
  },
23
23
  horizontal: {
24
- default: "h-0.5 w-full rounded bg-buttonPrimary-default",
25
- selected: "h-0.5 w-full rounded bg-buttonPrimary-default",
24
+ default: "h-0.5 w-full rounded bg-buttonPrimary-500",
25
+ selected: "h-0.5 w-full rounded bg-buttonPrimary-500",
26
26
  },
27
27
  }
28
28
  return (
@@ -71,8 +71,10 @@ const TimelineStep = (props) => (
71
71
  >
72
72
  <div
73
73
  className={clsx(
74
- "m-2 mr-4 flex h-10 w-10 items-center justify-center rounded ring-2 ring-primary-200 ring-offset-2",
75
- props.current ? "bg-buttonPrimary-default text-white" : "bg-primary-200"
74
+ "ring-buttonPrimary-200 m-2 mr-4 flex h-10 w-10 items-center justify-center rounded ring-2 ring-offset-2",
75
+ props.current
76
+ ? "bg-buttonPrimary-500 text-white"
77
+ : "bg-buttonPrimary-200"
76
78
  )}
77
79
  >
78
80
  {props.stepNumber}
@@ -0,0 +1,78 @@
1
+ import clsx from "clsx"
2
+ import React, { useState } from "react"
3
+ import { HawaChip } from "./HawaChip"
4
+
5
+ type SubsectionListTypes = {
6
+ align?: any
7
+ subsections: [
8
+ {
9
+ title: string
10
+ sections: [
11
+ {
12
+ label: string
13
+ action: () => void
14
+ icon?: any
15
+ value?: any
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
21
+ export const SubsectionList: React.FunctionComponent<SubsectionListTypes> = ({
22
+ subsections,
23
+ }) => {
24
+ const [selectedSection, setSelectedSection] = useState(null)
25
+ return (
26
+ <div className="w-full max-w-2xs rounded bg-layoutPrimary-500 p-4 ">
27
+ {subsections.map((ss) => (
28
+ <div className="my-0">
29
+ {ss.title && <div className="my-4 font-bold">{ss.title}</div>}
30
+ {ss.sections.map((s) => (
31
+ <SubsectionItem
32
+ onItemClick={() => setSelectedSection(s.value)}
33
+ selected={selectedSection}
34
+ value={s.value}
35
+ icon={s.icon}
36
+ title={s.label}
37
+ chip="Upgrade"
38
+ />
39
+ ))}
40
+ </div>
41
+ ))}
42
+ </div>
43
+ )
44
+ }
45
+
46
+ type TSubsectionItem = {
47
+ chip?: string
48
+ title: string
49
+ value: string
50
+ icon?: any
51
+ selected?: any
52
+ onItemClick?: () => void
53
+ }
54
+ const SubsectionItem: React.FunctionComponent<TSubsectionItem> = ({
55
+ title,
56
+ value,
57
+ icon,
58
+ chip,
59
+ selected,
60
+ onItemClick,
61
+ }) => {
62
+ return (
63
+ <div
64
+ onClick={onItemClick}
65
+ className={clsx(
66
+ "flex w-full cursor-pointer flex-row items-center justify-between gap-2 rounded p-2 transition-all ",
67
+ selected === value
68
+ ? "bg-buttonPrimary-500 text-white hover:bg-buttonPrimary-500"
69
+ : "hover:bg-layoutPrimary-300"
70
+ )}
71
+ >
72
+ <div className="flex w-full flex-row items-center justify-start gap-2">
73
+ {icon} <span>{title}</span>
74
+ </div>
75
+ {chip && <HawaChip label="Upgrade" size="normal" />}{" "}
76
+ </div>
77
+ )
78
+ }
@@ -26,6 +26,7 @@ export * from "./HawaStats"
26
26
  export * from "./HawaSpinner"
27
27
  export * from "./HawaRadio"
28
28
  export * from "./HawaDrawer"
29
+ export * from "./SubsectionList"
29
30
  // Inputs
30
31
  export * from "./HawaTextField"
31
32
  export * from "./HawaCardInput"
@@ -71,12 +71,12 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
71
71
  //less than 600
72
72
  //as nothing and expands as button is clicked
73
73
  let ltrDrawerStyle = [
74
- " fixed top-0 left-0 z-40 flex h-full flex-col justify-between overflow-x-clip bg-layoutPrimary-default transition-all",
74
+ " fixed top-0 left-0 z-40 flex h-full flex-col justify-between overflow-x-clip bg-layoutPrimary-500 transition-all",
75
75
  size > 600 ? "w-14 hover:w-40" : "w-0",
76
76
  openSideMenu ? "w-40" : "w-14",
77
77
  ]
78
78
  let rtlDrawerStyle = [
79
- "fixed top-0 right-0 z-40 flex h-full flex-col justify-between overflow-x-clip bg-layoutPrimary-default transition-all",
79
+ "fixed top-0 right-0 z-40 flex h-full flex-col justify-between overflow-x-clip bg-layoutPrimary-500 transition-all",
80
80
  size > 600 ? "w-14 hover:w-40" : "w-0",
81
81
  openSideMenu ? "w-40" : "w-14",
82
82
  ]
@@ -100,7 +100,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
100
100
  {props.topBar && (
101
101
  <div
102
102
  className={clsx(
103
- "fixed top-0 z-30 flex h-14 flex-row items-center justify-between bg-layoutPrimary-default",
103
+ "fixed top-0 z-30 flex h-14 flex-row items-center justify-between bg-layoutPrimary-500",
104
104
  // size > 600 ? "w-[calc(100%-3rem)] translate-x-[3rem]" : "w-full",
105
105
  "w-full",
106
106
  "p-2",
@@ -178,7 +178,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
178
178
  >
179
179
  <div
180
180
  className={clsx(
181
- "fixed z-50 mb-2 flex h-12 items-center justify-center bg-layoutPrimary-default p-2 transition-all",
181
+ "fixed z-50 mb-2 flex h-12 items-center justify-center bg-layoutPrimary-500 p-2 transition-all",
182
182
  openSideMenu ? "w-40" : "w-14"
183
183
  )}
184
184
  >
@@ -228,7 +228,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
228
228
  }}
229
229
  className={clsx(
230
230
  props.currentPage === dItem.slug
231
- ? "bg-buttonPrimary-default text-white"
231
+ ? "bg-buttonPrimary-500 text-white"
232
232
  : "hover:bg-buttonPrimary-lighter",
233
233
  "m-2 flex cursor-pointer flex-row items-center overflow-x-clip rounded p-2 pl-3 transition-all ",
234
234
  direction === "rtl" ? "flex-row-reverse pr-3" : ""
@@ -263,7 +263,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
263
263
  )
264
264
  })}
265
265
  {j !== props.drawerItems.length - 1 && (
266
- <div className="my-2 h-[1px] w-10/12 self-center bg-buttonPrimary-default text-center "></div>
266
+ <div className="my-2 h-[1px] w-10/12 self-center bg-buttonPrimary-500 text-center "></div>
267
267
  )}{" "}
268
268
  </div>
269
269
  ))}
@@ -20,7 +20,7 @@ export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
20
20
  normal: "max-w-sm md:max-w-md",
21
21
  }
22
22
  let variantStyles = {
23
- contained: "bg-layoutPrimary-default dark:bg-layoutPrimary-dark",
23
+ contained: "bg-layoutPrimary-500 dark:bg-layoutPrimary-dark",
24
24
  outlined: "bg-transparent border-2 border-black w-fit",
25
25
  neobrutalism: "shadow-neobrutalism border-4 border-black bg-white",
26
26
  }