sodtrack-web-ui 0.74.0 → 0.74.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.
- package/dist/{chunk-7DZXTSLA.mjs → chunk-ERR4CIFD.mjs} +1 -1
- package/dist/{chunk-D4T5LV6D.mjs → chunk-FERU7XG4.mjs} +1 -1
- package/dist/chunk-IWQYO3WW.mjs +1 -0
- package/dist/{chunk-KRU7R6C4.mjs → chunk-MLBV4ETD.mjs} +1 -1
- package/dist/{chunk-DLRA36N6.mjs → chunk-MNT76J6I.mjs} +1 -1
- package/dist/{chunk-LBSJRMFG.mjs → chunk-RT5WTNLQ.mjs} +1 -1
- package/dist/components/accordion-form.mjs +1 -1
- package/dist/components/accordion.mjs +1 -1
- package/dist/components/data-table.mjs +1 -1
- package/dist/components/expandable-card.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/components/list-item-arrow.mjs +1 -1
- package/dist/components/list-item-button.mjs +1 -1
- package/dist/components/list-item-checkbox-left.mjs +1 -1
- package/dist/components/list-item-checkbox.mjs +1 -1
- package/dist/components/list-item.mjs +1 -1
- package/dist/components/tab.mjs +1 -1
- package/dist/components/time-picker-new.js +1 -1
- package/dist/components/time-picker-new.mjs +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-JVONWEEA.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-FAMLJ6AJ.mjs';import {
|
|
1
|
+
import {d}from'./chunk-FAMLJ6AJ.mjs';import {g}from'./chunk-4HYLZVI5.mjs';import {a as a$1}from'./chunk-SXEHG5TZ.mjs';import {a}from'./chunk-BO6XI5BE.mjs';import*as c from'react';import*as e from'@radix-ui/react-accordion';export{e as a };import {jsx,jsxs}from'react/jsx-runtime';var S=["sm","md"],k=c.forwardRef(({className:i,children:r,size:o="md",hasBorder:a$1=false,...s},m)=>jsx(e.Root,{"data-border":a$1,"data-size":o,className:a("group/root space-y-2",i),...s,ref:m,children:r})),y=c.forwardRef(({className:i,...r},o)=>jsx(e.Item,{ref:o,className:a("rounded-lg bg-neutral-50","group-data-[border=true]/root:ring-1 group-data-[border=true]/root:ring-neutral-200 group-data-[border=true]/root:ring-inset",i),...r}));y.displayName="AccordionItem";var P=c.forwardRef(({className:i,children:r,...o},a$1)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{ref:a$1,className:a("group flex flex-1 items-center justify-between p-4 transition-all [&[data-state=open]>svg]:rotate-180",i),...o,children:[r,jsx(g,{className:"h-6 w-6 shrink-0 transition-transform duration-200 group-disabled:text-neutral-500"})]})}));P.displayName=e.Trigger.displayName;var x=c.forwardRef(({className:i,title:r,description:o,onEndButtonClick:a$2,StartIcon:s,EndIcon:m,children:N,badgeNumber:g$1,chipStatus:p,...v},A)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{title:r,ref:A,className:a("group hover:not-disabled:bg-primary-100 flex flex-1 items-center justify-between gap-3 rounded-lg p-2 pl-3 transition-all [&[data-state=open]>div>.chevron-icon]:rotate-180",a(!o&&"min-h-12",o&&"group-data-[size=md]/root:min-h-15.75 group-data-[size=sm]/root:min-h-12"),i),...v,children:[jsxs("div",{className:"flex",children:[s&&jsx(s,{className:"mr-2 h-4.5 w-4.5 text-neutral-900 group-disabled:text-neutral-500 group-data-[size=md]/root:h-4.5 group-data-[size=md]/root:w-4.5 group-data-[size=sm]:h-3.5 group-data-[size=sm]/root:w-3.5"}),jsxs("div",{children:[jsx("p",{className:"text-left text-base leading-[125%]! font-semibold text-neutral-900 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-sm",children:r}),jsx("p",{className:"text-left text-sm leading-[130%] font-normal tracking-[0.28px] text-neutral-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-xs",children:o})]})]}),jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[p&&jsx(d,{variant:p.variant,type:p.type,size:"xs",className:"shrink-0",children:p.text}),g$1?.toString()&&jsx(a$1,{variant:"alert",size:"md",content:g$1.toString()}),m&&jsx(m,{className:"m-1.75 text-neutral-900 group-disabled:text-neutral-500",size:18,onClick:R=>{R.stopPropagation(),a$2?.();}}),jsx(g,{className:"chevron-icon h-4.5 w-4.5 shrink-0 transition-transform duration-200 group-disabled:text-neutral-500"})]})]})}));x.displayName=e.Trigger.displayName;var h=c.forwardRef(({className:i,children:r,...o},a$1)=>jsx(e.Content,{ref:a$1,className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",...o,children:jsx("div",{className:a("pr-2 pl-3 group-data-[size=md]/root:py-4 group-data-[size=sm]/root:py-2",i),children:r})}));h.displayName=e.Content.displayName;export{S as b,k as c,y as d,P as e,x as f,h as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-FAMLJ6AJ.mjs';import {
|
|
1
|
+
import {d}from'./chunk-FAMLJ6AJ.mjs';import {g}from'./chunk-4HYLZVI5.mjs';import {a as a$1}from'./chunk-SXEHG5TZ.mjs';import {a}from'./chunk-BO6XI5BE.mjs';import*as n from'react';import*as e from'@radix-ui/react-accordion';import {jsx,jsxs}from'react/jsx-runtime';var b=["sm","md"],w=n.forwardRef(({className:i,children:o,size:r="md",...a$1},d)=>jsx(e.Root,{"data-size":r,className:a("group/root space-y-2",i),...a$1,ref:d,children:o})),y=n.forwardRef(({className:i,...o},r)=>jsx(e.Item,{ref:r,className:i,...o}));y.displayName="AccordionFormItem";var R=n.forwardRef(({className:i,title:o,onEndButtonClick:r,StartIcon:a$2,children:d$1,badgeNumber:p,chipStatus:c,...g$1},u)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{title:o,ref:u,className:a("group flex h-8 items-center gap-4 [&[data-state=open]>div>.chevron-icon]:rotate-180",i),...g$1,children:[jsxs("div",{className:"group flex items-center",children:[a$2&&jsx(a$2,{className:"mr-2 h-4.5 w-4.5 shrink-0 text-primary-500 transition-colors group-enabled:group-hover:text-primary-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:h-3.5 group-data-[size=sm]/root:w-3.5"}),jsx("div",{children:jsx("p",{className:"line-clamp-1 text-left text-base font-semibold leading-[130%]! text-primary-500 transition-colors group-enabled:group-hover:text-primary-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-sm",children:o})})]}),jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c&&jsx(d,{variant:c.variant,type:c.type,size:"xs",className:"shrink-0",children:c.text}),p?.toString()&&jsx(a$1,{variant:"alert",size:"md",content:p.toString()}),jsx(g,{className:"chevron-icon h-4.5 w-4.5 shrink-0 text-primary-500 transition-transform group-enabled:group-hover:text-primary-700 group-disabled:text-neutral-500"})]})]})}));R.displayName=e.Trigger.displayName;var A=n.forwardRef(({className:i,children:o,...r},a)=>jsx(e.Content,{ref:a,className:"overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:jsx("div",{className:i,children:o})}));A.displayName=e.Content.displayName;export{b as a,w as b,y as c,R as d,A as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-PF2FHSIC.mjs';import {q,d,v}from'./chunk-4HYLZVI5.mjs';import {a}from'./chunk-BO6XI5BE.mjs';import {Portal}from'@ark-ui/react/portal';import {createListCollection,Select}from'@ark-ui/react/select';import {forwardRef,useMemo,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=["00:00","00:30","01:00","01:30","02:00","02:30","03:00","03:30","04:00","04:30","05:00","05:30","06:00","06:30","07:00","07:30","08:00","08:30","09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00","17:30","18:00","18:30","19:00","19:30","20:00","20:30","21:00","21:30","22:00","22:30","23:00","23:30"],D="00:00",K=forwardRef((r,N)=>{let{className:y,label:s,required:w,tooltip:d$1,error:u,isItemDisabled:c,value:g,helperText:C,placeholder:v$1=D,onValueChange:m,defaultValue:p,...S}=r,o=Object.getOwnPropertyNames(r),f=useMemo(()=>createListCollection({items:z,isItemDisabled:c}),[c]),T=useCallback(l=>{m?.(l.value.at(0)??null);},[m]);if(o.includes("defaultValue")&&o.includes("value"))throw new Error("Cannot set both defaultValue and value props on TimePickerNew. Use one or the other.");return jsxs(Select.Root,{ref:N,"data-error":u,collection:f,className:a("group flex flex-col gap-2",y),positioning:{placement:"bottom-end"},onValueChange:T,value:o.includes("value")?g?[g]:[]:void 0,defaultValue:p?[p]:void 0,...S,children:[jsxs(Select.Label,{className:"font-inter flex items-center text-xs leading-[133.33%] font-medium text-neutral-700 data-[disabled]:text-neutral-400",children:[w?jsxs("span",{className:"flex items-center gap-1",children:[jsx("span",{className:"text-red-500",children:"*"}),s]}):s,d$1&&jsx(b,{content:d$1,size:"sm",className:"ml-2",children:jsx(q,{className:"size-3.5"})})]}),jsx(Select.Control,{className:a("group/control data-[focus]:ring-primary-800 group-data-[error=true]:ring-error-500 relative flex h-10 w-full justify-between overflow-hidden rounded-lg bg-neutral-50 ring ring-neutral-500 transition-shadow group-data-[error=true]:ring-2 group-data-[readonly]:bg-neutral-100 group-data-[readonly]:ring-neutral-300 has-focus:ring-2 data-[disabled]:ring-neutral-400",r.readOnly&&"pointer-events-none"),children:jsxs(Select.Trigger,{className:"flex w-full cursor-pointer items-center gap-1 text-neutral-900 group-data-[disabled]/control:text-neutral-400 disabled:cursor-not-allowed data-[placeholder-shown]:text-neutral-500",children:[jsx(Select.ValueText,{className:a("font-inter min-w-0 flex-1 py-2.5 pl-3 text-left text-sm",r.readOnly&&"pointer-events-none"),placeholder:v$1}),!r.readOnly&&jsx(Select.ClearTrigger,{className:a("z-10 cursor-pointer",r.readOnly&&"pointer-events-none"),tabIndex:r.readOnly?-1:void 0,children:jsx(d,{className:"size-4.5 text-neutral-700"})}),u&&jsx(q,{className:"text-error-500 z-10 size-4.5 cursor-pointer"}),jsx(Select.Indicator,{className:a("group-data-[focus]/control:ring-primary-800 group-data-[error=true]:ring-error-500 ml-2 flex h-full w-10 shrink-0 items-center justify-center bg-neutral-100 text-neutral-700 ring ring-neutral-500 transition-shadow group-data-[disabled]/control:text-neutral-400 group-data-[disabled]/control:ring-neutral-400 group-data-[error=true]:ring-2 group-data-[focus]/control:ring-2 group-data-[readonly]:text-neutral-400 group-data-[readonly]:ring-neutral-300",r.readOnly&&"pointer-events-none"),tabIndex:r.readOnly?-1:void 0,children:jsx(v,{className:"size-4.5"})})]})}),jsx("p",{className:"font-inter text-2xs group-data-[error=true]:text-error-500 -mt-1 leading-[133.33%] font-normal text-neutral-700 peer-data-[disabled]:text-neutral-400 empty:hidden",children:C}),jsx(Portal,{children:jsx(Select.Positioner,{className:"!z-10000",children:jsx(Select.Content,{className:"elevation-9 max-h-67.5 min-w-27.5 overflow-auto rounded-lg bg-neutral-50",children:f.items.map(l=>jsx(Select.Item,{item:l,className:"font-inter data-[highlighted]:bg-primary-100 cursor-pointer py-3 pr-2.5 pl-3 text-sm font-medium data-[disabled]:cursor-not-allowed data-[disabled]:text-neutral-400",children:jsx(Select.ItemText,{children:l})},l))})})}),jsx(Select.HiddenSelect,{})]})});export{K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-35JUETHD.mjs';import {d}from'./chunk-FAMLJ6AJ.mjs';import {
|
|
1
|
+
import {c}from'./chunk-35JUETHD.mjs';import {d}from'./chunk-FAMLJ6AJ.mjs';import {c as c$1}from'./chunk-KKWH3QUT.mjs';import {b}from'./chunk-PF2FHSIC.mjs';import {s,t}from'./chunk-4HYLZVI5.mjs';import {createElement,useCallback}from'react';import {tv}from'tailwind-variants';import {useCollapsibleContext,Collapsible}from'@ark-ui/react/collapsible';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var i=tv({slots:{root:"bg-neutral-80 ring-expandable-card-border group flex flex-col rounded-lg ring transition-all duration-200 ease-in-out ring-inset",header:"flex items-center justify-between gap-3 pt-3 pr-1 pb-2 pl-3",headerLabel:"font-semibold empty:hidden",headerValue:"",content:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up border-expandable-card-border overflow-hidden group-data-[state=open]:border-t",contentInner:"px-3 pt-4 pb-6",fixedContent:"border-expandable-card-border border-t px-3 pt-6 pb-4"},variants:{headerAlign:{vertical:{},horizontal:{}}},compoundVariants:[{headerAlign:"vertical",className:{headerValue:"text-xs leading-[130%] text-neutral-700"}},{headerAlign:"horizontal",className:{headerValue:"flex gap-3 text-base leading-[130%] text-neutral-900"}}]}),j=({headerLabel:a,headerValue:t$1,className:r,action:o,chipStatus:s$1,iconButtons:p,headerAlign:n="horizontal",...v})=>{let{header:f,headerLabel:m,headerValue:b$1}=i({headerAlign:n}),E=useCollapsibleContext();return jsxs("div",{...v,className:f({className:r}),children:[jsxs(Fragment,{children:[n==="horizontal"&&jsxs("p",{className:b$1(),children:[jsx("span",{className:m(),children:a}),t$1]}),n==="vertical"&&jsxs("div",{className:"flex flex-col gap-1",children:[jsx("p",{className:m(),children:a}),jsx("p",{className:b$1(),children:t$1})]})]}),jsxs("div",{className:"flex items-center gap-2",children:[s$1&&jsx(d,{...s$1,size:"xs",type:"light"}),p?.map((H,T)=>createElement(c,{...H,key:T,variant:"standard",size:"xs"})),o&&jsx(b,{size:"sm",content:o.tooltipContent,disabled:!o.tooltipContent,children:jsx(c$1,{...o,size:"xs",variant:"standard"})}),jsx(Collapsible.Trigger,{asChild:true,children:jsx(c,{Icon:E.open?s:t,variant:"standard",size:"xs"})})]})]})},q=({className:a,...t})=>{let{contentInner:r,content:o}=i();return jsx(Collapsible.Content,{className:o(),children:jsx("div",{...t,className:r({className:a})})})},G=({className:a,...t})=>{let{fixedContent:r}=i();return jsx("div",{...t,className:r({className:a})})},J=({className:a,onOpenChange:t,children:r,...o})=>{let{root:s}=i(),p=useCallback(n=>{t?.(n);},[t]);return jsx(Collapsible.Root,{onOpenChange:p,className:s({className:a}),...o,children:r})};export{j as a,q as b,G as c,J as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {d}from'./chunk-4HYLZVI5.mjs';import {a as a$1}from'./chunk-SXEHG5TZ.mjs';import {a}from'./chunk-BO6XI5BE.mjs';import*as e from'@radix-ui/react-tabs';import o from'react';import {cva}from'cva';import {jsx,jsxs}from'react/jsx-runtime';var k=["ghost","fill","fillWithCloseButton"],D=["sm","md"],y=cva({base:"group relative shrink-0 px-4 leading-[130%] text-neutral-900 transition-all disabled:text-neutral-500",variants:{variant:{ghost:"not-disabled:hover:bg-primary-100 rounded-sm font-semibold",fill:"[&:not(:disabled)]:aria-selected:elevation-10 not-disabled:hover:border-primary-300 not-disabled:hover:text-primary-700 not-disabled:aria-selected:text-primary-500 rounded-lg rounded-b-none! border-1 border-b-0! border-transparent aria-selected:bg-neutral-50 aria-selected:font-semibold",fillWithCloseButton:"[&:not(:disabled)]:aria-selected:elevation-10 bg-primary-100 not-disabled:hover:border-primary-300 not-disabled:hover:bg-primary-100 not-disabled:hover:text-primary-700 not-disabled:aria-selected:text-primary-500 rounded-lg rounded-b-none! border-1 border-b-0! border-transparent aria-selected:font-semibold not-disabled:not-[&:hover]:aria-selected:bg-neutral-50 not-disabled:hover:aria-selected:border-transparent not-disabled:hover:aria-selected:bg-neutral-50"},size:{sm:"h-10 text-sm",md:"h-12 text-base"}}}),P=cva({base:"mr-2 flex shrink-0 transition-all ease-linear group-aria-selected:not-disabled:text-neutral-900",variants:{size:{sm:"",md:""}}}),C=cva({base:"group-aria-selected:bg-primary-500 absolute bottom-0 h-0 w-full rounded-sm transition-all group-disabled:bg-neutral-500 group-aria-selected:h-1 group-disabled:group-aria-selected:h-0",variants:{variant:{ghost:"flex",fill:"hidden",fillWithCloseButton:"hidden"}}}),R=cva({variants:{variant:{ghost:"",fill:"elevation-10 rounded-lg bg-neutral-50 pt-6 before:absolute before:right-0 before:left-0 before:h-5 before:rounded-lg before:rounded-b-none before:bg-neutral-50 before:content-['']",fillWithCloseButton:"elevation-10 rounded-lg bg-neutral-50 pt-6 before:absolute before:right-0 before:left-0 before:h-5 before:rounded-lg before:rounded-b-none before:bg-neutral-50 before:content-['']"},size:{sm:"",md:""}},compoundVariants:[{variant:"fill",size:"sm",className:"before:top-10"},{variant:"fill",size:"md",className:"before:top-12"},{variant:"fillWithCloseButton",size:"sm",className:"before:top-10"},{variant:"fillWithCloseButton",size:"md",className:"before:top-12"}]}),f=o.createContext({}),I=o.forwardRef(({className:i,size:a$1="sm",variant:t="ghost",...s},l)=>jsx(f.Provider,{value:{size:a$1,variant:t},children:jsx(e.Root,{"data-tab-variant":t,ref:l,...s,className:a(i,"relative")})})),N=o.forwardRef(({className:i,...a$1},t)=>{let{variant:s}=o.useContext(f);return jsx(e.List,{ref:t,...a$1,className:a("no-scrollbar flex max-w-full space-x-2 overflow-x-scroll",s!=="ghost"&&"px-6",i)})});N.displayName=e.List.displayName;var z=o.forwardRef(({className:i,badgeNumber:a$2,disabled:t,variant:s,StartIcon:l,onClose:T,...v},h)=>{let{size:d$1,variant:x}=o.useContext(f),n=s??x;return jsx(e.Trigger,{"data-tab-variant":n,ref:h,disabled:t,className:y({size:d$1,variant:n,className:i}),...v,children:jsxs("div",{className:"flex flex-col items-center justify-center",children:[jsxs("div",{className:"flex items-center justify-center",children:[l&&jsx(l,{className:P({size:d$1}),size:d$1==="sm"?12:14}),v.children,jsxs("div",{className:a("flex items-center gap-1 empty:hidden",n==="ghost"&&"ml-1",n==="fill"&&"ml-3",n==="fillWithCloseButton"&&"ml-3"),children:[!t&&a$2&&jsx(a$1,{variant:"alert",size:d$1==="sm"?"sm":"md",content:String(a$2)}),n==="fillWithCloseButton"&&jsx(d,{onPointerDown:p=>{p.preventDefault(),p.stopPropagation(),T?.(p);},className:"transition-colors group-aria-selected:not-disabled:text-neutral-900",size:14})]})]}),jsx("div",{className:C({variant:n})})]})})});z.displayName=e.Trigger.displayName;var W=o.forwardRef(({className:i,...a},t)=>{let{variant:s,size:l}=o.useContext(f);return jsx(e.Content,{ref:t,className:R({variant:s,size:l,className:i}),...a})});W.displayName=e.Content.displayName;export{k as a,D as b,I as c,N as d,z as e,W as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c as c$3}from'./chunk-35JUETHD.mjs';import {d}from'./chunk-KTTNV2CJ.mjs';import {a as a$5}from'./chunk-KTRSJBA4.mjs';import {a as a$4}from'./chunk-5JYXZUPM.mjs';import {c as c$2}from'./chunk-ASMH3P7K.mjs';import {d as d$1}from'./chunk-FAMLJ6AJ.mjs';import {a as a$1}from'./chunk-T2IU5QUU.mjs';import {a}from'./chunk-RE4QNXBE.mjs';import {a as a$3}from'./chunk-SXEHG5TZ.mjs';import {c}from'./chunk-KKWH3QUT.mjs';import {c as c$1,h}from'./chunk-4HYLZVI5.mjs';import {a as a$2}from'./chunk-BO6XI5BE.mjs';import be,{createContext,useMemo,useCallback,useContext,useRef,useEffect,useState,useId}from'react';import*as Oe from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var Je=be.memo(({handleSelect:e,NoResultsIcon:i,noResultsLabel:o,noResultsDescription:t,noResultsDescriptionLines:p,noResultsAsColumn:s,noResultsButtonOnClick:n,optionDescriptionLines:r,noResultsButtonLabel:l,filteredOptions:u,inputRect:c$1,inputRef:f,popoverPosition:C,optionsListRef:v,selectedOption:h,options:g,setFilteredOptions:R})=>jsx(Oe.Root,{asChild:true,children:jsxs("div",{ref:v,className:"elevation-8 pointer-events-auto fixed z-50 mb-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:c$1?{width:`${c$1.width}px`,left:c$1.left,top:C==="bottom"?`${c$1.bottom}px`:void 0,bottom:C==="top"?`${window.innerHeight-c$1.top}px`:void 0}:void 0,children:[u.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(a,{title:o,description:t,Icon:i,iconAsColumn:s,descriptionLines:p}),n&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:a=>{v.current.style.display="none",f.current.value="",R(g),n();},children:l})]})]}),u.map(a=>jsx(Ie,{title:a.label,disabled:a.disabled,description:a.description,descriptionLines:r,onClick:()=>e(a),className:a$2(h?.value===a.value&&"bg-primary-200")},a.key??a.value))]})})),we=Je;var Qe=336,jt=({options:e,defaultSelectedOption:i,onSelect:o,onClick:t,onInputChange:p,error:s,helperText:n,label:r,placeholder:l,value:u,size:c="md",optionDescriptionLines:f=1,noResultsLabel:C,noResultsIcon:v,noResultsDescription:h,noResultsDescriptionLines:g,noResultsAsColumn:R,noResultsButtonOnClick:a,noResultsButtonLabel:S,className:L,disabled:P})=>{let[m,M]=useState(i??null),O=useRef(null),d=useRef(null),[pe,ue]=useState(),[ce,N]=useState([]),[me,z]=useState("bottom"),[X,j]=useState(),U=Qe,W=useCallback(x=>{O.current.style.display="none",d.current.value=x.label,M(x),o?.(x);},[o]),w=useCallback(()=>{if(!d?.current)return;let x=d.current.getBoundingClientRect();ue(x);let k=X?X.height:U,I=window.innerHeight-x.bottom>k,ee=x.top>k;z(I?"bottom":ee?"top":"bottom");},[X?.height]),q=useCallback(()=>{let x=e.filter(k=>k.label.toLowerCase().includes(d?.current?.value.toLowerCase()??""));if(N(x),O?.current){let k=O.current.getBoundingClientRect();j(k);}},[e]);return useEffect(()=>{N(e);},[e]),useEffect(()=>{if(!u){M(null),d.current&&(d.current.value="");return}(!d.current?.value||m?.value!==u.value)&&(M(u),d.current.value=u.label);},[u]),a$5(O,()=>{O.current.style.display="none",m&&d.current&&(d.current.value=m.label);}),useEffect(()=>{if(d?.current)return w(),d.current.addEventListener("mousedown",w),d.current.addEventListener("input",q),window.addEventListener("scroll",w,true),window.addEventListener("resize",w),()=>{d.current?.removeEventListener("mousedown",w),d.current?.removeEventListener("input",q),window.removeEventListener("scroll",w,true),window.removeEventListener("resize",w);}},[w,q]),jsxs("div",{className:a$2("relative",L),children:[jsx(a$4,{ref:d,autoComplete:"off",list:"",selectMode:true,onChange:x=>{x.target.value||(M(null),o?.(null)),p?.(x);},onClean:()=>{M(null),N(e),o?.(null);},onClick:x=>{O.current.style.display="flex",t?.(x);},onBlur:()=>{m&&d.current&&(d.current.value=m.label);},label:r,helperText:n,placeholder:l,size:c,error:s,disabled:P}),jsx(we,{handleSelect:W,noResultsLabel:C,NoResultsIcon:v,optionDescriptionLines:f,noResultsAsColumn:R,noResultsButtonLabel:S,noResultsButtonOnClick:a,noResultsDescription:h,noResultsDescriptionLines:g,filteredOptions:ce,inputRect:pe,inputRef:d,popoverPosition:me,optionsListRef:O,selectedOption:m,options:e,setFilteredOptions:N})]})};var Ze=({children:e,title:i,titleLines:o,description:t="",descriptionLines:p,disabled:s=false,className:n,...r})=>jsxs("div",{className:"flex w-full flex-col gap-1",...r,children:[jsx("p",{className:a$2("break-all text-sm leading-[130%]",!!t&&"font-medium"),style:o?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o}:void 0,children:i}),t&&jsx("p",{className:a$2("text-xs leading-[130%]",s?"text-neutral-400":"text-neutral-700"),style:p?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:p}:void 0,children:t})]}),D=Ze;var mo=({children:e,title:i,titleLines:o,description:t="",descriptionLines:p,startIcon:s,badgeContent:n,hasDivider:r=false,disabled:l=false,onSelect:u,className:c,...f})=>jsxs(y,{hasDescription:!!t,disabled:l,onClick:u,hasDivider:r,className:a$2(!l&&"cursor-pointer",c),...f,children:[s&&be.cloneElement(s,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:l}),jsxs("div",{className:"ml-4 flex gap-2",children:[n&&jsx(a$3,{content:n,size:"lg",variant:"alert",className:a$2("self-center",l&&"bg-neutral-400")}),jsx(h,{className:"h-4.5 w-4.5 self-center"})]})]});var Fe=({children:e,title:i,titleLines:o=1,description:t="",descriptionLines:p,startIcon:s,hasDivider:n=false,disabled:r=false,checked:l,onCheckedChange:u,className:c,...f})=>jsxs(y,{hasDescription:!!t,disabled:r,hasDivider:n,...f,className:a$2("pr-6",c),children:[s&&be.cloneElement(s,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:r}),jsx(c$2,{size:"sm",checked:l,onCheckedChange:u,className:"ml-4 self-center",disabled:r})]});var T=336,He=createContext({inputRef:null,optionsListRef:null,autocompleteId:"",inputRect:void 0,showChips:false,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:T,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),F=()=>{let e=useContext(He);if(e===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return e},Se=({children:e})=>{let i=useRef(null),o=useRef(null),t=useId(),[p,s]=useState(),[n,r]=useState(true),[l,u]=useState([]),[c,f]=useState(-1),[C,v]=useState("bottom"),[h,g]=useState(),[R,a]=useState(T);return jsx(He.Provider,{value:{optionsListRef:i,inputRef:o,autocompleteId:t,inputRect:p,showChips:n,filteredOptions:l,currentFocus:c,popoverPosition:C,setFilteredOptions:u,setCurrentFocus:f,setShowChips:r,setPopoverPosition:v,setInputRect:s,optionsListHeight:R,optionsListRect:h,setOptionsListRect:g,setOptionsListHeight:a},children:e})};var ut=({option:e,onMountWidth:i,size:o})=>{let t=useRef(null);return useEffect(()=>{t.current&&i?.(t.current.clientWidth);},[]),jsx(d,{type:"fill",variant:"standard",ref:t,className:"shrink-0",size:o==="md"?"xs":"sm",hasCloseIcon:false,children:e.label})},Be=ut;var dt=150,ft=be.memo(({selectedOptions:e,error:i,onCleanSelectedOptions:o,disabled:t,size:p})=>{let{autocompleteId:s,inputRect:n,inputRef:r,optionsListRef:l}=F(),u=be.useRef(null),[c,f]=be.useState(new Map),C=useMemo(()=>{if(!n?.width)return [];let h=0,g=n.width-dt,R=0;for(let a=0;a<e.length&&(R+=c.get(a)??0,!(R>g));a++)h++;return e.slice(0,h)},[n?.width,e,c]),v=useCallback(()=>{t||(r?.current?.focus(),l.current.style.display="flex");},[t]);return jsxs("div",{onClick:v,className:a$2("absolute top-0 z-30 flex w-full cursor-pointer flex-nowrap items-center gap-2 pl-3 pr-12",t&&"cursor-not-allowed"),style:{maxWidth:n?.width?n?.width:void 0,height:n?.height?n?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:u,children:C.map((h,g)=>jsx(Be,{option:h,onMountWidth:R=>f(a=>new Map(a).set(g,R)),size:p},`chip-input-${s}-${h.value}`))}),e.length>C.length&&jsx("span",{className:"text-base",children:"..."}),e.length>0&&!i&&jsx(a$3,{content:String(e.length),size:p}),i&&e.length>0&&jsx(c$1,{className:"h-6 w-6 text-error-700",onClick:h=>{h.stopPropagation(),o();}})]})}),Ne=ft;var Lt=be.memo(({option:e,index:i,onPressOption:o,isSelected:t,optionDescriptionLines:p})=>{let{currentFocus:s,inputRef:n}=F();return jsx(Fe,{title:e.label,checked:t,disabled:e.disabled,className:s===i?"bg-primary-200":void 0,onMouseDown:r=>{e.disabled||(n?.current?.value&&r.preventDefault(),o?.(e,r));},description:e.description,descriptionLines:p})}),Le=Lt;var gt=be.memo(({selectedOptions:e,handleSelect:i,NoResultsIcon:o,noResultsLabel:t,noResultsDescription:p,noResultsDescriptionLines:s,noResultsAsColumn:n,noResultsButtonOnClick:r,optionDescriptionLines:l,noResultsButtonLabel:u})=>{let{popoverPosition:c$1,optionsListRef:f,filteredOptions:C,inputRect:v,autocompleteId:h,inputRef:g,optionsListHeight:R}=F(),a$2=useCallback(L=>e.some(P=>P.value===L.value),[e]),S=useMemo(()=>e.filter(L=>L.label.toLowerCase().includes(g?.current?.value.toLowerCase()??"")),[e,g?.current?.value]);return jsx(Oe.Root,{asChild:true,children:jsxs("div",{ref:f,className:"elevation-8 pointer-events-auto fixed z-50 mb-2 hidden w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:v?{width:`${v.width}px`,left:v.left,top:c$1==="bottom"?`${v.bottom}px`:void 0,bottom:c$1==="top"?`${window.innerHeight-v.top}px`:void 0,maxHeight:R+"px"}:void 0,children:[C.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(a,{title:t,description:p,Icon:o,iconAsColumn:n,descriptionLines:s}),r&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:L=>{f.current.style.display="none",g.current.value="",r();},children:u})]})]}),S.map((L,P)=>jsx(Le,{option:L,index:P,onPressOption:m=>i(m),isSelected:a$2(L),optionDescriptionLines:l},`autocomplete-option-${h}-${L.key??L.value}`)),C.map((L,P)=>!e.some(m=>m.value===L.value)&&jsx(Le,{option:L,index:P,onPressOption:m=>i(m),isSelected:a$2(L),optionDescriptionLines:l},`autocomplete-option-${h}-${L.key??L.value}`))]})})}),We=gt;var Ot=be.memo(({selectedOptions:e,onSelect:i,error:o,helperText:t,label:p,placeholder:s,options:n,onInputChange:r,size:l,disabled:u})=>{let{setCurrentFocus:c,setFilteredOptions:f,optionsListRef:C,inputRef:v}=F();return jsx(a$4,{ref:v,autoComplete:"off",list:"",disabled:u,selectMode:true,onChange:h=>{c(-1),r?.(h.target.value);},onClean:()=>{c(-1),f(n),i?.(null,e);},onClick:()=>{u||(C.current.style.display="flex");},error:o,helperText:t,label:p,placeholder:s,fixedTopLabel:e.length>0,size:l})}),Ve=Ot;var $e=({options:e,defaultSelectedOptions:i,onSelect:o,error:t,helperText:p,label:s,placeholder:n,noResultsLabel:r,noResultsIcon:l,noResultsDescription:u,noResultsDescriptionLines:c,noResultsAsColumn:f,noResultsButtonOnClick:C,noResultsButtonLabel:v,className:h,onInputChange:g,value:R,loading:a,size:S="md",optionDescriptionLines:L=1,disabled:P})=>{let{inputRef:m,optionsListRef:M,setFilteredOptions:O,setShowChips:d,setInputRect:pe,setPopoverPosition:ue,setCurrentFocus:ce,showChips:N,setOptionsListRect:me,optionsListRect:z,setOptionsListHeight:X}=F(),j=useRef(false),[U,W]=useState(i??[]),w=useCallback(A=>{W(E=>{let H,J=E.findIndex(Ue=>Ue.value===A.value);return J===-1?(H=E.concat(A),o?.(A,H),H):(H=E.toSpliced(J,1),o?.(A,H),H)});},[o]),q=useCallback(()=>{W([]),O(e),o?.(null,[]);},[]),x=useCallback(()=>{d(false);},[]),k=useCallback(()=>{d(true);},[]),I=useCallback(()=>{if(!m?.current)return;let A=m.current.getBoundingClientRect();pe(A);let E=z?z.height>T?T:z.height:T,H=window.innerHeight-A.bottom>E,J=A.top>E;ue(H?"bottom":J?"top":"bottom"),X(J?T:window.innerHeight-A.bottom>T?T:window.innerHeight-A.bottom);},[z?.height]),ee=useCallback(()=>{let A=e.filter(E=>E.label.toLowerCase().includes(m?.current?.value.toLowerCase()??""));if(O(A),M?.current){let E=M.current.getBoundingClientRect();me(E);}},[e,M?.current]);return useEffect(()=>{O(e);},[e]),a$5(M,()=>{M.current.style.display="none",ce(-1);}),useEffect(()=>{if(m?.current)return I(),m.current.addEventListener("mousedown",I),m.current.addEventListener("input",ee),m.current.addEventListener("focusin",x),m.current.addEventListener("focusout",k),window.addEventListener("scroll",I,true),window.addEventListener("resize",I),()=>{m.current?.removeEventListener("mousedown",I),m.current?.removeEventListener("input",I),m.current?.removeEventListener("focusout",k),m.current?.removeEventListener("focusin",x),window.removeEventListener("scroll",I,true),window.removeEventListener("resize",I);}},[I,k,x,ee]),useEffect(()=>{R&&(W(R),d(true));},[R]),useEffect(()=>{a||i&&i.length&&!j.current&&(W(i),j.current=true,d(true));},[i,a]),jsxs("div",{className:a$2("relative",h),children:[jsx(Ve,{selectedOptions:U,onSelect:o,error:t,helperText:p,label:s,placeholder:n,handleSelect:w,options:e,onInputChange:g,size:S,disabled:P}),N&&jsx(Ne,{selectedOptions:U,disabled:P,error:t,onCleanSelectedOptions:q,size:S}),jsx(We,{handleSelect:w,selectedOptions:U,noResultsLabel:r,NoResultsIcon:l,optionDescriptionLines:L,noResultsAsColumn:f,noResultsButtonLabel:v,noResultsButtonOnClick:C,noResultsDescription:u,noResultsDescriptionLines:c})]})};var wi=e=>jsx(Se,{children:jsx($e,{...e})});var Hi=({children:e,title:i,titleLines:o=1,description:t,descriptionLines:p=1,StartIcon:s,hasDivider:n=false,disabled:r=false,actionButton:l,isSelected:u=false,className:c$1,...f})=>jsxs(y,{hasDescription:!!t,disabled:r,hasDivider:n,isSelected:u,...f,className:c$1,children:[s&&jsx(s,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:r}),l&&jsx(Fragment,{children:l.isIcon?jsx(c$3,{...l,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:r??l.disabled}):jsx(c,{...l,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:r??l.disabled})})]});var Xi=({title:e,titleLines:i=1,description:o="",descriptionLines:t,hasDivider:p=false,disabled:s=false,checked:n,onCheckedChange:r,className:l,chipStatus:u,...c})=>jsxs(y,{hasDescription:!!o,disabled:s,hasDivider:p,...c,className:a$2("pr-6",l),children:[jsx(c$2,{size:"sm",checked:n,onCheckedChange:r,className:"mr-4 self-center",disabled:s}),jsx(D,{title:e,titleLines:i,description:o,descriptionLines:t,disabled:s}),u&&jsx("div",{className:"flex shrink-0 items-center gap-1 ml-4",children:jsx(d$1,{...u,size:"xs",className:"shrink-0"})})]});var Ft=({children:e,hasDescription:i=false,disabled:o=false,hasDivider:t=false,className:p,isSelected:s,onClick:n,...r})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("flex flex-row px-3 py-4 text-neutral-900 transition-colors",i?"py-3":"py-3.5",o?"cursor-not-allowed text-neutral-400":"hover:bg-primary-100 focus:bg-primary-200",s&&"bg-primary-200",p),onClick:l=>{o||n?.(l);},...r,children:e}),t&&jsx(a$1,{})]}),y=Ft;var Ie=({children:e,title:i,titleLines:o,description:t="",descriptionLines:p,startIcon:s,endIcon:n,hasDivider:r=false,disabled:l=false,isSelected:u=false,className:c,...f})=>jsxs(y,{hasDescription:!!t,disabled:l,hasDivider:r,className:c,isSelected:u,...f,children:[s&&be.cloneElement(s,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:l}),n&&be.cloneElement(n,{className:"min-h-4.5 min-w-4.5 self-center ml-4"})]});export{jt as a,Ie as b,mo as c,Fe as d,wi as e,Hi as f,Xi as g};
|
|
1
|
+
import {c as c$3}from'./chunk-35JUETHD.mjs';import {d}from'./chunk-KTTNV2CJ.mjs';import {a as a$5}from'./chunk-KTRSJBA4.mjs';import {a as a$4}from'./chunk-5JYXZUPM.mjs';import {c as c$2}from'./chunk-ASMH3P7K.mjs';import {d as d$1}from'./chunk-FAMLJ6AJ.mjs';import {a as a$1}from'./chunk-T2IU5QUU.mjs';import {c}from'./chunk-KKWH3QUT.mjs';import {a}from'./chunk-RE4QNXBE.mjs';import {c as c$1,h}from'./chunk-4HYLZVI5.mjs';import {a as a$3}from'./chunk-SXEHG5TZ.mjs';import {a as a$2}from'./chunk-BO6XI5BE.mjs';import be,{createContext,useMemo,useCallback,useContext,useRef,useEffect,useState,useId}from'react';import*as Oe from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var Je=be.memo(({handleSelect:e,NoResultsIcon:i,noResultsLabel:o,noResultsDescription:t,noResultsDescriptionLines:p,noResultsAsColumn:s,noResultsButtonOnClick:n,optionDescriptionLines:r,noResultsButtonLabel:l,filteredOptions:u,inputRect:c$1,inputRef:f,popoverPosition:C,optionsListRef:v,selectedOption:h,options:g,setFilteredOptions:R})=>jsx(Oe.Root,{asChild:true,children:jsxs("div",{ref:v,className:"elevation-8 pointer-events-auto fixed z-50 mb-2 hidden max-h-[336px] w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:c$1?{width:`${c$1.width}px`,left:c$1.left,top:C==="bottom"?`${c$1.bottom}px`:void 0,bottom:C==="top"?`${window.innerHeight-c$1.top}px`:void 0}:void 0,children:[u.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(a,{title:o,description:t,Icon:i,iconAsColumn:s,descriptionLines:p}),n&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:a=>{v.current.style.display="none",f.current.value="",R(g),n();},children:l})]})]}),u.map(a=>jsx(Ie,{title:a.label,disabled:a.disabled,description:a.description,descriptionLines:r,onClick:()=>e(a),className:a$2(h?.value===a.value&&"bg-primary-200")},a.key??a.value))]})})),we=Je;var Qe=336,jt=({options:e,defaultSelectedOption:i,onSelect:o,onClick:t,onInputChange:p,error:s,helperText:n,label:r,placeholder:l,value:u,size:c="md",optionDescriptionLines:f=1,noResultsLabel:C,noResultsIcon:v,noResultsDescription:h,noResultsDescriptionLines:g,noResultsAsColumn:R,noResultsButtonOnClick:a,noResultsButtonLabel:S,className:L,disabled:P})=>{let[m,M]=useState(i??null),O=useRef(null),d=useRef(null),[pe,ue]=useState(),[ce,N]=useState([]),[me,z]=useState("bottom"),[X,j]=useState(),U=Qe,W=useCallback(x=>{O.current.style.display="none",d.current.value=x.label,M(x),o?.(x);},[o]),w=useCallback(()=>{if(!d?.current)return;let x=d.current.getBoundingClientRect();ue(x);let k=X?X.height:U,I=window.innerHeight-x.bottom>k,ee=x.top>k;z(I?"bottom":ee?"top":"bottom");},[X?.height]),q=useCallback(()=>{let x=e.filter(k=>k.label.toLowerCase().includes(d?.current?.value.toLowerCase()??""));if(N(x),O?.current){let k=O.current.getBoundingClientRect();j(k);}},[e]);return useEffect(()=>{N(e);},[e]),useEffect(()=>{if(!u){M(null),d.current&&(d.current.value="");return}(!d.current?.value||m?.value!==u.value)&&(M(u),d.current.value=u.label);},[u]),a$5(O,()=>{O.current.style.display="none",m&&d.current&&(d.current.value=m.label);}),useEffect(()=>{if(d?.current)return w(),d.current.addEventListener("mousedown",w),d.current.addEventListener("input",q),window.addEventListener("scroll",w,true),window.addEventListener("resize",w),()=>{d.current?.removeEventListener("mousedown",w),d.current?.removeEventListener("input",q),window.removeEventListener("scroll",w,true),window.removeEventListener("resize",w);}},[w,q]),jsxs("div",{className:a$2("relative",L),children:[jsx(a$4,{ref:d,autoComplete:"off",list:"",selectMode:true,onChange:x=>{x.target.value||(M(null),o?.(null)),p?.(x);},onClean:()=>{M(null),N(e),o?.(null);},onClick:x=>{O.current.style.display="flex",t?.(x);},onBlur:()=>{m&&d.current&&(d.current.value=m.label);},label:r,helperText:n,placeholder:l,size:c,error:s,disabled:P}),jsx(we,{handleSelect:W,noResultsLabel:C,NoResultsIcon:v,optionDescriptionLines:f,noResultsAsColumn:R,noResultsButtonLabel:S,noResultsButtonOnClick:a,noResultsDescription:h,noResultsDescriptionLines:g,filteredOptions:ce,inputRect:pe,inputRef:d,popoverPosition:me,optionsListRef:O,selectedOption:m,options:e,setFilteredOptions:N})]})};var Ze=({children:e,title:i,titleLines:o,description:t="",descriptionLines:p,disabled:s=false,className:n,...r})=>jsxs("div",{className:"flex w-full flex-col gap-1",...r,children:[jsx("p",{className:a$2("break-all text-sm leading-[130%]",!!t&&"font-medium"),style:o?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o}:void 0,children:i}),t&&jsx("p",{className:a$2("text-xs leading-[130%]",s?"text-neutral-400":"text-neutral-700"),style:p?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:p}:void 0,children:t})]}),D=Ze;var mo=({children:e,title:i,titleLines:o,description:t="",descriptionLines:p,startIcon:s,badgeContent:n,hasDivider:r=false,disabled:l=false,onSelect:u,className:c,...f})=>jsxs(y,{hasDescription:!!t,disabled:l,onClick:u,hasDivider:r,className:a$2(!l&&"cursor-pointer",c),...f,children:[s&&be.cloneElement(s,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:l}),jsxs("div",{className:"ml-4 flex gap-2",children:[n&&jsx(a$3,{content:n,size:"lg",variant:"alert",className:a$2("self-center",l&&"bg-neutral-400")}),jsx(h,{className:"h-4.5 w-4.5 self-center"})]})]});var Fe=({children:e,title:i,titleLines:o=1,description:t="",descriptionLines:p,startIcon:s,hasDivider:n=false,disabled:r=false,checked:l,onCheckedChange:u,className:c,...f})=>jsxs(y,{hasDescription:!!t,disabled:r,hasDivider:n,...f,className:a$2("pr-6",c),children:[s&&be.cloneElement(s,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:r}),jsx(c$2,{size:"sm",checked:l,onCheckedChange:u,className:"ml-4 self-center",disabled:r})]});var T=336,He=createContext({inputRef:null,optionsListRef:null,autocompleteId:"",inputRect:void 0,showChips:false,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:T,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),F=()=>{let e=useContext(He);if(e===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return e},Se=({children:e})=>{let i=useRef(null),o=useRef(null),t=useId(),[p,s]=useState(),[n,r]=useState(true),[l,u]=useState([]),[c,f]=useState(-1),[C,v]=useState("bottom"),[h,g]=useState(),[R,a]=useState(T);return jsx(He.Provider,{value:{optionsListRef:i,inputRef:o,autocompleteId:t,inputRect:p,showChips:n,filteredOptions:l,currentFocus:c,popoverPosition:C,setFilteredOptions:u,setCurrentFocus:f,setShowChips:r,setPopoverPosition:v,setInputRect:s,optionsListHeight:R,optionsListRect:h,setOptionsListRect:g,setOptionsListHeight:a},children:e})};var ut=({option:e,onMountWidth:i,size:o})=>{let t=useRef(null);return useEffect(()=>{t.current&&i?.(t.current.clientWidth);},[]),jsx(d,{type:"fill",variant:"standard",ref:t,className:"shrink-0",size:o==="md"?"xs":"sm",hasCloseIcon:false,children:e.label})},Be=ut;var dt=150,ft=be.memo(({selectedOptions:e,error:i,onCleanSelectedOptions:o,disabled:t,size:p})=>{let{autocompleteId:s,inputRect:n,inputRef:r,optionsListRef:l}=F(),u=be.useRef(null),[c,f]=be.useState(new Map),C=useMemo(()=>{if(!n?.width)return [];let h=0,g=n.width-dt,R=0;for(let a=0;a<e.length&&(R+=c.get(a)??0,!(R>g));a++)h++;return e.slice(0,h)},[n?.width,e,c]),v=useCallback(()=>{t||(r?.current?.focus(),l.current.style.display="flex");},[t]);return jsxs("div",{onClick:v,className:a$2("absolute top-0 z-30 flex w-full cursor-pointer flex-nowrap items-center gap-2 pl-3 pr-12",t&&"cursor-not-allowed"),style:{maxWidth:n?.width?n?.width:void 0,height:n?.height?n?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:u,children:C.map((h,g)=>jsx(Be,{option:h,onMountWidth:R=>f(a=>new Map(a).set(g,R)),size:p},`chip-input-${s}-${h.value}`))}),e.length>C.length&&jsx("span",{className:"text-base",children:"..."}),e.length>0&&!i&&jsx(a$3,{content:String(e.length),size:p}),i&&e.length>0&&jsx(c$1,{className:"h-6 w-6 text-error-700",onClick:h=>{h.stopPropagation(),o();}})]})}),Ne=ft;var Lt=be.memo(({option:e,index:i,onPressOption:o,isSelected:t,optionDescriptionLines:p})=>{let{currentFocus:s,inputRef:n}=F();return jsx(Fe,{title:e.label,checked:t,disabled:e.disabled,className:s===i?"bg-primary-200":void 0,onMouseDown:r=>{e.disabled||(n?.current?.value&&r.preventDefault(),o?.(e,r));},description:e.description,descriptionLines:p})}),Le=Lt;var gt=be.memo(({selectedOptions:e,handleSelect:i,NoResultsIcon:o,noResultsLabel:t,noResultsDescription:p,noResultsDescriptionLines:s,noResultsAsColumn:n,noResultsButtonOnClick:r,optionDescriptionLines:l,noResultsButtonLabel:u})=>{let{popoverPosition:c$1,optionsListRef:f,filteredOptions:C,inputRect:v,autocompleteId:h,inputRef:g,optionsListHeight:R}=F(),a$2=useCallback(L=>e.some(P=>P.value===L.value),[e]),S=useMemo(()=>e.filter(L=>L.label.toLowerCase().includes(g?.current?.value.toLowerCase()??"")),[e,g?.current?.value]);return jsx(Oe.Root,{asChild:true,children:jsxs("div",{ref:f,className:"elevation-8 pointer-events-auto fixed z-50 mb-2 hidden w-full flex-col overflow-y-auto rounded-lg bg-neutral-50",style:v?{width:`${v.width}px`,left:v.left,top:c$1==="bottom"?`${v.bottom}px`:void 0,bottom:c$1==="top"?`${window.innerHeight-v.top}px`:void 0,maxHeight:R+"px"}:void 0,children:[C.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(a,{title:t,description:p,Icon:o,iconAsColumn:n,descriptionLines:s}),r&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:L=>{f.current.style.display="none",g.current.value="",r();},children:u})]})]}),S.map((L,P)=>jsx(Le,{option:L,index:P,onPressOption:m=>i(m),isSelected:a$2(L),optionDescriptionLines:l},`autocomplete-option-${h}-${L.key??L.value}`)),C.map((L,P)=>!e.some(m=>m.value===L.value)&&jsx(Le,{option:L,index:P,onPressOption:m=>i(m),isSelected:a$2(L),optionDescriptionLines:l},`autocomplete-option-${h}-${L.key??L.value}`))]})})}),We=gt;var Ot=be.memo(({selectedOptions:e,onSelect:i,error:o,helperText:t,label:p,placeholder:s,options:n,onInputChange:r,size:l,disabled:u})=>{let{setCurrentFocus:c,setFilteredOptions:f,optionsListRef:C,inputRef:v}=F();return jsx(a$4,{ref:v,autoComplete:"off",list:"",disabled:u,selectMode:true,onChange:h=>{c(-1),r?.(h.target.value);},onClean:()=>{c(-1),f(n),i?.(null,e);},onClick:()=>{u||(C.current.style.display="flex");},error:o,helperText:t,label:p,placeholder:s,fixedTopLabel:e.length>0,size:l})}),Ve=Ot;var $e=({options:e,defaultSelectedOptions:i,onSelect:o,error:t,helperText:p,label:s,placeholder:n,noResultsLabel:r,noResultsIcon:l,noResultsDescription:u,noResultsDescriptionLines:c,noResultsAsColumn:f,noResultsButtonOnClick:C,noResultsButtonLabel:v,className:h,onInputChange:g,value:R,loading:a,size:S="md",optionDescriptionLines:L=1,disabled:P})=>{let{inputRef:m,optionsListRef:M,setFilteredOptions:O,setShowChips:d,setInputRect:pe,setPopoverPosition:ue,setCurrentFocus:ce,showChips:N,setOptionsListRect:me,optionsListRect:z,setOptionsListHeight:X}=F(),j=useRef(false),[U,W]=useState(i??[]),w=useCallback(A=>{W(E=>{let H,J=E.findIndex(Ue=>Ue.value===A.value);return J===-1?(H=E.concat(A),o?.(A,H),H):(H=E.toSpliced(J,1),o?.(A,H),H)});},[o]),q=useCallback(()=>{W([]),O(e),o?.(null,[]);},[]),x=useCallback(()=>{d(false);},[]),k=useCallback(()=>{d(true);},[]),I=useCallback(()=>{if(!m?.current)return;let A=m.current.getBoundingClientRect();pe(A);let E=z?z.height>T?T:z.height:T,H=window.innerHeight-A.bottom>E,J=A.top>E;ue(H?"bottom":J?"top":"bottom"),X(J?T:window.innerHeight-A.bottom>T?T:window.innerHeight-A.bottom);},[z?.height]),ee=useCallback(()=>{let A=e.filter(E=>E.label.toLowerCase().includes(m?.current?.value.toLowerCase()??""));if(O(A),M?.current){let E=M.current.getBoundingClientRect();me(E);}},[e,M?.current]);return useEffect(()=>{O(e);},[e]),a$5(M,()=>{M.current.style.display="none",ce(-1);}),useEffect(()=>{if(m?.current)return I(),m.current.addEventListener("mousedown",I),m.current.addEventListener("input",ee),m.current.addEventListener("focusin",x),m.current.addEventListener("focusout",k),window.addEventListener("scroll",I,true),window.addEventListener("resize",I),()=>{m.current?.removeEventListener("mousedown",I),m.current?.removeEventListener("input",I),m.current?.removeEventListener("focusout",k),m.current?.removeEventListener("focusin",x),window.removeEventListener("scroll",I,true),window.removeEventListener("resize",I);}},[I,k,x,ee]),useEffect(()=>{R&&(W(R),d(true));},[R]),useEffect(()=>{a||i&&i.length&&!j.current&&(W(i),j.current=true,d(true));},[i,a]),jsxs("div",{className:a$2("relative",h),children:[jsx(Ve,{selectedOptions:U,onSelect:o,error:t,helperText:p,label:s,placeholder:n,handleSelect:w,options:e,onInputChange:g,size:S,disabled:P}),N&&jsx(Ne,{selectedOptions:U,disabled:P,error:t,onCleanSelectedOptions:q,size:S}),jsx(We,{handleSelect:w,selectedOptions:U,noResultsLabel:r,NoResultsIcon:l,optionDescriptionLines:L,noResultsAsColumn:f,noResultsButtonLabel:v,noResultsButtonOnClick:C,noResultsDescription:u,noResultsDescriptionLines:c})]})};var wi=e=>jsx(Se,{children:jsx($e,{...e})});var Hi=({children:e,title:i,titleLines:o=1,description:t,descriptionLines:p=1,StartIcon:s,hasDivider:n=false,disabled:r=false,actionButton:l,isSelected:u=false,className:c$1,...f})=>jsxs(y,{hasDescription:!!t,disabled:r,hasDivider:n,isSelected:u,...f,className:c$1,children:[s&&jsx(s,{className:"mr-2 h-4.5 w-4.5 shrink-0 grow-0"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:r}),l&&jsx(Fragment,{children:l.isIcon?jsx(c$3,{...l,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:r??l.disabled}):jsx(c,{...l,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:r??l.disabled})})]});var Xi=({title:e,titleLines:i=1,description:o="",descriptionLines:t,hasDivider:p=false,disabled:s=false,checked:n,onCheckedChange:r,className:l,chipStatus:u,...c})=>jsxs(y,{hasDescription:!!o,disabled:s,hasDivider:p,...c,className:a$2("pr-6",l),children:[jsx(c$2,{size:"sm",checked:n,onCheckedChange:r,className:"mr-4 self-center",disabled:s}),jsx(D,{title:e,titleLines:i,description:o,descriptionLines:t,disabled:s}),u&&jsx("div",{className:"flex shrink-0 items-center gap-1 ml-4",children:jsx(d$1,{...u,size:"xs",className:"shrink-0"})})]});var Ft=({children:e,hasDescription:i=false,disabled:o=false,hasDivider:t=false,className:p,isSelected:s,onClick:n,...r})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("flex flex-row px-3 py-4 text-neutral-900 transition-colors",i?"py-3":"py-3.5",o?"cursor-not-allowed text-neutral-400":"hover:bg-primary-100 focus:bg-primary-200",s&&"bg-primary-200",p),onClick:l=>{o||n?.(l);},...r,children:e}),t&&jsx(a$1,{})]}),y=Ft;var Ie=({children:e,title:i,titleLines:o,description:t="",descriptionLines:p,startIcon:s,endIcon:n,hasDivider:r=false,disabled:l=false,isSelected:u=false,className:c,...f})=>jsxs(y,{hasDescription:!!t,disabled:l,hasDivider:r,className:c,isSelected:u,...f,children:[s&&be.cloneElement(s,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(D,{title:i,titleLines:o,description:t,descriptionLines:p,disabled:l}),n&&be.cloneElement(n,{className:"min-h-4.5 min-w-4.5 self-center ml-4"})]});export{jt as a,Ie as b,mo as c,Fe as d,wi as e,Hi as f,Xi as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as AccordionForm,e as AccordionFormContent,c as AccordionFormItem,a as AccordionFormSizes,d as AccordionFormTrigger}from'../chunk-
|
|
1
|
+
export{b as AccordionForm,e as AccordionFormContent,c as AccordionFormItem,a as AccordionFormSizes,d as AccordionFormTrigger}from'../chunk-FERU7XG4.mjs';import'../chunk-FAMLJ6AJ.mjs';import'../chunk-4HYLZVI5.mjs';import'../chunk-SXEHG5TZ.mjs';import'../chunk-BO6XI5BE.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as Accordion,g as AccordionContent,d as AccordionItem,a as AccordionPrimitive,b as AccordionSizes,f as AccordionTrigger,e as AccordionTriggerEmpty}from'../chunk-
|
|
1
|
+
export{c as Accordion,g as AccordionContent,d as AccordionItem,a as AccordionPrimitive,b as AccordionSizes,f as AccordionTrigger,e as AccordionTriggerEmpty}from'../chunk-ERR4CIFD.mjs';import'../chunk-FAMLJ6AJ.mjs';import'../chunk-4HYLZVI5.mjs';import'../chunk-SXEHG5TZ.mjs';import'../chunk-BO6XI5BE.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DataTable}from'../chunk-OUAQ2CF7.mjs';import'../chunk-2UWUPQW7.mjs';import'../chunk-
|
|
1
|
+
export{a as DataTable}from'../chunk-OUAQ2CF7.mjs';import'../chunk-2UWUPQW7.mjs';import'../chunk-KKWH3QUT.mjs';import'../chunk-PF2FHSIC.mjs';import'../chunk-4HYLZVI5.mjs';import'../chunk-BO6XI5BE.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as ExpandableCard,b as ExpandableCardContent,c as ExpandableCardFixedContent,a as ExpandableCardHeader}from'../chunk-
|
|
1
|
+
export{d as ExpandableCard,b as ExpandableCardContent,c as ExpandableCardFixedContent,a as ExpandableCardHeader}from'../chunk-MLBV4ETD.mjs';import'../chunk-35JUETHD.mjs';import'../chunk-FAMLJ6AJ.mjs';import'../chunk-KKWH3QUT.mjs';import'../chunk-PF2FHSIC.mjs';import'../chunk-4HYLZVI5.mjs';import'../chunk-BO6XI5BE.mjs';
|