@sikka/hawa 0.0.142 → 0.0.144
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 +8 -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/lib/elements/DragDropImages.d.ts +1 -0
- package/lib/elements/HawaPhoneInput.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/elements/DragDropImages.tsx +55 -46
- package/src/elements/HawaMenu.tsx +1 -1
- package/src/elements/HawaPhoneInput.tsx +1 -1
- package/src/elements/HawaTextField.tsx +7 -1
- package/src/styles.css +8 -4
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.f25e7d6a.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/main.f7aca500.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
|
}
|
|
@@ -98,7 +98,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
98
98
|
onClick={(e) => item.action(e, item.label)}
|
|
99
99
|
className={
|
|
100
100
|
item.isButton
|
|
101
|
-
? "mx-1 flex cursor-pointer flex-row items-center rounded-lg bg-primary-500 py-2 px-4 text-white hover:bg-primary-600 rtl:flex-row-reverse dark:hover:bg-primary-600 dark:hover:text-white"
|
|
101
|
+
? "mx-1 my-1 flex cursor-pointer flex-row items-center rounded-lg bg-primary-500 py-2 px-4 text-white hover:bg-primary-600 rtl:flex-row-reverse dark:hover:bg-primary-600 dark:hover:text-white"
|
|
102
102
|
: "mx-1 flex cursor-pointer flex-row items-center rounded-lg py-2 px-4 hover:bg-gray-200 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white"
|
|
103
103
|
}
|
|
104
104
|
>
|
|
@@ -54,7 +54,13 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
54
54
|
id="message"
|
|
55
55
|
rows={4}
|
|
56
56
|
className="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
57
|
-
|
|
57
|
+
onChange={props.onChange}
|
|
58
|
+
type={props.type}
|
|
59
|
+
aria-label={props.label}
|
|
60
|
+
placeholder={props.placeholder}
|
|
61
|
+
defaultValue={props.defaultValue}
|
|
62
|
+
value={props.value}
|
|
63
|
+
{...props}
|
|
58
64
|
/>
|
|
59
65
|
) : props.type === "search" ? (
|
|
60
66
|
<div className="relative">
|
package/src/styles.css
CHANGED
|
@@ -608,6 +608,10 @@ video {
|
|
|
608
608
|
margin-top: 0.5rem;
|
|
609
609
|
margin-bottom: 0.5rem;
|
|
610
610
|
}
|
|
611
|
+
.my-1 {
|
|
612
|
+
margin-top: 0.25rem;
|
|
613
|
+
margin-bottom: 0.25rem;
|
|
614
|
+
}
|
|
611
615
|
.my-7 {
|
|
612
616
|
margin-top: 1.75rem;
|
|
613
617
|
margin-bottom: 1.75rem;
|
|
@@ -2025,6 +2029,10 @@ body {
|
|
|
2025
2029
|
--tw-bg-opacity: 1;
|
|
2026
2030
|
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
|
|
2027
2031
|
}
|
|
2032
|
+
.dark .dark\:text-gray-300 {
|
|
2033
|
+
--tw-text-opacity: 1;
|
|
2034
|
+
color: rgb(209 213 219 / var(--tw-text-opacity));
|
|
2035
|
+
}
|
|
2028
2036
|
.dark .dark\:text-white {
|
|
2029
2037
|
--tw-text-opacity: 1;
|
|
2030
2038
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
@@ -2049,10 +2057,6 @@ body {
|
|
|
2049
2057
|
--tw-text-opacity: 1;
|
|
2050
2058
|
color: rgb(22 101 52 / var(--tw-text-opacity));
|
|
2051
2059
|
}
|
|
2052
|
-
.dark .dark\:text-gray-300 {
|
|
2053
|
-
--tw-text-opacity: 1;
|
|
2054
|
-
color: rgb(209 213 219 / var(--tw-text-opacity));
|
|
2055
|
-
}
|
|
2056
2060
|
.dark .dark\:text-red-500 {
|
|
2057
2061
|
--tw-text-opacity: 1;
|
|
2058
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.f25e7d6a.iframe.bundle.js"></script></body></html>
|