@deepnoid/ui 0.0.84 → 0.0.86

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 (183) hide show
  1. package/dist/{chunk-NTTHTGDK.mjs → chunk-FNPWLOGV.mjs} +37 -39
  2. package/dist/chunk-FRIK4CS7.mjs +83 -0
  3. package/dist/{chunk-ILMIS63S.mjs → chunk-H7BLXC5M.mjs} +14 -14
  4. package/dist/{chunk-XTJL67KM.mjs → chunk-HH2LF2SU.mjs} +32 -46
  5. package/dist/{chunk-ADDUBJ4I.mjs → chunk-S4DTK5GI.mjs} +1 -1
  6. package/dist/chunk-ZOTHPHXA.mjs +41 -0
  7. package/dist/components/accordion/accordion.d.mts +154 -0
  8. package/dist/components/accordion/accordion.test.js +37 -39
  9. package/dist/components/accordion/accordion.test.mjs +1 -1
  10. package/dist/components/accordion/accordionItem.d.mts +282 -0
  11. package/dist/components/accordion/index.d.mts +6 -0
  12. package/dist/components/button/button-group.d.mts +14 -0
  13. package/dist/components/button/button-group.test.d.mts +2 -0
  14. package/dist/components/button/button-group.test.js +37 -39
  15. package/dist/components/button/button-group.test.mjs +2 -2
  16. package/dist/components/button/button.d.mts +18 -0
  17. package/dist/components/button/button.test.d.mts +2 -0
  18. package/dist/components/button/button.test.js +50 -52
  19. package/dist/components/button/button.test.mjs +2 -2
  20. package/dist/components/button/index.d.mts +3 -0
  21. package/dist/components/card/card.d.mts +124 -0
  22. package/dist/components/card/card.test.d.mts +2 -0
  23. package/dist/components/card/card.test.js +37 -39
  24. package/dist/components/card/card.test.mjs +1 -1
  25. package/dist/components/card/index.d.mts +5 -0
  26. package/dist/components/card/index.d.ts +5 -0
  27. package/dist/components/checkbox/checkbox.d.mts +349 -0
  28. package/dist/components/checkbox/checkbox.test.d.mts +2 -0
  29. package/dist/components/checkbox/checkbox.test.js +37 -39
  30. package/dist/components/checkbox/checkbox.test.mjs +2 -2
  31. package/dist/components/checkbox/index.d.mts +5 -0
  32. package/dist/components/checkbox/index.d.ts +5 -0
  33. package/dist/components/icon/Icon.d.mts +513 -0
  34. package/dist/components/icon/index.d.mts +4 -0
  35. package/dist/components/icon/index.d.ts +4 -0
  36. package/dist/components/icon/template.d.mts +134 -0
  37. package/dist/components/input/index.d.mts +5 -0
  38. package/dist/components/input/index.d.ts +5 -0
  39. package/dist/components/input/input.d.mts +437 -0
  40. package/dist/components/input/input.test.d.mts +2 -0
  41. package/dist/components/input/input.test.js +50 -52
  42. package/dist/components/input/input.test.mjs +2 -2
  43. package/dist/components/list/index.d.mts +6 -0
  44. package/dist/components/list/index.mjs +3 -3
  45. package/dist/components/{dropdown/dropdown.d.ts → list/list.d.mts} +9 -9
  46. package/dist/components/list/list.test.d.mts +2 -0
  47. package/dist/components/list/list.test.js +37 -39
  48. package/dist/components/list/list.test.mjs +1 -1
  49. package/dist/components/list/listItem.d.mts +183 -0
  50. package/dist/components/modal/index.d.mts +8 -0
  51. package/dist/components/modal/index.d.ts +8 -0
  52. package/dist/components/modal/modal.d.mts +214 -0
  53. package/dist/components/modal/modal.test.d.mts +2 -0
  54. package/dist/components/modal/modal.test.js +37 -39
  55. package/dist/components/modal/modal.test.mjs +1 -1
  56. package/dist/components/pagination/index.d.mts +4 -0
  57. package/dist/components/pagination/index.d.ts +4 -0
  58. package/dist/components/pagination/pagination.d.mts +186 -0
  59. package/dist/components/pagination/pagination.test.d.mts +2 -0
  60. package/dist/components/pagination/pagination.test.js +37 -39
  61. package/dist/components/pagination/pagination.test.mjs +1 -1
  62. package/dist/components/pagination/usePagination.d.mts +16 -0
  63. package/dist/components/progress/index.d.mts +5 -0
  64. package/dist/components/progress/index.d.ts +5 -0
  65. package/dist/components/progress/progress.d.mts +281 -0
  66. package/dist/components/progress/progress.test.d.mts +2 -0
  67. package/dist/components/progress/progress.test.d.ts +2 -0
  68. package/dist/components/progress/progress.test.js +37 -39
  69. package/dist/components/progress/progress.test.mjs +1 -1
  70. package/dist/components/radio/index.d.mts +5 -0
  71. package/dist/components/radio/index.d.ts +5 -0
  72. package/dist/components/radio/radio.d.mts +278 -0
  73. package/dist/components/radio/radio.test.d.mts +2 -0
  74. package/dist/components/radio/radio.test.js +37 -39
  75. package/dist/components/radio/radio.test.mjs +1 -1
  76. package/dist/components/select/index.d.mts +5 -0
  77. package/dist/components/select/index.d.ts +5 -0
  78. package/dist/components/select/index.mjs +2 -2
  79. package/dist/components/select/option.d.mts +18 -0
  80. package/dist/components/select/select.d.mts +449 -0
  81. package/dist/components/select/select.mjs +2 -2
  82. package/dist/components/select/select.test.d.mts +2 -0
  83. package/dist/components/select/select.test.js +37 -39
  84. package/dist/components/select/select.test.mjs +4 -4
  85. package/dist/components/select/useSelect.d.mts +32 -0
  86. package/dist/components/slider/index.d.mts +5 -0
  87. package/dist/components/slider/index.d.ts +5 -0
  88. package/dist/components/slider/slider.d.mts +333 -0
  89. package/dist/components/slider/slider.test.d.mts +2 -0
  90. package/dist/components/slider/slider.test.d.ts +2 -0
  91. package/dist/components/slider/slider.test.js +37 -39
  92. package/dist/components/slider/slider.test.mjs +1 -1
  93. package/dist/components/switch/index.d.mts +5 -0
  94. package/dist/components/switch/index.d.ts +5 -0
  95. package/dist/components/switch/switch.d.mts +304 -0
  96. package/dist/components/switch/switch.test.d.mts +2 -0
  97. package/dist/components/switch/switch.test.d.ts +2 -0
  98. package/dist/components/switch/switch.test.js +37 -39
  99. package/dist/components/switch/switch.test.mjs +1 -1
  100. package/dist/components/table/index.d.mts +5 -0
  101. package/dist/components/table/index.d.ts +5 -0
  102. package/dist/components/table/index.mjs +2 -2
  103. package/dist/components/table/table-body.d.mts +26 -0
  104. package/dist/components/table/table-head.d.mts +21 -0
  105. package/dist/components/table/table.d.mts +583 -0
  106. package/dist/components/table/table.mjs +2 -2
  107. package/dist/components/table/table.test.d.mts +2 -0
  108. package/dist/components/table/table.test.d.ts +2 -0
  109. package/dist/components/table/table.test.js +37 -39
  110. package/dist/components/table/table.test.mjs +3 -3
  111. package/dist/components/tabs/index.d.mts +5 -0
  112. package/dist/components/tabs/index.d.ts +5 -0
  113. package/dist/components/tabs/tabs.d.mts +241 -0
  114. package/dist/components/tabs/tabs.test.d.mts +2 -0
  115. package/dist/components/tabs/tabs.test.d.ts +2 -0
  116. package/dist/components/tabs/tabs.test.js +37 -39
  117. package/dist/components/tabs/tabs.test.mjs +2 -2
  118. package/dist/components/textarea/index.d.mts +2 -0
  119. package/dist/components/textarea/index.d.ts +2 -0
  120. package/dist/components/textarea/textarea.d.mts +17 -0
  121. package/dist/components/textarea/textarea.test.d.mts +2 -0
  122. package/dist/components/textarea/textarea.test.d.ts +2 -0
  123. package/dist/components/textarea/textarea.test.js +50 -52
  124. package/dist/components/textarea/textarea.test.mjs +2 -2
  125. package/dist/components/toast/index.d.mts +9 -0
  126. package/dist/components/toast/index.d.ts +9 -0
  127. package/dist/components/toast/index.js +147 -127
  128. package/dist/components/toast/index.mjs +10 -5
  129. package/dist/components/toast/toast-utils.d.mts +9 -0
  130. package/dist/components/toast/toast-utils.d.ts +9 -0
  131. package/dist/components/toast/toast-utils.js +25 -45
  132. package/dist/components/toast/toast-utils.mjs +1 -1
  133. package/dist/components/toast/toast.d.mts +207 -0
  134. package/dist/components/toast/toast.d.ts +13 -10
  135. package/dist/components/toast/toast.js +32 -125
  136. package/dist/components/toast/toast.mjs +1 -3
  137. package/dist/components/toast/toast.test.d.mts +2 -0
  138. package/dist/components/toast/toast.test.d.ts +2 -0
  139. package/dist/components/toast/toast.test.js +73 -168
  140. package/dist/components/toast/toast.test.mjs +4 -6
  141. package/dist/components/toast/use-toast.d.mts +31 -0
  142. package/dist/components/toast/use-toast.d.ts +31 -0
  143. package/dist/components/toast/use-toast.js +3826 -0
  144. package/dist/components/toast/use-toast.mjs +17 -0
  145. package/dist/components/tooltip/index.d.mts +6 -0
  146. package/dist/components/tooltip/index.d.ts +6 -0
  147. package/dist/components/tooltip/tooltip-utils.d.mts +2 -0
  148. package/dist/components/tooltip/tooltip-utils.d.ts +2 -0
  149. package/dist/components/tooltip/tooltip.d.mts +143 -0
  150. package/dist/components/tooltip/tooltip.test.d.mts +2 -0
  151. package/dist/components/tooltip/tooltip.test.d.ts +2 -0
  152. package/dist/components/tooltip/tooltip.test.js +37 -39
  153. package/dist/components/tooltip/tooltip.test.mjs +1 -1
  154. package/dist/components/tooltip/useTooltip.d.mts +2 -0
  155. package/dist/components/tooltip/useTooltip.d.ts +2 -0
  156. package/dist/index.d.mts +33 -0
  157. package/dist/index.d.ts +2 -2
  158. package/dist/index.js +249 -180
  159. package/dist/index.mjs +136 -36
  160. package/dist/tooltip-utils-DCKA5gnI.d.mts +30 -0
  161. package/dist/tooltip-utils-DCKA5gnI.d.ts +30 -0
  162. package/dist/utils/clsx.d.mts +3 -0
  163. package/dist/utils/props.d.mts +3 -0
  164. package/dist/utils/tailwind-variants.d.mts +26 -0
  165. package/dist/utils/types.d.mts +10 -0
  166. package/package.json +2 -2
  167. package/dist/chunk-5T5F5WVS.mjs +0 -32
  168. package/dist/chunk-LXPWTJ3F.mjs +0 -58
  169. package/dist/chunk-SDNTEP5C.mjs +0 -61
  170. package/dist/chunk-W7ABNK3K.mjs +0 -1
  171. package/dist/components/dropdown/dropdown.js +0 -122
  172. package/dist/components/dropdown/dropdown.mjs +0 -10
  173. package/dist/components/dropdown/dropdown.test.js +0 -12997
  174. package/dist/components/dropdown/dropdown.test.mjs +0 -25
  175. package/dist/components/dropdown/index.js +0 -128
  176. package/dist/components/dropdown/index.mjs +0 -11
  177. package/dist/components/toast/useToast.d.ts +0 -0
  178. package/dist/components/toast/useToast.js +0 -110
  179. package/dist/components/toast/useToast.mjs +0 -9
  180. package/dist/{chunk-RDEWIZV3.mjs → chunk-LUWGOKLG.mjs} +0 -0
  181. package/dist/{chunk-RTH3FPAS.mjs → chunk-PSXPOYLX.mjs} +3 -3
  182. package/dist/{chunk-463XE4SI.mjs → chunk-RVGOARET.mjs} +3 -3
  183. /package/dist/components/{dropdown/dropdown.test.d.ts → accordion/accordion.test.d.mts} +0 -0
