@aveonline/ui-react 2.0.0 → 2.0.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ICardHistory } from './ICardHistory';
|
|
3
|
-
declare function CardHistory({ description, date, dimension, hour, badge, state, size, variant, dropdown, children }: ICardHistory): JSX.Element;
|
|
3
|
+
declare function CardHistory({ description, date, dimension, hour, badge, state, size, customWidth, variant, dropdown, children }: ICardHistory): JSX.Element;
|
|
4
4
|
export default CardHistory;
|
package/dist/ui-react.mjs
CHANGED
|
@@ -36953,23 +36953,25 @@ function TK({
|
|
|
36953
36953
|
badge: i = { variant: "neutral" },
|
|
36954
36954
|
state: a = "default",
|
|
36955
36955
|
size: o = "md",
|
|
36956
|
-
|
|
36957
|
-
|
|
36958
|
-
|
|
36956
|
+
customWidth: s,
|
|
36957
|
+
variant: l = "default",
|
|
36958
|
+
dropdown: u = { isActive: !1, title: /* @__PURE__ */ E.jsx(E.Fragment, {}) },
|
|
36959
|
+
children: c
|
|
36959
36960
|
}) {
|
|
36960
36961
|
return /* @__PURE__ */ E.jsxs(
|
|
36961
36962
|
"div",
|
|
36962
36963
|
{
|
|
36963
36964
|
className: ne(
|
|
36964
|
-
"flex flex-col rounded-xl
|
|
36965
|
+
"flex flex-col rounded-xl shadow-[0px_3px_22px_0px_#34343433]",
|
|
36965
36966
|
a === "active" && "border border-solid border-focused-default",
|
|
36966
36967
|
o === "md" && "py-6 px-11",
|
|
36967
36968
|
o === "sm" && "py-2 px-4",
|
|
36969
|
+
s ?? "max-w-md",
|
|
36968
36970
|
n === "xl" && "w-[447px] h-[126px]",
|
|
36969
36971
|
n === "lg" && "w-[447px] h-[116px]",
|
|
36970
36972
|
n === "md" && "w-[391px] h-[84px]",
|
|
36971
36973
|
n === "sm" && "w-[391px] max-h-[173px]",
|
|
36972
|
-
|
|
36974
|
+
l === "critical" ? "bg-surface-critical-subdued" : "bg-surface-subdued"
|
|
36973
36975
|
),
|
|
36974
36976
|
children: [
|
|
36975
36977
|
/* @__PURE__ */ E.jsxs("div", { className: "flex justify-between", children: [
|
|
@@ -37002,13 +37004,13 @@ function TK({
|
|
|
37002
37004
|
children: e
|
|
37003
37005
|
}
|
|
37004
37006
|
) : null,
|
|
37005
|
-
|
|
37006
|
-
|
|
37007
|
+
c ? /* @__PURE__ */ E.jsx(E.Fragment, { children: c }) : null,
|
|
37008
|
+
u.isActive && /* @__PURE__ */ E.jsx("div", { className: "mt-2", children: /* @__PURE__ */ E.jsx(co, { children: ({ open: f }) => /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
37007
37009
|
/* @__PURE__ */ E.jsxs(co.Button, { className: "flex justify-between w-full", children: [
|
|
37008
|
-
/* @__PURE__ */ E.jsx(De, { variant: "body", color: "subdued", children:
|
|
37009
|
-
/* @__PURE__ */ E.jsx(ht, { kind:
|
|
37010
|
+
/* @__PURE__ */ E.jsx(De, { variant: "body", color: "subdued", children: u.title }),
|
|
37011
|
+
/* @__PURE__ */ E.jsx(ht, { kind: f ? "up" : "down", color: "active" })
|
|
37010
37012
|
] }),
|
|
37011
|
-
/* @__PURE__ */ E.jsx(co.Panel, { className: "mt-2", children: typeof
|
|
37013
|
+
/* @__PURE__ */ E.jsx(co.Panel, { className: "mt-2", children: typeof u.children == "object" ? /* @__PURE__ */ E.jsx(E.Fragment, { children: u.children }) : u.description ? /* @__PURE__ */ E.jsx(De, { variant: "body", color: "subdued", children: u.description }) : null })
|
|
37012
37014
|
] }) }) })
|
|
37013
37015
|
]
|
|
37014
37016
|
}
|
package/dist/ui-react.umd.js
CHANGED
|
@@ -235,4 +235,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
235
235
|
* @license MIT license.
|
|
236
236
|
* @copyright (c) 2099 Kent C. Dodds
|
|
237
237
|
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|
238
|
-
*/const _n={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function kK(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:_n.MATCHES,!n.accessors){const o=K6(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=DK(e,n.accessors),a={rankedValue:e,rank:_n.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const s=i[o];let l=K6(s.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:f=n.threshold}=s.attributes;l<u&&l>=_n.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=f&&l>a.rank&&(a.rank=l,a.passed=!0,a.accessorIndex=o,a.accessorThreshold=f,a.rankedValue=s.itemValue)}return a}function K6(e,t,n){return e=$6(e,n),t=$6(t,n),t.length>e.length?_n.NO_MATCH:e===t?_n.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?_n.EQUAL:e.startsWith(t)?_n.STARTS_WITH:e.includes(` ${t}`)?_n.WORD_STARTS_WITH:e.includes(t)?_n.CONTAINS:t.length===1?_n.NO_MATCH:TK(e).includes(t)?_n.ACRONYM:NK(e,t))}function TK(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(a=>{t+=a.substr(0,1)})}),t}function NK(e,t){let n=0,r=0;function i(l,u,c){for(let f=c,p=u.length;f<p;f++)if(u[f]===l)return n+=1,f+1;return-1}function a(l){const u=1/l,c=n/t.length;return _n.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return _n.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return _n.NO_MATCH}const s=r-o;return a(s)}function $6(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=RK(e)),e}function jK(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function DK(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const a=t[r],o=FK(a),s=jK(e,a);for(let l=0,u=s.length;l<u;l++)n.push({itemValue:s[l],attributes:o})}return n}const e9={maxRanking:1/0,minRanking:-1/0};function FK(e){return typeof e=="function"?e9:{...e9,...e}}const x$="";function VK({value:e,onChange:t,debounce:n=500,placeholder:r,...i}){const[a,o]=x.useState(e);return x.useEffect(()=>{o(e)},[e]),x.useEffect(()=>{const s=setTimeout(()=>{t(a)},n);return()=>clearTimeout(s)},[n,t,a]),E.jsxs(E.Fragment,{children:[E.jsx(ft,{className:"m-2",color:"subdued",size:"sm",kind:"search"}),E.jsx("input",{...i,className:"rounded-tr-sm bg-action-secondary-default outline-none focus:shadow-none w-full h-14",value:a,placeholder:r,onChange:s=>o(s.target.value)})]})}function LK({pageIndex:e,getPageCount:t,pageSize:n,setPageSize:r,getCanPreviousPage:i,getCanNextPage:a,paginationOptionList:o,table:s,actualPage:l,setActualPage:u,isMobile:c}){const f=v=>{s.setPageIndex(v),u(v)},p=()=>{s.previousPage(),l!==0&&u(l-1)},h=()=>{s.nextPage(),u(l+1)};return E.jsx(E.Fragment,{children:E.jsxs("div",{className:"grid grid-cols-3 mt-4 mb-3",children:[E.jsx("div",{className:ne(c&&"col-start-2",!c&&"col-end-1"),children:E.jsxs("div",{className:"flex items-center justify-center gap-2",children:[E.jsx("span",{className:"flex items-center gap-1 min-w-max",children:E.jsxs(Me,{variant:"caption",children:[e+1," - ",t," de"]})}),E.jsx("select",{className:"focus:ring-none text-letter-default text-xxs p-0 flex justify-center items-center appearance-none bg-none border-transparent ring-transparent focus:shadow-none focus:outline-none focus:border-none",value:n,onChange:v=>r(Number(v.target.value)),children:o==null?void 0:o.map(v=>E.jsx("option",{value:v,children:v},v))})]})}),E.jsxs("div",{className:"col-start-3 flex justify-end items-center gap-3",children:[E.jsx("button",{className:"flex justify-center items-center",onClick:p,disabled:!i,children:E.jsx(ft,{color:i?"default":"subdued",kind:"page-back"})}),E.jsx("div",{className:"flex flex-row gap-1",children:s.getPageOptions().map(v=>v===0?E.jsxs("div",{className:ne("rounded-full w-5 h-5 flex items-center justify-center",v===l&&"bg-action-secondary-active"),children:[E.jsx("button",{onClick:()=>f(v),children:E.jsxs(Me,{variant:"button",children:[" ",String(v+1)," "]})}),l>2&&E.jsx("p",{className:"ml-2 mr-1",children:"..."})]},v):v!==0&&v<=l+1&&v>=l-1&&v!==s.getPageCount()-1?E.jsx("div",{className:ne("rounded-full w-5 h-5 flex items-center justify-center",v===l&&"bg-action-secondary-active"),children:E.jsx("button",{onClick:()=>f(v),children:E.jsxs(Me,{variant:"button",children:[" ",String(v+1)," "]})})},v):v===s.getPageCount()-1&&E.jsxs("div",{className:ne("rounded-full w-5 h-5 flex items-center justify-center",v===l&&"bg-action-secondary-active"),children:[l<s.getPageCount()-1-2&&E.jsx("p",{className:"ml-1 mr-1",children:"..."}),E.jsx("button",{onClick:()=>f(v),children:E.jsxs(Me,{variant:"button",children:[" ",String(v+1)," "]})})]},v))}),E.jsx("button",{className:"flex justify-center items-center",onClick:h,disabled:!a,children:E.jsx(ft,{color:a?"default":"subdued",kind:"page-front"})})]})]})})}function QK({table:e,sortItem:t,checkBoxSelect:n,titleSortTable:r}){return E.jsx(fn,{as:"div",className:ne(n,"relative inline-block text-left h-14 bg-action-secondary-default"),children:E.jsxs(E.Fragment,{children:[E.jsx(fn.Button,{className:ne(n,"flex flex-row items-center text-center justify-center justify-items-center h-14 px-[18px] pr-8"),children:E.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[E.jsx(ft,{kind:"major-minor",color:"default"}),E.jsx(Me,{variant:"button",className:"whitespace-nowrap",children:r})]})}),E.jsx(eu,{as:x.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-90",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:E.jsx(fn.Items,{className:"absolute z-10 right-0 mt-2 w-[240px] h-auto origin-top-right divide-y divide-border-subdued rounded-sm bg-action-secondary-default shadow-[0px_2px_10px_0px_#0000001A]",children:E.jsx("div",{children:e.getHeaderGroups().map(i=>i.headers.map(a=>t.map(o=>o.idHeader===a.id&&E.jsx(fn.Item,{children:E.jsx(ea,{className:"cursor-pointer h-[36px] pl-4 px-2 flex items-center hover:bg-action-secondary-hovered hover:last:rounded-b-sm hover:first:rounded-t-sm active:bg-action-secondary-pressed",variant:"body",onClick:()=>a.column.toggleSorting(o.asc?!1:o.desc??!1),children:o.title})},a.id))))})})})]})})}function t9({indeterminate:e,...t}){const n=x.useRef(null);return x.useEffect(()=>{typeof e=="boolean"&&(n.current.indeterminate=!t.checked&&e)},[n,e,t.checked]),E.jsx("input",{type:"checkbox",ref:n,className:"h-[18px] w-[18px] rounded-[5px] bg-white border-[1.5px] cursor-pointer border-border-default hover:border-border-hovered",...t})}function GK({searchFilter:e=!1,defaultData:t=[],columns:n=[],placeholder:r="Buscar",hasPagination:i=!1,paginationOptionList:a=[10,20,30,40,50],sortTable:o=!1,sortItem:s,rowItemSelected:l,optionDropdown:u=[{title:"",onClick:()=>""}],stateEmpty:c={title:"No tienes coincidencias",subtitle:"No se ha encontrado ningún elemento que coincida con tu búsqueda"},titleSortTable:f="Ordenar por",classNameContainer:p="",classNameContainerTable:h="",classNameTable:v="",emptyDataTable:d={title:"Lorem ipsum dolor sit amet",description:"Lorem ",img:"box",children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"md:flex md:gap-x-2 hidden",children:[E.jsx(Ra,{variant:"plain-monochrome",children:"Label"}),E.jsx(Ra,{variant:"primary",children:"Label"})]}),E.jsx("div",{className:"md:hidden flex w-full flex-col",children:E.jsx(Ra,{variant:"primary",fullWidth:!0,children:"Button primary"})})]})},valueRow:g,totalRows:A=[],isLoading:C=!1}){const[m]=x.useState(()=>[...t]),[y,b]=x.useState([]),[I,w]=x.useState(""),[S,O]=x.useState([]),[M,P]=x.useState({}),k=rs("(min-width: 768px)"),[N,j]=x.useState(0),D=x.useMemo(()=>n,[n]),G=[HTMLButtonElement,HTMLLabelElement,HTMLInputElement,HTMLSpanElement,HTMLTableRowElement,HTMLLinkElement,HTMLParagraphElement,HTMLSelectElement,SVGElement],U=(Q,_)=>{if(!G.some(H=>Q.target instanceof H))return g&&(g==null?void 0:g(_))},Y=(Q,_,H,V)=>{const F=kK(Q.getValue(_),H);return V({itemRank:F}),F.passed},$=BK({data:m,columns:D,filterFns:{fuzzy:Y},state:{columnFilters:y,globalFilter:I,sorting:S,rowSelection:M},onColumnFiltersChange:b,globalFilterFn:Y,getCoreRowModel:vK(),getFilteredRowModel:CK(),...i&&{getPaginationRowModel:IK()},onSortingChange:O,getSortedRowModel:EK(),onRowSelectionChange:P});return E.jsxs("div",{className:ne("relative overflow-x-auto overflow-y-hidden",p),children:[E.jsxs("div",{className:"flex w-full min-w-min",children:[e?E.jsx("div",{className:ne("flex items-center gap-1 bg-action-secondary-default w-full px-4 py-[18px] h-14",o?"rounded-tl-sm":"rounded-t-sm"),children:E.jsx(VK,{value:I??"",onChange:Q=>w(String(Q)),placeholder:r})}):null,o&&e&&s&&s.length>0?E.jsx(QK,{checkBoxSelect:Object.keys(M).length>0?"":"rounded-tr-sm",sortItem:s,table:$,titleSortTable:f}):null,l&&Object.keys(M).length>0?E.jsx("div",{className:"bg-action-secondary-default rounded-tr-sm flex items-center justify-center p-1 pr-4",onClick:()=>{l(Object.keys(M).map(Q=>$.getRow(String(Q)).original))},children:E.jsx(F6,{options:u})}):null]}),E.jsx("div",{className:ne(h),children:E.jsxs("table",{className:ne("w-full table-auto",v),children:[E.jsx("thead",{className:"bg-surface-neutral-default",children:$.getHeaderGroups().map(Q=>E.jsx("tr",{children:Q.headers.map(_=>E.jsx("th",{className:ne(!e&&"first:rounded-tl-sm last:rounded-tr-sm",_.id==="select"&&"w-4","p-4 h-14"),children:_.id==="select"?E.jsx(t9,{checked:$.getIsAllPageRowsSelected(),indeterminate:$.getIsSomePageRowsSelected(),onChange:$.getToggleAllPageRowsSelectedHandler()}):E.jsx(Me,{variant:"highlight",children:_.isPlaceholder?null:cg(_.column.columnDef.header,_.getContext())})},_.id))},Q.id))}),E.jsxs("tbody",{className:"table--tbody text-center bg-surface-neutral-subdued hover:bg-surface-neutral-hovered active:bg-surface-neutral-active",children:[!C&&A.length>0&&$.getPrePaginationRowModel().rows.length!==0&&E.jsx("tr",{className:"bg-surface-neutral-subdued hover:bg-surface-neutral-hovered active:bg-surface-neutral-active",children:A.map(Q=>E.jsx("td",{className:"p-4 border-t-2",children:E.jsx(Me,{variant:"highlight",children:Q.text})},Q.id))},"totalRows"),!C&&$.getRowModel().rows.map(Q=>E.jsx("tr",{className:"bg-surface-subdued hover:bg-surface-hovered active:bg-surface-active",onClick:_=>U(_,Q.original),children:Q.getVisibleCells().map(_=>E.jsx("td",{className:"p-4 border-t-2",children:cg(_.column.columnDef.cell,_.getContext())},_.id))},Q.id))]}),E.jsx("tfoot",{children:$.getFooterGroups().map(Q=>E.jsx("tr",{children:Q.headers.map(_=>E.jsx("th",{children:_.isPlaceholder?null:cg(_.column.columnDef.footer,_.getContext())},_.id))},Q.id))})]})}),E.jsxs("div",{className:"mt-[-3px] flex flex-col items-center gap-y-3 justify-center text-center border-2 rounded-b-sm border-border-subdued",children:[C&&E.jsx("div",{className:"py-28",children:E.jsx(cu,{size:"lg"})}),I!==""&&!C&&$.getPrePaginationRowModel().rows.length===0?E.jsxs("div",{className:"my-8",children:[E.jsx(ft,{size:"lg",kind:"search",color:"default"}),E.jsx(Ci,{className:"mt-8",variant:"heading",children:c.title}),E.jsx("div",{className:"mt-4 flex flex-col w-96",children:E.jsx(Me,{children:c.subtitle})})]}):$.getRowModel().rows.length===0&&!C&&E.jsx("div",{className:"mt-16 mb-8",children:E.jsx(s5,{className:"border-none",title:d.title,description:d.description,img:d.img,children:d.children})})]}),i?E.jsx(E.Fragment,{children:E.jsx(LK,{isMobile:k,actualPage:N,setActualPage:j,table:$,pageIndex:$.getState().pagination.pageIndex,getPageCount:$.getPageCount(),pageSize:$.getState().pagination.pageSize,setPageSize:Q=>{$.setPageSize(Q)},getCanPreviousPage:$.getCanPreviousPage(),getCanNextPage:$.getCanNextPage(),paginationOptionList:a})}):null]})}function HK({items:e=[],checkedItem:t,onChange:n}){const r=(o,s)=>s!=null&&s.error?"border-action-critical-default":s!=null&&s.isDisabled||s!=null&&s.isLoading?"border-border-disabled":o?"shadow-[0px_0px_0px_1px_#3EADFE]":"border-border-default hover:border-border-hovered",i=(o,s)=>{var l,u;return((l=o==null?void 0:o.id)==null?void 0:l.toLowerCase())===((u=s==null?void 0:s.id)==null?void 0:u.toLowerCase())},a=x.useMemo(()=>e,[e]);return a.length>0?E.jsx(th,{value:t,by:i,onChange:n,className:"space-y-sm",children:a.map(o=>E.jsx(th.Option,{value:o,disabled:(o==null?void 0:o.isDisabled)||!!(o!=null&&o.error),className:({active:s})=>ne("flex min-h-[78px] items-center rounded-sm border bg-white p-sm",!(o!=null&&o.isDisabled)&&"cursor-pointer",(o==null?void 0:o.isLoading)&&"cursor-default",r(s,o)),children:({checked:s})=>E.jsxs(E.Fragment,{children:[(o==null?void 0:o.isLoading)&&E.jsx("div",{className:"flex justify-center w-full",children:E.jsx(cu,{size:"md"})}),o.isLoading?null:E.jsxs("div",{className:"flex w-full justify-between flex-wrap",children:[E.jsxs("div",{className:ne("flex items-center",o!=null&&o.img||o!=null&&o.logo||o!=null&&o.hasRadio?"gap-x-sm":""),children:[(o==null?void 0:o.hasRadio)&&E.jsx(Th,{id:o==null?void 0:o.id,name:o==null?void 0:o.id,value:o==null?void 0:o.id,checked:s,isDisabled:o==null?void 0:o.isDisabled}),o!=null&&o.img?o==null?void 0:o.img:null,o!=null&&o.logo?E.jsx(ua,{kind:o.logo},o.logo):null,E.jsxs("header",{children:[E.jsx(Ci,{variant:"heading",color:o!=null&&o.isDisabled?"disabled":"default",children:o==null?void 0:o.title}),E.jsxs("div",{className:"flex gap-x-[2px] flex-wrap",children:[o!=null&&o.subtitle?E.jsx(Me,{variant:"body",color:o!=null&&o.isDisabled?"disabled":"subdued",children:(o==null?void 0:o.subtitle)??""}):null,o!=null&&o.description?E.jsx(Me,{variant:"highlight",color:o!=null&&o.isDisabled?"disabled":"subdued",children:(o==null?void 0:o.description)??""}):null]})]})]}),(o==null?void 0:o.state)&&E.jsx(Me,{variant:"caption",color:o!=null&&o.isDisabled?"disabled":"subdued",children:o==null?void 0:o.state})]})]})},o==null?void 0:o.id))}):E.jsx(E.Fragment,{})}function zK({title:e,description:t,size:n,children:r,button:i}){return E.jsx("div",{className:ne("bg-gray-200 w-full mt-2 rounded-sm py-2 px-4",n==="md"&&"py-6 px-11",n==="sm"&&"py-2 px-4"),children:E.jsxs("div",{className:"p-6",children:[E.jsxs("div",{className:"flex justify-between",children:[E.jsx("div",{className:"justify-start mt-2",children:E.jsx(Me,{variant:"highlight",children:e})}),i&&E.jsx("div",{className:"justify-end",children:E.jsxs(Ra,{variant:"plain",onClick:i.action,children:[" ",i==null?void 0:i.title," "]})})]}),t&&E.jsx("div",{className:"mt-4 mb-6",children:E.jsx(Me,{variant:"body",color:"subdued",children:t})}),r]})})}function ZK({description:e,date:t,dimension:n,hour:r,badge:i={variant:"neutral"},state:a="default",size:o="md",variant:s="default",dropdown:l={isActive:!1,title:E.jsx(E.Fragment,{})},children:u}){return E.jsxs("div",{className:ne("flex flex-col rounded-xl max-w-md shadow-[0px_3px_22px_0px_#34343433]",a==="active"&&"border border-solid border-focused-default",o==="md"&&"py-6 px-11",o==="sm"&&"py-2 px-4",n==="xl"&&"w-[447px] h-[126px]",n==="lg"&&"w-[447px] h-[116px]",n==="md"&&"w-[391px] h-[84px]",n==="sm"&&"w-[391px] max-h-[173px]",s==="critical"?"bg-surface-critical-subdued":"bg-surface-subdued"),children:[E.jsxs("div",{className:"flex justify-between",children:[E.jsx(Sg,{variant:i.variant,state:i.state,children:i.title}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx(Me,{variant:"body",color:a==="active"?"default":"subdued",children:t}),E.jsx(Me,{variant:"body",color:a==="active"?"default":"subdued",children:r})]})]}),e?E.jsx(Me,{variant:"body",color:a==="active"?"default":"subdued",className:"mt-2",children:e}):null,u?E.jsx(E.Fragment,{children:u}):null,l.isActive&&E.jsx("div",{className:"mt-2",children:E.jsx(Ga,{children:({open:c})=>E.jsxs(E.Fragment,{children:[E.jsxs(Ga.Button,{className:"flex justify-between w-full",children:[E.jsx(Me,{variant:"body",color:"subdued",children:l.title}),E.jsx(ft,{kind:c?"up":"down",color:"active"})]}),E.jsx(Ga.Panel,{className:"mt-2",children:typeof l.children=="object"?E.jsx(E.Fragment,{children:l.children}):l.description?E.jsx(Me,{variant:"body",color:"subdued",children:l.description}):null})]})})})]})}function WK({children:e,isSmall:t=!1,onClick:n,className:r,...i}){return rs("(min-width: 768px)")?E.jsxs("nav",{className:ne("hidden lg:block lg:h-full lg:bg-background-default lg:py-sm lg:shadow-[inset_-1px_0px_0px_#C2C2C2]",r,t?"lg:w-[67px]":"lg:min-w-[240px] lg:w-[240px] lg:pr-xs"),...i,children:[E.jsxs("div",{className:ne("mb-xl flex items-center",t?"justify-center":"justify-between px-sm"),children:[E.jsx(ua,{kind:"brand-sm",className:ne("w-[69px]",t&&"hidden")}),E.jsx(ft,{kind:"menu",color:"subdued",cursor:"pointer",size:"sm",onClick:n})]}),E.jsx("div",{className:"flex flex-col space-y-sm",children:e})]}):E.jsx(E.Fragment,{})}function R1({children:e,className:t,...n}){return E.jsx("div",{className:ne(t,"relative flex h-screen p-0"),...n,children:e})}R1.Header=function({children:t}){return E.jsx(E.Fragment,{children:t})},R1.Menu=function({children:t}){return E.jsx(E.Fragment,{children:t})},R1.Main=function({children:t,className:n,...r}){return E.jsx("main",{className:ne(n,"relative top-[64px] h-[calc(100%-64px)] w-full py-xl lg:px-xxl"),...r,children:t})};function fg({children:e,className:t,...n}){return E.jsx("div",{className:ne(t),...n,children:e})}fg.Header=function({children:t,className:n,...r}){return E.jsx("div",{className:ne(n),...r,children:t})},fg.Main=function({children:t,className:n,...r}){return E.jsx("div",{className:ne(n),...r,children:t})};const Rl=48,_K=({color:e="currentColor",direction:t="left",distance:n="md",duration:r=.4,easing:i="cubic-bezier(0, 0, 0, 1)",hideOutline:a=!0,label:o,lines:s=3,onToggle:l,render:u,rounded:c=!1,size:f=32,toggle:p,toggled:h})=>{const[v,d]=x.useState(!1),g=Math.max(12,Math.min(Rl,f)),A=Math.round((Rl-g)/2),C=g/12,m=Math.round(C),b=g/(s*((n==="lg"?.25:n==="sm"?.75:.5)+(s===3?1:1.25))),I=Math.round(b),w=m*s+I*(s-1),S=Math.round((Rl-w)/2),O=s===3?n==="lg"?4.0425:n==="sm"?5.1625:4.6325:n==="lg"?6.7875:n==="sm"?8.4875:7.6675,M=(C-m+(b-I))/(s===3?1:2),P=parseFloat((g/O-M/(4/3)).toFixed(2)),k=Math.max(0,r),N={cursor:"pointer",height:`${Rl}px`,position:"relative",transition:`${k}s ${i}`,userSelect:"none",width:`${Rl}px`},j={background:e,height:`${m}px`,left:`${A}px`,position:"absolute"};a&&(N.outline="none"),c&&(j.borderRadius="9em");const D=p||d,G=h!==void 0?h:v;return u({barHeight:m,barStyles:j,burgerStyles:N,easing:i,handler:()=>{D(!G),typeof l=="function"&&l(!G)},isLeft:t==="left",isToggled:G,label:o,margin:I,move:P,time:k,topOffset:S,width:g})};function dg(){return dg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dg.apply(this,arguments)}const XK=e=>x.createElement(_K,dg({},e,{render:t=>x.createElement("div",{className:"hamburger-react","aria-label":t.label,"aria-expanded":t.isToggled,onClick:t.handler,onKeyUp:n=>n.key==="Enter"&&t.handler(),role:"button",style:{...t.burgerStyles,transform:`${t.isToggled?`rotate(${90*(t.isLeft?-1:1)}deg)`:"none"}`},tabIndex:0},x.createElement("div",{style:{...t.barStyles,width:`${t.width}px`,top:`${t.topOffset}px`,transition:`${t.time}s ${t.easing}`,transform:`${t.isToggled?`rotate(${45*(t.isLeft?-1:1)}deg) translate(${t.move*(t.isLeft?-1:1)}px, ${t.move}px)`:"none"}`}}),x.createElement("div",{style:{...t.barStyles,width:`${t.width}px`,top:`${t.topOffset+t.barHeight+t.margin}px`,transition:`${t.time}s ${t.easing}`,transform:`${t.isToggled?"scaleX(0)":"none"}`}}),x.createElement("div",{style:{...t.barStyles,width:`${t.width}px`,top:`${t.topOffset+t.barHeight*2+t.margin*2}px`,transition:`${t.time}s ${t.easing}`,transform:`${t.isToggled?`rotate(${45*(t.isLeft?1:-1)}deg) translate(${t.move*(t.isLeft?-1:1)}px, ${t.move*-1}px)`:"none"}`}}))}));function n9({children:e,className:t,title:n,...r}){const[i,a]=x.useState(!1);return E.jsxs("div",{className:"h-full",children:[E.jsxs("div",{className:"flex mb-4 w-64",children:[E.jsx("div",{className:"lg:hidden",children:E.jsx(XK,{size:20,toggled:i,toggle:a})}),E.jsx(Ra,{variant:"plain-monochrome",children:E.jsx(ft,{kind:"thin-back"})}),E.jsxs("div",{className:"font-inter flex items-center justify-center w-auto gap-4",children:[E.jsx(Ql,{size:"md"}),E.jsx("div",{className:"text-gray-700 text-[20px]",children:n})]})]}),!i&&E.jsx("div",{className:ne(t,"relative flex h-screen p-0"),...r,children:e})]})}n9.Main=function({children:t,className:n,...r}){return E.jsx("main",{className:ne(n,"relative top-[64px] h-[calc(100%-64px)] w-full py-xl lg:px-xxl"),...r,children:t})};const Ra=x.forwardRef((e,t)=>{const{hasFill:n=!0,variant:r="primary",size:i="md",fullWidth:a=!1,isLoading:o=!1,isDisabled:s=!1,align:l="center",onlyOneIcon:u,type:c="button",children:f,onClick:p,className:h}=e,{getClass:v}=l9({hasFill:n,variant:r,isLoading:o,size:i,fullWidth:a,align:l,onlyOneIcon:u,className:h}),d=()=>typeof f=="string"?E.jsx("span",{className:o?"invisible":"",children:f}):f;return E.jsxs("button",{ref:t,type:c,className:v(),disabled:s||o,onClick:p,children:[o&&E.jsx("span",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center",children:E.jsx(cu,{size:"xs"})}),d()]})});Qe.AsyncCreatableSelect=ew,Qe.AsyncSelect=QI,Qe.Avatar=Ql,Qe.Badge=Sg,Qe.Button=Ra,Qe.CardHistory=ZK,Qe.CardSelect=HK,Qe.CardSimple=zK,Qe.CheckBoxTable=t9,Qe.Checkbox=Mf,Qe.DateInputPicker=Zq,Qe.DropdownButton=F6,Qe.DropdownFilterMultiple=Xq,Qe.DropdownSearchMultiple=Uq,Qe.DropdownSummary=Wq,Qe.DropdownUser=_q,Qe.EmptyState=s5,Qe.Field=E6,Qe.Flag=Nq,Qe.Graphic=hq,Qe.Header=ow,Qe.Heading=Ci,Qe.Icon=ft,Qe.InlineError=ud,Qe.LayoutMain=R1,Qe.LayoutSecondMain=n9,Qe.LayoutShipment=fg,Qe.Link=f9,Qe.Logo=ua,Qe.Modal=nw,Qe.Navigation=WK,Qe.NavigationMovil=sw,Qe.Radio=Th,Qe.Select=DI,Qe.SelectButton=HI,Qe.SelectCountry=UI,Qe.Spinner=cu,Qe.Summary=I1,Qe.Switch=mb,Qe.Tab=tw,Qe.TabNav=aw,Qe.Table=GK,Qe.Text=Me,Qe.TextRef=ea,Qe.Tooltip=Pf,Qe.Tracker=tC,Object.defineProperty(Qe,Symbol.toStringTag,{value:"Module"})});
|
|
238
|
+
*/const _n={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function kK(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:_n.MATCHES,!n.accessors){const o=K6(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=DK(e,n.accessors),a={rankedValue:e,rank:_n.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const s=i[o];let l=K6(s.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:f=n.threshold}=s.attributes;l<u&&l>=_n.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=f&&l>a.rank&&(a.rank=l,a.passed=!0,a.accessorIndex=o,a.accessorThreshold=f,a.rankedValue=s.itemValue)}return a}function K6(e,t,n){return e=$6(e,n),t=$6(t,n),t.length>e.length?_n.NO_MATCH:e===t?_n.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?_n.EQUAL:e.startsWith(t)?_n.STARTS_WITH:e.includes(` ${t}`)?_n.WORD_STARTS_WITH:e.includes(t)?_n.CONTAINS:t.length===1?_n.NO_MATCH:TK(e).includes(t)?_n.ACRONYM:NK(e,t))}function TK(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(a=>{t+=a.substr(0,1)})}),t}function NK(e,t){let n=0,r=0;function i(l,u,c){for(let f=c,p=u.length;f<p;f++)if(u[f]===l)return n+=1,f+1;return-1}function a(l){const u=1/l,c=n/t.length;return _n.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return _n.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return _n.NO_MATCH}const s=r-o;return a(s)}function $6(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=RK(e)),e}function jK(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function DK(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const a=t[r],o=FK(a),s=jK(e,a);for(let l=0,u=s.length;l<u;l++)n.push({itemValue:s[l],attributes:o})}return n}const e9={maxRanking:1/0,minRanking:-1/0};function FK(e){return typeof e=="function"?e9:{...e9,...e}}const x$="";function VK({value:e,onChange:t,debounce:n=500,placeholder:r,...i}){const[a,o]=x.useState(e);return x.useEffect(()=>{o(e)},[e]),x.useEffect(()=>{const s=setTimeout(()=>{t(a)},n);return()=>clearTimeout(s)},[n,t,a]),E.jsxs(E.Fragment,{children:[E.jsx(ft,{className:"m-2",color:"subdued",size:"sm",kind:"search"}),E.jsx("input",{...i,className:"rounded-tr-sm bg-action-secondary-default outline-none focus:shadow-none w-full h-14",value:a,placeholder:r,onChange:s=>o(s.target.value)})]})}function LK({pageIndex:e,getPageCount:t,pageSize:n,setPageSize:r,getCanPreviousPage:i,getCanNextPage:a,paginationOptionList:o,table:s,actualPage:l,setActualPage:u,isMobile:c}){const f=v=>{s.setPageIndex(v),u(v)},p=()=>{s.previousPage(),l!==0&&u(l-1)},h=()=>{s.nextPage(),u(l+1)};return E.jsx(E.Fragment,{children:E.jsxs("div",{className:"grid grid-cols-3 mt-4 mb-3",children:[E.jsx("div",{className:ne(c&&"col-start-2",!c&&"col-end-1"),children:E.jsxs("div",{className:"flex items-center justify-center gap-2",children:[E.jsx("span",{className:"flex items-center gap-1 min-w-max",children:E.jsxs(Me,{variant:"caption",children:[e+1," - ",t," de"]})}),E.jsx("select",{className:"focus:ring-none text-letter-default text-xxs p-0 flex justify-center items-center appearance-none bg-none border-transparent ring-transparent focus:shadow-none focus:outline-none focus:border-none",value:n,onChange:v=>r(Number(v.target.value)),children:o==null?void 0:o.map(v=>E.jsx("option",{value:v,children:v},v))})]})}),E.jsxs("div",{className:"col-start-3 flex justify-end items-center gap-3",children:[E.jsx("button",{className:"flex justify-center items-center",onClick:p,disabled:!i,children:E.jsx(ft,{color:i?"default":"subdued",kind:"page-back"})}),E.jsx("div",{className:"flex flex-row gap-1",children:s.getPageOptions().map(v=>v===0?E.jsxs("div",{className:ne("rounded-full w-5 h-5 flex items-center justify-center",v===l&&"bg-action-secondary-active"),children:[E.jsx("button",{onClick:()=>f(v),children:E.jsxs(Me,{variant:"button",children:[" ",String(v+1)," "]})}),l>2&&E.jsx("p",{className:"ml-2 mr-1",children:"..."})]},v):v!==0&&v<=l+1&&v>=l-1&&v!==s.getPageCount()-1?E.jsx("div",{className:ne("rounded-full w-5 h-5 flex items-center justify-center",v===l&&"bg-action-secondary-active"),children:E.jsx("button",{onClick:()=>f(v),children:E.jsxs(Me,{variant:"button",children:[" ",String(v+1)," "]})})},v):v===s.getPageCount()-1&&E.jsxs("div",{className:ne("rounded-full w-5 h-5 flex items-center justify-center",v===l&&"bg-action-secondary-active"),children:[l<s.getPageCount()-1-2&&E.jsx("p",{className:"ml-1 mr-1",children:"..."}),E.jsx("button",{onClick:()=>f(v),children:E.jsxs(Me,{variant:"button",children:[" ",String(v+1)," "]})})]},v))}),E.jsx("button",{className:"flex justify-center items-center",onClick:h,disabled:!a,children:E.jsx(ft,{color:a?"default":"subdued",kind:"page-front"})})]})]})})}function QK({table:e,sortItem:t,checkBoxSelect:n,titleSortTable:r}){return E.jsx(fn,{as:"div",className:ne(n,"relative inline-block text-left h-14 bg-action-secondary-default"),children:E.jsxs(E.Fragment,{children:[E.jsx(fn.Button,{className:ne(n,"flex flex-row items-center text-center justify-center justify-items-center h-14 px-[18px] pr-8"),children:E.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[E.jsx(ft,{kind:"major-minor",color:"default"}),E.jsx(Me,{variant:"button",className:"whitespace-nowrap",children:r})]})}),E.jsx(eu,{as:x.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-90",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:E.jsx(fn.Items,{className:"absolute z-10 right-0 mt-2 w-[240px] h-auto origin-top-right divide-y divide-border-subdued rounded-sm bg-action-secondary-default shadow-[0px_2px_10px_0px_#0000001A]",children:E.jsx("div",{children:e.getHeaderGroups().map(i=>i.headers.map(a=>t.map(o=>o.idHeader===a.id&&E.jsx(fn.Item,{children:E.jsx(ea,{className:"cursor-pointer h-[36px] pl-4 px-2 flex items-center hover:bg-action-secondary-hovered hover:last:rounded-b-sm hover:first:rounded-t-sm active:bg-action-secondary-pressed",variant:"body",onClick:()=>a.column.toggleSorting(o.asc?!1:o.desc??!1),children:o.title})},a.id))))})})})]})})}function t9({indeterminate:e,...t}){const n=x.useRef(null);return x.useEffect(()=>{typeof e=="boolean"&&(n.current.indeterminate=!t.checked&&e)},[n,e,t.checked]),E.jsx("input",{type:"checkbox",ref:n,className:"h-[18px] w-[18px] rounded-[5px] bg-white border-[1.5px] cursor-pointer border-border-default hover:border-border-hovered",...t})}function GK({searchFilter:e=!1,defaultData:t=[],columns:n=[],placeholder:r="Buscar",hasPagination:i=!1,paginationOptionList:a=[10,20,30,40,50],sortTable:o=!1,sortItem:s,rowItemSelected:l,optionDropdown:u=[{title:"",onClick:()=>""}],stateEmpty:c={title:"No tienes coincidencias",subtitle:"No se ha encontrado ningún elemento que coincida con tu búsqueda"},titleSortTable:f="Ordenar por",classNameContainer:p="",classNameContainerTable:h="",classNameTable:v="",emptyDataTable:d={title:"Lorem ipsum dolor sit amet",description:"Lorem ",img:"box",children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"md:flex md:gap-x-2 hidden",children:[E.jsx(Ra,{variant:"plain-monochrome",children:"Label"}),E.jsx(Ra,{variant:"primary",children:"Label"})]}),E.jsx("div",{className:"md:hidden flex w-full flex-col",children:E.jsx(Ra,{variant:"primary",fullWidth:!0,children:"Button primary"})})]})},valueRow:g,totalRows:A=[],isLoading:C=!1}){const[m]=x.useState(()=>[...t]),[y,b]=x.useState([]),[I,w]=x.useState(""),[S,O]=x.useState([]),[M,P]=x.useState({}),k=rs("(min-width: 768px)"),[N,j]=x.useState(0),D=x.useMemo(()=>n,[n]),G=[HTMLButtonElement,HTMLLabelElement,HTMLInputElement,HTMLSpanElement,HTMLTableRowElement,HTMLLinkElement,HTMLParagraphElement,HTMLSelectElement,SVGElement],U=(Q,_)=>{if(!G.some(H=>Q.target instanceof H))return g&&(g==null?void 0:g(_))},Y=(Q,_,H,V)=>{const F=kK(Q.getValue(_),H);return V({itemRank:F}),F.passed},$=BK({data:m,columns:D,filterFns:{fuzzy:Y},state:{columnFilters:y,globalFilter:I,sorting:S,rowSelection:M},onColumnFiltersChange:b,globalFilterFn:Y,getCoreRowModel:vK(),getFilteredRowModel:CK(),...i&&{getPaginationRowModel:IK()},onSortingChange:O,getSortedRowModel:EK(),onRowSelectionChange:P});return E.jsxs("div",{className:ne("relative overflow-x-auto overflow-y-hidden",p),children:[E.jsxs("div",{className:"flex w-full min-w-min",children:[e?E.jsx("div",{className:ne("flex items-center gap-1 bg-action-secondary-default w-full px-4 py-[18px] h-14",o?"rounded-tl-sm":"rounded-t-sm"),children:E.jsx(VK,{value:I??"",onChange:Q=>w(String(Q)),placeholder:r})}):null,o&&e&&s&&s.length>0?E.jsx(QK,{checkBoxSelect:Object.keys(M).length>0?"":"rounded-tr-sm",sortItem:s,table:$,titleSortTable:f}):null,l&&Object.keys(M).length>0?E.jsx("div",{className:"bg-action-secondary-default rounded-tr-sm flex items-center justify-center p-1 pr-4",onClick:()=>{l(Object.keys(M).map(Q=>$.getRow(String(Q)).original))},children:E.jsx(F6,{options:u})}):null]}),E.jsx("div",{className:ne(h),children:E.jsxs("table",{className:ne("w-full table-auto",v),children:[E.jsx("thead",{className:"bg-surface-neutral-default",children:$.getHeaderGroups().map(Q=>E.jsx("tr",{children:Q.headers.map(_=>E.jsx("th",{className:ne(!e&&"first:rounded-tl-sm last:rounded-tr-sm",_.id==="select"&&"w-4","p-4 h-14"),children:_.id==="select"?E.jsx(t9,{checked:$.getIsAllPageRowsSelected(),indeterminate:$.getIsSomePageRowsSelected(),onChange:$.getToggleAllPageRowsSelectedHandler()}):E.jsx(Me,{variant:"highlight",children:_.isPlaceholder?null:cg(_.column.columnDef.header,_.getContext())})},_.id))},Q.id))}),E.jsxs("tbody",{className:"table--tbody text-center bg-surface-neutral-subdued hover:bg-surface-neutral-hovered active:bg-surface-neutral-active",children:[!C&&A.length>0&&$.getPrePaginationRowModel().rows.length!==0&&E.jsx("tr",{className:"bg-surface-neutral-subdued hover:bg-surface-neutral-hovered active:bg-surface-neutral-active",children:A.map(Q=>E.jsx("td",{className:"p-4 border-t-2",children:E.jsx(Me,{variant:"highlight",children:Q.text})},Q.id))},"totalRows"),!C&&$.getRowModel().rows.map(Q=>E.jsx("tr",{className:"bg-surface-subdued hover:bg-surface-hovered active:bg-surface-active",onClick:_=>U(_,Q.original),children:Q.getVisibleCells().map(_=>E.jsx("td",{className:"p-4 border-t-2",children:cg(_.column.columnDef.cell,_.getContext())},_.id))},Q.id))]}),E.jsx("tfoot",{children:$.getFooterGroups().map(Q=>E.jsx("tr",{children:Q.headers.map(_=>E.jsx("th",{children:_.isPlaceholder?null:cg(_.column.columnDef.footer,_.getContext())},_.id))},Q.id))})]})}),E.jsxs("div",{className:"mt-[-3px] flex flex-col items-center gap-y-3 justify-center text-center border-2 rounded-b-sm border-border-subdued",children:[C&&E.jsx("div",{className:"py-28",children:E.jsx(cu,{size:"lg"})}),I!==""&&!C&&$.getPrePaginationRowModel().rows.length===0?E.jsxs("div",{className:"my-8",children:[E.jsx(ft,{size:"lg",kind:"search",color:"default"}),E.jsx(Ci,{className:"mt-8",variant:"heading",children:c.title}),E.jsx("div",{className:"mt-4 flex flex-col w-96",children:E.jsx(Me,{children:c.subtitle})})]}):$.getRowModel().rows.length===0&&!C&&E.jsx("div",{className:"mt-16 mb-8",children:E.jsx(s5,{className:"border-none",title:d.title,description:d.description,img:d.img,children:d.children})})]}),i?E.jsx(E.Fragment,{children:E.jsx(LK,{isMobile:k,actualPage:N,setActualPage:j,table:$,pageIndex:$.getState().pagination.pageIndex,getPageCount:$.getPageCount(),pageSize:$.getState().pagination.pageSize,setPageSize:Q=>{$.setPageSize(Q)},getCanPreviousPage:$.getCanPreviousPage(),getCanNextPage:$.getCanNextPage(),paginationOptionList:a})}):null]})}function HK({items:e=[],checkedItem:t,onChange:n}){const r=(o,s)=>s!=null&&s.error?"border-action-critical-default":s!=null&&s.isDisabled||s!=null&&s.isLoading?"border-border-disabled":o?"shadow-[0px_0px_0px_1px_#3EADFE]":"border-border-default hover:border-border-hovered",i=(o,s)=>{var l,u;return((l=o==null?void 0:o.id)==null?void 0:l.toLowerCase())===((u=s==null?void 0:s.id)==null?void 0:u.toLowerCase())},a=x.useMemo(()=>e,[e]);return a.length>0?E.jsx(th,{value:t,by:i,onChange:n,className:"space-y-sm",children:a.map(o=>E.jsx(th.Option,{value:o,disabled:(o==null?void 0:o.isDisabled)||!!(o!=null&&o.error),className:({active:s})=>ne("flex min-h-[78px] items-center rounded-sm border bg-white p-sm",!(o!=null&&o.isDisabled)&&"cursor-pointer",(o==null?void 0:o.isLoading)&&"cursor-default",r(s,o)),children:({checked:s})=>E.jsxs(E.Fragment,{children:[(o==null?void 0:o.isLoading)&&E.jsx("div",{className:"flex justify-center w-full",children:E.jsx(cu,{size:"md"})}),o.isLoading?null:E.jsxs("div",{className:"flex w-full justify-between flex-wrap",children:[E.jsxs("div",{className:ne("flex items-center",o!=null&&o.img||o!=null&&o.logo||o!=null&&o.hasRadio?"gap-x-sm":""),children:[(o==null?void 0:o.hasRadio)&&E.jsx(Th,{id:o==null?void 0:o.id,name:o==null?void 0:o.id,value:o==null?void 0:o.id,checked:s,isDisabled:o==null?void 0:o.isDisabled}),o!=null&&o.img?o==null?void 0:o.img:null,o!=null&&o.logo?E.jsx(ua,{kind:o.logo},o.logo):null,E.jsxs("header",{children:[E.jsx(Ci,{variant:"heading",color:o!=null&&o.isDisabled?"disabled":"default",children:o==null?void 0:o.title}),E.jsxs("div",{className:"flex gap-x-[2px] flex-wrap",children:[o!=null&&o.subtitle?E.jsx(Me,{variant:"body",color:o!=null&&o.isDisabled?"disabled":"subdued",children:(o==null?void 0:o.subtitle)??""}):null,o!=null&&o.description?E.jsx(Me,{variant:"highlight",color:o!=null&&o.isDisabled?"disabled":"subdued",children:(o==null?void 0:o.description)??""}):null]})]})]}),(o==null?void 0:o.state)&&E.jsx(Me,{variant:"caption",color:o!=null&&o.isDisabled?"disabled":"subdued",children:o==null?void 0:o.state})]})]})},o==null?void 0:o.id))}):E.jsx(E.Fragment,{})}function zK({title:e,description:t,size:n,children:r,button:i}){return E.jsx("div",{className:ne("bg-gray-200 w-full mt-2 rounded-sm py-2 px-4",n==="md"&&"py-6 px-11",n==="sm"&&"py-2 px-4"),children:E.jsxs("div",{className:"p-6",children:[E.jsxs("div",{className:"flex justify-between",children:[E.jsx("div",{className:"justify-start mt-2",children:E.jsx(Me,{variant:"highlight",children:e})}),i&&E.jsx("div",{className:"justify-end",children:E.jsxs(Ra,{variant:"plain",onClick:i.action,children:[" ",i==null?void 0:i.title," "]})})]}),t&&E.jsx("div",{className:"mt-4 mb-6",children:E.jsx(Me,{variant:"body",color:"subdued",children:t})}),r]})})}function ZK({description:e,date:t,dimension:n,hour:r,badge:i={variant:"neutral"},state:a="default",size:o="md",customWidth:s,variant:l="default",dropdown:u={isActive:!1,title:E.jsx(E.Fragment,{})},children:c}){return E.jsxs("div",{className:ne("flex flex-col rounded-xl shadow-[0px_3px_22px_0px_#34343433]",a==="active"&&"border border-solid border-focused-default",o==="md"&&"py-6 px-11",o==="sm"&&"py-2 px-4",s??"max-w-md",n==="xl"&&"w-[447px] h-[126px]",n==="lg"&&"w-[447px] h-[116px]",n==="md"&&"w-[391px] h-[84px]",n==="sm"&&"w-[391px] max-h-[173px]",l==="critical"?"bg-surface-critical-subdued":"bg-surface-subdued"),children:[E.jsxs("div",{className:"flex justify-between",children:[E.jsx(Sg,{variant:i.variant,state:i.state,children:i.title}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx(Me,{variant:"body",color:a==="active"?"default":"subdued",children:t}),E.jsx(Me,{variant:"body",color:a==="active"?"default":"subdued",children:r})]})]}),e?E.jsx(Me,{variant:"body",color:a==="active"?"default":"subdued",className:"mt-2",children:e}):null,c?E.jsx(E.Fragment,{children:c}):null,u.isActive&&E.jsx("div",{className:"mt-2",children:E.jsx(Ga,{children:({open:f})=>E.jsxs(E.Fragment,{children:[E.jsxs(Ga.Button,{className:"flex justify-between w-full",children:[E.jsx(Me,{variant:"body",color:"subdued",children:u.title}),E.jsx(ft,{kind:f?"up":"down",color:"active"})]}),E.jsx(Ga.Panel,{className:"mt-2",children:typeof u.children=="object"?E.jsx(E.Fragment,{children:u.children}):u.description?E.jsx(Me,{variant:"body",color:"subdued",children:u.description}):null})]})})})]})}function WK({children:e,isSmall:t=!1,onClick:n,className:r,...i}){return rs("(min-width: 768px)")?E.jsxs("nav",{className:ne("hidden lg:block lg:h-full lg:bg-background-default lg:py-sm lg:shadow-[inset_-1px_0px_0px_#C2C2C2]",r,t?"lg:w-[67px]":"lg:min-w-[240px] lg:w-[240px] lg:pr-xs"),...i,children:[E.jsxs("div",{className:ne("mb-xl flex items-center",t?"justify-center":"justify-between px-sm"),children:[E.jsx(ua,{kind:"brand-sm",className:ne("w-[69px]",t&&"hidden")}),E.jsx(ft,{kind:"menu",color:"subdued",cursor:"pointer",size:"sm",onClick:n})]}),E.jsx("div",{className:"flex flex-col space-y-sm",children:e})]}):E.jsx(E.Fragment,{})}function R1({children:e,className:t,...n}){return E.jsx("div",{className:ne(t,"relative flex h-screen p-0"),...n,children:e})}R1.Header=function({children:t}){return E.jsx(E.Fragment,{children:t})},R1.Menu=function({children:t}){return E.jsx(E.Fragment,{children:t})},R1.Main=function({children:t,className:n,...r}){return E.jsx("main",{className:ne(n,"relative top-[64px] h-[calc(100%-64px)] w-full py-xl lg:px-xxl"),...r,children:t})};function fg({children:e,className:t,...n}){return E.jsx("div",{className:ne(t),...n,children:e})}fg.Header=function({children:t,className:n,...r}){return E.jsx("div",{className:ne(n),...r,children:t})},fg.Main=function({children:t,className:n,...r}){return E.jsx("div",{className:ne(n),...r,children:t})};const Rl=48,_K=({color:e="currentColor",direction:t="left",distance:n="md",duration:r=.4,easing:i="cubic-bezier(0, 0, 0, 1)",hideOutline:a=!0,label:o,lines:s=3,onToggle:l,render:u,rounded:c=!1,size:f=32,toggle:p,toggled:h})=>{const[v,d]=x.useState(!1),g=Math.max(12,Math.min(Rl,f)),A=Math.round((Rl-g)/2),C=g/12,m=Math.round(C),b=g/(s*((n==="lg"?.25:n==="sm"?.75:.5)+(s===3?1:1.25))),I=Math.round(b),w=m*s+I*(s-1),S=Math.round((Rl-w)/2),O=s===3?n==="lg"?4.0425:n==="sm"?5.1625:4.6325:n==="lg"?6.7875:n==="sm"?8.4875:7.6675,M=(C-m+(b-I))/(s===3?1:2),P=parseFloat((g/O-M/(4/3)).toFixed(2)),k=Math.max(0,r),N={cursor:"pointer",height:`${Rl}px`,position:"relative",transition:`${k}s ${i}`,userSelect:"none",width:`${Rl}px`},j={background:e,height:`${m}px`,left:`${A}px`,position:"absolute"};a&&(N.outline="none"),c&&(j.borderRadius="9em");const D=p||d,G=h!==void 0?h:v;return u({barHeight:m,barStyles:j,burgerStyles:N,easing:i,handler:()=>{D(!G),typeof l=="function"&&l(!G)},isLeft:t==="left",isToggled:G,label:o,margin:I,move:P,time:k,topOffset:S,width:g})};function dg(){return dg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dg.apply(this,arguments)}const XK=e=>x.createElement(_K,dg({},e,{render:t=>x.createElement("div",{className:"hamburger-react","aria-label":t.label,"aria-expanded":t.isToggled,onClick:t.handler,onKeyUp:n=>n.key==="Enter"&&t.handler(),role:"button",style:{...t.burgerStyles,transform:`${t.isToggled?`rotate(${90*(t.isLeft?-1:1)}deg)`:"none"}`},tabIndex:0},x.createElement("div",{style:{...t.barStyles,width:`${t.width}px`,top:`${t.topOffset}px`,transition:`${t.time}s ${t.easing}`,transform:`${t.isToggled?`rotate(${45*(t.isLeft?-1:1)}deg) translate(${t.move*(t.isLeft?-1:1)}px, ${t.move}px)`:"none"}`}}),x.createElement("div",{style:{...t.barStyles,width:`${t.width}px`,top:`${t.topOffset+t.barHeight+t.margin}px`,transition:`${t.time}s ${t.easing}`,transform:`${t.isToggled?"scaleX(0)":"none"}`}}),x.createElement("div",{style:{...t.barStyles,width:`${t.width}px`,top:`${t.topOffset+t.barHeight*2+t.margin*2}px`,transition:`${t.time}s ${t.easing}`,transform:`${t.isToggled?`rotate(${45*(t.isLeft?1:-1)}deg) translate(${t.move*(t.isLeft?-1:1)}px, ${t.move*-1}px)`:"none"}`}}))}));function n9({children:e,className:t,title:n,...r}){const[i,a]=x.useState(!1);return E.jsxs("div",{className:"h-full",children:[E.jsxs("div",{className:"flex mb-4 w-64",children:[E.jsx("div",{className:"lg:hidden",children:E.jsx(XK,{size:20,toggled:i,toggle:a})}),E.jsx(Ra,{variant:"plain-monochrome",children:E.jsx(ft,{kind:"thin-back"})}),E.jsxs("div",{className:"font-inter flex items-center justify-center w-auto gap-4",children:[E.jsx(Ql,{size:"md"}),E.jsx("div",{className:"text-gray-700 text-[20px]",children:n})]})]}),!i&&E.jsx("div",{className:ne(t,"relative flex h-screen p-0"),...r,children:e})]})}n9.Main=function({children:t,className:n,...r}){return E.jsx("main",{className:ne(n,"relative top-[64px] h-[calc(100%-64px)] w-full py-xl lg:px-xxl"),...r,children:t})};const Ra=x.forwardRef((e,t)=>{const{hasFill:n=!0,variant:r="primary",size:i="md",fullWidth:a=!1,isLoading:o=!1,isDisabled:s=!1,align:l="center",onlyOneIcon:u,type:c="button",children:f,onClick:p,className:h}=e,{getClass:v}=l9({hasFill:n,variant:r,isLoading:o,size:i,fullWidth:a,align:l,onlyOneIcon:u,className:h}),d=()=>typeof f=="string"?E.jsx("span",{className:o?"invisible":"",children:f}):f;return E.jsxs("button",{ref:t,type:c,className:v(),disabled:s||o,onClick:p,children:[o&&E.jsx("span",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center",children:E.jsx(cu,{size:"xs"})}),d()]})});Qe.AsyncCreatableSelect=ew,Qe.AsyncSelect=QI,Qe.Avatar=Ql,Qe.Badge=Sg,Qe.Button=Ra,Qe.CardHistory=ZK,Qe.CardSelect=HK,Qe.CardSimple=zK,Qe.CheckBoxTable=t9,Qe.Checkbox=Mf,Qe.DateInputPicker=Zq,Qe.DropdownButton=F6,Qe.DropdownFilterMultiple=Xq,Qe.DropdownSearchMultiple=Uq,Qe.DropdownSummary=Wq,Qe.DropdownUser=_q,Qe.EmptyState=s5,Qe.Field=E6,Qe.Flag=Nq,Qe.Graphic=hq,Qe.Header=ow,Qe.Heading=Ci,Qe.Icon=ft,Qe.InlineError=ud,Qe.LayoutMain=R1,Qe.LayoutSecondMain=n9,Qe.LayoutShipment=fg,Qe.Link=f9,Qe.Logo=ua,Qe.Modal=nw,Qe.Navigation=WK,Qe.NavigationMovil=sw,Qe.Radio=Th,Qe.Select=DI,Qe.SelectButton=HI,Qe.SelectCountry=UI,Qe.Spinner=cu,Qe.Summary=I1,Qe.Switch=mb,Qe.Tab=tw,Qe.TabNav=aw,Qe.Table=GK,Qe.Text=Me,Qe.TextRef=ea,Qe.Tooltip=Pf,Qe.Tracker=tC,Object.defineProperty(Qe,Symbol.toStringTag,{value:"Module"})});
|