@sikka/hawa 0.23.10-next → 0.24.0-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 (138) hide show
  1. package/dist/Chip-H5BnuDdx.d.ts +36 -0
  2. package/dist/Chip-hr2gRBJ-.d.mts +36 -0
  3. package/dist/accordion/index.d.mts +2 -1
  4. package/dist/accordion/index.d.ts +2 -1
  5. package/dist/accordion/index.mjs +7 -219
  6. package/dist/avatar/index.d.mts +1 -1
  7. package/dist/avatar/index.d.ts +1 -1
  8. package/dist/avatar/index.js +1 -1
  9. package/dist/avatar/index.mjs +1 -1
  10. package/dist/backToTop/index.mjs +3 -100
  11. package/dist/blocks/auth/index.mjs +2444 -116
  12. package/dist/blocks/feedback/index.mjs +92 -30
  13. package/dist/blocks/index.js +381 -1827
  14. package/dist/blocks/index.mjs +17 -16
  15. package/dist/blocks/misc/index.mjs +107 -45
  16. package/dist/blocks/pricing/index.js +761 -2563
  17. package/dist/blocks/pricing/index.mjs +243 -1735
  18. package/dist/carousel/index.d.mts +13 -0
  19. package/dist/carousel/index.d.ts +13 -0
  20. package/dist/carousel/index.js +186 -0
  21. package/dist/carousel/index.mjs +144 -0
  22. package/dist/checkbox/index.d.mts +2 -1
  23. package/dist/checkbox/index.d.ts +2 -1
  24. package/dist/{chunk-3N6JJKMN.mjs → chunk-26FHSPJI.mjs} +104 -8
  25. package/dist/chunk-3KMBSNM3.mjs +1077 -0
  26. package/dist/{chunk-QGKW5R5F.mjs → chunk-7XRVH6O7.mjs} +1 -68
  27. package/dist/chunk-D75D7LGZ.mjs +189 -0
  28. package/dist/{chunk-TR56G3NM.mjs → chunk-O4FANSN5.mjs} +939 -189
  29. package/dist/{chunk-P2O6R3S6.mjs → chunk-OT7WQYPD.mjs} +1 -64
  30. package/dist/chunk-QBE2IIIH.mjs +229 -0
  31. package/dist/chunk-UTGVG66T.mjs +163 -0
  32. package/dist/chunk-W77KCP35.mjs +151 -0
  33. package/dist/chunk-ZCZ3WARS.mjs +12 -0
  34. package/dist/codeBlock/index.d.mts +23 -0
  35. package/dist/codeBlock/index.d.ts +23 -0
  36. package/dist/codeBlock/index.js +2772 -0
  37. package/dist/codeBlock/index.mjs +2282 -0
  38. package/dist/collapsible/index.d.mts +8 -0
  39. package/dist/collapsible/index.d.ts +8 -0
  40. package/dist/collapsible/index.js +49 -0
  41. package/dist/collapsible/index.mjs +10 -0
  42. package/dist/colorPicker/index.d.mts +29 -0
  43. package/dist/colorPicker/index.d.ts +29 -0
  44. package/dist/colorPicker/index.js +208 -0
  45. package/dist/colorPicker/index.mjs +171 -0
  46. package/dist/commonTypes-3k5cNB1s.d.mts +4 -0
  47. package/dist/commonTypes-3k5cNB1s.d.ts +4 -0
  48. package/dist/dataTable/index.d.mts +1 -2
  49. package/dist/dataTable/index.d.ts +1 -2
  50. package/dist/dataTable/index.mjs +359 -108
  51. package/dist/destroyableCard/index.d.mts +12 -0
  52. package/dist/destroyableCard/index.d.ts +12 -0
  53. package/dist/destroyableCard/index.js +205 -0
  54. package/dist/destroyableCard/index.mjs +163 -0
  55. package/dist/dropdownMenu/index.d.mts +2 -1
  56. package/dist/dropdownMenu/index.d.ts +2 -1
  57. package/dist/dropdownMenu/index.mjs +342 -19
  58. package/dist/elements/index.d.mts +83 -24
  59. package/dist/elements/index.d.ts +83 -24
  60. package/dist/elements/index.js +162 -162
  61. package/dist/elements/index.mjs +3161 -111
  62. package/dist/fileUploader/index.d.mts +5 -0
  63. package/dist/fileUploader/index.d.ts +5 -0
  64. package/dist/fileUploader/index.js +62 -0
  65. package/dist/fileUploader/index.mjs +25 -0
  66. package/dist/index.d.mts +17 -17
  67. package/dist/index.d.ts +17 -17
  68. package/dist/index.js +173 -173
  69. package/dist/index.mjs +177 -177
  70. package/dist/input/index.d.mts +1 -1
  71. package/dist/input/index.d.ts +1 -1
  72. package/dist/interfaceSettings/index.d.mts +18 -0
  73. package/dist/interfaceSettings/index.d.ts +18 -0
  74. package/dist/interfaceSettings/index.js +419 -0
  75. package/dist/interfaceSettings/index.mjs +379 -0
  76. package/dist/layout/index.d.mts +1 -2
  77. package/dist/layout/index.d.ts +1 -2
  78. package/dist/layout/index.js +1495 -3252
  79. package/dist/layout/index.mjs +7 -6
  80. package/dist/pagination/index.d.mts +11 -0
  81. package/dist/pagination/index.d.ts +11 -0
  82. package/dist/pagination/index.js +160 -0
  83. package/dist/pagination/index.mjs +118 -0
  84. package/dist/passwordInput/index.d.mts +13 -0
  85. package/dist/passwordInput/index.d.ts +13 -0
  86. package/dist/passwordInput/index.js +566 -0
  87. package/dist/passwordInput/index.mjs +523 -0
  88. package/dist/popover/index.d.mts +2 -1
  89. package/dist/popover/index.d.ts +2 -1
  90. package/dist/progressCircle/index.d.mts +16 -0
  91. package/dist/progressCircle/index.d.ts +16 -0
  92. package/dist/progressCircle/index.js +159 -0
  93. package/dist/progressCircle/index.mjs +117 -0
  94. package/dist/scrollArea/index.d.mts +1 -2
  95. package/dist/scrollArea/index.d.ts +1 -2
  96. package/dist/scrollIndicator/index.d.mts +9 -0
  97. package/dist/scrollIndicator/index.d.ts +9 -0
  98. package/dist/scrollIndicator/index.js +80 -0
  99. package/dist/scrollIndicator/index.mjs +43 -0
  100. package/dist/select/index.d.mts +1 -1
  101. package/dist/select/index.d.ts +1 -1
  102. package/dist/separator/index.d.mts +10 -0
  103. package/dist/separator/index.d.ts +10 -0
  104. package/dist/separator/index.js +66 -0
  105. package/dist/separator/index.mjs +24 -0
  106. package/dist/simpleTable/index.d.mts +30 -0
  107. package/dist/simpleTable/index.d.ts +30 -0
  108. package/dist/simpleTable/index.js +253 -0
  109. package/dist/simpleTable/index.mjs +217 -0
  110. package/dist/slider/index.d.mts +6 -0
  111. package/dist/slider/index.d.ts +6 -0
  112. package/dist/slider/index.js +66 -0
  113. package/dist/slider/index.mjs +24 -0
  114. package/dist/splitButton/index.d.mts +29 -2
  115. package/dist/splitButton/index.d.ts +29 -2
  116. package/dist/splitButton/index.mjs +355 -30
  117. package/dist/stopPropagationWrapper/index.d.mts +2 -2
  118. package/dist/stopPropagationWrapper/index.d.ts +2 -2
  119. package/dist/switch/index.d.mts +1 -1
  120. package/dist/switch/index.d.ts +1 -1
  121. package/dist/toast/index.d.mts +23 -0
  122. package/dist/toast/index.d.ts +23 -0
  123. package/dist/toast/index.js +185 -0
  124. package/dist/toast/index.mjs +137 -0
  125. package/dist/toaster/index.d.mts +9 -0
  126. package/dist/toaster/index.d.ts +9 -0
  127. package/dist/toaster/index.js +302 -0
  128. package/dist/toaster/index.mjs +262 -0
  129. package/dist/tooltip/index.d.mts +1 -2
  130. package/dist/tooltip/index.d.ts +1 -2
  131. package/package.json +1 -1
  132. package/dist/SimpleTable-EE4ejgUR.d.mts +0 -97
  133. package/dist/SimpleTable-vY1ziD-2.d.ts +0 -97
  134. package/dist/chunk-2R2QPJT7.mjs +0 -7519
  135. package/dist/chunk-C4CBXIG5.mjs +0 -363
  136. package/dist/chunk-UAVBFK53.mjs +0 -346
  137. package/dist/commonTypes-eIwARo5g.d.mts +0 -4
  138. package/dist/commonTypes-eIwARo5g.d.ts +0 -4
