@sikka/hawa 0.0.227 → 0.0.229

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.
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const Box: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const Box: (props: any) => React.JSX.Element;
@@ -1,23 +1,24 @@
1
+ import * as React from "react";
1
2
  import { Meta } from "@storybook/react";
2
3
  declare const _default: Meta<import("@storybook/react").Args>;
3
4
  export default _default;
4
5
  export declare const ButtonVariationsStory: {
5
- (): JSX.Element;
6
+ (): React.JSX.Element;
6
7
  storyName: string;
7
8
  };
8
9
  export declare const ButtonLoadingStory: {
9
- (): JSX.Element;
10
+ (): React.JSX.Element;
10
11
  storyName: string;
11
12
  };
12
13
  export declare const ButtonWidthStory: {
13
- (): JSX.Element;
14
+ (): React.JSX.Element;
14
15
  storyName: string;
15
16
  };
16
17
  export declare const ButtonSizesStory: {
17
- (): JSX.Element;
18
+ (): React.JSX.Element;
18
19
  storyName: string;
19
20
  };
20
21
  export declare const ButtonIconsStory: {
21
- (): JSX.Element;
22
+ (): React.JSX.Element;
22
23
  storyName: string;
23
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.227",
3
+ "version": "0.0.229",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -14,7 +14,7 @@ export const EmptyState: React.FunctionComponent<TEmptyState> = ({
14
14
  <HawaContainer variant={variant} centered={true}>
15
15
  <div className="flex flex-col items-center justify-center text-center dark:text-white">
16
16
  <div className="flex h-10 w-10 flex-col items-center justify-center rounded-3xl bg-buttonPrimary-300 text-6xl font-bold">
17
- <FaCheck size={20} />
17
+ <FaCheck size={20} color="white" />
18
18
  </div>
19
19
  <div className="m-2 text-xl font-bold">You're all caught up</div>
20
20
  <div>If you're lost, please contact us help@sikka.io </div>
@@ -0,0 +1,30 @@
1
+ import React from "react"
2
+ import { HawaButton } from "../../elements"
3
+ import { HawaContainer } from "../../layout"
4
+ import { FaLock } from "react-icons/fa"
5
+
6
+ type TNoPermission = {
7
+ variant?: "outlined" | "contained" | "neobrutalism"
8
+ }
9
+
10
+ export const NoPermission: React.FunctionComponent<TNoPermission> = ({
11
+ variant = "contained",
12
+ }) => {
13
+ return (
14
+ <HawaContainer variant={variant} centered={true}>
15
+ <div className="flex flex-col items-center justify-center text-center dark:text-white">
16
+ <div className="flex h-10 w-10 flex-col items-center justify-center rounded-3xl bg-buttonPrimary-300 text-6xl font-bold">
17
+ <FaLock size={20} color="white" />
18
+ </div>
19
+ <div className="m-2 text-xl font-bold">You don't have permission</div>
20
+ <div>
21
+ If you think this is a problem please contact your administrator or
22
+ our customer support
23
+ </div>
24
+ </div>
25
+ {/* <HawaButton color="primary" width="full">
26
+ Action
27
+ </HawaButton> */}
28
+ </HawaContainer>
29
+ )
30
+ }
@@ -3,3 +3,4 @@ export * from "./EmptyState"
3
3
  export * from "./Newsletter"
4
4
  export * from "./Testimonial"
5
5
  export * from "./LeadGenerator"
6
+ export * from "./NoPermission"
@@ -27,6 +27,7 @@ interface TMenuTypes {
27
27
 
28
28
  type MenuItems = {
29
29
  icon?: JSX.Element
30
+ disabled?: boolean
30
31
  label: string
31
32
  action?: (e: any) => void
32
33
  isButton?: boolean
@@ -186,12 +187,21 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
186
187
  ) : (
187
188
  <li
188
189
  key={indx}
189
- onClick={() => item?.action(actionedItem)}
190
+ onClick={() => {
191
+ if (item.disabled) {
192
+ console.log("button is disabled")
193
+ } else {
194
+ item?.action(actionedItem)
195
+ }
196
+ }}
190
197
  className={clsx(
191
198
  item.isButton
192
199
  ? "flex cursor-pointer flex-row items-center rounded bg-buttonPrimary-500 py-2 px-4 text-white hover:bg-buttonPrimary-700 rtl:flex-row-reverse dark:hover:bg-buttonPrimary-700 dark:hover:text-white"
193
- : " flex cursor-pointer flex-row items-center rounded hover:bg-gray-200 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white",
194
- sizeStyles[size]
200
+ : " flex flex-row items-center rounded rtl:flex-row-reverse ",
201
+ sizeStyles[size],
202
+ item.disabled
203
+ ? "text-gray-300"
204
+ : " cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 dark:hover:text-white"
195
205
  )}
196
206
  >
197
207
  {item.icon && (
@@ -17,6 +17,7 @@ type THawaSnackBar = {
17
17
  | "bottom-left"
18
18
  actions?: [
19
19
  {
20
+ icon?: any
20
21
  label: string
21
22
  onClick: any
22
23
  variant: "contained" | "outlined"
@@ -85,7 +86,7 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
85
86
  closed ? "opacity-0" : "opacity-100"
86
87
  )}
87
88
  >
88
- <div className="p-3 w-full">
89
+ <div className="w-full p-3 flex flex-col gap-2">
89
90
  <div className="text-sm font-bold">{title}</div>
90
91
  <div className="text-sm font-normal">{description}</div>
91
92
  {actions && (
@@ -97,6 +98,7 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
97
98
  onClick={act.onClick()}
98
99
  margins="none"
99
100
  >
101
+ {act.icon && act.icon}
100
102
  {act.label}
101
103
  </HawaButton>
102
104
  ))}
@@ -105,7 +107,7 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
105
107
  </div>
106
108
  <button
107
109
  type="button"
108
- className="inline-flex h-8 w-8 rounded p-1.5 right-0 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
110
+ className="right-0 inline-flex h-8 w-8 rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
109
111
  data-dismiss-target="#toast-default"
110
112
  aria-label="Close"
111
113
  onClick={() => setClosed(true)}
@@ -73,7 +73,10 @@ export const InvoiceAccordion: React.FunctionComponent<
73
73
  <HiChevronRight fontSize={30} />
74
74
  </div>
75
75
  )}
76
- <div className="flex w-full flex-col gap-0 ">
76
+ <div
77
+ className="flex w-full cursor-pointer flex-col gap-0"
78
+ onClick={() => setExpanded(!expanded)}
79
+ >
77
80
  <div className="flex flex-row items-center gap-2">
78
81
  <span className="bg-white-200">{props.invoiceTitle}</span>
79
82
  {props.status && <HawaChip size="small" label={props.status} />}
@@ -0,0 +1,59 @@
1
+ import React from "react"
2
+
3
+ type ComponentTypes = {
4
+ title?: string
5
+ question: string
6
+ options?: []
7
+ texts?: {
8
+ least: string
9
+ most: string
10
+ }
11
+ onOptionClicked?: (option) => void
12
+ }
13
+ export const UserFeedback: React.FunctionComponent<ComponentTypes> = ({
14
+ ...props
15
+ }) => {
16
+ return (
17
+ <div className="relative flex w-full max-w-sm flex-col gap-2 rounded bg-white p-4 shadow-md">
18
+ <div className="absolute left-2 top-2 p-1.5 text-sm">{props.title}</div>
19
+ <button
20
+ type="button"
21
+ className="absolute right-2 top-2 inline-flex h-8 w-8 rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
22
+ data-dismiss-target="#toast-default"
23
+ aria-label="Close"
24
+ // onClick={() => setClosed(true)}
25
+ >
26
+ <svg
27
+ aria-hidden="true"
28
+ className="h-5 w-5"
29
+ fill="currentColor"
30
+ viewBox="0 0 20 20"
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ >
33
+ <path
34
+ fillRule="evenodd"
35
+ d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
36
+ clipRule="evenodd"
37
+ ></path>
38
+ </svg>
39
+ </button>
40
+ <div className="mt-8">{props.question}</div>
41
+ <div className="flex w-full flex-row gap-1 rounded">
42
+ {props.options.map((op) => (
43
+ <span
44
+ onClick={() => props.onOptionClicked(op)}
45
+ className="w-full cursor-pointer rounded border bg-white p-4 text-center transition-all hover:bg-gray-100"
46
+ >
47
+ {op}
48
+ </span>
49
+ ))}
50
+ </div>
51
+ {props.texts && (
52
+ <div className=" flex flex-row justify-between text-xs">
53
+ <span>{props.texts.least}</span>
54
+ <span>{props.texts.most}</span>
55
+ </div>
56
+ )}
57
+ </div>
58
+ )
59
+ }
@@ -30,6 +30,7 @@ export * from "./SubsectionList"
30
30
  export * from "./UsageCard"
31
31
  export * from "./InvoiceAccordion"
32
32
  export * from "./HawaDatepicker"
33
+ export * from "./UserFeedback"
33
34
  // Inputs
34
35
  export * from "./HawaTextField"
35
36
  export * from "./HawaCardInput"
package/src/styles.css CHANGED
@@ -795,6 +795,9 @@ video {
795
795
  .mt-6 {
796
796
  margin-top: 1.5rem;
797
797
  }
798
+ .mt-8 {
799
+ margin-top: 2rem;
800
+ }
798
801
  .block {
799
802
  display: block;
800
803
  }
@@ -1,9 +0,0 @@
1
- import { Meta } from "@storybook/react";
2
- declare const _default: Meta<import("@storybook/react").Args>;
3
- export default _default;
4
- export declare const Plain: any;
5
- export declare const Success: any;
6
- export declare const Warning: any;
7
- export declare const Info: any;
8
- export declare const Error: any;
9
- export declare const WithActions: any;
@@ -1,9 +0,0 @@
1
- import { Meta } from "@storybook/react";
2
- declare const _default: Meta<import("@storybook/react").Args>;
3
- export default _default;
4
- export declare const Plain: any;
5
- export declare const Success: any;
6
- export declare const Warning: any;
7
- export declare const Info: any;
8
- export declare const Error: any;
9
- export declare const WithActions: any;