@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.
- package/dist/{chunk-NTTHTGDK.mjs → chunk-FNPWLOGV.mjs} +37 -39
- package/dist/chunk-FRIK4CS7.mjs +83 -0
- package/dist/{chunk-ILMIS63S.mjs → chunk-H7BLXC5M.mjs} +14 -14
- package/dist/{chunk-XTJL67KM.mjs → chunk-HH2LF2SU.mjs} +32 -46
- package/dist/{chunk-ADDUBJ4I.mjs → chunk-S4DTK5GI.mjs} +1 -1
- package/dist/chunk-ZOTHPHXA.mjs +41 -0
- package/dist/components/accordion/accordion.d.mts +154 -0
- package/dist/components/accordion/accordion.test.js +37 -39
- package/dist/components/accordion/accordion.test.mjs +1 -1
- package/dist/components/accordion/accordionItem.d.mts +282 -0
- package/dist/components/accordion/index.d.mts +6 -0
- package/dist/components/button/button-group.d.mts +14 -0
- package/dist/components/button/button-group.test.d.mts +2 -0
- package/dist/components/button/button-group.test.js +37 -39
- package/dist/components/button/button-group.test.mjs +2 -2
- package/dist/components/button/button.d.mts +18 -0
- package/dist/components/button/button.test.d.mts +2 -0
- package/dist/components/button/button.test.js +50 -52
- package/dist/components/button/button.test.mjs +2 -2
- package/dist/components/button/index.d.mts +3 -0
- package/dist/components/card/card.d.mts +124 -0
- package/dist/components/card/card.test.d.mts +2 -0
- package/dist/components/card/card.test.js +37 -39
- package/dist/components/card/card.test.mjs +1 -1
- package/dist/components/card/index.d.mts +5 -0
- package/dist/components/card/index.d.ts +5 -0
- package/dist/components/checkbox/checkbox.d.mts +349 -0
- package/dist/components/checkbox/checkbox.test.d.mts +2 -0
- package/dist/components/checkbox/checkbox.test.js +37 -39
- package/dist/components/checkbox/checkbox.test.mjs +2 -2
- package/dist/components/checkbox/index.d.mts +5 -0
- package/dist/components/checkbox/index.d.ts +5 -0
- package/dist/components/icon/Icon.d.mts +513 -0
- package/dist/components/icon/index.d.mts +4 -0
- package/dist/components/icon/index.d.ts +4 -0
- package/dist/components/icon/template.d.mts +134 -0
- package/dist/components/input/index.d.mts +5 -0
- package/dist/components/input/index.d.ts +5 -0
- package/dist/components/input/input.d.mts +437 -0
- package/dist/components/input/input.test.d.mts +2 -0
- package/dist/components/input/input.test.js +50 -52
- package/dist/components/input/input.test.mjs +2 -2
- package/dist/components/list/index.d.mts +6 -0
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/{dropdown/dropdown.d.ts → list/list.d.mts} +9 -9
- package/dist/components/list/list.test.d.mts +2 -0
- package/dist/components/list/list.test.js +37 -39
- package/dist/components/list/list.test.mjs +1 -1
- package/dist/components/list/listItem.d.mts +183 -0
- package/dist/components/modal/index.d.mts +8 -0
- package/dist/components/modal/index.d.ts +8 -0
- package/dist/components/modal/modal.d.mts +214 -0
- package/dist/components/modal/modal.test.d.mts +2 -0
- package/dist/components/modal/modal.test.js +37 -39
- package/dist/components/modal/modal.test.mjs +1 -1
- package/dist/components/pagination/index.d.mts +4 -0
- package/dist/components/pagination/index.d.ts +4 -0
- package/dist/components/pagination/pagination.d.mts +186 -0
- package/dist/components/pagination/pagination.test.d.mts +2 -0
- package/dist/components/pagination/pagination.test.js +37 -39
- package/dist/components/pagination/pagination.test.mjs +1 -1
- package/dist/components/pagination/usePagination.d.mts +16 -0
- package/dist/components/progress/index.d.mts +5 -0
- package/dist/components/progress/index.d.ts +5 -0
- package/dist/components/progress/progress.d.mts +281 -0
- package/dist/components/progress/progress.test.d.mts +2 -0
- package/dist/components/progress/progress.test.d.ts +2 -0
- package/dist/components/progress/progress.test.js +37 -39
- package/dist/components/progress/progress.test.mjs +1 -1
- package/dist/components/radio/index.d.mts +5 -0
- package/dist/components/radio/index.d.ts +5 -0
- package/dist/components/radio/radio.d.mts +278 -0
- package/dist/components/radio/radio.test.d.mts +2 -0
- package/dist/components/radio/radio.test.js +37 -39
- package/dist/components/radio/radio.test.mjs +1 -1
- package/dist/components/select/index.d.mts +5 -0
- package/dist/components/select/index.d.ts +5 -0
- package/dist/components/select/index.mjs +2 -2
- package/dist/components/select/option.d.mts +18 -0
- package/dist/components/select/select.d.mts +449 -0
- package/dist/components/select/select.mjs +2 -2
- package/dist/components/select/select.test.d.mts +2 -0
- package/dist/components/select/select.test.js +37 -39
- package/dist/components/select/select.test.mjs +4 -4
- package/dist/components/select/useSelect.d.mts +32 -0
- package/dist/components/slider/index.d.mts +5 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/slider.d.mts +333 -0
- package/dist/components/slider/slider.test.d.mts +2 -0
- package/dist/components/slider/slider.test.d.ts +2 -0
- package/dist/components/slider/slider.test.js +37 -39
- package/dist/components/slider/slider.test.mjs +1 -1
- package/dist/components/switch/index.d.mts +5 -0
- package/dist/components/switch/index.d.ts +5 -0
- package/dist/components/switch/switch.d.mts +304 -0
- package/dist/components/switch/switch.test.d.mts +2 -0
- package/dist/components/switch/switch.test.d.ts +2 -0
- package/dist/components/switch/switch.test.js +37 -39
- package/dist/components/switch/switch.test.mjs +1 -1
- package/dist/components/table/index.d.mts +5 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/table/index.mjs +2 -2
- package/dist/components/table/table-body.d.mts +26 -0
- package/dist/components/table/table-head.d.mts +21 -0
- package/dist/components/table/table.d.mts +583 -0
- package/dist/components/table/table.mjs +2 -2
- package/dist/components/table/table.test.d.mts +2 -0
- package/dist/components/table/table.test.d.ts +2 -0
- package/dist/components/table/table.test.js +37 -39
- package/dist/components/table/table.test.mjs +3 -3
- package/dist/components/tabs/index.d.mts +5 -0
- package/dist/components/tabs/index.d.ts +5 -0
- package/dist/components/tabs/tabs.d.mts +241 -0
- package/dist/components/tabs/tabs.test.d.mts +2 -0
- package/dist/components/tabs/tabs.test.d.ts +2 -0
- package/dist/components/tabs/tabs.test.js +37 -39
- package/dist/components/tabs/tabs.test.mjs +2 -2
- package/dist/components/textarea/index.d.mts +2 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.mts +17 -0
- package/dist/components/textarea/textarea.test.d.mts +2 -0
- package/dist/components/textarea/textarea.test.d.ts +2 -0
- package/dist/components/textarea/textarea.test.js +50 -52
- package/dist/components/textarea/textarea.test.mjs +2 -2
- package/dist/components/toast/index.d.mts +9 -0
- package/dist/components/toast/index.d.ts +9 -0
- package/dist/components/toast/index.js +147 -127
- package/dist/components/toast/index.mjs +10 -5
- package/dist/components/toast/toast-utils.d.mts +9 -0
- package/dist/components/toast/toast-utils.d.ts +9 -0
- package/dist/components/toast/toast-utils.js +25 -45
- package/dist/components/toast/toast-utils.mjs +1 -1
- package/dist/components/toast/toast.d.mts +207 -0
- package/dist/components/toast/toast.d.ts +13 -10
- package/dist/components/toast/toast.js +32 -125
- package/dist/components/toast/toast.mjs +1 -3
- package/dist/components/toast/toast.test.d.mts +2 -0
- package/dist/components/toast/toast.test.d.ts +2 -0
- package/dist/components/toast/toast.test.js +73 -168
- package/dist/components/toast/toast.test.mjs +4 -6
- package/dist/components/toast/use-toast.d.mts +31 -0
- package/dist/components/toast/use-toast.d.ts +31 -0
- package/dist/components/toast/use-toast.js +3826 -0
- package/dist/components/toast/use-toast.mjs +17 -0
- package/dist/components/tooltip/index.d.mts +6 -0
- package/dist/components/tooltip/index.d.ts +6 -0
- package/dist/components/tooltip/tooltip-utils.d.mts +2 -0
- package/dist/components/tooltip/tooltip-utils.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.mts +143 -0
- package/dist/components/tooltip/tooltip.test.d.mts +2 -0
- package/dist/components/tooltip/tooltip.test.d.ts +2 -0
- package/dist/components/tooltip/tooltip.test.js +37 -39
- package/dist/components/tooltip/tooltip.test.mjs +1 -1
- package/dist/components/tooltip/useTooltip.d.mts +2 -0
- package/dist/components/tooltip/useTooltip.d.ts +2 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +249 -180
- package/dist/index.mjs +136 -36
- package/dist/tooltip-utils-DCKA5gnI.d.mts +30 -0
- package/dist/tooltip-utils-DCKA5gnI.d.ts +30 -0
- package/dist/utils/clsx.d.mts +3 -0
- package/dist/utils/props.d.mts +3 -0
- package/dist/utils/tailwind-variants.d.mts +26 -0
- package/dist/utils/types.d.mts +10 -0
- package/package.json +2 -2
- package/dist/chunk-5T5F5WVS.mjs +0 -32
- package/dist/chunk-LXPWTJ3F.mjs +0 -58
- package/dist/chunk-SDNTEP5C.mjs +0 -61
- package/dist/chunk-W7ABNK3K.mjs +0 -1
- package/dist/components/dropdown/dropdown.js +0 -122
- package/dist/components/dropdown/dropdown.mjs +0 -10
- package/dist/components/dropdown/dropdown.test.js +0 -12997
- package/dist/components/dropdown/dropdown.test.mjs +0 -25
- package/dist/components/dropdown/index.js +0 -128
- package/dist/components/dropdown/index.mjs +0 -11
- package/dist/components/toast/useToast.d.ts +0 -0
- package/dist/components/toast/useToast.js +0 -110
- package/dist/components/toast/useToast.mjs +0 -9
- package/dist/{chunk-RDEWIZV3.mjs → chunk-LUWGOKLG.mjs} +0 -0
- package/dist/{chunk-RTH3FPAS.mjs → chunk-PSXPOYLX.mjs} +3 -3
- package/dist/{chunk-463XE4SI.mjs → chunk-RVGOARET.mjs} +3 -3
- /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
|
-
});
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
table_body_default
|
|
4
|
-
} from "./chunk-LGELMZCN.mjs";
|
|
5
2
|
import {
|
|
6
3
|
table_head_default
|
|
7
4
|
} from "./chunk-PUFNT5LS.mjs";
|
|
5
|
+
import {
|
|
6
|
+
table_body_default
|
|
7
|
+
} from "./chunk-LGELMZCN.mjs";
|
|
8
8
|
import {
|
|
9
9
|
clsx
|
|
10
10
|
} from "./chunk-27Y6K5NK.mjs";
|
|
File without changes
|