@deepnoid/ui 0.0.84 → 0.0.87

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 (216) hide show
  1. package/dist/{chunk-XTJL67KM.mjs → chunk-2COCX2VX.mjs} +37 -47
  2. package/dist/{chunk-KA4L5SCT.mjs → chunk-4DLTBZUQ.mjs} +1 -1
  3. package/dist/{chunk-RTH3FPAS.mjs → chunk-4SWFYTMR.mjs} +3 -3
  4. package/dist/{chunk-463XE4SI.mjs → chunk-4VIEZ5FT.mjs} +4 -4
  5. package/dist/{chunk-NTTHTGDK.mjs → chunk-FNPWLOGV.mjs} +37 -39
  6. package/dist/{chunk-ILMIS63S.mjs → chunk-H7BLXC5M.mjs} +14 -14
  7. package/dist/{chunk-QURXBWKK.mjs → chunk-IOV7MEPG.mjs} +323 -331
  8. package/dist/{chunk-SQLRQTFC.mjs → chunk-LY6LJRUX.mjs} +1 -1
  9. package/dist/{chunk-EWKYBS7I.mjs → chunk-PHQY5T3E.mjs} +1 -1
  10. package/dist/{chunk-AHORH5PH.mjs → chunk-PRUAIZTU.mjs} +1 -1
  11. package/dist/{chunk-LGELMZCN.mjs → chunk-QIZOXBOY.mjs} +1 -1
  12. package/dist/chunk-QX6VJLEM.mjs +83 -0
  13. package/dist/{chunk-ADDUBJ4I.mjs → chunk-S4DTK5GI.mjs} +1 -1
  14. package/dist/{chunk-QCOPD2HG.mjs → chunk-SFNR4F3J.mjs} +1 -1
  15. package/dist/chunk-ZOTHPHXA.mjs +41 -0
  16. package/dist/components/accordion/accordion.d.mts +154 -0
  17. package/dist/components/accordion/accordion.test.js +37 -39
  18. package/dist/components/accordion/accordion.test.mjs +1 -1
  19. package/dist/components/accordion/accordionItem.d.mts +282 -0
  20. package/dist/components/accordion/accordionItem.js +323 -331
  21. package/dist/components/accordion/accordionItem.mjs +3 -3
  22. package/dist/components/accordion/index.d.mts +6 -0
  23. package/dist/components/accordion/index.js +323 -331
  24. package/dist/components/accordion/index.mjs +3 -3
  25. package/dist/components/button/button-group.d.mts +14 -0
  26. package/dist/components/button/button-group.test.d.mts +2 -0
  27. package/dist/components/button/button-group.test.js +37 -39
  28. package/dist/components/button/button-group.test.mjs +2 -2
  29. package/dist/components/button/button.d.mts +18 -0
  30. package/dist/components/button/button.test.d.mts +2 -0
  31. package/dist/components/button/button.test.js +50 -52
  32. package/dist/components/button/button.test.mjs +2 -2
  33. package/dist/components/button/index.d.mts +3 -0
  34. package/dist/components/card/card.d.mts +124 -0
  35. package/dist/components/card/card.test.d.mts +2 -0
  36. package/dist/components/card/card.test.js +37 -39
  37. package/dist/components/card/card.test.mjs +1 -1
  38. package/dist/components/card/index.d.mts +5 -0
  39. package/dist/components/card/index.d.ts +5 -0
  40. package/dist/components/checkbox/checkbox.d.mts +349 -0
  41. package/dist/components/checkbox/checkbox.test.d.mts +2 -0
  42. package/dist/components/checkbox/checkbox.test.js +37 -39
  43. package/dist/components/checkbox/checkbox.test.mjs +2 -2
  44. package/dist/components/checkbox/index.d.mts +5 -0
  45. package/dist/components/checkbox/index.d.ts +5 -0
  46. package/dist/components/icon/Icon.d.mts +513 -0
  47. package/dist/components/icon/Icon.js +323 -331
  48. package/dist/components/icon/Icon.mjs +2 -2
  49. package/dist/components/icon/index.d.mts +4 -0
  50. package/dist/components/icon/index.d.ts +4 -0
  51. package/dist/components/icon/index.js +323 -331
  52. package/dist/components/icon/index.mjs +2 -2
  53. package/dist/components/icon/template.d.mts +134 -0
  54. package/dist/components/icon/template.js +323 -331
  55. package/dist/components/icon/template.mjs +1 -1
  56. package/dist/components/input/index.d.mts +5 -0
  57. package/dist/components/input/index.d.ts +5 -0
  58. package/dist/components/input/index.js +323 -331
  59. package/dist/components/input/index.mjs +3 -3
  60. package/dist/components/input/input.d.mts +437 -0
  61. package/dist/components/input/input.js +323 -331
  62. package/dist/components/input/input.mjs +3 -3
  63. package/dist/components/input/input.test.d.mts +2 -0
  64. package/dist/components/input/input.test.js +373 -383
  65. package/dist/components/input/input.test.mjs +5 -5
  66. package/dist/components/list/index.d.mts +6 -0
  67. package/dist/components/list/index.mjs +3 -3
  68. package/dist/components/{dropdown/dropdown.d.ts → list/list.d.mts} +9 -9
  69. package/dist/components/list/list.test.d.mts +2 -0
  70. package/dist/components/list/list.test.js +37 -39
  71. package/dist/components/list/list.test.mjs +1 -1
  72. package/dist/components/list/listItem.d.mts +183 -0
  73. package/dist/components/modal/index.d.mts +8 -0
  74. package/dist/components/modal/index.d.ts +8 -0
  75. package/dist/components/modal/index.js +323 -331
  76. package/dist/components/modal/index.mjs +3 -3
  77. package/dist/components/modal/modal.d.mts +214 -0
  78. package/dist/components/modal/modal.js +323 -331
  79. package/dist/components/modal/modal.mjs +3 -3
  80. package/dist/components/modal/modal.test.d.mts +2 -0
  81. package/dist/components/modal/modal.test.js +360 -370
  82. package/dist/components/modal/modal.test.mjs +4 -4
  83. package/dist/components/pagination/index.d.mts +4 -0
  84. package/dist/components/pagination/index.d.ts +4 -0
  85. package/dist/components/pagination/pagination.d.mts +186 -0
  86. package/dist/components/pagination/pagination.test.d.mts +2 -0
  87. package/dist/components/pagination/pagination.test.js +37 -39
  88. package/dist/components/pagination/pagination.test.mjs +1 -1
  89. package/dist/components/pagination/usePagination.d.mts +16 -0
  90. package/dist/components/progress/index.d.mts +5 -0
  91. package/dist/components/progress/index.d.ts +5 -0
  92. package/dist/components/progress/progress.d.mts +281 -0
  93. package/dist/components/progress/progress.test.d.mts +2 -0
  94. package/dist/components/progress/progress.test.d.ts +2 -0
  95. package/dist/components/progress/progress.test.js +37 -39
  96. package/dist/components/progress/progress.test.mjs +1 -1
  97. package/dist/components/radio/index.d.mts +5 -0
  98. package/dist/components/radio/index.d.ts +5 -0
  99. package/dist/components/radio/radio.d.mts +278 -0
  100. package/dist/components/radio/radio.test.d.mts +2 -0
  101. package/dist/components/radio/radio.test.js +37 -39
  102. package/dist/components/radio/radio.test.mjs +1 -1
  103. package/dist/components/select/index.d.mts +5 -0
  104. package/dist/components/select/index.d.ts +5 -0
  105. package/dist/components/select/index.js +323 -331
  106. package/dist/components/select/index.mjs +4 -4
  107. package/dist/components/select/option.d.mts +18 -0
  108. package/dist/components/select/option.js +323 -331
  109. package/dist/components/select/option.mjs +3 -3
  110. package/dist/components/select/select.d.mts +449 -0
  111. package/dist/components/select/select.js +323 -331
  112. package/dist/components/select/select.mjs +4 -4
  113. package/dist/components/select/select.test.d.mts +2 -0
  114. package/dist/components/select/select.test.js +360 -370
  115. package/dist/components/select/select.test.mjs +6 -6
  116. package/dist/components/select/useSelect.d.mts +32 -0
  117. package/dist/components/slider/index.d.mts +5 -0
  118. package/dist/components/slider/index.d.ts +5 -0
  119. package/dist/components/slider/slider.d.mts +333 -0
  120. package/dist/components/slider/slider.test.d.mts +2 -0
  121. package/dist/components/slider/slider.test.d.ts +2 -0
  122. package/dist/components/slider/slider.test.js +37 -39
  123. package/dist/components/slider/slider.test.mjs +1 -1
  124. package/dist/components/switch/index.d.mts +5 -0
  125. package/dist/components/switch/index.d.ts +5 -0
  126. package/dist/components/switch/switch.d.mts +304 -0
  127. package/dist/components/switch/switch.test.d.mts +2 -0
  128. package/dist/components/switch/switch.test.d.ts +2 -0
  129. package/dist/components/switch/switch.test.js +37 -39
  130. package/dist/components/switch/switch.test.mjs +1 -1
  131. package/dist/components/table/index.d.mts +5 -0
  132. package/dist/components/table/index.d.ts +5 -0
  133. package/dist/components/table/index.js +323 -331
  134. package/dist/components/table/index.mjs +4 -4
  135. package/dist/components/table/table-body.d.mts +26 -0
  136. package/dist/components/table/table-body.js +323 -331
  137. package/dist/components/table/table-body.mjs +3 -3
  138. package/dist/components/table/table-head.d.mts +21 -0
  139. package/dist/components/table/table.d.mts +583 -0
  140. package/dist/components/table/table.js +323 -331
  141. package/dist/components/table/table.mjs +4 -4
  142. package/dist/components/table/table.test.d.mts +2 -0
  143. package/dist/components/table/table.test.d.ts +2 -0
  144. package/dist/components/table/table.test.js +360 -370
  145. package/dist/components/table/table.test.mjs +5 -5
  146. package/dist/components/tabs/index.d.mts +5 -0
  147. package/dist/components/tabs/index.d.ts +5 -0
  148. package/dist/components/tabs/tabs.d.mts +241 -0
  149. package/dist/components/tabs/tabs.test.d.mts +2 -0
  150. package/dist/components/tabs/tabs.test.d.ts +2 -0
  151. package/dist/components/tabs/tabs.test.js +37 -39
  152. package/dist/components/tabs/tabs.test.mjs +2 -2
  153. package/dist/components/textarea/index.d.mts +2 -0
  154. package/dist/components/textarea/index.d.ts +2 -0
  155. package/dist/components/textarea/textarea.d.mts +17 -0
  156. package/dist/components/textarea/textarea.test.d.mts +2 -0
  157. package/dist/components/textarea/textarea.test.d.ts +2 -0
  158. package/dist/components/textarea/textarea.test.js +50 -52
  159. package/dist/components/textarea/textarea.test.mjs +2 -2
  160. package/dist/components/toast/index.d.mts +9 -0
  161. package/dist/components/toast/index.d.ts +9 -0
  162. package/dist/components/toast/index.js +474 -458
  163. package/dist/components/toast/index.mjs +12 -7
  164. package/dist/components/toast/toast-utils.d.mts +9 -0
  165. package/dist/components/toast/toast-utils.d.ts +9 -0
  166. package/dist/components/toast/toast-utils.js +25 -45
  167. package/dist/components/toast/toast-utils.mjs +1 -1
  168. package/dist/components/toast/toast.d.mts +208 -0
  169. package/dist/components/toast/toast.d.ts +14 -10
  170. package/dist/components/toast/toast.js +359 -456
  171. package/dist/components/toast/toast.mjs +3 -5
  172. package/dist/components/toast/toast.test.d.mts +2 -0
  173. package/dist/components/toast/toast.test.d.ts +2 -0
  174. package/dist/components/toast/toast.test.js +400 -499
  175. package/dist/components/toast/toast.test.mjs +6 -8
  176. package/dist/components/toast/use-toast.d.mts +31 -0
  177. package/dist/components/toast/use-toast.d.ts +31 -0
  178. package/dist/components/toast/use-toast.js +3822 -0
  179. package/dist/components/toast/use-toast.mjs +17 -0
  180. package/dist/components/tooltip/index.d.mts +6 -0
  181. package/dist/components/tooltip/index.d.ts +6 -0
  182. package/dist/components/tooltip/tooltip-utils.d.mts +2 -0
  183. package/dist/components/tooltip/tooltip-utils.d.ts +2 -0
  184. package/dist/components/tooltip/tooltip.d.mts +143 -0
  185. package/dist/components/tooltip/tooltip.test.d.mts +2 -0
  186. package/dist/components/tooltip/tooltip.test.d.ts +2 -0
  187. package/dist/components/tooltip/tooltip.test.js +37 -39
  188. package/dist/components/tooltip/tooltip.test.mjs +1 -1
  189. package/dist/components/tooltip/useTooltip.d.mts +2 -0
  190. package/dist/components/tooltip/useTooltip.d.ts +2 -0
  191. package/dist/index.d.mts +33 -0
  192. package/dist/index.d.ts +2 -2
  193. package/dist/index.js +576 -511
  194. package/dist/index.mjs +139 -39
  195. package/dist/tooltip-utils-DCKA5gnI.d.mts +30 -0
  196. package/dist/tooltip-utils-DCKA5gnI.d.ts +30 -0
  197. package/dist/utils/clsx.d.mts +3 -0
  198. package/dist/utils/props.d.mts +3 -0
  199. package/dist/utils/tailwind-variants.d.mts +26 -0
  200. package/dist/utils/types.d.mts +10 -0
  201. package/package.json +3 -2
  202. package/dist/chunk-5T5F5WVS.mjs +0 -32
  203. package/dist/chunk-LXPWTJ3F.mjs +0 -58
  204. package/dist/chunk-SDNTEP5C.mjs +0 -61
  205. package/dist/chunk-W7ABNK3K.mjs +0 -1
  206. package/dist/components/dropdown/dropdown.js +0 -122
  207. package/dist/components/dropdown/dropdown.mjs +0 -10
  208. package/dist/components/dropdown/dropdown.test.js +0 -12997
  209. package/dist/components/dropdown/dropdown.test.mjs +0 -25
  210. package/dist/components/dropdown/index.js +0 -128
  211. package/dist/components/dropdown/index.mjs +0 -11
  212. package/dist/components/toast/useToast.d.ts +0 -0
  213. package/dist/components/toast/useToast.js +0 -110
  214. package/dist/components/toast/useToast.mjs +0 -9
  215. /package/dist/{chunk-RDEWIZV3.mjs → chunk-LUWGOKLG.mjs} +0 -0
  216. /package/dist/components/{dropdown/dropdown.test.d.ts → accordion/accordion.test.d.mts} +0 -0
