@sikka/hawa 0.0.143 → 0.0.145
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/dist/styles.css +4 -4
- package/es/elements/DragDropImages.d.ts +1 -0
- package/es/elements/HawaPhoneInput.d.ts +1 -1
- package/es/index.es.js +1 -1
- package/es/layout/HawaAppLayout.d.ts +1 -1
- package/lib/elements/DragDropImages.d.ts +1 -0
- package/lib/elements/HawaPhoneInput.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/layout/HawaAppLayout.d.ts +1 -1
- package/package.json +1 -1
- package/src/elements/DragDropImages.tsx +55 -46
- package/src/elements/HawaMenu.tsx +5 -2
- package/src/elements/HawaPanelTabs.tsx +2 -2
- package/src/elements/HawaPhoneInput.tsx +1 -1
- package/src/elements/HawaPricingCard.tsx +2 -2
- package/src/elements/HawaRadio.tsx +2 -2
- package/src/elements/HawaTabs.tsx +2 -2
- package/src/layout/HawaAppLayout.tsx +23 -6
- package/src/layout/HawaSiteLayout.tsx +4 -4
- package/src/styles.css +4 -4
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.caad440f.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/main.64f67baa.iframe.bundle.js +0 -1
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ const thumbsContainer = {
|
|
|
10
10
|
marginTop: 10,
|
|
11
11
|
}
|
|
12
12
|
type DragDropImagesTypes = {
|
|
13
|
+
label?: string
|
|
13
14
|
texts: any
|
|
14
15
|
files: [File]
|
|
15
16
|
setFiles: any
|
|
@@ -37,6 +38,7 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
37
38
|
onClearFiles,
|
|
38
39
|
maxSize,
|
|
39
40
|
errorMessages,
|
|
41
|
+
label,
|
|
40
42
|
}) =>
|
|
41
43
|
// props
|
|
42
44
|
{
|
|
@@ -154,55 +156,62 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
154
156
|
console.log("error", fileRejections)
|
|
155
157
|
|
|
156
158
|
return (
|
|
157
|
-
<div
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
159
|
+
<div>
|
|
160
|
+
{label && (
|
|
161
|
+
<div className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
162
|
+
{label}
|
|
163
|
+
</div>
|
|
164
|
+
)}
|
|
165
|
+
<div
|
|
166
|
+
// variant="drop-area"
|
|
167
|
+
{...getRootProps({
|
|
168
|
+
style: { backgroundColor: isDragActive ? "white" : "inherit" },
|
|
169
|
+
})}
|
|
170
|
+
// style={{ backgroundColor: isDragActive ? "white" : "inherit" }}
|
|
171
|
+
className="mb-2 flex flex-col justify-center rounded-xl border border-dashed border-black"
|
|
172
|
+
>
|
|
173
|
+
<input {...getInputProps()} />
|
|
174
|
+
<div className="p-1 text-center">
|
|
175
|
+
Click here or drop files here to upload
|
|
176
|
+
</div>
|
|
177
|
+
<div className="p-1 text-center">Max file size is {max}</div>
|
|
178
|
+
<div className="flex justify-center ">
|
|
179
|
+
{acceptedFiles.length > 0 && (
|
|
180
|
+
<HawaButton
|
|
181
|
+
// style={{ color: "black" }}
|
|
182
|
+
onClick={(e) => {
|
|
183
|
+
e.stopPropagation()
|
|
184
|
+
onClearFiles(acceptedFiles)
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
Clear All
|
|
188
|
+
</HawaButton>
|
|
189
|
+
)}
|
|
190
|
+
</div>
|
|
191
|
+
{thumbs && showPreview ? (
|
|
192
|
+
<aside
|
|
193
|
+
style={{
|
|
194
|
+
display: "flex",
|
|
195
|
+
flexDirection: "row",
|
|
196
|
+
flexWrap: "wrap",
|
|
197
|
+
// marginTop: 10,
|
|
177
198
|
}}
|
|
199
|
+
className="rounded-lg border-red-500"
|
|
178
200
|
>
|
|
179
|
-
|
|
180
|
-
</
|
|
181
|
-
)}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
>
|
|
193
|
-
{thumbs}
|
|
194
|
-
</aside>
|
|
195
|
-
) : null}
|
|
196
|
-
<div className="px-2">
|
|
197
|
-
{fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
|
|
198
|
-
<HawaAlert text={texts.tooManyFiles} severity="error" />
|
|
199
|
-
) : fileRejections[0]?.errors[0]?.code === "file-too-large" ? (
|
|
200
|
-
<HawaAlert text={texts.fileTooLarge} severity="error" />
|
|
201
|
-
) : (
|
|
202
|
-
errs
|
|
203
|
-
)}
|
|
201
|
+
{thumbs}
|
|
202
|
+
</aside>
|
|
203
|
+
) : null}
|
|
204
|
+
<div className="px-2">
|
|
205
|
+
{fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
|
|
206
|
+
<HawaAlert text={texts.tooManyFiles} severity="error" />
|
|
207
|
+
) : fileRejections[0]?.errors[0]?.code === "file-too-large" ? (
|
|
208
|
+
<HawaAlert text={texts.fileTooLarge} severity="error" />
|
|
209
|
+
) : (
|
|
210
|
+
errs
|
|
211
|
+
)}
|
|
212
|
+
</div>
|
|
213
|
+
{}
|
|
204
214
|
</div>
|
|
205
|
-
{}
|
|
206
215
|
</div>
|
|
207
216
|
)
|
|
208
217
|
}
|
|
@@ -89,9 +89,12 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
89
89
|
<div className="truncate font-medium">{headerSubtitle}</div>
|
|
90
90
|
</div>
|
|
91
91
|
)}
|
|
92
|
-
{menuItems.map((group) => {
|
|
92
|
+
{menuItems.map((group, o) => {
|
|
93
93
|
return (
|
|
94
|
-
<ul
|
|
94
|
+
<ul
|
|
95
|
+
key={o}
|
|
96
|
+
className="py-1 text-sm text-gray-700 dark:text-gray-200"
|
|
97
|
+
>
|
|
95
98
|
{group?.map((item) => {
|
|
96
99
|
return (
|
|
97
100
|
<li
|
|
@@ -26,9 +26,9 @@ export const HawaPanelTabs: React.FunctionComponent<PanelTabsTypes> = (
|
|
|
26
26
|
data-tabs-toggle="#myTabContent"
|
|
27
27
|
role="tablist"
|
|
28
28
|
>
|
|
29
|
-
{props.options.map((option: any) => {
|
|
29
|
+
{props.options.map((option: any, o) => {
|
|
30
30
|
return (
|
|
31
|
-
<li className="mr-2" role="presentation">
|
|
31
|
+
<li key={o} className="mr-2" role="presentation">
|
|
32
32
|
<button
|
|
33
33
|
className="inline-block rounded-t-lg border-b-2 border-blue-600 p-4 text-blue-600 hover:text-blue-600 dark:border-blue-500 dark:text-blue-500 dark:hover:text-blue-500"
|
|
34
34
|
id={`${option.value}-tab`}
|
|
@@ -95,9 +95,9 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
|
|
|
95
95
|
</span>
|
|
96
96
|
</div>
|
|
97
97
|
<ul role="list" className="my-7 space-y-0">
|
|
98
|
-
{featuresMapping?.map((feature) => {
|
|
98
|
+
{featuresMapping?.map((feature, o) => {
|
|
99
99
|
return (
|
|
100
|
-
<li className="flex ">
|
|
100
|
+
<li key={o} className="flex ">
|
|
101
101
|
<svg
|
|
102
102
|
aria-hidden="true"
|
|
103
103
|
className="m-2 h-5 w-5 flex-shrink-0 text-blue-600 dark:text-blue-500"
|
|
@@ -28,8 +28,8 @@ export const HawaRadio: React.FunctionComponent<RadioTypes> = (props) => {
|
|
|
28
28
|
"flex max-w-fit flex-row whitespace-nowrap rounded-lg bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400"
|
|
29
29
|
)}
|
|
30
30
|
>
|
|
31
|
-
{props.options?.map((opt: any) => (
|
|
32
|
-
<li className="w-full">
|
|
31
|
+
{props.options?.map((opt: any, o) => (
|
|
32
|
+
<li className="w-full" key={o}>
|
|
33
33
|
<button
|
|
34
34
|
aria-current="page"
|
|
35
35
|
onClick={() => {
|
|
@@ -21,8 +21,8 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = (props) => {
|
|
|
21
21
|
selectedOption ? "border-b-2" : "border-b-0"
|
|
22
22
|
)}
|
|
23
23
|
>
|
|
24
|
-
{props.options?.map((opt: any) => (
|
|
25
|
-
<li>
|
|
24
|
+
{props.options?.map((opt: any, o) => (
|
|
25
|
+
<li key={o}>
|
|
26
26
|
<button
|
|
27
27
|
aria-current="page"
|
|
28
28
|
onClick={() => {
|
|
@@ -5,7 +5,12 @@ import { HawaMenu } from "../elements"
|
|
|
5
5
|
import { HiMenu } from "react-icons/hi"
|
|
6
6
|
import useBreakpoint from "../hooks/useBreakpoint"
|
|
7
7
|
type HawaAppLayoutTypes = {
|
|
8
|
-
drawerItems: {
|
|
8
|
+
drawerItems: {
|
|
9
|
+
label: string
|
|
10
|
+
icon: any
|
|
11
|
+
slug: string
|
|
12
|
+
action: () => void
|
|
13
|
+
}[][]
|
|
9
14
|
currentPage: string
|
|
10
15
|
pageTitle?: string
|
|
11
16
|
logoSymbol?: any
|
|
@@ -51,6 +56,11 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
51
56
|
}
|
|
52
57
|
}, [])
|
|
53
58
|
|
|
59
|
+
//States of the side menu
|
|
60
|
+
//larger than 600
|
|
61
|
+
//as a bar and expands when hover
|
|
62
|
+
//less than 600
|
|
63
|
+
//as nothing and expands as button is clicked
|
|
54
64
|
return (
|
|
55
65
|
<>
|
|
56
66
|
{props.topBar && (
|
|
@@ -100,12 +110,12 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
100
110
|
onMouseLeave={() => setOpenSideMenu(false)}
|
|
101
111
|
ref={ref}
|
|
102
112
|
className={clsx(
|
|
103
|
-
"fixed top-0 left-0 z-50 flex h-full flex-col bg-primary-400 transition-all
|
|
104
|
-
size > 600 ? "w-12" : "w-0",
|
|
105
|
-
openSideMenu ? "w-40" : ""
|
|
113
|
+
"fixed top-0 left-0 z-50 flex h-full flex-col overflow-x-clip bg-primary-400 transition-all hover:overflow-auto",
|
|
114
|
+
size > 600 ? "w-12 hover:w-40" : "w-0",
|
|
115
|
+
openSideMenu ? "w-40" : "w-0"
|
|
106
116
|
)}
|
|
107
117
|
>
|
|
108
|
-
<div className="
|
|
118
|
+
<div className="mb-9 h-12 w-12 p-2">
|
|
109
119
|
<img
|
|
110
120
|
className={clsx(
|
|
111
121
|
"fixed top-2 h-9",
|
|
@@ -140,7 +150,13 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
140
150
|
</div>
|
|
141
151
|
|
|
142
152
|
{props.drawerItems.map((dSection, j) => (
|
|
143
|
-
<div
|
|
153
|
+
<div
|
|
154
|
+
key={j}
|
|
155
|
+
className={clsx(
|
|
156
|
+
"flex flex-col items-stretch justify-center"
|
|
157
|
+
// !openSideMenu ? "invisible" : "visible"
|
|
158
|
+
)}
|
|
159
|
+
>
|
|
144
160
|
{dSection.map((dItem, i) => {
|
|
145
161
|
return (
|
|
146
162
|
<div
|
|
@@ -151,6 +167,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
151
167
|
props.currentPage === dItem.slug
|
|
152
168
|
? "bg-primary-600 text-white hover:bg-primary-600"
|
|
153
169
|
: ""
|
|
170
|
+
// !openSideMenu ? " h-0 w-0" : ""
|
|
154
171
|
)}
|
|
155
172
|
>
|
|
156
173
|
<div className="flex items-center justify-center">
|
|
@@ -46,8 +46,8 @@ const ProfileDropdown = (props: any) => {
|
|
|
46
46
|
className="py-1 text-sm text-gray-700 dark:text-gray-200"
|
|
47
47
|
aria-labelledby="avatarButton"
|
|
48
48
|
>
|
|
49
|
-
{props.profileItems.map((it: any) => {
|
|
50
|
-
return <ProfileItem text={it.text} link={it.slug} />
|
|
49
|
+
{props.profileItems.map((it: any, o) => {
|
|
50
|
+
return <ProfileItem key={o} text={it.text} link={it.slug} />
|
|
51
51
|
})}
|
|
52
52
|
</ul>
|
|
53
53
|
<div className="py-1">
|
|
@@ -85,7 +85,7 @@ const DrawerContent = (props: any) => {
|
|
|
85
85
|
<div className="overflow-y-auto py-4">
|
|
86
86
|
<ul className="space-y-2">
|
|
87
87
|
{props.drawerItems.map((item: any, i: any) => {
|
|
88
|
-
return <div>{item.text}</div>
|
|
88
|
+
return <div key={i}>{item.text}</div>
|
|
89
89
|
})}
|
|
90
90
|
</ul>
|
|
91
91
|
</div>
|
|
@@ -236,7 +236,7 @@ export const HawaSiteLayout: React.FunctionComponent<LayoutTypes> = (
|
|
|
236
236
|
<div className="overflow-y-auto py-4">
|
|
237
237
|
<ul className="space-y-2">
|
|
238
238
|
{props.drawerItems.map((item: any, i: any) => {
|
|
239
|
-
return <div>{item.text}</div>
|
|
239
|
+
return <div key={i}>{item.text}</div>
|
|
240
240
|
})}
|
|
241
241
|
</ul>
|
|
242
242
|
</div>
|
package/src/styles.css
CHANGED
|
@@ -2029,6 +2029,10 @@ body {
|
|
|
2029
2029
|
--tw-bg-opacity: 1;
|
|
2030
2030
|
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
|
|
2031
2031
|
}
|
|
2032
|
+
.dark .dark\:text-gray-300 {
|
|
2033
|
+
--tw-text-opacity: 1;
|
|
2034
|
+
color: rgb(209 213 219 / var(--tw-text-opacity));
|
|
2035
|
+
}
|
|
2032
2036
|
.dark .dark\:text-white {
|
|
2033
2037
|
--tw-text-opacity: 1;
|
|
2034
2038
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
@@ -2053,10 +2057,6 @@ body {
|
|
|
2053
2057
|
--tw-text-opacity: 1;
|
|
2054
2058
|
color: rgb(22 101 52 / var(--tw-text-opacity));
|
|
2055
2059
|
}
|
|
2056
|
-
.dark .dark\:text-gray-300 {
|
|
2057
|
-
--tw-text-opacity: 1;
|
|
2058
|
-
color: rgb(209 213 219 / var(--tw-text-opacity));
|
|
2059
|
-
}
|
|
2060
2060
|
.dark .dark\:text-red-500 {
|
|
2061
2061
|
--tw-text-opacity: 1;
|
|
2062
2062
|
color: rgb(239 68 68 / var(--tw-text-opacity));
|
|
@@ -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.4a2964ac.iframe.bundle.js"></script><script src="870.32eb3abe.iframe.bundle.js"></script><script src="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.4a2964ac.iframe.bundle.js"></script><script src="870.32eb3abe.iframe.bundle.js"></script><script src="main.caad440f.iframe.bundle.js"></script></body></html>
|