@sikka/hawa 0.0.143 → 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 +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/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/HawaPhoneInput.tsx +1 -1
- package/src/styles.css +4 -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.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
|
}
|
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.f25e7d6a.iframe.bundle.js"></script></body></html>
|