smooth-components 1.1.15 → 1.1.16
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.
|
@@ -1,51 +1,37 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.poster-container{position:relative;z-index:30;border-radius:2px;overflow:hidden;cursor:pointer;transform:translateY(0) scale(1);transition:all .4s cubic-bezier(.25,.46,.45,.94);border:18px solid;border-top-color:#1c1c1c;border-left-color:#181818;border-right-color:#0e0e0e;border-bottom-color:#0a0a0a;box-shadow:-1px -1px #ffffff12,1px 1px #00000080,0 2px 4px #0003,0 6px 12px #00000026,0 12px 24px #0000001f,0 20px 40px #0000001a,0 32px 64px #00000014}.poster-container:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:5;pointer-events:none;border-radius:1px;box-shadow:inset 0 3px 8px #0009,inset 0 -2px 6px #0006,inset 3px 0 8px #0006,inset -3px 0 8px #0006,inset 0 1px #000c}.poster-container:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:20;pointer-events:none;background:linear-gradient(130deg,rgba(255,255,255,.14) 0%,rgba(255,255,255,.06) 12%,rgba(255,255,255,.01) 28%,transparent 45%,transparent 60%,rgba(0,0,0,.03) 100%),linear-gradient(to bottom,rgba(255,255,255,.06) 0%,transparent 20%),linear-gradient(to bottom,#b4dcdc05,#b4dcdc03);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none;display:block;position:relative;z-index:1;filter:contrast(.97) brightness(.98);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image-glint{position:absolute;top:0;left:-120%;width:60%;height:100%;pointer-events:none;z-index:15;background:linear-gradient(105deg,transparent 20%,rgba(255,255,255,.15) 45%,rgba(255,255,255,.3) 50%,rgba(255,255,255,.15) 55%,transparent 80%);transform:skew(-18deg);transition:left .7s cubic-bezier(.25,.46,.45,.94)}.poster-container:hover{transform:scale(1.015) translateY(-4px);box-shadow:-1px -1px #ffffff1a,1px 1px #00000080,0 4px 8px #0003,0 8px 16px #00000026,0 16px 32px #0000001f,0 32px 64px #0000001a,0 48px 96px #00000014}.poster-container:hover:after{background:linear-gradient(125deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.08) 14%,rgba(255,255,255,.02) 30%,transparent 50%,transparent 65%,rgba(0,0,0,.04) 100%),linear-gradient(to bottom,rgba(255,255,255,.08) 0%,transparent 25%),linear-gradient(to bottom,#b4dcdc08,#b4dcdc04)}.poster-container:hover .poster-image{filter:contrast(1) brightness(1)}.poster-container:hover .poster-image-glint{left:140%}.poster-
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
5
|
-
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 560" fill="none"><rect width="400" height="560" fill="#1a1a1a"/><g transform="translate(200,250)"><rect x="-50" y="-40" width="100" height="72" rx="4" stroke="#555" stroke-width="3" fill="none"/><circle cx="-25" cy="-18" r="8" stroke="#555" stroke-width="2.5" fill="none"/><polyline points="-40,20 -15,-8 5,12 15,2 40,20" stroke="#555" stroke-width="2.5" fill="none" stroke-linejoin="round"/></g><text x="200" y="310" text-anchor="middle" font-family="system-ui,sans-serif" font-size="16" fill="#555">Image not found</text></svg>'
|
|
6
|
-
)}`, C = (c) => {
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.poster-container{position:relative;z-index:30;border-radius:2px;overflow:hidden;cursor:pointer;transform:translateY(0) scale(1);transition:all .4s cubic-bezier(.25,.46,.45,.94);border:18px solid;border-top-color:#1c1c1c;border-left-color:#181818;border-right-color:#0e0e0e;border-bottom-color:#0a0a0a;box-shadow:-1px -1px #ffffff12,1px 1px #00000080,0 2px 4px #0003,0 6px 12px #00000026,0 12px 24px #0000001f,0 20px 40px #0000001a,0 32px 64px #00000014}.poster-container:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:5;pointer-events:none;border-radius:1px;box-shadow:inset 0 3px 8px #0009,inset 0 -2px 6px #0006,inset 3px 0 8px #0006,inset -3px 0 8px #0006,inset 0 1px #000c}.poster-container:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:20;pointer-events:none;background:linear-gradient(130deg,rgba(255,255,255,.14) 0%,rgba(255,255,255,.06) 12%,rgba(255,255,255,.01) 28%,transparent 45%,transparent 60%,rgba(0,0,0,.03) 100%),linear-gradient(to bottom,rgba(255,255,255,.06) 0%,transparent 20%),linear-gradient(to bottom,#b4dcdc05,#b4dcdc03);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none;display:block;position:relative;z-index:1;filter:contrast(.97) brightness(.98);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image-glint{position:absolute;top:0;left:-120%;width:60%;height:100%;pointer-events:none;z-index:15;background:linear-gradient(105deg,transparent 20%,rgba(255,255,255,.15) 45%,rgba(255,255,255,.3) 50%,rgba(255,255,255,.15) 55%,transparent 80%);transform:skew(-18deg);transition:left .7s cubic-bezier(.25,.46,.45,.94)}.poster-container:hover{transform:scale(1.015) translateY(-4px);box-shadow:-1px -1px #ffffff1a,1px 1px #00000080,0 4px 8px #0003,0 8px 16px #00000026,0 16px 32px #0000001f,0 32px 64px #0000001a,0 48px 96px #00000014}.poster-container:hover:after{background:linear-gradient(125deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.08) 14%,rgba(255,255,255,.02) 30%,transparent 50%,transparent 65%,rgba(0,0,0,.04) 100%),linear-gradient(to bottom,rgba(255,255,255,.08) 0%,transparent 25%),linear-gradient(to bottom,#b4dcdc08,#b4dcdc04)}.poster-container:hover .poster-image{filter:contrast(1) brightness(1)}.poster-container:hover .poster-image-glint{left:140%}.poster-container--frame-sm{border-width:6px}.poster-container--frame-sm:before{box-shadow:inset 0 1px 3px #0009,inset 0 -1px 2px #0006,inset 1px 0 3px #0006,inset -1px 0 3px #0006,inset 0 1px #000c}.poster-container--frame-md{border-width:12px}.poster-container--frame-md:before{box-shadow:inset 0 2px 5px #0009,inset 0 -1px 4px #0006,inset 2px 0 5px #0006,inset -2px 0 5px #0006,inset 0 1px #000c}.poster-container--no-frame{border:none;box-shadow:none}.poster-container--no-frame:before{display:none}.poster-container--no-frame:after{display:none}.poster-container--no-frame:hover{box-shadow:none}.poster-container--no-frame:hover:after{display:none}.poster-container--scale-loading{opacity:0;transform:scale(.96);visibility:hidden}.poster-container--scale-loaded{opacity:1;transform:translateY(0) scale(1);visibility:visible;transition:opacity .5s ease,transform .5s ease,visibility 0ms}@media (min-width: 1024px){.poster-container{margin-bottom:0}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g, useCallback as A } from "react";
|
|
4
|
+
const F = 0.91, L = "auto", T = "auto", h = !0, u = !1, _ = "lg", S = (o) => {
|
|
7
5
|
const {
|
|
8
|
-
alt:
|
|
9
|
-
frameSize: t =
|
|
10
|
-
hasFrame:
|
|
11
|
-
hasGlintEffect:
|
|
12
|
-
src:
|
|
13
|
-
styles:
|
|
14
|
-
} =
|
|
15
|
-
opacity:
|
|
16
|
-
height:
|
|
17
|
-
width:
|
|
18
|
-
} =
|
|
19
|
-
|
|
20
|
-
}, []), A = i(() => {
|
|
21
|
-
r(!0);
|
|
6
|
+
alt: a,
|
|
7
|
+
frameSize: t = _,
|
|
8
|
+
hasFrame: e = h,
|
|
9
|
+
hasGlintEffect: n = u,
|
|
10
|
+
src: r,
|
|
11
|
+
styles: c
|
|
12
|
+
} = o, {
|
|
13
|
+
opacity: i = F,
|
|
14
|
+
height: l = T,
|
|
15
|
+
width: d = L
|
|
16
|
+
} = c ?? {}, [m, p] = g(!1), E = A(() => {
|
|
17
|
+
p(!0);
|
|
22
18
|
}, []);
|
|
23
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ f(
|
|
24
20
|
"div",
|
|
25
21
|
{
|
|
26
|
-
className: `poster-container${
|
|
22
|
+
className: `poster-container${e ? "" : " poster-container--no-frame"}${e && t !== "lg" ? ` poster-container--frame-${t}` : ""} poster-container--scale-${m ? "loaded" : "loading"}`,
|
|
27
23
|
style: {
|
|
28
|
-
opacity:
|
|
29
|
-
height:
|
|
30
|
-
width:
|
|
24
|
+
opacity: i,
|
|
25
|
+
height: l,
|
|
26
|
+
width: d
|
|
31
27
|
},
|
|
32
28
|
children: [
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
ref: e,
|
|
37
|
-
alt: f,
|
|
38
|
-
src: m || l,
|
|
39
|
-
className: `poster-image${s ? " poster-image--fallback" : ""}`,
|
|
40
|
-
onError: w,
|
|
41
|
-
onLoad: A
|
|
42
|
-
}
|
|
43
|
-
),
|
|
44
|
-
d && !s && /* @__PURE__ */ n("div", { className: "poster-image-glint" })
|
|
29
|
+
/* @__PURE__ */ s("img", { alt: a, src: r, className: "poster-image", onLoad: E }),
|
|
30
|
+
n && /* @__PURE__ */ s("div", { className: "poster-image-glint" })
|
|
45
31
|
]
|
|
46
32
|
}
|
|
47
33
|
);
|
|
48
34
|
};
|
|
49
35
|
export {
|
|
50
|
-
|
|
36
|
+
S as Poster
|
|
51
37
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.poster-container{position:relative;z-index:30;border-radius:2px;overflow:hidden;cursor:pointer;transform:translateY(0) scale(1);transition:all .4s cubic-bezier(.25,.46,.45,.94);border:18px solid;border-top-color:#1c1c1c;border-left-color:#181818;border-right-color:#0e0e0e;border-bottom-color:#0a0a0a;box-shadow:-1px -1px #ffffff12,1px 1px #00000080,0 2px 4px #0003,0 6px 12px #00000026,0 12px 24px #0000001f,0 20px 40px #0000001a,0 32px 64px #00000014}.poster-container:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:5;pointer-events:none;border-radius:1px;box-shadow:inset 0 3px 8px #0009,inset 0 -2px 6px #0006,inset 3px 0 8px #0006,inset -3px 0 8px #0006,inset 0 1px #000c}.poster-container:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:20;pointer-events:none;background:linear-gradient(130deg,rgba(255,255,255,.14) 0%,rgba(255,255,255,.06) 12%,rgba(255,255,255,.01) 28%,transparent 45%,transparent 60%,rgba(0,0,0,.03) 100%),linear-gradient(to bottom,rgba(255,255,255,.06) 0%,transparent 20%),linear-gradient(to bottom,#b4dcdc05,#b4dcdc03);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none;display:block;position:relative;z-index:1;filter:contrast(.97) brightness(.98);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image-glint{position:absolute;top:0;left:-120%;width:60%;height:100%;pointer-events:none;z-index:15;background:linear-gradient(105deg,transparent 20%,rgba(255,255,255,.15) 45%,rgba(255,255,255,.3) 50%,rgba(255,255,255,.15) 55%,transparent 80%);transform:skew(-18deg);transition:left .7s cubic-bezier(.25,.46,.45,.94)}.poster-container:hover{transform:scale(1.015) translateY(-4px);box-shadow:-1px -1px #ffffff1a,1px 1px #00000080,0 4px 8px #0003,0 8px 16px #00000026,0 16px 32px #0000001f,0 32px 64px #0000001a,0 48px 96px #00000014}.poster-container:hover:after{background:linear-gradient(125deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.08) 14%,rgba(255,255,255,.02) 30%,transparent 50%,transparent 65%,rgba(0,0,0,.04) 100%),linear-gradient(to bottom,rgba(255,255,255,.08) 0%,transparent 25%),linear-gradient(to bottom,#b4dcdc08,#b4dcdc04)}.poster-container:hover .poster-image{filter:contrast(1) brightness(1)}.poster-container:hover .poster-image-glint{left:140%}.poster-
|
|
2
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.SmoothComponents={},e["react/jsx-runtime"],e.React))})(this,function(e,t,s){"use strict";const
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.poster-container{position:relative;z-index:30;border-radius:2px;overflow:hidden;cursor:pointer;transform:translateY(0) scale(1);transition:all .4s cubic-bezier(.25,.46,.45,.94);border:18px solid;border-top-color:#1c1c1c;border-left-color:#181818;border-right-color:#0e0e0e;border-bottom-color:#0a0a0a;box-shadow:-1px -1px #ffffff12,1px 1px #00000080,0 2px 4px #0003,0 6px 12px #00000026,0 12px 24px #0000001f,0 20px 40px #0000001a,0 32px 64px #00000014}.poster-container:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:5;pointer-events:none;border-radius:1px;box-shadow:inset 0 3px 8px #0009,inset 0 -2px 6px #0006,inset 3px 0 8px #0006,inset -3px 0 8px #0006,inset 0 1px #000c}.poster-container:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:20;pointer-events:none;background:linear-gradient(130deg,rgba(255,255,255,.14) 0%,rgba(255,255,255,.06) 12%,rgba(255,255,255,.01) 28%,transparent 45%,transparent 60%,rgba(0,0,0,.03) 100%),linear-gradient(to bottom,rgba(255,255,255,.06) 0%,transparent 20%),linear-gradient(to bottom,#b4dcdc05,#b4dcdc03);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none;display:block;position:relative;z-index:1;filter:contrast(.97) brightness(.98);transition:all .4s cubic-bezier(.25,.46,.45,.94)}.poster-image-glint{position:absolute;top:0;left:-120%;width:60%;height:100%;pointer-events:none;z-index:15;background:linear-gradient(105deg,transparent 20%,rgba(255,255,255,.15) 45%,rgba(255,255,255,.3) 50%,rgba(255,255,255,.15) 55%,transparent 80%);transform:skew(-18deg);transition:left .7s cubic-bezier(.25,.46,.45,.94)}.poster-container:hover{transform:scale(1.015) translateY(-4px);box-shadow:-1px -1px #ffffff1a,1px 1px #00000080,0 4px 8px #0003,0 8px 16px #00000026,0 16px 32px #0000001f,0 32px 64px #0000001a,0 48px 96px #00000014}.poster-container:hover:after{background:linear-gradient(125deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.08) 14%,rgba(255,255,255,.02) 30%,transparent 50%,transparent 65%,rgba(0,0,0,.04) 100%),linear-gradient(to bottom,rgba(255,255,255,.08) 0%,transparent 25%),linear-gradient(to bottom,#b4dcdc08,#b4dcdc04)}.poster-container:hover .poster-image{filter:contrast(1) brightness(1)}.poster-container:hover .poster-image-glint{left:140%}.poster-container--frame-sm{border-width:6px}.poster-container--frame-sm:before{box-shadow:inset 0 1px 3px #0009,inset 0 -1px 2px #0006,inset 1px 0 3px #0006,inset -1px 0 3px #0006,inset 0 1px #000c}.poster-container--frame-md{border-width:12px}.poster-container--frame-md:before{box-shadow:inset 0 2px 5px #0009,inset 0 -1px 4px #0006,inset 2px 0 5px #0006,inset -2px 0 5px #0006,inset 0 1px #000c}.poster-container--no-frame{border:none;box-shadow:none}.poster-container--no-frame:before{display:none}.poster-container--no-frame:after{display:none}.poster-container--no-frame:hover{box-shadow:none}.poster-container--no-frame:hover:after{display:none}.poster-container--scale-loading{opacity:0;transform:scale(.96);visibility:hidden}.poster-container--scale-loaded{opacity:1;transform:translateY(0) scale(1);visibility:visible;transition:opacity .5s ease,transform .5s ease,visibility 0ms}@media (min-width: 1024px){.poster-container{margin-bottom:0}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.SmoothComponents={},e["react/jsx-runtime"],e.React))})(this,function(e,t,s){"use strict";const a="auto",r="auto",i="lg",c=d=>{const{alt:l,frameSize:o=i,hasFrame:n=!0,hasGlintEffect:f=!1,src:u,styles:m}=d,{opacity:p=.91,height:T=r,width:E=a}=m??{},[A,F]=s.useState(!1),h=s.useCallback(()=>{F(!0)},[]);return t.jsxs("div",{className:`poster-container${n?"":" poster-container--no-frame"}${n&&o!=="lg"?` poster-container--frame-${o}`:""} poster-container--scale-${A?"loaded":"loading"}`,style:{opacity:p,height:T,width:E},children:[t.jsx("img",{alt:l,src:u,className:"poster-image",onLoad:h}),f&&t.jsx("div",{className:"poster-image-glint"})]})};e.Poster=c,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smooth-components",
|
|
3
3
|
"description": "A collection of smooth and elegant React components for building modern web applications.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.16",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Jaime Torres",
|
|
7
7
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"format": "prettier --write .",
|
|
25
25
|
"lint": "eslint .",
|
|
26
26
|
"preview": "vite preview",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
27
28
|
"prepare": "husky"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|