@kydra/ui 0.2.3 → 0.2.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/kyd/Button/index.d.mts +36 -0
- package/kyd/Button/index.d.ts +36 -0
- package/kyd/Button/index.js +2 -0
- package/kyd/Button/index.js.map +1 -0
- package/kyd/Button/index.mjs +2 -0
- package/kyd/Button/index.mjs.map +1 -0
- package/kyd/Checkbox/index.d.mts +26 -0
- package/kyd/Checkbox/index.d.ts +26 -0
- package/kyd/Checkbox/index.js +2 -0
- package/kyd/Checkbox/index.js.map +1 -0
- package/kyd/Checkbox/index.mjs +2 -0
- package/kyd/Checkbox/index.mjs.map +1 -0
- package/kyd/chunk-FEKZX2UD.mjs +2 -0
- package/kyd/chunk-FEKZX2UD.mjs.map +1 -0
- package/kyd/chunk-H7J3HXHU.js +7 -0
- package/kyd/chunk-H7J3HXHU.js.map +1 -0
- package/kyd/chunk-MQ5FY35R.js +2 -0
- package/kyd/chunk-MQ5FY35R.js.map +1 -0
- package/kyd/chunk-V7SDXFIT.mjs +7 -0
- package/kyd/chunk-V7SDXFIT.mjs.map +1 -0
- package/kyd/index.d.mts +3 -34
- package/kyd/index.d.ts +3 -34
- package/kyd/index.js +23 -28
- package/kyd/index.js.map +1 -1
- package/kyd/index.mjs +23 -28
- package/kyd/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'filled' | 'dotted' | 'ghost-hover';
|
|
5
|
+
type IconPosition = 'left' | 'right';
|
|
6
|
+
type TextAlign = 'left' | 'center' | 'right';
|
|
7
|
+
/**
|
|
8
|
+
* @interface ButtonProps
|
|
9
|
+
* Propiedades para el componente Button.
|
|
10
|
+
* Extiende los atributos nativos de un botón HTML.
|
|
11
|
+
*/
|
|
12
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
/** @param label - Texto descriptivo que se muestra dentro del botón. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** @param color - Color principal del botón en formato Hex, RGB o HSL. */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** @param variant - Estilo visual: 'filled' (sólido), 'dotted' (punteado) o 'ghost-hover' (relleno al hover). */
|
|
18
|
+
variant?: ButtonVariant;
|
|
19
|
+
/** @param icon - Elemento de icono (ReactNode) que acompaña al texto. */
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/** @param iconPosition - Ubicación del icono: 'left' (izquierda) o 'right' (derecha). */
|
|
22
|
+
iconPosition?: IconPosition;
|
|
23
|
+
/** @param textAlign - Alineación horizontal del contenido interno. */
|
|
24
|
+
textAlign?: TextAlign;
|
|
25
|
+
/** @param loading - Si es true, muestra un spinner y bloquea la interacción. */
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** @param kd - Objeto de estilos CSS personalizados para modificaciones directas (Kydra Design). */
|
|
28
|
+
kd?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Componente Button - Core librería @kydra/ui
|
|
33
|
+
*/
|
|
34
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
|
|
36
|
+
export { Button, type ButtonProps, type ButtonVariant, type IconPosition, type TextAlign };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'filled' | 'dotted' | 'ghost-hover';
|
|
5
|
+
type IconPosition = 'left' | 'right';
|
|
6
|
+
type TextAlign = 'left' | 'center' | 'right';
|
|
7
|
+
/**
|
|
8
|
+
* @interface ButtonProps
|
|
9
|
+
* Propiedades para el componente Button.
|
|
10
|
+
* Extiende los atributos nativos de un botón HTML.
|
|
11
|
+
*/
|
|
12
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
/** @param label - Texto descriptivo que se muestra dentro del botón. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** @param color - Color principal del botón en formato Hex, RGB o HSL. */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** @param variant - Estilo visual: 'filled' (sólido), 'dotted' (punteado) o 'ghost-hover' (relleno al hover). */
|
|
18
|
+
variant?: ButtonVariant;
|
|
19
|
+
/** @param icon - Elemento de icono (ReactNode) que acompaña al texto. */
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/** @param iconPosition - Ubicación del icono: 'left' (izquierda) o 'right' (derecha). */
|
|
22
|
+
iconPosition?: IconPosition;
|
|
23
|
+
/** @param textAlign - Alineación horizontal del contenido interno. */
|
|
24
|
+
textAlign?: TextAlign;
|
|
25
|
+
/** @param loading - Si es true, muestra un spinner y bloquea la interacción. */
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** @param kd - Objeto de estilos CSS personalizados para modificaciones directas (Kydra Design). */
|
|
28
|
+
kd?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Componente Button - Core librería @kydra/ui
|
|
33
|
+
*/
|
|
34
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
|
|
36
|
+
export { Button, type ButtonProps, type ButtonVariant, type IconPosition, type TextAlign };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @interface CheckBoxProps
|
|
6
|
+
* Propiedades para el componente CheckBox estilizado.
|
|
7
|
+
*/
|
|
8
|
+
interface CheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
|
|
9
|
+
/** @param color - Color del fondo cuando el checkbox está seleccionado. */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** @param label - Texto que se muestra a la par del control. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** @param value - Estado booleano (checked/unchecked). */
|
|
14
|
+
value?: boolean;
|
|
15
|
+
/** @param onChange - Callback que retorna el nuevo valor booleano. */
|
|
16
|
+
onChange?: (checked: boolean) => void;
|
|
17
|
+
/** @param kd - Estilos CSS para el cuadro visual (ej: borderRadius para hacerlo circular). */
|
|
18
|
+
kd?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Componente CheckBox - Core librería @kydra/ui
|
|
23
|
+
*/
|
|
24
|
+
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
25
|
+
|
|
26
|
+
export { CheckBox, type CheckBoxProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @interface CheckBoxProps
|
|
6
|
+
* Propiedades para el componente CheckBox estilizado.
|
|
7
|
+
*/
|
|
8
|
+
interface CheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
|
|
9
|
+
/** @param color - Color del fondo cuando el checkbox está seleccionado. */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** @param label - Texto que se muestra a la par del control. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** @param value - Estado booleano (checked/unchecked). */
|
|
14
|
+
value?: boolean;
|
|
15
|
+
/** @param onChange - Callback que retorna el nuevo valor booleano. */
|
|
16
|
+
onChange?: (checked: boolean) => void;
|
|
17
|
+
/** @param kd - Estilos CSS para el cuadro visual (ej: borderRadius para hacerlo circular). */
|
|
18
|
+
kd?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Componente CheckBox - Core librería @kydra/ui
|
|
23
|
+
*/
|
|
24
|
+
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
25
|
+
|
|
26
|
+
export { CheckBox, type CheckBoxProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {Check}from'lucide-react';import {forwardRef}from'react';import {jsxs,jsx}from'react/jsx-runtime';var a=forwardRef(({color:o="#6366f1",label:r,value:e=false,onChange:s,kd:c={},className:p="",disabled:n=false,...f},l)=>{let m=h=>{s&&s(h.target.checked);},d={"--tw-ring-color":o,borderColor:e?o:"#94a3b8",backgroundColor:e?o:"transparent",...c};return jsxs("label",{className:`inline-flex items-center gap-3 cursor-pointer select-none ${n?"opacity-50 cursor-not-allowed":""} ${p}`,children:[jsxs("div",{className:"relative flex items-center justify-center",children:[jsx("input",{ref:l,type:"checkbox",checked:e,onChange:m,disabled:n,className:"peer sr-only",...f}),jsx("div",{style:d,className:"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center",children:e&&jsx(Check,{size:14,className:"text-white animate-in zoom-in-50 duration-200",strokeWidth:4})})]}),r&&jsx("span",{className:"text-sm font-medium leading-none",children:r})]})});a.displayName="CheckBox";export{a};//# sourceMappingURL=chunk-FEKZX2UD.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-FEKZX2UD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Checkbox/CheckBox.tsx"],"names":["CheckBox","forwardRef","color","label","value","onChange","kd","className","disabled","props","ref","handleChange","e","customBoxStyles","jsxs","jsx","Check"],"mappings":"yGAQO,IAAMA,CAAAA,CAAWC,UAAAA,CAA4C,CAAC,CACnE,KAAA,CAAAC,CAAAA,CAAQ,SAAA,CACR,KAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,KAAA,CACR,QAAA,CAAAC,CAAAA,CACA,EAAA,CAAAC,EAAK,EAAC,CACN,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,GAAGC,CACL,CAAA,CAAGC,CAAAA,GAAQ,CACT,IAAMC,CAAAA,CAAgBC,CAAAA,EAA2C,CAC3DP,CAAAA,EAAUA,CAAAA,CAASO,CAAAA,CAAE,MAAA,CAAO,OAAO,EACzC,CAAA,CAEMC,CAAAA,CAAiC,CACrC,iBAAA,CAAmBX,CAAAA,CACnB,WAAA,CAAaE,CAAAA,CAAQF,CAAAA,CAAQ,SAAA,CAC7B,eAAA,CAAiBE,CAAAA,CAAQF,EAAQ,aAAA,CACjC,GAAGI,CACL,CAAA,CAEA,OACEQ,IAAAA,CAAC,OAAA,CAAA,CAAM,SAAA,CAAW,CAAA,0DAAA,EAA6DN,CAAAA,CAAW,+BAAA,CAAkC,EAAE,CAAA,CAAA,EAAID,CAAS,CAAA,CAAA,CACzI,QAAA,CAAA,CAAAO,KAAC,KAAA,CAAA,CAAI,SAAA,CAAU,2CAAA,CACb,QAAA,CAAA,CAAAC,GAAAA,CAAC,OAAA,CAAA,CAAM,GAAA,CAAKL,CAAAA,CAAK,KAAK,UAAA,CAAW,OAAA,CAASN,CAAAA,CAAO,QAAA,CAAUO,CAAAA,CAAc,QAAA,CAAUH,CAAAA,CAAU,SAAA,CAAU,eAAgB,GAAGC,CAAAA,CAAO,CAAA,CACjIM,GAAAA,CAAC,KAAA,CAAA,CAAI,KAAA,CAAOF,CAAAA,CAAiB,SAAA,CAAU,oNAAA,CACpC,QAAA,CAAAT,CAAAA,EAASW,GAAAA,CAACC,KAAAA,CAAA,CAAM,IAAA,CAAM,EAAA,CAAI,UAAU,+CAAA,CAAgD,WAAA,CAAa,CAAA,CAAG,CAAA,CACvG,CAAA,CAAA,CACF,CAAA,CACCb,CAAAA,EAASY,GAAAA,CAAC,QAAK,SAAA,CAAU,kCAAA,CAAoC,QAAA,CAAAZ,CAAAA,CAAM,CAAA,CAAA,CACtE,CAEJ,CAAC,EAEDH,EAAS,WAAA,CAAc,UAAA","file":"chunk-FEKZX2UD.mjs","sourcesContent":["import { Check } from \"lucide-react\";\r\nimport { CSSProperties, forwardRef } from \"react\";\r\nimport { CheckBoxProps } from \"./CheckBox.types\";\r\n\r\n\r\n/**\r\n * Componente CheckBox - Core librería @kydra/ui\r\n */\r\nexport const CheckBox = forwardRef<HTMLInputElement, CheckBoxProps>(({\r\n color = \"#6366f1\",\r\n label,\r\n value = false,\r\n onChange,\r\n kd = {},\r\n className = \"\",\r\n disabled = false,\r\n ...props\r\n}, ref) => {\r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n if (onChange) onChange(e.target.checked);\r\n };\r\n\r\n const customBoxStyles: CSSProperties = {\r\n '--tw-ring-color': color,\r\n borderColor: value ? color : '#94a3b8',\r\n backgroundColor: value ? color : 'transparent',\r\n ...kd\r\n } as CSSProperties;\r\n\r\n return (\r\n <label className={`inline-flex items-center gap-3 cursor-pointer select-none ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`}>\r\n <div className=\"relative flex items-center justify-center\">\r\n <input ref={ref} type=\"checkbox\" checked={value} onChange={handleChange} disabled={disabled} className=\"peer sr-only\" {...props} />\r\n <div style={customBoxStyles} className=\"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center\">\r\n {value && <Check size={14} className=\"text-white animate-in zoom-in-50 duration-200\" strokeWidth={4} />}\r\n </div>\r\n </div>\r\n {label && <span className=\"text-sm font-medium leading-none\">{label}</span>}\r\n </label>\r\n );\r\n});\r\n\r\nCheckBox.displayName = \"CheckBox\";"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var react=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');var f=react.forwardRef(({label:p="Bot\xF3n",color:r="#6366f1",variant:c="filled",icon:a,iconPosition:u="left",textAlign:m="center",type:d="button",onClick:x,className:y="",disabled:o=false,loading:t=false,kd:g={},...b},S)=>{let[i,l]=react.useState(false),v={left:"justify-start",center:"justify-center",right:"justify-end"};return jsxRuntime.jsx("button",{ref:S,type:d,disabled:o||t,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),onClick:x,style:{...(()=>{let e=i&&!o&&!t,n={opacity:o||t?.6:1,cursor:o||t?"not-allowed":"pointer",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1)"};switch(c){case "filled":return {...n,backgroundColor:r,color:"#ffffff",border:"1px solid transparent",filter:e?"brightness(0.9)":"none",boxShadow:e?"0 4px 12px rgba(0,0,0,0.15)":"none"};case "dotted":return {...n,backgroundColor:e?`${r}15`:"transparent",color:r,border:`2px dotted ${r}`,transform:e?"translateY(-1px)":"none"};case "ghost-hover":return {...n,backgroundColor:e?r:"transparent",color:e?"#ffffff":"currentColor",borderColor:e?"transparent":"currentColor",borderWidth:"1px",borderStyle:"solid"};default:return n}})(),...g},className:`
|
|
2
|
+
group relative px-6 py-3 rounded-lg font-medium
|
|
3
|
+
active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden
|
|
4
|
+
${v[m]}
|
|
5
|
+
${y}
|
|
6
|
+
`,...b,children:jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${u==="right"?"flex-row-reverse":"flex-row"}`,children:[t?jsxRuntime.jsx(lucideReact.Loader2,{className:"animate-spin",size:18}):a&&jsxRuntime.jsx("span",{className:`flex items-center transition-transform duration-300 ${i&&!o?"scale-110":""}`,children:a}),jsxRuntime.jsx("span",{className:"leading-none",children:t?"Cargando...":p})]})})});f.displayName="Button";exports.a=f;//# sourceMappingURL=chunk-H7J3HXHU.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-H7J3HXHU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button/Button.tsx"],"names":["Button","forwardRef","label","color","variant","icon","iconPosition","textAlign","type","onClick","className","disabled","loading","kd","props","ref","isHovered","setIsHovered","useState","alignmentStyles","jsx","activeHover","baseStyles","jsxs","Loader2"],"mappings":"oHAQO,IAAMA,CAAAA,CAASC,iBAA2C,CAAC,CAChE,KAAA,CAAAC,CAAAA,CAAQ,UAAA,CACR,KAAA,CAAAC,EAAQ,SAAA,CACR,OAAA,CAAAC,EAAU,QAAA,CACV,IAAA,CAAAC,EACA,YAAA,CAAAC,CAAAA,CAAe,MAAA,CACf,SAAA,CAAAC,CAAAA,CAAY,QAAA,CACZ,KAAAC,CAAAA,CAAO,QAAA,CACP,QAAAC,CAAAA,CACA,SAAA,CAAAC,EAAY,EAAA,CACZ,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,MACV,EAAA,CAAAC,CAAAA,CAAK,EAAC,CACN,GAAGC,CACL,CAAA,CAAGC,CAAAA,GAAQ,CACT,GAAM,CAACC,CAAAA,CAAWC,CAAY,CAAA,CAAIC,cAAAA,CAAS,KAAK,CAAA,CAG1CC,CAAAA,CAA6C,CACjD,IAAA,CAAM,eAAA,CACN,MAAA,CAAQ,gBAAA,CACR,KAAA,CAAO,aACT,EA4CA,OACEC,cAAAA,CAAC,UACC,GAAA,CAAKL,CAAAA,CACL,KAAMP,CAAAA,CACN,QAAA,CAAUG,CAAAA,EAAYC,CAAAA,CACtB,YAAA,CAAc,IAAMK,EAAa,IAAI,CAAA,CACrC,aAAc,IAAMA,CAAAA,CAAa,KAAK,CAAA,CACtC,OAAA,CAASR,CAAAA,CACT,KAAA,CAAO,CAAE,GAAA,CAjDY,IAAqB,CAC5C,IAAMY,EAAcL,CAAAA,EAAa,CAACL,GAAY,CAACC,CAAAA,CAEzCU,CAAAA,CAA4B,CAChC,OAAA,CAASX,CAAAA,EAAYC,EAAU,EAAA,CAAM,CAAA,CACrC,OAAQD,CAAAA,EAAYC,CAAAA,CAAU,cAAgB,SAAA,CAC9C,UAAA,CAAY,wCACd,CAAA,CAEA,OAAQR,CAAAA,EACN,KAAK,QAAA,CACH,OAAO,CACL,GAAGkB,EACH,eAAA,CAAiBnB,CAAAA,CACjB,KAAA,CAAO,SAAA,CACP,MAAA,CAAQ,uBAAA,CACR,OAAQkB,CAAAA,CAAc,iBAAA,CAAoB,OAC1C,SAAA,CAAWA,CAAAA,CAAc,8BAAgC,MAC3D,CAAA,CACF,KAAK,QAAA,CACH,OAAO,CACL,GAAGC,CAAAA,CACH,eAAA,CAAiBD,EAAc,CAAA,EAAGlB,CAAK,KAAO,aAAA,CAC9C,KAAA,CAAOA,CAAAA,CACP,MAAA,CAAQ,CAAA,WAAA,EAAcA,CAAK,GAC3B,SAAA,CAAWkB,CAAAA,CAAc,mBAAqB,MAChD,CAAA,CACF,KAAK,aAAA,CACH,OAAO,CACL,GAAGC,CAAAA,CACH,eAAA,CAAiBD,EAAclB,CAAAA,CAAQ,aAAA,CACvC,MAAOkB,CAAAA,CAAc,SAAA,CAAY,eACjC,WAAA,CAAaA,CAAAA,CAAc,aAAA,CAAgB,cAAA,CAC3C,WAAA,CAAa,KAAA,CACb,YAAa,OACf,CAAA,CACF,QACE,OAAOC,CACX,CACF,IAUiC,CAAG,GAAGT,CAAG,CAAA,CACtC,SAAA,CAAW;AAAA;AAAA;AAAA,QAAA,EAGPM,CAAAA,CAAgBZ,CAAS,CAAC;AAAA,QAAA,EAC1BG,CAAS;AAAA,MAAA,CAAA,CAEZ,GAAGI,EAEJ,QAAA,CAAAS,eAAAA,CAAC,OAAI,SAAA,CAAW,CAAA,wBAAA,EAA2BjB,CAAAA,GAAiB,OAAA,CAAU,kBAAA,CAAqB,UAAU,GAClG,QAAA,CAAA,CAAAM,CAAAA,CACCQ,cAAAA,CAACI,mBAAAA,CAAA,CAAQ,SAAA,CAAU,eAAe,IAAA,CAAM,EAAA,CAAI,CAAA,CAE5CnB,CAAAA,EACEe,cAAAA,CAAC,MAAA,CAAA,CAAK,UAAW,CAAA,oDAAA,EAAuDJ,CAAAA,EAAa,CAACL,CAAAA,CAAW,WAAA,CAAc,EAAE,CAAA,CAAA,CAC9G,QAAA,CAAAN,CAAAA,CACH,CAAA,CAGJe,cAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,cAAA,CAAgB,QAAA,CAAAR,CAAAA,CAAU,aAAA,CAAgBV,CAAAA,CAAM,CAAA,CAAA,CAClE,EACF,CAEJ,CAAC,EAEDF,CAAAA,CAAO,WAAA,CAAc,QAAA","file":"chunk-H7J3HXHU.js","sourcesContent":["import { useState, forwardRef, CSSProperties } from 'react';\r\nimport { Loader2 } from 'lucide-react';\r\nimport { ButtonProps, TextAlign } from './Button.types';\r\n\r\n\r\n/**\r\n * Componente Button - Core librería @kydra/ui\r\n */\r\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(({\r\n label = \"Botón\",\r\n color = \"#6366f1\",\r\n variant = \"filled\",\r\n icon,\r\n iconPosition = \"left\",\r\n textAlign = \"center\",\r\n type = \"button\",\r\n onClick,\r\n className = \"\",\r\n disabled = false,\r\n loading = false,\r\n kd = {},\r\n ...props\r\n}, ref) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n // Mapeo de estilos de alineación\r\n const alignmentStyles: Record<TextAlign, string> = {\r\n left: 'justify-start',\r\n center: 'justify-center',\r\n right: 'justify-end'\r\n };\r\n\r\n // Lógica de estilos dinámicos\r\n const getDynamicStyles = (): CSSProperties => {\r\n const activeHover = isHovered && !disabled && !loading;\r\n\r\n const baseStyles: CSSProperties = {\r\n opacity: disabled || loading ? 0.6 : 1,\r\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\r\n transition: 'all 300ms cubic-bezier(0.4, 0, 0.2, 1)',\r\n };\r\n\r\n switch (variant) {\r\n case 'filled':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: color,\r\n color: '#ffffff',\r\n border: '1px solid transparent',\r\n filter: activeHover ? 'brightness(0.9)' : 'none',\r\n boxShadow: activeHover ? '0 4px 12px rgba(0,0,0,0.15)' : 'none',\r\n };\r\n case 'dotted':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? `${color}15` : 'transparent',\r\n color: color,\r\n border: `2px dotted ${color}`,\r\n transform: activeHover ? 'translateY(-1px)' : 'none',\r\n };\r\n case 'ghost-hover':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? color : 'transparent',\r\n color: activeHover ? '#ffffff' : 'currentColor',\r\n borderColor: activeHover ? 'transparent' : 'currentColor',\r\n borderWidth: '1px',\r\n borderStyle: 'solid',\r\n };\r\n default:\r\n return baseStyles;\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n type={type}\r\n disabled={disabled || loading}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n onClick={onClick}\r\n style={{ ...getDynamicStyles(), ...kd }}\r\n className={`\r\n group relative px-6 py-3 rounded-lg font-medium \r\n active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden\r\n ${alignmentStyles[textAlign]}\r\n ${className}\r\n `}\r\n {...props}\r\n >\r\n <div className={`flex items-center gap-2 ${iconPosition === 'right' ? 'flex-row-reverse' : 'flex-row'}`}>\r\n {loading ? (\r\n <Loader2 className=\"animate-spin\" size={18} />\r\n ) : (\r\n icon && (\r\n <span className={`flex items-center transition-transform duration-300 ${isHovered && !disabled ? 'scale-110' : ''}`}>\r\n {icon}\r\n </span>\r\n )\r\n )}\r\n <span className=\"leading-none\">{loading ? 'Cargando...' : label}</span>\r\n </div>\r\n </button>\r\n );\r\n});\r\n\r\nButton.displayName = \"Button\";"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var lucideReact=require('lucide-react'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var a=react.forwardRef(({color:o="#6366f1",label:r,value:e=false,onChange:s,kd:c={},className:p="",disabled:n=false,...f},l)=>{let m=h=>{s&&s(h.target.checked);},d={"--tw-ring-color":o,borderColor:e?o:"#94a3b8",backgroundColor:e?o:"transparent",...c};return jsxRuntime.jsxs("label",{className:`inline-flex items-center gap-3 cursor-pointer select-none ${n?"opacity-50 cursor-not-allowed":""} ${p}`,children:[jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center",children:[jsxRuntime.jsx("input",{ref:l,type:"checkbox",checked:e,onChange:m,disabled:n,className:"peer sr-only",...f}),jsxRuntime.jsx("div",{style:d,className:"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center",children:e&&jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-white animate-in zoom-in-50 duration-200",strokeWidth:4})})]}),r&&jsxRuntime.jsx("span",{className:"text-sm font-medium leading-none",children:r})]})});a.displayName="CheckBox";exports.a=a;//# sourceMappingURL=chunk-MQ5FY35R.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-MQ5FY35R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Checkbox/CheckBox.tsx"],"names":["CheckBox","forwardRef","color","label","value","onChange","kd","className","disabled","props","ref","handleChange","e","customBoxStyles","jsxs","jsx","Check"],"mappings":"oHAQO,IAAMA,CAAAA,CAAWC,gBAAAA,CAA4C,CAAC,CACnE,KAAA,CAAAC,CAAAA,CAAQ,SAAA,CACR,KAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,KAAA,CACR,QAAA,CAAAC,CAAAA,CACA,EAAA,CAAAC,EAAK,EAAC,CACN,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,GAAGC,CACL,CAAA,CAAGC,CAAAA,GAAQ,CACT,IAAMC,CAAAA,CAAgBC,CAAAA,EAA2C,CAC3DP,CAAAA,EAAUA,CAAAA,CAASO,CAAAA,CAAE,MAAA,CAAO,OAAO,EACzC,CAAA,CAEMC,CAAAA,CAAiC,CACrC,iBAAA,CAAmBX,CAAAA,CACnB,WAAA,CAAaE,CAAAA,CAAQF,CAAAA,CAAQ,SAAA,CAC7B,eAAA,CAAiBE,CAAAA,CAAQF,EAAQ,aAAA,CACjC,GAAGI,CACL,CAAA,CAEA,OACEQ,eAAAA,CAAC,OAAA,CAAA,CAAM,SAAA,CAAW,CAAA,0DAAA,EAA6DN,CAAAA,CAAW,+BAAA,CAAkC,EAAE,CAAA,CAAA,EAAID,CAAS,CAAA,CAAA,CACzI,QAAA,CAAA,CAAAO,gBAAC,KAAA,CAAA,CAAI,SAAA,CAAU,2CAAA,CACb,QAAA,CAAA,CAAAC,cAAAA,CAAC,OAAA,CAAA,CAAM,GAAA,CAAKL,CAAAA,CAAK,KAAK,UAAA,CAAW,OAAA,CAASN,CAAAA,CAAO,QAAA,CAAUO,CAAAA,CAAc,QAAA,CAAUH,CAAAA,CAAU,SAAA,CAAU,eAAgB,GAAGC,CAAAA,CAAO,CAAA,CACjIM,cAAAA,CAAC,KAAA,CAAA,CAAI,KAAA,CAAOF,CAAAA,CAAiB,SAAA,CAAU,oNAAA,CACpC,QAAA,CAAAT,CAAAA,EAASW,cAAAA,CAACC,iBAAAA,CAAA,CAAM,IAAA,CAAM,EAAA,CAAI,UAAU,+CAAA,CAAgD,WAAA,CAAa,CAAA,CAAG,CAAA,CACvG,CAAA,CAAA,CACF,CAAA,CACCb,CAAAA,EAASY,cAAAA,CAAC,QAAK,SAAA,CAAU,kCAAA,CAAoC,QAAA,CAAAZ,CAAAA,CAAM,CAAA,CAAA,CACtE,CAEJ,CAAC,EAEDH,EAAS,WAAA,CAAc,UAAA","file":"chunk-MQ5FY35R.js","sourcesContent":["import { Check } from \"lucide-react\";\r\nimport { CSSProperties, forwardRef } from \"react\";\r\nimport { CheckBoxProps } from \"./CheckBox.types\";\r\n\r\n\r\n/**\r\n * Componente CheckBox - Core librería @kydra/ui\r\n */\r\nexport const CheckBox = forwardRef<HTMLInputElement, CheckBoxProps>(({\r\n color = \"#6366f1\",\r\n label,\r\n value = false,\r\n onChange,\r\n kd = {},\r\n className = \"\",\r\n disabled = false,\r\n ...props\r\n}, ref) => {\r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n if (onChange) onChange(e.target.checked);\r\n };\r\n\r\n const customBoxStyles: CSSProperties = {\r\n '--tw-ring-color': color,\r\n borderColor: value ? color : '#94a3b8',\r\n backgroundColor: value ? color : 'transparent',\r\n ...kd\r\n } as CSSProperties;\r\n\r\n return (\r\n <label className={`inline-flex items-center gap-3 cursor-pointer select-none ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`}>\r\n <div className=\"relative flex items-center justify-center\">\r\n <input ref={ref} type=\"checkbox\" checked={value} onChange={handleChange} disabled={disabled} className=\"peer sr-only\" {...props} />\r\n <div style={customBoxStyles} className=\"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center\">\r\n {value && <Check size={14} className=\"text-white animate-in zoom-in-50 duration-200\" strokeWidth={4} />}\r\n </div>\r\n </div>\r\n {label && <span className=\"text-sm font-medium leading-none\">{label}</span>}\r\n </label>\r\n );\r\n});\r\n\r\nCheckBox.displayName = \"CheckBox\";"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {forwardRef,useState}from'react';import {Loader2}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var f=forwardRef(({label:p="Bot\xF3n",color:r="#6366f1",variant:c="filled",icon:a,iconPosition:u="left",textAlign:m="center",type:d="button",onClick:x,className:y="",disabled:o=false,loading:t=false,kd:g={},...b},S)=>{let[i,l]=useState(false),v={left:"justify-start",center:"justify-center",right:"justify-end"};return jsx("button",{ref:S,type:d,disabled:o||t,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),onClick:x,style:{...(()=>{let e=i&&!o&&!t,n={opacity:o||t?.6:1,cursor:o||t?"not-allowed":"pointer",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1)"};switch(c){case "filled":return {...n,backgroundColor:r,color:"#ffffff",border:"1px solid transparent",filter:e?"brightness(0.9)":"none",boxShadow:e?"0 4px 12px rgba(0,0,0,0.15)":"none"};case "dotted":return {...n,backgroundColor:e?`${r}15`:"transparent",color:r,border:`2px dotted ${r}`,transform:e?"translateY(-1px)":"none"};case "ghost-hover":return {...n,backgroundColor:e?r:"transparent",color:e?"#ffffff":"currentColor",borderColor:e?"transparent":"currentColor",borderWidth:"1px",borderStyle:"solid"};default:return n}})(),...g},className:`
|
|
2
|
+
group relative px-6 py-3 rounded-lg font-medium
|
|
3
|
+
active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden
|
|
4
|
+
${v[m]}
|
|
5
|
+
${y}
|
|
6
|
+
`,...b,children:jsxs("div",{className:`flex items-center gap-2 ${u==="right"?"flex-row-reverse":"flex-row"}`,children:[t?jsx(Loader2,{className:"animate-spin",size:18}):a&&jsx("span",{className:`flex items-center transition-transform duration-300 ${i&&!o?"scale-110":""}`,children:a}),jsx("span",{className:"leading-none",children:t?"Cargando...":p})]})})});f.displayName="Button";export{f as a};//# sourceMappingURL=chunk-V7SDXFIT.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-V7SDXFIT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button/Button.tsx"],"names":["Button","forwardRef","label","color","variant","icon","iconPosition","textAlign","type","onClick","className","disabled","loading","kd","props","ref","isHovered","setIsHovered","useState","alignmentStyles","jsx","activeHover","baseStyles","jsxs","Loader2"],"mappings":"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","file":"chunk-V7SDXFIT.mjs","sourcesContent":["import { useState, forwardRef, CSSProperties } from 'react';\r\nimport { Loader2 } from 'lucide-react';\r\nimport { ButtonProps, TextAlign } from './Button.types';\r\n\r\n\r\n/**\r\n * Componente Button - Core librería @kydra/ui\r\n */\r\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(({\r\n label = \"Botón\",\r\n color = \"#6366f1\",\r\n variant = \"filled\",\r\n icon,\r\n iconPosition = \"left\",\r\n textAlign = \"center\",\r\n type = \"button\",\r\n onClick,\r\n className = \"\",\r\n disabled = false,\r\n loading = false,\r\n kd = {},\r\n ...props\r\n}, ref) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n // Mapeo de estilos de alineación\r\n const alignmentStyles: Record<TextAlign, string> = {\r\n left: 'justify-start',\r\n center: 'justify-center',\r\n right: 'justify-end'\r\n };\r\n\r\n // Lógica de estilos dinámicos\r\n const getDynamicStyles = (): CSSProperties => {\r\n const activeHover = isHovered && !disabled && !loading;\r\n\r\n const baseStyles: CSSProperties = {\r\n opacity: disabled || loading ? 0.6 : 1,\r\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\r\n transition: 'all 300ms cubic-bezier(0.4, 0, 0.2, 1)',\r\n };\r\n\r\n switch (variant) {\r\n case 'filled':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: color,\r\n color: '#ffffff',\r\n border: '1px solid transparent',\r\n filter: activeHover ? 'brightness(0.9)' : 'none',\r\n boxShadow: activeHover ? '0 4px 12px rgba(0,0,0,0.15)' : 'none',\r\n };\r\n case 'dotted':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? `${color}15` : 'transparent',\r\n color: color,\r\n border: `2px dotted ${color}`,\r\n transform: activeHover ? 'translateY(-1px)' : 'none',\r\n };\r\n case 'ghost-hover':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? color : 'transparent',\r\n color: activeHover ? '#ffffff' : 'currentColor',\r\n borderColor: activeHover ? 'transparent' : 'currentColor',\r\n borderWidth: '1px',\r\n borderStyle: 'solid',\r\n };\r\n default:\r\n return baseStyles;\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n type={type}\r\n disabled={disabled || loading}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n onClick={onClick}\r\n style={{ ...getDynamicStyles(), ...kd }}\r\n className={`\r\n group relative px-6 py-3 rounded-lg font-medium \r\n active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden\r\n ${alignmentStyles[textAlign]}\r\n ${className}\r\n `}\r\n {...props}\r\n >\r\n <div className={`flex items-center gap-2 ${iconPosition === 'right' ? 'flex-row-reverse' : 'flex-row'}`}>\r\n {loading ? (\r\n <Loader2 className=\"animate-spin\" size={18} />\r\n ) : (\r\n icon && (\r\n <span className={`flex items-center transition-transform duration-300 ${isHovered && !disabled ? 'scale-110' : ''}`}>\r\n {icon}\r\n </span>\r\n )\r\n )}\r\n <span className=\"leading-none\">{loading ? 'Cargando...' : label}</span>\r\n </div>\r\n </button>\r\n );\r\n});\r\n\r\nButton.displayName = \"Button\";"]}
|
package/kyd/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { InputHTMLAttributes, CSSProperties,
|
|
3
|
+
import react__default, { InputHTMLAttributes, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { LucideIcon } from 'lucide-react';
|
|
5
|
+
export { Button, ButtonProps, ButtonVariant, IconPosition, TextAlign } from './Button/index.mjs';
|
|
5
6
|
|
|
6
7
|
interface TableAction<T> {
|
|
7
8
|
label: string;
|
|
@@ -87,38 +88,6 @@ interface CheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onC
|
|
|
87
88
|
*/
|
|
88
89
|
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
89
90
|
|
|
90
|
-
type ButtonVariant = 'filled' | 'dotted' | 'ghost-hover';
|
|
91
|
-
type IconPosition = 'left' | 'right';
|
|
92
|
-
type TextAlign = 'left' | 'center' | 'right';
|
|
93
|
-
/**
|
|
94
|
-
* @interface ButtonProps
|
|
95
|
-
* Propiedades para el componente Button.
|
|
96
|
-
* Extiende los atributos nativos de un botón HTML.
|
|
97
|
-
*/
|
|
98
|
-
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
99
|
-
/** @param label - Texto descriptivo que se muestra dentro del botón. */
|
|
100
|
-
label?: string;
|
|
101
|
-
/** @param color - Color principal del botón en formato Hex, RGB o HSL. */
|
|
102
|
-
color?: string;
|
|
103
|
-
/** @param variant - Estilo visual: 'filled' (sólido), 'dotted' (punteado) o 'ghost-hover' (relleno al hover). */
|
|
104
|
-
variant?: ButtonVariant;
|
|
105
|
-
/** @param icon - Elemento de icono (ReactNode) que acompaña al texto. */
|
|
106
|
-
icon?: ReactNode;
|
|
107
|
-
/** @param iconPosition - Ubicación del icono: 'left' (izquierda) o 'right' (derecha). */
|
|
108
|
-
iconPosition?: IconPosition;
|
|
109
|
-
/** @param textAlign - Alineación horizontal del contenido interno. */
|
|
110
|
-
textAlign?: TextAlign;
|
|
111
|
-
/** @param loading - Si es true, muestra un spinner y bloquea la interacción. */
|
|
112
|
-
loading?: boolean;
|
|
113
|
-
/** @param kd - Objeto de estilos CSS personalizados para modificaciones directas (Kydra Design). */
|
|
114
|
-
kd?: CSSProperties;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Componente Button - Core librería @kydra/ui
|
|
119
|
-
*/
|
|
120
|
-
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
121
|
-
|
|
122
91
|
type NavbarPosition = 'static' | 'sticky' | 'fixed-bottom-floating';
|
|
123
92
|
/**
|
|
124
93
|
* @interface NavbarProps
|
|
@@ -148,4 +117,4 @@ interface NavbarProps {
|
|
|
148
117
|
*/
|
|
149
118
|
declare const Navbar: ({ title, position, color, colorDominant, isMenuOpen, onToggleMenu, children, kd }: NavbarProps) => react_jsx_runtime.JSX.Element;
|
|
150
119
|
|
|
151
|
-
export {
|
|
120
|
+
export { CheckBox, type CheckBoxProps, Input, type InputProps, type InputVariant, Navbar, type NavbarPosition, type NavbarProps, Table, type TableAction, type TableColumn };
|
package/kyd/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { InputHTMLAttributes, CSSProperties,
|
|
3
|
+
import react__default, { InputHTMLAttributes, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { LucideIcon } from 'lucide-react';
|
|
5
|
+
export { Button, ButtonProps, ButtonVariant, IconPosition, TextAlign } from './Button/index.js';
|
|
5
6
|
|
|
6
7
|
interface TableAction<T> {
|
|
7
8
|
label: string;
|
|
@@ -87,38 +88,6 @@ interface CheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onC
|
|
|
87
88
|
*/
|
|
88
89
|
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
89
90
|
|
|
90
|
-
type ButtonVariant = 'filled' | 'dotted' | 'ghost-hover';
|
|
91
|
-
type IconPosition = 'left' | 'right';
|
|
92
|
-
type TextAlign = 'left' | 'center' | 'right';
|
|
93
|
-
/**
|
|
94
|
-
* @interface ButtonProps
|
|
95
|
-
* Propiedades para el componente Button.
|
|
96
|
-
* Extiende los atributos nativos de un botón HTML.
|
|
97
|
-
*/
|
|
98
|
-
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
99
|
-
/** @param label - Texto descriptivo que se muestra dentro del botón. */
|
|
100
|
-
label?: string;
|
|
101
|
-
/** @param color - Color principal del botón en formato Hex, RGB o HSL. */
|
|
102
|
-
color?: string;
|
|
103
|
-
/** @param variant - Estilo visual: 'filled' (sólido), 'dotted' (punteado) o 'ghost-hover' (relleno al hover). */
|
|
104
|
-
variant?: ButtonVariant;
|
|
105
|
-
/** @param icon - Elemento de icono (ReactNode) que acompaña al texto. */
|
|
106
|
-
icon?: ReactNode;
|
|
107
|
-
/** @param iconPosition - Ubicación del icono: 'left' (izquierda) o 'right' (derecha). */
|
|
108
|
-
iconPosition?: IconPosition;
|
|
109
|
-
/** @param textAlign - Alineación horizontal del contenido interno. */
|
|
110
|
-
textAlign?: TextAlign;
|
|
111
|
-
/** @param loading - Si es true, muestra un spinner y bloquea la interacción. */
|
|
112
|
-
loading?: boolean;
|
|
113
|
-
/** @param kd - Objeto de estilos CSS personalizados para modificaciones directas (Kydra Design). */
|
|
114
|
-
kd?: CSSProperties;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Componente Button - Core librería @kydra/ui
|
|
119
|
-
*/
|
|
120
|
-
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
121
|
-
|
|
122
91
|
type NavbarPosition = 'static' | 'sticky' | 'fixed-bottom-floating';
|
|
123
92
|
/**
|
|
124
93
|
* @interface NavbarProps
|
|
@@ -148,4 +117,4 @@ interface NavbarProps {
|
|
|
148
117
|
*/
|
|
149
118
|
declare const Navbar: ({ title, position, color, colorDominant, isMenuOpen, onToggleMenu, children, kd }: NavbarProps) => react_jsx_runtime.JSX.Element;
|
|
150
119
|
|
|
151
|
-
export {
|
|
120
|
+
export { CheckBox, type CheckBoxProps, Input, type InputProps, type InputVariant, Navbar, type NavbarPosition, type NavbarProps, Table, type TableAction, type TableColumn };
|
package/kyd/index.js
CHANGED
|
@@ -1,46 +1,41 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
${
|
|
1
|
+
'use strict';var chunkH7J3HXHU_js=require('./chunk-H7J3HXHU.js'),chunkMQ5FY35R_js=require('./chunk-MQ5FY35R.js'),ie=require('react'),reactDom=require('react-dom'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ie__default=/*#__PURE__*/_interopDefault(ie);var B=ie.forwardRef(({icon:r,color:c="#6366f1",label:n,error:a,variant:l="standard",type:b="text",value:i="",onChange:o,onClear:d,placeholder:k,disabled:h,className:E="",kd:L={},...j},I)=>{let[w,x]=ie.useState(false),P=u=>{o&&o(u.target.value);},m=w||i&&i.toString().length>0,O=()=>{let u="block w-full text-sm transition-all outline-none dark:text-white";switch(l){case "filled":return `${u} pt-6 pb-3 px-4 bg-slate-100 dark:bg-slate-800 border-b-2 border-transparent rounded-t-xl focus:bg-slate-50 dark:focus:bg-slate-900 focus:border-[var(--highlight)] ${a?"border-red-400 bg-red-50 dark:bg-red-950/20":""}`;case "underlined":return `${u} pt-6 pb-3 bg-transparent border-b-2 border-slate-200 dark:border-slate-800 rounded-none px-0 focus:border-[var(--highlight)] focus:ring-0 ${a?"border-red-400":""}`;default:return `${u} py-3.5 px-4 bg-white dark:bg-slate-900 border rounded-xl
|
|
2
|
+
${a?"border-red-400 focus:border-red-500 ring-0 focus:ring-2 focus:ring-red-500/10":"border-slate-200 dark:border-slate-800 focus:border-[var(--highlight)] ring-0 focus:ring-2 focus:ring-[var(--highlight)]/20"}`}};return jsxRuntime.jsxs("div",{className:`flex flex-col gap-1 w-full ${E}`,style:{"--highlight":c},children:[jsxRuntime.jsxs("div",{className:"relative flex items-center group",children:[n&&jsxRuntime.jsx("label",{className:`
|
|
3
3
|
absolute pointer-events-none transition-all duration-200 ease-in-out z-20
|
|
4
|
-
${
|
|
4
|
+
${m?`text-[10px] font-bold uppercase tracking-wider ${a?"text-red-500":"text-[var(--highlight)]"}`:"text-sm font-medium text-slate-400"}
|
|
5
5
|
|
|
6
6
|
/* Alineaci\xF3n Horizontal: Uniforme en standard y filled */
|
|
7
|
-
${
|
|
7
|
+
${l==="underlined"?"left-0":"left-4"}
|
|
8
8
|
|
|
9
9
|
/* Posicionamiento Vertical */
|
|
10
|
-
${
|
|
10
|
+
${l==="standard"?m?"-top-2 px-1.5 bg-white dark:bg-slate-900 translate-x-[-4px]":"top-1/2 -translate-y-1/2":m?"top-1.5":"top-[31px] -translate-y-1/2"}
|
|
11
11
|
|
|
12
12
|
/* Ajuste por Icono cuando NO flota */
|
|
13
|
-
${!
|
|
14
|
-
`,children:
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
13
|
+
${!m&&r?"pl-7":""}
|
|
14
|
+
`,children:n}),r&&jsxRuntime.jsx("div",{className:`absolute flex items-center pointer-events-none transition-colors duration-200 z-10
|
|
15
|
+
${l==="underlined"?"left-0":"left-4"}
|
|
16
|
+
${l==="standard"?"top-1/2 -translate-y-1/2":"top-[31px] -translate-y-1/2"}
|
|
17
|
+
${a?"text-red-400":w?"text-[var(--highlight)]":"text-slate-400"}`,children:jsxRuntime.jsx(r,{className:"w-4 h-4"})}),jsxRuntime.jsx("input",{ref:I,type:b,value:i,onFocus:()=>x(true),onBlur:()=>x(false),onChange:P,disabled:h,placeholder:w&&m?k:"",style:{...L},className:`
|
|
18
|
+
${O()}
|
|
19
|
+
${h?"opacity-50 cursor-not-allowed":""}
|
|
20
20
|
/* Padding Left: alineado con el icono */
|
|
21
|
-
${
|
|
21
|
+
${r?l==="underlined"?"pl-7":"pl-11":l==="underlined"?"pl-0":"pl-4"}
|
|
22
22
|
${d?"pr-10":"pr-4"}
|
|
23
23
|
relative z-0
|
|
24
|
-
`,...
|
|
25
|
-
${
|
|
26
|
-
group relative px-6 py-3 rounded-lg font-medium
|
|
27
|
-
active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden
|
|
28
|
-
${x[m]}
|
|
29
|
-
${d}
|
|
30
|
-
`,...I,children:jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${i==="right"?"flex-row-reverse":"flex-row"}`,children:[f?jsxRuntime.jsx(lucideReact.Loader2,{className:"animate-spin",size:18}):r&&jsxRuntime.jsx("span",{className:`flex items-center transition-transform duration-300 ${C&&!u?"scale-110":""}`,children:r}),jsxRuntime.jsx("span",{className:"leading-none",children:f?"Cargando...":a})]})})});j.displayName="Button";var _=he.createContext({darkMode:false,color:"#2563eb"}),q=()=>he.useContext(_),Me=he__default.default.memo(({row:a,columns:o,selectable:s,isSelected:r,onSelect:i})=>{let{color:m}=q(),n={left:"text-left",center:"text-center",right:"text-right"};return jsxRuntime.jsxs("tr",{className:"group transition-colors duration-150 hover:bg-[var(--highlight)]/5",children:[s&&jsxRuntime.jsx("td",{className:"px-6 py-4 border-b border-transparent",children:jsxRuntime.jsx(L,{color:m,value:r,onChange:()=>i(a.id)})}),o.filter(l=>!l.hidden).map(l=>jsxRuntime.jsx("td",{className:`
|
|
24
|
+
`,...j}),i&&d&&!h&&jsxRuntime.jsx("button",{type:"button",onClick:d,className:`absolute right-0 flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 transition-colors z-20
|
|
25
|
+
${l==="underlined"?"pr-0 top-[31px] -translate-y-1/2":"pr-3 top-1/2 -translate-y-1/2"}`,children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),a&&jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-red-500 ml-1 uppercase tracking-tight animate-in slide-in-from-top-1 duration-200",children:a})]})});B.displayName="Input";var K=ie.createContext({darkMode:false,color:"#2563eb"}),_=()=>ie.useContext(K),Te=ie__default.default.memo(({row:r,columns:c,selectable:n,isSelected:a,onSelect:l})=>{let{color:b}=_(),i={left:"text-left",center:"text-center",right:"text-right"};return jsxRuntime.jsxs("tr",{className:"group transition-colors duration-150 hover:bg-[var(--highlight)]/5",children:[n&&jsxRuntime.jsx("td",{className:"px-6 py-4 border-b border-transparent",children:jsxRuntime.jsx(chunkMQ5FY35R_js.a,{color:b,value:a,onChange:()=>l(r.id)})}),c.filter(o=>!o.hidden).map(o=>jsxRuntime.jsx("td",{className:`
|
|
31
26
|
whitespace-nowrap px-6 py-4
|
|
32
27
|
text-slate-600 dark:text-slate-300
|
|
33
28
|
transition-colors group-hover:text-slate-900 dark:group-hover:text-white
|
|
34
|
-
${
|
|
35
|
-
`,children:
|
|
36
|
-
`),
|
|
37
|
-
`+
|
|
29
|
+
${i[o.align||"left"]}
|
|
30
|
+
`,children:o.actions?jsxRuntime.jsx($e,{actions:o.actions,row:r}):o.format?o.format(r[o.accessor],r,b):String(r[o.accessor]??"")},String(o.accessor)))]})}),Se=({isOpen:r,onClose:c,anchorRect:n,actions:a,row:l})=>{let{darkMode:b,color:i}=_();if(!r||!n)return null;let o={position:"fixed",top:`${n.bottom+8}px`,left:`${n.right-192}px`,zIndex:9999};return reactDom.createPortal(jsxRuntime.jsxs("div",{className:b?"dark":"",style:{"--highlight":i},children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:c}),jsxRuntime.jsx("div",{style:o,className:"w-48 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-2xl ring-1 ring-black ring-opacity-5 dark:border-slate-700 dark:bg-slate-800 animate-in fade-in zoom-in duration-150",children:jsxRuntime.jsx("div",{className:"py-1",children:a.map((d,k)=>{let h=d.icon;return jsxRuntime.jsxs("button",{onClick:()=>{d.onClick(l),c();},className:`flex w-full items-center gap-3 px-4 py-2.5 text-sm transition-colors hover:bg-slate-50 dark:hover:bg-slate-700/50 ${d.color||"text-slate-700 dark:text-slate-200"}`,children:[h&&jsxRuntime.jsx(h,{className:"w-4 h-4 opacity-70"}),jsxRuntime.jsx("span",{className:"font-medium",children:d.label})]},k)})})})]}),document.body)},$e=({actions:r,row:c})=>{let[n,a]=ie.useState(false),[l,b]=ie.useState(null),i=ie.useRef(null);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{ref:i,onClick:d=>{d.stopPropagation(),i.current&&b(i.current.getBoundingClientRect()),a(!n);},className:`p-2 rounded-full transition-all duration-200 ${n?"bg-[var(--highlight)]/10 text-[var(--highlight)]":"hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-400"}`,children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx(Se,{isOpen:n,onClose:()=>a(false),anchorRect:l,actions:r,row:c})]})},Ue=({data:r=[],columns:c=[],pagination:n=true,selectable:a=false,customArrayPagination:l=[5,10,25,50,100],defaultPageSize:b=10,filter:i=false,filterPlaceholder:o="Buscar registros...",color:d="#2563eb",add:k=false,textAdd:h="Agregar",actionAdd:E=()=>{},excelExport:L=false,onDeleteRows:j=()=>{},emptyState:I,darkMode:w=false})=>{let[x,P]=ie.useState(1),[m,O]=ie.useState(b),[u,U]=ie.useState(""),[g,J]=ie.useState({key:null,direction:"asc"}),[y,z]=ie.useState(new Set),Q=ie.useMemo(()=>({darkMode:w,color:d}),[w,d]),W=t=>{let p="asc";g.key===t&&g.direction==="asc"&&(p="desc"),J({key:t,direction:p});},R=ie.useMemo(()=>{let t=[...r];if(i&&u){let p=c.filter(f=>f.filter).map(f=>f.accessor);t=t.filter(f=>p.some(S=>String(f[S]??"").toLowerCase().includes(u.toLowerCase())));}return g.key&&t.sort((p,f)=>{let S=p[g.key],M=f[g.key];return S<M?g.direction==="asc"?-1:1:S>M?g.direction==="asc"?1:-1:0}),t},[r,u,i,c,g]),F=Math.ceil(R.length/m)||1,N=n?R.slice((x-1)*m,x*m):R,Y=()=>{N.length>0&&y.size===N.length?z(new Set):z(new Set(N.map(t=>t.id)));},Z=t=>{let p=new Set(y);p.has(t)?p.delete(t):p.add(t),z(p);},ee=()=>{let t=c.filter($=>!$.hidden&&!$.actions),p=t.map($=>`"${$.header}"`).join(","),f=R.map($=>t.map(re=>{let oe=$[re.accessor];return `"${String(oe??"").replace(/"/g,'""')}"`}).join(",")).join(`
|
|
31
|
+
`),S="\uFEFF"+p+`
|
|
32
|
+
`+f,M=new Blob([S],{type:"text/csv;charset=utf-8;"}),ae=URL.createObjectURL(M),A=document.createElement("a");A.setAttribute("href",ae),A.setAttribute("download",`Export_${new Date().getTime()}.csv`),document.body.appendChild(A),A.click(),document.body.removeChild(A);},te={left:"text-left",center:"text-center",right:"text-right"};return jsxRuntime.jsx(K.Provider,{value:Q,children:jsxRuntime.jsxs("div",{className:`flex flex-col gap-4 w-full ${w?"dark":""}`,style:{"--highlight":d},children:[jsxRuntime.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-1 gap-4 w-full sm:w-auto",children:[i&&jsxRuntime.jsx("div",{className:"w-full sm:max-w-xs",children:jsxRuntime.jsx(B,{icon:lucideReact.Search,color:d,value:u,onChange:U,label:o,onClear:()=>U("")})}),a&&y.size>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3 animate-in fade-in slide-in-from-left-4",children:[jsxRuntime.jsxs("span",{className:"text-sm font-bold text-slate-500 hidden md:inline",children:[y.size," seleccionados"]}),jsxRuntime.jsxs("button",{onClick:()=>{j(Array.from(y)),z(new Set);},className:"text-xs font-bold text-red-500 hover:text-red-600 bg-red-50 dark:bg-red-500/10 px-4 py-2.5 rounded-xl transition-all active:scale-95 flex items-center gap-2 border border-red-100 dark:border-red-500/20",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:"Eliminar"})]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[L&&jsxRuntime.jsx(chunkH7J3HXHU_js.a,{onClick:ee,color:"green",icon:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"}),label:"Exportar"}),k&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(chunkH7J3HXHU_js.a,{onClick:E,kd:{backgroundColor:"var(--highlight)"},icon:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),label:h})})]})]}),jsxRuntime.jsx("div",{className:"w-full rounded-2xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900 overflow-hidden",children:jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full border-separate border-spacing-0 text-sm",children:[jsxRuntime.jsx("thead",{className:"bg-slate-50/50 dark:bg-slate-950/40",children:jsxRuntime.jsxs("tr",{children:[a&&jsxRuntime.jsx("th",{className:"px-6 py-4 border-b border-slate-100 dark:border-slate-800 w-10 text-left",children:jsxRuntime.jsx(chunkMQ5FY35R_js.a,{color:d,value:N.length>0&&y.size===N.length,onChange:Y})}),c.filter(t=>!t.hidden).map(t=>jsxRuntime.jsx("th",{onClick:()=>W(t.accessor),className:`
|
|
38
33
|
px-6 py-4 font-bold uppercase tracking-tight text-slate-500 dark:text-slate-400
|
|
39
|
-
${
|
|
34
|
+
${te[t.align||"left"]}
|
|
40
35
|
border-b border-slate-100 dark:border-slate-800 cursor-pointer select-none group/th
|
|
41
|
-
`,children:jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${t.align==="center"?"justify-center":t.align==="right"?"justify-end":""}`,children:[t.header,jsxRuntime.jsx("span",{className:`transition-colors ${
|
|
36
|
+
`,children:jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${t.align==="center"?"justify-center":t.align==="right"?"justify-end":""}`,children:[t.header,jsxRuntime.jsx("span",{className:`transition-colors ${g.key===t.accessor?"text-[var(--highlight)]":"text-slate-300 opacity-0 group-hover/th:opacity-100"}`,children:g.key===t.accessor?g.direction==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-3 h-3"}):jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-3 h-3"}):jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})})]})},String(t.accessor)))]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-800",children:N.length>0?N.map(t=>jsxRuntime.jsx(Te,{row:t,columns:c,selectable:a,isSelected:y.has(t.id),onSelect:Z},t.id)):jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:c.length+(a?1:0),children:I?jsxRuntime.jsx(I,{}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-slate-400 gap-3",children:[jsxRuntime.jsx(lucideReact.Inbox,{className:"w-12 h-12 opacity-20"}),jsxRuntime.jsx("p",{className:"font-medium italic",children:"No se encontraron registros para mostrar"})]})})})})]})})}),n&&R.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-2 text-sm text-slate-500 dark:text-slate-400 font-medium",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:"Mostrar"}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("select",{value:m,onChange:t=>{O(Number(t.target.value)),P(1);},className:"appearance-none bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg px-3 py-1.5 pr-8 focus:outline-none focus:ring-2 focus:ring-[var(--highlight)]/20 cursor-pointer text-slate-700 dark:text-slate-300 font-bold",children:l.map(t=>jsxRuntime.jsx("option",{value:t,children:t},t))}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4 absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none opacity-50"})]})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:()=>P(t=>Math.max(t-1,1)),disabled:x===1,className:"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 min-w-[60px] justify-center",children:[jsxRuntime.jsx("span",{className:"font-bold text-[var(--highlight)]",children:x}),jsxRuntime.jsx("span",{className:"opacity-30",children:"/"}),jsxRuntime.jsx("span",{children:F})]}),jsxRuntime.jsx("button",{onClick:()=>P(t=>Math.min(t+1,F)),disabled:x===F,className:"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]})]})})};var Ge=({title:r="Kydra Nav",position:c="static",color:n="#6366f1",colorDominant:a=false,isMenuOpen:l=false,onToggleMenu:b,children:i,kd:o={}})=>{let d=()=>{switch(c){case "sticky":return "sticky top-0 z-50";case "fixed-bottom-floating":return "fixed bottom-6 left-6 right-6 z-50 rounded-2xl shadow-2xl max-w-5xl mx-auto";default:return "relative"}},k={backgroundColor:a?n:void 0,borderColor:a?"transparent":`${n}40`,color:a?"#ffffff":void 0,...o};return jsxRuntime.jsxs("nav",{style:k,className:`
|
|
42
37
|
${d()}
|
|
43
38
|
px-6 py-4 border-b transition-all duration-300
|
|
44
|
-
${
|
|
45
|
-
`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 font-black text-lg tracking-tight",children:typeof
|
|
39
|
+
${a?"border-none text-white":"bg-white/80 dark:bg-slate-900/80 backdrop-blur-md dark:border-slate-800 text-slate-900 dark:text-white"}
|
|
40
|
+
`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 font-black text-lg tracking-tight",children:typeof r=="string"?jsxRuntime.jsx("span",{style:{color:a?"white":n},children:r}):r}),jsxRuntime.jsx("div",{className:"hidden md:flex items-center gap-6",children:i}),jsxRuntime.jsx("button",{onClick:b,className:`md:hidden p-2 rounded-lg transition-colors ${a?"hover:bg-white/10":"hover:bg-black/5 dark:hover:bg-white/5"}`,children:l?jsxRuntime.jsx(lucideReact.X,{size:24}):jsxRuntime.jsx(lucideReact.Menu,{size:24})})]}),l&&jsxRuntime.jsx("div",{className:`md:hidden mt-4 pb-4 animate-in slide-in-from-top-2 duration-200 border-t pt-4 ${a?"border-white/20":"border-black/5 dark:border-white/5"}`,children:jsxRuntime.jsx("div",{className:"flex flex-col gap-4",children:i})})]})};Object.defineProperty(exports,"Button",{enumerable:true,get:function(){return chunkH7J3HXHU_js.a}});Object.defineProperty(exports,"CheckBox",{enumerable:true,get:function(){return chunkMQ5FY35R_js.a}});exports.Input=B;exports.Navbar=Ge;exports.Table=Ue;//# sourceMappingURL=index.js.map
|
|
46
41
|
//# sourceMappingURL=index.js.map
|