framepexls-ui-lib 2.0.0 → 2.2.0

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 (236) hide show
  1. package/dist/AnalyticsCharts.d.mts +4 -4
  2. package/dist/AnalyticsCharts.d.ts +4 -4
  3. package/dist/AppTopbar.d.mts +1 -2
  4. package/dist/AppTopbar.d.ts +1 -2
  5. package/dist/AssetPerformanceCard.d.mts +50 -0
  6. package/dist/AssetPerformanceCard.d.ts +50 -0
  7. package/dist/AssetPerformanceCard.js +342 -0
  8. package/dist/AssetPerformanceCard.mjs +319 -0
  9. package/dist/AssetTickerRow.d.mts +26 -0
  10. package/dist/AssetTickerRow.d.ts +26 -0
  11. package/dist/AssetTickerRow.js +255 -0
  12. package/dist/AssetTickerRow.mjs +225 -0
  13. package/dist/AuthTopbar.d.mts +2 -2
  14. package/dist/AuthTopbar.d.ts +2 -2
  15. package/dist/AuthTopbar.js +2 -1
  16. package/dist/AuthTopbar.mjs +2 -1
  17. package/dist/AvatarGroup.d.mts +2 -2
  18. package/dist/AvatarGroup.d.ts +2 -2
  19. package/dist/AvatarSquare.d.mts +2 -2
  20. package/dist/AvatarSquare.d.ts +2 -2
  21. package/dist/AvatarSquare.js +29 -27
  22. package/dist/AvatarSquare.mjs +29 -27
  23. package/dist/Badge.d.mts +1 -2
  24. package/dist/Badge.d.ts +1 -2
  25. package/dist/BadgeCluster.d.mts +2 -3
  26. package/dist/BadgeCluster.d.ts +2 -3
  27. package/dist/Breadcrumb.d.mts +1 -2
  28. package/dist/Breadcrumb.d.ts +1 -2
  29. package/dist/CalendarPanel.d.mts +2 -2
  30. package/dist/CalendarPanel.d.ts +2 -2
  31. package/dist/Carousel.d.mts +1 -2
  32. package/dist/Carousel.d.ts +1 -2
  33. package/dist/ChangeHistory.d.mts +1 -2
  34. package/dist/ChangeHistory.d.ts +1 -2
  35. package/dist/ChartCard.d.mts +1 -2
  36. package/dist/ChartCard.d.ts +1 -2
  37. package/dist/ChatCenter.d.mts +2 -2
  38. package/dist/ChatCenter.d.ts +2 -2
  39. package/dist/ChatbotCenter.d.mts +1 -2
  40. package/dist/ChatbotCenter.d.ts +1 -2
  41. package/dist/Checkbox.d.mts +1 -1
  42. package/dist/Checkbox.d.ts +1 -1
  43. package/dist/CheckboxPillsGroup.d.mts +1 -2
  44. package/dist/CheckboxPillsGroup.d.ts +1 -2
  45. package/dist/ColorPicker.d.mts +2 -2
  46. package/dist/ColorPicker.d.ts +2 -2
  47. package/dist/ColumnSelector.d.mts +1 -2
  48. package/dist/ColumnSelector.d.ts +1 -2
  49. package/dist/ComboSelect.d.mts +1 -2
  50. package/dist/ComboSelect.d.ts +1 -2
  51. package/dist/DataPageLayout.d.mts +64 -0
  52. package/dist/DataPageLayout.d.ts +64 -0
  53. package/dist/DataPageLayout.js +191 -0
  54. package/dist/DataPageLayout.mjs +157 -0
  55. package/dist/DataTable.d.mts +1 -2
  56. package/dist/DataTable.d.ts +1 -2
  57. package/dist/DataTableCard.d.mts +1 -2
  58. package/dist/DataTableCard.d.ts +1 -2
  59. package/dist/DataTableCardFooter.d.mts +2 -2
  60. package/dist/DataTableCardFooter.d.ts +2 -2
  61. package/dist/DateTimeField.d.mts +1 -2
  62. package/dist/DateTimeField.d.ts +1 -2
  63. package/dist/Dialog.d.mts +6 -7
  64. package/dist/Dialog.d.ts +6 -7
  65. package/dist/DocumentEditor.d.mts +3 -3
  66. package/dist/DocumentEditor.d.ts +3 -3
  67. package/dist/Drawer.d.mts +4 -5
  68. package/dist/Drawer.d.ts +4 -5
  69. package/dist/Dropdown.d.mts +7 -8
  70. package/dist/Dropdown.d.ts +7 -8
  71. package/dist/EmptyState.d.mts +1 -2
  72. package/dist/EmptyState.d.ts +1 -2
  73. package/dist/FiltersMultiSelect.d.mts +1 -2
  74. package/dist/FiltersMultiSelect.d.ts +1 -2
  75. package/dist/HeliipLoader.d.mts +2 -2
  76. package/dist/HeliipLoader.d.ts +2 -2
  77. package/dist/ImpersonationDialog.d.mts +2 -2
  78. package/dist/ImpersonationDialog.d.ts +2 -2
  79. package/dist/ImpersonationSwitcher.d.mts +2 -2
  80. package/dist/ImpersonationSwitcher.d.ts +2 -2
  81. package/dist/InfoGrid.d.mts +1 -2
  82. package/dist/InfoGrid.d.ts +1 -2
  83. package/dist/KnowledgeBase.d.mts +1 -2
  84. package/dist/KnowledgeBase.d.ts +1 -2
  85. package/dist/KpiCard.d.mts +2 -3
  86. package/dist/KpiCard.d.ts +2 -3
  87. package/dist/LanguageSwitcher.d.mts +2 -2
  88. package/dist/LanguageSwitcher.d.ts +2 -2
  89. package/dist/LicenseStatus.d.mts +1 -2
  90. package/dist/LicenseStatus.d.ts +1 -2
  91. package/dist/Link.d.mts +1 -2
  92. package/dist/Link.d.ts +1 -2
  93. package/dist/Login.d.mts +1 -2
  94. package/dist/Login.d.ts +1 -2
  95. package/dist/LoginCarousel.d.mts +2 -3
  96. package/dist/LoginCarousel.d.ts +2 -3
  97. package/dist/LoginGallery.d.mts +2 -3
  98. package/dist/LoginGallery.d.ts +2 -3
  99. package/dist/LoginTools.d.mts +1 -2
  100. package/dist/LoginTools.d.ts +1 -2
  101. package/dist/Map.d.mts +4 -5
  102. package/dist/Map.d.ts +4 -5
  103. package/dist/MarkdownEditor.d.mts +2 -2
  104. package/dist/MarkdownEditor.d.ts +2 -2
  105. package/dist/MediaCard.d.mts +2 -2
  106. package/dist/MediaCard.d.ts +2 -2
  107. package/dist/MediaLibraryLayout.d.mts +89 -0
  108. package/dist/MediaLibraryLayout.d.ts +89 -0
  109. package/dist/MediaLibraryLayout.js +369 -0
  110. package/dist/MediaLibraryLayout.mjs +348 -0
  111. package/dist/MediaSelector.d.mts +2 -2
  112. package/dist/MediaSelector.d.ts +2 -2
  113. package/dist/MediaTile.d.mts +2 -2
  114. package/dist/MediaTile.d.ts +2 -2
  115. package/dist/Money.d.mts +2 -2
  116. package/dist/Money.d.ts +2 -2
  117. package/dist/MotionProvider.d.mts +1 -2
  118. package/dist/MotionProvider.d.ts +1 -2
  119. package/dist/MultiComboSelect.d.mts +2 -3
  120. package/dist/MultiComboSelect.d.ts +2 -3
  121. package/dist/NotificationsCenter.d.mts +1 -2
  122. package/dist/NotificationsCenter.d.ts +1 -2
  123. package/dist/Numeric.d.mts +24 -0
  124. package/dist/Numeric.d.ts +24 -0
  125. package/dist/Numeric.js +102 -0
  126. package/dist/Numeric.mjs +76 -0
  127. package/dist/OmniSearch.d.mts +2 -3
  128. package/dist/OmniSearch.d.ts +2 -3
  129. package/dist/OrderButton.d.mts +2 -2
  130. package/dist/OrderButton.d.ts +2 -2
  131. package/dist/PageScaffold.d.mts +1 -2
  132. package/dist/PageScaffold.d.ts +1 -2
  133. package/dist/PageScaffold.js +1 -1
  134. package/dist/PageScaffold.mjs +1 -1
  135. package/dist/PageTransition.d.mts +1 -2
  136. package/dist/PageTransition.d.ts +1 -2
  137. package/dist/PageTransition.js +33 -27
  138. package/dist/PageTransition.mjs +33 -27
  139. package/dist/Pagination.d.mts +2 -2
  140. package/dist/Pagination.d.ts +2 -2
  141. package/dist/PasswordField.d.mts +1 -2
  142. package/dist/PasswordField.d.ts +1 -2
  143. package/dist/ProductCatalog.d.mts +2 -3
  144. package/dist/ProductCatalog.d.ts +2 -3
  145. package/dist/PromotionsCatalog.d.mts +2 -3
  146. package/dist/PromotionsCatalog.d.ts +2 -3
  147. package/dist/QrCode.d.mts +2 -2
  148. package/dist/QrCode.d.ts +2 -2
  149. package/dist/QuoteEditor.d.mts +2 -2
  150. package/dist/QuoteEditor.d.ts +2 -2
  151. package/dist/RechartsBarCard.d.mts +1 -2
  152. package/dist/RechartsBarCard.d.ts +1 -2
  153. package/dist/RechartsDonutCard.d.mts +1 -2
  154. package/dist/RechartsDonutCard.d.ts +1 -2
  155. package/dist/RechartsTimeSeriesCard.d.mts +1 -2
  156. package/dist/RechartsTimeSeriesCard.d.ts +1 -2
  157. package/dist/ReviewHistory.d.mts +3 -3
  158. package/dist/ReviewHistory.d.ts +3 -3
  159. package/dist/Reviews.d.mts +1 -2
  160. package/dist/Reviews.d.ts +1 -2
  161. package/dist/SearchInput.d.mts +2 -2
  162. package/dist/SearchInput.d.ts +2 -2
  163. package/dist/SegmentedTabs.d.mts +1 -2
  164. package/dist/SegmentedTabs.d.ts +1 -2
  165. package/dist/Select.d.mts +2 -2
  166. package/dist/Select.d.ts +2 -2
  167. package/dist/ShareAccess.d.mts +1 -2
  168. package/dist/ShareAccess.d.ts +1 -2
  169. package/dist/Sidebar.d.mts +1 -2
  170. package/dist/Sidebar.d.ts +1 -2
  171. package/dist/Sidebar.js +492 -335
  172. package/dist/Sidebar.mjs +492 -335
  173. package/dist/StatCard.d.mts +1 -2
  174. package/dist/StatCard.d.ts +1 -2
  175. package/dist/Steps.d.mts +3 -3
  176. package/dist/Steps.d.ts +3 -3
  177. package/dist/StorageUsage.d.mts +1 -2
  178. package/dist/StorageUsage.d.ts +1 -2
  179. package/dist/Table.d.mts +4 -5
  180. package/dist/Table.d.ts +4 -5
  181. package/dist/TableRecordButton.d.mts +1 -2
  182. package/dist/TableRecordButton.d.ts +1 -2
  183. package/dist/TimeAgo.d.mts +2 -2
  184. package/dist/TimeAgo.d.ts +2 -2
  185. package/dist/TimePanel.d.mts +1 -2
  186. package/dist/TimePanel.d.ts +1 -2
  187. package/dist/TimeRangeField.d.mts +2 -2
  188. package/dist/TimeRangeField.d.ts +2 -2
  189. package/dist/Toast.d.mts +1 -2
  190. package/dist/Toast.d.ts +1 -2
  191. package/dist/Tooltip.d.mts +1 -2
  192. package/dist/Tooltip.d.ts +1 -2
  193. package/dist/UploadCard.d.mts +1 -2
  194. package/dist/UploadCard.d.ts +1 -2
  195. package/dist/WordEditor.d.mts +3 -3
  196. package/dist/WordEditor.d.ts +3 -3
  197. package/dist/WorkflowDiagram.d.mts +1 -2
  198. package/dist/WorkflowDiagram.d.ts +1 -2
  199. package/dist/{animations-CHrNeawW.d.mts → animations-Di5tQRLw.d.mts} +2 -2
  200. package/dist/{animations-CHrNeawW.d.ts → animations-Di5tQRLw.d.ts} +2 -2
  201. package/dist/animations.d.mts +1 -1
  202. package/dist/animations.d.ts +1 -1
  203. package/dist/charts.d.mts +2 -1
  204. package/dist/charts.d.ts +2 -1
  205. package/dist/charts.js +6 -0
  206. package/dist/charts.mjs +6 -2
  207. package/dist/i18n.d.mts +1 -2
  208. package/dist/i18n.d.ts +1 -2
  209. package/dist/iconos/WorkflowEdgesSvg.d.mts +1 -2
  210. package/dist/iconos/WorkflowEdgesSvg.d.ts +1 -2
  211. package/dist/iconos/index.d.mts +1546 -1547
  212. package/dist/iconos/index.d.ts +1546 -1547
  213. package/dist/iconos/regular-icons.js +2 -2
  214. package/dist/iconos/regular-icons.mjs +2 -2
  215. package/dist/index.d.mts +10 -4
  216. package/dist/index.d.ts +10 -4
  217. package/dist/index.js +33 -0
  218. package/dist/index.mjs +166 -146
  219. package/dist/internal/AutoSize.d.mts +1 -2
  220. package/dist/internal/AutoSize.d.ts +1 -2
  221. package/dist/map.css +1 -1
  222. package/dist/theme/FontSizeController.d.mts +2 -2
  223. package/dist/theme/FontSizeController.d.ts +2 -2
  224. package/dist/theme/FontSizeController.js +1 -1
  225. package/dist/theme/FontSizeController.mjs +1 -1
  226. package/dist/theme/ThemeController.d.mts +2 -3
  227. package/dist/theme/ThemeController.d.ts +2 -3
  228. package/dist/theme/ThemeProvider.d.mts +1 -2
  229. package/dist/theme/ThemeProvider.d.ts +1 -2
  230. package/dist/theme/ThemeScript.d.mts +2 -2
  231. package/dist/theme/ThemeScript.d.ts +2 -2
  232. package/dist/theme/ThemeToggle.d.mts +2 -2
  233. package/dist/theme/ThemeToggle.d.ts +2 -2
  234. package/dist/theme/ThemeToggle.js +4 -4
  235. package/dist/theme/ThemeToggle.mjs +4 -4
  236. package/package.json +7 -8
