@t7blocks/ui 0.0.1 → 0.0.4

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 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
+ [![npm version](https://img.shields.io/npm/v/@t7blocks/ui?style=flat-square)](https://www.npmjs.com/package/@t7blocks/ui)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@t7blocks/ui?style=flat-square)](https://www.npmjs.com/package/@t7blocks/ui)
7
+ [![license](https://img.shields.io/badge/license-Custom-blue?style=flat-square)](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/dist/index.d.mts CHANGED
@@ -8,4 +8,14 @@ interface Button1Props {
8
8
  }
9
9
  declare function Button1({ label, variant, size, onClick, }: Button1Props): react_jsx_runtime.JSX.Element;
10
10
 
11
- export { Button1 };
11
+ interface DotlaunchbuttonProps {
12
+ label?: string;
13
+ onClick?: () => void;
14
+ className?: string;
15
+ accentColor?: string;
16
+ btnColor?: string;
17
+ animationSpeed?: number;
18
+ }
19
+ declare function Dotlaunchbutton({ label, onClick, className, accentColor, btnColor, animationSpeed, }: DotlaunchbuttonProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { Button1, Dotlaunchbutton };
package/dist/index.d.ts CHANGED
@@ -8,4 +8,14 @@ interface Button1Props {
8
8
  }
9
9
  declare function Button1({ label, variant, size, onClick, }: Button1Props): react_jsx_runtime.JSX.Element;
10
10
 
11
- export { Button1 };
11
+ interface DotlaunchbuttonProps {
12
+ label?: string;
13
+ onClick?: () => void;
14
+ className?: string;
15
+ accentColor?: string;
16
+ btnColor?: string;
17
+ animationSpeed?: number;
18
+ }
19
+ declare function Dotlaunchbutton({ label, onClick, className, accentColor, btnColor, animationSpeed, }: DotlaunchbuttonProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { Button1, Dotlaunchbutton };
package/dist/index.js CHANGED
@@ -20,7 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- Button1: () => Button1
23
+ Button1: () => Button1,
24
+ Dotlaunchbutton: () => Dotlaunchbutton
24
25
  });
25
26
  module.exports = __toCommonJS(index_exports);
26
27
 
@@ -63,8 +64,126 @@ function Button1({
63
64
  }
64
65
  );
65
66
  }
67
+
68
+ // src/components/button/DotLaunch/Dotlaunchbutton.tsx
69
+ var import_react2 = require("react");
70
+ var import_framer_motion2 = require("framer-motion");
71
+ var import_jsx_runtime2 = require("react/jsx-runtime");
72
+ function arrowAt(tipCol) {
73
+ const cells = /* @__PURE__ */ new Set();
74
+ if (tipCol >= 0 && tipCol <= 4) cells.add(2 * 5 + tipCol);
75
+ if (tipCol - 1 >= 0 && tipCol - 1 <= 4) cells.add(1 * 5 + (tipCol - 1));
76
+ if (tipCol - 2 >= 0 && tipCol - 2 <= 4) cells.add(0 * 5 + (tipCol - 2));
77
+ if (tipCol - 1 >= 0 && tipCol - 1 <= 4) cells.add(3 * 5 + (tipCol - 1));
78
+ if (tipCol - 2 >= 0 && tipCol - 2 <= 4) cells.add(4 * 5 + (tipCol - 2));
79
+ for (let c = Math.max(0, tipCol - 4); c < tipCol && c <= 4; c++) cells.add(2 * 5 + c);
80
+ return cells;
81
+ }
82
+ function lightTint(hex, amount) {
83
+ if (!hex.startsWith("#")) return hex;
84
+ const r = parseInt(hex.slice(1, 3), 16);
85
+ const g = parseInt(hex.slice(3, 5), 16);
86
+ const b = parseInt(hex.slice(5, 7), 16);
87
+ const tr = Math.round(r + (255 - r) * (1 - amount));
88
+ const tg = Math.round(g + (255 - g) * (1 - amount));
89
+ const tb = Math.round(b + (255 - b) * (1 - amount));
90
+ return `rgb(${tr},${tg},${tb})`;
91
+ }
92
+ var TIP_SEQUENCE = [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7];
93
+ var DOT_COUNT = 25;
94
+ var GRID_SIZE = 41;
95
+ var GAP = 3;
96
+ var DOT_SIZE = (GRID_SIZE - GAP * 4) / 5;
97
+ function Dotlaunchbutton({
98
+ label = "Get started",
99
+ onClick,
100
+ className = "",
101
+ accentColor = "#18db38",
102
+ btnColor = "#111111",
103
+ animationSpeed = 155
104
+ }) {
105
+ const [seqIndex, setSeqIndex] = (0, import_react2.useState)(0);
106
+ const timerRef = (0, import_react2.useRef)(null);
107
+ const buttonRef = (0, import_react2.useRef)(null);
108
+ (0, import_react2.useEffect)(() => {
109
+ timerRef.current = setInterval(() => {
110
+ setSeqIndex((prev) => (prev + 1) % TIP_SEQUENCE.length);
111
+ }, animationSpeed);
112
+ return () => {
113
+ if (timerRef.current) clearInterval(timerRef.current);
114
+ };
115
+ }, [animationSpeed]);
116
+ const activeSet = arrowAt(TIP_SEQUENCE[seqIndex]);
117
+ const inactiveDotColor = lightTint(accentColor, 0.65);
118
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
119
+ import_framer_motion2.motion.button,
120
+ {
121
+ ref: buttonRef,
122
+ onClick,
123
+ whileHover: { scale: 1.03 },
124
+ whileTap: { scale: 0.97 },
125
+ className: `group relative inline-flex items-center rounded-[14px] border border-white/[0.06] shadow-[0_4px_24px_rgba(0,0,0,0.65)] cursor-pointer select-none ${className}`,
126
+ style: {
127
+ padding: "8px 28px 8px 8px",
128
+ backgroundColor: btnColor
129
+ },
130
+ children: [
131
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
132
+ "div",
133
+ {
134
+ className: "relative flex items-center justify-center flex-shrink-0 overflow-hidden",
135
+ style: {
136
+ width: 58,
137
+ height: 58,
138
+ borderRadius: 10,
139
+ backgroundColor: accentColor,
140
+ marginRight: 18,
141
+ boxShadow: "inset 0 -2px 5px rgba(0,0,0,0.18)"
142
+ },
143
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { position: "relative", width: GRID_SIZE, height: GRID_SIZE }, children: Array.from({ length: DOT_COUNT }).map((_, i) => {
144
+ const row = Math.floor(i / 5);
145
+ const col = i % 5;
146
+ const isActive = activeSet.has(i);
147
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
148
+ import_framer_motion2.motion.div,
149
+ {
150
+ initial: false,
151
+ animate: {
152
+ backgroundColor: isActive ? "#ffffff" : inactiveDotColor,
153
+ opacity: isActive ? 1 : 0.72
154
+ },
155
+ transition: { duration: 0.08 },
156
+ style: {
157
+ position: "absolute",
158
+ width: DOT_SIZE,
159
+ height: DOT_SIZE,
160
+ left: col * (DOT_SIZE + GAP),
161
+ top: row * (DOT_SIZE + GAP),
162
+ borderRadius: 0
163
+ }
164
+ },
165
+ i
166
+ );
167
+ }) })
168
+ }
169
+ ),
170
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
171
+ "span",
172
+ {
173
+ className: "text-white whitespace-nowrap",
174
+ style: { fontSize: 17, fontWeight: 400, letterSpacing: "-0.2px" },
175
+ children: label
176
+ }
177
+ ),
178
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "pointer-events-none absolute inset-0 rounded-[14px] bg-gradient-to-tr from-white/[0.04] to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" }),
179
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute inset-[0.5px] rounded-[14px] border-t border-white/5 pointer-events-none" })
180
+ ]
181
+ }
182
+ );
183
+ }
66
184
  // Annotate the CommonJS export names for ESM import in node:
