@sikka/hawa 0.0.228 → 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.
- package/es/blocks/Misc/NoPermission.d.ts +6 -0
- package/es/blocks/Misc/index.d.ts +1 -0
- package/es/elements/HawaCardInput.d.ts +2 -2
- package/es/elements/HawaMenu.d.ts +1 -0
- package/es/elements/HawaSnackbar.d.ts +1 -0
- package/es/index.es.js +1 -1
- package/es/layout/Box.d.ts +2 -2
- package/es/stories/ElementsStories/Buttons.stories.d.ts +6 -5
- package/lib/blocks/Misc/NoPermission.d.ts +6 -0
- package/lib/blocks/Misc/index.d.ts +1 -0
- package/lib/elements/HawaCardInput.d.ts +2 -2
- package/lib/elements/HawaMenu.d.ts +1 -0
- package/lib/elements/HawaSnackbar.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/layout/Box.d.ts +2 -2
- package/lib/stories/ElementsStories/Buttons.stories.d.ts +6 -5
- package/package.json +1 -1
- package/src/blocks/Misc/EmptyState.tsx +1 -1
- package/src/blocks/Misc/NoPermission.tsx +30 -0
- package/src/blocks/Misc/index.ts +1 -0
- package/src/elements/HawaMenu.tsx +13 -3
- package/src/elements/HawaSnackbar.tsx +4 -2
- package/es/stories/ElementsStories/Snackbar.stories.d.ts +0 -9
- package/lib/stories/ElementsStories/Snackbar.stories.d.ts +0 -9
package/lib/layout/Box.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
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
|
@@ -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
|
+
}
|
package/src/blocks/Misc/index.ts
CHANGED
|
@@ -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={() =>
|
|
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
|
|
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
|
|
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
|
|
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)}
|
|
@@ -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;
|