rc-cui 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.
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Button/Button.d.ts.map +2 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +2 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* Auto-generated by vite-plugin-dts */
|
|
2
|
+
import { default as React, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Variant of the button
|
|
6
|
+
*/
|
|
7
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
8
|
+
/**
|
|
9
|
+
* Size of the button
|
|
10
|
+
*/
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/**
|
|
13
|
+
* Button is in loading state
|
|
14
|
+
*/
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export default Button;
|
|
19
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* Auto-generated by vite-plugin-dts */
|
|
2
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAE/D,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAA;IACvD;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAyCX,CAAA;AAID,eAAe,MAAM,CAAA"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`react/jsx-runtime`);var u=(0,c.forwardRef)(({variant:e=`primary`,size:t=`md`,loading:n=!1,className:r=``,children:i,disabled:a,...o},s)=>(0,l.jsx)(`button`,{ref:s,className:`font-medium rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed ${{primary:`bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500`,secondary:`bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500`,outline:`border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500`,ghost:`bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500`}[e]} ${{sm:`px-2 py-1 text-sm`,md:`px-4 py-2 text-base`,lg:`px-6 py-3 text-lg`}[t]} ${r}`,disabled:a||n,...o,children:n?(0,l.jsxs)(`span`,{className:`flex items-center justify-center`,children:[(0,l.jsx)(`span`,{className:`animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2`}),`Loading...`]}):i}));u.displayName=`Button`;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef, ButtonHTMLAttributes } from 'react'\r\n\r\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\r\n /**\r\n * Variant of the button\r\n */\r\n variant?: 'primary' | 'secondary' | 'outline' | 'ghost'\r\n /**\r\n * Size of the button\r\n */\r\n size?: 'sm' | 'md' | 'lg'\r\n /**\r\n * Button is in loading state\r\n */\r\n loading?: boolean\r\n}\r\n\r\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\r\n ({ \r\n variant = 'primary', \r\n size = 'md', \r\n loading = false,\r\n className = '',\r\n children,\r\n disabled,\r\n ...props \r\n }, ref) => {\r\n const baseStyles = 'font-medium rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed'\r\n\r\n const variantStyles = {\r\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\r\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\r\n outline: 'border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500',\r\n ghost: 'bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500'\r\n }\r\n\r\n const sizeStyles = {\r\n sm: 'px-2 py-1 text-sm',\r\n md: 'px-4 py-2 text-base',\r\n lg: 'px-6 py-3 text-lg'\r\n }\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n className={`${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${className}`}\r\n disabled={disabled || loading}\r\n {...props}\r\n >\r\n {loading ? (\r\n <span className=\"flex items-center justify-center\">\r\n <span className=\"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2\"></span>\r\n Loading...\r\n </span>\r\n ) : children}\r\n </button>\r\n )\r\n }\r\n)\r\n\r\nButton.displayName = 'Button'\r\n\r\nexport default Button"],"mappings":"+hBAiBA,IAAM,GAAA,EAAA,EAAA,aACH,CACC,UAAU,UACV,OAAO,KACP,UAAU,GACV,YAAY,GACZ,WACA,WACA,GAAG,GACF,KAiBC,EAAA,EAAA,KAAC,SAAA,CACM,MACL,UAAW,6IAhBO,CACpB,QAAS,+DACT,UAAW,+DACX,QAAS,8EACT,MAAO,qEACR,CAW6C,GAAS,GATpC,CACjB,GAAI,oBACJ,GAAI,sBACJ,GAAI,oBACL,CAKoE,GAAM,GAAG,IAC1E,SAAU,GAAY,EACtB,GAAI,WAEH,GACC,EAAA,EAAA,MAAC,OAAA,CAAK,UAAU,8CACd,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,iEAAA,CAAwE,CAAA,aAAA,EAEnF,CACL,GACG,CAGd,CAED,EAAO,YAAc"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
var Button = forwardRef(({ variant: e = "primary", size: r = "md", loading: i = !1, className: a = "", children: o, disabled: s, ...c }, l) => /* @__PURE__ */ jsx("button", {
|
|
4
|
+
ref: l,
|
|
5
|
+
className: `font-medium rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed ${{
|
|
6
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",
|
|
7
|
+
secondary: "bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500",
|
|
8
|
+
outline: "border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500",
|
|
9
|
+
ghost: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"
|
|
10
|
+
}[e]} ${{
|
|
11
|
+
sm: "px-2 py-1 text-sm",
|
|
12
|
+
md: "px-4 py-2 text-base",
|
|
13
|
+
lg: "px-6 py-3 text-lg"
|
|
14
|
+
}[r]} ${a}`,
|
|
15
|
+
disabled: s || i,
|
|
16
|
+
...c,
|
|
17
|
+
children: i ? /* @__PURE__ */ jsxs("span", {
|
|
18
|
+
className: "flex items-center justify-center",
|
|
19
|
+
children: [/* @__PURE__ */ jsx("span", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2" }), "Loading..."]
|
|
20
|
+
}) : o
|
|
21
|
+
}));
|
|
22
|
+
Button.displayName = "Button";
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef, ButtonHTMLAttributes } from 'react'\r\n\r\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\r\n /**\r\n * Variant of the button\r\n */\r\n variant?: 'primary' | 'secondary' | 'outline' | 'ghost'\r\n /**\r\n * Size of the button\r\n */\r\n size?: 'sm' | 'md' | 'lg'\r\n /**\r\n * Button is in loading state\r\n */\r\n loading?: boolean\r\n}\r\n\r\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\r\n ({ \r\n variant = 'primary', \r\n size = 'md', \r\n loading = false,\r\n className = '',\r\n children,\r\n disabled,\r\n ...props \r\n }, ref) => {\r\n const baseStyles = 'font-medium rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed'\r\n\r\n const variantStyles = {\r\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\r\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\r\n outline: 'border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500',\r\n ghost: 'bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500'\r\n }\r\n\r\n const sizeStyles = {\r\n sm: 'px-2 py-1 text-sm',\r\n md: 'px-4 py-2 text-base',\r\n lg: 'px-6 py-3 text-lg'\r\n }\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n className={`${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${className}`}\r\n disabled={disabled || loading}\r\n {...props}\r\n >\r\n {loading ? (\r\n <span className=\"flex items-center justify-center\">\r\n <span className=\"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2\"></span>\r\n Loading...\r\n </span>\r\n ) : children}\r\n </button>\r\n )\r\n }\r\n)\r\n\r\nButton.displayName = 'Button'\r\n\r\nexport default Button"],"mappings":";;AAiBA,IAAM,SAAS,YACZ,EACC,aAAU,WACV,UAAO,MACP,aAAU,IACV,eAAY,IACZ,aACA,aACA,GAAG,KACF,MAiBC,oBAAC,UAAA;CACM;CACL,WAAW,6IAhBO;EACpB,SAAS;EACT,WAAW;EACX,SAAS;EACT,OAAO;EACR,CAW6C,GAAS,GATpC;EACjB,IAAI;EACJ,IAAI;EACJ,IAAI;EACL,CAKoE,GAAM,GAAG;CAC1E,UAAU,KAAY;CACtB,GAAI;WAEH,IACC,qBAAC,QAAA;EAAK,WAAU;aACd,oBAAC,QAAA,EAAK,WAAU,kEAAA,CAAwE,EAAA,aAAA;GAEnF,GACL;EACG,CAGd;AAED,OAAO,cAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.React,e.jsxRuntime))})(this,function(e,t){var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e};e=((e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)))(e);var l=(0,e.forwardRef)(({variant:e=`primary`,size:n=`md`,loading:r=!1,className:i=``,children:a,disabled:o,...s},c)=>(0,t.jsx)(`button`,{ref:c,className:`font-medium rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed ${{primary:`bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500`,secondary:`bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500`,outline:`border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500`,ghost:`bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500`}[e]} ${{sm:`px-2 py-1 text-sm`,md:`px-4 py-2 text-base`,lg:`px-6 py-3 text-lg`}[n]} ${i}`,disabled:o||r,...s,children:r?(0,t.jsxs)(`span`,{className:`flex items-center justify-center`,children:[(0,t.jsx)(`span`,{className:`animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2`}),`Loading...`]}):a}));l.displayName=`Button`});
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":[],"sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { forwardRef, ButtonHTMLAttributes } from 'react'\r\n\r\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\r\n /**\r\n * Variant of the button\r\n */\r\n variant?: 'primary' | 'secondary' | 'outline' | 'ghost'\r\n /**\r\n * Size of the button\r\n */\r\n size?: 'sm' | 'md' | 'lg'\r\n /**\r\n * Button is in loading state\r\n */\r\n loading?: boolean\r\n}\r\n\r\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\r\n ({ \r\n variant = 'primary', \r\n size = 'md', \r\n loading = false,\r\n className = '',\r\n children,\r\n disabled,\r\n ...props \r\n }, ref) => {\r\n const baseStyles = 'font-medium rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed'\r\n\r\n const variantStyles = {\r\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\r\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\r\n outline: 'border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500',\r\n ghost: 'bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500'\r\n }\r\n\r\n const sizeStyles = {\r\n sm: 'px-2 py-1 text-sm',\r\n md: 'px-4 py-2 text-base',\r\n lg: 'px-6 py-3 text-lg'\r\n }\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n className={`${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${className}`}\r\n disabled={disabled || loading}\r\n {...props}\r\n >\r\n {loading ? (\r\n <span className=\"flex items-center justify-center\">\r\n <span className=\"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2\"></span>\r\n Loading...\r\n </span>\r\n ) : children}\r\n </button>\r\n )\r\n }\r\n)\r\n\r\nButton.displayName = 'Button'\r\n\r\nexport default Button"],"mappings":"uvBAiBA,IAAM,GAAA,EAAA,EAAA,aACH,CACC,UAAU,UACV,OAAO,KACP,UAAU,GACV,YAAY,GACZ,WACA,WACA,GAAG,GACF,KAiBC,EAAA,EAAA,KAAC,SAAA,CACM,MACL,UAAW,6IAhBO,CACpB,QAAS,+DACT,UAAW,+DACX,QAAS,8EACT,MAAO,qEACR,CAW6C,GAAS,GATpC,CACjB,GAAI,oBACJ,GAAI,sBACJ,GAAI,oBACL,CAKoE,GAAM,GAAG,IAC1E,SAAU,GAAY,EACtB,GAAI,WAEH,GACC,EAAA,EAAA,MAAC,OAAA,CAAK,UAAU,8CACd,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,iEAAA,CAAwE,CAAA,aAAA,EAEnF,CACL,GACG,CAGd,CAED,EAAO,YAAc"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rc-cui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"author": "Igor Ushakov",
|
|
5
|
+
"description": "This is a customizable UI component library for React + TypeScript + Tailwind CSS.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"keywords": ["react", "typescript", "tailwind"],
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/MrGodOfNight/CUI.git"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"require": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.cjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"./dist/style.css": "./dist/style.css",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "vite",
|
|
35
|
+
"build": "tsc -b && vite build",
|
|
36
|
+
"lint": "eslint .",
|
|
37
|
+
"preview": "vite preview",
|
|
38
|
+
"clean": "shx rm -rf dist",
|
|
39
|
+
"prebuild": "npm run clean",
|
|
40
|
+
"postbuild": "shx mkdir -p dist && shx cp src/index.css dist/style.css",
|
|
41
|
+
"build:full": "npm run prebuild && npm run build && npm run postbuild"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"react": "^19.2.3",
|
|
45
|
+
"react-dom": "^19.2.3"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@eslint/js": "^9.39.1",
|
|
49
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
50
|
+
"@types/node": "^24.10.1",
|
|
51
|
+
"@types/react": "^19.2.5",
|
|
52
|
+
"@types/react-dom": "^19.2.3",
|
|
53
|
+
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
54
|
+
"eslint": "^9.39.1",
|
|
55
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
56
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
57
|
+
"globals": "^16.5.0",
|
|
58
|
+
"shx": "^0.4.0",
|
|
59
|
+
"tailwindcss": "^4.1.18",
|
|
60
|
+
"typescript": "~5.9.3",
|
|
61
|
+
"typescript-eslint": "^8.46.4",
|
|
62
|
+
"vite": "npm:rolldown-vite@7.2.5",
|
|
63
|
+
"vite-plugin-dts": "^4.5.4"
|
|
64
|
+
},
|
|
65
|
+
"overrides": {
|
|
66
|
+
"vite": "npm:rolldown-vite@7.2.5"
|
|
67
|
+
}
|
|
68
|
+
}
|