@@ -0,0 +1,348 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Button from "./Button.mjs";
5
+ import ChartCard from "./ChartCard.mjs";
6
+ import DataPageLayout from "./DataPageLayout.mjs";
7
+ import Dialog from "./Dialog.mjs";
8
+ import Dropdown from "./Dropdown.mjs";
9
+ import Input from "./Input.mjs";
10
+ import {
11
+ ArrowUpFromBracketIcon,
12
+ CheckIcon,
13
+ CopyIcon,
14
+ EyeIcon,
15
+ ImageBrokenIcon,
16
+ PencilIcon,
17
+ PlusIcon,
18
+ TrashIcon
19
+ } from "./iconos/index.mjs";
20
+ function cx(...values) {
21
+ return values.filter(Boolean).join(" ");
22
+ }
23
+ const defaultLabels = {
24
+ actions: "Acciones",
25
+ uploadAction: "Subir archivos",
26
+ clearSearch: "Limpiar b\xFAsqueda",
27
+ uploadTitle: "Subir archivos",
28
+ uploadSubtitle: "Formatos permitidos: JPG, PNG, WEBP, GIF",
29
+ uploadButton: "Seleccionar",
30
+ uploadDropTitle: "Arrastra y suelta im\xE1genes aqu\xED o haz clic",
31
+ uploadDropHelp: "M\xE1ximo recomendado 16MB por archivo",
32
+ noItemsTitle: "No hay medios",
33
+ noItemsSubtitle: "Sube im\xE1genes para agregarlas al repositorio.",
34
+ noSearchResultsSubtitle: "Ajusta la b\xFAsqueda para ver resultados.",
35
+ previewTitle: "Vista previa",
36
+ previewAction: "Visualizar",
37
+ copyAction: "Copiar URL",
38
+ copiedAction: "Copiado",
39
+ renameAction: "Renombrar",
40
+ replaceAction: "Reemplazar",
41
+ deleteAction: "Eliminar",
42
+ brokenImage: "Imagen no disponible"
43
+ };
44
+ function MediaLibraryLayout({
45
+ items,
46
+ totalItems,
47
+ tickerItems,
48
+ query = "",
49
+ onQueryChange,
50
+ searchId = "media-library-search",
51
+ searchPlaceholder = "Buscar por nombre",
52
+ upload,
53
+ uploads = [],
54
+ pagination,
55
+ error,
56
+ labels: labelsProp,
57
+ actionMenuMaxHeight = 420,
58
+ controlsRight,
59
+ beforeGallery,
60
+ afterGallery,
61
+ extraActions,
62
+ overlays,
63
+ tableContainerClassName,
64
+ gridClassName,
65
+ getItemId = (item) => item.id,
66
+ getItemName = (item) => {
67
+ var _a;
68
+ return (_a = item.name) != null ? _a : "";
69
+ },
70
+ getItemUrl = (item) => item.url,
71
+ getItemMeta = (item) => item.meta,
72
+ getItemActive = (item) => {
73
+ var _a;
74
+ return (_a = item.active) != null ? _a : true;
75
+ },
76
+ onPreview,
77
+ onCopyUrl,
78
+ onRename,
79
+ onReplace,
80
+ onDelete,
81
+ ...pageProps
82
+ }) {
83
+ var _a, _b;
84
+ const labels = { ...defaultLabels, ...labelsProp };
85
+ const inputRef = React.useRef(null);
86
+ const [previewItem, setPreviewItem] = React.useState(null);
87
+ const [previewImageError, setPreviewImageError] = React.useState(false);
88
+ const [copiedId, setCopiedId] = React.useState(null);
89
+ React.useEffect(() => {
90
+ setPreviewImageError(false);
91
+ }, [previewItem ? getItemUrl(previewItem) : null]);
92
+ const openUpload = React.useCallback(() => {
93
+ var _a2;
94
+ (_a2 = inputRef.current) == null ? void 0 : _a2.click();
95
+ }, []);
96
+ const openPreview = React.useCallback(
97
+ (item) => {
98
+ setPreviewItem(item);
99
+ onPreview == null ? void 0 : onPreview(item);
100
+ },
101
+ [onPreview]
102
+ );
103
+ const copyUrl = React.useCallback(
104
+ async (item) => {
105
+ if (onCopyUrl) {
106
+ await onCopyUrl(item);
107
+ } else {
108
+ const url = getItemUrl(item);
109
+ if (url) await navigator.clipboard.writeText(url);
110
+ }
111
+ const id = getItemId(item);
112
+ setCopiedId(id);
113
+ window.setTimeout(() => setCopiedId((current) => current === id ? null : current), 1200);
114
+ },
115
+ [getItemId, getItemUrl, onCopyUrl]
116
+ );
117
+ const uploader = upload === false ? null : /* @__PURE__ */ jsxs(
118
+ ChartCard,
119
+ {
120
+ title: labels.uploadTitle,
121
+ subtitle: /* @__PURE__ */ jsx("span", { children: labels.uploadSubtitle }),
122
+ right: /* @__PURE__ */ jsxs(Fragment, { children: [
123
+ /* @__PURE__ */ jsx(
124
+ Input,
125
+ {
126
+ unstyled: true,
127
+ ref: inputRef,
128
+ type: "file",
129
+ accept: (_a = upload == null ? void 0 : upload.accept) != null ? _a : "image/png,image/jpeg,image/jpg,image/webp,image/gif",
130
+ multiple: (_b = upload == null ? void 0 : upload.multiple) != null ? _b : true,
131
+ className: "hidden",
132
+ onChange: (event) => {
133
+ void (upload == null ? void 0 : upload.onFilesSelected(event.target.files));
134
+ event.currentTarget.value = "";
135
+ }
136
+ }
137
+ ),
138
+ /* @__PURE__ */ jsx(Button, { color: upload == null ? void 0 : upload.buttonColor, onClick: openUpload, children: labels.uploadButton })
139
+ ] }),
140
+ children: [
141
+ /* @__PURE__ */ jsxs(
142
+ "div",
143
+ {
144
+ onDragOver: (event) => {
145
+ event.preventDefault();
146
+ event.dataTransfer.dropEffect = "copy";
147
+ },
148
+ onDrop: (event) => {
149
+ event.preventDefault();
150
+ void (upload == null ? void 0 : upload.onFilesSelected(event.dataTransfer.files));
151
+ },
152
+ onClick: openUpload,
153
+ className: "flex cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl border border-dashed border-[color-mix(in_oklab,var(--border)_78%,transparent)] bg-[color-mix(in_oklab,var(--surface)_84%,var(--card))] p-8 text-center transition hover:border-[color-mix(in_oklab,var(--border)_92%,var(--primary))] hover:bg-[color-mix(in_oklab,var(--surface)_78%,var(--card))]",
154
+ children: [
155
+ /* @__PURE__ */ jsx(ArrowUpFromBracketIcon, { className: "h-8 w-8 text-[color-mix(in_oklab,var(--muted)_78%,transparent)]" }),
156
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: labels.uploadDropTitle }),
157
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-[var(--muted)]", children: labels.uploadDropHelp })
158
+ ]
159
+ }
160
+ ),
161
+ uploads.length > 0 ? /* @__PURE__ */ jsx("div", { className: "mt-4 space-y-2", children: uploads.map((uploadItem) => /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 rounded-xl border border-[color-mix(in_oklab,var(--border)_78%,transparent)] bg-[color-mix(in_oklab,var(--card)_74%,transparent)] p-2", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
162
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
163
+ /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: uploadItem.name }),
164
+ /* @__PURE__ */ jsxs("div", { className: "text-xs text-[var(--muted)]", children: [
165
+ uploadItem.progress,
166
+ "%"
167
+ ] })
168
+ ] }),
169
+ /* @__PURE__ */ jsx("div", { className: "mt-1 h-2 w-full overflow-hidden rounded-full bg-[color-mix(in_oklab,var(--surface)_78%,transparent)]", children: /* @__PURE__ */ jsx(
170
+ "div",
171
+ {
172
+ className: "h-full bg-[color-mix(in_oklab,var(--primary)_68%,transparent)]",
173
+ style: { width: `${Math.max(0, Math.min(100, uploadItem.progress))}%` }
174
+ }
175
+ ) }),
176
+ uploadItem.status === "error" && uploadItem.error ? /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-[var(--primary)]", children: uploadItem.error }) : null
177
+ ] }) }, uploadItem.id)) }) : null
178
+ ]
179
+ }
180
+ );
181
+ const gallery = /* @__PURE__ */ jsxs(Fragment, { children: [
182
+ beforeGallery,
183
+ /* @__PURE__ */ jsx("div", { className: cx("grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5", gridClassName), children: items.map((item) => {
184
+ const id = getItemId(item);
185
+ const name = getItemName(item);
186
+ const url = getItemUrl(item);
187
+ return /* @__PURE__ */ jsx(
188
+ MediaLibraryCard,
189
+ {
190
+ name,
191
+ url,
192
+ meta: getItemMeta(item),
193
+ active: getItemActive(item),
194
+ copied: copiedId === id,
195
+ labels,
196
+ actionMenuMaxHeight,
197
+ onPreview: () => openPreview(item),
198
+ onCopy: () => void copyUrl(item),
199
+ onRename: onRename ? () => onRename(item) : void 0,
200
+ onReplace: onReplace ? () => onReplace(item) : void 0,
201
+ onDelete: onDelete ? () => onDelete(item) : void 0
202
+ },
203
+ id
204
+ );
205
+ }) }),
206
+ afterGallery
207
+ ] });
208
+ const previewName = previewItem ? getItemName(previewItem) : labels.previewTitle;
209
+ const previewUrl = previewItem ? getItemUrl(previewItem) : null;
210
+ return /* @__PURE__ */ jsx(
211
+ DataPageLayout,
212
+ {
213
+ ...pageProps,
214
+ tickerItems,
215
+ search: onQueryChange ? {
216
+ id: searchId,
217
+ value: query,
218
+ onChange: onQueryChange,
219
+ placeholder: searchPlaceholder
220
+ } : void 0,
221
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
222
+ upload !== false ? /* @__PURE__ */ jsxs(Dropdown, { align: "end", children: [
223
+ /* @__PURE__ */ jsxs(Dropdown.Trigger, { className: "px-3 py-2", children: [
224
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.actions }),
225
+ /* @__PURE__ */ jsx(Dropdown.MenuPuntosVerticalIcon, {})
226
+ ] }),
227
+ /* @__PURE__ */ jsxs(Dropdown.Content, { children: [
228
+ /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: openUpload, icon: /* @__PURE__ */ jsx(PlusIcon, { className: "h-4 w-4" }), children: labels.uploadAction }),
229
+ query.trim() && onQueryChange ? /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: () => onQueryChange(""), children: labels.clearSearch }) : null
230
+ ] })
231
+ ] }) : null,
232
+ extraActions
233
+ ] }),
234
+ beforeTable: uploader,
235
+ controlsRight: controlsRight != null ? controlsRight : /* @__PURE__ */ jsxs("div", { className: "text-xs text-[var(--muted)]", children: [
236
+ totalItems != null ? totalItems : items.length,
237
+ " elemento(s)"
238
+ ] }),
239
+ table: gallery,
240
+ tableContainerClassName: cx("px-4 pt-4 pb-28 sm:px-5 sm:pt-5 sm:pb-32", tableContainerClassName),
241
+ empty: items.length === 0,
242
+ emptyState: {
243
+ title: labels.noItemsTitle,
244
+ subtitle: query.trim() ? labels.noSearchResultsSubtitle : labels.noItemsSubtitle
245
+ },
246
+ emptyAction: upload !== false ? /* @__PURE__ */ jsx(Button, { variant: "primary", onClick: openUpload, children: labels.uploadAction }) : null,
247
+ pagination,
248
+ error,
249
+ overlays: /* @__PURE__ */ jsxs(Fragment, { children: [
250
+ /* @__PURE__ */ jsxs(Dialog, { open: Boolean(previewItem), onClose: () => setPreviewItem(null), title: previewName, size: "full", children: [
251
+ /* @__PURE__ */ jsx(Dialog.Header, { title: previewName, description: previewItem ? getItemMeta(previewItem) : void 0, onClose: () => setPreviewItem(null) }),
252
+ /* @__PURE__ */ jsx(Dialog.Body, { padded: false, noScroll: true, className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx("div", { className: "flex h-full min-h-[60vh] items-center justify-center bg-[color-mix(in_oklab,var(--surface)_88%,var(--card))] p-4", children: previewUrl && !previewImageError ? /* @__PURE__ */ jsx(
253
+ "img",
254
+ {
255
+ src: previewUrl,
256
+ alt: String(previewName),
257
+ className: "max-h-[calc(100vh-9rem)] max-w-full rounded-2xl object-contain shadow-2xl",
258
+ onError: () => setPreviewImageError(true)
259
+ }
260
+ ) : /* @__PURE__ */ jsx(BrokenImageFallback, { label: labels.brokenImage, size: "lg" }) }) })
261
+ ] }),
262
+ overlays
263
+ ] })
264
+ }
265
+ );
266
+ }
267
+ function MediaLibraryCard({
268
+ name,
269
+ url,
270
+ meta,
271
+ active,
272
+ copied,
273
+ labels,
274
+ actionMenuMaxHeight,
275
+ onPreview,
276
+ onCopy,
277
+ onRename,
278
+ onReplace,
279
+ onDelete
280
+ }) {
281
+ const [imageError, setImageError] = React.useState(false);
282
+ const showImage = Boolean(url) && !imageError;
283
+ React.useEffect(() => {
284
+ setImageError(false);
285
+ }, [url]);
286
+ return /* @__PURE__ */ jsxs("div", { className: "group relative overflow-hidden rounded-2xl border border-[color-mix(in_oklab,var(--border)_78%,transparent)] bg-[color-mix(in_oklab,var(--card)_82%,transparent)] shadow-sm ring-1 ring-black/5 backdrop-blur transition hover:border-[color-mix(in_oklab,var(--border)_84%,var(--primary))]", children: [
287
+ /* @__PURE__ */ jsx(
288
+ "button",
289
+ {
290
+ type: "button",
291
+ onClick: onPreview,
292
+ className: "block aspect-square w-full bg-[color-mix(in_oklab,var(--surface)_78%,transparent)] text-left focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklab,var(--ring)_55%,transparent)]",
293
+ "aria-label": `${labels.previewAction} ${name}`,
294
+ children: showImage ? /* @__PURE__ */ jsx(
295
+ "img",
296
+ {
297
+ src: url != null ? url : void 0,
298
+ alt: name,
299
+ className: cx("h-full w-full object-cover", !active && "opacity-60"),
300
+ onError: () => setImageError(true)
301
+ }
302
+ ) : /* @__PURE__ */ jsx(BrokenImageFallback, { label: labels.brokenImage })
303
+ }
304
+ ),
305
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 p-2", children: [
306
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
307
+ /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: name }),
308
+ meta ? /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-[var(--muted)]", children: meta }) : null
309
+ ] }),
310
+ /* @__PURE__ */ jsxs(Dropdown, { align: "end", children: [
311
+ /* @__PURE__ */ jsx(Dropdown.Trigger, { "aria-label": labels.actions, className: "px-2.5 py-2", children: /* @__PURE__ */ jsx(Dropdown.MenuPuntosVerticalIcon, {}) }),
312
+ /* @__PURE__ */ jsxs(Dropdown.Content, { "aria-label": labels.actions, maxHeight: actionMenuMaxHeight, children: [
313
+ /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onPreview, icon: /* @__PURE__ */ jsx(EyeIcon, { className: "h-4 w-4" }), children: labels.previewAction }),
314
+ /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onCopy, icon: copied ? /* @__PURE__ */ jsx(CheckIcon, { className: "h-4 w-4 text-emerald-600" }) : /* @__PURE__ */ jsx(CopyIcon, { className: "h-4 w-4" }), children: copied ? labels.copiedAction : labels.copyAction }),
315
+ onRename ? /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onRename, icon: /* @__PURE__ */ jsx(PencilIcon, { className: "h-4 w-4" }), children: labels.renameAction }) : null,
316
+ onReplace ? /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onReplace, icon: /* @__PURE__ */ jsx(PlusIcon, { className: "h-4 w-4" }), children: labels.replaceAction }) : null,
317
+ onDelete ? /* @__PURE__ */ jsxs(Fragment, { children: [
318
+ /* @__PURE__ */ jsx(Dropdown.Separator, {}),
319
+ /* @__PURE__ */ jsx(Dropdown.Item, { danger: true, onSelect: onDelete, icon: /* @__PURE__ */ jsx(TrashIcon, { className: "h-4 w-4" }), children: labels.deleteAction })
320
+ ] }) : null
321
+ ] })
322
+ ] })
323
+ ] })
324
+ ] });
325
+ }
326
+ function BrokenImageFallback({ label, size = "md" }) {
327
+ return /* @__PURE__ */ jsx(
328
+ "div",
329
+ {
330
+ className: "flex h-full w-full items-center justify-center bg-[color-mix(in_oklab,var(--surface)_84%,var(--card))]",
331
+ "aria-label": label,
332
+ role: "img",
333
+ children: /* @__PURE__ */ jsx(
334
+ "span",
335
+ {
336
+ className: cx(
337
+ "flex items-center justify-center rounded-2xl border border-[color-mix(in_oklab,var(--border)_86%,transparent)] bg-[var(--card)] text-[color-mix(in_oklab,var(--primary)_54%,var(--muted))] shadow-sm",
338
+ size === "lg" ? "h-40 w-40" : "h-16 w-16"
339
+ ),
340
+ children: /* @__PURE__ */ jsx(ImageBrokenIcon, { className: size === "lg" ? "h-14 w-14" : "h-8 w-8" })
341
+ }
342
+ )
343
+ }
344
+ );
345
+ }
346
+ export {
347
+ MediaLibraryLayout as default
348
+ };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
 
