@sikka/hawa 0.0.46 → 0.0.47
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/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/elements/HawaDrawerItem.js +10 -8
- package/src/layout/HawaLayout.js +58 -55
- package/src/tailwind.css +5 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.07f6e990.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/{vendors~main.bfb520c7.iframe.bundle.js → vendors~main.bff3812a.iframe.bundle.js} +3 -3
- package/storybook-static/{vendors~main.bfb520c7.iframe.bundle.js.LICENSE.txt → vendors~main.bff3812a.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.bff3812a.iframe.bundle.js.map +1 -0
- package/tailwind.config.js +4 -0
- package/storybook-static/main.e8029a3c.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.bfb520c7.iframe.bundle.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
const HawaDrawerItem = (props) => {
|
|
4
|
+
let withIcon =
|
|
5
|
+
"flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700";
|
|
6
|
+
let withoutIcon =
|
|
7
|
+
"flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700";
|
|
8
|
+
|
|
4
9
|
return (
|
|
5
|
-
<li>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
9
|
-
>
|
|
10
|
-
<svg
|
|
10
|
+
<li onClick={props.action}>
|
|
11
|
+
<div className={props.icon ? withIcon : withoutIcon}>
|
|
12
|
+
{/* <svg
|
|
11
13
|
aria-hidden="true"
|
|
12
14
|
class="w-6 h-6 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"
|
|
13
15
|
fill="currentColor"
|
|
@@ -16,9 +18,9 @@ const HawaDrawerItem = (props) => {
|
|
|
16
18
|
>
|
|
17
19
|
<path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path>
|
|
18
20
|
<path d="M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"></path>
|
|
19
|
-
</svg>
|
|
21
|
+
</svg> */}
|
|
20
22
|
<span class="ml-3">{props.text}</span>
|
|
21
|
-
</
|
|
23
|
+
</div>
|
|
22
24
|
</li>
|
|
23
25
|
);
|
|
24
26
|
};
|
package/src/layout/HawaLayout.js
CHANGED
|
@@ -29,18 +29,51 @@ const MenuButton = () => {
|
|
|
29
29
|
</button>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
+
|
|
33
|
+
const ProfileItem = (props) => {
|
|
34
|
+
return (
|
|
35
|
+
<li>
|
|
36
|
+
<a
|
|
37
|
+
href={props.link}
|
|
38
|
+
className="block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
39
|
+
>
|
|
40
|
+
{props.text}
|
|
41
|
+
</a>
|
|
42
|
+
</li>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
const CloseButton = () => {
|
|
46
|
+
return (
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
data-drawer-dismiss="drawer-navigation"
|
|
50
|
+
aria-controls="drawer-navigation"
|
|
51
|
+
className="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
|
|
52
|
+
>
|
|
53
|
+
<svg
|
|
54
|
+
aria-hidden="true"
|
|
55
|
+
class="w-5 h-5"
|
|
56
|
+
fill="currentColor"
|
|
57
|
+
viewBox="0 0 20 20"
|
|
58
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
+
>
|
|
60
|
+
<path
|
|
61
|
+
fill-rule="evenodd"
|
|
62
|
+
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"
|
|
63
|
+
clip-rule="evenodd"
|
|
64
|
+
></path>
|
|
65
|
+
</svg>
|
|
66
|
+
</button>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
32
69
|
export const HawaLayout = (props) => {
|
|
33
70
|
return (
|
|
34
|
-
<div>
|
|
71
|
+
<div className="font-plex">
|
|
35
72
|
<div>
|
|
36
73
|
<nav class="border-gray-200 rounded dark:bg-gray-900">
|
|
37
74
|
<div class="flex p-3 flex-row-reverse items-center justify-between w-full">
|
|
38
|
-
<div href={props.
|
|
39
|
-
<img
|
|
40
|
-
src="https://flowbite.com/docs/images/logo.svg"
|
|
41
|
-
class="h-9"
|
|
42
|
-
alt="Flowbite Logo"
|
|
43
|
-
/>
|
|
75
|
+
<div href={props.logoHref} class="flex items-center">
|
|
76
|
+
<img src={props.logoLink} class="h-9" alt="Flowbite Logo" />
|
|
44
77
|
</div>
|
|
45
78
|
<div className="flex flex-row-reverse">
|
|
46
79
|
<MenuButton />
|
|
@@ -86,37 +119,16 @@ export const HawaLayout = (props) => {
|
|
|
86
119
|
// style="position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate3d(0px, 295.5px, 0px);"
|
|
87
120
|
>
|
|
88
121
|
<div class="py-3 px-4 text-sm text-gray-900 dark:text-white">
|
|
89
|
-
<div>
|
|
90
|
-
<div class="font-medium truncate">
|
|
122
|
+
<div>{props.username}</div>
|
|
123
|
+
<div class="font-medium truncate">{props.userEmail}</div>
|
|
91
124
|
</div>
|
|
92
125
|
<ul
|
|
93
126
|
class="py-1 text-sm text-gray-700 dark:text-gray-200"
|
|
94
127
|
aria-labelledby="avatarButton"
|
|
95
128
|
>
|
|
96
|
-
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
class="block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
100
|
-
>
|
|
101
|
-
Dashboard
|
|
102
|
-
</a>
|
|
103
|
-
</li>
|
|
104
|
-
<li>
|
|
105
|
-
<a
|
|
106
|
-
href="#"
|
|
107
|
-
class="block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
108
|
-
>
|
|
109
|
-
Settings
|
|
110
|
-
</a>
|
|
111
|
-
</li>
|
|
112
|
-
<li>
|
|
113
|
-
<a
|
|
114
|
-
href="#"
|
|
115
|
-
class="block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
116
|
-
>
|
|
117
|
-
Earnings
|
|
118
|
-
</a>
|
|
119
|
-
</li>
|
|
129
|
+
{props.profileItems.map((it) => {
|
|
130
|
+
return <ProfileItem text={it.text} link={it.slug} />;
|
|
131
|
+
})}
|
|
120
132
|
</ul>
|
|
121
133
|
<div class="py-1">
|
|
122
134
|
<a
|
|
@@ -140,38 +152,29 @@ export const HawaLayout = (props) => {
|
|
|
140
152
|
>
|
|
141
153
|
{props.appTitle}
|
|
142
154
|
</h5>
|
|
143
|
-
<
|
|
144
|
-
type="button"
|
|
145
|
-
data-drawer-dismiss="drawer-navigation"
|
|
146
|
-
aria-controls="drawer-navigation"
|
|
147
|
-
class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
|
|
148
|
-
>
|
|
149
|
-
<svg
|
|
150
|
-
aria-hidden="true"
|
|
151
|
-
class="w-5 h-5"
|
|
152
|
-
fill="currentColor"
|
|
153
|
-
viewBox="0 0 20 20"
|
|
154
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
155
|
-
>
|
|
156
|
-
<path
|
|
157
|
-
fill-rule="evenodd"
|
|
158
|
-
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"
|
|
159
|
-
clip-rule="evenodd"
|
|
160
|
-
></path>
|
|
161
|
-
</svg>
|
|
162
|
-
</button>
|
|
155
|
+
<CloseButton />
|
|
163
156
|
<div class="py-4 overflow-y-auto">
|
|
164
157
|
<ul class="space-y-2">
|
|
165
158
|
{props.drawerItems.map((item, i) => {
|
|
166
|
-
return
|
|
159
|
+
return (
|
|
160
|
+
<HawaDrawerItem action={item.action} key={i} text={item.text} />
|
|
161
|
+
);
|
|
167
162
|
})}
|
|
168
163
|
</ul>
|
|
169
164
|
</div>
|
|
170
165
|
</div>
|
|
166
|
+
<div className="p-3">{props.children}</div>
|
|
171
167
|
</div>
|
|
172
168
|
);
|
|
173
169
|
};
|
|
174
170
|
|
|
175
171
|
HawaLayout.propTypes = {
|
|
176
|
-
logoLink: PropTypes.string
|
|
172
|
+
logoLink: PropTypes.string,
|
|
173
|
+
username: PropTypes.string,
|
|
174
|
+
userEmail: PropTypes.string,
|
|
175
|
+
drawerItems: PropTypes.objectOf({
|
|
176
|
+
text: PropTypes.string,
|
|
177
|
+
slug: PropTypes.string,
|
|
178
|
+
action: PropTypes.func
|
|
179
|
+
})
|
|
177
180
|
};
|
package/src/tailwind.css
CHANGED
|
@@ -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.0e8a2888.iframe.bundle.js"></script><script src="vendors~main.
|
|
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.0e8a2888.iframe.bundle.js"></script><script src="vendors~main.bff3812a.iframe.bundle.js"></script><script src="main.07f6e990.iframe.bundle.js"></script></body></html>
|