avine-react-components
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -239,3 +239,3 @@ 'use strict'; | ||
className: `${enabled ? 'bg-green-600' : 'bg-gray-400'} | ||
relative inline-flex flex-shrink-0 h-7 w-14 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` | ||
relative flex items-center h-6 w-12 rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` | ||
}, /*#__PURE__*/React__default.createElement("span", { | ||
@@ -245,4 +245,4 @@ className: "sr-only" | ||
"aria-hidden": "true", | ||
className: `${enabled ? 'translate-x-7' : 'translate-x-0'} | ||
pointer-events-none inline-block h-6 w-6 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200` | ||
className: `${enabled ? 'translate-x-7' : 'translate-x-1'} | ||
pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200` | ||
})); | ||
@@ -249,0 +249,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,l=require("@headlessui/react");const n={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8",xl:"w-10 h-10"},s={primary:"text-gray-200 fill-green-600",secondary:"text-gray-200 fill-slate-600",tertiary:"text-gray-200 fill-gray-600",success:"text-gray-200 fill-green-400",warning:"text-gray-200 fill-yellow-400",danger:"text-gray-200 fill-red-400"},a=({size:e="md",fillColor:l="primary"})=>{const a=t.useMemo(()=>["animate-spin",s[l],n[e]].join(" "),[e,l]);return r.createElement("div",{className:"flex justify-center items-center",role:"status"},r.createElement("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r.createElement("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})),r.createElement("span",{className:"sr-only"},"Carregando..."))},o={primary:"text-white bg-green-600 hover:bg-green-700 focus:ring-4 focus:ring-green-300 font-medium rounded-lg",secondary:"text-white bg-slate-600 hover:bg-slate-700 focus:ring-4 focus:ring-slate-300 font-medium rounded-lg",tertiary:"text-gray-800 hover:bg-slate-200 focus:ring-4 focus:ring-slate-100 font-medium rounded-lg",danger:"text-white bg-red-600 hover:bg-red-700 focus:ring-4 focus:ring-red-300 font-medium rounded-lg"},i={sm:"text-sm px-3 py-2",md:"text-sm px-5 py-2.5",lg:"px-5 py-3 text-base"},c="rounded-md block border-2 transition-colors text-gray-900",d={sm:"text-xs p-2",md:"text-sm p-2.5",lg:"text-md p-4"},u="text-sm rounded-md block p-2.5 border-2 transition-colors text-gray-900",m="relative flex item-center",g={sm:"text-sm",md:"text-sm",lg:"text-base"},x={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"},f="font-bold mb-4",p={sm:"text-2xl",md:"text-3xl",lg:"text-4xl",xl:"text-5xl","2xl":"text-6xl","3xl":"text-7xl"};exports.Button=({variant:e="primary",size:l="md",full:n=!1,disabled:s=!1,loading:c=!1,label:d="",onClick:u,...m})=>{const g=t.useMemo(()=>["relative",o[e],i[l],n?"w-full":"",s?"cursor-not-allowed opacity-50":""].join(" "),[e,l,n,s]),x=t.useMemo(()=>[c?"z-10":""].join(" "),[c]),f=t.useMemo(()=>[c?"opacity-0 invisible":""].join(" "),[c]);return r.createElement("button",Object.assign({onClick:s||c?void 0:u,className:g,disabled:s},m),r.createElement(t.Fragment,null,c&&r.createElement("div",{className:"w-full h-full absolute z-10 top-0 left-0 flex justify-center items-center"},r.createElement(a,{className:x,size:"sm",fillColor:e})),r.createElement("span",{className:f},d)))},exports.Heading=({size:e="md",children:l=""})=>{const n=t.useMemo(()=>[f,p[e]].join(" "),[e]);return r.createElement("3xl"===e?"h1":"2xl"===e?"h2":"lg"===e?"h3":"md"===e?"h4":"sm"===e?"h5":"h6",{className:n},l)},exports.LinkButton=({size:e="md",className:l,label:n="",rightIcon:s=null,disabled:a=!1,full:o=!1})=>{const i=t.useMemo(()=>[m,g[e],a?"opacity-50":"",o?"w-full":""].join(" "),[e,a,o]);return r.createElement("a",{className:l||i},n,s&&r.createElement("span",{className:"ml-2"},s))},exports.NumberInput=({placeHolder:e="",disabled:l=!1,error:n=!1,full:s=!1})=>{const[a,o]=t.useState(""),i=t.useMemo(()=>[u,s?"w-full":"",l?"opacity-50":"",n?"bg-red-50 border-gray-300 ring-red-400 border-red-400 outline-red-400":"bg-gray-100 border-gray-100 focus:ring-green-600 focus:border-green-600 focus:outline-green-600"].join(" "),[l,n,s]);return r.createElement("input",{placeholder:e,className:i,type:"text",value:a,onChange:e=>(e=>{/^(\d)*(,)?([0-9]{1})?([0-9]{1})?$/.test(e)&&o(e)})(e.target.value),disabled:l})},exports.Spinner=a,exports.Text=({size:e="md",children:l=""})=>{const n=t.useMemo(()=>[x[e]].join(" "),[e]);return r.createElement("p",{className:n},l)},exports.TextInput=({type:e="text",size:l="md",placeHolder:n="",disabled:s=!1,error:a=!1,full:o=!1,...i})=>{const u=t.useMemo(()=>[o?"w-full":"",s?"opacity-50":"",a?"bg-red-50 border-gray-300 ring-red-400 border-red-400 outline-red-400":"bg-gray-100 border-gray-100 focus:ring-green-600 focus:border-green-600 focus:outline-green-600",c,d[l]].join(" "),[s,a,o,l]),[m,g]=t.useState("");return r.createElement("input",Object.assign({type:e,placeholder:n,className:u,value:m,onChange:e=>g(e.target.value),disabled:s},i))},exports.ToggleSwitch=({onChange:e})=>{const[n,s]=t.useState(!1);return r.createElement(l.Switch,{checked:n,onChange:e,onClick:()=>s(!n),className:(n?"bg-green-600":"bg-gray-400")+"\n relative inline-flex flex-shrink-0 h-7 w-14 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},r.createElement("span",{className:"sr-only"},"Use setting"),r.createElement("span",{"aria-hidden":"true",className:(n?"translate-x-7":"translate-x-0")+"\n pointer-events-none inline-block h-6 w-6 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200"}))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,l=require("@headlessui/react");const n={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8",xl:"w-10 h-10"},s={primary:"text-gray-200 fill-green-600",secondary:"text-gray-200 fill-slate-600",tertiary:"text-gray-200 fill-gray-600",success:"text-gray-200 fill-green-400",warning:"text-gray-200 fill-yellow-400",danger:"text-gray-200 fill-red-400"},a=({size:e="md",fillColor:l="primary"})=>{const a=t.useMemo(()=>["animate-spin",s[l],n[e]].join(" "),[e,l]);return r.createElement("div",{className:"flex justify-center items-center",role:"status"},r.createElement("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r.createElement("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})),r.createElement("span",{className:"sr-only"},"Carregando..."))},o={primary:"text-white bg-green-600 hover:bg-green-700 focus:ring-4 focus:ring-green-300 font-medium rounded-lg",secondary:"text-white bg-slate-600 hover:bg-slate-700 focus:ring-4 focus:ring-slate-300 font-medium rounded-lg",tertiary:"text-gray-800 hover:bg-slate-200 focus:ring-4 focus:ring-slate-100 font-medium rounded-lg",danger:"text-white bg-red-600 hover:bg-red-700 focus:ring-4 focus:ring-red-300 font-medium rounded-lg"},i={sm:"text-sm px-3 py-2",md:"text-sm px-5 py-2.5",lg:"px-5 py-3 text-base"},c="rounded-md block border-2 transition-colors text-gray-900",d={sm:"text-xs p-2",md:"text-sm p-2.5",lg:"text-md p-4"},u="text-sm rounded-md block p-2.5 border-2 transition-colors text-gray-900",m="relative flex item-center",g={sm:"text-sm",md:"text-sm",lg:"text-base"},x={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"},f="font-bold mb-4",p={sm:"text-2xl",md:"text-3xl",lg:"text-4xl",xl:"text-5xl","2xl":"text-6xl","3xl":"text-7xl"};exports.Button=({variant:e="primary",size:l="md",full:n=!1,disabled:s=!1,loading:c=!1,label:d="",onClick:u,...m})=>{const g=t.useMemo(()=>["relative",o[e],i[l],n?"w-full":"",s?"cursor-not-allowed opacity-50":""].join(" "),[e,l,n,s]),x=t.useMemo(()=>[c?"z-10":""].join(" "),[c]),f=t.useMemo(()=>[c?"opacity-0 invisible":""].join(" "),[c]);return r.createElement("button",Object.assign({onClick:s||c?void 0:u,className:g,disabled:s},m),r.createElement(t.Fragment,null,c&&r.createElement("div",{className:"w-full h-full absolute z-10 top-0 left-0 flex justify-center items-center"},r.createElement(a,{className:x,size:"sm",fillColor:e})),r.createElement("span",{className:f},d)))},exports.Heading=({size:e="md",children:l=""})=>{const n=t.useMemo(()=>[f,p[e]].join(" "),[e]);return r.createElement("3xl"===e?"h1":"2xl"===e?"h2":"lg"===e?"h3":"md"===e?"h4":"sm"===e?"h5":"h6",{className:n},l)},exports.LinkButton=({size:e="md",className:l,label:n="",rightIcon:s=null,disabled:a=!1,full:o=!1})=>{const i=t.useMemo(()=>[m,g[e],a?"opacity-50":"",o?"w-full":""].join(" "),[e,a,o]);return r.createElement("a",{className:l||i},n,s&&r.createElement("span",{className:"ml-2"},s))},exports.NumberInput=({placeHolder:e="",disabled:l=!1,error:n=!1,full:s=!1})=>{const[a,o]=t.useState(""),i=t.useMemo(()=>[u,s?"w-full":"",l?"opacity-50":"",n?"bg-red-50 border-gray-300 ring-red-400 border-red-400 outline-red-400":"bg-gray-100 border-gray-100 focus:ring-green-600 focus:border-green-600 focus:outline-green-600"].join(" "),[l,n,s]);return r.createElement("input",{placeholder:e,className:i,type:"text",value:a,onChange:e=>(e=>{/^(\d)*(,)?([0-9]{1})?([0-9]{1})?$/.test(e)&&o(e)})(e.target.value),disabled:l})},exports.Spinner=a,exports.Text=({size:e="md",children:l=""})=>{const n=t.useMemo(()=>[x[e]].join(" "),[e]);return r.createElement("p",{className:n},l)},exports.TextInput=({type:e="text",size:l="md",placeHolder:n="",disabled:s=!1,error:a=!1,full:o=!1,...i})=>{const u=t.useMemo(()=>[o?"w-full":"",s?"opacity-50":"",a?"bg-red-50 border-gray-300 ring-red-400 border-red-400 outline-red-400":"bg-gray-100 border-gray-100 focus:ring-green-600 focus:border-green-600 focus:outline-green-600",c,d[l]].join(" "),[s,a,o,l]),[m,g]=t.useState("");return r.createElement("input",Object.assign({type:e,placeholder:n,className:u,value:m,onChange:e=>g(e.target.value),disabled:s},i))},exports.ToggleSwitch=({onChange:e})=>{const[n,s]=t.useState(!1);return r.createElement(l.Switch,{checked:n,onChange:e,onClick:()=>s(!n),className:(n?"bg-green-600":"bg-gray-400")+"\n relative flex items-center h-6 w-12 rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},r.createElement("span",{className:"sr-only"},"Use setting"),r.createElement("span",{"aria-hidden":"true",className:(n?"translate-x-7":"translate-x-1")+"\n pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200"}))}; | ||
//# sourceMappingURL=avine-react-components.cjs.production.min.js.map |
@@ -232,3 +232,3 @@ import React, { useMemo, Fragment, useState } from 'react'; | ||
className: `${enabled ? 'bg-green-600' : 'bg-gray-400'} | ||
relative inline-flex flex-shrink-0 h-7 w-14 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` | ||
relative flex items-center h-6 w-12 rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` | ||
}, /*#__PURE__*/React.createElement("span", { | ||
@@ -238,4 +238,4 @@ className: "sr-only" | ||
"aria-hidden": "true", | ||
className: `${enabled ? 'translate-x-7' : 'translate-x-0'} | ||
pointer-events-none inline-block h-6 w-6 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200` | ||
className: `${enabled ? 'translate-x-7' : 'translate-x-1'} | ||
pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-lg transform ring-0 transition ease-in-out duration-200` | ||
})); | ||
@@ -242,0 +242,0 @@ }; |
{ | ||
"name": "avine-react-components", | ||
"author": "Carlos Daniel Oliveira dos Santos", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"license": "MIT", | ||
@@ -18,6 +18,5 @@ "main": "dist/index.js", | ||
"build-tailwind": "npx tailwindcss -o ./dist/tailwind.css --minify", | ||
"build": "tsdx build && npm run build-tailwind", | ||
"test": "tsdx test --passWithNoTests", | ||
"lint": "tsdx lint", | ||
"prepare": "tsdx build", | ||
"prepare": "tsdx build && npm run build-tailwind", | ||
"size": "size-limit", | ||
@@ -24,0 +23,0 @@ "analyze": "size-limit --why", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121152
53