3
3
  type MediaSelectorItem = {
4
4
  id: number | string;
@@ -43,6 +43,6 @@ declare function MediaSelector({ value, onChange, medios, accept, autoOpen, dial
43
43
  autoOpen?: boolean;
44
44
  dialogOnly?: boolean;
45
45
  onClose?: () => void;
46
- }): react_jsx_runtime.JSX.Element;
46
+ }): React__default.JSX.Element;
47
47
 
48
48
  export { type MediaSelectorItem, type MediosAdapter, MediaSelector as default };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
 
3
3
  type MediaSelectorItem = {
4
4
  id: number | string;
@@ -43,6 +43,6 @@ declare function MediaSelector({ value, onChange, medios, accept, autoOpen, dial
43
43
  autoOpen?: boolean;
44
44
  dialogOnly?: boolean;
45
45
  onClose?: () => void;
46
- }): react_jsx_runtime.JSX.Element;
46
+ }): React__default.JSX.Element;
47
47
 
48
48
  export { type MediaSelectorItem, type MediosAdapter, MediaSelector as default };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
 
3
3
  type MediaTileProps = {
4
4
  imageUrl?: string | null;
@@ -14,6 +14,6 @@ type MediaTileProps = {
14
14
  menuSize?: "sm" | "md" | "lg";
15
15
  className?: string;
16
16
  };
17
- declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, isPrivateImage, loading, menuSize, className, }: MediaTileProps): react_jsx_runtime.JSX.Element;
17
+ declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, isPrivateImage, loading, menuSize, className, }: MediaTileProps): React.JSX.Element;
18
18
 
