@t7blocks/ui 0.0.1 → 0.0.3
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 +78 -0
- package/package.json +1 -1
- package/.turbo/turbo-build.log +0 -22
- package/RULES.md +0 -104
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/src/components/button/button-1/Button1.tsx +0 -50
- package/src/components/button/button-1/index.ts +0 -1
- package/src/index.ts +0 -4
- package/src/types/index.ts +0 -1
- package/tsconfig.json +0 -8
- package/tsup.config.ts +0 -10
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @t7blocks/ui
|
|
2
|
+
|
|
3
|
+
Premium-grade UI components for React. The kind you see on high-end landing pages and Framer templates — built with GSAP, Framer Motion, and custom animation logic. Ship faster without starting from scratch.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@t7blocks/ui)
|
|
6
|
+
[](https://www.npmjs.com/package/@t7blocks/ui)
|
|
7
|
+
[](https://github.com/Ethan4582/t7block-free/blob/master/LICENSE)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# npm
|
|
15
|
+
npm install @t7blocks/ui
|
|
16
|
+
|
|
17
|
+
# yarn
|
|
18
|
+
yarn add @t7blocks/ui
|
|
19
|
+
|
|
20
|
+
# pnpm
|
|
21
|
+
pnpm add @t7blocks/ui
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Some components require peer dependencies. Each component page on [t7blocks.com](https://t7blocks.com) lists exactly what to install.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Button1 } from '@t7blocks/ui'
|
|
32
|
+
|
|
33
|
+
export default function App() {
|
|
34
|
+
return <Button1 label="Get started" variant="primary" />
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Components
|
|
41
|
+
|
|
42
|
+
Browse all components with live demos, props tables, and install instructions at **[t7blocks.xyz](https://t7blocks.xyz)**.
|
|
43
|
+
|
|
44
|
+
More components are added regularly. Star the repo to stay updated.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Prefer to own the source?
|
|
49
|
+
|
|
50
|
+
Use the CLI to copy any component directly into your project as an editable file:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx @t7blocks/cli add button-1
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The file is written to `./components/ui/` in your project. You own it and can modify it freely.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Requirements
|
|
61
|
+
|
|
62
|
+
- React 18+
|
|
63
|
+
- Node.js 18+
|
|
64
|
+
- TypeScript recommended
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Premium Components
|
|
69
|
+
|
|
70
|
+
Hero sections, background effects, and advanced blocks are available to Pro members at **[t7blocks.xyz](https://t7blocks.xyz)**. Premium components include full source access, CLI download, and props documentation.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
Copyright © 2025 Ashirwad Singh. Free components are available under a custom license that permits personal and commercial use with attribution. Redistribution as a standalone library or template kit is not permitted.
|
|
77
|
+
|
|
78
|
+
Read the full license → [LICENSE](https://github.com/Ethan4582/t7block-free/blob/master/LICENSE)
|
package/package.json
CHANGED
package/.turbo/turbo-build.log
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @t7blocks/ui@0.0.1 build C:\Users\singh\Desktop\Dev\T7blocks\packages\ui
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.5.1
|
|
8
|
-
[34mCLI[39m Using tsup config: C:\Users\singh\Desktop\Dev\T7blocks\packages\ui\tsup.config.ts
|
|
9
|
-
[34mCLI[39m Target: es2020
|
|
10
|
-
[34mCLI[39m Cleaning output folder
|
|
11
|
-
[34mCJS[39m Build start
|
|
12
|
-
[34mESM[39m Build start
|
|
13
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m1.08 KB[39m
|
|
14
|
-
[32mESM[39m [1mdist\index.mjs.map [22m[32m2.13 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in 54ms
|
|
16
|
-
[32mCJS[39m [1mdist\index.js [22m[32m2.17 KB[39m
|
|
17
|
-
[32mCJS[39m [1mdist\index.js.map [22m[32m2.36 KB[39m
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in 55ms
|
|
19
|
-
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in 1666ms
|
|
21
|
-
[32mDTS[39m [1mdist\index.d.ts [22m[32m326.00 B[39m
|
|
22
|
-
[32mDTS[39m [1mdist\index.d.mts [22m[32m326.00 B[39m
|
package/RULES.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# RULES.md — packages/ui
|
|
2
|
-
|
|
3
|
-
## What this package is
|
|
4
|
-
|
|
5
|
-
The **published npm package** `@t7blocks`. This is what users install.
|
|
6
|
-
It contains only free component source code. It is built with tsup and published to npm.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Core Constraints
|
|
11
|
-
|
|
12
|
-
- Only free components live here. Premium components never enter this repo.
|
|
13
|
-
- Every export must be tree-shakeable — named exports only, no default exports from `index.ts`.
|
|
14
|
-
- This package has no runtime dependencies. Only peer dependencies.
|
|
15
|
-
- Peer dependencies: `react ^18`, and whatever animation library the component uses (e.g. `framer-motion`, `gsap`, `lenis`). Never bundle these.
|
|
16
|
-
- Never import from `apps/` — this package is standalone.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Folder Structure
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
src/
|
|
24
|
-
├── index.ts ← barrel export, only file to edit when adding a component
|
|
25
|
-
├── components/
|
|
26
|
-
│ └── [type]/ ← matches the category type in registry
|
|
27
|
-
│ └── [component-name]/
|
|
28
|
-
│ ├── [ComponentName].tsx ← component source
|
|
29
|
-
│ ├── [ComponentName].css ← scoped styles if needed (optional)
|
|
30
|
-
│ └── index.ts ← re-exports the component
|
|
31
|
-
└── types/
|
|
32
|
-
└── index.ts ← shared prop types
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Example for `button-1` in category `button`:
|
|
36
|
-
```
|
|
37
|
-
src/components/button/button-1/Button1.tsx
|
|
38
|
-
src/components/button/button-1/index.ts
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Adding a New Component — Exact Steps
|
|
44
|
-
|
|
45
|
-
1. Create the folder: `src/components/[type]/[component-name]/`
|
|
46
|
-
2. Write the component in `[ComponentName].tsx` — named export, typed props, no `any`
|
|
47
|
-
3. Create `index.ts` in that folder:
|
|
48
|
-
```ts
|
|
49
|
-
export { ComponentName } from './ComponentName';
|
|
50
|
-
```
|
|
51
|
-
4. Add the export to `src/index.ts`:
|
|
52
|
-
```ts
|
|
53
|
-
export { ComponentName } from './components/[type]/[component-name]';
|
|
54
|
-
```
|
|
55
|
-
5. If the component needs a peer dep, add it to `peerDependencies` in `package.json` — do not add it to `dependencies`
|
|
56
|
-
6. Rebuild: `pnpm turbo build --filter=@t7blocks/ui`
|
|
57
|
-
7. Confirm `dist/` updates with no errors
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Component Writing Rules
|
|
62
|
-
|
|
63
|
-
- Props interface must be explicitly typed — no implicit prop types.
|
|
64
|
-
- Always provide sensible defaults for every optional prop.
|
|
65
|
-
- Component file name: PascalCase matching the export name (`Button1.tsx`)
|
|
66
|
-
- Folder name: kebab-case matching the registry `name` (`button-1/`)
|
|
67
|
-
- No hardcoded colours — use CSS variables or accept colour as a prop.
|
|
68
|
-
- No side effects at module level (no `window` access outside `useEffect`).
|
|
69
|
-
- Animation libraries must be listed as peer deps and imported normally — never bundled.
|
|
70
|
-
- If a component needs a CSS file, scope all class names with a `t7-` prefix to avoid collisions with user styles.
|
|
71
|
-
- Components must work without any Tailwind — the user may not have it.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## tsconfig Rules
|
|
76
|
-
|
|
77
|
-
- `tsconfig.json` extends `@t7blocks/typescript-config/base.json` — NOT `nextjs.json`
|
|
78
|
-
- Add `"jsx": "react-jsx"` manually in `compilerOptions`
|
|
79
|
-
- `"incremental"` must never appear in this tsconfig — it breaks tsup DTS build
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## package.json Rules
|
|
84
|
-
|
|
85
|
-
- In the `exports` field, `"types"` must come BEFORE `"import"` and `"require"`:
|
|
86
|
-
```json
|
|
87
|
-
".": {
|
|
88
|
-
"types": "./dist/index.d.ts",
|
|
89
|
-
"import": "./dist/index.mjs",
|
|
90
|
-
"require": "./dist/index.js"
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
- Bump the version in `package.json` before every `pnpm publish`
|
|
94
|
-
- Use semantic versioning: patch (0.0.x) for fixes, minor (0.x.0) for new components, major (x.0.0) for breaking changes
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## What Never Goes in This Package
|
|
99
|
-
|
|
100
|
-
- Premium component source code
|
|
101
|
-
- Demo UI (prop control cards, canvases)
|
|
102
|
-
- Documentation content (code block strings, prop tables)
|
|
103
|
-
- Any app-level code from `apps/`
|
|
104
|
-
- `devDependencies` listed as `dependencies` (keep the bundle clean)
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/button/button-1/Button1.tsx"],"sourcesContent":["// free component exports go here\r\n// export { MagneticButton } from './components/button/MagneticButton';\r\n\r\nexport { Button1 } from './components/button/button-1';","\"use client\";\r\n\r\nimport { motion } from \"framer-motion\";\r\nimport { useRef } from \"react\";\r\n\r\ninterface Button1Props {\r\n label?: string;\r\n variant?: \"primary\" | \"outline\";\r\n size?: \"sm\" | \"md\" | \"lg\";\r\n onClick?: () => void;\r\n}\r\n\r\nexport function Button1({\r\n label = \"Click me\",\r\n variant = \"primary\",\r\n size = \"md\",\r\n onClick,\r\n}: Button1Props) {\r\n const ref = useRef<HTMLButtonElement>(null);\r\n\r\n const sizeMap = {\r\n sm: { padding: \"8px 20px\", fontSize: \"13px\" },\r\n md: { padding: \"12px 28px\", fontSize: \"15px\" },\r\n lg: { padding: \"16px 36px\", fontSize: \"17px\" },\r\n };\r\n\r\n const isPrimary = variant === \"primary\";\r\n\r\n return (\r\n <motion.button\r\n ref={ref}\r\n onClick={onClick}\r\n whileHover={{ scale: 1.04 }}\r\n whileTap={{ scale: 0.97 }}\r\n transition={{ type: \"spring\", stiffness: 400, damping: 20 }}\r\n style={{\r\n ...sizeMap[size],\r\n background: isPrimary ? \"#000\" : \"transparent\",\r\n color: isPrimary ? \"#fff\" : \"#000\",\r\n border: \"1.5px solid #000\",\r\n borderRadius: \"8px\",\r\n cursor: \"pointer\",\r\n fontWeight: 500,\r\n letterSpacing: \"-0.01em\",\r\n }}\r\n >\r\n {label}\r\n </motion.button>\r\n );\r\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,2BAAuB;AACvB,mBAAuB;AA0BnB;AAjBG,SAAS,QAAQ;AAAA,EACtB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AACF,GAAiB;AACf,QAAM,UAAM,qBAA0B,IAAI;AAE1C,QAAM,UAAU;AAAA,IACd,IAAI,EAAE,SAAS,YAAY,UAAU,OAAO;AAAA,IAC5C,IAAI,EAAE,SAAS,aAAa,UAAU,OAAO;AAAA,IAC7C,IAAI,EAAE,SAAS,aAAa,UAAU,OAAO;AAAA,EAC/C;AAEA,QAAM,YAAY,YAAY;AAE9B,SACE;AAAA,IAAC,4BAAO;AAAA,IAAP;AAAA,MACC;AAAA,MACA;AAAA,MACA,YAAY,EAAE,OAAO,KAAK;AAAA,MAC1B,UAAU,EAAE,OAAO,KAAK;AAAA,MACxB,YAAY,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,GAAG;AAAA,MAC1D,OAAO;AAAA,QACL,GAAG,QAAQ,IAAI;AAAA,QACf,YAAY,YAAY,SAAS;AAAA,QACjC,OAAO,YAAY,SAAS;AAAA,QAC5B,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,eAAe;AAAA,MACjB;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button/button-1/Button1.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { motion } from \"framer-motion\";\r\nimport { useRef } from \"react\";\r\n\r\ninterface Button1Props {\r\n label?: string;\r\n variant?: \"primary\" | \"outline\";\r\n size?: \"sm\" | \"md\" | \"lg\";\r\n onClick?: () => void;\r\n}\r\n\r\nexport function Button1({\r\n label = \"Click me\",\r\n variant = \"primary\",\r\n size = \"md\",\r\n onClick,\r\n}: Button1Props) {\r\n const ref = useRef<HTMLButtonElement>(null);\r\n\r\n const sizeMap = {\r\n sm: { padding: \"8px 20px\", fontSize: \"13px\" },\r\n md: { padding: \"12px 28px\", fontSize: \"15px\" },\r\n lg: { padding: \"16px 36px\", fontSize: \"17px\" },\r\n };\r\n\r\n const isPrimary = variant === \"primary\";\r\n\r\n return (\r\n <motion.button\r\n ref={ref}\r\n onClick={onClick}\r\n whileHover={{ scale: 1.04 }}\r\n whileTap={{ scale: 0.97 }}\r\n transition={{ type: \"spring\", stiffness: 400, damping: 20 }}\r\n style={{\r\n ...sizeMap[size],\r\n background: isPrimary ? \"#000\" : \"transparent\",\r\n color: isPrimary ? \"#fff\" : \"#000\",\r\n border: \"1.5px solid #000\",\r\n borderRadius: \"8px\",\r\n cursor: \"pointer\",\r\n fontWeight: 500,\r\n letterSpacing: \"-0.01em\",\r\n }}\r\n >\r\n {label}\r\n </motion.button>\r\n );\r\n}"],"mappings":";AAEA,SAAS,cAAc;AACvB,SAAS,cAAc;AA0BnB;AAjBG,SAAS,QAAQ;AAAA,EACtB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AACF,GAAiB;AACf,QAAM,MAAM,OAA0B,IAAI;AAE1C,QAAM,UAAU;AAAA,IACd,IAAI,EAAE,SAAS,YAAY,UAAU,OAAO;AAAA,IAC5C,IAAI,EAAE,SAAS,aAAa,UAAU,OAAO;AAAA,IAC7C,IAAI,EAAE,SAAS,aAAa,UAAU,OAAO;AAAA,EAC/C;AAEA,QAAM,YAAY,YAAY;AAE9B,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACC;AAAA,MACA;AAAA,MACA,YAAY,EAAE,OAAO,KAAK;AAAA,MAC1B,UAAU,EAAE,OAAO,KAAK;AAAA,MACxB,YAAY,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,GAAG;AAAA,MAC1D,OAAO;AAAA,QACL,GAAG,QAAQ,IAAI;AAAA,QACf,YAAY,YAAY,SAAS;AAAA,QACjC,OAAO,YAAY,SAAS;AAAA,QAC5B,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,eAAe;AAAA,MACjB;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { motion } from "framer-motion";
|
|
4
|
-
import { useRef } from "react";
|
|
5
|
-
|
|
6
|
-
interface Button1Props {
|
|
7
|
-
label?: string;
|
|
8
|
-
variant?: "primary" | "outline";
|
|
9
|
-
size?: "sm" | "md" | "lg";
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function Button1({
|
|
14
|
-
label = "Click me",
|
|
15
|
-
variant = "primary",
|
|
16
|
-
size = "md",
|
|
17
|
-
onClick,
|
|
18
|
-
}: Button1Props) {
|
|
19
|
-
const ref = useRef<HTMLButtonElement>(null);
|
|
20
|
-
|
|
21
|
-
const sizeMap = {
|
|
22
|
-
sm: { padding: "8px 20px", fontSize: "13px" },
|
|
23
|
-
md: { padding: "12px 28px", fontSize: "15px" },
|
|
24
|
-
lg: { padding: "16px 36px", fontSize: "17px" },
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const isPrimary = variant === "primary";
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<motion.button
|
|
31
|
-
ref={ref}
|
|
32
|
-
onClick={onClick}
|
|
33
|
-
whileHover={{ scale: 1.04 }}
|
|
34
|
-
whileTap={{ scale: 0.97 }}
|
|
35
|
-
transition={{ type: "spring", stiffness: 400, damping: 20 }}
|
|
36
|
-
style={{
|
|
37
|
-
...sizeMap[size],
|
|
38
|
-
background: isPrimary ? "#000" : "transparent",
|
|
39
|
-
color: isPrimary ? "#fff" : "#000",
|
|
40
|
-
border: "1.5px solid #000",
|
|
41
|
-
borderRadius: "8px",
|
|
42
|
-
cursor: "pointer",
|
|
43
|
-
fontWeight: 500,
|
|
44
|
-
letterSpacing: "-0.01em",
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
{label}
|
|
48
|
-
</motion.button>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button1 } from './Button1';
|
package/src/index.ts
DELETED
package/src/types/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// shared prop types go here
|
package/tsconfig.json
DELETED