@@ -0,0 +1,36 @@
1
+ import React__default from 'react';
2
+ import { R as RadiusType } from './commonTypes-CKtkuNFH.js';
3
+
4
+ type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
5
+ type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
6
+ /** The text inside the chip */
7
+ label: string;
8
+ /** The small icon before the chip label */
9
+ icon?: JSX.Element;
10
+ /** The color of the chip, must be a tailwind color */
11
+ color?: ChipColors;
12
+ /** The size of the chip */
13
+ size?: "small" | "normal" | "large";
14
+ /** Enable/Disable the dot before the label of the chip */
15
+ dot?: boolean;
16
+ /** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
17
+ dotType?: "available" | "unavailable";
18
+ radius?: RadiusType;
19
+ };
20
+ declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & {
21
+ /** The text inside the chip */
22
+ label: string;
23
+ /** The small icon before the chip label */
24
+ icon?: JSX.Element | undefined;
25
+ /** The color of the chip, must be a tailwind color */
26
+ color?: ChipColors | undefined;
27
+ /** The size of the chip */
28
+ size?: "normal" | "small" | "large" | undefined;
29
+ /** Enable/Disable the dot before the label of the chip */
30
+ dot?: boolean | undefined;
31
+ /** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
32
+ dotType?: "available" | "unavailable" | undefined;
33
+ radius?: RadiusType | undefined;
34
+ } & React__default.RefAttributes<HTMLSpanElement>>;
35
+
36
+ export { type ChipColors as C, type ChipTypes as a, Chip as b };
@@ -0,0 +1,36 @@
1
+ import React__default from 'react';
2
+ import { R as RadiusType } from './commonTypes-CKtkuNFH.mjs';
3
+
4
+ type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
5
+ type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
6
+ /** The text inside the chip */
7
+ label: string;
8
+ /** The small icon before the chip label */
9
+ icon?: JSX.Element;
10
+ /** The color of the chip, must be a tailwind color */
11
+ color?: ChipColors;
12
+ /** The size of the chip */
13
+ size?: "small" | "normal" | "large";
14
+ /** Enable/Disable the dot before the label of the chip */
15
+ dot?: boolean;
16
+ /** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
17
+ dotType?: "available" | "unavailable";
18
+ radius?: RadiusType;
19
+ };
20
+ declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & {
21
+ /** The text inside the chip */
22
+ label: string;
23
+ /** The small icon before the chip label */
24
+ icon?: JSX.Element | undefined;
25
+ /** The color of the chip, must be a tailwind color */
26
+ color?: ChipColors | undefined;
27
+ /** The size of the chip */
28
+ size?: "normal" | "small" | "large" | undefined;
29
+ /** Enable/Disable the dot before the label of the chip */
30
+ dot?: boolean | undefined;
31
+ /** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
32
+ dotType?: "available" | "unavailable" | undefined;
33
+ radius?: RadiusType | undefined;
34
+ } & React__default.RefAttributes<HTMLSpanElement>>;
35
+
36
+ export { type ChipColors as C, type ChipTypes as a, Chip as b };
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
4
- import { R as RadiusType } from '../commonTypes-PBumfOBg.mjs';
4
+
5
+ type RadiusType = "full" | "inherit" | "none";
5
6
 
6
7
  type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
7
8
  type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
4
- import { R as RadiusType } from '../commonTypes-PBumfOBg.js';
4
+
5
+ type RadiusType = "full" | "inherit" | "none";
5
6
 
6
7
  type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
7
8
  type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
@@ -1,223 +1,11 @@
1
1
  import {
2
- cn
3
- } from "../chunk-TE3BKEXL.mjs";
4
-
5
- // components/elements/accordion/Accordion.tsx
6
- import * as React4 from "react";
7
- import * as AccordionPrimitive3 from "@radix-ui/react-accordion";
8
-
9
- // components/elements/chip/Chip.tsx
10
- import React from "react";
11
- var Chip = React.forwardRef(
12
- ({
13
- label,
14
- size = "normal",
15
- icon,
16
- color,
17
- radius = "inherit",
18
- dotType,
19
- ...rest
20
- }, ref) => {
21
- let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
22
- let radiusStyles = {
23
- inherit: " hawa-rounded",
24
- full: "hawa-rounded-full",
25
- none: "hawa-rounded-none"
26
- };
27
- let sizeStyles = {
28
- small: "hawa-h-[15px] hawa-leading-4 hawa-px-0 hawa-py-0 hawa-text-[9px] hawa-gap-0.5 ",
29
- normal: "hawa-h-fit hawa-text-xs",
30
- large: "hawa-text-base"
31
- };
32
- let dotStyles = {
33
- small: "hawa-flex hawa-h-1 hawa-w-1 hawa-rounded-full",
34
- normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
35
- large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
36
- };
37
- let dotTypeStyles = {
38
- available: "hawa-bg-green-500",
39
- unavailable: "hawa-bg-red-500"
40
- };
41
- let colorStyles = {
42
- green: "hawa-bg-green-100 hawa-text-green-500 dark:hawa-bg-green-400 dark:hawa-text-green-800",
43
- blue: "hawa-bg-blue-100 hawa-text-blue-500 dark:hawa-bg-blue-400 dark:hawa-text-blue-100",
44
- red: "hawa-bg-red-100 hawa-text-red-500 dark:hawa-bg-red-400 dark:hawa-text-red-100",
45
- yellow: "hawa-bg-yellow-100 hawa-text-yellow-600 dark:hawa-bg-yellow-400 dark:hawa-text-yellow-800",
46
- orange: "hawa-bg-orange-100 hawa-text-orange-500 dark:hawa-bg-orange-400 dark:hawa-text-orange-100",
47
- purple: "hawa-bg-purple-100 hawa-text-purple-500 dark:hawa-bg-purple-400 dark:hawa-text-purple-100",
48
- cyan: "hawa-bg-cyan-100 hawa-text-cyan-800 dark:hawa-bg-cyan-400 dark:hawa-text-cyan-800",
49
- hyper: "hawa-text-white hawa-bg-gradient-to-tl hawa-from-pink-500 hawa-via-red-500 hawa-to-yellow-500 ",
50
- oceanic: "hawa-text-white hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
51
- };
52
- if (label) {
53
- return /* @__PURE__ */ React.createElement(
54
- "span",
55
- {
56
- ...rest,
57
- ref,
58
- className: cn(
59
- defaultStyles,
60
- sizeStyles[size],
61
- radiusStyles[radius],
62
- color ? colorStyles[color] : "hawa-border hawa-bg-none"
63
- )
64
- },
65
- dotType && /* @__PURE__ */ React.createElement(
66
- "span",
67
- {
68
- className: cn(dotStyles[size], dotTypeStyles[dotType])
69
- }
70
- ),
71
- icon && icon,
72
- label
73
- );
74
- } else {
75
- return /* @__PURE__ */ React.createElement(
76
- "span",
77
- {
78
- ...rest,
79
- ref,
80
- className: cn(
81
- "hawa-h-2 hawa-w-2 hawa-rounded-full",
82
- color ? colorStyles[color] : "hawa-border hawa-bg-none"
83
- )
84
- }
85
- );
86
- }
87
- }
88
- );
89
-
90
- // components/elements/accordion/AccordionContent.tsx
91
- import * as React2 from "react";
92
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
93
- var AccordionContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React2.createElement(
94
- AccordionPrimitive.Content,
95
- {
96
- ref,
97
- className: !props.unstyled ? cn(
98
- "hawa-overflow-hidden hawa-text-sm hawa-transition-all data-[state=closed]:hawa-animate-accordion-up data-[state=open]:hawa-animate-accordion-down",
99
- className
100
- ) : className,
101
- ...props
102
- },
103
- /* @__PURE__ */ React2.createElement("div", { className: "hawa-bg-background hawa-p-4" }, children)
104
- ));
105
- AccordionContent.displayName = AccordionPrimitive.Content.displayName;
106
-
107
- // components/elements/accordion/AccordionTrigger.tsx
108
- import * as React3 from "react";
109
- import * as AccordionPrimitive2 from "@radix-ui/react-accordion";
110
- var AccordionTrigger = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React3.createElement(AccordionPrimitive2.Header, { className: "hawa-flex" }, /* @__PURE__ */ React3.createElement(
111
- AccordionPrimitive2.Trigger,
112
- {
113
- ref,
114
- className: !props.unstyled ? cn(
115
- "hawa-flex hawa-flex-1 hawa-items-center hawa-justify-between hawa-bg-muted/50 hawa-p-4 hawa-font-medium hawa-transition-all [&[data-state=open]>svg]:hawa-rotate-180",
116
- props.disabled ? "hawa-bg-muted/30 hawa-text-muted-foreground/50" : "hover:hawa-bg-muted",
117
- className
118
- ) : className,
119
- ...props
120
- },
121
- children,
122
- !props.hideArrow && /* @__PURE__ */ React3.createElement(
123
- "svg",
124
- {
125
- xmlns: "http://www.w3.org/2000/svg",
126
- width: "24",
127
- height: "24",
128
- viewBox: "0 0 24 24",
129
- fill: "none",
130
- stroke: "currentColor",
131
- strokeWidth: "2",
132
- strokeLinecap: "round",
133
- strokeLinejoin: "round",
134
- className: "hawa-icon hawa-shrink-0 hawa-transition-transform hawa-duration-200"
135
- },
136
- /* @__PURE__ */ React3.createElement("path", { d: "m6 9 6 6 6-6" })
137
- )
138
- )));
139
- AccordionTrigger.displayName = AccordionPrimitive2.Trigger.displayName;
140
-
141
- // components/elements/accordion/Accordion.tsx
142
- var Accordion = React4.forwardRef(
143
- ({
144
- items,
145
- design = "default",
146
- itemClassNames,
147
- triggerclassNames,
148
- contentclassNames,
149
- className,
150
- ...props
151
- }, ref) => /* @__PURE__ */ React4.createElement(AccordionPrimitive3.Root, { type: props.type, collapsible: true }, /* @__PURE__ */ React4.createElement(
152
- "div",
153
- {
154
- className: cn("hawa-flex hawa-flex-col", {
155
- "hawa-gap-4": design === "separated",
156
- "hawa-gap-0": design === "default"
157
- })
158
- },
159
- items.map((item, index) => /* @__PURE__ */ React4.createElement(
160
- AccordionPrimitive3.Item,
161
- {
162
- disabled: item.disabled || false,
163
- className: cn(itemClassNames, "hawa-rounded"),
164
- key: index,
165
- value: `item-${index}`
166
- },
167
- /* @__PURE__ */ React4.createElement(
168
- AccordionTrigger,
169
- {
170
- disabled: item.disabled || false,
171
- className: cn(
172
- "hawa-transition-all",
173
- design === "separated" ? "hawa-rounded data-[state=open]:hawa-rounded-b-none" : {
174
- "hawa-rounded-t": index === 0,
175
- "data-[state=closed]:hawa-rounded-b": index === items.length - 1
176
- },
177
- triggerclassNames
178
- )
179
- },
180
- /* @__PURE__ */ React4.createElement(
181
- "span",
182
- {
183
- className: cn(
184
- "hawa-flex hawa-flex-row",
185
- item.chip && "hawa-gap-2"
186
- )
187
- },
188
- item.trigger,
189
- " ",
190
- item.chip && /* @__PURE__ */ React4.createElement(Chip, { ...item.chip })
191
- )
192
- ),
193
- /* @__PURE__ */ React4.createElement(
194
- AccordionContent,
195
- {
196
- "aria-disabled": item.disabled || false,
197
- className: cn(
198
- "hawa-border hawa-transition-all",
199
- design === "separated" ? "hawa-rounded data-[state=open]:hawa-rounded-t-none" : {
200
- "data-[state=open]:hawa-rounded-b": index === items.length - 1
201
- },
202
- contentclassNames
203
- )
204
- },
205
- item.content
206
- )
207
- ))
208
- ))
209
- );
210
- Accordion.displayName = "Accordion";
211
-
212
- // components/elements/accordion/AccordionItem.tsx
213
- import * as React5 from "react";
214
- import * as AccordionPrimitive4 from "@radix-ui/react-accordion";
215
- var AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(AccordionPrimitive4.Item, { ref, className: cn(className), ...props }));
216
- AccordionItem.displayName = "AccordionItem";
217
-
218
- // components/elements/accordion/AccordionRoot.tsx
219
- import * as AccordionPrimitive5 from "@radix-ui/react-accordion";
220
- var AccordionRoot = AccordionPrimitive5.Root;
2
+ Accordion,
3
+ AccordionContent,
4
+ AccordionItem,
5
+ AccordionRoot,
6
+ AccordionTrigger
7
+ } from "../chunk-QBE2IIIH.mjs";
8
+ import "../chunk-TE3BKEXL.mjs";
221
9
  export {
222
10
  Accordion,
223
11
  AccordionContent,
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { R as RadiusType } from '../commonTypes-eIwARo5g.mjs';
2
+ import { R as RadiusType } from '../commonTypes-PBumfOBg.mjs';
3
3
 
4
4
  interface AvatarProps {
5
5
  isUploadable?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { R as RadiusType } from '../commonTypes-eIwARo5g.js';
2
+ import { R as RadiusType } from '../commonTypes-PBumfOBg.js';
3
3
 
4
4
  interface AvatarProps {
5
5
  isUploadable?: boolean;
@@ -44,7 +44,7 @@ function cn(...inputs) {
44
44
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
45
45
  }
46
46
 
47
- // components/elements/FileUploader.tsx
47
+ // components/elements/fileUploader/FileUploader.tsx
48
48
  var import_react = __toESM(require("react"));
49
49
  var FileUploader = ({ handleFile, className }) => {
50
50
  const hiddenFileInput = (0, import_react.useRef)(null);
@@ -5,7 +5,7 @@ import {
5
5
  // components/elements/avatar/Avatar.tsx
6
6
  import React2 from "react";
7
7
 
8
- // components/elements/FileUploader.tsx
8
+ // components/elements/fileUploader/FileUploader.tsx
9
9
  import React, { useRef } from "react";
10
10
  var FileUploader = ({ handleFile, className }) => {
11
11
  const hiddenFileInput = useRef(null);
@@ -1,104 +1,7 @@
1
1
  import {
2
- Button,
3
- cn
4
- } from "../chunk-3N6JJKMN.mjs";
5
-
6
- // components/elements/backToTop/BackToTop.tsx
7
- import React, { useState, useEffect, useRef } from "react";
8
- var BackToTop = ({ ...props }) => {
9
- const [visible, setVisible] = useState(false);
10
- const [rect, _setRect] = useState(null);
11
- const self = useRef(null);
12
- const _rect = useRef(rect);
13
- const setRect = (data) => {
14
- _rect.current = data;
15
- _setRect(data);
16
- };
17
- const getCoords = () => {
18
- let anchor = props.anchor.current;
19
- if (anchor) {
20
- return [anchor.scrollTop, anchor.scrollLeft];
21
- }
22
- return [0, 0];
23
- };
24
- const onScroll = () => {
25
- var _a;
26
- let [scrollTop, scrollLeft] = getCoords();
27
- let rect2 = (_a = props.anchor.current) == null ? void 0 : _a.getBoundingClientRect();
28
- if (rect2) {
29
- setVisible(scrollTop >= rect2.height + (props.paddingThreshold || 100));
30
- }
31
- };
32
- const backToTop = () => {
33
- if (props.anchor.current) {
34
- props.anchor.current.scrollTo({ top: 0, behavior: "smooth" });
35
- }
36
- };
37
- useEffect(() => {
38
- if (!props.anchor.current)
39
- return;
40
- props.anchor.current.addEventListener("scroll", onScroll);
41
- let interval = setInterval(() => {
42
- if (!props.anchor.current)
43
- return;
44
- let newRect = props.anchor.current.getBoundingClientRect();
45
- if (_rect.current == null)
46
- return setRect(newRect);
47
- if (!(_rect.current.top == newRect.top && _rect.current.left == newRect.left && _rect.current.width == newRect.width && _rect.current.height == newRect.height)) {
48
- setRect(newRect);
49
- }
50
- }, 1);
51
- return () => {
52
- var _a;
53
- (_a = props.anchor.current) == null ? void 0 : _a.removeEventListener("scroll", onScroll);
54
- clearInterval(interval);
55
- };
56
- }, [onScroll, props.anchor]);
57
- const getStyles = () => {
58
- var _a;
59
- if (!props.anchor.current || !self.current)
60
- return {};
61
- let corner = props.corner || "bottom-right";
62
- let [vertical, horizontal] = corner.split("-");
63
- let anchorRect = props.anchor.current.getBoundingClientRect();
64
- let selfRect = (_a = self.current) == null ? void 0 : _a.getBoundingClientRect();
65
- let width = horizontal == "right" ? anchorRect.width - selfRect.width : 0;
66
- let height = vertical == "bottom" ? anchorRect.height - selfRect.height : 0;
67
- let style = {
68
- top: anchorRect.y + height + (vertical == "bottom" ? -1 : 1) * (props.paddingX || 10),
69
- left: anchorRect.x + width + (horizontal == "right" ? -1 : 1) * (props.paddingX || 25)
70
- };
71
- return style;
72
- };
73
- return /* @__PURE__ */ React.createElement(
74
- Button,
75
- {
76
- className: cn(
77
- "hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all",
78
- visible ? "hawa-pointer-events-all hawa-opacity-100" : "hawa-pointer-events-none hawa-opacity-0"
79
- ),
80
- onClick: backToTop,
81
- style: {
82
- ...getStyles(),
83
- transitionProperty: "opacity, background-color"
84
- },
85
- ref: self,
86
- size: "icon"
87
- },
88
- /* @__PURE__ */ React.createElement(
89
- "svg",
90
- {
91
- className: cn(
92
- "hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200"
93
- ),
94
- "aria-label": "Arrow Icon",
95
- viewBox: "0 0 20 20",
96
- fill: "currentColor"
97
- },
98
- /* @__PURE__ */ React.createElement("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
99
- )
100
- );
101
- };
2
+ BackToTop
3
+ } from "../chunk-26FHSPJI.mjs";
4
+ import "../chunk-TE3BKEXL.mjs";
102
5
  export {
103
6
  BackToTop
104
7
  };