@@ -0,0 +1,207 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as tailwind_variants_dist_config from 'tailwind-variants/dist/config';
4
+ import * as react from 'react';
5
+ import { ReactNode } from 'react';
6
+ import { ToastPlacement } from './toast-utils.mjs';
7
+ import { IconName } from '../icon/Icon.mjs';
8
+ import 'react/jsx-runtime';
9
+ import '../icon/template.mjs';
10
+
11
+ interface Props {
12
+ icon?: IconName;
13
+ content?: ReactNode | string;
14
+ placement?: ToastPlacement;
15
+ classNames?: Record<string, string>;
16
+ showIcon?: boolean;
17
+ showCloseButton?: boolean;
18
+ onClose?: () => void;
19
+ }
20
+ type ToastProps = Props & ToastVariantProps;
21
+ declare const Toast: react.ForwardRefExoticComponent<Props & ToastVariantProps & react.RefAttributes<any>>;
22
+
23
+ declare const toast: tailwind_variants.TVReturnType<{
24
+ color: {
25
+ primary: {
26
+ base: string;
27
+ };
28
+ secondary: {
29
+ base: string;
30
+ };
31
+ default: {
32
+ base: string;
33
+ };
34
+ success: {
35
+ base: string;
36
+ };
37
+ info: {
38
+ base: string;
39
+ };
40
+ warning: {
41
+ base: string;
42
+ };
43
+ danger: {
44
+ base: string;
45
+ };
46
+ };
47
+ disableAnimation: {
48
+ true: {
49
+ base: string;
50
+ };
51
+ };
52
+ }, {
53
+ base: string[];
54
+ content: string[];
55
+ }, undefined, {
56
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
57
+ color?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
58
+ disableAnimation?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
59
+ } | undefined;
60
+ } & tailwind_variants_dist_config.TWMConfig & {
61
+ twMergeConfig: {
62
+ classGroups: {
63
+ fontSize: {
64
+ text: string[];
65
+ }[];
66
+ borderRadius: {
67
+ rounded: string[];
68
+ }[];
69
+ boxShadow: {
70
+ shadow: string[];
71
+ }[];
72
+ padding: {
73
+ p: string[];
74
+ }[];
75
+ gap: {
76
+ gap: string[];
77
+ }[];
78
+ };
79
+ };
80
+ }, {
81
+ color: {
82
+ primary: {
83
+ base: string;
84
+ };
85
+ secondary: {
86
+ base: string;
87
+ };
88
+ default: {
89
+ base: string;
90
+ };
91
+ success: {
92
+ base: string;
93
+ };
94
+ info: {
95
+ base: string;
96
+ };
97
+ warning: {
98
+ base: string;
99
+ };
100
+ danger: {
101
+ base: string;
102
+ };
103
+ };
104
+ disableAnimation: {
105
+ true: {
106
+ base: string;
107
+ };
108
+ };
109
+ }, {
110
+ base: string[];
111
+ content: string[];
112
+ }, tailwind_variants.TVReturnType<{
113
+ color: {
114
+ primary: {
115
+ base: string;
116
+ };
117
+ secondary: {
118
+ base: string;
119
+ };
120
+ default: {
121
+ base: string;
122
+ };
123
+ success: {
124
+ base: string;
125
+ };
126
+ info: {
127
+ base: string;
128
+ };
129
+ warning: {
130
+ base: string;
131
+ };
132
+ danger: {
133
+ base: string;
134
+ };
135
+ };
136
+ disableAnimation: {
137
+ true: {
138
+ base: string;
139
+ };
140
+ };
141
+ }, {
142
+ base: string[];
143
+ content: string[];
144
+ }, undefined, tailwind_variants_dist_config.TVConfig<{
145
+ color: {
146
+ primary: {
147
+ base: string;
148
+ };
149
+ secondary: {
150
+ base: string;
151
+ };
152
+ default: {
153
+ base: string;
154
+ };
155
+ success: {
156
+ base: string;
157
+ };
158
+ info: {
159
+ base: string;
160
+ };
161
+ warning: {
162
+ base: string;
163
+ };
164
+ danger: {
165
+ base: string;
166
+ };
167
+ };
168
+ disableAnimation: {
169
+ true: {
170
+ base: string;
171
+ };
172
+ };
173
+ }, {
174
+ color: {
175
+ primary: {
176
+ base: string;
177
+ };
178
+ secondary: {
179
+ base: string;
180
+ };
181
+ default: {
182
+ base: string;
183
+ };
184
+ success: {
185
+ base: string;
186
+ };
187
+ info: {
188
+ base: string;
189
+ };
190
+ warning: {
191
+ base: string;
192
+ };
193
+ danger: {
194
+ base: string;
195
+ };
196
+ };
197
+ disableAnimation: {
198
+ true: {
199
+ base: string;
200
+ };
201
+ };
202
+ }>, unknown, unknown, undefined>>;
203
+ type ToastVariantProps = VariantProps<typeof toast>;
204
+ type ToastSlots = keyof ReturnType<typeof toast>;
205
+ type ToastReturnType = ReturnType<typeof toast>;
206
+
207
+ export { type Props, type ToastProps, type ToastReturnType, type ToastSlots, type ToastVariantProps, Toast as default };
@@ -3,21 +3,24 @@ import { VariantProps } from 'tailwind-variants';
3
3
  import * as tailwind_variants_dist_config from 'tailwind-variants/dist/config';
