@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.143",
3
+ "version": "0.0.144",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -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
- // variant="drop-area"
159
- {...getRootProps({
160
- style: { backgroundColor: isDragActive ? "white" : "inherit" },
161
- })}
162
- // style={{ backgroundColor: isDragActive ? "white" : "inherit" }}
163
- className="flex flex-col justify-center rounded-xl border border-dashed border-black"
164
- >
165
- <input {...getInputProps()} />
166
- <div className="p-1 text-center">
167
- Click here or drop files here to upload
168
- </div>
169
- <div className="p-1 text-center">Max file size is {max}</div>
170
- <div className="flex justify-center ">
171
- {acceptedFiles.length > 0 && (
172
- <HawaButton
173
- // style={{ color: "black" }}
174
- onClick={(e) => {
175
- e.stopPropagation()
176
- onClearFiles(acceptedFiles)
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
- Clear All
180
- </HawaButton>
181
- )}
182
- </div>
183
- {thumbs && showPreview ? (
184
- <aside
185
- style={{
186
- display: "flex",
187
- flexDirection: "row",
188
- flexWrap: "wrap",
189
- // marginTop: 10,
190
- }}
191
- className="rounded-lg border-red-500"
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
  }
@@ -1,4 +1,4 @@
1
- import { useState } from "react"
1
+ import React, { useState } from "react"
2
2
  import Countries from "../countries"
3
3
  import Select from "react-select"
4
4
 
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.64f67baa.iframe.bundle.js"></script></body></html>
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>