@axtec/components 0.1.8 → 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.
Files changed (157) hide show
  1. package/README.md +1 -0
  2. package/dist/components/AgentChat/AgentChat.d.ts +32 -0
  3. package/dist/components/AgentChat/index.d.ts +1 -0
  4. package/dist/components/AgentPanel/AgentPanel.d.ts +44 -0
  5. package/dist/components/AgentPanel/index.d.ts +1 -0
  6. package/dist/components/index.d.ts +2 -0
  7. package/dist/index.css +1 -1
  8. package/dist/index.js +161 -157
  9. package/dist/index.js.map +1 -1
  10. package/dist/index10.js +77 -99
  11. package/dist/index10.js.map +1 -1
  12. package/dist/index11.js +91 -36
  13. package/dist/index11.js.map +1 -1
  14. package/dist/index12.js +97 -75
  15. package/dist/index12.js.map +1 -1
  16. package/dist/index13.js +38 -24
  17. package/dist/index13.js.map +1 -1
  18. package/dist/index14.js +76 -16
  19. package/dist/index14.js.map +1 -1
  20. package/dist/index15.js +24 -38
  21. package/dist/index15.js.map +1 -1
  22. package/dist/index16.js +18 -72
  23. package/dist/index16.js.map +1 -1
  24. package/dist/index17.js +36 -47
  25. package/dist/index17.js.map +1 -1
  26. package/dist/index18.js +73 -13
  27. package/dist/index18.js.map +1 -1
  28. package/dist/index19.js +47 -151
  29. package/dist/index19.js.map +1 -1
  30. package/dist/index20.js +12 -17
  31. package/dist/index20.js.map +1 -1
  32. package/dist/index21.js +148 -40
  33. package/dist/index21.js.map +1 -1
  34. package/dist/index22.js +18 -50
  35. package/dist/index22.js.map +1 -1
  36. package/dist/index23.js +41 -74
  37. package/dist/index23.js.map +1 -1
  38. package/dist/index24.js +46 -216
  39. package/dist/index24.js.map +1 -1
  40. package/dist/index25.js +73 -46
  41. package/dist/index25.js.map +1 -1
  42. package/dist/index26.js +212 -70
  43. package/dist/index26.js.map +1 -1
  44. package/dist/index27.js +51 -23
  45. package/dist/index27.js.map +1 -1
  46. package/dist/index28.js +74 -74
  47. package/dist/index28.js.map +1 -1
  48. package/dist/index29.js +19 -28
  49. package/dist/index29.js.map +1 -1
  50. package/dist/index3.js +2 -2
  51. package/dist/index30.js +62 -76
  52. package/dist/index30.js.map +1 -1
  53. package/dist/index31.js +28 -55
  54. package/dist/index31.js.map +1 -1
  55. package/dist/index32.js +87 -40
  56. package/dist/index32.js.map +1 -1
  57. package/dist/index33.js +57 -45
  58. package/dist/index33.js.map +1 -1
  59. package/dist/index34.js +40 -47
  60. package/dist/index34.js.map +1 -1
  61. package/dist/index35.js +47 -27
  62. package/dist/index35.js.map +1 -1
  63. package/dist/index36.js +52 -54
  64. package/dist/index36.js.map +1 -1
  65. package/dist/index37.js +28 -49
  66. package/dist/index37.js.map +1 -1
  67. package/dist/index38.js +54 -13
  68. package/dist/index38.js.map +1 -1
  69. package/dist/index39.js +46 -79
  70. package/dist/index39.js.map +1 -1
  71. package/dist/index40.js +13 -49
  72. package/dist/index40.js.map +1 -1
  73. package/dist/index41.js +80 -17
  74. package/dist/index41.js.map +1 -1
  75. package/dist/index42.js +48 -33
  76. package/dist/index42.js.map +1 -1
  77. package/dist/index43.js +18 -17
  78. package/dist/index43.js.map +1 -1
  79. package/dist/index44.js +34 -15
  80. package/dist/index44.js.map +1 -1
  81. package/dist/index45.js +16 -89
  82. package/dist/index45.js.map +1 -1
  83. package/dist/index46.js +15 -69
  84. package/dist/index46.js.map +1 -1
  85. package/dist/index47.js +85 -116
  86. package/dist/index47.js.map +1 -1
  87. package/dist/index48.js +69 -40
  88. package/dist/index48.js.map +1 -1
  89. package/dist/index49.js +120 -42
  90. package/dist/index49.js.map +1 -1
  91. package/dist/index5.js +1 -1
  92. package/dist/index50.js +39 -55
  93. package/dist/index50.js.map +1 -1
  94. package/dist/index51.js +39 -11
  95. package/dist/index51.js.map +1 -1
  96. package/dist/index52.js +53 -62
  97. package/dist/index52.js.map +1 -1
  98. package/dist/index53.js +16 -54
  99. package/dist/index53.js.map +1 -1
  100. package/dist/index54.js +64 -36
  101. package/dist/index54.js.map +1 -1
  102. package/dist/index55.js +54 -66
  103. package/dist/index55.js.map +1 -1
  104. package/dist/index56.js +37 -22
  105. package/dist/index56.js.map +1 -1
  106. package/dist/index57.js +63 -101
  107. package/dist/index57.js.map +1 -1
  108. package/dist/index58.js +16 -67
  109. package/dist/index58.js.map +1 -1
  110. package/dist/index59.js +99 -213
  111. package/dist/index59.js.map +1 -1
  112. package/dist/index6.js +1 -1
  113. package/dist/index60.js +67 -62
  114. package/dist/index60.js.map +1 -1
  115. package/dist/index61.js +206 -224
  116. package/dist/index61.js.map +1 -1
  117. package/dist/index62.js +62 -96
  118. package/dist/index62.js.map +1 -1
  119. package/dist/index63.js +233 -33
  120. package/dist/index63.js.map +1 -1
  121. package/dist/index64.js +98 -14
  122. package/dist/index64.js.map +1 -1
  123. package/dist/index65.js +35 -59
  124. package/dist/index65.js.map +1 -1
  125. package/dist/index66.js +16 -59
  126. package/dist/index66.js.map +1 -1
  127. package/dist/index67.js +57 -72
  128. package/dist/index67.js.map +1 -1
  129. package/dist/index68.js +58 -106
  130. package/dist/index68.js.map +1 -1
  131. package/dist/index69.js +70 -43
  132. package/dist/index69.js.map +1 -1
  133. package/dist/index7.js +157 -69
  134. package/dist/index7.js.map +1 -1
  135. package/dist/index70.js +101 -40
  136. package/dist/index70.js.map +1 -1
  137. package/dist/index71.js +44 -72
  138. package/dist/index71.js.map +1 -1
  139. package/dist/index72.js +47 -53
  140. package/dist/index72.js.map +1 -1
  141. package/dist/index73.js +70 -62
  142. package/dist/index73.js.map +1 -1
  143. package/dist/index74.js +46 -28
  144. package/dist/index74.js.map +1 -1
  145. package/dist/index75.js +67 -13
  146. package/dist/index75.js.map +1 -1
  147. package/dist/index76.js +35 -2263
  148. package/dist/index76.js.map +1 -1
  149. package/dist/index77.js +17 -0
  150. package/dist/index77.js.map +1 -0
  151. package/dist/index78.js +2267 -0
  152. package/dist/index78.js.map +1 -0
  153. package/dist/index8.js +377 -70
  154. package/dist/index8.js.map +1 -1
  155. package/dist/index9.js +60 -77
  156. package/dist/index9.js.map +1 -1
  157. package/package.json +1 -1