4
4
  import * as react from 'react';
5
5
  import { ReactNode } from 'react';
6
- import { SlotsToClasses } from '../../utils/types.js';
7
- import { T as ToastPlacement } from '../../toast-utils-c66EY-H0.js';
6
+ import { ToastPlacement } from './toast-utils.js';
7
+ import { IconName } from '../icon/Icon.js';
8
+ import 'react/jsx-runtime';
9
+ import '../icon/template.js';
8
10
 
9
11
  interface Props {
12
+ icon?: IconName;
10
13
  content?: ReactNode | string;
11
- offset?: number;
12
14
  placement?: ToastPlacement;
13
- classNames?: SlotsToClasses<ToastSlots>;
14
- showStatusIcon?: boolean;
15
+ classNames?: Record<string, string>;
16
+ showIcon?: boolean;
15
17
  showCloseButton?: boolean;
18
+ onClose?: () => void;
16
19
  }
17
20
  type ToastProps = Props & ToastVariantProps;
18
- declare const Toast: react.ForwardRefExoticComponent<Props & ToastVariantProps & react.RefAttributes<HTMLDivElement>>;
21
+ declare const Toast: react.ForwardRefExoticComponent<Props & ToastVariantProps & react.RefAttributes<any>>;
19
22
 
20
- declare const tooltip: tailwind_variants.TVReturnType<{
23
+ declare const toast: tailwind_variants.TVReturnType<{
21
24
  color: {
22
25
  primary: {
23
26
  base: string;
@@ -197,8 +200,8 @@ declare const tooltip: tailwind_variants.TVReturnType<{
197
200
  };
198
201
  };
199
202
  }>, unknown, unknown, undefined>>;
200
- type ToastVariantProps = VariantProps<typeof tooltip>;
201
- type ToastSlots = keyof ReturnType<typeof tooltip>;
202
- type ToastReturnType = ReturnType<typeof tooltip>;
203
+ type ToastVariantProps = VariantProps<typeof toast>;
204
+ type ToastSlots = keyof ReturnType<typeof toast>;
205
+ type ToastReturnType = ReturnType<typeof toast>;
203
206
 
204
207
  export { type Props, type ToastProps, type ToastReturnType, type ToastSlots, type ToastVariantProps, Toast as default };
@@ -24,8 +24,7 @@ __export(toast_exports, {
24
24
  default: () => toast_default
25
25
  });
26
26
  module.exports = __toCommonJS(toast_exports);
27
- var import_react2 = require("react");
28
- var import_react_dom = require("react-dom");
27
+ var import_react = require("react");
29
28
 
30
29
  // src/utils/tailwind-variants.ts
31
30
  var import_tailwind_variants = require("tailwind-variants");
@@ -66,88 +65,6 @@ var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
66
65
  }
67
66
  };
