@sikka/hawa 0.23.2-next → 0.23.7-next

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.
Files changed (145) hide show
  1. package/dist/accordion/index.js +30 -2399
  2. package/dist/accordion/index.mjs +19 -461
  3. package/dist/alert/index.mjs +0 -1
  4. package/dist/appStores/index.js +75 -0
  5. package/dist/appStores/index.mjs +38 -0
  6. package/dist/avatar/index.mjs +118 -3
  7. package/dist/backToTop/index.mjs +102 -4
  8. package/dist/badge/index.js +127 -0
  9. package/dist/badge/index.mjs +84 -0
  10. package/dist/blocks/auth/index.js +1173 -3092
  11. package/dist/blocks/auth/index.mjs +16 -10
  12. package/dist/blocks/feedback/index.js +864 -2913
  13. package/dist/blocks/feedback/index.mjs +14 -8
  14. package/dist/blocks/index.js +5714 -5316
  15. package/dist/blocks/index.mjs +390 -45
  16. package/dist/blocks/misc/index.js +634 -2409
  17. package/dist/blocks/misc/index.mjs +14 -8
  18. package/dist/blocks/pricing/index.js +522 -524
  19. package/dist/blocks/pricing/index.mjs +1861 -45
  20. package/dist/breadcrumb/index.js +63 -0
  21. package/dist/breadcrumb/index.mjs +26 -0
  22. package/dist/card/index.mjs +83 -8
  23. package/dist/checkbox/index.mjs +138 -3
  24. package/dist/chip/index.js +129 -0
  25. package/dist/chip/index.mjs +8 -0
  26. package/dist/{chunk-X6PCWJYD.mjs → chunk-2R2QPJT7.mjs} +761 -1104
  27. package/dist/chunk-677VOLD4.mjs +464 -0
  28. package/dist/chunk-72HYR6WB.mjs +88 -0
  29. package/dist/chunk-A25EXELT.mjs +131 -0
  30. package/dist/{chunk-OE27DSIY.mjs → chunk-F6TKEDDP.mjs} +2 -4
  31. package/dist/{chunk-YFC2GSJ6.mjs → chunk-P2O6R3S6.mjs} +66 -5
  32. package/dist/{chunk-GXXX5UB4.mjs → chunk-QGKW5R5F.mjs} +59 -20
  33. package/dist/chunk-TR56G3NM.mjs +2350 -0
  34. package/dist/chunk-UAVBFK53.mjs +346 -0
  35. package/dist/combobox/index.mjs +153 -7
  36. package/dist/dataTable/index.mjs +355 -8
  37. package/dist/elements/index.js +800 -1148
  38. package/dist/elements/index.mjs +1 -11
  39. package/dist/fileDropzone/index.mjs +226 -4
  40. package/dist/index.js +1721 -1721
  41. package/dist/index.mjs +1663 -1663
  42. package/dist/layout/index.js +493 -510
  43. package/dist/layout/index.mjs +1 -1
  44. package/dist/loading/index.mjs +0 -1
  45. package/dist/logos/index.mjs +204 -3
  46. package/dist/navigationMenu/index.mjs +155 -13
  47. package/dist/phoneInput/index.js +2074 -0
  48. package/dist/phoneInput/index.mjs +1776 -0
  49. package/dist/pinInput/index.js +130 -0
  50. package/dist/pinInput/index.mjs +88 -0
  51. package/dist/progress/index.js +71 -0
  52. package/dist/progress/index.mjs +29 -0
  53. package/dist/radio/index.mjs +202 -4
  54. package/dist/scrollArea/index.js +90 -0
  55. package/dist/scrollArea/index.mjs +47 -0
  56. package/dist/select/index.mjs +1 -1
  57. package/dist/sheet/index.mjs +137 -12
  58. package/dist/sortButton/index.mjs +40 -4
  59. package/dist/stopPropagationWrapper/index.js +48 -0
  60. package/dist/stopPropagationWrapper/index.mjs +11 -0
  61. package/dist/switch/index.mjs +79 -3
  62. package/dist/tabs/index.js +1 -1
  63. package/dist/tabs/index.mjs +68 -6
  64. package/dist/textarea/index.mjs +54 -4
  65. package/package.json +2 -2
  66. package/dist/Chip-DJ6ThZc_.d.ts +0 -21
  67. package/dist/Chip-eal8vwDz.d.mts +0 -21
  68. package/dist/accordion/index.d.mts +0 -42
  69. package/dist/accordion/index.d.ts +0 -42
  70. package/dist/alert/index.d.mts +0 -28
  71. package/dist/alert/index.d.ts +0 -28
  72. package/dist/avatar/index.d.mts +0 -15
  73. package/dist/avatar/index.d.ts +0 -15
  74. package/dist/backToTop/index.d.mts +0 -15
  75. package/dist/backToTop/index.d.ts +0 -15
  76. package/dist/button/index.d.mts +0 -16
  77. package/dist/button/index.d.ts +0 -16
  78. package/dist/card/index.d.mts +0 -17
  79. package/dist/card/index.d.ts +0 -17
  80. package/dist/checkbox/index.d.mts +0 -20
  81. package/dist/checkbox/index.d.ts +0 -20
  82. package/dist/chunk-BK5WF7UO.mjs +0 -231
  83. package/dist/chunk-CXWYC6FS.mjs +0 -360
  84. package/dist/chunk-D2USGMDT.mjs +0 -208
  85. package/dist/chunk-DX4SLF2L.mjs +0 -45
  86. package/dist/chunk-ENNSA4VR.mjs +0 -5566
  87. package/dist/chunk-GXSYCLZZ.mjs +0 -158
  88. package/dist/chunk-IQPGAHUR.mjs +0 -107
  89. package/dist/chunk-POT2IP62.mjs +0 -123
  90. package/dist/chunk-TWDZB2VH.mjs +0 -151
  91. package/dist/chunk-VBTYVVA7.mjs +0 -93
  92. package/dist/chunk-VCGW5DIP.mjs +0 -170
  93. package/dist/chunk-X3SMPIA3.mjs +0 -0
  94. package/dist/chunk-XA646BZ2.mjs +0 -143
  95. package/dist/chunk-ZCUUQ5VV.mjs +0 -84
  96. package/dist/combobox/index.d.mts +0 -32
  97. package/dist/combobox/index.d.ts +0 -32
  98. package/dist/command/index.d.mts +0 -48
  99. package/dist/command/index.d.ts +0 -48
  100. package/dist/commonTypes-gbO4hPli.d.mts +0 -7
  101. package/dist/commonTypes-gbO4hPli.d.ts +0 -7
  102. package/dist/dataTable/index.d.mts +0 -39
  103. package/dist/dataTable/index.d.ts +0 -39
  104. package/dist/dialog/index.d.mts +0 -57
  105. package/dist/dialog/index.d.ts +0 -57
  106. package/dist/dropdownMenu/index.d.mts +0 -95
  107. package/dist/dropdownMenu/index.d.ts +0 -95
  108. package/dist/fileDropzone/index.d.mts +0 -37
  109. package/dist/fileDropzone/index.d.ts +0 -37
  110. package/dist/input/index.d.mts +0 -36
  111. package/dist/input/index.d.ts +0 -36
  112. package/dist/label/index.d.mts +0 -12
  113. package/dist/label/index.d.ts +0 -12
  114. package/dist/loading/index.d.mts +0 -15
  115. package/dist/loading/index.d.ts +0 -15
  116. package/dist/logos/index.d.mts +0 -27
  117. package/dist/logos/index.d.ts +0 -27
  118. package/dist/navigationMenu/index.d.mts +0 -39
  119. package/dist/navigationMenu/index.d.ts +0 -39
  120. package/dist/popover/index.d.mts +0 -23
  121. package/dist/popover/index.d.ts +0 -23
  122. package/dist/radio/index.d.mts +0 -28
  123. package/dist/radio/index.d.ts +0 -28
  124. package/dist/select/index.d.mts +0 -43
  125. package/dist/select/index.d.ts +0 -43
  126. package/dist/sheet/index.d.mts +0 -30
  127. package/dist/sheet/index.d.ts +0 -30
  128. package/dist/skeleton/index.d.mts +0 -10
  129. package/dist/skeleton/index.d.ts +0 -10
  130. package/dist/sortButton/index.d.mts +0 -10
  131. package/dist/sortButton/index.d.ts +0 -10
  132. package/dist/splitButton/index.d.mts +0 -15
  133. package/dist/splitButton/index.d.ts +0 -15
  134. package/dist/switch/index.d.mts +0 -12
  135. package/dist/switch/index.d.ts +0 -12
  136. package/dist/table/index.d.mts +0 -21
  137. package/dist/table/index.d.ts +0 -21
  138. package/dist/tabs/index.d.mts +0 -16
  139. package/dist/tabs/index.d.ts +0 -16
  140. package/dist/textarea/index.d.mts +0 -17
  141. package/dist/textarea/index.d.ts +0 -17
  142. package/dist/tooltip/index.d.mts +0 -26
  143. package/dist/tooltip/index.d.ts +0 -26
  144. /package/dist/{chunk-A7OPD7H7.mjs → chunk-B6UCD4GP.mjs} +0 -0
  145. /package/dist/{chunk-O2ALK7UE.mjs → chunk-Z4M72OD3.mjs} +0 -0
