@prashu29/button 0.0.1

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.
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ type ButtonVariant = "primary" | "ghost";
4
+ type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
5
+ variant?: ButtonVariant;
6
+ };
7
+ declare const Button: React.FC<ButtonProps>;
8
+
9
+ export { Button, ButtonProps };
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ Button: () => Button
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // src/Button.tsx
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ var base = "inline-flex items-center justify-center px-4 py-2 rounded";
30
+ var variants = {
31
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
32
+ ghost: "bg-transparent border border-gray-200"
33
+ };
34
+ var Button = ({
35
+ variant = "primary",
36
+ className = "",
37
+ children,
38
+ ...rest
39
+ }) => {
40
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
+ "button",
42
+ {
43
+ className: `${base} ${variants[variant]} ${className}`,
44
+ ...rest,
45
+ children
46
+ }
47
+ );
48
+ };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ Button
52
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,25 @@
1
+ // src/Button.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var base = "inline-flex items-center justify-center px-4 py-2 rounded";
4
+ var variants = {
5
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
6
+ ghost: "bg-transparent border border-gray-200"
7
+ };
8
+ var Button = ({
9
+ variant = "primary",
10
+ className = "",
11
+ children,
12
+ ...rest
13
+ }) => {
14
+ return /* @__PURE__ */ jsx(
15
+ "button",
16
+ {
17
+ className: `${base} ${variants[variant]} ${className}`,
18
+ ...rest,
19
+ children
20
+ }
21
+ );
22
+ };
23
+ export {
24
+ Button
25
+ };
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@prashu29/button",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": ["dist"],
9
+ "license": "MIT",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "build": "tsup src/index.ts --format esm,cjs --dts --tsconfig ./tsconfig.json --outDir dist",
15
+ "prepare": "npm run build"
16
+ },
17
+ "devDependencies": {
18
+ "tsup": "^6.0.0",
19
+ "typescript": "^5.0.0",
20
+ "@types/react": "^18.0.0"
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^18.0.0"
24
+ }
25
+ }