framepexls-ui-lib 0.3.31 → 0.3.33

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.
@@ -11,7 +11,7 @@ type CheckboxProps = Omit<React__default.InputHTMLAttributes<HTMLInputElement>,
11
11
  className?: string;
12
12
  inputClassName?: string;
13
13
  };
14
- declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
14
+ declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
15
15
  label?: React__default.ReactNode;
16
16
  description?: React__default.ReactNode;
17
17
  error?: boolean;
@@ -11,7 +11,7 @@ type CheckboxProps = Omit<React__default.InputHTMLAttributes<HTMLInputElement>,
11
11
  className?: string;
12
12
  inputClassName?: string;
13
13
  };
14
- declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
14
+ declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
15
15
  label?: React__default.ReactNode;
16
16
  description?: React__default.ReactNode;
17
17
  error?: boolean;
@@ -6,11 +6,12 @@ type MediaCardProps = {
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
8
  mimeType?: string | null;
9
+ isPrivateImage?: boolean;
9
10
  onRename?: () => void;
10
11
  onReplace?: () => void;
11
12
  onDelete?: () => void;
12
13
  className?: string;
13
14
  };
14
- declare function MediaCard({ imageUrl, title, subtitle, copyUrl, mimeType, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
15
+ declare function MediaCard({ imageUrl, title, subtitle, copyUrl, mimeType, isPrivateImage, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { type MediaCardProps, MediaCard as default };
@@ -6,11 +6,12 @@ type MediaCardProps = {
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
8
  mimeType?: string | null;
9
+ isPrivateImage?: boolean;
9
10
  onRename?: () => void;
10
11
  onReplace?: () => void;
11
12
  onDelete?: () => void;
12
13
  className?: string;
13
14
  };
14
- declare function MediaCard({ imageUrl, title, subtitle, copyUrl, mimeType, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
15
+ declare function MediaCard({ imageUrl, title, subtitle, copyUrl, mimeType, isPrivateImage, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { type MediaCardProps, MediaCard as default };
package/dist/MediaCard.js CHANGED
@@ -44,6 +44,7 @@ function MediaCard({
44
44
  subtitle,
45
45
  copyUrl,
46
46
  mimeType,
47
+ isPrivateImage,
47
48
  onRename,
48
49
  onReplace,
49
50
  onDelete,
@@ -80,7 +81,8 @@ function MediaCard({
80
81
  alt: title,
81
82
  fill: true,
82
83
  sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
83
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
84
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
85
+ unoptimized: Boolean(isPrivateImage)
84
86
  }
85
87
  );
86
88
  }
@@ -11,6 +11,7 @@ function MediaCard({
11
11
  subtitle,
12
12
  copyUrl,
13
13
  mimeType,
14
+ isPrivateImage,
14
15
  onRename,
15
16
  onReplace,
16
17
  onDelete,
@@ -47,7 +48,8 @@ function MediaCard({
47
48
  alt: title,
48
49
  fill: true,
49
50
  sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
50
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
51
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
52
+ unoptimized: Boolean(isPrivateImage)
51
53
  }
52
54
  );
53
55
  }
@@ -6,6 +6,7 @@ type MediaTileProps = {
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
8
  loading?: boolean;
9
+ isPrivateImage?: boolean;
9
10
  onPreview?: () => void;
10
11
  onRename?: () => void;
11
12
  onReplace?: () => void;
@@ -13,6 +14,6 @@ type MediaTileProps = {
13
14
  menuSize?: "sm" | "md" | "lg";
14
15
  className?: string;
15
16
  };
16
- declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, 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_runtime.JSX.Element;
17
18
 
18
19
  export { type MediaTileProps, MediaTile as default };
@@ -6,6 +6,7 @@ type MediaTileProps = {
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
8
  loading?: boolean;
9
+ isPrivateImage?: boolean;
9
10
  onPreview?: () => void;
10
11
  onRename?: () => void;
11
12
  onReplace?: () => void;
@@ -13,6 +14,6 @@ type MediaTileProps = {
13
14
  menuSize?: "sm" | "md" | "lg";
14
15
  className?: string;
15
16
  };
16
- declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, 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_runtime.JSX.Element;
17
18
 
18
19
  export { type MediaTileProps, MediaTile as default };
package/dist/MediaTile.js CHANGED
@@ -48,6 +48,7 @@ function MediaTile({
48
48
  onRename,
49
49
  onReplace,
50
50
  onDelete,
51
+ isPrivateImage,
51
52
  loading,
52
53
  menuSize = "md",
53
54
  className
@@ -64,7 +65,7 @@ function MediaTile({
64
65
  };
65
66
  const btnSize = menuSize === "lg" ? "h-11 w-11" : menuSize === "sm" ? "h-8 w-8" : "h-9 w-9";
66
67
  const iconSize = menuSize === "lg" ? "h-7 w-7" : menuSize === "sm" ? "h-5 w-5" : "h-6 w-6";
67
- const ImgWrap = onPreview ? (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.default, { unstyled: true, type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props });
68
+ const hasMenuActions = Boolean(copyUrl || onRename || onReplace || onDelete);
68
69
  if (loading) {
69
70
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
70
71
  "div",
@@ -93,7 +94,29 @@ function MediaTile({
93
94
  className != null ? className : ""
94
95
  ].join(" "),
95
96
  children: [
96
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ImgWrap, { className: "aspect-square w-full bg-slate-100 relative text-left", children: [
97
+ onPreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
98
+ import_Button.default,
99
+ {
100
+ unstyled: true,
101
+ type: "button",
102
+ onClick: onPreview,
103
+ className: "aspect-square w-full bg-slate-100 relative text-left",
104
+ children: [
105
+ imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ import_image.default,
107
+ {
108
+ src: imageUrl,
109
+ alt: title,
110
+ fill: true,
111
+ sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
112
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
113
+ unoptimized: Boolean(isPrivateImage)
114
+ }
115
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }),
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
117
+ ]
118
+ }
119
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "aspect-square w-full bg-slate-100 relative text-left", children: [
97
120
  imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
121
  import_image.default,
99
122
  {
@@ -101,7 +124,8 @@ function MediaTile({
101
124
  alt: title,
102
125
  fill: true,
103
126
  sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
104
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
127
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
128
+ unoptimized: Boolean(isPrivateImage)
105
129
  }
106
130
  ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }),
107
131
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
@@ -111,7 +135,7 @@ function MediaTile({
111
135
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-sm font-medium", children: title }),
112
136
  subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-slate-500 dark:text-slate-400", children: subtitle })
113
137
  ] }),
114
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Dropdown.default, { children: [
138
+ hasMenuActions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Dropdown.default, { children: [
115
139
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dropdown.default.Trigger, { "aria-label": "Acciones", className: [btnSize, "p-0 !gap-0"].join(" "), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", className: iconSize, fill: "currentColor", children: [
116
140
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "5", r: "2" }),
117
141
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "2" }),
@@ -15,6 +15,7 @@ function MediaTile({
15
15
  onRename,
16
16
  onReplace,
17
17
  onDelete,
18
+ isPrivateImage,
18
19
  loading,
19
20
  menuSize = "md",
20
21
  className
@@ -31,7 +32,7 @@ function MediaTile({
31
32
  };
32
33
  const btnSize = menuSize === "lg" ? "h-11 w-11" : menuSize === "sm" ? "h-8 w-8" : "h-9 w-9";
33
34
  const iconSize = menuSize === "lg" ? "h-7 w-7" : menuSize === "sm" ? "h-5 w-5" : "h-6 w-6";
34
- const ImgWrap = onPreview ? (props) => /* @__PURE__ */ jsx(Button, { unstyled: true, type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ jsx("div", { ...props });
35
+ const hasMenuActions = Boolean(copyUrl || onRename || onReplace || onDelete);
35
36
  if (loading) {
36
37
  return /* @__PURE__ */ jsxs(
37
38
  "div",
@@ -60,7 +61,29 @@ function MediaTile({
60
61
  className != null ? className : ""
61
62
  ].join(" "),
62
63
  children: [
63
- /* @__PURE__ */ jsxs(ImgWrap, { className: "aspect-square w-full bg-slate-100 relative text-left", children: [
64
+ onPreview ? /* @__PURE__ */ jsxs(
65
+ Button,
66
+ {
67
+ unstyled: true,
68
+ type: "button",
69
+ onClick: onPreview,
70
+ className: "aspect-square w-full bg-slate-100 relative text-left",
71
+ children: [
72
+ imageUrl ? /* @__PURE__ */ jsx(
73
+ Image,
74
+ {
75
+ src: imageUrl,
76
+ alt: title,
77
+ fill: true,
78
+ sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
79
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
80
+ unoptimized: Boolean(isPrivateImage)
81
+ }
82
+ ) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }),
83
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
84
+ ]
85
+ }
86
+ ) : /* @__PURE__ */ jsxs("div", { className: "aspect-square w-full bg-slate-100 relative text-left", children: [
64
87
  imageUrl ? /* @__PURE__ */ jsx(
65
88
  Image,
66
89
  {
@@ -68,7 +91,8 @@ function MediaTile({
68
91
  alt: title,
69
92
  fill: true,
70
93
  sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
71
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
94
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
95
+ unoptimized: Boolean(isPrivateImage)
72
96
  }
73
97
  ) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }),
74
98
  /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
@@ -78,7 +102,7 @@ function MediaTile({
78
102
  /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: title }),
79
103
  subtitle && /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500 dark:text-slate-400", children: subtitle })
80
104
  ] }),
81
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxs(Dropdown, { children: [
105
+ hasMenuActions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxs(Dropdown, { children: [
82
106
  /* @__PURE__ */ jsx(Dropdown.Trigger, { "aria-label": "Acciones", className: [btnSize, "p-0 !gap-0"].join(" "), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: iconSize, fill: "currentColor", children: [
83
107
  /* @__PURE__ */ jsx("circle", { cx: "12", cy: "5", r: "2" }),
84
108
  /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "2" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepexls-ui-lib",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Componentes UI de Framepexls para React/Next.",