67
185
  0 && (module.exports = {
68
- Button1
186
+ Button1,
187
+ Dotlaunchbutton
69
188
  });
70
189
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -37,7 +37,125 @@ function Button1({
37
37
  }
38
38
  );
39
39
  }
40
+
41
+ // src/components/button/DotLaunch/Dotlaunchbutton.tsx
42
+ import { useState, useEffect, useRef as useRef2 } from "react";
43
+ import { motion as motion2 } from "framer-motion";
44
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
45
+ function arrowAt(tipCol) {
46
+ const cells = /* @__PURE__ */ new Set();
47
+ if (tipCol >= 0 && tipCol <= 4) cells.add(2 * 5 + tipCol);
48
+ if (tipCol - 1 >= 0 && tipCol - 1 <= 4) cells.add(1 * 5 + (tipCol - 1));
49
+ if (tipCol - 2 >= 0 && tipCol - 2 <= 4) cells.add(0 * 5 + (tipCol - 2));
50
+ if (tipCol - 1 >= 0 && tipCol - 1 <= 4) cells.add(3 * 5 + (tipCol - 1));
51
+ if (tipCol - 2 >= 0 && tipCol - 2 <= 4) cells.add(4 * 5 + (tipCol - 2));
52
+ for (let c = Math.max(0, tipCol - 4); c < tipCol && c <= 4; c++) cells.add(2 * 5 + c);
53
+ return cells;
54
+ }
55
+ function lightTint(hex, amount) {
56
+ if (!hex.startsWith("#")) return hex;
57
+ const r = parseInt(hex.slice(1, 3), 16);
58
+ const g = parseInt(hex.slice(3, 5), 16);
59
+ const b = parseInt(hex.slice(5, 7), 16);
60
+ const tr = Math.round(r + (255 - r) * (1 - amount));
61
+ const tg = Math.round(g + (255 - g) * (1 - amount));
62
+ const tb = Math.round(b + (255 - b) * (1 - amount));
63
+ return `rgb(${tr},${tg},${tb})`;
64
+ }
65
+ var TIP_SEQUENCE = [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7];
66
+ var DOT_COUNT = 25;
67
+ var GRID_SIZE = 41;
68
+ var GAP = 3;
69
+ var DOT_SIZE = (GRID_SIZE - GAP * 4) / 5;
70
+ function Dotlaunchbutton({
71
+ label = "Get started",
72
+ onClick,
73
+ className = "",
74
+ accentColor = "#18db38",
75
+ btnColor = "#111111",
76
+ animationSpeed = 155
77
+ }) {
78
+ const [seqIndex, setSeqIndex] = useState(0);
79
+ const timerRef = useRef2(null);
80
+ const buttonRef = useRef2(null);
81
+ useEffect(() => {
82
+ timerRef.current = setInterval(() => {
83
+ setSeqIndex((prev) => (prev + 1) % TIP_SEQUENCE.length);
84
+ }, animationSpeed);
85
+ return () => {
86
+ if (timerRef.current) clearInterval(timerRef.current);
87
+ };
88
+ }, [animationSpeed]);
89
+ const activeSet = arrowAt(TIP_SEQUENCE[seqIndex]);
90
+ const inactiveDotColor = lightTint(accentColor, 0.65);
91
+ return /* @__PURE__ */ jsxs(
92
+ motion2.button,
93
+ {
94
+ ref: buttonRef,
95
+ onClick,
96
+ whileHover: { scale: 1.03 },
97
+ whileTap: { scale: 0.97 },
98
+ className: `group relative inline-flex items-center rounded-[14px] border border-white/[0.06] shadow-[0_4px_24px_rgba(0,0,0,0.65)] cursor-pointer select-none ${className}`,
99
+ style: {
100
+ padding: "8px 28px 8px 8px",
101
+ backgroundColor: btnColor
102
+ },
103
+ children: [
104
+ /* @__PURE__ */ jsx2(
105
+ "div",
106
+ {
107
+ className: "relative flex items-center justify-center flex-shrink-0 overflow-hidden",
108
+ style: {
109
+ width: 58,
110
+ height: 58,
111
+ borderRadius: 10,
112
+ backgroundColor: accentColor,
113
+ marginRight: 18,
114
+ boxShadow: "inset 0 -2px 5px rgba(0,0,0,0.18)"
115
+ },
116
+ children: /* @__PURE__ */ jsx2("div", { style: { position: "relative", width: GRID_SIZE, height: GRID_SIZE }, children: Array.from({ length: DOT_COUNT }).map((_, i) => {
117
+ const row = Math.floor(i / 5);
118
+ const col = i % 5;
119
+ const isActive = activeSet.has(i);
120
+ return /* @__PURE__ */ jsx2(
121
+ motion2.div,
122
+ {
123
+ initial: false,
124
+ animate: {
125
+ backgroundColor: isActive ? "#ffffff" : inactiveDotColor,
126
+ opacity: isActive ? 1 : 0.72
127
+ },
128
+ transition: { duration: 0.08 },
129
+ style: {
130
+ position: "absolute",
131
+ width: DOT_SIZE,
132
+ height: DOT_SIZE,
133
+ left: col * (DOT_SIZE + GAP),
134
+ top: row * (DOT_SIZE + GAP),
135
+ borderRadius: 0
136
+ }
137
+ },
138
+ i
139
+ );
140
+ }) })
141
+ }
142
+ ),
143
+ /* @__PURE__ */ jsx2(
144
+ "span",
145
+ {
146
+ className: "text-white whitespace-nowrap",
147
+ style: { fontSize: 17, fontWeight: 400, letterSpacing: "-0.2px" },
148
+ children: label
149
+ }
150
+ ),
151
+ /* @__PURE__ */ jsx2("div", { className: "pointer-events-none absolute inset-0 rounded-[14px] bg-gradient-to-tr from-white/[0.04] to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" }),
152
+ /* @__PURE__ */ jsx2("div", { className: "absolute inset-[0.5px] rounded-[14px] border-t border-white/5 pointer-events-none" })
153
+ ]
154
+ }
155
+ );
156
+ }
40
157
  export {
41
- Button1
158
+ Button1,
159
+ Dotlaunchbutton
42
160
  };
