@javiluli96dev/ui 1.4.0
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/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +55 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "solid" | "bordered" | "light" | "flat" | null | undefined;
|
|
8
|
+
size?: "sm" | "lg" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
11
|
+
}
|
|
12
|
+
declare const Button: ({ className, variant, size, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { Button, type ButtonProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "solid" | "bordered" | "light" | "flat" | null | undefined;
|
|
8
|
+
size?: "sm" | "lg" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
11
|
+
}
|
|
12
|
+
declare const Button: ({ className, variant, size, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { Button, type ButtonProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var x=(t,r)=>{for(var e in r)o(t,e,{get:r[e],enumerable:!0})},c=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of m(r))!u.call(t,a)&&a!==e&&o(t,a,{get:()=>r[a],enumerable:!(n=l(r,a))||n.enumerable});return t};var f=t=>c(o({},"__esModule",{value:!0}),t);var h={};x(h,{Button:()=>v});module.exports=f(h);var d=require("class-variance-authority");var s=require("clsx"),i=require("tailwind-merge");function b(...t){return(0,i.twMerge)((0,s.clsx)(t))}var p=require("react/jsx-runtime"),g=(0,d.cva)("inline-flex items-center justify-center rounded-xl font-medium transition-all active:scale-95 disabled:opacity-50",{variants:{variant:{solid:"bg-brand-500 text-white hover:bg-brand-600 shadow-md",bordered:"border-2 border-brand-500 text-brand-500 hover:bg-brand-50",light:"bg-transparent text-brand-500 hover:bg-brand-50",flat:"bg-brand-100 text-brand-900 hover:bg-brand-200"},size:{sm:"px-3 py-1 text-xs",lg:"px-8 py-3 text-base"}},defaultVariants:{variant:"solid"}}),v=({className:t,variant:r,size:e,...n})=>(0,p.jsx)("button",{className:b(g({variant:r,size:e,className:t})),...n});0&&(module.exports={Button});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/button.tsx","../src/utils.ts"],"sourcesContent":["export * from \"./button\";\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"./utils\";\n\n// 1. Definimos las variantes\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-xl font-medium transition-all active:scale-95 disabled:opacity-50\",\n {\n variants: {\n variant: {\n solid: \"bg-brand-500 text-white hover:bg-brand-600 shadow-md\",\n bordered: \"border-2 border-brand-500 text-brand-500 hover:bg-brand-50\",\n light: \"bg-transparent text-brand-500 hover:bg-brand-50\",\n flat: \"bg-brand-100 text-brand-900 hover:bg-brand-200\",\n },\n size: {\n sm: \"px-3 py-1 text-xs\",\n lg: \"px-8 py-3 text-base\",\n },\n },\n defaultVariants: {\n variant: \"solid\",\n },\n },\n);\n\n// 2. Creamos la interfaz uniendo los tipos de React con los de CVA\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {}\n\n// 3. El componente\nexport const Button = ({ className, variant, size, ...props }: ButtonProps) => {\n return (\n <button\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GCCA,IAAAI,EAAuC,oCCDvC,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CD8BI,IAAAC,EAAA,6BA9BEC,KAAiB,OACrB,oHACA,CACE,SAAU,CACR,QAAS,CACP,MAAO,uDACP,SAAU,6DACV,MAAO,kDACP,KAAM,gDACR,EACA,KAAM,CACJ,GAAI,oBACJ,GAAI,qBACN,CACF,EACA,gBAAiB,CACf,QAAS,OACX,CACF,CACF,EASaC,EAAS,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,GAAGC,CAAM,OAExD,OAAC,UACC,UAAWC,EAAGN,EAAe,CAAE,QAAAG,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EACzD,GAAGG,EACN","names":["index_exports","__export","Button","__toCommonJS","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","props","cn"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cva as i}from"class-variance-authority";import{clsx as o}from"clsx";import{twMerge as s}from"tailwind-merge";function r(...t){return s(o(t))}import{jsx as d}from"react/jsx-runtime";var b=i("inline-flex items-center justify-center rounded-xl font-medium transition-all active:scale-95 disabled:opacity-50",{variants:{variant:{solid:"bg-brand-500 text-white hover:bg-brand-600 shadow-md",bordered:"border-2 border-brand-500 text-brand-500 hover:bg-brand-50",light:"bg-transparent text-brand-500 hover:bg-brand-50",flat:"bg-brand-100 text-brand-900 hover:bg-brand-200"},size:{sm:"px-3 py-1 text-xs",lg:"px-8 py-3 text-base"}},defaultVariants:{variant:"solid"}}),c=({className:t,variant:e,size:a,...n})=>d("button",{className:r(b({variant:e,size:a,className:t})),...n});export{c as Button};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"./utils\";\n\n// 1. Definimos las variantes\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-xl font-medium transition-all active:scale-95 disabled:opacity-50\",\n {\n variants: {\n variant: {\n solid: \"bg-brand-500 text-white hover:bg-brand-600 shadow-md\",\n bordered: \"border-2 border-brand-500 text-brand-500 hover:bg-brand-50\",\n light: \"bg-transparent text-brand-500 hover:bg-brand-50\",\n flat: \"bg-brand-100 text-brand-900 hover:bg-brand-200\",\n },\n size: {\n sm: \"px-3 py-1 text-xs\",\n lg: \"px-8 py-3 text-base\",\n },\n },\n defaultVariants: {\n variant: \"solid\",\n },\n },\n);\n\n// 2. Creamos la interfaz uniendo los tipos de React con los de CVA\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {}\n\n// 3. El componente\nexport const Button = ({ className, variant, size, ...props }: ButtonProps) => {\n return (\n <button\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AACA,OAAS,OAAAA,MAA8B,2BCDvC,OAAS,QAAAC,MAA6B,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CD8BI,cAAAC,MAAA,oBA9BJ,IAAMC,EAAiBC,EACrB,oHACA,CACE,SAAU,CACR,QAAS,CACP,MAAO,uDACP,SAAU,6DACV,MAAO,kDACP,KAAM,gDACR,EACA,KAAM,CACJ,GAAI,oBACJ,GAAI,qBACN,CACF,EACA,gBAAiB,CACf,QAAS,OACX,CACF,CACF,EASaC,EAAS,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,GAAGC,CAAM,IAExDP,EAAC,UACC,UAAWQ,EAAGP,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EACzD,GAAGG,EACN","names":["cva","clsx","twMerge","cn","inputs","jsx","buttonVariants","cva","Button","className","variant","size","props","cn"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@javiluli96dev/ui",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Esto es mi primer paquete de componentes",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"dev": "tsup --watch",
|
|
27
|
+
"lint": "eslint . --max-warnings 0",
|
|
28
|
+
"generate:component": "turbo gen react-component",
|
|
29
|
+
"check-types": "tsc --noEmit"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"react",
|
|
33
|
+
"componentes",
|
|
34
|
+
"react-components"
|
|
35
|
+
],
|
|
36
|
+
"author": "javilulidev",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@simple-ui-components/eslint-config": "workspace:*",
|
|
40
|
+
"@simple-ui-components/typescript-config": "workspace:*",
|
|
41
|
+
"@types/node": "^22.15.3",
|
|
42
|
+
"@types/react": "19.2.2",
|
|
43
|
+
"@types/react-dom": "19.2.2",
|
|
44
|
+
"eslint": "^9.39.1",
|
|
45
|
+
"tsup": "^8.5.1",
|
|
46
|
+
"typescript": "5.9.2"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"class-variance-authority": "^0.7.1",
|
|
50
|
+
"clsx": "^2.1.1",
|
|
51
|
+
"react": "^19.2.0",
|
|
52
|
+
"react-dom": "^19.2.0",
|
|
53
|
+
"tailwind-merge": "^3.4.0"
|
|
54
|
+
}
|
|
55
|
+
}
|