68
67
 
69
- // src/components/toast/useToast.ts
70
- var import_react = require("react");
71
-
72
- // src/components/toast/toast-utils.ts
73
- var getToastPosition = (placement, targetRect, width, height, offset) => {
74
- let x = 0, y = 0;
75
- switch (placement) {
76
- case "top":
77
- x = targetRect.left + targetRect.width / 2 - width / 2;
78
- y = targetRect.top - height - offset;
79
- break;
80
- case "left":
81
- x = targetRect.left - width - offset;
82
- y = targetRect.top + targetRect.height / 2 - height / 2;
83
- break;
84
- case "right":
85
- x = targetRect.right + offset;
86
- y = targetRect.top + targetRect.height / 2 - height / 2;
87
- break;
88
- case "bottom":
89
- x = targetRect.left + targetRect.width / 2 - width / 2;
90
- y = targetRect.bottom + offset;
91
- break;
92
- case "top-start":
93
- x = targetRect.left;
94
- y = targetRect.top - height - offset;
95
- break;
96
- case "top-end":
97
- x = targetRect.right - width;
98
- y = targetRect.top - height - offset;
99
- break;
100
- case "bottom-start":
101
- x = targetRect.left;
102
- y = targetRect.bottom + offset;
103
- break;
104
- case "bottom-end":
105
- x = targetRect.right - width;
106
- y = targetRect.bottom + offset;
107
- break;
108
- case "left-start":
109
- x = targetRect.left - width - offset;
110
- y = targetRect.top;
111
- break;
112
- case "left-end":
113
- x = targetRect.left - width - offset;
114
- y = targetRect.bottom - height;
115
- break;
116
- case "right-start":
117
- x = targetRect.right + offset;
118
- y = targetRect.top;
119
- break;
120
- case "right-end":
121
- x = targetRect.right + offset;
122
- y = targetRect.bottom - height;
123
- break;
124
- }
125
- return { toastX: x, toastY: y };
126
- };
127
-
128
- // src/components/toast/useToast.ts
129
- var useToast = ({ placement, offset, targetRect }) => {
130
- const [toastPosition, setToastPosition] = (0, import_react.useState)({ x: 0, y: 0 });
131
- const toastRef = (0, import_react.useRef)(null);
132
- (0, import_react.useEffect)(() => {
133
- if (targetRect && toastRef.current) {
134
- const { width, height } = toastRef.current.getBoundingClientRect();
135
- const scrollX = window.scrollX;
136
- const scrollY = window.scrollY;
137
- const adjustedTargetRect = {
138
- ...targetRect,
139
- left: targetRect.left + scrollX,
140
- top: targetRect.top + scrollY,
141
- right: targetRect.right + scrollX,
142
- bottom: targetRect.bottom + scrollY
143
- };
144
- const { toastX, toastY } = getToastPosition(placement, adjustedTargetRect, width, height, offset);
145
- setToastPosition({ x: toastX, y: toastY });
146
- }
147
- }, [placement, offset, targetRect]);
148
- return { toastPosition, toastRef };
149
- };
150
-
151
68
  // src/components/icon/template.tsx
