rc-cui 0.0.1 → 0.0.2
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 +13 -16
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +2 -24
- package/dist/index.umd.js +1 -2
- package/package.json +1 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.umd.js.map +0 -1
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
/* Auto-generated by vite-plugin-dts */
|
|
2
|
-
import { default as React
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Button is in loading state
|
|
14
|
-
*/
|
|
15
|
-
loading?: boolean;
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'success' | 'outline';
|
|
4
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
leftIcon?: React.ReactNode;
|
|
9
|
+
rightIcon?: React.ReactNode;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: React.ReactNode;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
|
-
export
|
|
14
|
+
export default function Button({ variant, size, leftIcon, rightIcon, isLoading, disabled, className, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
19
16
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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,
|
|
2
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAChF,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,UAAU,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACzE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAmB,EACnB,IAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAiB,EACjB,QAAgB,EAChB,SAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,2CA0Eb"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
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));
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
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));require(`react`),require(`react/jsx-runtime`);
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
|
1
|
+
import "react";
|
|
2
|
+
import "react/jsx-runtime";
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
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){
|
|
2
|
-
//# sourceMappingURL=index.umd.js.map
|
|
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){Object.create,Object.defineProperty,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.prototype.hasOwnProperty});
|
package/package.json
CHANGED
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|