@sikka/hawa 0.0.46 → 0.0.48
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/blocks/AuthForms/CodeConfirmation.js +5 -21
- package/src/blocks/AuthForms/NewPasswordForm.js +6 -22
- package/src/blocks/AuthForms/ResetPasswordForm.js +6 -17
- package/src/blocks/AuthForms/SignInForm.js +59 -82
- package/src/blocks/AuthForms/SignInPhone.js +5 -9
- package/src/blocks/AuthForms/SignUpForm.js +38 -69
- package/src/elements/HawaButton.js +7 -4
- package/src/elements/HawaDrawerItem.js +10 -8
- package/src/elements/HawaPhoneInput.js +17 -0
- package/src/elements/HawaTextField.js +3 -3
- package/src/layout/HawaLayout.js +148 -117
- package/src/layout/index.js +0 -1
- package/src/tailwind.css +5 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.7d233d65.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/{vendors~main.bfb520c7.iframe.bundle.js → vendors~main.ceb9a32a.iframe.bundle.js} +4 -4
- package/storybook-static/{vendors~main.bfb520c7.iframe.bundle.js.LICENSE.txt → vendors~main.ceb9a32a.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.ceb9a32a.iframe.bundle.js.map +1 -0
- package/tailwind.config.js +4 -0
- package/src/layout/HawaAppBar.js +0 -97
- package/storybook-static/main.e8029a3c.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.bfb520c7.iframe.bundle.js.map +0 -1
package/src/layout/HawaLayout.js
CHANGED
|
@@ -29,41 +29,149 @@ const MenuButton = () => {
|
|
|
29
29
|
</button>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
+
const ProfileDropdown = (props) => {
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
id="userDropdown"
|
|
36
|
+
class="hidden z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600"
|
|
37
|
+
data-popper-reference-hidden=""
|
|
38
|
+
data-popper-escaped=""
|
|
39
|
+
data-popper-placement="bottom-start"
|
|
40
|
+
// style="position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate3d(0px, 295.5px, 0px);"
|
|
41
|
+
>
|
|
42
|
+
<div class="py-3 px-4 text-sm text-gray-900 dark:text-white">
|
|
43
|
+
<div>{props.username}</div>
|
|
44
|
+
<div class="font-medium truncate">{props.userEmail}</div>
|
|
45
|
+
</div>
|
|
46
|
+
<ul
|
|
47
|
+
class="py-1 text-sm text-gray-700 dark:text-gray-200"
|
|
48
|
+
aria-labelledby="avatarButton"
|
|
49
|
+
>
|
|
50
|
+
{props.profileItems.map((it) => {
|
|
51
|
+
return <ProfileItem text={it.text} link={it.slug} />;
|
|
52
|
+
})}
|
|
53
|
+
</ul>
|
|
54
|
+
<div class="py-1">
|
|
55
|
+
<a
|
|
56
|
+
href="#"
|
|
57
|
+
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
|
|
58
|
+
>
|
|
59
|
+
Sign out
|
|
60
|
+
</a>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
const DrawerContent = (props) => {
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
id="drawer-navigation"
|
|
69
|
+
class="fixed z-40 h-screen p-4 overflow-y-auto bg-white w-80 dark:bg-gray-800"
|
|
70
|
+
tabindex="-1"
|
|
71
|
+
aria-labelledby="drawer-navigation-label"
|
|
72
|
+
>
|
|
73
|
+
<div href={props.logoHref} class="flex items-center">
|
|
74
|
+
<img
|
|
75
|
+
src={
|
|
76
|
+
"https://my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"
|
|
77
|
+
}
|
|
78
|
+
// src={props.logoLink}
|
|
79
|
+
class="h-9"
|
|
80
|
+
alt="Flowbite Logo"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<CloseButton />
|
|
84
|
+
<div class="py-4 overflow-y-auto">
|
|
85
|
+
<ul class="space-y-2">
|
|
86
|
+
{props.drawerItems.map((item, i) => {
|
|
87
|
+
return (
|
|
88
|
+
<HawaDrawerItem action={item.action} key={i} text={item.text} />
|
|
89
|
+
);
|
|
90
|
+
})}
|
|
91
|
+
</ul>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const ProfileItem = (props) => {
|
|
98
|
+
return (
|
|
99
|
+
<li>
|
|
100
|
+
<a
|
|
101
|
+
href={props.link}
|
|
102
|
+
className="block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
103
|
+
>
|
|
104
|
+
{props.text}
|
|
105
|
+
</a>
|
|
106
|
+
</li>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
const CloseButton = () => {
|
|
110
|
+
return (
|
|
111
|
+
<button
|
|
112
|
+
type="button"
|
|
113
|
+
data-drawer-dismiss="drawer-navigation"
|
|
114
|
+
aria-controls="drawer-navigation"
|
|
115
|
+
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"
|
|
116
|
+
>
|
|
117
|
+
<svg
|
|
118
|
+
aria-hidden="true"
|
|
119
|
+
class="w-5 h-5"
|
|
120
|
+
fill="currentColor"
|
|
121
|
+
viewBox="0 0 20 20"
|
|
122
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
123
|
+
>
|
|
124
|
+
<path
|
|
125
|
+
fill-rule="evenodd"
|
|
126
|
+
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"
|
|
127
|
+
clip-rule="evenodd"
|
|
128
|
+
></path>
|
|
129
|
+
</svg>
|
|
130
|
+
</button>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
32
133
|
export const HawaLayout = (props) => {
|
|
33
134
|
return (
|
|
34
|
-
<div>
|
|
135
|
+
<div className="font-plex">
|
|
35
136
|
<div>
|
|
36
137
|
<nav class="border-gray-200 rounded dark:bg-gray-900">
|
|
37
138
|
<div class="flex p-3 flex-row-reverse items-center justify-between w-full">
|
|
38
|
-
<div href={props.
|
|
139
|
+
{/* <div href={props.logoHref} class="flex items-center">
|
|
140
|
+
<img src={props.logoLink} class="h-9" alt="Flowbite Logo" />
|
|
141
|
+
</div> */}
|
|
142
|
+
<div
|
|
143
|
+
data-dropdown-toggle="userDropdown"
|
|
144
|
+
data-dropdown-placement="bottom-start"
|
|
145
|
+
class="overflow-hidden mr-2 relative w-10 h-10 bg-gray-100 rounded-full dark:bg-gray-600"
|
|
146
|
+
>
|
|
147
|
+
<svg
|
|
148
|
+
class="absolute -left-1 w-12 h-12 text-gray-400"
|
|
149
|
+
fill="currentColor"
|
|
150
|
+
viewBox="0 0 20 20"
|
|
151
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
152
|
+
>
|
|
153
|
+
<path
|
|
154
|
+
fill-rule="evenodd"
|
|
155
|
+
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
156
|
+
clip-rule="evenodd"
|
|
157
|
+
></path>
|
|
158
|
+
</svg>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
{/* <div href={props.logoHref} class="flex items-center">
|
|
39
162
|
<img
|
|
40
|
-
src=
|
|
41
|
-
|
|
163
|
+
src={
|
|
164
|
+
// "https://my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"
|
|
165
|
+
"https://qawaim-images.s3-ap-southeast-1.amazonaws.com/614580f79706137eab618399"
|
|
166
|
+
}
|
|
167
|
+
// src={props.logoLink}
|
|
168
|
+
class="h-12"
|
|
42
169
|
alt="Flowbite Logo"
|
|
43
170
|
/>
|
|
44
|
-
</div>
|
|
171
|
+
</div> */}
|
|
172
|
+
<div>{props.pageTitle ?? "Home"}</div>
|
|
45
173
|
<div className="flex flex-row-reverse">
|
|
46
174
|
<MenuButton />
|
|
47
|
-
|
|
48
|
-
<div
|
|
49
|
-
data-dropdown-toggle="userDropdown"
|
|
50
|
-
data-dropdown-placement="bottom-start"
|
|
51
|
-
class="overflow-hidden mr-2 relative w-10 h-10 bg-gray-100 rounded-full dark:bg-gray-600"
|
|
52
|
-
>
|
|
53
|
-
<svg
|
|
54
|
-
class="absolute -left-1 w-12 h-12 text-gray-400"
|
|
55
|
-
fill="currentColor"
|
|
56
|
-
viewBox="0 0 20 20"
|
|
57
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
58
|
-
>
|
|
59
|
-
<path
|
|
60
|
-
fill-rule="evenodd"
|
|
61
|
-
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
62
|
-
clip-rule="evenodd"
|
|
63
|
-
></path>
|
|
64
|
-
</svg>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
175
|
{/* <img
|
|
68
176
|
id="avatarButton"
|
|
69
177
|
type="button"
|
|
@@ -77,101 +185,24 @@ export const HawaLayout = (props) => {
|
|
|
77
185
|
</div>
|
|
78
186
|
</nav>
|
|
79
187
|
</div>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
>
|
|
88
|
-
<div class="py-3 px-4 text-sm text-gray-900 dark:text-white">
|
|
89
|
-
<div>Bonnie Green</div>
|
|
90
|
-
<div class="font-medium truncate">name@flowbite.com</div>
|
|
91
|
-
</div>
|
|
92
|
-
<ul
|
|
93
|
-
class="py-1 text-sm text-gray-700 dark:text-gray-200"
|
|
94
|
-
aria-labelledby="avatarButton"
|
|
95
|
-
>
|
|
96
|
-
<li>
|
|
97
|
-
<a
|
|
98
|
-
href="#"
|
|
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>
|
|
120
|
-
</ul>
|
|
121
|
-
<div class="py-1">
|
|
122
|
-
<a
|
|
123
|
-
href="#"
|
|
124
|
-
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
|
|
125
|
-
>
|
|
126
|
-
Sign out
|
|
127
|
-
</a>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
|
|
131
|
-
<div
|
|
132
|
-
id="drawer-navigation"
|
|
133
|
-
class="fixed z-40 h-screen p-4 overflow-y-auto bg-white w-80 dark:bg-gray-800"
|
|
134
|
-
tabindex="-1"
|
|
135
|
-
aria-labelledby="drawer-navigation-label"
|
|
136
|
-
>
|
|
137
|
-
<h5
|
|
138
|
-
id="drawer-navigation-label"
|
|
139
|
-
class="text-base font-semibold text-gray-500 uppercase dark:text-gray-400"
|
|
140
|
-
>
|
|
141
|
-
{props.appTitle}
|
|
142
|
-
</h5>
|
|
143
|
-
<button
|
|
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>
|
|
163
|
-
<div class="py-4 overflow-y-auto">
|
|
164
|
-
<ul class="space-y-2">
|
|
165
|
-
{props.drawerItems.map((item, i) => {
|
|
166
|
-
return <HawaDrawerItem key={i} text={item.text} />;
|
|
167
|
-
})}
|
|
168
|
-
</ul>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
188
|
+
<ProfileDropdown profileItems={props.profileItems} />
|
|
189
|
+
<DrawerContent
|
|
190
|
+
logoHref={props.logoHref}
|
|
191
|
+
appTitle={props.appTitle}
|
|
192
|
+
drawerItems={props.drawerItems}
|
|
193
|
+
/>
|
|
194
|
+
<div className="p-3">{props.children}</div>
|
|
171
195
|
</div>
|
|
172
196
|
);
|
|
173
197
|
};
|
|
174
198
|
|
|
175
199
|
HawaLayout.propTypes = {
|
|
176
|
-
logoLink: PropTypes.string
|
|
200
|
+
logoLink: PropTypes.string,
|
|
201
|
+
username: PropTypes.string,
|
|
202
|
+
userEmail: PropTypes.string,
|
|
203
|
+
drawerItems: PropTypes.objectOf({
|
|
204
|
+
text: PropTypes.string,
|
|
205
|
+
slug: PropTypes.string,
|
|
206
|
+
action: PropTypes.func
|
|
207
|
+
})
|
|
177
208
|
};
|
package/src/layout/index.js
CHANGED
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.ceb9a32a.iframe.bundle.js"></script><script src="main.7d233d65.iframe.bundle.js"></script></body></html>
|