152
69
  var import_jsx_runtime = require("react/jsx-runtime");
153
70
  var template = {
@@ -3697,63 +3614,53 @@ var Icon_default = Icon;
3697
3614
 
3698
3615
  // src/components/toast/toast.tsx
3699
3616
  var import_jsx_runtime3 = require("react/jsx-runtime");
3700
- var Toast = (0, import_react2.forwardRef)((originalProps, ref) => {
3701
- const [props, variantProps] = mapPropsVariants(originalProps, tooltip.variantKeys);
3702
- const { placement = "bottom", offset = 5, classNames, ...tooltipProps } = props;
3703
- const slots = (0, import_react2.useMemo)(() => tooltip({ ...variantProps }), [variantProps]);
3704
- const [targetRect, setTargetRect] = (0, import_react2.useState)(null);
3705
- const { toastPosition, toastRef } = useToast({ placement, offset, targetRect });
3706
- const condition = true;
3707
- const getBaseProps = (0, import_react2.useCallback)(
3617
+ var Toast = (0, import_react.forwardRef)((originalProps, ref) => {
3618
+ const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
3619
+ const { placement, classNames, showIcon = true, showCloseButton = true, onClose, ...toastProps } = props;
3620
+ const slots = (0, import_react.useMemo)(() => toast({ ...variantProps }), [variantProps]);
3621
+ const toastRef = (0, import_react.useRef)(null);
3622
+ (0, import_react.useImperativeHandle)(
3623
+ ref,
3708
3624
  () => ({
3709
- className: slots.base({ class: classNames == null ? void 0 : classNames.base })
3625
+ getWidth: () => {
3626
+ if (toastRef.current) {
3627
+ return toastRef.current.offsetWidth;
3628
+ }
3629
+ }
3710
3630
  }),
3711
- [slots, classNames == null ? void 0 : classNames.base]
3631
+ []
3712
3632
  );
3713
- const getContentProps = (0, import_react2.useCallback)(
3633
+ const getBaseProps = (0, import_react.useCallback)(
3714
3634
  () => ({
3715
- className: slots.content({ class: classNames == null ? void 0 : classNames.content })
3635
+ className: slots.base({
3636
+ class: [classNames == null ? void 0 : classNames.base, (placement == null ? void 0 : placement.includes("top")) ? "animate-slideInFromTop" : "animate-slideInFromBottom"]
3637
+ })
3716
3638
  }),
3717
- [slots, classNames == null ? void 0 : classNames.content]
3639
+ [slots, classNames == null ? void 0 : classNames.base]
3718
3640
  );
3719
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
3720
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ...getBaseProps(), onPointerLeave: () => setTargetRect(null), onPointerEnter: () => {
3721
- }, children: [
3722
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "info-circle", fill: true }),
3723
- props.content,
3724
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "close", className: "cursor-pointer" })
3725
- ] }),
3726
- condition && (0, import_react_dom.createPortal)(
3727
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3728
- "div",
3729
- {
3730
- ref: toastRef,
3731
- ...getContentProps(),
3732
- style: {
3733
- visibility: toastPosition.x !== 0 ? "visible" : "hidden",
3734
- transform: `translate3d(${toastPosition.x}px, ${toastPosition.y}px, 0)`
3735
- },
3736
- children: props.content
3737
- }
3738
- ),
3739
- document.body
3740
- )
3641
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref: toastRef, ...getBaseProps(), children: [
3642
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
3643
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex-1", children: props.content }),
3644
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "close", className: "cursor-pointer mt-[2px]", onClick: onClose })
3741
3645
  ] });
