framepexls-ui-lib 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionIconButton.d.mts +1 -0
- package/dist/ActionIconButton.d.ts +1 -0
- package/dist/ActionIconButton.js +12 -9
- package/dist/ActionIconButton.mjs +13 -10
- package/dist/AppTopbar.js +23 -6
- package/dist/AppTopbar.mjs +13 -6
- package/dist/AvatarGroup.d.mts +14 -0
- package/dist/AvatarGroup.d.ts +14 -0
- package/dist/AvatarGroup.js +77 -0
- package/dist/AvatarGroup.mjs +47 -0
- package/dist/AvatarSquare.d.mts +2 -5
- package/dist/AvatarSquare.d.ts +2 -5
- package/dist/AvatarSquare.js +52 -3
- package/dist/AvatarSquare.mjs +52 -3
- package/dist/Badge.d.mts +2 -1
- package/dist/Badge.d.ts +2 -1
- package/dist/Badge.js +3 -1
- package/dist/Badge.mjs +3 -1
- package/dist/BadgeCluster.js +3 -3
- package/dist/BadgeCluster.mjs +3 -3
- package/dist/Button.d.mts +3 -4
- package/dist/Button.d.ts +3 -4
- package/dist/Button.js +96 -8
- package/dist/Button.mjs +86 -8
- package/dist/CalendarPanel.js +20 -3
- package/dist/CalendarPanel.mjs +10 -3
- package/dist/Card.d.mts +6 -0
- package/dist/Card.d.ts +6 -0
- package/dist/Card.js +52 -0
- package/dist/Card.mjs +22 -0
- package/dist/CheckboxPillsGroup.d.mts +2 -1
- package/dist/CheckboxPillsGroup.d.ts +2 -1
- package/dist/CheckboxPillsGroup.js +16 -12
- package/dist/CheckboxPillsGroup.mjs +16 -12
- package/dist/ColumnSelector.js +16 -2
- package/dist/ColumnSelector.mjs +6 -2
- package/dist/ComboSelect.d.mts +0 -2
- package/dist/ComboSelect.d.ts +0 -2
- package/dist/ComboSelect.js +8 -4
- package/dist/ComboSelect.mjs +8 -4
- package/dist/DateTimeField.d.mts +0 -5
- package/dist/DateTimeField.d.ts +0 -5
- package/dist/DateTimeField.js +17 -8
- package/dist/DateTimeField.mjs +17 -8
- package/dist/Dialog.d.mts +2 -5
- package/dist/Dialog.d.ts +2 -5
- package/dist/Dialog.js +21 -22
- package/dist/Dialog.mjs +21 -22
- package/dist/Drawer.d.mts +38 -0
- package/dist/Drawer.d.ts +38 -0
- package/dist/Drawer.js +139 -0
- package/dist/Drawer.mjs +102 -0
- package/dist/Dropdown.d.mts +0 -3
- package/dist/Dropdown.d.ts +0 -3
- package/dist/Dropdown.js +61 -42
- package/dist/Dropdown.mjs +51 -42
- package/dist/FiltersMultiSelect.d.mts +28 -0
- package/dist/FiltersMultiSelect.d.ts +28 -0
- package/dist/FiltersMultiSelect.js +136 -0
- package/dist/FiltersMultiSelect.mjs +106 -0
- package/dist/Input.d.mts +2 -0
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +20 -5
- package/dist/Input.mjs +20 -5
- package/dist/Link.d.mts +15 -0
- package/dist/Link.d.ts +15 -0
- package/dist/Link.js +93 -0
- package/dist/Link.mjs +63 -0
- package/dist/MediaCard.d.mts +15 -0
- package/dist/MediaCard.d.ts +15 -0
- package/dist/MediaCard.js +153 -0
- package/dist/MediaCard.mjs +123 -0
- package/dist/MediaSelector.d.mts +48 -0
- package/dist/MediaSelector.d.ts +48 -0
- package/dist/MediaSelector.js +225 -0
- package/dist/MediaSelector.mjs +195 -0
- package/dist/Money.d.mts +2 -1
- package/dist/Money.d.ts +2 -1
- package/dist/Money.js +26 -2
- package/dist/Money.mjs +26 -2
- package/dist/MultiComboSelect.js +6 -11
- package/dist/MultiComboSelect.mjs +6 -11
- package/dist/OrderButton.js +13 -1
- package/dist/OrderButton.mjs +3 -1
- package/dist/Pagination.d.mts +2 -1
- package/dist/Pagination.d.ts +2 -1
- package/dist/Pagination.js +40 -3
- package/dist/Pagination.mjs +30 -3
- package/dist/ReviewHistory.js +3 -9
- package/dist/ReviewHistory.mjs +3 -9
- package/dist/SearchInput.js +17 -42
- package/dist/SearchInput.mjs +17 -42
- package/dist/Select.js +5 -2
- package/dist/Select.mjs +5 -2
- package/dist/Sidebar.d.mts +2 -3
- package/dist/Sidebar.d.ts +2 -3
- package/dist/Sidebar.js +132 -24
- package/dist/Sidebar.mjs +132 -24
- package/dist/Steps.d.mts +0 -2
- package/dist/Steps.d.ts +0 -2
- package/dist/Steps.js +19 -6
- package/dist/Steps.mjs +9 -6
- package/dist/Table.js +3 -1
- package/dist/Table.mjs +3 -1
- package/dist/TimePanel.js +21 -7
- package/dist/TimePanel.mjs +11 -7
- package/dist/TimePopover.js +32 -15
- package/dist/TimePopover.mjs +32 -15
- package/dist/TimeRangeField.js +13 -6
- package/dist/TimeRangeField.mjs +13 -6
- package/dist/Toast.d.mts +53 -0
- package/dist/Toast.d.ts +53 -0
- package/dist/Toast.js +273 -0
- package/dist/Toast.mjs +238 -0
- package/dist/Tooltip.d.mts +15 -0
- package/dist/Tooltip.d.ts +15 -0
- package/dist/Tooltip.js +135 -0
- package/dist/Tooltip.mjs +105 -0
- package/dist/UploadCard.d.mts +27 -0
- package/dist/UploadCard.d.ts +27 -0
- package/dist/UploadCard.js +143 -0
- package/dist/UploadCard.mjs +113 -0
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +33 -1
- package/dist/index.mjs +78 -57
- package/package.json +1 -1
package/dist/Input.js
CHANGED
|
@@ -34,13 +34,26 @@ __export(Input_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Input_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_Button = __toESM(require("./Button"));
|
|
37
38
|
function cx(...a) {
|
|
38
39
|
return a.filter(Boolean).join(" ");
|
|
39
40
|
}
|
|
40
41
|
const baseControl = "w-full rounded-2xl border border-slate-200 bg-white px-3.5 py-2.5 text-sm text-slate-900 placeholder:text-slate-400 shadow-sm outline-none transition focus:ring-4 focus:ring-slate-900/5 focus:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/10 dark:text-slate-100 dark:placeholder:text-slate-400 dark:focus:ring-white/10";
|
|
41
42
|
const errorControl = "border-blue-300 focus:border-blue-300 focus:ring-blue-500/15";
|
|
42
43
|
const Input = import_react.default.forwardRef(
|
|
43
|
-
({ className, error, leftSlot, rightSlot, clearable, onClear, tone = "default", value, onChange, ...props }, ref) => {
|
|
44
|
+
({ className, error, leftSlot, rightSlot, clearable, onClear, tone = "default", value, onChange, unstyled, ...props }, ref) => {
|
|
45
|
+
if (unstyled) {
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
"input",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
value,
|
|
51
|
+
onChange,
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
44
57
|
const showClear = clearable && !!value && !props.disabled;
|
|
45
58
|
const readOnly = !onChange;
|
|
46
59
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative content-center", children: [
|
|
@@ -63,12 +76,14 @@ const Input = import_react.default.forwardRef(
|
|
|
63
76
|
...props
|
|
64
77
|
}
|
|
65
78
|
),
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
rightSlot && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-slate-400", children: rightSlot }),
|
|
80
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_Button.default,
|
|
68
82
|
{
|
|
83
|
+
unstyled: true,
|
|
69
84
|
type: "button",
|
|
70
85
|
title: "Limpiar",
|
|
71
|
-
className:
|
|
86
|
+
className: `absolute ${rightSlot ? "right-9" : "right-2.5"} top-1/2 -translate-y-1/2 inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5`,
|
|
72
87
|
onClick: (e) => {
|
|
73
88
|
e.preventDefault();
|
|
74
89
|
onClear == null ? void 0 : onClear();
|
|
@@ -79,7 +94,7 @@ const Input = import_react.default.forwardRef(
|
|
|
79
94
|
},
|
|
80
95
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-4.5 w-4.5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
81
96
|
}
|
|
82
|
-
)
|
|
97
|
+
)
|
|
83
98
|
] });
|
|
84
99
|
}
|
|
85
100
|
);
|
package/dist/Input.mjs
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import Button from "./Button";
|
|
4
5
|
function cx(...a) {
|
|
5
6
|
return a.filter(Boolean).join(" ");
|
|
6
7
|
}
|
|
7
8
|
const baseControl = "w-full rounded-2xl border border-slate-200 bg-white px-3.5 py-2.5 text-sm text-slate-900 placeholder:text-slate-400 shadow-sm outline-none transition focus:ring-4 focus:ring-slate-900/5 focus:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/10 dark:text-slate-100 dark:placeholder:text-slate-400 dark:focus:ring-white/10";
|
|
8
9
|
const errorControl = "border-blue-300 focus:border-blue-300 focus:ring-blue-500/15";
|
|
9
10
|
const Input = React.forwardRef(
|
|
10
|
-
({ className, error, leftSlot, rightSlot, clearable, onClear, tone = "default", value, onChange, ...props }, ref) => {
|
|
11
|
+
({ className, error, leftSlot, rightSlot, clearable, onClear, tone = "default", value, onChange, unstyled, ...props }, ref) => {
|
|
12
|
+
if (unstyled) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"input",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
11
24
|
const showClear = clearable && !!value && !props.disabled;
|
|
12
25
|
const readOnly = !onChange;
|
|
13
26
|
return /* @__PURE__ */ jsxs("div", { className: "relative content-center", children: [
|
|
@@ -30,12 +43,14 @@ const Input = React.forwardRef(
|
|
|
30
43
|
...props
|
|
31
44
|
}
|
|
32
45
|
),
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
rightSlot && /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-slate-400", children: rightSlot }),
|
|
47
|
+
showClear && /* @__PURE__ */ jsx(
|
|
48
|
+
Button,
|
|
35
49
|
{
|
|
50
|
+
unstyled: true,
|
|
36
51
|
type: "button",
|
|
37
52
|
title: "Limpiar",
|
|
38
|
-
className:
|
|
53
|
+
className: `absolute ${rightSlot ? "right-9" : "right-2.5"} top-1/2 -translate-y-1/2 inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5`,
|
|
39
54
|
onClick: (e) => {
|
|
40
55
|
e.preventDefault();
|
|
41
56
|
onClear == null ? void 0 : onClear();
|
|
@@ -46,7 +61,7 @@ const Input = React.forwardRef(
|
|
|
46
61
|
},
|
|
47
62
|
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4.5 w-4.5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
48
63
|
}
|
|
49
|
-
)
|
|
64
|
+
)
|
|
50
65
|
] });
|
|
51
66
|
}
|
|
52
67
|
);
|
package/dist/Link.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type Size = "sm" | "md";
|
|
5
|
+
type LinkProps = Omit<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
|
|
6
|
+
href: string;
|
|
7
|
+
showAnchorIcon?: boolean;
|
|
8
|
+
underline?: "hover" | "always" | "none";
|
|
9
|
+
size?: Size;
|
|
10
|
+
external?: boolean;
|
|
11
|
+
color?: "slate" | "gray" | "zinc" | "neutral" | "stone" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
|
|
12
|
+
};
|
|
13
|
+
declare function Link({ href, children, className, showAnchorIcon, underline, size, external, color, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { type LinkProps, Link as default };
|
package/dist/Link.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type Size = "sm" | "md";
|
|
5
|
+
type LinkProps = Omit<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
|
|
6
|
+
href: string;
|
|
7
|
+
showAnchorIcon?: boolean;
|
|
8
|
+
underline?: "hover" | "always" | "none";
|
|
9
|
+
size?: Size;
|
|
10
|
+
external?: boolean;
|
|
11
|
+
color?: "slate" | "gray" | "zinc" | "neutral" | "stone" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
|
|
12
|
+
};
|
|
13
|
+
declare function Link({ href, children, className, showAnchorIcon, underline, size, external, color, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { type LinkProps, Link as default };
|
package/dist/Link.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var Link_exports = {};
|
|
31
|
+
__export(Link_exports, {
|
|
32
|
+
default: () => Link
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Link_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_link = __toESM(require("next/link"));
|
|
37
|
+
function Link({
|
|
38
|
+
href,
|
|
39
|
+
children,
|
|
40
|
+
className,
|
|
41
|
+
showAnchorIcon,
|
|
42
|
+
underline = "hover",
|
|
43
|
+
size = "md",
|
|
44
|
+
external,
|
|
45
|
+
color = "rose",
|
|
46
|
+
...rest
|
|
47
|
+
}) {
|
|
48
|
+
const base = "inline-flex items-center gap-1 font-medium transition";
|
|
49
|
+
const sizeCls = size === "sm" ? "text-sm" : "text-[15px]";
|
|
50
|
+
const COLORS = {
|
|
51
|
+
slate: "text-slate-600 hover:text-slate-700 dark:text-slate-300 dark:hover:text-slate-200",
|
|
52
|
+
gray: "text-gray-600 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200",
|
|
53
|
+
zinc: "text-zinc-600 hover:text-zinc-700 dark:text-zinc-300 dark:hover:text-zinc-200",
|
|
54
|
+
neutral: "text-neutral-600 hover:text-neutral-700 dark:text-neutral-300 dark:hover:text-neutral-200",
|
|
55
|
+
stone: "text-stone-600 hover:text-stone-700 dark:text-stone-300 dark:hover:text-stone-200",
|
|
56
|
+
red: "text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",
|
|
57
|
+
orange: "text-orange-600 hover:text-orange-700 dark:text-orange-400 dark:hover:text-orange-300",
|
|
58
|
+
amber: "text-amber-600 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-300",
|
|
59
|
+
yellow: "text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300",
|
|
60
|
+
lime: "text-lime-600 hover:text-lime-700 dark:text-lime-400 dark:hover:text-lime-300",
|
|
61
|
+
green: "text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",
|
|
62
|
+
emerald: "text-emerald-600 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300",
|
|
63
|
+
teal: "text-teal-600 hover:text-teal-700 dark:text-teal-400 dark:hover:text-teal-300",
|
|
64
|
+
cyan: "text-cyan-600 hover:text-cyan-700 dark:text-cyan-400 dark:hover:text-cyan-300",
|
|
65
|
+
sky: "text-sky-600 hover:text-sky-700 dark:text-sky-400 dark:hover:text-sky-300",
|
|
66
|
+
blue: "text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",
|
|
67
|
+
indigo: "text-indigo-600 hover:text-indigo-700 dark:text-indigo-400 dark:hover:text-indigo-300",
|
|
68
|
+
violet: "text-violet-600 hover:text-violet-700 dark:text-violet-400 dark:hover:text-violet-300",
|
|
69
|
+
purple: "text-purple-600 hover:text-purple-700 dark:text-purple-400 dark:hover:text-purple-300",
|
|
70
|
+
fuchsia: "text-fuchsia-600 hover:text-fuchsia-700 dark:text-fuchsia-400 dark:hover:text-fuchsia-300",
|
|
71
|
+
pink: "text-pink-600 hover:text-pink-700 dark:text-pink-400 dark:hover:text-pink-300",
|
|
72
|
+
rose: "text-rose-600 hover:text-rose-700 dark:text-rose-400 dark:hover:text-rose-300"
|
|
73
|
+
};
|
|
74
|
+
const deco = underline === "always" ? "underline decoration-dotted underline-offset-4" : underline === "hover" ? "hover:underline decoration-dotted underline-offset-4" : "";
|
|
75
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
76
|
+
"span",
|
|
77
|
+
{
|
|
78
|
+
className: [base, sizeCls, COLORS[color], deco, className != null ? className : ""].join(" "),
|
|
79
|
+
...rest,
|
|
80
|
+
children: [
|
|
81
|
+
children,
|
|
82
|
+
showAnchorIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-[15px] w-[15px] opacity-80", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: [
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14 3h7v7" }),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 14L21 3" }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21 14v7h-7" }),
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 10l11 11" })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
const isExternal = external != null ? external : /^https?:\/\//i.test(href);
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href, target: isExternal ? "_blank" : rest.target, rel: isExternal ? "noopener noreferrer" : rest.rel, children: content });
|
|
93
|
+
}
|
package/dist/Link.mjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import NextLink from "next/link";
|
|
4
|
+
function Link({
|
|
5
|
+
href,
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
showAnchorIcon,
|
|
9
|
+
underline = "hover",
|
|
10
|
+
size = "md",
|
|
11
|
+
external,
|
|
12
|
+
color = "rose",
|
|
13
|
+
...rest
|
|
14
|
+
}) {
|
|
15
|
+
const base = "inline-flex items-center gap-1 font-medium transition";
|
|
16
|
+
const sizeCls = size === "sm" ? "text-sm" : "text-[15px]";
|
|
17
|
+
const COLORS = {
|
|
18
|
+
slate: "text-slate-600 hover:text-slate-700 dark:text-slate-300 dark:hover:text-slate-200",
|
|
19
|
+
gray: "text-gray-600 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200",
|
|
20
|
+
zinc: "text-zinc-600 hover:text-zinc-700 dark:text-zinc-300 dark:hover:text-zinc-200",
|
|
21
|
+
neutral: "text-neutral-600 hover:text-neutral-700 dark:text-neutral-300 dark:hover:text-neutral-200",
|
|
22
|
+
stone: "text-stone-600 hover:text-stone-700 dark:text-stone-300 dark:hover:text-stone-200",
|
|
23
|
+
red: "text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",
|
|
24
|
+
orange: "text-orange-600 hover:text-orange-700 dark:text-orange-400 dark:hover:text-orange-300",
|
|
25
|
+
amber: "text-amber-600 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-300",
|
|
26
|
+
yellow: "text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300",
|
|
27
|
+
lime: "text-lime-600 hover:text-lime-700 dark:text-lime-400 dark:hover:text-lime-300",
|
|
28
|
+
green: "text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",
|
|
29
|
+
emerald: "text-emerald-600 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300",
|
|
30
|
+
teal: "text-teal-600 hover:text-teal-700 dark:text-teal-400 dark:hover:text-teal-300",
|
|
31
|
+
cyan: "text-cyan-600 hover:text-cyan-700 dark:text-cyan-400 dark:hover:text-cyan-300",
|
|
32
|
+
sky: "text-sky-600 hover:text-sky-700 dark:text-sky-400 dark:hover:text-sky-300",
|
|
33
|
+
blue: "text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",
|
|
34
|
+
indigo: "text-indigo-600 hover:text-indigo-700 dark:text-indigo-400 dark:hover:text-indigo-300",
|
|
35
|
+
violet: "text-violet-600 hover:text-violet-700 dark:text-violet-400 dark:hover:text-violet-300",
|
|
36
|
+
purple: "text-purple-600 hover:text-purple-700 dark:text-purple-400 dark:hover:text-purple-300",
|
|
37
|
+
fuchsia: "text-fuchsia-600 hover:text-fuchsia-700 dark:text-fuchsia-400 dark:hover:text-fuchsia-300",
|
|
38
|
+
pink: "text-pink-600 hover:text-pink-700 dark:text-pink-400 dark:hover:text-pink-300",
|
|
39
|
+
rose: "text-rose-600 hover:text-rose-700 dark:text-rose-400 dark:hover:text-rose-300"
|
|
40
|
+
};
|
|
41
|
+
const deco = underline === "always" ? "underline decoration-dotted underline-offset-4" : underline === "hover" ? "hover:underline decoration-dotted underline-offset-4" : "";
|
|
42
|
+
const content = /* @__PURE__ */ jsxs(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
className: [base, sizeCls, COLORS[color], deco, className != null ? className : ""].join(" "),
|
|
46
|
+
...rest,
|
|
47
|
+
children: [
|
|
48
|
+
children,
|
|
49
|
+
showAnchorIcon && /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-[15px] w-[15px] opacity-80", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: [
|
|
50
|
+
/* @__PURE__ */ jsx("path", { d: "M14 3h7v7" }),
|
|
51
|
+
/* @__PURE__ */ jsx("path", { d: "M10 14L21 3" }),
|
|
52
|
+
/* @__PURE__ */ jsx("path", { d: "M21 14v7h-7" }),
|
|
53
|
+
/* @__PURE__ */ jsx("path", { d: "M3 10l11 11" })
|
|
54
|
+
] })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
const isExternal = external != null ? external : /^https?:\/\//i.test(href);
|
|
59
|
+
return /* @__PURE__ */ jsx(NextLink, { href, target: isExternal ? "_blank" : rest.target, rel: isExternal ? "noopener noreferrer" : rest.rel, children: content });
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
Link as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type MediaCardProps = {
|
|
4
|
+
imageUrl?: string | null;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
copyUrl?: string;
|
|
8
|
+
onRename?: () => void;
|
|
9
|
+
onReplace?: () => void;
|
|
10
|
+
onDelete?: () => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function MediaCard({ imageUrl, title, subtitle, copyUrl, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { type MediaCardProps, MediaCard as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type MediaCardProps = {
|
|
4
|
+
imageUrl?: string | null;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
copyUrl?: string;
|
|
8
|
+
onRename?: () => void;
|
|
9
|
+
onReplace?: () => void;
|
|
10
|
+
onDelete?: () => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function MediaCard({ imageUrl, title, subtitle, copyUrl, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { type MediaCardProps, MediaCard as default };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var MediaCard_exports = {};
|
|
31
|
+
__export(MediaCard_exports, {
|
|
32
|
+
default: () => MediaCard
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(MediaCard_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_image = __toESM(require("next/image"));
|
|
38
|
+
var import_ActionIconButton = __toESM(require("./ActionIconButton"));
|
|
39
|
+
function MediaCard({
|
|
40
|
+
imageUrl,
|
|
41
|
+
title,
|
|
42
|
+
subtitle,
|
|
43
|
+
copyUrl,
|
|
44
|
+
onRename,
|
|
45
|
+
onReplace,
|
|
46
|
+
onDelete,
|
|
47
|
+
className
|
|
48
|
+
}) {
|
|
49
|
+
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
50
|
+
const copy = async () => {
|
|
51
|
+
if (!copyUrl) return;
|
|
52
|
+
try {
|
|
53
|
+
await navigator.clipboard.writeText(copyUrl);
|
|
54
|
+
setCopied(true);
|
|
55
|
+
setTimeout(() => setCopied(false), 1200);
|
|
56
|
+
} catch {
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: [
|
|
63
|
+
"group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 shadow-sm ring-1 ring-black/5 backdrop-blur dark:border-white/10 dark:bg-white/5",
|
|
64
|
+
className != null ? className : ""
|
|
65
|
+
].join(" "),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full bg-slate-100 relative", children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_image.default,
|
|
69
|
+
{
|
|
70
|
+
src: imageUrl,
|
|
71
|
+
alt: title,
|
|
72
|
+
fill: true,
|
|
73
|
+
sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
|
|
74
|
+
className: "object-cover"
|
|
75
|
+
}
|
|
76
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }) }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2 p-2", children: [
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-sm font-medium", children: title }),
|
|
80
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-slate-500", children: subtitle })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
83
|
+
copyUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionIconButton.default, { title: copied ? "Copiado" : "Copiar URL", onClick: copy, children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
"svg",
|
|
85
|
+
{
|
|
86
|
+
viewBox: "0 0 24 24",
|
|
87
|
+
className: "h-4.5 w-4.5 text-emerald-600",
|
|
88
|
+
fill: "none",
|
|
89
|
+
stroke: "currentColor",
|
|
90
|
+
strokeWidth: "2",
|
|
91
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 13l4 4L19 7" })
|
|
92
|
+
}
|
|
93
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
|
+
"svg",
|
|
95
|
+
{
|
|
96
|
+
viewBox: "0 0 24 24",
|
|
97
|
+
className: "h-4.5 w-4.5",
|
|
98
|
+
fill: "none",
|
|
99
|
+
stroke: "currentColor",
|
|
100
|
+
strokeWidth: "2",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
onRename && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionIconButton.default, { title: "Renombrar", onClick: onRename, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
108
|
+
"svg",
|
|
109
|
+
{
|
|
110
|
+
viewBox: "0 0 24 24",
|
|
111
|
+
className: "h-4.5 w-4.5",
|
|
112
|
+
fill: "none",
|
|
113
|
+
stroke: "currentColor",
|
|
114
|
+
strokeWidth: "2",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 21v-4l12-12 4 4-12 12z" }),
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14 7l4 4" })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
) }),
|
|
121
|
+
onReplace && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionIconButton.default, { title: "Reemplazar", onClick: onReplace, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
"svg",
|
|
123
|
+
{
|
|
124
|
+
viewBox: "0 0 24 24",
|
|
125
|
+
className: "h-4.5 w-4.5",
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
strokeWidth: "2",
|
|
129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 5v14M5 12h14" })
|
|
130
|
+
}
|
|
131
|
+
) }),
|
|
132
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionIconButton.default, { title: "Eliminar", danger: true, onClick: onDelete, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
133
|
+
"svg",
|
|
134
|
+
{
|
|
135
|
+
viewBox: "0 0 24 24",
|
|
136
|
+
className: "h-4.5 w-4.5",
|
|
137
|
+
fill: "none",
|
|
138
|
+
stroke: "currentColor",
|
|
139
|
+
strokeWidth: "2",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 6h18" }),
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 6v14a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V6" }),
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 11v6M14 11v6" }),
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
) })
|
|
148
|
+
] })
|
|
149
|
+
] })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import Image from "next/image";
|
|
5
|
+
import ActionIconButton from "./ActionIconButton";
|
|
6
|
+
function MediaCard({
|
|
7
|
+
imageUrl,
|
|
8
|
+
title,
|
|
9
|
+
subtitle,
|
|
10
|
+
copyUrl,
|
|
11
|
+
onRename,
|
|
12
|
+
onReplace,
|
|
13
|
+
onDelete,
|
|
14
|
+
className
|
|
15
|
+
}) {
|
|
16
|
+
const [copied, setCopied] = useState(false);
|
|
17
|
+
const copy = async () => {
|
|
18
|
+
if (!copyUrl) return;
|
|
19
|
+
try {
|
|
20
|
+
await navigator.clipboard.writeText(copyUrl);
|
|
21
|
+
setCopied(true);
|
|
22
|
+
setTimeout(() => setCopied(false), 1200);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: [
|
|
30
|
+
"group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 shadow-sm ring-1 ring-black/5 backdrop-blur dark:border-white/10 dark:bg-white/5",
|
|
31
|
+
className != null ? className : ""
|
|
32
|
+
].join(" "),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "aspect-square w-full bg-slate-100 relative", children: imageUrl ? /* @__PURE__ */ jsx(
|
|
35
|
+
Image,
|
|
36
|
+
{
|
|
37
|
+
src: imageUrl,
|
|
38
|
+
alt: title,
|
|
39
|
+
fill: true,
|
|
40
|
+
sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
|
|
41
|
+
className: "object-cover"
|
|
42
|
+
}
|
|
43
|
+
) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 p-2", children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: title }),
|
|
47
|
+
subtitle && /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500", children: subtitle })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
50
|
+
copyUrl && /* @__PURE__ */ jsx(ActionIconButton, { title: copied ? "Copiado" : "Copiar URL", onClick: copy, children: copied ? /* @__PURE__ */ jsx(
|
|
51
|
+
"svg",
|
|
52
|
+
{
|
|
53
|
+
viewBox: "0 0 24 24",
|
|
54
|
+
className: "h-4.5 w-4.5 text-emerald-600",
|
|
55
|
+
fill: "none",
|
|
56
|
+
stroke: "currentColor",
|
|
57
|
+
strokeWidth: "2",
|
|
58
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ jsxs(
|
|
61
|
+
"svg",
|
|
62
|
+
{
|
|
63
|
+
viewBox: "0 0 24 24",
|
|
64
|
+
className: "h-4.5 w-4.5",
|
|
65
|
+
fill: "none",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: "2",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
70
|
+
/* @__PURE__ */ jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
) }),
|
|
74
|
+
onRename && /* @__PURE__ */ jsx(ActionIconButton, { title: "Renombrar", onClick: onRename, children: /* @__PURE__ */ jsxs(
|
|
75
|
+
"svg",
|
|
76
|
+
{
|
|
77
|
+
viewBox: "0 0 24 24",
|
|
78
|
+
className: "h-4.5 w-4.5",
|
|
79
|
+
fill: "none",
|
|
80
|
+
stroke: "currentColor",
|
|
81
|
+
strokeWidth: "2",
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx("path", { d: "M3 21v-4l12-12 4 4-12 12z" }),
|
|
84
|
+
/* @__PURE__ */ jsx("path", { d: "M14 7l4 4" })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
) }),
|
|
88
|
+
onReplace && /* @__PURE__ */ jsx(ActionIconButton, { title: "Reemplazar", onClick: onReplace, children: /* @__PURE__ */ jsx(
|
|
89
|
+
"svg",
|
|
90
|
+
{
|
|
91
|
+
viewBox: "0 0 24 24",
|
|
92
|
+
className: "h-4.5 w-4.5",
|
|
93
|
+
fill: "none",
|
|
94
|
+
stroke: "currentColor",
|
|
95
|
+
strokeWidth: "2",
|
|
96
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14" })
|
|
97
|
+
}
|
|
98
|
+
) }),
|
|
99
|
+
onDelete && /* @__PURE__ */ jsx(ActionIconButton, { title: "Eliminar", danger: true, onClick: onDelete, children: /* @__PURE__ */ jsxs(
|
|
100
|
+
"svg",
|
|
101
|
+
{
|
|
102
|
+
viewBox: "0 0 24 24",
|
|
103
|
+
className: "h-4.5 w-4.5",
|
|
104
|
+
fill: "none",
|
|
105
|
+
stroke: "currentColor",
|
|
106
|
+
strokeWidth: "2",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx("path", { d: "M3 6h18" }),
|
|
109
|
+
/* @__PURE__ */ jsx("path", { d: "M8 6v14a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V6" }),
|
|
110
|
+
/* @__PURE__ */ jsx("path", { d: "M10 11v6M14 11v6" }),
|
|
111
|
+
/* @__PURE__ */ jsx("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
) })
|
|
115
|
+
] })
|
|
116
|
+
] })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
MediaCard as default
|
|
123
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type MediaSelectorItem = {
|
|
4
|
+
id: number | string;
|
|
5
|
+
nombre: string;
|
|
6
|
+
url?: string | null;
|
|
7
|
+
};
|
|
8
|
+
type MediosAdapter = {
|
|
9
|
+
items: MediaSelectorItem[];
|
|
10
|
+
page: number;
|
|
11
|
+
lastPage: number;
|
|
12
|
+
setPage: (p: number) => void;
|
|
13
|
+
obtenerMedios: (opts?: {
|
|
14
|
+
page?: number;
|
|
15
|
+
per_page?: number;
|
|
16
|
+
}) => Promise<any>;
|
|
17
|
+
subirMedio: (file: File, opts?: {
|
|
18
|
+
onProgress?: (p: {
|
|
19
|
+
porcentaje: number;
|
|
20
|
+
}) => void;
|
|
21
|
+
}) => Promise<{
|
|
22
|
+
ok: boolean;
|
|
23
|
+
data?: any;
|
|
24
|
+
error?: any;
|
|
25
|
+
}>;
|
|
26
|
+
importFromUrl?: (url: string) => Promise<{
|
|
27
|
+
ok: boolean;
|
|
28
|
+
data?: any;
|
|
29
|
+
error?: any;
|
|
30
|
+
}>;
|
|
31
|
+
importarMedioDesdeUrl?: (url: string) => Promise<{
|
|
32
|
+
ok: boolean;
|
|
33
|
+
data?: any;
|
|
34
|
+
error?: any;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
declare function MediaSelector({ value, onChange, medios, accept, autoOpen, dialogOnly, onClose, }: {
|
|
38
|
+
value?: string | null;
|
|
39
|
+
onChange: (url: string | null, picked?: MediaSelectorItem | null) => void;
|
|
40
|
+
medios: MediosAdapter;
|
|
41
|
+
label?: string;
|
|
42
|
+
accept?: string;
|
|
43
|
+
autoOpen?: boolean;
|
|
44
|
+
dialogOnly?: boolean;
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
}): react_jsx_runtime.JSX.Element;
|
|
47
|
+
|
|
48
|
+
export { type MediaSelectorItem, type MediosAdapter, MediaSelector as default };
|