19
19
  export { type MediaTileProps, MediaTile as default };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
 
3
3
  type MediaTileProps = {
4
4
  imageUrl?: string | null;
@@ -14,6 +14,6 @@ type MediaTileProps = {
14
14
  menuSize?: "sm" | "md" | "lg";
15
15
  className?: string;
16
16
  };
17
- declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, isPrivateImage, loading, menuSize, className, }: MediaTileProps): react_jsx_runtime.JSX.Element;
17
+ declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, isPrivateImage, loading, menuSize, className, }: MediaTileProps): React.JSX.Element;
18
18
 
19
19
  export { type MediaTileProps, MediaTile as default };
package/dist/Money.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
 
3
3
  type MoneyColor = "accent" | "success" | "warning" | "danger" | "slate" | "gray" | "zinc" | "neutral" | "stone" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
4
4
  declare function Money({ amount, currency, color }: {
5
5
  amount: number;
6
6
  currency?: string;
7
7
  color?: MoneyColor;
8
- }): react_jsx_runtime.JSX.Element;
8
+ }): React.JSX.Element;
9
9
 
10
10
  export { Money as default };
package/dist/Money.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as React from 'react';
2
2
 
3
3
  type MoneyColor = "accent" | "success" | "warning" | "danger" | "slate" | "gray" | "zinc" | "neutral" | "stone" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