package/dist/index47.js CHANGED
@@ -1,125 +1,94 @@
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 "./index27.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,
13
- className: i
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));
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 t.length === 0 ? /* @__PURE__ */ e(
28
- x,
29
+ return /* @__PURE__ */ m(
30
+ "nav",
29
31
  {
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",
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
- 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
- }
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
- 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
- }
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
- 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
- }
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
- 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
- };
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
- T as PhotoLibrary
92
+ R as Pagination
124
93
  };
125
94
  //# sourceMappingURL=index47.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index47.js","sources":["../src/components/PhotoLibrary/PhotoLibrary.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { cn } from '@/lib/utils'\nimport { EmptyData } from '../EmptyData/EmptyData'\nimport { Dialog, DialogPanel } from '@headlessui/react'\nimport { XMarkIcon, ChevronLeftIcon, ChevronRightIcon, TrashIcon } from '@heroicons/react/24/outline'\n\nexport interface PhotoLibraryImage {\n url: string\n alt?: string\n id?: string\n}\n\nexport interface PhotoLibraryProps {\n images: PhotoLibraryImage[]\n columns?: 3 | 4 | 5 | 6\n gap?: number\n emptyMessage?: string\n onDelete?: (image: PhotoLibraryImage, index: number) => void\n className?: string\n}\n\nexport const PhotoLibrary = ({\n images,\n columns = 4,\n gap = 16,\n emptyMessage = 'To add images, upload them directly or import from another source.',\n onDelete,\n className,\n}: PhotoLibraryProps) => {\n const [previewIndex, setPreviewIndex] = useState<number | null>(null)\n\n const columnClasses = {\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n 5: 'grid-cols-5',\n 6: 'grid-cols-6',\n }\n\n const handlePrevious = () => {\n if (previewIndex !== null && previewIndex > 0) {\n setPreviewIndex(previewIndex - 1)\n }\n }\n\n const handleNext = () => {\n if (previewIndex !== null && previewIndex < images.length - 1) {\n setPreviewIndex(previewIndex + 1)\n }\n }\n\n const handleDelete = () => {\n if (previewIndex !== null && onDelete) {\n onDelete(images[previewIndex], previewIndex)\n if (images.length === 1) {\n setPreviewIndex(null)\n } else if (previewIndex >= images.length - 1) {\n setPreviewIndex(images.length - 2)\n }\n }\n }\n\n if (images.length === 0) {\n return (\n <EmptyData\n fullBlock\n message={emptyMessage}\n className={className}\n />\n )\n }\n\n return (\n <>\n <div\n className={cn('grid', columnClasses[columns], className)}\n style={{ gap: `${gap}px` }}\n >\n {images.map((image, index) => (\n <div\n key={image.id || image.url}\n className=\"aspect-square rounded-lg overflow-hidden cursor-pointer bg-slate-200 hover:opacity-90 transition-opacity\"\n onClick={() => setPreviewIndex(index)}\n >\n <img\n src={image.url}\n alt={image.alt || `Image ${index + 1}`}\n className=\"w-full h-full object-cover\"\n />\n </div>\n ))}\n </div>\n\n {/* Preview Modal */}\n <Dialog\n open={previewIndex !== null}\n onClose={() => setPreviewIndex(null)}\n className=\"relative z-50\"\n >\n <div className=\"fixed inset-0 bg-black\" aria-hidden=\"true\" />\n\n <div className=\"fixed inset-0 flex items-center justify-center\">\n <DialogPanel className=\"relative w-full h-full flex items-center justify-center\">\n {/* Close button */}\n <button\n onClick={() => setPreviewIndex(null)}\n className=\"absolute top-8 left-8 p-2 rounded-full bg-white hover:bg-slate-100 transition-colors z-10\"\n aria-label=\"Close preview\"\n >\n <XMarkIcon className=\"w-6 h-6 text-slate-700\" />\n </button>\n\n {/* Delete button */}\n {onDelete && (\n <button\n onClick={handleDelete}\n className=\"absolute top-8 right-8 p-2 rounded-full bg-white hover:bg-red-50 transition-colors z-10\"\n aria-label=\"Delete image\"\n >\n <TrashIcon className=\"w-6 h-6 text-red-500\" />\n </button>\n )}\n\n {/* Navigation */}\n {previewIndex !== null && previewIndex > 0 && (\n <button\n onClick={handlePrevious}\n className=\"absolute left-8 p-3 rounded-full bg-white/80 hover:bg-white transition-colors z-10\"\n aria-label=\"Previous image\"\n >\n <ChevronLeftIcon className=\"w-6 h-6 text-slate-700\" />\n </button>\n )}\n\n {previewIndex !== null && previewIndex < images.length - 1 && (\n <button\n onClick={handleNext}\n className=\"absolute right-8 p-3 rounded-full bg-white/80 hover:bg-white transition-colors z-10\"\n aria-label=\"Next image\"\n >\n <ChevronRightIcon className=\"w-6 h-6 text-slate-700\" />\n </button>\n )}\n\n {/* Image */}\n {previewIndex !== null && (\n <img\n src={images[previewIndex].url}\n alt={images[previewIndex].alt || `Image ${previewIndex + 1}`}\n className=\"max-w-full max-h-full object-contain\"\n />\n )}\n\n {/* Counter */}\n {previewIndex !== null && (\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\">\n {previewIndex + 1} / {images.length}\n </div>\n )}\n </DialogPanel>\n </div>\n </Dialog>\n </>\n )\n}\n"],"names":["PhotoLibrary","images","columns","gap","emptyMessage","onDelete","className","previewIndex","setPreviewIndex","useState","columnClasses","handlePrevious","handleNext","handleDelete","jsx","EmptyData","jsxs","Fragment","cn","image","index","Dialog","DialogPanel","XMarkIcon","TrashIcon","ChevronLeftIcon","ChevronRightIcon"],"mappings":";;;;;;AAqBO,MAAMA,IAAe,CAAC;AAAA,EAC3B,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,KAAAC,IAAM;AAAA,EACN,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,WAAAC;AACF,MAAyB;AACvB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAwB,IAAI,GAE9DC,IAAgB;AAAA,IACpB,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GA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AASA,IAAe,CAAC;AAAA,gBAC1D,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YAKbA,MAAiB,QAChB,gBAAAS,EAAC,OAAA,EAAI,WAAU,sGACZ,UAAA;AAAA,cAAAT,IAAe;AAAA,cAAE;AAAA,cAAIN,EAAO;AAAA,YAAA,EAAA,CAC/B;AAAA,UAAA,EAAA,CAEJ,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
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","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G,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 m } from "react/jsx-runtime";
2
- import { cn as o } from "./index3.js";
3
- const p = {
4
- default: "bg-slate-100 text-slate-700",
5
- primary: "bg-primary-500 text-white",
6
- success: "bg-green-100 text-green-700",
7
- warning: "bg-amber-100 text-amber-700",
8
- danger: "bg-red-100 text-red-700",
9
- info: "bg-blue-100 text-blue-700"
10
- }, x = {
11
- sm: "px-2 py-0.5 text-xs",
12
- md: "px-2.5 py-1 text-sm",
13
- lg: "px-3 py-1.5 text-base"
14
- }, y = ({
15
- label: n,
16
- variant: i = "default",
17
- size: a = "md",
18
- className: l,
19
- onClick: e,
20
- backgroundColor: t,
21
- textColor: r
22
- }) => {
23
- const s = t || r ? { backgroundColor: t, color: r } : void 0;
24
- return /* @__PURE__ */ m(
25
- "span",
26
- {
27
- onClick: e,
28
- className: o(
29
- "inline-flex items-center rounded-full font-medium whitespace-nowrap",
30
- !s && p[i],
31
- x[a],
32
- e && "cursor-pointer hover:opacity-80 transition-opacity",
33
- l
34
- ),
35
- style: s,
36
- children: n
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
- y as Pill
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
@@ -1 +1 @@
1
- {"version":3,"file":"index48.js","sources":["../src/components/Pill/Pill.tsx"],"sourcesContent":["import { type ReactNode } from 'react'\nimport { cn } from '@/lib/utils'\n\nexport interface PillProps {\n label: ReactNode\n variant?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info'\n size?: 'sm' | 'md' | 'lg'\n className?: string\n onClick?: (event: React.MouseEvent) => void\n backgroundColor?: string\n textColor?: string\n}\n\nconst variantStyles = {\n default: 'bg-slate-100 text-slate-700',\n primary: 'bg-primary-500 text-white',\n success: 'bg-green-100 text-green-700',\n warning: 'bg-amber-100 text-amber-700',\n danger: 'bg-red-100 text-red-700',\n info: 'bg-blue-100 text-blue-700',\n}\n\nconst sizeStyles = {\n sm: 'px-2 py-0.5 text-xs',\n md: 'px-2.5 py-1 text-sm',\n lg: 'px-3 py-1.5 text-base',\n}\n\nexport const Pill = ({\n label,\n variant = 'default',\n size = 'md',\n className,\n onClick,\n backgroundColor,\n textColor,\n}: PillProps) => {\n const customStyles = backgroundColor || textColor\n ? { backgroundColor, color: textColor }\n : undefined\n\n return (\n <span\n onClick={onClick}\n className={cn(\n 'inline-flex items-center rounded-full font-medium whitespace-nowrap',\n !customStyles && variantStyles[variant],\n sizeStyles[size],\n onClick && 'cursor-pointer hover:opacity-80 transition-opacity',\n className\n )}\n style={customStyles}\n >\n {label}\n </span>\n )\n}\n"],"names":["variantStyles","sizeStyles","Pill","label","variant","size","className","onClick","backgroundColor","textColor","customStyles","jsx","cn"],"mappings":";;AAaA,MAAMA,IAAgB;AAAA,EACpB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR,GAEMC,IAAa;AAAA,EACjB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAO,CAAC;AAAA,EACnB,OAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AACF,MAAiB;AACf,QAAMC,IAAeF,KAAmBC,IACpC,EAAE,iBAAAD,GAAiB,OAAOC,MAC1B;AAEJ,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAAJ;AAAA,MACA,WAAWK;AAAA,QACT;AAAA,QACA,CAACF,KAAgBV,EAAcI,CAAO;AAAA,QACtCH,EAAWI,CAAI;AAAA,QACfE,KAAW;AAAA,QACXD;AAAA,MAAA;AAAA,MAEF,OAAOI;AAAA,MAEN,UAAAP;AAAA,IAAA;AAAA,EAAA;AAGP;"}
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 p, jsx as e } from "react/jsx-runtime";
2
- import { cn as t } from "./index3.js";
3
- const h = ({
4
- icon: l,
5
- title: o,
6
- description: x,
7
- buttonLabel: r,
8
- onAction: a,
9
- children: s,
10
- size: m = "md",
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
- }) => /* @__PURE__ */ p(
13
- "div",
14
- {
15
- className: t(
16
- "rounded-xl bg-gradient-to-br from-primary-500 to-primary-500/80 text-white",
17
- m === "sm" ? "p-3" : "p-4",
18
- i
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
- children: [
21
- /* @__PURE__ */ p("div", { className: t("flex items-center gap-2", (x || r || s) && "mb-2"), children: [
22
- l && /* @__PURE__ */ e(l, { className: t(m === "sm" ? "h-4 w-4" : "h-5 w-5") }),
23
- /* @__PURE__ */ e("span", { className: t("font-semibold", m === "sm" ? "text-xs" : "text-sm"), children: o })
24
- ] }),
25
- x && /* @__PURE__ */ e("p", { className: t(
26
- "text-white/90",
27
- m === "sm" ? "text-[11px]" : "text-xs",
28
- s || r && a ? m === "sm" ? "mb-2" : "mb-3" : ""
29
- ), children: x }),
30
- s || (r && a ? /* @__PURE__ */ e(
31
- "button",
32
- {
33
- onClick: a,
34
- className: t(
35
- "w-full bg-white text-primary-600 rounded-lg font-semibold hover:bg-white/90 transition-colors cursor-pointer",
36
- m === "sm" ? "px-2 py-1.5 text-xs" : "px-3 py-2 text-sm"
37
- ),
38
- children: r
39
- }
40
- ) : null)
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
- h as PrimaryCard
123
+ T as PhotoLibrary
46
124
  };
47
125
  //# sourceMappingURL=index49.js.map