@@ -1,25 +0,0 @@
1
- "use client";
2
- import {
3
- dropdown_default
4
- } from "../../chunk-LXPWTJ3F.mjs";
5
- import {
6
- render
7
- } from "../../chunk-NTTHTGDK.mjs";
8
- import "../../chunk-E3G5QXSH.mjs";
9
- import "../../chunk-J725QONZ.mjs";
10
- import "../../chunk-IZ6II3QA.mjs";
11
-
12
- // src/components/dropdown/dropdown.test.tsx
13
- import { createRef } from "react";
14
- import { jsx } from "react/jsx-runtime";
15
- describe("Dropdown", () => {
16
- it("should render correctly", () => {
17
- const wrapper = render(/* @__PURE__ */ jsx(dropdown_default, {}));
18
- expect(() => wrapper.unmount()).not.toThrow();
19
- });
20
- it("ref should be forwarded", () => {
21
- const ref = createRef();
22
- render(/* @__PURE__ */ jsx(dropdown_default, { ref }));
23
- expect(ref.current).not.toBeNull();
24
- });
25
- });
@@ -1,128 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/components/dropdown/index.ts
32
- var dropdown_exports = {};
33
- __export(dropdown_exports, {
34
- Dropdown: () => dropdown_default
35
- });
36
- module.exports = __toCommonJS(dropdown_exports);
37
-
38
- // src/components/dropdown/dropdown.tsx
39
- var import_react = __toESM(require("react"));
40
-
41
- // src/utils/tailwind-variants.ts
42
- var import_tailwind_variants = require("tailwind-variants");
43
- var COMMON_SIZE = ["sm", "md", "lg"];
44
- var COMMON_RADIUS = ["xlg", "xxlg", "none", "full"];
45
- var COMMON_FONTSIZE = ["h1", "h2", "h3", "h4", "h5"];
46
- var COMMON_SHADOW = ["inner", "drop"];
47
- var tv = (0, import_tailwind_variants.createTV)({
48
- // twMerge: false,
49
- twMergeConfig: {
50
- classGroups: {
51
- fontSize: [{ text: [...COMMON_SIZE, ...COMMON_FONTSIZE] }],
52
- borderRadius: [{ rounded: [...COMMON_RADIUS, ...COMMON_SIZE] }],
53
- boxShadow: [{ shadow: [...COMMON_SHADOW] }],
54
- padding: [{ p: [...COMMON_SIZE] }],
55
- gap: [{ gap: [...COMMON_SIZE] }]
56
- }
57
- }
58
- });
59
-
60
- // src/utils/props.ts
61
- var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
62
- if (!variantKeys) {
63
- return [props, {}];
64
- }
65
- const picked = variantKeys.reduce((acc, key) => {
66
- if (key in props) {
67
- return { ...acc, [key]: props[key] };
68
- } else {
69
- return acc;
70
- }
71
- }, {});
72
- if (removeVariantProps) {
73
- const omitted = Object.keys(props).filter((key) => !variantKeys.includes(key)).reduce((acc, key) => ({ ...acc, [key]: props[key] }), {});
74
- return [omitted, picked];
75
- } else {
76
- return [props, picked];
77
- }
78
- };
79
-
80
- // src/components/dropdown/dropdown.tsx
81
- var import_jsx_runtime = require("react/jsx-runtime");
82
- var Dropdown = (0, import_react.forwardRef)((originalProps, ref) => {
83
- const [props, variantProps] = mapPropsVariants(originalProps, dropdown.variantKeys);
84
- const { children, classNames } = props;
85
- const slots = (0, import_react.useMemo)(() => dropdown({ ...variantProps }), [...Object.values(variantProps)]);
86
- const getBaseProps = (0, import_react.useCallback)(() => {
87
- return {
88
- className: slots.base({ class: classNames == null ? void 0 : classNames.base })
89
- };
90
- }, [slots, classNames == null ? void 0 : classNames.base]);
91
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, ...getBaseProps(), children: import_react.default.Children.map(children, (child, index) => {
92
- return import_react.default.cloneElement(child, {
93
- ...variantProps,
94
- ...child.props
95
- });
96
- }) });
97
- });
98
- Dropdown.displayName = "Dropdown";
99
- var dropdown_default = Dropdown;
100
- var dropdown = tv({
101
- slots: {
102
- base: ["flex", "flex-col"]
103
- },
104
- variants: {
105
- variant: {
106
- solid: {},
107
- line: {}
108
- },
109
- size: {
110
- sm: {},
111
- md: {},
112
- lg: {}
113
- },
114
- color: {
115
- primary: {},
116
- secondary: {}
117
- }
118
- },
119
- defaultVariants: {
120
- variant: "solid",
121
- color: "primary",
122
- size: "md"
123
- }
124
- });
125
- // Annotate the CommonJS export names for ESM import in node:
126
- 0 && (module.exports = {
127
- Dropdown
128
- });
@@ -1,11 +0,0 @@
1
- "use client";
2
- import "../../chunk-RDEWIZV3.mjs";
3
- import {
4
- dropdown_default
5
- } from "../../chunk-LXPWTJ3F.mjs";
6
- import "../../chunk-E3G5QXSH.mjs";
7
- import "../../chunk-J725QONZ.mjs";
8
- import "../../chunk-IZ6II3QA.mjs";
9
- export {
10
- dropdown_default as Dropdown
11
- };
File without changes
@@ -1,110 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/components/toast/useToast.ts
22
- var useToast_exports = {};
23
- __export(useToast_exports, {
24
- useToast: () => useToast
25
- });
26
- module.exports = __toCommonJS(useToast_exports);
27
- var import_react = require("react");
28
-
29
- // src/components/toast/toast-utils.ts
30
- var getToastPosition = (placement, targetRect, width, height, offset) => {
31
- let x = 0, y = 0;
32
- switch (placement) {
33
- case "top":
34
- x = targetRect.left + targetRect.width / 2 - width / 2;
35
- y = targetRect.top - height - offset;
36
- break;
37
- case "left":
38
- x = targetRect.left - width - offset;
39
- y = targetRect.top + targetRect.height / 2 - height / 2;
40
- break;
41
- case "right":
42
- x = targetRect.right + offset;
43
- y = targetRect.top + targetRect.height / 2 - height / 2;
44
- break;
45
- case "bottom":
46
- x = targetRect.left + targetRect.width / 2 - width / 2;
47
- y = targetRect.bottom + offset;
48
- break;
49
- case "top-start":
50
- x = targetRect.left;
51
- y = targetRect.top - height - offset;
52
- break;
53
- case "top-end":
54
- x = targetRect.right - width;
55
- y = targetRect.top - height - offset;
56
- break;
57
- case "bottom-start":
58
- x = targetRect.left;
59
- y = targetRect.bottom + offset;
60
- break;
61
- case "bottom-end":
62
- x = targetRect.right - width;
63
- y = targetRect.bottom + offset;
64
- break;
65
- case "left-start":
66
- x = targetRect.left - width - offset;
67
- y = targetRect.top;
68
- break;
69
- case "left-end":
70
- x = targetRect.left - width - offset;
71
- y = targetRect.bottom - height;
72
- break;
73
- case "right-start":
74
- x = targetRect.right + offset;
75
- y = targetRect.top;
76
- break;
77
- case "right-end":
78
- x = targetRect.right + offset;
79
- y = targetRect.bottom - height;
80
- break;
81
- }
82
- return { toastX: x, toastY: y };
83
- };
84
-
85
- // src/components/toast/useToast.ts
86
- var useToast = ({ placement, offset, targetRect }) => {
87
- const [toastPosition, setToastPosition] = (0, import_react.useState)({ x: 0, y: 0 });
88
- const toastRef = (0, import_react.useRef)(null);
89
- (0, import_react.useEffect)(() => {
90
- if (targetRect && toastRef.current) {
91
- const { width, height } = toastRef.current.getBoundingClientRect();
92
- const scrollX = window.scrollX;
93
- const scrollY = window.scrollY;
94
- const adjustedTargetRect = {
95
- ...targetRect,
96
- left: targetRect.left + scrollX,
97
- top: targetRect.top + scrollY,
98
- right: targetRect.right + scrollX,
99
- bottom: targetRect.bottom + scrollY
100
- };
101
- const { toastX, toastY } = getToastPosition(placement, adjustedTargetRect, width, height, offset);
102
- setToastPosition({ x: toastX, y: toastY });
103
- }
104
- }, [placement, offset, targetRect]);
105
- return { toastPosition, toastRef };
106
- };
107
- // Annotate the CommonJS export names for ESM import in node:
108
- 0 && (module.exports = {
109
- useToast
110
- });
@@ -1,9 +0,0 @@
1
- "use client";
2
- import {
3
- useToast
4
- } from "../../chunk-5T5F5WVS.mjs";
5
- import "../../chunk-SDNTEP5C.mjs";
6
- import "../../chunk-IZ6II3QA.mjs";
7
- export {
8
- useToast
9
- };
File without changes