43
161
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t7blocks/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -16,8 +16,12 @@
16
16
  "react": "^18.0.0"
17
17
  },
18
18
  "devDependencies": {
19
+ "@tailwindcss/postcss": "^4.2.2",
19
20
  "@types/react": "^18.0.0",
21
+ "@types/react-dom": "^19.2.3",
20
22
  "framer-motion": "^12.38.0",
23
+ "postcss": "^8.5.9",
24
+ "tailwindcss": "^4.2.2",
21
25
  "tsup": "^8.0.0",
22
26
  "typescript": "^5.0.0",
23
27
  "@t7blocks/typescript-config": "0.0.1"
@@ -1,22 +0,0 @@
1
-
2
- > @t7blocks/ui@0.0.1 build C:\Users\singh\Desktop\Dev\T7blocks\packages\ui
3
- > tsup
4
-
5
- CLI Building entry: src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.1
8
- CLI Using tsup config: C:\Users\singh\Desktop\Dev\T7blocks\packages\ui\tsup.config.ts
9
- CLI Target: es2020
10
- CLI Cleaning output folder
11
- CJS Build start
12
- ESM Build start
13
- ESM dist\index.mjs 1.08 KB
14
- ESM dist\index.mjs.map 2.13 KB
15
- ESM ⚡️ Build success in 54ms
16
- CJS dist\index.js 2.17 KB
17
- CJS dist\index.js.map 2.36 KB
18
- CJS ⚡️ Build success in 55ms
19
- DTS Build start
20
- DTS ⚡️ Build success in 1666ms
21
- DTS dist\index.d.ts 326.00 B
22
- DTS dist\index.d.mts 326.00 B
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":[]}
@@ -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
@@ -1,4 +0,0 @@
1
- // free component exports go here
2
- // export { MagneticButton } from './components/button/MagneticButton';
3
-
4
- export { Button1 } from './components/button/button-1';
@@ -1 +0,0 @@
1
- // shared prop types go here
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@t7blocks/typescript-config/base.json",
3
- "compilerOptions": {
4
- "jsx": "react-jsx"
5
- },
6
- "include": ["src"],
7
- "exclude": ["dist", "node_modules"]
8
- }
package/tsup.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ['src/index.ts'],
5
- format: ['cjs', 'esm'],
6
- dts: true,
7
- clean: true,
8
- external: ['react', 'framer-motion'],
9
- sourcemap: true,
10
- });