@axtec/components 0.1.7 → 0.1.10
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/README.md +1 -0
- package/dist/components/AgentChat/AgentChat.d.ts +32 -0
- package/dist/components/AgentChat/index.d.ts +1 -0
- package/dist/components/AgentPanel/AgentPanel.d.ts +44 -0
- package/dist/components/AgentPanel/index.d.ts +1 -0
- package/dist/components/OptionDivider/OptionDivider.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.js +161 -157
- package/dist/index.js.map +1 -1
- package/dist/index10.js +77 -99
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +91 -36
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +97 -75
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +38 -24
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +76 -16
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +24 -38
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +18 -72
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +36 -47
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +73 -13
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +47 -151
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +12 -17
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +148 -40
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +18 -50
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +41 -74
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +46 -216
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +73 -46
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +212 -70
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +51 -23
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +74 -74
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +19 -28
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.js +62 -76
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +28 -55
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +87 -40
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +57 -45
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +40 -47
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +47 -27
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +52 -54
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +28 -49
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +54 -13
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +46 -79
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +13 -49
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +80 -17
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +48 -33
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +17 -11
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +34 -15
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +16 -89
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +15 -69
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +85 -116
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +69 -40
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +120 -42
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.js +39 -55
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +39 -11
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +53 -62
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +16 -54
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +64 -36
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +54 -66
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +37 -22
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +63 -101
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +16 -67
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +99 -213
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +1 -1
- package/dist/index60.js +67 -62
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +206 -224
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +62 -96
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +233 -33
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +98 -14
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +35 -59
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +16 -59
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +57 -72
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +58 -106
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +70 -43
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +157 -69
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +101 -40
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +44 -72
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +47 -53
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +70 -62
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +46 -28
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +67 -13
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +35 -2263
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +17 -0
- package/dist/index77.js.map +1 -0
- package/dist/index78.js +2267 -0
- package/dist/index78.js.map +1 -0
- package/dist/index8.js +377 -70
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +60 -77
- package/dist/index9.js.map +1 -1
- package/package.json +1 -1
package/dist/index47.js
CHANGED
|
@@ -1,125 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeftIcon as b, ChevronRightIcon as f } from "@heroicons/react/20/solid";
|
|
3
|
+
import { cn as c } from "./index3.js";
|
|
4
|
+
function p(i, t) {
|
|
5
|
+
return Array.from({ length: t - i + 1 }, (e, l) => i + l);
|
|
6
|
+
}
|
|
7
|
+
function u(i, t, e) {
|
|
8
|
+
const l = e * 2 + 5;
|
|
9
|
+
if (t <= l)
|
|
10
|
+
return p(1, t);
|
|
11
|
+
const o = Math.max(i - e, 1), r = Math.min(i + e, t), a = o > 2, d = r < t - 1;
|
|
12
|
+
return !a && d ? [...p(1, 3 + e * 2), "ellipsis", t] : a && !d ? [1, "ellipsis", ...p(t - (2 + e * 2), t)] : [1, "ellipsis", ...p(o, r), "ellipsis", t];
|
|
13
|
+
}
|
|
14
|
+
function R({
|
|
15
|
+
currentPage: i,
|
|
16
|
+
totalPages: t,
|
|
17
|
+
onPageChange: e,
|
|
18
|
+
siblingCount: l = 1,
|
|
19
|
+
className: o
|
|
20
|
+
}) {
|
|
21
|
+
const r = u(i, t, l);
|
|
22
|
+
if (t <= 1)
|
|
23
|
+
return null;
|
|
24
|
+
const a = () => {
|
|
25
|
+
i > 1 && e(i - 1);
|
|
26
|
+
}, d = () => {
|
|
27
|
+
i < t && e(i + 1);
|
|
26
28
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
+
return /* @__PURE__ */ m(
|
|
30
|
+
"nav",
|
|
29
31
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
"div",
|
|
37
|
-
{
|
|
38
|
-
className: v("grid", h[c], i),
|
|
39
|
-
style: { gap: `${u}px` },
|
|
40
|
-
children: t.map((o, s) => /* @__PURE__ */ e(
|
|
41
|
-
"div",
|
|
32
|
+
"aria-label": "Pagination",
|
|
33
|
+
className: c("flex items-center justify-center gap-1", o),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ s(
|
|
36
|
+
"button",
|
|
42
37
|
{
|
|
43
|
-
|
|
44
|
-
onClick:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
className: "w-full h-full object-cover"
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
},
|
|
54
|
-
o.id || o.url
|
|
55
|
-
))
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ n(
|
|
59
|
-
w,
|
|
60
|
-
{
|
|
61
|
-
open: l !== null,
|
|
62
|
-
onClose: () => r(null),
|
|
63
|
-
className: "relative z-50",
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black", "aria-hidden": "true" }),
|
|
66
|
-
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(N, { className: "relative w-full h-full flex items-center justify-center", children: [
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
"button",
|
|
69
|
-
{
|
|
70
|
-
onClick: () => r(null),
|
|
71
|
-
className: "absolute top-8 left-8 p-2 rounded-full bg-white hover:bg-slate-100 transition-colors z-10",
|
|
72
|
-
"aria-label": "Close preview",
|
|
73
|
-
children: /* @__PURE__ */ e(C, { className: "w-6 h-6 text-slate-700" })
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
a && /* @__PURE__ */ e(
|
|
77
|
-
"button",
|
|
78
|
-
{
|
|
79
|
-
onClick: b,
|
|
80
|
-
className: "absolute top-8 right-8 p-2 rounded-full bg-white hover:bg-red-50 transition-colors z-10",
|
|
81
|
-
"aria-label": "Delete image",
|
|
82
|
-
children: /* @__PURE__ */ e(y, { className: "w-6 h-6 text-red-500" })
|
|
83
|
-
}
|
|
38
|
+
type: "button",
|
|
39
|
+
onClick: a,
|
|
40
|
+
disabled: i === 1,
|
|
41
|
+
className: c(
|
|
42
|
+
"p-2 rounded-lg transition-colors duration-150",
|
|
43
|
+
"text-slate-500 hover:bg-slate-100 hover:text-slate-700",
|
|
44
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent"
|
|
84
45
|
),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
46
|
+
"aria-label": "Previous page",
|
|
47
|
+
children: /* @__PURE__ */ s(b, { className: "h-5 w-5" })
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
r.map((n, h) => n === "ellipsis" ? /* @__PURE__ */ s(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
className: "px-3 py-2 text-slate-400",
|
|
54
|
+
children: "..."
|
|
55
|
+
},
|
|
56
|
+
`ellipsis-${h}`
|
|
57
|
+
) : /* @__PURE__ */ s(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
type: "button",
|
|
61
|
+
onClick: () => e(n),
|
|
62
|
+
className: c(
|
|
63
|
+
"min-w-[40px] h-10 px-3 rounded-lg text-sm font-medium",
|
|
64
|
+
"transition-colors duration-150",
|
|
65
|
+
n === i ? "bg-primary-500 text-white" : "text-slate-700 hover:bg-slate-100"
|
|
102
66
|
),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
67
|
+
"aria-current": n === i ? "page" : void 0,
|
|
68
|
+
children: n
|
|
69
|
+
},
|
|
70
|
+
n
|
|
71
|
+
)),
|
|
72
|
+
/* @__PURE__ */ s(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: d,
|
|
77
|
+
disabled: i === t,
|
|
78
|
+
className: c(
|
|
79
|
+
"p-2 rounded-lg transition-colors duration-150",
|
|
80
|
+
"text-slate-500 hover:bg-slate-100 hover:text-slate-700",
|
|
81
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent"
|
|
110
82
|
),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
)
|
|
120
|
-
] });
|
|
121
|
-
};
|
|
83
|
+
"aria-label": "Next page",
|
|
84
|
+
children: /* @__PURE__ */ s(f, { className: "h-5 w-5" })
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
122
91
|
export {
|
|
123
|
-
|
|
92
|
+
R as Pagination
|
|
124
93
|
};
|
|
125
94
|
//# sourceMappingURL=index47.js.map
|
package/dist/index47.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index47.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index47.js","sources":["../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/20/solid'\nimport { cn } from '@/lib/utils'\n\nexport interface PaginationProps {\n currentPage: number\n totalPages: number\n onPageChange: (page: number) => void\n siblingCount?: number\n className?: string\n}\n\nfunction range(start: number, end: number): number[] {\n return Array.from({ length: end - start + 1 }, (_, i) => start + i)\n}\n\nfunction getPaginationRange(\n currentPage: number,\n totalPages: number,\n siblingCount: number\n): (number | 'ellipsis')[] {\n const totalPageNumbers = siblingCount * 2 + 5 // siblings + first + last + current + 2 ellipsis\n\n if (totalPages <= totalPageNumbers) {\n return range(1, totalPages)\n }\n\n const leftSiblingIndex = Math.max(currentPage - siblingCount, 1)\n const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages)\n\n const showLeftEllipsis = leftSiblingIndex > 2\n const showRightEllipsis = rightSiblingIndex < totalPages - 1\n\n if (!showLeftEllipsis && showRightEllipsis) {\n const leftRange = range(1, 3 + siblingCount * 2)\n return [...leftRange, 'ellipsis', totalPages]\n }\n\n if (showLeftEllipsis && !showRightEllipsis) {\n const rightRange = range(totalPages - (2 + siblingCount * 2), totalPages)\n return [1, 'ellipsis', ...rightRange]\n }\n\n const middleRange = range(leftSiblingIndex, rightSiblingIndex)\n return [1, 'ellipsis', ...middleRange, 'ellipsis', totalPages]\n}\n\nexport function Pagination({\n currentPage,\n totalPages,\n onPageChange,\n siblingCount = 1,\n className,\n}: PaginationProps) {\n const paginationRange = getPaginationRange(currentPage, totalPages, siblingCount)\n\n if (totalPages <= 1) {\n return null\n }\n\n const onPrevious = () => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1)\n }\n }\n\n const onNext = () => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1)\n }\n }\n\n return (\n <nav\n aria-label=\"Pagination\"\n className={cn('flex items-center justify-center gap-1', className)}\n >\n <button\n type=\"button\"\n onClick={onPrevious}\n disabled={currentPage === 1}\n className={cn(\n 'p-2 rounded-lg transition-colors duration-150',\n 'text-slate-500 hover:bg-slate-100 hover:text-slate-700',\n 'disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent'\n )}\n aria-label=\"Previous page\"\n >\n <ChevronLeftIcon className=\"h-5 w-5\" />\n </button>\n\n {paginationRange.map((page, index) => {\n if (page === 'ellipsis') {\n return (\n <span\n key={`ellipsis-${index}`}\n className=\"px-3 py-2 text-slate-400\"\n >\n ...\n </span>\n )\n }\n\n return (\n <button\n key={page}\n type=\"button\"\n onClick={() => onPageChange(page)}\n className={cn(\n 'min-w-[40px] h-10 px-3 rounded-lg text-sm font-medium',\n 'transition-colors duration-150',\n page === currentPage\n ? 'bg-primary-500 text-white'\n : 'text-slate-700 hover:bg-slate-100'\n )}\n aria-current={page === currentPage ? 'page' : undefined}\n >\n {page}\n </button>\n )\n })}\n\n <button\n type=\"button\"\n onClick={onNext}\n disabled={currentPage === totalPages}\n className={cn(\n 'p-2 rounded-lg transition-colors duration-150',\n 'text-slate-500 hover:bg-slate-100 hover:text-slate-700',\n 'disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent'\n )}\n aria-label=\"Next page\"\n >\n <ChevronRightIcon className=\"h-5 w-5\" />\n </button>\n </nav>\n )\n}\n"],"names":["range","start","end","_","i","getPaginationRange","currentPage","totalPages","siblingCount","totalPageNumbers","leftSiblingIndex","rightSiblingIndex","showLeftEllipsis","showRightEllipsis","Pagination","onPageChange","className","paginationRange","onPrevious","onNext","jsxs","cn","jsx","ChevronLeftIcon","page","index","ChevronRightIcon"],"mappings":";;;AAWA,SAASA,EAAMC,GAAeC,GAAuB;AACnD,SAAO,MAAM,KAAK,EAAE,QAAQA,IAAMD,IAAQ,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AACpE;AAEA,SAASC,EACPC,GACAC,GACAC,GACyB;AACzB,QAAMC,IAAmBD,IAAe,IAAI;AAE5C,MAAID,KAAcE;AAChB,WAAOT,EAAM,GAAGO,CAAU;AAG5B,QAAMG,IAAmB,KAAK,IAAIJ,IAAcE,GAAc,CAAC,GACzDG,IAAoB,KAAK,IAAIL,IAAcE,GAAcD,CAAU,GAEnEK,IAAmBF,IAAmB,GACtCG,IAAoBF,IAAoBJ,IAAa;AAE3D,SAAI,CAACK,KAAoBC,IAEhB,CAAC,GADUb,EAAM,GAAG,IAAIQ,IAAe,CAAC,GACzB,YAAYD,CAAU,IAG1CK,KAAoB,CAACC,IAEhB,CAAC,GAAG,YAAY,GADJb,EAAMO,KAAc,IAAIC,IAAe,IAAID,CAAU,CACpC,IAI/B,CAAC,GAAG,YAAY,GADHP,EAAMU,GAAkBC,CAAiB,GACtB,YAAYJ,CAAU;AAC/D;AAEO,SAASO,EAAW;AAAA,EACzB,aAAAR;AAAA,EACA,YAAAC;AAAA,EACA,cAAAQ;AAAA,EACA,cAAAP,IAAe;AAAA,EACf,WAAAQ;AACF,GAAoB;AAClB,QAAMC,IAAkBZ,EAAmBC,GAAaC,GAAYC,CAAY;AAEhF,MAAID,KAAc;AAChB,WAAO;AAGT,QAAMW,IAAa,MAAM;AACvB,IAAIZ,IAAc,KAChBS,EAAaT,IAAc,CAAC;AAAA,EAEhC,GAEMa,IAAS,MAAM;AACnB,IAAIb,IAAcC,KAChBQ,EAAaT,IAAc,CAAC;AAAA,EAEhC;AAEA,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAW;AAAA,MACX,WAAWC,EAAG,0CAA0CL,CAAS;AAAA,MAEjE,UAAA;AAAA,QAAA,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAASJ;AAAA,YACT,UAAUZ,MAAgB;AAAA,YAC1B,WAAWe;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAEF,cAAW;AAAA,YAEX,UAAA,gBAAAC,EAACC,GAAA,EAAgB,WAAU,UAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAGtCN,EAAgB,IAAI,CAACO,GAAMC,MACtBD,MAAS,aAET,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,UAFM,YAAYG,CAAK;AAAA,QAAA,IAS1B,gBAAAH;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,MAAK;AAAA,YACL,SAAS,MAAMP,EAAaS,CAAI;AAAA,YAChC,WAAWH;AAAA,cACT;AAAA,cACA;AAAA,cACAG,MAASlB,IACL,8BACA;AAAA,YAAA;AAAA,YAEN,gBAAckB,MAASlB,IAAc,SAAS;AAAA,YAE7C,UAAAkB;AAAA,UAAA;AAAA,UAZIA;AAAA,QAAA,CAeV;AAAA,QAED,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAASH;AAAA,YACT,UAAUb,MAAgBC;AAAA,YAC1B,WAAWc;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,YAEF,cAAW;AAAA,YAEX,UAAA,gBAAAC,EAACI,GAAA,EAAiB,WAAU,UAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACxC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/index48.js
CHANGED
|
@@ -1,43 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "./index3.js";
|
|
3
|
+
const i = ({ children: e, className: t }) => /* @__PURE__ */ r(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
className: n(
|
|
7
|
+
"border border-slate-200 rounded-2xl p-6 bg-white relative",
|
|
8
|
+
t
|
|
9
|
+
),
|
|
10
|
+
children: e
|
|
11
|
+
}
|
|
12
|
+
), m = ({ children: e, className: t }) => /* @__PURE__ */ r(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: n(
|
|
16
|
+
"flex justify-between items-center mb-5",
|
|
17
|
+
t
|
|
18
|
+
),
|
|
19
|
+
children: e
|
|
20
|
+
}
|
|
21
|
+
), d = ({ children: e, badge: t, className: s }) => /* @__PURE__ */ a("div", { className: n("flex items-center gap-3", s), children: [
|
|
22
|
+
/* @__PURE__ */ r("h2", { className: "text-lg font-semibold text-primary-500 m-0", children: e }),
|
|
23
|
+
t
|
|
24
|
+
] }), p = ({ children: e, onClick: t, disabled: s, className: o }) => /* @__PURE__ */ r(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
type: "button",
|
|
28
|
+
onClick: t,
|
|
29
|
+
disabled: s,
|
|
30
|
+
className: n(
|
|
31
|
+
"bg-transparent border-none p-0",
|
|
32
|
+
"flex items-center gap-1.5",
|
|
33
|
+
"cursor-pointer text-primary-500",
|
|
34
|
+
"text-sm font-semibold",
|
|
35
|
+
"transition-opacity hover:opacity-70",
|
|
36
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
37
|
+
o
|
|
38
|
+
),
|
|
39
|
+
children: e
|
|
40
|
+
}
|
|
41
|
+
), x = ({ children: e, className: t }) => /* @__PURE__ */ r("div", { className: t, children: e }), b = ({ children: e, className: t }) => /* @__PURE__ */ r(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: n(
|
|
45
|
+
"border-t border-slate-100 pt-3 mt-4 text-center",
|
|
46
|
+
t
|
|
47
|
+
),
|
|
48
|
+
children: e
|
|
49
|
+
}
|
|
50
|
+
), u = ({ message: e, action: t, className: s }) => /* @__PURE__ */ a(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: n(
|
|
54
|
+
"flex flex-col items-center justify-center py-8 text-center",
|
|
55
|
+
s
|
|
56
|
+
),
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ r("p", { className: "text-sm text-slate-500 mb-4", children: e }),
|
|
59
|
+
t
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
40
63
|
export {
|
|
41
|
-
|
|
64
|
+
i as Panel,
|
|
65
|
+
p as PanelAction,
|
|
66
|
+
x as PanelBody,
|
|
67
|
+
u as PanelEmptyState,
|
|
68
|
+
b as PanelFooter,
|
|
69
|
+
m as PanelHeader,
|
|
70
|
+
d as PanelTitle
|
|
42
71
|
};
|
|
43
72
|
//# sourceMappingURL=index48.js.map
|
package/dist/index48.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index48.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index48.js","sources":["../src/components/Panel/Panel.tsx"],"sourcesContent":["import { type ReactNode } from 'react'\nimport { cn } from '@/lib/utils'\n\nexport interface PanelProps {\n children: ReactNode\n className?: string\n}\n\nexport const Panel = ({ children, className }: PanelProps) => {\n return (\n <div\n className={cn(\n 'border border-slate-200 rounded-2xl p-6 bg-white relative',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport interface PanelHeaderProps {\n children: ReactNode\n className?: string\n}\n\nexport const PanelHeader = ({ children, className }: PanelHeaderProps) => {\n return (\n <div\n className={cn(\n 'flex justify-between items-center mb-5',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport interface PanelTitleProps {\n children: ReactNode\n badge?: ReactNode\n className?: string\n}\n\nexport const PanelTitle = ({ children, badge, className }: PanelTitleProps) => {\n return (\n <div className={cn('flex items-center gap-3', className)}>\n <h2 className=\"text-lg font-semibold text-primary-500 m-0\">\n {children}\n </h2>\n {badge}\n </div>\n )\n}\n\nexport interface PanelActionProps {\n children: ReactNode\n onClick?: () => void\n disabled?: boolean\n className?: string\n}\n\nexport const PanelAction = ({ children, onClick, disabled, className }: PanelActionProps) => {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={cn(\n 'bg-transparent border-none p-0',\n 'flex items-center gap-1.5',\n 'cursor-pointer text-primary-500',\n 'text-sm font-semibold',\n 'transition-opacity hover:opacity-70',\n 'disabled:opacity-40 disabled:cursor-not-allowed',\n className\n )}\n >\n {children}\n </button>\n )\n}\n\nexport interface PanelBodyProps {\n children: ReactNode\n className?: string\n}\n\nexport const PanelBody = ({ children, className }: PanelBodyProps) => {\n return (\n <div className={className}>\n {children}\n </div>\n )\n}\n\nexport interface PanelFooterProps {\n children: ReactNode\n className?: string\n}\n\nexport const PanelFooter = ({ children, className }: PanelFooterProps) => {\n return (\n <div\n className={cn(\n 'border-t border-slate-100 pt-3 mt-4 text-center',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport interface PanelEmptyStateProps {\n message: string\n action?: ReactNode\n className?: string\n}\n\nexport const PanelEmptyState = ({ message, action, className }: PanelEmptyStateProps) => {\n return (\n <div\n className={cn(\n 'flex flex-col items-center justify-center py-8 text-center',\n className\n )}\n >\n <p className=\"text-sm text-slate-500 mb-4\">{message}</p>\n {action}\n </div>\n )\n}\n"],"names":["Panel","children","className","jsx","cn","PanelHeader","PanelTitle","badge","PanelAction","onClick","disabled","PanelBody","PanelFooter","PanelEmptyState","message","action","jsxs"],"mappings":";;AAQO,MAAMA,IAAQ,CAAC,EAAE,UAAAC,GAAU,WAAAC,QAE9B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAF;AAAA,IAAA;AAAA,IAGD,UAAAD;AAAA,EAAA;AAAA,GAUMI,IAAc,CAAC,EAAE,UAAAJ,GAAU,WAAAC,QAEpC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAF;AAAA,IAAA;AAAA,IAGD,UAAAD;AAAA,EAAA;AAAA,GAWMK,IAAa,CAAC,EAAE,UAAAL,GAAU,OAAAM,GAAO,WAAAL,0BAEzC,OAAA,EAAI,WAAWE,EAAG,2BAA2BF,CAAS,GACrD,UAAA;AAAA,EAAA,gBAAAC,EAAC,MAAA,EAAG,WAAU,8CACX,UAAAF,EAAA,CACH;AAAA,EACCM;AAAA,GACH,GAWSC,IAAc,CAAC,EAAE,UAAAP,GAAU,SAAAQ,GAAS,UAAAC,GAAU,WAAAR,QAEvD,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAAM;AAAA,IACA,UAAAC;AAAA,IACA,WAAWN;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAF;AAAA,IAAA;AAAA,IAGD,UAAAD;AAAA,EAAA;AAAA,GAUMU,IAAY,CAAC,EAAE,UAAAV,GAAU,WAAAC,QAElC,gBAAAC,EAAC,OAAA,EAAI,WAAAD,GACF,UAAAD,EAAA,CACH,GASSW,IAAc,CAAC,EAAE,UAAAX,GAAU,WAAAC,QAEpC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAF;AAAA,IAAA;AAAA,IAGD,UAAAD;AAAA,EAAA;AAAA,GAWMY,IAAkB,CAAC,EAAE,SAAAC,GAAS,QAAAC,GAAQ,WAAAb,QAE/C,gBAAAc;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWZ;AAAA,MACT;AAAA,MACAF;AAAA,IAAA;AAAA,IAGF,UAAA;AAAA,MAAA,gBAAAC,EAAC,KAAA,EAAE,WAAU,+BAA+B,UAAAW,GAAQ;AAAA,MACnDC;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
package/dist/index49.js
CHANGED
|
@@ -1,47 +1,125 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { cn as v } from "./index3.js";
|
|
4
|
+
import { EmptyData as x } from "./index29.js";
|
|
5
|
+
import { Dialog as w, DialogPanel as N } from "@headlessui/react";
|
|
6
|
+
import { XMarkIcon as C, TrashIcon as y, ChevronLeftIcon as k, ChevronRightIcon as I } from "@heroicons/react/24/outline";
|
|
7
|
+
const T = ({
|
|
8
|
+
images: t,
|
|
9
|
+
columns: c = 4,
|
|
10
|
+
gap: u = 16,
|
|
11
|
+
emptyMessage: d = "To add images, upload them directly or import from another source.",
|
|
12
|
+
onDelete: a,
|
|
11
13
|
className: i
|
|
12
|
-
}) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
}) => {
|
|
15
|
+
const [l, r] = g(null), h = {
|
|
16
|
+
3: "grid-cols-3",
|
|
17
|
+
4: "grid-cols-4",
|
|
18
|
+
5: "grid-cols-5",
|
|
19
|
+
6: "grid-cols-6"
|
|
20
|
+
}, m = () => {
|
|
21
|
+
l !== null && l > 0 && r(l - 1);
|
|
22
|
+
}, f = () => {
|
|
23
|
+
l !== null && l < t.length - 1 && r(l + 1);
|
|
24
|
+
}, b = () => {
|
|
25
|
+
l !== null && a && (a(t[l], l), t.length === 1 ? r(null) : l >= t.length - 1 && r(t.length - 2));
|
|
26
|
+
};
|
|
27
|
+
return t.length === 0 ? /* @__PURE__ */ e(
|
|
28
|
+
x,
|
|
29
|
+
{
|
|
30
|
+
fullBlock: !0,
|
|
31
|
+
message: d,
|
|
32
|
+
className: i
|
|
33
|
+
}
|
|
34
|
+
) : /* @__PURE__ */ n(p, { children: [
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: v("grid", h[c], i),
|
|
39
|
+
style: { gap: `${u}px` },
|
|
40
|
+
children: t.map((o, s) => /* @__PURE__ */ e(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: "aspect-square rounded-lg overflow-hidden cursor-pointer bg-slate-200 hover:opacity-90 transition-opacity",
|
|
44
|
+
onClick: () => r(s),
|
|
45
|
+
children: /* @__PURE__ */ e(
|
|
46
|
+
"img",
|
|
47
|
+
{
|
|
48
|
+
src: o.url,
|
|
49
|
+
alt: o.alt || `Image ${s + 1}`,
|
|
50
|
+
className: "w-full h-full object-cover"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
},
|
|
54
|
+
o.id || o.url
|
|
55
|
+
))
|
|
56
|
+
}
|
|
19
57
|
),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
/* @__PURE__ */ n(
|
|
59
|
+
w,
|
|
60
|
+
{
|
|
61
|
+
open: l !== null,
|
|
62
|
+
onClose: () => r(null),
|
|
63
|
+
className: "relative z-50",
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black", "aria-hidden": "true" }),
|
|
66
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(N, { className: "relative w-full h-full flex items-center justify-center", children: [
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
onClick: () => r(null),
|
|
71
|
+
className: "absolute top-8 left-8 p-2 rounded-full bg-white hover:bg-slate-100 transition-colors z-10",
|
|
72
|
+
"aria-label": "Close preview",
|
|
73
|
+
children: /* @__PURE__ */ e(C, { className: "w-6 h-6 text-slate-700" })
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
a && /* @__PURE__ */ e(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
onClick: b,
|
|
80
|
+
className: "absolute top-8 right-8 p-2 rounded-full bg-white hover:bg-red-50 transition-colors z-10",
|
|
81
|
+
"aria-label": "Delete image",
|
|
82
|
+
children: /* @__PURE__ */ e(y, { className: "w-6 h-6 text-red-500" })
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
l !== null && l > 0 && /* @__PURE__ */ e(
|
|
86
|
+
"button",
|
|
87
|
+
{
|
|
88
|
+
onClick: m,
|
|
89
|
+
className: "absolute left-8 p-3 rounded-full bg-white/80 hover:bg-white transition-colors z-10",
|
|
90
|
+
"aria-label": "Previous image",
|
|
91
|
+
children: /* @__PURE__ */ e(k, { className: "w-6 h-6 text-slate-700" })
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
l !== null && l < t.length - 1 && /* @__PURE__ */ e(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
onClick: f,
|
|
98
|
+
className: "absolute right-8 p-3 rounded-full bg-white/80 hover:bg-white transition-colors z-10",
|
|
99
|
+
"aria-label": "Next image",
|
|
100
|
+
children: /* @__PURE__ */ e(I, { className: "w-6 h-6 text-slate-700" })
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
l !== null && /* @__PURE__ */ e(
|
|
104
|
+
"img",
|
|
105
|
+
{
|
|
106
|
+
src: t[l].url,
|
|
107
|
+
alt: t[l].alt || `Image ${l + 1}`,
|
|
108
|
+
className: "max-w-full max-h-full object-contain"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
l !== null && /* @__PURE__ */ n("div", { className: "absolute bottom-8 left-1/2 -translate-x-1/2 px-4 py-2 rounded-full bg-white/80 text-sm font-medium", children: [
|
|
112
|
+
l + 1,
|
|
113
|
+
" / ",
|
|
114
|
+
t.length
|
|
115
|
+
] })
|
|
116
|
+
] }) })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] });
|
|
121
|
+
};
|
|
44
122
|
export {
|
|
45
|
-
|
|
123
|
+
T as PhotoLibrary
|
|
46
124
|
};
|
|
47
125
|
//# sourceMappingURL=index49.js.map
|