4
4
  declare function Money({ amount, currency, color }: {
5
5
  amount: number;
6
6
  currency?: string;
7
7
  color?: MoneyColor;
8
- }): react_jsx_runtime.JSX.Element;
8
+ }): React.JSX.Element;
9
9
 
10
10
  export { Money as default };
@@ -1,10 +1,9 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import React__default from 'react';
3
2
 
4
3
  declare function MotionProvider({ children, reducedMotion, features }: {
5
4
  children: React__default.ReactNode;
6
5
  reducedMotion?: "user" | "always" | "never";
7
6
  features?: "animation" | "max";
8
- }): react_jsx_runtime.JSX.Element;
7
+ }): React__default.JSX.Element;
9
8
 
10
9
  export { MotionProvider as default };
@@ -1,10 +1,9 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import React__default from 'react';
3
2
 
4
3
  declare function MotionProvider({ children, reducedMotion, features }: {
5
4
  children: React__default.ReactNode;
6
5
  reducedMotion?: "user" | "always" | "never";
7
6
  features?: "animation" | "max";
8
- }): react_jsx_runtime.JSX.Element;
7
+ }): React__default.JSX.Element;
9
8
 
10
9
  export { MotionProvider as default };
@@ -1,6 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import { ComboOption } from './ComboSelect.mjs';
3
- import 'react';
4
3
 
