smooth-components 1.1.5 β 1.1.7
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/LICENSE +21 -0
- package/README.md +50 -33
- package/dist/akira.webp +0 -0
- package/dist/smooth-components.d.ts +3 -3
- package/dist/smooth-components.js +9 -20
- package/dist/smooth-components.umd.cjs +2 -2
- package/package.json +7 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jaime Torres
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# smooth-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Elegant, customizable, and accessible React components.**
|
|
4
|
+
|
|
5
|
+
`smooth-components` is a growing library of beautifully designed, reusable UI components for React. Whether you're building a portfolio, dashboard, or e-commerce site, these components help you move fast and look great β without sacrificing accessibility or flexibility.
|
|
4
6
|
|
|
5
7
|
[](https://www.npmjs.com/package/smooth-components)
|
|
6
8
|
[](https://opensource.org/licenses/MIT)
|
|
7
9
|
|
|
8
10
|
---
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Zero CSS imports** β styles are automatically injected at runtime, no extra setup needed
|
|
15
|
+
- **Fully typed** β built with TypeScript, includes type declarations out of the box
|
|
16
|
+
- **Accessible** β components enforce accessibility props (e.g. required `alt` text)
|
|
17
|
+
- **Smooth animations** β hover effects, glint overlays, 3D borders, and glass reflections
|
|
18
|
+
- **Lightweight** β React and react-dom are externalized, keeping the bundle small
|
|
19
|
+
- **ESM & UMD** β works with any bundler or via CDN
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
13
24
|
|
|
14
25
|
```bash
|
|
15
26
|
npm install smooth-components
|
|
16
|
-
# or
|
|
17
|
-
yarn add smooth-components
|
|
18
27
|
```
|
|
19
28
|
|
|
20
29
|
---
|
|
21
30
|
|
|
22
|
-
##
|
|
31
|
+
## Poster
|
|
23
32
|
|
|
24
|
-
The
|
|
33
|
+
The `<Poster />` component is ideal for showcasing images like movie posters, artworks, product covers, or any visual element that needs emphasis. It includes a 3D border effect, glass overlay, and an optional animated **glint** effect on hover.
|
|
25
34
|
|
|
26
|
-
###
|
|
35
|
+
### Usage
|
|
27
36
|
|
|
28
37
|
```tsx
|
|
29
|
-
import { Poster } from
|
|
38
|
+
import { Poster } from "smooth-components";
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
function App() {
|
|
32
41
|
return (
|
|
33
42
|
<Poster
|
|
34
43
|
alt="Cyberpunk City"
|
|
@@ -36,41 +45,49 @@ export default function App() {
|
|
|
36
45
|
styles={{
|
|
37
46
|
width: 240,
|
|
38
47
|
height: 360,
|
|
39
|
-
borderColor: '#555',
|
|
40
48
|
opacity: 0.95,
|
|
41
49
|
}}
|
|
42
50
|
/>
|
|
43
|
-
)
|
|
51
|
+
);
|
|
44
52
|
}
|
|
45
53
|
```
|
|
46
54
|
|
|
47
|
-
###
|
|
55
|
+
### Props
|
|
56
|
+
|
|
57
|
+
| Prop | Type | Default | Required | Description |
|
|
58
|
+
| ---------------- | -------------- | ------- | -------- | ------------------------------------------------ |
|
|
59
|
+
| `alt` | `string` | β | Yes | Descriptive alt text for accessibility. |
|
|
60
|
+
| `src` | `string` | β | Yes | Path or URL to the image. |
|
|
61
|
+
| `styles` | `PosterStyles` | β | No | Custom styles for the container (see below). |
|
|
62
|
+
| `hasGlintEffect` | `boolean` | `true` | No | Enables animated glint overlay across the image. |
|
|
63
|
+
|
|
64
|
+
#### `PosterStyles`
|
|
65
|
+
|
|
66
|
+
| Property | Type | Default | Description |
|
|
67
|
+
| --------- | ------------------ | -------- | ------------------------------ |
|
|
68
|
+
| `opacity` | `number \| string` | `0.91` | Opacity of the image container |
|
|
69
|
+
| `width` | `number \| string` | `"auto"` | Width of the image container |
|
|
70
|
+
| `height` | `number \| string` | `"auto"` | Height of the image container |
|
|
71
|
+
|
|
72
|
+
> Numbers are interpreted as `px`. You can also pass CSS units like `"50%"`, `"20rem"`, etc.
|
|
73
|
+
|
|
74
|
+
---
|
|
48
75
|
|
|
49
|
-
|
|
50
|
-
| -------------------- | ------------------ | --------- | ------------------------------------------- |
|
|
51
|
-
| `alt` | `string` | β | Alternative text for the image. |
|
|
52
|
-
| `src` | `string` | β | Image source path or URL. |
|
|
53
|
-
| `styles` | `object` | β | Optional inline styles for the container. |
|
|
54
|
-
| `styles.opacity` | `number \| string` | `1` | Opacity of the poster container. |
|
|
55
|
-
| `styles.width` | `number \| string` | `'200px'` | Width of the poster. |
|
|
56
|
-
| `styles.height` | `number \| string` | `'300px'` | Height of the poster. |
|
|
57
|
-
| `styles.borderColor` | `string` | `'#ccc'` | Border color around the poster. |
|
|
58
|
-
| `hasGlintEffect` | `boolean` | `true` | Whether to show the animated glint overlay. |
|
|
76
|
+
## More Components Coming Soon
|
|
59
77
|
|
|
60
|
-
|
|
78
|
+
Stay tuned for new additions including modals, cards, loaders, and more.
|
|
61
79
|
|
|
62
80
|
---
|
|
63
81
|
|
|
64
|
-
##
|
|
82
|
+
## License
|
|
65
83
|
|
|
66
|
-
|
|
67
|
-
See [LICENSE](LICENSE) for more information.
|
|
84
|
+
MIT Β© [Jaime Torres](https://github.com/jaime00)
|
|
68
85
|
|
|
69
86
|
---
|
|
70
87
|
|
|
71
|
-
##
|
|
88
|
+
## Connect
|
|
72
89
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
90
|
+
- [Portfolio](https://jaime00portfolio.netlify.app/)
|
|
91
|
+
- [LinkedIn](https://www.linkedin.com/in/jaime00)
|
|
92
|
+
- [GitHub](https://github.com/jaime00)
|
|
93
|
+
- [Email](mailto:imjaimetorresv@gmail.com)
|
package/dist/akira.webp
ADDED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
import { PosterProps } from '
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PosterProps } from '../types/poster';
|
|
3
3
|
|
|
4
|
-
export declare const Poster: (
|
|
4
|
+
export declare const Poster: (props: PosterProps) => JSX.Element;
|
|
5
5
|
|
|
6
6
|
export { }
|
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(
|
|
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%}@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
2
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
const m = 0.91, T = "auto", E = "auto", p =
|
|
4
|
-
alt: o,
|
|
5
|
-
src: s,
|
|
6
|
-
styles: e,
|
|
7
|
-
hasGlintEffect: r = _
|
|
8
|
-
}) => {
|
|
9
|
-
const {
|
|
10
|
-
opacity: c = m,
|
|
11
|
-
height: a = E,
|
|
12
|
-
width: i = T,
|
|
13
|
-
borderColor: n = p
|
|
14
|
-
} = e ?? {};
|
|
3
|
+
const m = 0.91, T = "auto", E = "auto", p = !0, h = (s) => {
|
|
4
|
+
const { alt: e, hasGlintEffect: o = p, src: c, styles: a } = s, { opacity: i = m, height: n = E, width: r = T } = a ?? {};
|
|
15
5
|
return /* @__PURE__ */ l(
|
|
16
6
|
"div",
|
|
17
7
|
{
|
|
18
8
|
className: "poster-container",
|
|
19
9
|
style: {
|
|
20
|
-
opacity:
|
|
21
|
-
height:
|
|
22
|
-
width:
|
|
23
|
-
borderColor: n
|
|
10
|
+
opacity: i,
|
|
11
|
+
height: n,
|
|
12
|
+
width: r
|
|
24
13
|
},
|
|
25
14
|
children: [
|
|
26
|
-
/* @__PURE__ */ t("img", { alt:
|
|
27
|
-
|
|
15
|
+
/* @__PURE__ */ t("img", { alt: e, src: c, className: "poster-image" }),
|
|
16
|
+
o && /* @__PURE__ */ t("div", { className: "poster-image-glint" })
|
|
28
17
|
]
|
|
29
18
|
}
|
|
30
19
|
);
|
|
31
20
|
};
|
|
32
21
|
export {
|
|
33
|
-
|
|
22
|
+
h as Poster
|
|
34
23
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(
|
|
2
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.SmoothComponents={},e["react/jsx-runtime"]))})(this,function(e,t){"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%}@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")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.SmoothComponents={},e["react/jsx-runtime"]))})(this,function(e,t){"use strict";const s="auto",o="auto",n=i=>{const{alt:r,hasGlintEffect:c=!0,src:a,styles:d}=i,{opacity:u=.91,height:T=o,width:f=s}=d??{};return t.jsxs("div",{className:"poster-container",style:{opacity:u,height:T,width:f},children:[t.jsx("img",{alt:r,src:a,className:"poster-image"}),c&&t.jsx("div",{className:"poster-image-glint"})]})};e.Poster=n,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.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Jaime Torres",
|
|
7
7
|
"license": "MIT",
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "vite --port 3000",
|
|
23
23
|
"build": "tsc -b && vite build",
|
|
24
|
+
"format": "prettier --write .",
|
|
24
25
|
"lint": "eslint .",
|
|
25
|
-
"preview": "vite preview"
|
|
26
|
+
"preview": "vite preview",
|
|
27
|
+
"prepare": "husky"
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
30
|
"react": "^19.1.0",
|
|
@@ -30,6 +32,7 @@
|
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@eslint/js": "^9.25.0",
|
|
35
|
+
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
33
36
|
"@types/node": "^24.0.1",
|
|
34
37
|
"@types/react": "^19.1.2",
|
|
35
38
|
"@types/react-dom": "^19.1.2",
|
|
@@ -38,6 +41,8 @@
|
|
|
38
41
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
39
42
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
40
43
|
"globals": "^16.0.0",
|
|
44
|
+
"husky": "^9.1.7",
|
|
45
|
+
"prettier": "^3.8.1",
|
|
41
46
|
"typescript": "~5.8.3",
|
|
42
47
|
"typescript-eslint": "^8.30.1",
|
|
43
48
|
"vite": "^6.3.5",
|