@vtspecian/ui-core-design-system 0.1.4 → 0.1.5

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.cjs CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var s in t)a(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!y.call(e,r)&&r!==s&&a(e,r,{get:()=>t[r],enumerable:!(o=b(t,r))||o.enumerable});return e};var x=e=>g(a({},"__esModule",{value:!0}),e);var C={};f(C,{Button:()=>v});module.exports=x(C);function i(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&s.firstChild?s.insertBefore(o,s.firstChild):s.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}i(`@import"tailwindcss";@theme{ --color-brand-primary: var(--color-blue-600); --color-brand-secondary: var(--color-slate-200); --default-transition-duration: .2s; }
2
- `);var n=require("react/jsx-runtime"),v=({children:e,variant:t="primary",size:s="md",isLoading:o=!1,className:r="",disabled:l,...d})=>{let c="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",m={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"hover:bg-gray-100 text-gray-700"},p={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},u=`${c} ${m[t]} ${p[s]} ${r}`;return(0,n.jsx)("button",{className:u,disabled:l||o,...d,children:o?(0,n.jsxs)("span",{className:"flex items-center gap-2",children:[(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):e})};0&&(module.exports={Button});
1
+ "use strict";var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of p(t))!u.call(e,o)&&o!==r&&n(e,o,{get:()=>t[o],enumerable:!(a=g(t,o))||a.enumerable});return e};var h=e=>y(n({},"__esModule",{value:!0}),e);var f={};x(f,{Button:()=>v});module.exports=h(f);var s=require("react/jsx-runtime"),v=({children:e,variant:t="primary",size:r="md",isLoading:a=!1,className:o="",disabled:i,...l})=>{let c="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",d={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"hover:bg-gray-100 text-gray-700"},m={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},b=`${c} ${d[t]} ${m[r]} ${o}`;return(0,s.jsx)("button",{className:b,disabled:i||a,...l,children:a?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):e})};0&&(module.exports={Button});
3
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","#style-inject:#style-inject","../src/styles/global.css","../src/components/Button.tsx"],"sourcesContent":["import './styles/global.css'\nexport * from './components/Button'","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\"@import\\\"tailwindcss\\\";@theme{ --color-brand-primary: var(--color-blue-600); --color-brand-secondary: var(--color-slate-200); --default-transition-duration: .2s; }\\n\")","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n// A interface estende ButtonHTMLAttributes para incluir onClick, disabled, className, etc.\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n size?: 'sm' | 'md' | 'lg';\n isLoading?: boolean;\n}\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n isLoading = false,\n className = '',\n disabled,\n ...props // Repassa todas as outras propriedades nativas (como onClick)\n}: ButtonProps) => {\n \n // Definição manual das classes caso não esteja usando uma lib de variants ainda\n const baseStyles = \"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50\";\n \n const variants = {\n primary: \"bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"bg-gray-100 text-gray-900 hover:bg-gray-200\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n ghost: \"hover:bg-gray-100 text-gray-700\",\n };\n\n const sizes = {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-6 text-base\",\n };\n\n // Combinação das classes (recomendo usar a lib 'clsx' ou 'tailwind-merge' futuramente)\n const combinedClasses = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;\n\n return (\n <button\n className={combinedClasses}\n disabled={disabled || isLoading} // O botão fica desativado se estiver carregando\n {...props} // Aplica o onClick e outros atributos passados\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <svg className=\"animate-spin h-4 w-4\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" fill=\"none\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n Loading...\n </span>\n ) : (\n children\n )}\n </button>\n );\n};"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GCCyB,SAARI,EAA6BC,EAAK,CAAE,SAAAC,CAAS,EAAI,CAAC,EAAG,CAC1D,GAAI,CAACD,GAAO,OAAO,SAAa,IAAa,OAE7C,IAAME,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAC/DC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,KAAO,WAETF,IAAa,OACXC,EAAK,WACPA,EAAK,aAAaC,EAAOD,EAAK,UAAU,EAK1CA,EAAK,YAAYC,CAAK,EAGpBA,EAAM,WACRA,EAAM,WAAW,QAAUH,EAE3BG,EAAM,YAAY,SAAS,eAAeH,CAAG,CAAC,CAElD,CCvB8BI,EAAY;AAAA,CAAuK,EC+CjN,IAAAC,EAAA,6BArCGC,EAAS,CAAC,CACrB,SAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,IAAmB,CAGjB,IAAMC,EAAa,oLAEbC,EAAW,CACf,QAAS,2CACT,UAAW,8CACX,OAAQ,yCACR,MAAO,iCACT,EAEMC,EAAQ,CACZ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBACN,EAGMC,EAAkB,GAAGH,CAAU,IAAIC,EAASP,CAAO,CAAC,IAAIQ,EAAMP,CAAI,CAAC,IAAIE,CAAS,GAEtF,SACE,OAAC,UACC,UAAWM,EACX,SAAUL,GAAYF,EACrB,GAAGG,EAEH,SAAAH,KACC,QAAC,QAAK,UAAU,0BACd,qBAAC,OAAI,UAAU,uBAAuB,QAAQ,YAC5C,oBAAC,UAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,KAAK,OAAO,KACxG,OAAC,QAAK,UAAU,aAAa,KAAK,eAAe,EAAE,kHAAkH,GACvK,EAAM,cAER,EAEAH,EAEJ,CAEJ","names":["index_exports","__export","Button","__toCommonJS","styleInject","css","insertAt","head","style","styleInject","import_jsx_runtime","Button","children","variant","size","isLoading","className","disabled","props","baseStyles","variants","sizes","combinedClasses"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/components/Button.tsx"],"sourcesContent":["import './styles/global.css'\nexport * from './components/Button'","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n// A interface estende ButtonHTMLAttributes para incluir onClick, disabled, className, etc.\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n size?: 'sm' | 'md' | 'lg';\n isLoading?: boolean;\n}\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n isLoading = false,\n className = '',\n disabled,\n ...props // Repassa todas as outras propriedades nativas (como onClick)\n}: ButtonProps) => {\n \n // Definição manual das classes caso não esteja usando uma lib de variants ainda\n const baseStyles = \"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50\";\n \n const variants = {\n primary: \"bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"bg-gray-100 text-gray-900 hover:bg-gray-200\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n ghost: \"hover:bg-gray-100 text-gray-700\",\n };\n\n const sizes = {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-6 text-base\",\n };\n\n // Combinação das classes (recomendo usar a lib 'clsx' ou 'tailwind-merge' futuramente)\n const combinedClasses = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;\n\n return (\n <button\n className={combinedClasses}\n disabled={disabled || isLoading} // O botão fica desativado se estiver carregando\n {...props} // Aplica o onClick e outros atributos passados\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <svg className=\"animate-spin h-4 w-4\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" fill=\"none\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n Loading...\n </span>\n ) : (\n children\n )}\n </button>\n );\n};"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GC+CU,IAAAI,EAAA,6BArCGC,EAAS,CAAC,CACrB,SAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,IAAmB,CAGjB,IAAMC,EAAa,oLAEbC,EAAW,CACf,QAAS,2CACT,UAAW,8CACX,OAAQ,yCACR,MAAO,iCACT,EAEMC,EAAQ,CACZ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBACN,EAGMC,EAAkB,GAAGH,CAAU,IAAIC,EAASP,CAAO,CAAC,IAAIQ,EAAMP,CAAI,CAAC,IAAIE,CAAS,GAEtF,SACE,OAAC,UACC,UAAWM,EACX,SAAUL,GAAYF,EACrB,GAAGG,EAEH,SAAAH,KACC,QAAC,QAAK,UAAU,0BACd,qBAAC,OAAI,UAAU,uBAAuB,QAAQ,YAC5C,oBAAC,UAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,KAAK,OAAO,KACxG,OAAC,QAAK,UAAU,aAAa,KAAK,eAAe,EAAE,kHAAkH,GACvK,EAAM,cAER,EAEAH,EAEJ,CAEJ","names":["index_exports","__export","Button","__toCommonJS","import_jsx_runtime","Button","children","variant","size","isLoading","className","disabled","props","baseStyles","variants","sizes","combinedClasses"]}
package/dist/index.css ADDED
@@ -0,0 +1,2 @@
1
+ @import"tailwindcss";@theme{ --color-brand-primary: var(--color-blue-600); --color-brand-secondary: var(--color-slate-200); --default-transition-duration: .2s; }
2
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/styles/global.css"],"sourcesContent":["@import \"tailwindcss\";\n\n@theme {\n --color-brand-primary: var(--color-blue-600);\n --color-brand-secondary: var(--color-slate-200);\n \n /* Customizing global transitions */\n --default-transition-duration: 200ms;\n}"],"mappings":"qBAEA,MAAO,EACL,qBAAqB,EAAE,IAAI,iBAAiB,EAC5C,uBAAuB,EAAE,IAAI,kBAAkB,EAG/C,6BAA6B,EAAE,GAAK","names":[]}
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
- function r(o,{insertAt:s}={}){if(!o||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",s==="top"&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),e.styleSheet?e.styleSheet.cssText=o:e.appendChild(document.createTextNode(o))}r(`@import"tailwindcss";@theme{ --color-brand-primary: var(--color-blue-600); --color-brand-secondary: var(--color-slate-200); --default-transition-duration: .2s; }
2
- `);import{jsx as n,jsxs as a}from"react/jsx-runtime";var y=({children:o,variant:s="primary",size:t="md",isLoading:e=!1,className:i="",disabled:l,...d})=>{let c="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",m={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"hover:bg-gray-100 text-gray-700"},p={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},u=`${c} ${m[s]} ${p[t]} ${i}`;return n("button",{className:u,disabled:l||e,...d,children:e?a("span",{className:"flex items-center gap-2",children:[a("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[n("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),n("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):o})};export{y as Button};
1
+ import{jsx as t,jsxs as o}from"react/jsx-runtime";var u=({children:s,variant:r="primary",size:a="md",isLoading:e=!1,className:n="",disabled:i,...l})=>{let c="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",d={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"hover:bg-gray-100 text-gray-700"},m={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},b=`${c} ${d[r]} ${m[a]} ${n}`;return t("button",{className:b,disabled:i||e,...l,children:e?o("span",{className:"flex items-center gap-2",children:[o("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[t("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),t("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):s})};export{u as Button};
3
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["#style-inject:#style-inject","../src/styles/global.css","../src/components/Button.tsx"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\"@import\\\"tailwindcss\\\";@theme{ --color-brand-primary: var(--color-blue-600); --color-brand-secondary: var(--color-slate-200); --default-transition-duration: .2s; }\\n\")","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n// A interface estende ButtonHTMLAttributes para incluir onClick, disabled, className, etc.\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n size?: 'sm' | 'md' | 'lg';\n isLoading?: boolean;\n}\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n isLoading = false,\n className = '',\n disabled,\n ...props // Repassa todas as outras propriedades nativas (como onClick)\n}: ButtonProps) => {\n \n // Definição manual das classes caso não esteja usando uma lib de variants ainda\n const baseStyles = \"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50\";\n \n const variants = {\n primary: \"bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"bg-gray-100 text-gray-900 hover:bg-gray-200\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n ghost: \"hover:bg-gray-100 text-gray-700\",\n };\n\n const sizes = {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-6 text-base\",\n };\n\n // Combinação das classes (recomendo usar a lib 'clsx' ou 'tailwind-merge' futuramente)\n const combinedClasses = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;\n\n return (\n <button\n className={combinedClasses}\n disabled={disabled || isLoading} // O botão fica desativado se estiver carregando\n {...props} // Aplica o onClick e outros atributos passados\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <svg className=\"animate-spin h-4 w-4\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" fill=\"none\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n Loading...\n </span>\n ) : (\n children\n )}\n </button>\n );\n};"],"mappings":"AACyB,SAARA,EAA6BC,EAAK,CAAE,SAAAC,CAAS,EAAI,CAAC,EAAG,CAC1D,GAAI,CAACD,GAAO,OAAO,SAAa,IAAa,OAE7C,IAAME,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAC/DC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,KAAO,WAETF,IAAa,OACXC,EAAK,WACPA,EAAK,aAAaC,EAAOD,EAAK,UAAU,EAK1CA,EAAK,YAAYC,CAAK,EAGpBA,EAAM,WACRA,EAAM,WAAW,QAAUH,EAE3BG,EAAM,YAAY,SAAS,eAAeH,CAAG,CAAC,CAElD,CCvB8BI,EAAY;AAAA,CAAuK,EC+CjN,OACE,OAAAC,EADF,QAAAC,MAAA,oBArCH,IAAMC,EAAS,CAAC,CACrB,SAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,IAAmB,CAGjB,IAAMC,EAAa,oLAEbC,EAAW,CACf,QAAS,2CACT,UAAW,8CACX,OAAQ,yCACR,MAAO,iCACT,EAEMC,EAAQ,CACZ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBACN,EAGMC,EAAkB,GAAGH,CAAU,IAAIC,EAASP,CAAO,CAAC,IAAIQ,EAAMP,CAAI,CAAC,IAAIE,CAAS,GAEtF,OACEP,EAAC,UACC,UAAWa,EACX,SAAUL,GAAYF,EACrB,GAAGG,EAEH,SAAAH,EACCL,EAAC,QAAK,UAAU,0BACd,UAAAA,EAAC,OAAI,UAAU,uBAAuB,QAAQ,YAC5C,UAAAD,EAAC,UAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,KAAK,OAAO,EACxGA,EAAC,QAAK,UAAU,aAAa,KAAK,eAAe,EAAE,kHAAkH,GACvK,EAAM,cAER,EAEAG,EAEJ,CAEJ","names":["styleInject","css","insertAt","head","style","styleInject","jsx","jsxs","Button","children","variant","size","isLoading","className","disabled","props","baseStyles","variants","sizes","combinedClasses"]}
1
+ {"version":3,"sources":["../src/components/Button.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n// A interface estende ButtonHTMLAttributes para incluir onClick, disabled, className, etc.\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n size?: 'sm' | 'md' | 'lg';\n isLoading?: boolean;\n}\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n isLoading = false,\n className = '',\n disabled,\n ...props // Repassa todas as outras propriedades nativas (como onClick)\n}: ButtonProps) => {\n \n // Definição manual das classes caso não esteja usando uma lib de variants ainda\n const baseStyles = \"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50\";\n \n const variants = {\n primary: \"bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"bg-gray-100 text-gray-900 hover:bg-gray-200\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n ghost: \"hover:bg-gray-100 text-gray-700\",\n };\n\n const sizes = {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-6 text-base\",\n };\n\n // Combinação das classes (recomendo usar a lib 'clsx' ou 'tailwind-merge' futuramente)\n const combinedClasses = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;\n\n return (\n <button\n className={combinedClasses}\n disabled={disabled || isLoading} // O botão fica desativado se estiver carregando\n {...props} // Aplica o onClick e outros atributos passados\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <svg className=\"animate-spin h-4 w-4\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" fill=\"none\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n Loading...\n </span>\n ) : (\n children\n )}\n </button>\n );\n};"],"mappings":"AA+CU,OACE,OAAAA,EADF,QAAAC,MAAA,oBArCH,IAAMC,EAAS,CAAC,CACrB,SAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,IAAmB,CAGjB,IAAMC,EAAa,oLAEbC,EAAW,CACf,QAAS,2CACT,UAAW,8CACX,OAAQ,yCACR,MAAO,iCACT,EAEMC,EAAQ,CACZ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBACN,EAGMC,EAAkB,GAAGH,CAAU,IAAIC,EAASP,CAAO,CAAC,IAAIQ,EAAMP,CAAI,CAAC,IAAIE,CAAS,GAEtF,OACEP,EAAC,UACC,UAAWa,EACX,SAAUL,GAAYF,EACrB,GAAGG,EAEH,SAAAH,EACCL,EAAC,QAAK,UAAU,0BACd,UAAAA,EAAC,OAAI,UAAU,uBAAuB,QAAQ,YAC5C,UAAAD,EAAC,UAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,KAAK,OAAO,EACxGA,EAAC,QAAK,UAAU,aAAa,KAAK,eAAe,EAAE,kHAAkH,GACvK,EAAM,cAER,EAEAG,EAEJ,CAEJ","names":["jsx","jsxs","Button","children","variant","size","isLoading","className","disabled","props","baseStyles","variants","sizes","combinedClasses"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtspecian/ui-core-design-system",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "A scalable UI Design System built with React, Tailwind CSS and TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",