@loja-integrada/admin-components 1.0.9 → 1.0.11
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/chunk-2VOBQTBC.js +12 -0
- package/dist/chunk-72QPS6JN.js +8 -0
- package/dist/{chunk-ZXGG7PWF.js → chunk-ABMMRP7O.js} +1 -1
- package/dist/{chunk-UIHRQE2I.js → chunk-EHRQIKSI.js} +1 -1
- package/dist/{chunk-VERZSHK6.js → chunk-FNTWCBA6.js} +1 -1
- package/dist/chunk-T46I7KD2.js +10 -0
- package/dist/chunk-UQTLNERO.js +8 -0
- package/dist/chunk-UYUM2DWH.js +9 -0
- package/dist/forms/Dropdown/Dropdown.client.d.ts +141 -0
- package/dist/forms/Dropdown/index.d.ts +1 -0
- package/dist/forms/Dropdown/index.js +7 -0
- package/dist/forms/Input/Input.d.ts +5 -0
- package/dist/forms/Input/index.js +1 -1
- package/dist/forms/InputMask/index.js +2 -2
- package/dist/forms/Select/Select.d.ts +6 -2
- package/dist/forms/Select/index.js +1 -1
- package/dist/forms/index.d.ts +1 -0
- package/dist/forms/index.js +8 -4
- package/dist/index.js +9 -8
- package/dist/indicators/Badge/Badge.d.ts +1 -5
- package/dist/indicators/Badge/index.js +1 -1
- package/dist/indicators/Toast/index.js +1 -1
- package/dist/indicators/index.js +2 -2
- package/dist/layout/ActionBar/index.js +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/navigation/Pagination/index.js +2 -2
- package/dist/navigation/index.js +2 -2
- package/package.json +8 -3
- package/dist/chunk-BLEJ5LCZ.js +0 -10
- package/dist/chunk-M4V7OPDZ.js +0 -8
- package/dist/chunk-XMNDXVVV.js +0 -8
- package/dist/chunk-ZRJQNS4S.js +0 -9
- /package/dist/{chunk-66GVVFKI.js → chunk-WV2QQGA4.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-7Z3CCBLX.js';
|
|
2
|
+
import { a as a$3 } from './chunk-HQ53LHR2.js';
|
|
3
|
+
import { a as a$2 } from './chunk-G3GCVCTU.js';
|
|
4
|
+
import { a } from './chunk-REQIQLRI.js';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import h, { useMemo } from 'react';
|
|
7
|
+
import k, { components } from 'react-select';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var W=cva("flex w-full cursor-pointer items-center border bg-base-1 transition-colors",{variants:{size:{small:"text-f7 h-10",default:"text-f6 h-12",large:"text-f5 h-14",xlarge:"text-f4 h-24"},variant:{default:"rounded border-card-stroke font-normal text-on-base",secondary:"rounded-md border-inverted-2 font-semibold shadow-inner hover:bg-base-3 focus:bg-base-1 focus:ring-2 focus:ring-focus focus:ring-offset-2"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2"},readOnly:{true:"pointer-events-none bg-base-2"},hasErrorState:{true:"border-danger focus:border-danger"}},defaultVariants:{variant:"default",size:"default",hasErrorState:!1,disabled:!1,readOnly:!1}}),{Option:q,DropdownIndicator:$}=components,A=o=>{let{selectProps:n}=o,t=`transform transition duration-200 ${n.menuIsOpen?"rotate-180":"rotate-0"} text-inverted-2`;return jsx($,{...o,className:"mr-2",children:jsx(a$3,{icon:"sortDown",size:5,className:t})})},J=o=>{let{isSelected:n,isDisabled:t,isFocused:p,data:s}=o;return jsxs(q,{...o,className:a("text-f6 first:mt-2 last:mb-2 py-2 px-5 font-semibold transition-colors flex items-center",t?"opacity-50 cursor-not-allowed":"hover:text-on-base hover:bg-inverted-2/5 cursor-pointer",n?"text-inverted-1":"text-inverted-2",p&&"bg-inverted-2/5"),children:[s.icon?jsx(a$3,{icon:s.icon,className:"mr-2"}):null,s.label]})},K=({options:o,isSearchable:n=!1,onChange:t,onBlur:p,size:s="default",variant:P="default",placeholder:v="Selecione um item",emptyMessage:w="Nenhuma op\xE7\xE3o dispon\xEDvel",hasError:C=!1,errorMessage:m,helpText:O,label:I,labelComplement:D,id:y,name:N,required:S=!1,disabled:c,readOnly:d,maxMenuHeight:E=300,menuPosition:M="absolute",menuPlacement:V="auto",menuWidth:G="100%",menuHorizontalPlacement:a$3,formGroupClassName:R="",value:z},B)=>{let F=useMemo(()=>Math.random().toString(36).substring(7),[]),f=y||N||F,i=C||!!m;return jsxs("div",{className:a("form-group flex flex-col",R),children:[jsx(a$1,{label:I,labelComplement:D,required:S,hasError:i,htmlFor:f,className:"mb-1"}),jsx(k,{id:f,ref:B,value:z,classNamePrefix:"select",options:o,isSearchable:n,isDisabled:c||d,maxMenuHeight:E,menuPortalTarget:document?.body,menuPosition:M,menuPlacement:V,placeholder:v,noOptionsMessage:({inputValue:e})=>e?`Nenhum resultado para "${e}"`:w,onChange:e=>t&&e&&t(e),onBlur:e=>p?.(e),components:{Option:e=>J(e),DropdownIndicator:e=>A(e)},classNames:{input:()=>"absolute !mx-0",noOptionsMessage:()=>"text-on-base-3 text-f6 font-semibold break-words",valueContainer:()=>"w-full min-h-10",singleValue:()=>"truncate",placeholder:()=>"w-full truncate pr-2 h-full text-on-base-3",control:({isFocused:e})=>a(W({variant:P,size:s,hasErrorState:i,disabled:c,readOnly:d}),e&&!i&&!d&&"border-inverted-1"),groupHeading:()=>"px-5 text-on-base-3 text-f7 font-semibold uppercase"},styles:{option:()=>({}),control:()=>({}),menu:e=>({...e,width:G,backgroundColor:"rgb(var(--color-base-1) / 100)",zIndex:999,...a$3&&a$3==="left"&&{left:0},...a$3&&a$3==="right"&&{right:0}}),menuPortal:e=>({...e,zIndex:9999}),indicatorSeparator:()=>({}),groupHeading:()=>({}),singleValue:()=>({maxWidth:"calc(100% - 6px)"}),valueContainer:e=>({...e,paddingLeft:16,display:"flex",alignItems:"center",flexWrap:"nowrap"}),placeholder:()=>({})}}),jsx(a$2,{helpText:m||O,hasError:i,className:"mt-2"})]})},Q=h.forwardRef(K),U=h.memo(Q);U.displayName="Dropdown";
|
|
11
|
+
|
|
12
|
+
export { U as a };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a } from './chunk-REQIQLRI.js';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import l from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var o=cva("badge inline-flex items-center font-semibold",{variants:{type:{neutral:"bg-inverted-2 text-base-1",neutralLight:"bg-inverted-3 text-tertiary",primary:"bg-primary-dark text-base-1",danger:"bg-danger-dark text-base-1",success:"bg-success-dark text-base-1",warning:"bg-warning-dark text-base-1",focus:"bg-focus text-base-1"},size:{default:"text-f7 h-5 px-2 py-0.5",small:"text-f7 h-4 px-2",xsmall:"text-f8 h-3 px-0.5 py-px"},rounded:{full:"rounded-full",small:"rounded",none:"rounded-none"}},defaultVariants:{type:"primary",size:"default"}}),i=({type:t="neutral",text:a$1,size:r="default",rounded:s="full",className:n=""})=>jsx("div",{className:a(o({type:t,size:r,rounded:s}),n),children:a$1}),g=l.memo(i);g.displayName="Badge";
|
|
7
|
+
|
|
8
|
+
export { g as a };
|
|
@@ -4,6 +4,6 @@ import i from 'react';
|
|
|
4
4
|
import { ToastContainer, toast } from 'react-toastify';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var m={success:"bg-primary-light border-primary-dark",error:"bg-danger-light border-danger-dark",info:"bg-secondary-light border-secondary",warning:"bg-warning-light border-warning-dark",default:"",dark:""},l={success:"!bg-primary-dark",error:"!bg-danger-dark",info:"!bg-secondary-dark",warning:"!bg-warning-dark",default:"",dark:""},p=({...t})=>jsx(ToastContainer,{toastClassName:o=>a("border flex items-top justify-between py-3 px-4 relative rounded shadow-md mb-2",m[o?.type||"info"]),bodyClassName:"max-w-[95%] text-sm text-on-base break-words",progressClassName:o=>a(o?.defaultClassName,"!h-1",l[o?.type||"info"]),closeButton:({closeToast:o})=>jsx("div",{className:"text-on-base hover:text-on-base-2
|
|
7
|
+
var m={success:"bg-primary-light border-primary-dark",error:"bg-danger-light border-danger-dark",info:"bg-secondary-light border-secondary",warning:"bg-warning-light border-warning-dark",default:"",dark:""},l={success:"!bg-primary-dark",error:"!bg-danger-dark",info:"!bg-secondary-dark",warning:"!bg-warning-dark",default:"",dark:""},p=({...t})=>jsx(ToastContainer,{toastClassName:o=>a("border flex items-top justify-between py-3 px-4 relative rounded shadow-md mb-2",m[o?.type||"info"]),bodyClassName:"max-w-[95%] text-sm text-on-base break-words",progressClassName:o=>a(o?.defaultClassName,"!h-1",l[o?.type||"info"]),closeButton:({closeToast:o})=>jsx("div",{className:"flex cursor-pointer items-center text-on-base hover:text-on-base-2",onClick:o,children:jsx(a$1,{icon:"close",size:3})}),position:"top-right",icon:!1,...t}),h=({content:t,...o})=>{let a=o?.type||"success",n=typeof o?.autoClose!="boolean"?o?.autoClose:o?.autoClose&&5e3;toast(t,{...o,type:a,autoClose:n});},f=i.memo(p);f.displayName="Toast";
|
|
8
8
|
|
|
9
9
|
export { h as a, f as b };
|
|
@@ -5,6 +5,6 @@ import { cva } from 'class-variance-authority';
|
|
|
5
5
|
import h, { useMemo } from 'react';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var V=cva("peer text-f6 flex w-full min-w-0 appearance-none overflow-hidden rounded border border-card-stroke bg-base-1 px-4 text-on-base shadow-none outline-none transition-colors placeholder:text-on-base-
|
|
8
|
+
var V=cva("peer text-f6 flex w-full min-w-0 appearance-none overflow-hidden rounded border border-card-stroke bg-base-1 px-4 text-on-base shadow-none outline-none transition-colors placeholder:text-on-base-2 focus-within:border-inverted-1 focus:border-inverted-1",{variants:{variant:{default:"h-12",small:"h-10",large:"h-14",xlarge:"h-24"},hasErrorState:{true:"border-danger focus:border-danger [&~.adornment]:border-danger [&~.adornment]:focus:border-danger"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2"},readOnly:{true:"bg-base-2"},prefixBorder:{true:"[&~.adornment.prefix]:border-r"},sufixBorder:{true:"[&~.adornment.sufix]:border-l"},hasPrefix:{true:"pl-[4.5rem]"},hasSufix:{true:"pr-[4.5rem]"}},compoundVariants:[{hasPrefix:!0,prefixBorder:!1,class:"pl-14"},{hasSufix:!0,sufixBorder:!1,class:"pr-14"}],defaultVariants:{variant:"default",hasErrorState:!1,disabled:!1,readOnly:!1}}),b="adornment border-card-stroke flex justify-center items-center absolute bottom-0 w-14 h-full text-f6 text-inverted-2 -mt-px peer-focus:border-inverted-1 transition-colors",k=({className:g="",formGroupClassName:I="",label:v,labelComplement:N,helpText:P,hasError:R=!1,errorMessage:o,required:n=!1,id:w,name:s,variant:E="default",disabled:l,readOnly:d,type:T="text",prefix:i,sufix:p,prefixBorder:H=!0,sufixBorder:L=!0,...S},y)=>{let B=useMemo(()=>Math.random().toString(36).substring(7),[]),t=w||s||B,a$3=R||!!o,u=!!p,f=!!i,C=jsx(a,{label:v,labelComplement:N,required:n,hasError:a$3,htmlFor:t,className:"mb-1"}),F=jsx(a$1,{helpText:o||P,hasError:a$3,className:"mt-2"});return jsxs("div",{className:a$2("form-group flex flex-col",I),children:[C,jsxs("div",{className:"relative",children:[jsx("input",{ref:y,type:T,id:t,name:s,required:n,disabled:l,readOnly:d,className:a$2(V({variant:E,hasErrorState:a$3,disabled:l,readOnly:d,className:g,prefixBorder:H,sufixBorder:L,hasSufix:u,hasPrefix:f})),...S}),f?jsx("label",{htmlFor:t,className:a$2("prefix left-0",b),children:i}):null,u?jsx("label",{htmlFor:t,className:a$2("sufix right-0",b),children:p}):null]}),F]})},q=h.forwardRef(k),A=h.memo(q);A.displayName="Input";
|
|
9
9
|
|
|
10
10
|
export { A as a };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a } from './chunk-7Z3CCBLX.js';
|
|
2
|
+
import { a as a$1 } from './chunk-G3GCVCTU.js';
|
|
3
|
+
import { a as a$2 } from './chunk-REQIQLRI.js';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import b from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var E=cva("w-full min-w-0 cursor-pointer appearance-none rounded border border-card-stroke bg-base-1 bg-no-repeat pl-4 pr-8 text-sm tracking-4 text-on-base shadow-none outline-none transition-colors duration-75 placeholder:text-on-base-2 focus:border-inverted-1",{variants:{variant:{default:"h-12",small:"h-10",large:"h-14",xlarge:"h-24"},withoutStyle:{true:"no-style border-transparent pl-2 pr-4 hover:text-inverted-1"},hasErrorState:{true:"border-danger focus:border-danger"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2 opacity-100"}}}),R=({formGroupClassName:f="",className:g="",label:x,labelComplement:v,helpText:h,hasError:S=!1,errorMessage:n,required:r=!1,id:w,name:s,variant:H="default",disabled:p,placeholder:c,options:I=[],withoutStyle:i=!1,style:N,...P},T)=>{let a$3=w||s,o=S||!!n,y=jsx(a,{label:x,required:r,hasError:o,htmlFor:a$3,className:"mb-1",labelComplement:v}),L=jsx(a$1,{helpText:n||h,hasError:o,className:"mt-2"});return jsxs("div",{className:a$2("form-group flex flex-col",f),children:[y,jsx("div",{className:"flex w-full",children:jsxs("select",{ref:T,id:a$3,name:s,required:r,disabled:p,className:a$2(E({variant:H,withoutStyle:i,hasErrorState:o,disabled:p}),g),...P,style:{backgroundImage:`url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 5" fill="%23607081"><path d="M7.11 0H.889a.667.667 0 00-.47 1.138l3.11 3.11a.661.661 0 00.943 0l3.11-3.11A.666.666 0 007.112 0z" /></svg>')`,backgroundSize:"8px",backgroundPosition:`calc(100% - ${i?"5px":"15px"}) center`,...N},children:[c?jsx("option",{value:"",disabled:r,children:c}):null,I?.map(t=>jsx("option",{value:`${t.value}`,disabled:t.disabled,children:t.label},`${a$3}-${t.value}`))]})}),L]})},C=b.forwardRef(R),M=b.memo(C);M.displayName="Select";
|
|
9
|
+
|
|
10
|
+
export { R as a, M as b };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a } from './chunk-L6H2NDVS.js';
|
|
2
|
+
import { a as a$1 } from './chunk-T7A7CWOV.js';
|
|
3
|
+
import s, { memo, useState, useEffect } from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var d=e=>s.isValidElement(e)&&e.type===a$1?s.cloneElement(e,{key:e.key,className:"[&_svg]:ml-0 [&_svg]:size-5 [&_svg]:p-px h-auto text-base-1 active:text-base-4 px-4 py-1 transition-colors flex-col-reverse inline-flex text-center font-normal text-f8 bg-transparent border-none hover:bg-transparent active:bg-transparent disabled:opacity-50"}):e,p=(e,o)=>{if(!Array.isArray(e))return d(e);for(let t=0;t<e.length;t++){let n;if(s.isValidElement(e[t]))if(e[t].type===a$1?n=d(e[t]):e[t].props.children?n=s.cloneElement(e[t],{key:t,children:p(e[t].props.children)}):n=e[t],o)o.push(n);else return n}},b=e=>{let o=[];return p(e,o),o},y=({onlyMobile:e=!1,children:o})=>{let[t,n]=useState(!0);useEffect(()=>{if(typeof window<"u"){let r=window.parent.document.querySelector(".botbar"),a=window.document.querySelector(".page-container");return r&&(r.style.display="none"),a&&(a.classList.remove("lg:mb-10","lg:pb-0"),n(!!a.dataset.expanded)),()=>{r&&(r.style.display=""),a&&a.classList.add("lg:mb-10","lg:pb-0");}}},[]);let f=b(o);return jsx("div",{className:"action-bar fixed inset-x-0 bottom-0 h-12 lg:h-auto pb-0-safe bg-inverted-1 lg:bg-base-1 z-50 shadow"+(e?" lg:hidden":""),children:jsxs("div",{className:`${t?a.expanded:a.default} mx-auto flex size-full items-center justify-center px-8 lg:justify-end lg:px-0`,children:[!e&&jsx("div",{className:"my-2.5 mr-8 hidden grid-flow-col gap-x-4 lg:grid [&_svg:not(.icon-loading)]:hidden",children:o}),jsx("div",{className:"flex h-full items-center justify-center lg:hidden",children:f})]})})},R=memo(y);R.displayName="ActionBar";
|
|
7
|
+
|
|
8
|
+
export { R as a };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { b } from './chunk-T46I7KD2.js';
|
|
2
|
+
import { a } from './chunk-HQ53LHR2.js';
|
|
3
|
+
import { a as a$1 } from './chunk-REQIQLRI.js';
|
|
4
|
+
import y, { useMemo, useRef } from 'react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var I=({currentItemsLength:n,totalItemsLength:a=0,itemsLengthOptions:i,onItemsLengthChange:r})=>{let e=l=>{let o=l.currentTarget.value;r&&r(o);},s=useMemo(()=>{if(n)return Math.max(n,a)},[n,a]);return !n&&n!==0?null:jsx("div",{className:"pagination-info hidden sm:flex",children:jsxs("div",{className:"text-f6 mr-5 flex items-center tracking-4 text-inverted-2",children:[i?jsx(b,{id:"selectItemsPerPage",options:i,withoutStyle:!0,"aria-label":"Itens por p\xE1gina",onChange:e,className:"h-6"}):jsxs("span",{children:["Mostrando ",jsx("span",{className:"pagination-info-current",children:n})]}),"\xA0de\xA0",jsx("span",{className:"pagination-info-total",children:s}),"\xA0no total"]})})},u=y.memo(I);u.displayName="PaginationInfo";var M=({currentPage:n=1,totalPages:a$1=1,onPageChange:i})=>{let r=useRef(null),e=useMemo(()=>Math.max(n,a$1),[n,a$1]),s=useMemo(()=>n<a$1,[n,a$1]),l=useMemo(()=>n>1,[n]),o=t=>{t=t<1?1:t>e?e:t,i&&i(t);},c=t=>(t.preventDefault(),!1);return jsxs("div",{className:"pagination-nav flex w-full items-center justify-between sm:w-auto",children:[jsxs("div",{className:"text-f6 tracking-4 text-inverted-2",children:[jsx("span",{id:"btnPaginationActualPage",className:"pagination-nav-current inline-block w-9 rounded border border-card-stroke/50 bg-base-1 text-center font-semibold leading-8 text-primary outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",ref:r,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:t=>{if(!(t.which>=35&&t.which<=39)&&!(t.which===46||t.which===8)){if(t.which===13){let b=r?.current?.innerText;if(b){let w=parseInt(b);o(w);}t.preventDefault();return}isNaN(parseInt(String.fromCharCode(t.which)))&&t.preventDefault();}},onCopy:c,onCut:c,onPaste:c,children:n})," ","/"," ",jsx("button",{type:"button",id:"btnPaginationLastPage",className:"pagination-nav-total focus:outline-none",onClick:()=>{n!==e&&o(e);},children:e})]}),jsxs("div",{className:"ml-5 flex items-center text-inverted-2",children:[jsx("button",{type:"button",id:"btnPaginationPrev",className:`pagination-nav-previous mr-3 outline-none duration-200 ${l?"hover:text-inverted-1":""}`,"aria-label":"Ir para p\xE1gina anterior",onClick:()=>{l&&o(n-1);},children:jsx(a,{icon:"arrowLeft",size:4})}),jsx("button",{type:"button",id:"btnPaginationNext",className:`pagination-nav-next outline-none duration-200 ${s?"hover:text-inverted-1":""}`,"aria-label":"Ir para pr\xF3xima p\xE1gina",onClick:()=>{s&&o(n+1);},children:jsx(a,{icon:"arrowRight",size:4})})]})]})},v=y.memo(M);v.displayName="PaginationNav";var R=({className:n="",currentPage:a=1,totalPages:i=1,onPageChange:r,currentItemsLength:e,totalItemsLength:s,itemsLengthOptions:l,onItemsLengthChange:o})=>jsxs("div",{className:a$1("pagination flex flex-wrap items-center justify-end leading-4 sm:justify-between",n),children:[jsx(u,{currentItemsLength:e,totalItemsLength:s,itemsLengthOptions:l,onItemsLengthChange:o}),jsx(v,{currentPage:a,totalPages:i,onPageChange:r})]}),L=y.memo(R);L.displayName="Pagination";
|
|
8
|
+
|
|
9
|
+
export { L as a };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SelectInstance } from 'react-select';
|
|
4
|
+
import { IconProps } from '../../components/Icon';
|
|
5
|
+
import { InputLabelProps } from '../InputLabel';
|
|
6
|
+
declare const dropdownVariants: (props?: ({
|
|
7
|
+
size?: "small" | "default" | "large" | "xlarge" | null | undefined;
|
|
8
|
+
variant?: "secondary" | "default" | null | undefined;
|
|
9
|
+
disabled?: boolean | null | undefined;
|
|
10
|
+
readOnly?: boolean | null | undefined;
|
|
11
|
+
hasErrorState?: boolean | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
interface DropdownProps {
|
|
14
|
+
/**
|
|
15
|
+
* Form group custom class name
|
|
16
|
+
* */
|
|
17
|
+
formGroupClassName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Options displayed inside dropdown
|
|
20
|
+
* */
|
|
21
|
+
options: CustomOptionProps[] | CustomGroupedOptionsProps[];
|
|
22
|
+
/**
|
|
23
|
+
* Placeholder text
|
|
24
|
+
* @default "Selecione um item"
|
|
25
|
+
* */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Callback function triggered when an option is selected
|
|
29
|
+
* */
|
|
30
|
+
onChange?: (option: CustomOptionProps) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Callback function triggered when the dropdown loses
|
|
33
|
+
* focus
|
|
34
|
+
* */
|
|
35
|
+
onBlur?: (event: React.FocusEvent<HTMLElement>) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Changes the size of dropdown
|
|
38
|
+
* @default default
|
|
39
|
+
* */
|
|
40
|
+
size?: VariantProps<typeof dropdownVariants>['size'];
|
|
41
|
+
/**
|
|
42
|
+
* Changes the variant of dropdown
|
|
43
|
+
* @default default
|
|
44
|
+
* */
|
|
45
|
+
variant?: VariantProps<typeof dropdownVariants>['variant'];
|
|
46
|
+
/**
|
|
47
|
+
* Keep marked the selected option on clicked
|
|
48
|
+
* @default false
|
|
49
|
+
* */
|
|
50
|
+
markSelectedOption?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Makes the field writeable and return the matched options
|
|
53
|
+
* @default false
|
|
54
|
+
* */
|
|
55
|
+
isSearchable?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Disable entire dropdown
|
|
58
|
+
* @default false
|
|
59
|
+
* */
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* ReadOnly entire dropdown
|
|
63
|
+
* @default false
|
|
64
|
+
* */
|
|
65
|
+
readOnly?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The string showed if the options are empty or search result is empty
|
|
68
|
+
* @default "Nenhuma opção disponível"
|
|
69
|
+
* */
|
|
70
|
+
emptyMessage?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Help text
|
|
73
|
+
* */
|
|
74
|
+
label?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Label complement
|
|
77
|
+
* */
|
|
78
|
+
labelComplement?: InputLabelProps['labelComplement'];
|
|
79
|
+
/** Should display the label above the dropdown
|
|
80
|
+
* @default ''
|
|
81
|
+
* */
|
|
82
|
+
helpText?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Change dropdown style to error state
|
|
85
|
+
* @default false
|
|
86
|
+
* */
|
|
87
|
+
hasError?: boolean;
|
|
88
|
+
/** Should display error state and the message
|
|
89
|
+
* @default ''
|
|
90
|
+
* */
|
|
91
|
+
errorMessage?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Requires at least one option marked on dropdown
|
|
94
|
+
* @default false
|
|
95
|
+
* */
|
|
96
|
+
required?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Current value of dropdown
|
|
99
|
+
* */
|
|
100
|
+
value?: CustomOptionProps;
|
|
101
|
+
/**
|
|
102
|
+
* Max height for the options menu container
|
|
103
|
+
* */
|
|
104
|
+
maxMenuHeight?: number;
|
|
105
|
+
/**
|
|
106
|
+
* The CSS position value of the menu,
|
|
107
|
+
* when "fixed" extra layout management is required
|
|
108
|
+
* @default 'absolute'
|
|
109
|
+
* */
|
|
110
|
+
menuPosition?: 'fixed' | 'absolute';
|
|
111
|
+
/**
|
|
112
|
+
* Default placement of the menu in relation to the control.
|
|
113
|
+
* 'auto' will flip when there isn't enough space below the control.
|
|
114
|
+
* @default 'auto'
|
|
115
|
+
* */
|
|
116
|
+
menuPlacement?: 'top' | 'bottom' | 'auto';
|
|
117
|
+
/**
|
|
118
|
+
* Width of menu containing the options
|
|
119
|
+
* @default '100%'
|
|
120
|
+
* */
|
|
121
|
+
menuWidth?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Can align the menu in different positions if the menuWidth
|
|
124
|
+
* is bigger than the width of select
|
|
125
|
+
* */
|
|
126
|
+
menuHorizontalPlacement?: 'left' | 'right';
|
|
127
|
+
id?: string;
|
|
128
|
+
name?: string;
|
|
129
|
+
}
|
|
130
|
+
interface CustomOptionProps {
|
|
131
|
+
value: string | number;
|
|
132
|
+
label: string;
|
|
133
|
+
icon?: IconProps['icon'];
|
|
134
|
+
isDisabled?: boolean | undefined;
|
|
135
|
+
}
|
|
136
|
+
interface CustomGroupedOptionsProps {
|
|
137
|
+
label: string;
|
|
138
|
+
options: CustomOptionProps[];
|
|
139
|
+
}
|
|
140
|
+
declare const Dropdown: React.MemoExoticComponent<React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<SelectInstance<CustomOptionProps>>>>;
|
|
141
|
+
export { type CustomGroupedOptionsProps, type CustomOptionProps, Dropdown, type DropdownProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dropdown.client';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";export { a as Dropdown } from '../../chunk-2VOBQTBC.js';
|
|
2
|
+
import '../../chunk-7Z3CCBLX.js';
|
|
3
|
+
import '../../chunk-LTWCICTK.js';
|
|
4
|
+
import '../../chunk-HQ53LHR2.js';
|
|
5
|
+
import '../../chunk-EVEOC5I2.js';
|
|
6
|
+
import '../../chunk-G3GCVCTU.js';
|
|
7
|
+
import '../../chunk-REQIQLRI.js';
|
|
@@ -15,6 +15,11 @@ interface InputProps extends InputLabelProps, InputHelpTextProps, Omit<React.Inp
|
|
|
15
15
|
* @default default
|
|
16
16
|
* */
|
|
17
17
|
variant?: 'default' | 'small' | 'large' | 'xlarge';
|
|
18
|
+
/**
|
|
19
|
+
* Change input style to error state
|
|
20
|
+
* @default false
|
|
21
|
+
* */
|
|
22
|
+
hasError?: boolean;
|
|
18
23
|
/**
|
|
19
24
|
* Error message to display
|
|
20
25
|
* */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";export { a as InputMask } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
"use client";export { a as InputMask } from '../../chunk-ABMMRP7O.js';
|
|
2
|
+
import '../../chunk-FNTWCBA6.js';
|
|
3
3
|
import '../../chunk-7Z3CCBLX.js';
|
|
4
4
|
import '../../chunk-G3GCVCTU.js';
|
|
5
5
|
import '../../chunk-REQIQLRI.js';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputHelpTextProps } from '../InputHelpText';
|
|
3
3
|
import { InputLabelProps } from '../InputLabel';
|
|
4
|
-
export declare const SelectComponent: ({ className, label, labelComplement, helpText, hasError, errorMessage, required, id, name, variant, disabled, placeholder, options, withoutStyle, style, ...props }: SelectProps, ref: React.ForwardedRef<HTMLSelectElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const SelectComponent: ({ formGroupClassName, className, label, labelComplement, helpText, hasError, errorMessage, required, id, name, variant, disabled, placeholder, options, withoutStyle, style, ...props }: SelectProps, ref: React.ForwardedRef<HTMLSelectElement>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
interface SelectProps extends InputLabelProps, InputHelpTextProps, React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
6
6
|
/**
|
|
7
|
-
* Custom class name
|
|
7
|
+
* Custom class name for form group
|
|
8
|
+
*/
|
|
9
|
+
formGroupClassName?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Custom class name for input
|
|
8
12
|
* */
|
|
9
13
|
className?: string;
|
|
10
14
|
/** List of options to populate select
|
package/dist/forms/index.d.ts
CHANGED
package/dist/forms/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import '../chunk-
|
|
2
|
-
export {
|
|
3
|
-
export { a as
|
|
4
|
-
export { a as
|
|
1
|
+
import '../chunk-WV2QQGA4.js';
|
|
2
|
+
export { a as Dropdown } from '../chunk-2VOBQTBC.js';
|
|
3
|
+
export { b as Select, a as SelectComponent } from '../chunk-T46I7KD2.js';
|
|
4
|
+
export { a as InputMask } from '../chunk-ABMMRP7O.js';
|
|
5
|
+
export { a as Input } from '../chunk-FNTWCBA6.js';
|
|
5
6
|
export { a as InputLabel } from '../chunk-7Z3CCBLX.js';
|
|
7
|
+
import '../chunk-LTWCICTK.js';
|
|
8
|
+
import '../chunk-HQ53LHR2.js';
|
|
9
|
+
import '../chunk-EVEOC5I2.js';
|
|
6
10
|
export { a as Checkbox } from '../chunk-DIENJUYM.js';
|
|
7
11
|
export { a as InputHelpText } from '../chunk-G3GCVCTU.js';
|
|
8
12
|
import '../chunk-REQIQLRI.js';
|
package/dist/index.js
CHANGED
|
@@ -4,21 +4,22 @@ import './chunk-4PUGMMDC.js';
|
|
|
4
4
|
export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
|
|
5
5
|
export { a as Breadcrumb } from './chunk-FZISHDWC.js';
|
|
6
6
|
export { a as HelpLink } from './chunk-SXBDHD2Z.js';
|
|
7
|
-
export { a as Pagination } from './chunk-
|
|
7
|
+
export { a as Pagination } from './chunk-UYUM2DWH.js';
|
|
8
8
|
export { a as Stepper } from './chunk-I7PCF2VW.js';
|
|
9
9
|
import './chunk-DIFKNF3L.js';
|
|
10
10
|
export { a as IconCircular } from './chunk-BV27BOLB.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
export {
|
|
13
|
-
export { a as
|
|
14
|
-
export { a as
|
|
11
|
+
import './chunk-WV2QQGA4.js';
|
|
12
|
+
export { a as Dropdown } from './chunk-2VOBQTBC.js';
|
|
13
|
+
export { b as Select, a as SelectComponent } from './chunk-T46I7KD2.js';
|
|
14
|
+
export { a as InputMask } from './chunk-ABMMRP7O.js';
|
|
15
|
+
export { a as Input } from './chunk-FNTWCBA6.js';
|
|
15
16
|
export { a as InputLabel } from './chunk-7Z3CCBLX.js';
|
|
16
17
|
export { a as Alert } from './chunk-FM3XVRKO.js';
|
|
17
|
-
export { a as Badge } from './chunk-
|
|
18
|
+
export { a as Badge } from './chunk-72QPS6JN.js';
|
|
18
19
|
export { a as Tag } from './chunk-2B6HWISX.js';
|
|
19
|
-
export { b as ToastContainer, a as notify } from './chunk-
|
|
20
|
+
export { b as ToastContainer, a as notify } from './chunk-EHRQIKSI.js';
|
|
20
21
|
export { a as Tooltip } from './chunk-TZI6YTCW.js';
|
|
21
|
-
export { a as ActionBar } from './chunk-
|
|
22
|
+
export { a as ActionBar } from './chunk-UQTLNERO.js';
|
|
22
23
|
import './chunk-L6H2NDVS.js';
|
|
23
24
|
export { a as Button } from './chunk-T7A7CWOV.js';
|
|
24
25
|
export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-IGUCTFH2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const Badge: React.MemoExoticComponent<({ type, text, size,
|
|
2
|
+
declare const Badge: React.MemoExoticComponent<({ type, text, size, rounded, className }: BadgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
3
|
interface BadgeProps {
|
|
4
4
|
/**
|
|
5
5
|
* Custom class name
|
|
@@ -17,10 +17,6 @@ interface BadgeProps {
|
|
|
17
17
|
* @default default
|
|
18
18
|
* */
|
|
19
19
|
size?: 'default' | 'small' | 'xsmall';
|
|
20
|
-
/**
|
|
21
|
-
* Enlarge width of the badge
|
|
22
|
-
* */
|
|
23
|
-
expanded?: boolean;
|
|
24
20
|
/**
|
|
25
21
|
* Style of rounded corners
|
|
26
22
|
* @default full
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as Badge } from '../../chunk-
|
|
1
|
+
export { a as Badge } from '../../chunk-72QPS6JN.js';
|
|
2
2
|
import '../../chunk-REQIQLRI.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";export { b as ToastContainer, a as notify } from '../../chunk-
|
|
1
|
+
"use client";export { b as ToastContainer, a as notify } from '../../chunk-EHRQIKSI.js';
|
|
2
2
|
import '../../chunk-LTWCICTK.js';
|
|
3
3
|
import '../../chunk-HQ53LHR2.js';
|
|
4
4
|
import '../../chunk-EVEOC5I2.js';
|
package/dist/indicators/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../chunk-7RP4L6ZM.js';
|
|
2
2
|
export { a as Alert } from '../chunk-FM3XVRKO.js';
|
|
3
|
-
export { a as Badge } from '../chunk-
|
|
3
|
+
export { a as Badge } from '../chunk-72QPS6JN.js';
|
|
4
4
|
export { a as Tag } from '../chunk-2B6HWISX.js';
|
|
5
|
-
export { b as ToastContainer, a as notify } from '../chunk-
|
|
5
|
+
export { b as ToastContainer, a as notify } from '../chunk-EHRQIKSI.js';
|
|
6
6
|
export { a as Tooltip } from '../chunk-TZI6YTCW.js';
|
|
7
7
|
import '../chunk-T7A7CWOV.js';
|
|
8
8
|
import '../chunk-LTWCICTK.js';
|
package/dist/layout/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../chunk-DBWOW4GL.js';
|
|
2
2
|
export { a as Container, b as ContainerHeader } from '../chunk-3BKW5XAK.js';
|
|
3
|
-
export { a as ActionBar } from '../chunk-
|
|
3
|
+
export { a as ActionBar } from '../chunk-UQTLNERO.js';
|
|
4
4
|
import '../chunk-L6H2NDVS.js';
|
|
5
5
|
import '../chunk-T7A7CWOV.js';
|
|
6
6
|
export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from '../chunk-IGUCTFH2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";export { a as Pagination } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
"use client";export { a as Pagination } from '../../chunk-UYUM2DWH.js';
|
|
2
|
+
import '../../chunk-T46I7KD2.js';
|
|
3
3
|
import '../../chunk-7Z3CCBLX.js';
|
|
4
4
|
import '../../chunk-LTWCICTK.js';
|
|
5
5
|
import '../../chunk-HQ53LHR2.js';
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../chunk-4PUGMMDC.js';
|
|
2
2
|
export { a as Breadcrumb } from '../chunk-FZISHDWC.js';
|
|
3
3
|
export { a as HelpLink } from '../chunk-SXBDHD2Z.js';
|
|
4
|
-
export { a as Pagination } from '../chunk-
|
|
4
|
+
export { a as Pagination } from '../chunk-UYUM2DWH.js';
|
|
5
5
|
export { a as Stepper } from '../chunk-I7PCF2VW.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-T46I7KD2.js';
|
|
7
7
|
import '../chunk-7Z3CCBLX.js';
|
|
8
8
|
import '../chunk-LTWCICTK.js';
|
|
9
9
|
import '../chunk-HQ53LHR2.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loja-integrada/admin-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"author": "Loja Integrada",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"tsup": "^8.1.0",
|
|
33
33
|
"typescript": "^5.3.3",
|
|
34
34
|
"vite": "^5.1.4",
|
|
35
|
-
"@loja-integrada/eslint-config": "0.0.
|
|
35
|
+
"@loja-integrada/eslint-config": "0.0.2",
|
|
36
36
|
"@loja-integrada/tailwindcss-config": "2.0.1",
|
|
37
37
|
"@loja-integrada/typescript-config": "0.0.2"
|
|
38
38
|
},
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"react-imask": "^7.6.1",
|
|
45
45
|
"react-modal": "^3.16.1",
|
|
46
|
+
"react-select": "^5.8.0",
|
|
46
47
|
"react-toastify": "10.0.5",
|
|
47
48
|
"tailwind-merge": "^2.3.0"
|
|
48
49
|
},
|
|
@@ -101,6 +102,10 @@
|
|
|
101
102
|
"types": "./dist/forms/Checkbox/Checkbox.d.ts",
|
|
102
103
|
"import": "./dist/forms/Checkbox/index.js"
|
|
103
104
|
},
|
|
105
|
+
"./Dropdown": {
|
|
106
|
+
"types": "./dist/forms/Dropdown/Dropdown.d.ts",
|
|
107
|
+
"import": "./dist/forms/Dropdown/index.js"
|
|
108
|
+
},
|
|
104
109
|
"./Input": {
|
|
105
110
|
"types": "./dist/forms/Input/Input.d.ts",
|
|
106
111
|
"import": "./dist/forms/Input/index.js"
|
|
@@ -176,7 +181,7 @@
|
|
|
176
181
|
"gen-entry": "node scripts/entry-points.js",
|
|
177
182
|
"dev": "tsup --watch",
|
|
178
183
|
"lint": "eslint . && prettier --check .",
|
|
179
|
-
"format": "
|
|
184
|
+
"format": "eslint --fix . && prettier --write .",
|
|
180
185
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
181
186
|
"test": "cypress run --component",
|
|
182
187
|
"test-visual": "cypress open --component"
|
package/dist/chunk-BLEJ5LCZ.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-7Z3CCBLX.js';
|
|
2
|
-
import { a as a$2 } from './chunk-G3GCVCTU.js';
|
|
3
|
-
import { a } from './chunk-REQIQLRI.js';
|
|
4
|
-
import { cva } from 'class-variance-authority';
|
|
5
|
-
import b from 'react';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var E=cva("",{variants:{variant:{default:"h-12",small:"h-10",large:"h-14",xlarge:"h-24"},withoutStyle:{true:"no-style mr-1 cursor-pointer appearance-none bg-no-repeat pr-4 hover:text-inverted-1",false:"transition-border w-full min-w-0 cursor-pointer appearance-none rounded border bg-base-1 bg-no-repeat px-4 pr-8 text-sm tracking-4 text-on-base placeholder-on-base-2 shadow-none outline-none duration-75 focus:border-inverted-1"},hasErrorState:{true:"border-danger focus:border-danger",false:"border-card-stroke"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2 opacity-100"}}}),R=({className:f="",label:g,labelComplement:x,helpText:v,hasError:h=!1,errorMessage:l,required:r=!1,id:S,name:n,variant:w="default",disabled:s,placeholder:p,options:H=[],withoutStyle:c=!1,style:I,...P},T)=>{let a$3=S||n,o=h||!!l,y=a(E({variant:w,withoutStyle:c,hasErrorState:o,disabled:s})),L=jsx(a$1,{label:g,required:r,hasError:o,htmlFor:a$3,className:"mb-1",labelComplement:x}),N=jsx(a$2,{helpText:l||v,hasError:o,className:"mt-2"});return jsxs("div",{className:`form-group flex flex-col ${f}`,children:[L,jsx("div",{className:"flex w-full",children:jsxs("select",{ref:T,id:a$3,name:n,required:r,disabled:s,className:y,...P,style:{backgroundImage:`url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 5" fill="%23607081"><path d="M7.11 0H.889a.667.667 0 00-.47 1.138l3.11 3.11a.661.661 0 00.943 0l3.11-3.11A.666.666 0 007.112 0z" /></svg>')`,backgroundSize:"8px",backgroundPosition:`calc(100% - ${c?"5px":"15px"}) center`,...I},children:[p?jsx("option",{value:"",disabled:r,children:p}):null,H?.map(t=>jsx("option",{value:`${t.value}`,disabled:t.disabled,children:t.label},`${a$3}-${t.value}`))]})}),N]})},C=b.forwardRef(R),$=b.memo(C);$.displayName="Select";
|
|
9
|
-
|
|
10
|
-
export { R as a, $ as b };
|
package/dist/chunk-M4V7OPDZ.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-REQIQLRI.js';
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
|
-
import o from 'react';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var i=cva("badge items-center justify-center font-semibold",{variants:{type:{neutral:"bg-inverted-2 text-base-1",neutralLight:"bg-inverted-3 text-tertiary",primary:"bg-primary-dark text-base-1",danger:"bg-danger-dark text-base-1",success:"bg-success-dark text-base-1",warning:"bg-warning-dark text-base-1",focus:"bg-focus text-base-1"},size:{default:"px-2 py-0.5 text-xs",small:"px-1.5 text-[0.70rem]",xsmall:"text-f8 px-0.5 py-px"},expanded:{true:"flex w-full",false:"inline-flex"},rounded:{full:"rounded-full",small:"rounded",none:"rounded-none"}},defaultVariants:{type:"primary",size:"default"}}),u=({type:a$1="neutral",text:t,size:r="default",expanded:s=!1,rounded:n="full",className:l=""})=>jsx("div",{className:a(i({type:a$1,size:r,expanded:s,rounded:n}),l),children:t}),p=o.memo(u);p.displayName="Badge";
|
|
7
|
-
|
|
8
|
-
export { p as a };
|
package/dist/chunk-XMNDXVVV.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-L6H2NDVS.js';
|
|
2
|
-
import { a as a$1 } from './chunk-T7A7CWOV.js';
|
|
3
|
-
import s, { memo, useState, useEffect } from 'react';
|
|
4
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var d=e=>s.isValidElement(e)&&e.type===a$1?s.cloneElement(e,{className:"[&_svg]:ml-0 [&_svg]:size-5 [&_svg]:p-px h-auto text-base-1 active:text-base-4 px-4 py-1 transition-colors flex-col-reverse inline-flex text-center font-normal text-f8 bg-transparent border-none hover:bg-transparent active:bg-transparent"}):e,p=(e,o)=>{if(!Array.isArray(e))return d(e);for(let t=0;t<e.length;t++){let n;if(s.isValidElement(e[t]))if(e[t].type===a$1?n=d(e[t]):e[t].props.children?n=s.cloneElement(e[t],{children:p(e[t].props.children)}):n=e[t],o)o.push(n);else return n}},b=e=>{let o=[];return p(e,o),o},R=({onlyMobile:e=!1,children:o})=>{let[t,n]=useState(!0);useEffect(()=>{if(typeof window<"u"){let r=window.parent.document.querySelector(".botbar"),a=window.document.querySelector(".page-container");return r&&(r.style.display="none"),a&&(a.classList.remove("lg:mb-10","lg:pb-0"),n(!!a.dataset.expanded)),()=>{r&&(r.style.display=""),a&&a.classList.add("lg:mb-10","lg:pb-0");}}},[]);let f=b(o);return jsx("div",{className:"action-bar fixed inset-x-0 bottom-0 h-12 lg:h-auto pb-0-safe bg-inverted-1 lg:bg-base-1 z-50 shadow"+(e?" lg:hidden":""),children:jsxs("div",{className:`${t?a.expanded:a.default} mx-auto flex size-full items-center justify-center px-8 lg:justify-end lg:px-0`,children:[!e&&jsx("div",{className:"my-2.5 mr-8 hidden grid-flow-col gap-x-4 lg:grid [&_svg:not(.icon-loading)]:hidden",children:o}),jsx("div",{className:"flex h-full items-center justify-center lg:hidden",children:f})]})})},x=memo(R);x.displayName="ActionBar";
|
|
7
|
-
|
|
8
|
-
export { x as a };
|
package/dist/chunk-ZRJQNS4S.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { b } from './chunk-BLEJ5LCZ.js';
|
|
2
|
-
import { a } from './chunk-HQ53LHR2.js';
|
|
3
|
-
import { a as a$1 } from './chunk-REQIQLRI.js';
|
|
4
|
-
import y, { useMemo, useRef } from 'react';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var I=({currentItemsLength:n,totalItemsLength:a=0,itemsLengthOptions:i,onItemsLengthChange:r})=>{let e=p=>{let o=p.currentTarget.value;r&&r(o);},s=useMemo(()=>{if(n)return Math.max(n,a)},[n,a]);return !n&&n!==0?null:jsx("div",{className:"pagination-info hidden sm:flex",children:jsxs("div",{className:"text-f6 mr-5 flex items-center tracking-4 text-inverted-2",children:[i?jsx(b,{id:"selectItemsPerPage",options:i,withoutStyle:!0,"aria-label":"Itens por p\xE1gina",onChange:e}):jsxs("span",{children:["Mostrando ",jsx("span",{className:"pagination-info-current",children:n})]}),"\xA0de\xA0",jsx("span",{className:"pagination-info-total",children:s}),"\xA0no total"]})})},g=y.memo(I);g.displayName="PaginationInfo";var M=({currentPage:n=1,totalPages:a$1=1,onPageChange:i})=>{let r=useRef(null),e=useMemo(()=>Math.max(n,a$1),[n,a$1]),s=useMemo(()=>n<a$1,[n,a$1]),p=useMemo(()=>n>1,[n]),o=t=>{t=t<1?1:t>e?e:t,i&&i(t);},c=t=>(t.preventDefault(),!1);return jsxs("div",{className:"pagination-nav flex w-full items-center justify-between sm:w-auto",children:[jsxs("div",{className:"text-f6 tracking-4 text-inverted-2",children:[jsx("span",{id:"btnPaginationActualPage",className:"pagination-nav-current inline-block w-9 rounded border border-card-stroke/50 bg-base-1 text-center font-semibold leading-8 text-primary",ref:r,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:t=>{if(!(t.which>=35&&t.which<=39)&&!(t.which===46||t.which===8)){if(t.which===13){let P=r?.current?.innerText;if(P){let w=parseInt(P);o(w);}t.preventDefault();return}isNaN(parseInt(String.fromCharCode(t.which)))&&t.preventDefault();}},onCopy:c,onCut:c,onPaste:c,children:n})," ","/"," ",jsx("button",{type:"button",id:"btnPaginationLastPage",className:"pagination-nav-total focus:outline-none",onClick:()=>{n!==e&&o(e);},children:e})]}),jsxs("div",{className:"ml-5 flex items-center text-inverted-2",children:[jsx("button",{type:"button",id:"btnPaginationPrev",className:`pagination-nav-previous mr-3 outline-none duration-200 ${p?"hover:text-inverted-1":""}`,"aria-label":"Ir para p\xE1gina anterior",onClick:()=>{p&&o(n-1);},children:jsx(a,{icon:"arrowLeft",size:4})}),jsx("button",{type:"button",id:"btnPaginationNext",className:`pagination-nav-next outline-none duration-200 ${s?"hover:text-inverted-1":""}`,"aria-label":"Ir para pr\xF3xima p\xE1gina",onClick:()=>{s&&o(n+1);},children:jsx(a,{icon:"arrowRight",size:4})})]})]})},v=y.memo(M);v.displayName="PaginationNav";var R=({className:n="",currentPage:a=1,totalPages:i=1,onPageChange:r,currentItemsLength:e,totalItemsLength:s,itemsLengthOptions:p,onItemsLengthChange:o})=>jsxs("div",{className:a$1("pagination flex flex-wrap items-center justify-end leading-4 sm:justify-between",n),children:[jsx(g,{currentItemsLength:e,totalItemsLength:s,itemsLengthOptions:p,onItemsLengthChange:o}),jsx(v,{currentPage:a,totalPages:i,onPageChange:r})]}),L=y.memo(R);L.displayName="Pagination";
|
|
8
|
-
|
|
9
|
-
export { L as a };
|
|
File without changes
|