@@ -1,28 +0,0 @@
1
- import React__default from 'react';
2
- import { S as SeverityType, D as DirectionType } from '../commonTypes-gbO4hPli.mjs';
3
-
4
- type AlertTypes = {
5
- severity?: SeverityType | "hyper" | "oceanic";
6
- /** The title of the alert placed above the text of the alert. Can be used alone */
7
- title?: any;
8
- /** The text of the alert placed below the title of the alert. Can be used alone */
9
- text: any;
10
- /** The duration for the alert to stay on the screen */
11
- duration?: number;
12
- variant?: "normal" | "solid" | "top-accent" | "left-accent" | "right-accent" | "bottom-accent";
13
- direction?: DirectionType;
14
- actions?: [
15
- {
16
- label: string;
17
- onClick: any;
18
- variant: "outline" | "link" | "default" | "destructive" | "secondary" | "ghost";
19
- }
20
- ];
21
- persistent?: boolean;
22
- icon?: any;
23
- className?: any;
24
- onAlertClosed?: any;
25
- };
26
- declare const Alert: React__default.FunctionComponent<AlertTypes>;
27
-
28
- export { Alert };
@@ -1,28 +0,0 @@
1
- import React__default from 'react';
2
- import { S as SeverityType, D as DirectionType } from '../commonTypes-gbO4hPli.js';
3
-
4
- type AlertTypes = {
5
- severity?: SeverityType | "hyper" | "oceanic";
6
- /** The title of the alert placed above the text of the alert. Can be used alone */
7
- title?: any;
8
- /** The text of the alert placed below the title of the alert. Can be used alone */
9
- text: any;
10
- /** The duration for the alert to stay on the screen */
11
- duration?: number;
12
- variant?: "normal" | "solid" | "top-accent" | "left-accent" | "right-accent" | "bottom-accent";
13
- direction?: DirectionType;
14
- actions?: [
15
- {
16
- label: string;
17
- onClick: any;
18
- variant: "outline" | "link" | "default" | "destructive" | "secondary" | "ghost";
19
- }
20
- ];
21
- persistent?: boolean;
22
- icon?: any;
23
- className?: any;
24
- onAlertClosed?: any;
25
- };
26
- declare const Alert: React__default.FunctionComponent<AlertTypes>;
27
-
28
- export { Alert };
@@ -1,15 +0,0 @@
1
- import React__default from 'react';
2
- import { R as RadiusType } from '../commonTypes-gbO4hPli.mjs';
3
-
4
- interface AvatarProps {
5
- isUploadable?: boolean;
6
- src?: string;
7
- alt?: string;
8
- size?: "2xs" | "xs" | "sm" | "default" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
9
- radius?: RadiusType;
10
- className?: string;
11
- icon?: React__default.ReactNode;
12
- }
13
- declare const Avatar: React__default.FC<AvatarProps>;
14
-
15
- export { Avatar };
@@ -1,15 +0,0 @@
1
- import React__default from 'react';
2
- import { R as RadiusType } from '../commonTypes-gbO4hPli.js';
3
-
4
- interface AvatarProps {
5
- isUploadable?: boolean;
6
- src?: string;
7
- alt?: string;
8
- size?: "2xs" | "xs" | "sm" | "default" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
9
- radius?: RadiusType;
10
- className?: string;
11
- icon?: React__default.ReactNode;
12
- }
13
- declare const Avatar: React__default.FC<AvatarProps>;
14
-
15
- export { Avatar };
@@ -1,15 +0,0 @@
1
- import { FC, RefObject } from 'react';
2
-
3
- type BackToTopTypes = {
4
- /** Horizontal padding relative to the attached corner */
5
- paddingX?: number;
6
- /** Vertical padding relative to the attached corner */
7
- paddingY?: number;
8
- /** Increase to the threshold of the scroll value that has to be passed for the button to appear */
9
- paddingThreshold?: number;
10
- corner?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
11
- anchor: RefObject<HTMLInputElement>;
12
- };
13
- declare const BackToTop: FC<BackToTopTypes>;
14
-
15
- export { BackToTop };
@@ -1,15 +0,0 @@
1
- import { FC, RefObject } from 'react';
2
-
3
- type BackToTopTypes = {
4
- /** Horizontal padding relative to the attached corner */
5
- paddingX?: number;
6
- /** Vertical padding relative to the attached corner */
7
- paddingY?: number;
8
- /** Increase to the threshold of the scroll value that has to be passed for the button to appear */
9
- paddingThreshold?: number;
10
- corner?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
11
- anchor: RefObject<HTMLInputElement>;
12
- };
13
- declare const BackToTop: FC<BackToTopTypes>;
14
-
15
- export { BackToTop };
@@ -1,16 +0,0 @@
1
- import * as class_variance_authority_types from 'class-variance-authority/types';
2
- import * as React from 'react';
3
- import { VariantProps } from 'class-variance-authority';
4
-
5
- declare const buttonVariants: (props?: ({
6
- variant?: "default" | "neoBrutalism" | "link" | "combobox" | "light" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
7
- size?: "default" | "xs" | "sm" | "lg" | "xl" | "icon" | "heightless" | "smallIcon" | null | undefined;
8
- } & class_variance_authority_types.ClassProp) | undefined) => string;
9
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
- asChild?: boolean;
11
- centered?: boolean;
12
- isLoading?: boolean;
13
- }
14
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
15
-
16
- export { Button, type ButtonProps, buttonVariants };
@@ -1,16 +0,0 @@
1
- import * as class_variance_authority_types from 'class-variance-authority/types';
2
- import * as React from 'react';
3
- import { VariantProps } from 'class-variance-authority';
4
-
5
- declare const buttonVariants: (props?: ({
6
- variant?: "default" | "neoBrutalism" | "link" | "combobox" | "light" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
7
- size?: "default" | "xs" | "sm" | "lg" | "xl" | "icon" | "heightless" | "smallIcon" | null | undefined;
8
- } & class_variance_authority_types.ClassProp) | undefined) => string;
9
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
- asChild?: boolean;
11
- centered?: boolean;
12
- isLoading?: boolean;
13
- }
14
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
15
-
16
- export { Button, type ButtonProps, buttonVariants };
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
4
- clickable?: boolean;
5
- variant?: "default" | "neoBrutalism";
6
- }
7
- declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
8
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
10
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
11
- declare const CardContent: React.ForwardRefExoticComponent<{
12
- headless?: boolean | undefined;
13
- noPadding?: boolean | undefined;
14
- } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
- declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
-
17
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
4
- clickable?: boolean;
5
- variant?: "default" | "neoBrutalism";
6
- }
7
- declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
8
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
10
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
11
- declare const CardContent: React.ForwardRefExoticComponent<{
12
- headless?: boolean | undefined;
13
- noPadding?: boolean | undefined;
14
- } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
- declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
-
17
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
- import { R as RadiusType } from '../commonTypes-gbO4hPli.mjs';
4
-
5
- type CheckBoxTypes = {
6
- id: string;
7
- label?: React.ReactNode;
8
- sublabel?: React.ReactNode;
9
- helperText?: string;
10
- size?: "xs" | "sm" | "default" | "md" | "lg" | "xl";
11
- radius?: RadiusType;
12
- };
13
- type CheckboxProps = CheckBoxTypes & React.ComponentProps<typeof CheckboxElement>;
14
- declare const Checkbox: React.FC<CheckboxProps>;
15
- declare const CheckboxElement: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
16
- size?: "default" | "xs" | "sm" | "lg" | "xl" | "md" | undefined;
17
- radius?: RadiusType | undefined;
18
- } & React.RefAttributes<HTMLButtonElement>>;
19
-
20
- export { Checkbox };
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
- import { R as RadiusType } from '../commonTypes-gbO4hPli.js';
4
-
5
- type CheckBoxTypes = {
6
- id: string;
7
- label?: React.ReactNode;
8
- sublabel?: React.ReactNode;
9
- helperText?: string;
10
- size?: "xs" | "sm" | "default" | "md" | "lg" | "xl";
11
- radius?: RadiusType;
12
- };
13
- type CheckboxProps = CheckBoxTypes & React.ComponentProps<typeof CheckboxElement>;
14
- declare const Checkbox: React.FC<CheckboxProps>;
15
- declare const CheckboxElement: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
16
- size?: "default" | "xs" | "sm" | "lg" | "xl" | "md" | undefined;
17
- radius?: RadiusType | undefined;
18
- } & React.RefAttributes<HTMLButtonElement>>;
19
-
20
- export { Checkbox };
@@ -1,231 +0,0 @@
1
- import {
2
- Alert
3
- } from "./chunk-FRDYTR55.mjs";
4
- import {
5
- Button
6
- } from "./chunk-SYB66JGL.mjs";
7
-
8
- // components/elements/fileDropzone/FileDropzone.tsx
9
- import React, { useEffect, useState } from "react";
10
- import { useDropzone } from "react-dropzone";
11
- import clsx from "clsx";
12
- var FileDropzone = ({
13
- texts,
14
- files,
15
- setFiles,
16
- setDeletedFiles,
17
- onAcceptedFiles,
18
- errorMessages,
19
- maxFiles,
20
- accept,
21
- showPreview,
22
- onDeleteFile,
23
- onClearFiles,
24
- disclaimer,
25
- maxSize,
26
- label,
27
- termsLink,
28
- privacyLink
29
- }) => {
30
- var _a, _b, _c, _d, _e, _f;
31
- const [cmp, setCmp] = useState(0);
32
- const [max, setMax] = useState(0);
33
- const {
34
- getRootProps,
35
- getInputProps,
36
- fileRejections,
37
- acceptedFiles,
38
- isDragActive
39
- } = useDropzone({
40
- multiple: true,
41
- accept,
42
- maxSize,
43
- maxFiles,
44
- onDrop: (acceptedFiles2) => {
45
- setFiles(
46
- acceptedFiles2.map(
47
- (file, index) => Object.assign(file, {
48
- preview: URL.createObjectURL(file)
49
- })
50
- )
51
- );
52
- }
53
- });
54
- useEffect(
55
- () => () => {
56
- files == null ? void 0 : files.forEach((file) => {
57
- URL.revokeObjectURL(file.preview);
58
- });
59
- },
60
- [files]
61
- );
62
- useEffect(() => {
63
- setFiles(acceptedFiles);
64
- }, [acceptedFiles, cmp, setFiles]);
65
- onClearFiles = () => {
66
- acceptedFiles.length = 0;
67
- acceptedFiles.splice(0, acceptedFiles.length);
68
- setFiles([]);
69
- };
70
- const clearAllFiles = () => {
71
- acceptedFiles.length = 0;
72
- setFiles([]);
73
- };
74
- useEffect(() => {
75
- if (maxSize > 0) {
76
- const k = 1024;
77
- const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
78
- const i = Math.floor(Math.log(maxSize) / Math.log(1024));
79
- setMax(
80
- parseFloat((maxSize / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]
81
- );
82
- }
83
- }, [maxSize]);
84
- const errs = fileRejections.map((rej, i) => {
85
- switch (rej.errors[0].code) {
86
- case "file-too-large":
87
- return /* @__PURE__ */ React.createElement(
88
- Alert,
89
- {
90
- key: i,
91
- text: rej.file.name,
92
- title: texts.fileTooLarge,
93
- severity: "error"
94
- }
95
- );
96
- case "too-many-files":
97
- return /* @__PURE__ */ React.createElement(
98
- Alert,
99
- {
100
- key: i,
101
- text: rej.file.name,
102
- title: texts.tooManyFiles,
103
- severity: "error"
104
- }
105
- );
106
- case "file-invalid-type":
107
- return /* @__PURE__ */ React.createElement(
108
- Alert,
109
- {
110
- key: i,
111
- text: rej.file.name,
112
- title: texts.invalidFileType,
113
- severity: "error"
114
- }
115
- );
116
- default:
117
- return /* @__PURE__ */ React.createElement(
118
- Alert,
119
- {
120
- key: i,
121
- text: rej.file.name,
122
- title: rej.errors[0].code,
123
- severity: "error"
124
- }
125
- );
126
- }
127
- });
128
- const thumbs = files == null ? void 0 : files.map((file, index) => /* @__PURE__ */ React.createElement("div", { className: "hawa-relative hawa-rounded", key: index }, /* @__PURE__ */ React.createElement(
129
- "button",
130
- {
131
- onClick: (e) => {
132
- e.stopPropagation();
133
- acceptedFiles.splice(acceptedFiles.indexOf(file), 1);
134
- setCmp(Math.random);
135
- onDeleteFile(file);
136
- },
137
- type: "button",
138
- className: "hawa-absolute hawa-left-0 hawa-ml-auto hawa-inline-flex hawa-items-center hawa-rounded-inner hawa-rounded-bl-none hawa-rounded-tr-none hawa-bg-gray-900 hawa-p-1.5 hawa-text-sm hawa-text-gray-400 hawa-transition-all hover:hawa-bg-gray-200 hover:hawa-text-gray-900 dark:hover:hawa-bg-gray-600 dark:hover:hawa-text-white",
139
- "data-modal-toggle": "defaultModal"
140
- },
141
- /* @__PURE__ */ React.createElement(
142
- "svg",
143
- {
144
- "aria-hidden": "true",
145
- className: "hawa-h-5 hawa-w-5",
146
- fill: "currentColor",
147
- viewBox: "0 0 20 20"
148
- },
149
- /* @__PURE__ */ React.createElement(
150
- "path",
151
- {
152
- fillRule: "evenodd",
153
- 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",
154
- clipRule: "evenodd"
155
- }
156
- )
157
- ),
158
- /* @__PURE__ */ React.createElement("span", { className: "hawa-sr-only" }, "Close modal")
159
- ), /* @__PURE__ */ React.createElement(
160
- "div",
161
- {
162
- style: {
163
- display: "flex",
164
- justifyContent: "center",
165
- alignItems: "center",
166
- overflow: "hidden",
167
- height: 100,
168
- width: 100,
169
- backgroundImage: `url(${file.preview})`,
170
- backgroundSize: "cover",
171
- backgroundPosition: "center",
172
- border: "1px solid black"
173
- },
174
- className: "hawa-rounded",
175
- key: file.name
176
- }
177
- )));
178
- return /* @__PURE__ */ React.createElement("div", null, label && /* @__PURE__ */ React.createElement("div", { className: "hawa-mb-2 hawa-block hawa-text-sm hawa-font-medium hawa-text-gray-900 dark:hawa-text-gray-300" }, label), /* @__PURE__ */ React.createElement(
179
- "div",
180
- {
181
- className: clsx(
182
- "hawa-flex hawa-flex-col hawa-justify-center hawa-rounded hawa-border hawa-border-dashed hawa-p-6 hawa-transition-all ",
183
- isDragActive ? "hawa-bg-muted" : "hawa-bg-muted/20 hover:hawa-bg-muted/50 "
184
- )
185
- },
186
- /* @__PURE__ */ React.createElement("div", { ...getRootProps({}) }, /* @__PURE__ */ React.createElement("p", { ...getInputProps() }), /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-pt-4 hawa-text-center" }, /* @__PURE__ */ React.createElement(
187
- "svg",
188
- {
189
- stroke: "currentColor",
190
- fill: "none",
191
- strokeWidth: "2",
192
- viewBox: "0 0 24 24",
193
- strokeLinecap: "round",
194
- strokeLinejoin: "round",
195
- height: "1.5em",
196
- width: "1.5em"
197
- },
198
- /* @__PURE__ */ React.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
199
- /* @__PURE__ */ React.createElement("path", { d: "M19 11v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" }),
200
- /* @__PURE__ */ React.createElement("path", { d: "M13 13l9 3l-4 2l-2 4l-3 -9" }),
201
- /* @__PURE__ */ React.createElement("path", { d: "M3 3l0 .01" }),
202
- /* @__PURE__ */ React.createElement("path", { d: "M7 3l0 .01" }),
203
- /* @__PURE__ */ React.createElement("path", { d: "M11 3l0 .01" }),
204
- /* @__PURE__ */ React.createElement("path", { d: "M15 3l0 .01" }),
205
- /* @__PURE__ */ React.createElement("path", { d: "M3 7l0 .01" }),
206
- /* @__PURE__ */ React.createElement("path", { d: "M3 11l0 .01" }),
207
- /* @__PURE__ */ React.createElement("path", { d: "M3 15l0 .01" })
208
- ), typeof texts.clickHereToUpload === "function" ? texts.clickHereToUpload() : texts.clickHereToUpload), /* @__PURE__ */ React.createElement("div", { className: "hawa-select-none hawa-pt-2 hawa-text-center hawa-text-xs" }, texts.acceptedFileTypes, " ", accept.split(",")), /* @__PURE__ */ React.createElement("div", { className: "hawa-select-none hawa-pb-2 hawa-pt-1 hawa-text-center hawa-text-xs" }, texts.maxFileSize, " ", max)),
209
- acceptedFiles.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-justify-center hawa-rounded-lg hawa-p-2 " }, /* @__PURE__ */ React.createElement(Button, { onClick: clearAllFiles }, "Clear All")),
210
- acceptedFiles.length > 0 && thumbs && showPreview ? /* @__PURE__ */ React.createElement("aside", { className: "hawa-flex hawa-flex-row hawa-flex-wrap hawa-justify-center hawa-gap-2 hawa-rounded-lg hawa-p-2" }, thumbs) : null,
211
- /* @__PURE__ */ React.createElement("div", { className: "px-4" }, ((_b = (_a = fileRejections[0]) == null ? void 0 : _a.errors[0]) == null ? void 0 : _b.code) && errs)
212
- ), disclaimer && /* @__PURE__ */ React.createElement("div", { className: "hawa-mt-2 hawa-text-sm hawa-text-muted-foreground/50" }, (_c = texts.disclaimer) != null ? _c : "By uploading a file you agree to our", " ", /* @__PURE__ */ React.createElement(
213
- "a",
214
- {
215
- href: termsLink,
216
- className: "clickable-link hawa-text-muted-foreground/50"
217
- },
218
- (_d = texts.terms) != null ? _d : "Terms"
219
- ), " ", (_e = texts.and) != null ? _e : "and", " ", /* @__PURE__ */ React.createElement(
220
- "a",
221
- {
222
- href: privacyLink,
223
- className: "clickable-link hawa-text-muted-foreground/50"
224
- },
225
- (_f = texts.privacyPolicy) != null ? _f : "Privacy Policy"
226
- )));
227
- };
228
-
229
- export {
230
- FileDropzone
231
- };