3742
3646
  });
3743
3647
  Toast.displayName = "Toast";
3744
3648
  var toast_default = Toast;
3745
- var tooltip = tv({
3649
+ var toast = tv({
3746
3650
  slots: {
3747
3651
  base: [
3748
- "z-0",
3652
+ "w-[300px]",
3749
3653
  "relative",
3750
3654
  "inline-flex",
3751
- "items-center",
3752
- "text-md",
3753
- "gap-[5px]",
3655
+ "items-start",
3754
3656
  "border",
3657
+ "rounded-md",
3658
+ "text-md",
3755
3659
  "p-[10px]",
3756
- "rounded-md"
3660
+ "gap-[5px]",
3661
+ "z-0",
3662
+ "transition-all",
3663
+ "duration-300"
3757
3664
  ],
3758
3665
  content: [
3759
3666
  "absolute",
@@ -1,9 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  toast_default
4
- } from "../../chunk-XTJL67KM.mjs";
5
- import "../../chunk-5T5F5WVS.mjs";
6
- import "../../chunk-SDNTEP5C.mjs";
4
+ } from "../../chunk-HH2LF2SU.mjs";
7
5
  import "../../chunk-ZYIIXWVY.mjs";
8
6
  import "../../chunk-AHORH5PH.mjs";
9
7
  import "../../chunk-QURXBWKK.mjs";
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }