smooth-components 1.1.6 β 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/README.md +42 -51
- 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/README.md
CHANGED
|
@@ -1,36 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# smooth-components
|
|
2
2
|
|
|
3
3
|
**Elegant, customizable, and accessible React components.**
|
|
4
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.
|
|
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.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/smooth-components)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Features
|
|
13
13
|
|
|
14
|
-
|
|
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
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
15
24
|
|
|
16
25
|
```bash
|
|
17
26
|
npm install smooth-components
|
|
18
|
-
# or
|
|
19
|
-
yarn add smooth-components
|
|
20
27
|
```
|
|
21
28
|
|
|
22
29
|
---
|
|
23
30
|
|
|
24
|
-
##
|
|
31
|
+
## Poster
|
|
25
32
|
|
|
26
|
-
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.
|
|
27
34
|
|
|
28
|
-
###
|
|
35
|
+
### Usage
|
|
29
36
|
|
|
30
37
|
```tsx
|
|
31
|
-
import { Poster } from
|
|
38
|
+
import { Poster } from "smooth-components";
|
|
32
39
|
|
|
33
|
-
|
|
40
|
+
function App() {
|
|
34
41
|
return (
|
|
35
42
|
<Poster
|
|
36
43
|
alt="Cyberpunk City"
|
|
@@ -38,65 +45,49 @@ export default function App() {
|
|
|
38
45
|
styles={{
|
|
39
46
|
width: 240,
|
|
40
47
|
height: 360,
|
|
41
|
-
borderColor: '#555',
|
|
42
48
|
opacity: 0.95,
|
|
43
49
|
}}
|
|
44
50
|
/>
|
|
45
|
-
)
|
|
51
|
+
);
|
|
46
52
|
}
|
|
47
53
|
```
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### π§ Props
|
|
55
|
+
### Props
|
|
52
56
|
|
|
53
|
-
| Prop
|
|
54
|
-
|
|
|
55
|
-
| `alt`
|
|
56
|
-
| `src`
|
|
57
|
-
| `styles`
|
|
58
|
-
| `
|
|
59
|
-
| `styles.width` | `number \| string` | `'auto'` | Width of the image container. |
|
|
60
|
-
| `styles.height` | `number \| string` | `'auto'` | Height of the image container. |
|
|
61
|
-
| `styles.borderColor` | `string` | `'oklch(12.9% 0.042 264.695)'` | Color of the border around the poster. |
|
|
62
|
-
| `hasGlintEffect` | `boolean` | `true` | Enables a subtle animated glint overlay across the image. |
|
|
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
63
|
|
|
64
|
-
|
|
64
|
+
#### `PosterStyles`
|
|
65
65
|
|
|
66
|
-
|
|
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 |
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
This is just the beginning. Stay tuned for new additions including:
|
|
71
|
-
|
|
72
|
-
* Modals
|
|
73
|
-
* Cards
|
|
74
|
-
* Loaders
|
|
75
|
-
* And more...
|
|
72
|
+
> Numbers are interpreted as `px`. You can also pass CSS units like `"50%"`, `"20rem"`, etc.
|
|
76
73
|
|
|
77
74
|
---
|
|
78
75
|
|
|
79
|
-
##
|
|
76
|
+
## More Components Coming Soon
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
See the full license in [LICENSE](./LICENSE).
|
|
78
|
+
Stay tuned for new additions including modals, cards, loaders, and more.
|
|
83
79
|
|
|
84
80
|
---
|
|
85
81
|
|
|
86
|
-
##
|
|
82
|
+
## License
|
|
87
83
|
|
|
88
|
-
|
|
89
|
-
* πΌ [LinkedIn](https://www.linkedin.com/in/jaime00)
|
|
90
|
-
* π§ [Email](mailto:imjaimetorresv@gmail.com)
|
|
91
|
-
* π [GitHub](https://github.com/jaime00)
|
|
84
|
+
MIT Β© [Jaime Torres](https://github.com/jaime00)
|
|
92
85
|
|
|
93
86
|
---
|
|
94
87
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
* Usage with Tailwind or a specific framework
|
|
98
|
-
* Storybook/preview link
|
|
99
|
-
* Development & contribution guide
|
|
100
|
-
* More animated gifs/screenshots
|
|
88
|
+
## Connect
|
|
101
89
|
|
|
102
|
-
|
|
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",
|