5
4
  type MultiComboOption = ComboOption & {
6
5
  color?: string | null;
@@ -18,6 +17,6 @@ type MultiComboSelectProps = {
18
17
  enableDialog?: boolean;
19
18
  dialogTitle?: string;
20
19
  };
21
- declare function MultiComboSelect({ options, value, onChange, placeholder, disabled, loading, className, noResultsText, maxVisibleTags, enableDialog, dialogTitle, }: MultiComboSelectProps): react_jsx_runtime.JSX.Element;
20
+ declare function MultiComboSelect({ options, value, onChange, placeholder, disabled, loading, className, noResultsText, maxVisibleTags, enableDialog, dialogTitle, }: MultiComboSelectProps): React__default.JSX.Element;
22
21
 
23
22
  export { type MultiComboOption, type MultiComboSelectProps, MultiComboSelect as default };
@@ -1,6 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import { ComboOption } from './ComboSelect.js';
3
- import 'react';
4
3
 
5
4
  type MultiComboOption = ComboOption & {
6
5
  color?: string | null;
@@ -18,6 +17,6 @@ type MultiComboSelectProps = {
18
17
  enableDialog?: boolean;
19
18
  dialogTitle?: string;
20
19
  };
21
- declare function MultiComboSelect({ options, value, onChange, placeholder, disabled, loading, className, noResultsText, maxVisibleTags, enableDialog, dialogTitle, }: MultiComboSelectProps): react_jsx_runtime.JSX.Element;
20
+ declare function MultiComboSelect({ options, value, onChange, placeholder, disabled, loading, className, noResultsText, maxVisibleTags, enableDialog, dialogTitle, }: MultiComboSelectProps): React__default.JSX.Element;
22
21
 
23
22
  export { type MultiComboOption, type MultiComboSelectProps, MultiComboSelect as default };
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import React__default from 'react';
3
2
 
4
3
  type NotificationTone = "neutral" | "info" | "success" | "warning" | "danger";
@@ -48,6 +47,6 @@ type NotificationsCenterProps = {
48
47
  headerRight?: React__default.ReactNode;
49
48
  labels?: NotificationsCenterLabels;
50
49
  };
51
- declare function NotificationsCenter({ items, onItemsChange, onOpenNotification, open: openProp, onOpenChange, unreadCount: unreadCountProp, className, triggerClassName, drawerWidthClass, headerRight, labels, }: NotificationsCenterProps): react_jsx_runtime.JSX.Element;
50
+ declare function NotificationsCenter({ items, onItemsChange, onOpenNotification, open: openProp, onOpenChange, unreadCount: unreadCountProp, className, triggerClassName, drawerWidthClass, headerRight, labels, }: NotificationsCenterProps): React__default.JSX.Element;
52
51
 
53
52
  export { type NotificationActor, type NotificationItem, type NotificationTone, type NotificationsCenterLabels, type NotificationsCenterProps, NotificationsCenter as default };
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import React__default from 'react';
3
2
 
4
3
  type NotificationTone = "neutral" | "info" | "success" | "warning" | "danger";
@@ -48,6 +47,6 @@ type NotificationsCenterProps = {
48
47
  headerRight?: React__default.ReactNode;
49
48
  labels?: NotificationsCenterLabels;
50
49
  };
51
- declare function NotificationsCenter({ items, onItemsChange, onOpenNotification, open: openProp, onOpenChange, unreadCount: unreadCountProp, className, triggerClassName, drawerWidthClass, headerRight, labels, }: NotificationsCenterProps): react_jsx_runtime.JSX.Element;
50
+ declare function NotificationsCenter({ items, onItemsChange, onOpenNotification, open: openProp, onOpenChange, unreadCount: unreadCountProp, className, triggerClassName, drawerWidthClass, headerRight, labels, }: NotificationsCenterProps): React__default.JSX.Element;
52
51
 
53
52
  export { type NotificationActor, type NotificationItem, type NotificationTone, type NotificationsCenterLabels, type NotificationsCenterProps, NotificationsCenter as default };
@@ -0,0 +1,24 @@
1
+ import React__default from 'react';
2
+
3
+ type NumericVariant = "number" | "currency" | "percent";
4
+ type NumericFormatOptions = {
5
+ variant?: NumericVariant;
6
+ currency?: string;
7
+ locale?: string;
8
+ minimumFractionDigits?: number;
9
+ maximumFractionDigits?: number;
10
+ useGrouping?: boolean;
11
+ fallback?: string;
12
+ prefix?: string;
13
+ suffix?: string;
14
+ };
15
+ type NumericProps = NumericFormatOptions & {
16
+ value: number | null | undefined;
17
+ className?: string;
18
+ };
19
+ declare function formatNumericValue(value: number | null | undefined, { variant, currency, locale, minimumFractionDigits, maximumFractionDigits, useGrouping, fallback, prefix, suffix, }?: NumericFormatOptions): string;
20
+ declare function formatCurrencyValue(value: number | null | undefined, options?: Omit<NumericFormatOptions, "variant">): string;
21
+ declare function formatPercentValue(value: number | null | undefined, options?: Omit<NumericFormatOptions, "variant" | "suffix">): string;
22
+ declare function Numeric({ value, className, fallback, ...options }: NumericProps): React__default.JSX.Element;
23
+
24
+ export { type NumericFormatOptions, type NumericProps, type NumericVariant, Numeric as default, formatCurrencyValue, formatNumericValue, formatPercentValue };
@@ -0,0 +1,24 @@
1
+ import React__default from 'react';
2
+
3
+ type NumericVariant = "number" | "currency" | "percent";
4
+ type NumericFormatOptions = {
5
+ variant?: NumericVariant;
6
+ currency?: string;
7
+ locale?: string;
8
+ minimumFractionDigits?: number;
9
+ maximumFractionDigits?: number;
10
+ useGrouping?: boolean;
11
+ fallback?: string;
12
+ prefix?: string;
13
+ suffix?: string;
14
+ };
15
+ type NumericProps = NumericFormatOptions & {
16
+ value: number | null | undefined;
17
+ className?: string;
18
+ };
19
+ declare function formatNumericValue(value: number | null | undefined, { variant, currency, locale, minimumFractionDigits, maximumFractionDigits, useGrouping, fallback, prefix, suffix, }?: NumericFormatOptions): string;
20
+ declare function formatCurrencyValue(value: number | null | undefined, options?: Omit<NumericFormatOptions, "variant">): string;
21
+ declare function formatPercentValue(value: number | null | undefined, options?: Omit<NumericFormatOptions, "variant" | "suffix">): string;
22
+ declare function Numeric({ value, className, fallback, ...options }: NumericProps): React__default.JSX.Element;
23
+
24
+ export { type NumericFormatOptions, type NumericProps, type NumericVariant, Numeric as default, formatCurrencyValue, formatNumericValue, formatPercentValue };